CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions
JetCorrExtractorT< T > Class Template Reference

#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)
 

Detailed Description

template<typename T>
class JetCorrExtractorT< T >

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

Author
Christian Veelken, LLR

Definition at line 50 of file JetCorrExtractorT.h.

Member Function Documentation

template<typename T >
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 54 of file JetCorrExtractorT.h.

58  {
59  // "general" implementation requires access to edm::Event and edm::EventSetup,
60  // only specialization for pat::Jets doesn't
61  assert(evt && es);
62 
63  // allow to specify four-vector to be used as "raw" (uncorrected) jet momentum,
64  // call 'rawJet.p4()' in case four-vector not specified explicitely
65  reco::Candidate::LorentzVector rawJetP4 = ( rawJetP4_specified ) ?
66  (*rawJetP4_specified) : rawJet.p4();
67 
68  double jetCorrFactor = 1.;
69  if ( fabs(rawJetP4.eta()) < jetCorrEtaMax ) {
70  jetCorrFactor = getCorrection(rawJet, jetCorrLabel, *evt, *es);
71  } else {
72  reco::Candidate::PolarLorentzVector modJetPolarP4(rawJetP4);
73  modJetPolarP4.SetEta(sign(rawJetP4.eta())*jetCorrEtaMax);
74 
75  reco::Candidate::LorentzVector modJetP4(modJetPolarP4);
76 
77  T modJet(rawJet);
78  modJet.setP4(modJetP4);
79 
80  jetCorrFactor = getCorrection(modJet, jetCorrLabel, *evt, *es);
81  }
82 
83  reco::Candidate::LorentzVector corrJetP4 = rawJetP4;
84  corrJetP4 *= jetCorrFactor;
85 
86  return corrJetP4;
87  }
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Candidate.h:41
long double T
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.
Definition: Candidate.h:43