Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:19:17

0001 #ifndef JetMETCorrections_FFTJetObjects_L2RecoScaleCalculator_h
0002 #define JetMETCorrections_FFTJetObjects_L2RecoScaleCalculator_h
0003 
0004 #include <cassert>
0005 
0006 #include "JetMETCorrections/FFTJetObjects/interface/AbsFFTSpecificScaleCalculator.h"
0007 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0008 #include "FWCore/Utilities/interface/Exception.h"
0009 
0010 class L2RecoScaleCalculator : public AbsFFTSpecificScaleCalculator {
0011 public:
0012   inline explicit L2RecoScaleCalculator(const edm::ParameterSet& ps)
0013       : m_radiusFactor(ps.getParameter<double>("radiusFactor")) {}
0014 
0015   inline ~L2RecoScaleCalculator() override {}
0016 
0017   inline void mapFFTJet(const reco::Jet& /* jet */,
0018                         const reco::FFTJet<float>& fftJet,
0019                         const math::XYZTLorentzVector& /* current */,
0020                         double* buf,
0021                         const unsigned dim) const override {
0022     if (dim != 1)
0023       throw cms::Exception("FFTJetBadConfig") << "In L2RecoScaleCalculator::mapFFTJet: "
0024                                               << "invalid table dimensionality: " << dim << std::endl;
0025     assert(buf);
0026     const double radius = fftJet.f_recoScale();
0027     buf[0] = radius * m_radiusFactor;
0028   }
0029 
0030 private:
0031   double m_radiusFactor;
0032 };
0033 
0034 #endif  // JetMETCorrections_FFTJetObjects_L2RecoScaleCalculator_h