CMS 3D CMS Logo

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

#include <JetCorrExtractorT.h>

Public Member Functions

reco::Candidate::LorentzVector operator() (const T &rawJet, const reco::JetCorrector *jetCorr, double jetCorrEtaMax=9.9, const reco::Candidate::LorentzVector *const rawJetP4_specified=0) const
 
reco::Candidate::LorentzVector operator() (const T &rawJet, const std::string &jetCorrLabel, double jetCorrEtaMax=9.9, const reco::Candidate::LorentzVector *const rawJetP4_specified=0) const
 

Static Private Member Functions

static double getCorrection (const T &jet, const reco::JetCorrector *jetCorr)
 

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 41 of file JetCorrExtractorT.h.

Member Function Documentation

template<typename T>
static double JetCorrExtractorT< T >::getCorrection ( const T jet,
const reco::JetCorrector jetCorr 
)
inlinestaticprivate

Definition at line 90 of file JetCorrExtractorT.h.

References reco::JetCorrector::correction().

Referenced by JetCorrExtractorT< T >::operator()().

91  {
92  return jetCorr->correction(jet);
93  }
double correction(const LorentzVector &fJet) const
get correction using Jet information only
Definition: JetCorrector.h:47
template<typename T>
reco::Candidate::LorentzVector JetCorrExtractorT< T >::operator() ( const T rawJet,
const reco::JetCorrector jetCorr,
double  jetCorrEtaMax = 9.9,
const reco::Candidate::LorentzVector *const  rawJetP4_specified = 0 
) const
inline

Definition at line 45 of file JetCorrExtractorT.h.

References JetCorrExtractorT< T >::getCorrection(), and jetcorrextractor::sign().

48  {
49 
50  // allow to specify four-vector to be used as "raw" (uncorrected) jet momentum,
51  // call 'rawJet.p4()' in case four-vector not specified explicitely
52  reco::Candidate::LorentzVector rawJetP4 = ( rawJetP4_specified ) ?
53  (*rawJetP4_specified) : rawJet.p4();
54 
55  double jetCorrFactor = 1.;
56  if ( fabs(rawJetP4.eta()) < jetCorrEtaMax ) {
57  jetCorrFactor = getCorrection(rawJet, jetCorr);
58  } else {
59  reco::Candidate::PolarLorentzVector modJetPolarP4(rawJetP4);
60  modJetPolarP4.SetEta(jetcorrextractor::sign(rawJetP4.eta())*jetCorrEtaMax);
61 
62  reco::Candidate::LorentzVector modJetP4(modJetPolarP4);
63 
64  T modJet(rawJet);
65  modJet.setP4(modJetP4);
66 
67  jetCorrFactor = getCorrection(modJet, jetCorr);
68  }
69 
70  reco::Candidate::LorentzVector corrJetP4 = rawJetP4;
71  corrJetP4 *= jetCorrFactor;
72 
73  return corrJetP4;
74  }
double sign(double x)
static double getCorrection(const T &jet, const reco::JetCorrector *jetCorr)
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Candidate.h:37
long double T
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.
Definition: Candidate.h:39
template<typename T>
reco::Candidate::LorentzVector JetCorrExtractorT< T >::operator() ( const T rawJet,
const std::string &  jetCorrLabel,
double  jetCorrEtaMax = 9.9,
const reco::Candidate::LorentzVector *const  rawJetP4_specified = 0 
) const
inline

Definition at line 76 of file JetCorrExtractorT.h.

79  {
80  edm::LogWarning("JetCorrExtractor") << "JetCorrExtractorT<T>::operator(const T&, const std::string&, ...) is deprecated.\n"
81  << "Please use JetCorrExtractorT<T>::operator(const T&, const reco::JetCorrector*, ...) instead.\n"
82  << "Jet remains uncorrected!";
83  reco::Candidate::LorentzVector rawJetP4 = ( rawJetP4_specified ) ?
84  (*rawJetP4_specified) : rawJet.p4();
85  return rawJetP4;
86  }
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Candidate.h:37