CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 {
13 public:
14  inline explicit L2AbsScaleCalculator(const edm::ParameterSet& ps)
15  : m_radiusFactor(ps.getParameter<double>("radiusFactor")),
16  m_zeroPtLog(ps.getParameter<double>("zeroPtLog")),
17  m_takePtLog(ps.getParameter<bool>("takePtLog")) {}
18 
19  inline virtual ~L2AbsScaleCalculator() {}
20 
21  inline virtual void mapFFTJet(const reco::Jet& /* jet */,
22  const reco::FFTJet<float>& fftJet,
23  const math::XYZTLorentzVector& current,
24  double* buf, const unsigned dim) const
25  {
26  if (dim != 2)
27  throw cms::Exception("FFTJetBadConfig")
28  << "In L2AbsScaleCalculator::mapFFTJet: "
29  << "invalid table dimensionality: "
30  << dim << std::endl;
31  assert(buf);
32  const double radius = fftJet.f_recoScale();
33  const double pt = current.pt();
34  buf[0] = radius*m_radiusFactor;
35  if (m_takePtLog)
36  {
37  if (pt > 0.0)
38  buf[1] = log(pt);
39  else
40  buf[1] = m_zeroPtLog;
41  }
42  else
43  buf[1] = pt;
44  }
45 
46 private:
48  double m_zeroPtLog;
50 };
51 
52 #endif // JetMETCorrections_FFTJetObjects_L2AbsScaleCalculator_h
Base class for all types of Jets.
Definition: Jet.h:20
assert(m_qm.get())
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
Real f_recoScale() const
Definition: FFTJet.h:73
L2AbsScaleCalculator(const edm::ParameterSet &ps)
virtual void mapFFTJet(const reco::Jet &, const reco::FFTJet< float > &fftJet, const math::XYZTLorentzVector &current, double *buf, const unsigned dim) const