CMS 3D CMS Logo

L2AbsScaleCalculator.h
Go to the documentation of this file.
1 #ifndef JetMETCorrections_FFTJetObjects_L2AbsScaleCalculator_h
2 #define JetMETCorrections_FFTJetObjects_L2AbsScaleCalculator_h
3 
4 #include <cmath>
5 #include <cassert>
6 
10 
12 public:
13  inline explicit L2AbsScaleCalculator(const edm::ParameterSet& ps)
14  : m_radiusFactor(ps.getParameter<double>("radiusFactor")),
15  m_zeroPtLog(ps.getParameter<double>("zeroPtLog")),
16  m_takePtLog(ps.getParameter<bool>("takePtLog")) {}
17 
18  inline ~L2AbsScaleCalculator() override {}
19 
20  inline void mapFFTJet(const reco::Jet& /* jet */,
21  const reco::FFTJet<float>& fftJet,
22  const math::XYZTLorentzVector& current,
23  double* buf,
24  const unsigned dim) const override {
25  if (dim != 2)
26  throw cms::Exception("FFTJetBadConfig") << "In L2AbsScaleCalculator::mapFFTJet: "
27  << "invalid table dimensionality: " << dim << std::endl;
28  assert(buf);
29  const double radius = fftJet.f_recoScale();
30  const double pt = current.pt();
31  buf[0] = radius * m_radiusFactor;
32  if (m_takePtLog) {
33  if (pt > 0.0)
34  buf[1] = log(pt);
35  else
36  buf[1] = m_zeroPtLog;
37  } else
38  buf[1] = pt;
39  }
40 
41 private:
43  double m_zeroPtLog;
45 };
46 
47 #endif // JetMETCorrections_FFTJetObjects_L2AbsScaleCalculator_h
Base class for all types of Jets.
Definition: Jet.h:20
void mapFFTJet(const reco::Jet &, const reco::FFTJet< float > &fftJet, const math::XYZTLorentzVector &current, double *buf, const unsigned dim) const override
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
Real f_recoScale() const
Definition: FFTJet.h:85
L2AbsScaleCalculator(const edm::ParameterSet &ps)