CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
LXXXCorrector Class Reference

#include <LXXXCorrector.h>

Inheritance diagram for LXXXCorrector:
JetCorrector

Public Member Functions

double correction (const LorentzVector &fJet) const override
 get correction using Jet information only More...
 
double correction (const reco::Jet &fJet) const override
 apply correction using Jet information only More...
 
bool eventRequired () const override
 if correction needs event information More...
 
 LXXXCorrector (const JetCorrectorParameters &fConfig, const edm::ParameterSet &fParameters)
 
bool refRequired () const override
 if correction needs the jet reference More...
 
 ~LXXXCorrector () override
 
- Public Member Functions inherited from JetCorrector
virtual double correction (const reco::Jet &fJet, const edm::Event &fEvent, const edm::EventSetup &fSetup) const
 apply correction using all event information More...
 
virtual double correction (const reco::Jet &fJet, const edm::RefToBase< reco::Jet > &fJetRef, const edm::Event &fEvent, const edm::EventSetup &fSetup) const
 apply correction using all event information More...
 
virtual double correction (const reco::Jet &fJet, const edm::RefToBase< reco::Jet > &fJetRef, const edm::Event &fEvent, const edm::EventSetup &fSetup, LorentzVector &corrected) const
 Apply vectorial correction using all event information. More...
 
 JetCorrector ()
 
virtual bool vectorialCorrection () const
 if vectorial correction is provided More...
 
virtual ~JetCorrector ()
 

Private Attributes

FactorizedJetCorrectorCalculatormCorrector
 
unsigned mLevel
 

Additional Inherited Members

- Public Types inherited from JetCorrector
typedef reco::Particle::LorentzVector LorentzVector
 
- Static Public Member Functions inherited from JetCorrector
static const JetCorrectorgetJetCorrector (const std::string &fName, const edm::EventSetup &fSetup)
 retrieve corrector from the event setup. troughs exception if something is missing More...
 

Detailed Description

Definition at line 15 of file LXXXCorrector.h.

Constructor & Destructor Documentation

LXXXCorrector::LXXXCorrector ( const JetCorrectorParameters fConfig,
const edm::ParameterSet fParameters 
)

Definition at line 19 of file LXXXCorrector.cc.

References JetCorrectorParameters::definitions(), Exception, personalPlayback::level, and JetCorrectorParameters::Definitions::level().

19  {
20  string level = fParam.definitions().level();
21  if (level == "L2Relative")
22  mLevel = 2;
23  else if (level == "L3Absolute")
24  mLevel = 3;
25  else if (level == "L4EMF")
26  mLevel = 4;
27  else if (level == "L5Flavor")
28  mLevel = 5;
29  else if (level == "L7Parton")
30  mLevel = 7;
31  else if (level == "L2L3Residual")
32  mLevel = 8;
33  else
34  throw cms::Exception("LXXXCorrector") << " unknown correction level " << level;
35  vector<JetCorrectorParameters> vParam;
36  vParam.push_back(fParam);
38 }
unsigned mLevel
Definition: LXXXCorrector.h:37
FactorizedJetCorrectorCalculator * mCorrector
Definition: LXXXCorrector.h:38
LXXXCorrector::~LXXXCorrector ( )
override

Definition at line 42 of file LXXXCorrector.cc.

42 { delete mCorrector; }
FactorizedJetCorrectorCalculator * mCorrector
Definition: LXXXCorrector.h:38

Member Function Documentation

double LXXXCorrector::correction ( const LorentzVector fJet) const
overridevirtual

get correction using Jet information only

Implements JetCorrector.

Definition at line 46 of file LXXXCorrector.cc.

References Exception, FactorizedJetCorrectorCalculator::VariableValues::setJetE(), FactorizedJetCorrectorCalculator::VariableValues::setJetEta(), FactorizedJetCorrectorCalculator::VariableValues::setJetPhi(), FactorizedJetCorrectorCalculator::VariableValues::setJetPt(), and contentValuesCheck::values.

46  {
47  // L4 correction requires more information than a simple 4-vector
48  if (mLevel == 4) {
49  throw cms::Exception("Invalid jet type") << "L4EMFCorrection is applicable to CaloJets only";
50  return 1;
51  }
52 
54  values.setJetEta(fJet.eta());
55  values.setJetE(fJet.energy());
56  values.setJetPt(fJet.pt());
57  values.setJetPhi(fJet.phi());
58 
59  return mCorrector->getCorrection(values);
60 }
unsigned mLevel
Definition: LXXXCorrector.h:37
FactorizedJetCorrectorCalculator * mCorrector
Definition: LXXXCorrector.h:38
double LXXXCorrector::correction ( const reco::Jet fJet) const
overridevirtual

apply correction using Jet information only

Implements JetCorrector.

Definition at line 64 of file LXXXCorrector.cc.

References pfMETCorrectionType0_cfi::correction, reco::CaloJet::emEnergyFraction(), reco::LeafCandidate::eta(), reco::LeafCandidate::p4(), reco::LeafCandidate::pt(), mps_fire::result, FactorizedJetCorrectorCalculator::VariableValues::setJetEMF(), FactorizedJetCorrectorCalculator::VariableValues::setJetEta(), FactorizedJetCorrectorCalculator::VariableValues::setJetPt(), and contentValuesCheck::values.

64  {
65  double result = 1.;
66  // L4 correction applies to Calojets only
67  if (mLevel == 4) {
68  const reco::CaloJet& caloJet = dynamic_cast<const reco::CaloJet&>(fJet);
70  values.setJetEta(fJet.eta());
71  values.setJetPt(fJet.pt());
72  values.setJetEMF(caloJet.emEnergyFraction());
73  result = mCorrector->getCorrection(values);
74  } else
75  result = correction(fJet.p4());
76  return result;
77 }
double eta() const final
momentum pseudorapidity
Jets made from CaloTowers.
Definition: CaloJet.h:27
double pt() const final
transverse momentum
double correction(const LorentzVector &fJet) const override
get correction using Jet information only
unsigned mLevel
Definition: LXXXCorrector.h:37
const LorentzVector & p4() const final
four-momentum Lorentz vector
FactorizedJetCorrectorCalculator * mCorrector
Definition: LXXXCorrector.h:38
float emEnergyFraction() const
Definition: CaloJet.h:97
bool LXXXCorrector::eventRequired ( ) const
inlineoverridevirtual

if correction needs event information

Implements JetCorrector.

Definition at line 30 of file LXXXCorrector.h.

30 { return false; }
bool LXXXCorrector::refRequired ( ) const
inlineoverridevirtual

if correction needs the jet reference

Implements JetCorrector.

Definition at line 33 of file LXXXCorrector.h.

33 { return false; }

Member Data Documentation

FactorizedJetCorrectorCalculator* LXXXCorrector::mCorrector
private

Definition at line 38 of file LXXXCorrector.h.

unsigned LXXXCorrector::mLevel
private

Definition at line 37 of file LXXXCorrector.h.