CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Attributes
FFTJetCorrector< Jet, Adjustable > Class Template Reference

#include <FFTJetCorrector.h>

Public Types

typedef AbsFFTJetAdjuster< jet_type, adjustable_typeAbsAdjuster
 
typedef AbsFFTJetScaleCalculator< jet_type, adjustable_typeAbsScaler
 
typedef Adjustable adjustable_type
 
typedef Jet jet_type
 

Public Member Functions

FFTJetCorrectorApp app () const
 
void correct (const Jet &jet, const bool isMC, const Adjustable &in, Adjustable *out) const
 
 FFTJetCorrector (std::shared_ptr< const AbsAdjuster > adjuster, const std::vector< std::shared_ptr< const AbsScaler > > &scalers, const unsigned i_level, const FFTJetCorrectorApp a)
 
unsigned level () const
 

Private Attributes

std::shared_ptr< const AbsAdjusteradjuster_
 
FFTJetCorrectorApp app_
 
unsigned level_
 
std::vector< std::shared_ptr< const AbsScaler > > scalers_
 

Detailed Description

template<class Jet, class Adjustable>
class FFTJetCorrector< Jet, Adjustable >

Definition at line 12 of file FFTJetCorrector.h.

Member Typedef Documentation

◆ AbsAdjuster

template<class Jet , class Adjustable >
typedef AbsFFTJetAdjuster<jet_type, adjustable_type> FFTJetCorrector< Jet, Adjustable >::AbsAdjuster

Definition at line 17 of file FFTJetCorrector.h.

◆ AbsScaler

template<class Jet , class Adjustable >
typedef AbsFFTJetScaleCalculator<jet_type, adjustable_type> FFTJetCorrector< Jet, Adjustable >::AbsScaler

Definition at line 16 of file FFTJetCorrector.h.

◆ adjustable_type

template<class Jet , class Adjustable >
typedef Adjustable FFTJetCorrector< Jet, Adjustable >::adjustable_type

Definition at line 15 of file FFTJetCorrector.h.

◆ jet_type

template<class Jet , class Adjustable >
typedef Jet FFTJetCorrector< Jet, Adjustable >::jet_type

Definition at line 14 of file FFTJetCorrector.h.

Constructor & Destructor Documentation

◆ FFTJetCorrector()

template<class Jet , class Adjustable >
FFTJetCorrector< Jet, Adjustable >::FFTJetCorrector ( std::shared_ptr< const AbsAdjuster adjuster,
const std::vector< std::shared_ptr< const AbsScaler > > &  scalers,
const unsigned  i_level,
const FFTJetCorrectorApp  a 
)
inline

Definition at line 19 of file FFTJetCorrector.h.

23  : adjuster_(adjuster), scalers_(scalers), level_(i_level), app_(a) {}
std::shared_ptr< const AbsAdjuster > adjuster_
std::vector< std::shared_ptr< const AbsScaler > > scalers_
FFTJetCorrectorApp app_
double a
Definition: hdecay.h:121

Member Function Documentation

◆ app()

template<class Jet , class Adjustable >
FFTJetCorrectorApp FFTJetCorrector< Jet, Adjustable >::app ( ) const
inline

Definition at line 51 of file FFTJetCorrector.h.

References FFTJetCorrector< Jet, Adjustable >::app_.

51 { return app_; }
FFTJetCorrectorApp app_

◆ correct()

template<class Jet , class Adjustable >
void FFTJetCorrector< Jet, Adjustable >::correct ( const Jet &  jet,
const bool  isMC,
const Adjustable &  in,
Adjustable *  out 
) const
inline

Definition at line 25 of file FFTJetCorrector.h.

References FFTJetCorrector< Jet, Adjustable >::adjuster_, FFTJetCorrector< Jet, Adjustable >::app_, visDQMUpload::buf, DATA_ONLY, mps_fire::i, recoMuon::in, PV_cfg::isMC, metsig::jet, MC_ONLY, MillePedeFileConverter_cfg::out, pfClustersFromCombinedCaloHF_cfi::scale, and FFTJetCorrector< Jet, Adjustable >::scalers_.

Referenced by KalmanMuonCorrector.KalmanMuonCorrector::correct_all(), and JetReCalibrator.JetReCalibrator::correctAll().

25  {
27  // Do not need to apply this corrector. Simply copy
28  // the transient data from the input to the output.
29  *out = in;
30  else {
31  const unsigned nAdj = scalers_.size();
32  //If we only need a small buffer, use one on the stack
33  // else we will use a std::vector
34  constexpr size_t kStaticBufferSize = 10;
35  double staticBuffer[kStaticBufferSize];
36  std::vector<double> dynamicBuffer;
37  double* buf = nullptr;
38  if (nAdj <= kStaticBufferSize) {
39  buf = &(staticBuffer[0]);
40  } else {
41  dynamicBuffer.resize(nAdj);
42  buf = &(dynamicBuffer[0]);
43  }
44  for (unsigned i = 0; i < nAdj; ++i)
45  buf[i] = scalers_[i]->scale(jet, in);
46  adjuster_->adjust(jet, in, buf, nAdj, out);
47  }
48  }
std::shared_ptr< const AbsAdjuster > adjuster_
std::vector< std::shared_ptr< const AbsScaler > > scalers_
FFTJetCorrectorApp app_
dictionary isMC
Definition: PV_cfg.py:29

◆ level()

template<class Jet , class Adjustable >
unsigned FFTJetCorrector< Jet, Adjustable >::level ( ) const
inline

Definition at line 50 of file FFTJetCorrector.h.

References FFTJetCorrector< Jet, Adjustable >::level_.

50 { return level_; }

Member Data Documentation

◆ adjuster_

template<class Jet , class Adjustable >
std::shared_ptr<const AbsAdjuster> FFTJetCorrector< Jet, Adjustable >::adjuster_
private

Definition at line 54 of file FFTJetCorrector.h.

Referenced by FFTJetCorrector< Jet, Adjustable >::correct().

◆ app_

template<class Jet , class Adjustable >
FFTJetCorrectorApp FFTJetCorrector< Jet, Adjustable >::app_
private

◆ level_

template<class Jet , class Adjustable >
unsigned FFTJetCorrector< Jet, Adjustable >::level_
private

Definition at line 56 of file FFTJetCorrector.h.

Referenced by FFTJetCorrector< Jet, Adjustable >::level().

◆ scalers_

template<class Jet , class Adjustable >
std::vector<std::shared_ptr<const AbsScaler> > FFTJetCorrector< Jet, Adjustable >::scalers_
private

Definition at line 55 of file FFTJetCorrector.h.

Referenced by FFTJetCorrector< Jet, Adjustable >::correct().