CMS 3D CMS Logo

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

#include <ChainedJetCorrector.h>

Inheritance diagram for ChainedJetCorrector:
JetCorrector

Public Member Functions

 ChainedJetCorrector ()
 
void clear ()
 
virtual double correction (const JetCorrector::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 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 and reference to the raw jet More...
 
virtual bool eventRequired () const
 if correction needs event information More...
 
void push_back (const JetCorrector *fCorrector)
 
virtual bool refRequired () const
 if correction needs jet reference More...
 
virtual ~ChainedJetCorrector ()
 
- Public Member Functions inherited from JetCorrector
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

std::vector< const JetCorrector * > mCorrectors
 

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 ChainedJetCorrector.h.

Constructor & Destructor Documentation

ChainedJetCorrector::ChainedJetCorrector ( )
inline

Definition at line 18 of file ChainedJetCorrector.h.

18 {}
virtual ChainedJetCorrector::~ChainedJetCorrector ( )
inlinevirtual

Definition at line 19 of file ChainedJetCorrector.h.

References correction(), eventRequired(), hcaldqm::fEvent, and refRequired().

19 {}

Member Function Documentation

void ChainedJetCorrector::clear ( void  )
inline

Definition at line 35 of file ChainedJetCorrector.h.

References mCorrectors.

Referenced by JetCorrectionESChain::produce().

35 {mCorrectors.clear ();}
std::vector< const JetCorrector * > mCorrectors
double ChainedJetCorrector::correction ( const JetCorrector::LorentzVector fJet) const
virtual

get correction using Jet information only

Implements JetCorrector.

Definition at line 10 of file ChainedJetCorrector.cc.

References mps_fire::i, metsig::jet, mCorrectors, mps_fire::result, and Scenarios_cff::scale.

Referenced by ~ChainedJetCorrector().

11 {
12  LorentzVector jet = fJet;
13  double result = 1;
14  for (size_t i = 0; i < mCorrectors.size (); ++i) {
15  double scale = mCorrectors[i]->correction (jet);
16  jet *= scale;
17  result *= scale;
18  }
19  return result;
20 }
math::XYZTLorentzVector LorentzVector
std::vector< const JetCorrector * > mCorrectors
double ChainedJetCorrector::correction ( const reco::Jet fJet) const
virtual

apply correction using Jet information only

Implements JetCorrector.

Definition at line 23 of file ChainedJetCorrector.cc.

References reco::CompositePtrCandidate::clone(), mps_fire::i, metsig::jet, mCorrectors, mps_fire::result, and Scenarios_cff::scale.

24 {
25  std::auto_ptr<reco::Jet> jet (dynamic_cast<reco::Jet*> (fJet.clone ()));
26  double result = 1;
27  for (size_t i = 0; i < mCorrectors.size (); ++i) {
28  double scale = mCorrectors[i]->correction (*jet);
29  jet->scaleEnergy (scale);
30  result *= scale;
31  }
32  return result;
33 }
std::vector< const JetCorrector * > mCorrectors
CompositePtrCandidate * clone() const override
returns a clone of the candidate
double ChainedJetCorrector::correction ( const reco::Jet fJet,
const edm::Event fEvent,
const edm::EventSetup fSetup 
) const
virtual

apply correction using all event information

Reimplemented from JetCorrector.

Definition at line 36 of file ChainedJetCorrector.cc.

References reco::CompositePtrCandidate::clone(), mps_fire::i, metsig::jet, mCorrectors, mps_fire::result, and Scenarios_cff::scale.

39 {
40  std::auto_ptr<reco::Jet> jet (dynamic_cast<reco::Jet*> (fJet.clone ()));
41  double result = 1;
42  for (size_t i = 0; i < mCorrectors.size (); ++i) {
43  double scale = mCorrectors[i]->correction (*jet, fEvent, fSetup);
44  jet->scaleEnergy (scale);
45  result *= scale;
46  }
47  return result;
48 }
std::vector< const JetCorrector * > mCorrectors
CompositePtrCandidate * clone() const override
returns a clone of the candidate
double ChainedJetCorrector::correction ( const reco::Jet fJet,
const edm::RefToBase< reco::Jet > &  fJetRef,
const edm::Event fEvent,
const edm::EventSetup fSetup 
) const
virtual

apply correction using all event information and reference to the raw jet

Reimplemented from JetCorrector.

Definition at line 50 of file ChainedJetCorrector.cc.

References reco::CompositePtrCandidate::clone(), mps_fire::i, metsig::jet, mCorrectors, mps_fire::result, and Scenarios_cff::scale.

54 {
55  std::auto_ptr<reco::Jet> jet (dynamic_cast<reco::Jet*> (fJet.clone ()));
56  double result = 1;
57  for (size_t i = 0; i < mCorrectors.size (); ++i) {
58  double scale = mCorrectors[i]->correction (*jet, fJetRef, fEvent, fSetup);
59  jet->scaleEnergy (scale);
60  result *= scale;
61  }
62  return result;
63 }
std::vector< const JetCorrector * > mCorrectors
CompositePtrCandidate * clone() const override
returns a clone of the candidate
bool ChainedJetCorrector::eventRequired ( ) const
virtual

if correction needs event information

Implements JetCorrector.

Definition at line 66 of file ChainedJetCorrector.cc.

References mps_fire::i, and mCorrectors.

Referenced by ~ChainedJetCorrector().

67 {
68  for (size_t i = 0; i < mCorrectors.size (); ++i) {
69  if (mCorrectors[i]->eventRequired ()) return true;
70  }
71  return false;
72 }
virtual bool eventRequired() const
if correction needs event information
std::vector< const JetCorrector * > mCorrectors
void ChainedJetCorrector::push_back ( const JetCorrector fCorrector)
inline

Definition at line 34 of file ChainedJetCorrector.h.

References mCorrectors.

Referenced by JetCorrectionESChain::produce().

34 {mCorrectors.push_back (fCorrector);}
std::vector< const JetCorrector * > mCorrectors
bool ChainedJetCorrector::refRequired ( ) const
virtual

if correction needs jet reference

Implements JetCorrector.

Definition at line 75 of file ChainedJetCorrector.cc.

References mps_fire::i, and mCorrectors.

Referenced by ~ChainedJetCorrector().

76 {
77  for (size_t i = 0; i < mCorrectors.size (); ++i) {
78  if (mCorrectors[i]->refRequired ()) return true;
79  }
80  return false;
81 }
virtual bool refRequired() const
if correction needs jet reference
std::vector< const JetCorrector * > mCorrectors

Member Data Documentation

std::vector<const JetCorrector*> ChainedJetCorrector::mCorrectors
private

Definition at line 38 of file ChainedJetCorrector.h.

Referenced by clear(), correction(), eventRequired(), push_back(), and refRequired().