#include <JetCorrExtractorT.h>
Public Member Functions | |
reco::Candidate::LorentzVector | operator() (const T &rawJet, const std::string &jetCorrLabel, const edm::Event *evt=0, const edm::EventSetup *es=0, double jetCorrEtaMax=9.9, const reco::Candidate::LorentzVector *rawJetP4_specified=0) |
Retrieve jet energy correction factor for o reco::CaloJets o reco::PFJets o pat::Jets (of either PF-type or Calo-type)
NOTE: this "general" implementation is to be used for reco::CaloJets and reco::PFJets, **not** for pat::Jets
Definition at line 52 of file JetCorrExtractorT.h.
reco::Candidate::LorentzVector JetCorrExtractorT< T >::operator() | ( | const T & | rawJet, |
const std::string & | jetCorrLabel, | ||
const edm::Event * | evt = 0 , |
||
const edm::EventSetup * | es = 0 , |
||
double | jetCorrEtaMax = 9.9 , |
||
const reco::Candidate::LorentzVector * | rawJetP4_specified = 0 |
||
) | [inline] |
Definition at line 56 of file JetCorrExtractorT.h.
{ // "general" implementation requires access to edm::Event and edm::EventSetup, // only specialization for pat::Jets doesn't assert(evt && es); // allow to specify four-vector to be used as "raw" (uncorrected) jet momentum, // call 'rawJet.p4()' in case four-vector not specified explicitely reco::Candidate::LorentzVector rawJetP4 = ( rawJetP4_specified ) ? (*rawJetP4_specified) : rawJet.p4(); double jetCorrFactor = 1.; if ( fabs(rawJetP4.eta()) < jetCorrEtaMax ) { jetCorrFactor = getCorrection(rawJet, jetCorrLabel, *evt, *es); } else { reco::Candidate::PolarLorentzVector modJetPolarP4(rawJetP4); modJetPolarP4.SetEta(sign(rawJetP4.eta())*jetCorrEtaMax); reco::Candidate::LorentzVector modJetP4(modJetPolarP4); T modJet(rawJet); modJet.setP4(modJetP4); jetCorrFactor = getCorrection(modJet, jetCorrLabel, *evt, *es); } reco::Candidate::LorentzVector corrJetP4 = rawJetP4; corrJetP4 *= jetCorrFactor; return corrJetP4; }