CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
FFTJetScaleCalculators.h
Go to the documentation of this file.
1 #ifndef JetMETCorrections_FFTJetObjects_FFTJetScaleCalculators_h
2 #define JetMETCorrections_FFTJetObjects_FFTJetScaleCalculators_h
3 
4 #include <cassert>
5 #include <cmath>
6 
10 
11 template<class MyJet, class Adjustable>
13  public AbsFFTJetScaleCalculator<MyJet, Adjustable>
14 {
15 public:
16  inline explicit FFTEtaLogPtConeRadiusMapper(
17  CPP11_shared_ptr<npstat::AbsMultivariateFunctor> f)
18  : AbsFFTJetScaleCalculator<MyJet, Adjustable>(f) {}
19 
20 private:
21  inline void map(const MyJet& jet,
22  const Adjustable& current,
23  double* buf, const unsigned dim) const
24  {
25  assert(buf);
26  if (dim != 3)
27  throw cms::Exception("FFTJetBadConfig")
28  << "In FFTEtaLogPtConeRadiusMapper::map: "
29  << "invalid table dimensionality: "
30  << dim << std::endl;
31  buf[0] = current.vec().eta();
32  buf[1] = log(current.vec().pt());
33  buf[2] = jet.getFFTSpecific().f_recoScale();
34  }
35 };
36 
37 template<class MyJet, class Adjustable>
39  public AbsFFTJetScaleCalculator<MyJet, Adjustable>
40 {
41 public:
42  //
43  // This class will assume the ownership of the
44  // AbsFFTSpecificScaleCalculator object provided
45  // in the constructor
46  //
48  CPP11_shared_ptr<npstat::AbsMultivariateFunctor> f,
50  : AbsFFTJetScaleCalculator<MyJet, Adjustable>(f), calc_(p) {assert(p);}
51 
52  inline virtual ~FFTSpecificScaleCalculator() {delete calc_;}
53 
54 private:
55  inline void map(const MyJet& jet,
56  const Adjustable& current,
57  double* buf, const unsigned dim) const
58  {
59  return calc_->mapFFTJet(jet, jet.getFFTSpecific(),
60  current.vec(), buf, dim);
61  }
62 
64 };
65 
66 #endif // JetMETCorrections_FFTJetObjects_FFTJetScaleCalculators_h
FFTSpecificScaleCalculator(std::shared_ptr< npstat::AbsMultivariateFunctor > f, const AbsFFTSpecificScaleCalculator *p)
void map(const MyJet &jet, const Adjustable &current, double *buf, const unsigned dim) const
virtual void mapFFTJet(const reco::Jet &jet, const reco::FFTJet< float > &fftJet, const math::XYZTLorentzVector &current, double *buf, unsigned dim) const =0
FFTEtaLogPtConeRadiusMapper(std::shared_ptr< npstat::AbsMultivariateFunctor > f)
double f[11][100]
void map(const MyJet &jet, const Adjustable &current, double *buf, const unsigned dim) const
const AbsFFTSpecificScaleCalculator * calc_