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
electrons_cff.bool
bool
Definition: electrons_cff.py:366
reco::Jet
Base class for all types of Jets.
Definition: Jet.h:20
AbsFFTSpecificScaleCalculator.h
DiDispStaMuonMonitor_cfi.pt
pt
Definition: DiDispStaMuonMonitor_cfi.py:39
L2AbsScaleCalculator
Definition: L2AbsScaleCalculator.h:11
reco::FFTJet< float >
cms::cuda::assert
assert(be >=bs)
L2AbsScaleCalculator::L2AbsScaleCalculator
L2AbsScaleCalculator(const edm::ParameterSet &ps)
Definition: L2AbsScaleCalculator.h:13
L2AbsScaleCalculator::mapFFTJet
void mapFFTJet(const reco::Jet &, const reco::FFTJet< float > &fftJet, const math::XYZTLorentzVector &current, double *buf, const unsigned dim) const override
Definition: L2AbsScaleCalculator.h:20
edm::ParameterSet
Definition: ParameterSet.h:47
reco::FFTJet::f_recoScale
Real f_recoScale() const
Definition: FFTJet.h:85
L2AbsScaleCalculator::~L2AbsScaleCalculator
~L2AbsScaleCalculator() override
Definition: L2AbsScaleCalculator.h:18
visDQMUpload.buf
buf
Definition: visDQMUpload.py:160
AbsFFTSpecificScaleCalculator
Definition: AbsFFTSpecificScaleCalculator.h:13
math::XYZTLorentzVector
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
Exception
Definition: hltDiff.cc:245
L2AbsScaleCalculator::m_takePtLog
bool m_takePtLog
Definition: L2AbsScaleCalculator.h:44
CosmicsPD_Skims.radius
radius
Definition: CosmicsPD_Skims.py:135
Exception.h
dqm-mbProfile.log
log
Definition: dqm-mbProfile.py:17
ParameterSet.h
L2AbsScaleCalculator::m_radiusFactor
double m_radiusFactor
Definition: L2AbsScaleCalculator.h:42
L2AbsScaleCalculator::m_zeroPtLog
double m_zeroPtLog
Definition: L2AbsScaleCalculator.h:43