CMS 3D CMS Logo

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>
12 class FFTEtaLogPtConeRadiusMapper : public AbsFFTJetScaleCalculator<MyJet, Adjustable> {
13 public:
14  inline explicit FFTEtaLogPtConeRadiusMapper(std::shared_ptr<npstat::AbsMultivariateFunctor> f)
15  : AbsFFTJetScaleCalculator<MyJet, Adjustable>(f) {}
16 
17 private:
18  inline void map(const MyJet& jet, const Adjustable& current, double* buf, const unsigned dim) const override {
19  assert(buf);
20  if (dim != 3)
21  throw cms::Exception("FFTJetBadConfig") << "In FFTEtaLogPtConeRadiusMapper::map: "
22  << "invalid table dimensionality: " << dim << std::endl;
23  buf[0] = current.vec().eta();
24  buf[1] = log(current.vec().pt());
25  buf[2] = jet.getFFTSpecific().f_recoScale();
26  }
27 };
28 
29 template <class MyJet, class Adjustable>
30 class FFTSpecificScaleCalculator : public AbsFFTJetScaleCalculator<MyJet, Adjustable> {
31 public:
32  //
33  // This class will assume the ownership of the
34  // AbsFFTSpecificScaleCalculator object provided
35  // in the constructor
36  //
37  inline FFTSpecificScaleCalculator(std::shared_ptr<npstat::AbsMultivariateFunctor> f,
39  : AbsFFTJetScaleCalculator<MyJet, Adjustable>(f), calc_(p) {
40  assert(p);
41  }
42 
43  inline ~FFTSpecificScaleCalculator() override { delete calc_; }
44 
45 private:
46  inline void map(const MyJet& jet, const Adjustable& current, double* buf, const unsigned dim) const override {
47  return calc_->mapFFTJet(jet, jet.getFFTSpecific(), current.vec(), buf, dim);
48  }
49 
51 };
52 
53 #endif // JetMETCorrections_FFTJetObjects_FFTJetScaleCalculators_h
FFTEtaLogPtConeRadiusMapper::FFTEtaLogPtConeRadiusMapper
FFTEtaLogPtConeRadiusMapper(std::shared_ptr< npstat::AbsMultivariateFunctor > f)
Definition: FFTJetScaleCalculators.h:14
AbsFFTSpecificScaleCalculator.h
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
FFTSpecificScaleCalculator::map
void map(const MyJet &jet, const Adjustable &current, double *buf, const unsigned dim) const override
Definition: FFTJetScaleCalculators.h:46
cms::cuda::assert
assert(be >=bs)
AbsFFTSpecificScaleCalculator::mapFFTJet
virtual void mapFFTJet(const reco::Jet &jet, const reco::FFTJet< float > &fftJet, const math::XYZTLorentzVector &current, double *buf, unsigned dim) const =0
FFTSpecificScaleCalculator::FFTSpecificScaleCalculator
FFTSpecificScaleCalculator(std::shared_ptr< npstat::AbsMultivariateFunctor > f, const AbsFFTSpecificScaleCalculator *p)
Definition: FFTJetScaleCalculators.h:37
FFTEtaLogPtConeRadiusMapper
Definition: FFTJetScaleCalculators.h:12
AbsFFTJetScaleCalculator.h
FFTEtaLogPtConeRadiusMapper::map
void map(const MyJet &jet, const Adjustable &current, double *buf, const unsigned dim) const override
Definition: FFTJetScaleCalculators.h:18
AbsFFTJetScaleCalculator
Definition: AbsFFTJetScaleCalculator.h:10
visDQMUpload.buf
buf
Definition: visDQMUpload.py:154
FFTSpecificScaleCalculator::calc_
const AbsFFTSpecificScaleCalculator * calc_
Definition: FFTJetScaleCalculators.h:50
FFTSpecificScaleCalculator
Definition: FFTJetScaleCalculators.h:30
FFTSpecificScaleCalculator::~FFTSpecificScaleCalculator
~FFTSpecificScaleCalculator() override
Definition: FFTJetScaleCalculators.h:43
AbsFFTSpecificScaleCalculator
Definition: AbsFFTSpecificScaleCalculator.h:13
metsig::jet
Definition: SignAlgoResolutions.h:47
Exception
Definition: hltDiff.cc:246
Exception.h
dqm-mbProfile.log
log
Definition: dqm-mbProfile.py:17