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
Version
Revision:
1.5
Id:
JetCorrExtractorT.h,v 1.5 2012/04/19 17:55:52 veelken Exp

Definition at line 52 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 56 of file JetCorrExtractorT.h.

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