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

virtual double correction (const LorentzVector &fJet) const
 get correction using Jet information only More...
 
virtual double correction (const reco::Jet &fJet) const
 apply correction using Jet information only More...
 
virtual bool eventRequired () const
 if correction needs event information More...
 
 LXXXCorrector (const JetCorrectorParameters &fConfig, const edm::ParameterSet &fParameters)
 
virtual bool refRequired () const
 if correction needs the jet reference More...
 
virtual ~LXXXCorrector ()
 
- 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 16 of file LXXXCorrector.h.

Constructor & Destructor Documentation

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

Definition at line 20 of file LXXXCorrector.cc.

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

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

Definition at line 44 of file LXXXCorrector.cc.

45 {
46  delete mCorrector;
47 }
FactorizedJetCorrectorCalculator * mCorrector
Definition: LXXXCorrector.h:40

Member Function Documentation

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

get correction using Jet information only

Implements JetCorrector.

Definition at line 51 of file LXXXCorrector.cc.

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

52 {
53  // L4 correction requires more information than a simple 4-vector
54  if (mLevel == 4) {
55  throw cms::Exception("Invalid jet type") << "L4EMFCorrection is applicable to CaloJets only";
56  return 1;
57  }
58 
60  values.setJetEta(fJet.eta());
61  values.setJetE(fJet.energy());
62  values.setJetPt(fJet.pt());
63  values.setJetPhi(fJet.phi());
64 
65  return mCorrector->getCorrection(values);
66 }
unsigned mLevel
Definition: LXXXCorrector.h:39
FactorizedJetCorrectorCalculator * mCorrector
Definition: LXXXCorrector.h:40
double LXXXCorrector::correction ( const reco::Jet fJet) const
virtual

apply correction using Jet information only

Implements JetCorrector.

Definition at line 70 of file LXXXCorrector.cc.

References reco::CaloJet::emEnergyFraction(), reco::LeafCandidate::eta(), reco::LeafCandidate::p4(), reco::LeafCandidate::pt(), mps_fire::result, and MuonErrorMatrixValues_cff::values.

71 {
72  double result = 1.;
73  // L4 correction applies to Calojets only
74  if (mLevel == 4) {
75  const reco::CaloJet& caloJet = dynamic_cast <const reco::CaloJet&> (fJet);
77  values.setJetEta(fJet.eta());
78  values.setJetPt(fJet.pt());
79  values.setJetEMF(caloJet.emEnergyFraction());
80  result = mCorrector->getCorrection(values);
81  }
82  else
83  result = correction(fJet.p4());
84  return result;
85 }
virtual double pt() const final
transverse momentum
Jets made from CaloTowers.
Definition: CaloJet.h:29
virtual double eta() const final
momentum pseudorapidity
virtual double correction(const LorentzVector &fJet) const
get correction using Jet information only
unsigned mLevel
Definition: LXXXCorrector.h:39
FactorizedJetCorrectorCalculator * mCorrector
Definition: LXXXCorrector.h:40
virtual const LorentzVector & p4() const final
four-momentum Lorentz vector
Definition: LeafCandidate.h:99
float emEnergyFraction() const
Definition: CaloJet.h:102
virtual bool LXXXCorrector::eventRequired ( ) const
inlinevirtual

if correction needs event information

Implements JetCorrector.

Definition at line 32 of file LXXXCorrector.h.

32 {return false;}
virtual bool LXXXCorrector::refRequired ( ) const
inlinevirtual

if correction needs the jet reference

Implements JetCorrector.

Definition at line 35 of file LXXXCorrector.h.

35 { return false; }

Member Data Documentation

FactorizedJetCorrectorCalculator* LXXXCorrector::mCorrector
private

Definition at line 40 of file LXXXCorrector.h.

unsigned LXXXCorrector::mLevel
private

Definition at line 39 of file LXXXCorrector.h.