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

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

Definition at line 18 of file FFTJetCorrector.h.

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

Definition at line 17 of file FFTJetCorrector.h.

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

Definition at line 16 of file FFTJetCorrector.h.

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

Definition at line 15 of file FFTJetCorrector.h.

Constructor & Destructor Documentation

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 20 of file FFTJetCorrector.h.

23  : adjuster_(adjuster), scalers_(scalers),
24  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

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

Definition at line 56 of file FFTJetCorrector.h.

References FFTJetCorrector< Jet, Adjustable >::app_.

56 {return app_;}
FFTJetCorrectorApp app_
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 26 of file FFTJetCorrector.h.

References FFTJetCorrector< Jet, Adjustable >::adjuster_, FFTJetCorrector< Jet, Adjustable >::app_, constexpr, DATA_ONLY, mps_fire::i, recoMuon::in, MC_ONLY, Scenarios_cff::scale, and FFTJetCorrector< Jet, Adjustable >::scalers_.

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

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

Definition at line 55 of file FFTJetCorrector.h.

References FFTJetCorrector< Jet, Adjustable >::level_.

55 {return level_;}

Member Data Documentation

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

Definition at line 59 of file FFTJetCorrector.h.

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

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

Definition at line 61 of file FFTJetCorrector.h.

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

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

Definition at line 60 of file FFTJetCorrector.h.

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