CMS 3D CMS Logo

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=nullptr) const
 
reco::Candidate::LorentzVector operator() (const T &rawJet, const std::string &jetCorrLabel, double jetCorrEtaMax=9.9, const reco::Candidate::LorentzVector *const rawJetP4_specified=nullptr) 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 42 of file JetCorrExtractorT.h.

Member Function Documentation

◆ getCorrection()

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

◆ operator()() [1/2]

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 = nullptr 
) const
inline

Definition at line 44 of file JetCorrExtractorT.h.

48  {
49  // allow to specify four-vector to be used as "raw" (uncorrected) jet momentum,
50  // call 'rawJet.p4()' in case four-vector not specified explicitely
51  reco::Candidate::LorentzVector rawJetP4 = (rawJetP4_specified) ? (*rawJetP4_specified) : rawJet.p4();
52 
53  double jetCorrFactor = 1.;
54  if (fabs(rawJetP4.eta()) < jetCorrEtaMax) {
55  jetCorrFactor = getCorrection(rawJet, jetCorr);
56  } else {
57  reco::Candidate::PolarLorentzVector modJetPolarP4(rawJetP4);
58  modJetPolarP4.SetEta(jetcorrextractor::sign(rawJetP4.eta()) * jetCorrEtaMax);
59 
60  reco::Candidate::LorentzVector modJetP4(modJetPolarP4);
61 
62  T modJet(rawJet);
63  modJet.setP4(modJetP4);
64 
65  jetCorrFactor = getCorrection(modJet, jetCorr);
66  if (jetCorrFactor < 0) {
67  edm::LogWarning("JetCorrExtractor") << "Negative jet energy scale correction noticed"
68  << ".\n";
69  }
70  }
71 
72  reco::Candidate::LorentzVector corrJetP4 = rawJetP4;
73  corrJetP4 *= jetCorrFactor;
74 
75  return corrJetP4;
76  }

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

◆ operator()() [2/2]

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 = nullptr 
) const
inline

Definition at line 78 of file JetCorrExtractorT.h.

82  {
83  edm::LogWarning("JetCorrExtractor")
84  << "JetCorrExtractorT<T>::operator(const T&, const std::string&, ...) is deprecated.\n"
85  << "Please use JetCorrExtractorT<T>::operator(const T&, const reco::JetCorrector*, ...) instead.\n"
86  << "Jet remains uncorrected!";
87  reco::Candidate::LorentzVector rawJetP4 = (rawJetP4_specified) ? (*rawJetP4_specified) : rawJet.p4();
88  return rawJetP4;
89  }
reco::Candidate::PolarLorentzVector
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.
Definition: Candidate.h:38
HLT_FULL_cff.jetCorrEtaMax
jetCorrEtaMax
Definition: HLT_FULL_cff.py:52296
reco::JetCorrector::correction
double correction(const LorentzVector &fJet) const
get correction using Jet information only
Definition: JetCorrector.h:44
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
JetCorrExtractorT::getCorrection
static double getCorrection(const T &jet, const reco::JetCorrector *jetCorr)
Definition: JetCorrExtractorT.h:92
jetcorrextractor::sign
double sign(double x)
Definition: JetCorrExtractorT.h:31
T
long double T
Definition: Basic3DVectorLD.h:48
metsig::jet
Definition: SignAlgoResolutions.h:47
reco::Candidate::LorentzVector
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Candidate.h:36