CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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

FactorizedJetCorrectormCorrector
 
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(), edm::hlt::Exception, testEve_cfg::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
34  throw cms::Exception("LXXXCorrector")<<" unknown correction level "<<level;
35  vector<JetCorrectorParameters> vParam;
36  vParam.push_back(fParam);
37  mCorrector = new FactorizedJetCorrector(vParam);
38 }
unsigned mLevel
Definition: LXXXCorrector.h:39
FactorizedJetCorrector * mCorrector
Definition: LXXXCorrector.h:40
tuple level
Definition: testEve_cfg.py:34
LXXXCorrector::~LXXXCorrector ( )
virtual

Definition at line 42 of file LXXXCorrector.cc.

43 {
44  delete mCorrector;
45 }
FactorizedJetCorrector * 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 49 of file LXXXCorrector.cc.

References edm::hlt::Exception.

50 {
51  // L4 correction requires more information than a simple 4-vector
52  if (mLevel == 4) {
53  throw cms::Exception("Invalid jet type") << "L4EMFCorrection is applicable to CaloJets only";
54  return 1;
55  }
56  else {
57  mCorrector->setJetEta(fJet.eta());
58  mCorrector->setJetE(fJet.energy());
59  mCorrector->setJetPt(fJet.pt());
60  mCorrector->setJetPhi(fJet.phi());
61  }
62  return mCorrector->getCorrection();
63 }
unsigned mLevel
Definition: LXXXCorrector.h:39
FactorizedJetCorrector * 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 67 of file LXXXCorrector.cc.

References reco::CaloJet::emEnergyFraction(), reco::LeafCandidate::eta(), reco::LeafCandidate::p4(), reco::LeafCandidate::pt(), and query::result.

68 {
69  double result = 1.;
70  // L4 correction applies to Calojets only
71  if (mLevel == 4) {
72  const reco::CaloJet& caloJet = dynamic_cast <const reco::CaloJet&> (fJet);
73  mCorrector->setJetEta(fJet.eta());
74  mCorrector->setJetPt(fJet.pt());
76  result = mCorrector->getCorrection();
77  }
78  else
79  result = correction(fJet.p4());
80  return result;
81 }
Jets made from CaloTowers.
Definition: CaloJet.h:29
virtual const LorentzVector & p4() const GCC11_FINAL
four-momentum Lorentz vector
virtual double correction(const LorentzVector &fJet) const
get correction using Jet information only
unsigned mLevel
Definition: LXXXCorrector.h:39
tuple result
Definition: query.py:137
virtual float eta() const GCC11_FINAL
momentum pseudorapidity
FactorizedJetCorrector * mCorrector
Definition: LXXXCorrector.h:40
virtual float pt() const GCC11_FINAL
transverse momentum
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

FactorizedJetCorrector* LXXXCorrector::mCorrector
private

Definition at line 40 of file LXXXCorrector.h.

unsigned LXXXCorrector::mLevel
private

Definition at line 39 of file LXXXCorrector.h.