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
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 16 of file ChainedJetCorrector.h.

Constructor & Destructor Documentation

ChainedJetCorrector::ChainedJetCorrector ( )
inline

Definition at line 19 of file ChainedJetCorrector.h.

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

Definition at line 20 of file ChainedJetCorrector.h.

20 {}

Member Function Documentation

void ChainedJetCorrector::clear ( void  )
inline

Definition at line 36 of file ChainedJetCorrector.h.

References mCorrectors.

Referenced by JetCorrectionESChain::produce().

36 {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 11 of file ChainedJetCorrector.cc.

References i, metsig::jet, mCorrectors, query::result, and pileupReCalc_HLTpaths::scale.

12 {
13  LorentzVector jet = fJet;
14  double result = 1;
15  for (size_t i = 0; i < mCorrectors.size (); ++i) {
16  double scale = mCorrectors[i]->correction (jet);
17  jet *= scale;
18  result *= scale;
19  }
20  return result;
21 }
int i
Definition: DBlmapReader.cc:9
math::XYZTLorentzVector LorentzVector
tuple result
Definition: query.py:137
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 24 of file ChainedJetCorrector.cc.

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

25 {
26  std::auto_ptr<reco::Jet> jet (dynamic_cast<reco::Jet*> (fJet.clone ()));
27  double result = 1;
28  for (size_t i = 0; i < mCorrectors.size (); ++i) {
29  double scale = mCorrectors[i]->correction (*jet);
30  jet->scaleEnergy (scale);
31  result *= scale;
32  }
33  return result;
34 }
int i
Definition: DBlmapReader.cc:9
virtual CompositePtrCandidate * clone() const
returns a clone of the candidate
tuple result
Definition: query.py:137
std::vector< const JetCorrector * > mCorrectors
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 37 of file ChainedJetCorrector.cc.

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

40 {
41  std::auto_ptr<reco::Jet> jet (dynamic_cast<reco::Jet*> (fJet.clone ()));
42  double result = 1;
43  for (size_t i = 0; i < mCorrectors.size (); ++i) {
44  double scale = mCorrectors[i]->correction (*jet, fEvent, fSetup);
45  jet->scaleEnergy (scale);
46  result *= scale;
47  }
48  return result;
49 }
int i
Definition: DBlmapReader.cc:9
virtual CompositePtrCandidate * clone() const
returns a clone of the candidate
tuple result
Definition: query.py:137
std::vector< const JetCorrector * > mCorrectors
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 51 of file ChainedJetCorrector.cc.

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

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

if correction needs event information

Implements JetCorrector.

Definition at line 67 of file ChainedJetCorrector.cc.

References i, and mCorrectors.

68 {
69  for (size_t i = 0; i < mCorrectors.size (); ++i) {
70  if (mCorrectors[i]->eventRequired ()) return true;
71  }
72  return false;
73 }
int i
Definition: DBlmapReader.cc:9
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 35 of file ChainedJetCorrector.h.

References mCorrectors.

Referenced by JetCorrectionESChain::produce().

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

if correction needs jet reference

Implements JetCorrector.

Definition at line 76 of file ChainedJetCorrector.cc.

References i, and mCorrectors.

77 {
78  for (size_t i = 0; i < mCorrectors.size (); ++i) {
79  if (mCorrectors[i]->refRequired ()) return true;
80  }
81  return false;
82 }
int i
Definition: DBlmapReader.cc:9
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 39 of file ChainedJetCorrector.h.

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