File indexing completed on 2024-04-06 12:09:45
0001 #ifndef CorrectJet_H
0002 #define CorrectJet_H
0003
0004 #include <string>
0005
0006 #include "FWCore/Framework/interface/EventSetup.h"
0007 #include "DataFormats/JetReco/interface/Jet.h"
0008 #include "JetMETCorrections/JetCorrector/interface/JetCorrector.h"
0009
0010
0011
0012
0013
0014
0015
0016 class CorrectJet {
0017 public:
0018 CorrectJet() {}
0019
0020
0021 void setCorrector(const reco::JetCorrector *corrector) { m_corrector = corrector; }
0022 reco::Jet operator()(const reco::Jet &jet) const {
0023 reco::Jet correctedJet(jet.p4(), jet.vertex());
0024 if (m_corrector)
0025 correctedJet.scaleEnergy(m_corrector->correction(jet));
0026 return correctedJet;
0027 }
0028
0029 private:
0030 const reco::JetCorrector *m_corrector;
0031 };
0032
0033 #endif