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 ()
 
double correction (const JetCorrector::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...
 
double correction (const reco::Jet &fJet, const edm::Event &fEvent, const edm::EventSetup &fSetup) const override
 apply correction using all event information More...
 
double correction (const reco::Jet &fJet, const edm::RefToBase< reco::Jet > &fJetRef, const edm::Event &fEvent, const edm::EventSetup &fSetup) const override
 apply correction using all event information and reference to the raw jet More...
 
bool eventRequired () const override
 if correction needs event information More...
 
void push_back (const JetCorrector *fCorrector)
 
bool refRequired () const override
 if correction needs jet reference More...
 
 ~ChainedJetCorrector () override
 
- 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 13 of file ChainedJetCorrector.h.

Constructor & Destructor Documentation

◆ ChainedJetCorrector()

ChainedJetCorrector::ChainedJetCorrector ( )
inline

Definition at line 15 of file ChainedJetCorrector.h.

15 {}

◆ ~ChainedJetCorrector()

ChainedJetCorrector::~ChainedJetCorrector ( )
inlineoverride

Definition at line 16 of file ChainedJetCorrector.h.

16 {}

Member Function Documentation

◆ clear()

void ChainedJetCorrector::clear ( void  )
inline

Definition at line 30 of file ChainedJetCorrector.h.

References mCorrectors.

30 { mCorrectors.clear(); }
std::vector< const JetCorrector * > mCorrectors

◆ correction() [1/4]

double ChainedJetCorrector::correction ( const JetCorrector::LorentzVector fJet) const
overridevirtual

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 L1EGammaClusterEmuProducer_cfi::scale.

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

◆ correction() [2/4]

double ChainedJetCorrector::correction ( const reco::Jet fJet) const
overridevirtual

apply correction using Jet information only

Implements JetCorrector.

Definition at line 22 of file ChainedJetCorrector.cc.

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

22  {
23  std::unique_ptr<reco::Jet> jet(dynamic_cast<reco::Jet*>(fJet.clone()));
24  double result = 1;
25  for (size_t i = 0; i < mCorrectors.size(); ++i) {
26  double scale = mCorrectors[i]->correction(*jet);
27  jet->scaleEnergy(scale);
28  result *= scale;
29  }
30  return result;
31 }
std::vector< const JetCorrector * > mCorrectors
CompositePtrCandidate * clone() const override
returns a clone of the candidate

◆ correction() [3/4]

double ChainedJetCorrector::correction ( const reco::Jet fJet,
const edm::Event fEvent,
const edm::EventSetup fSetup 
) const
overridevirtual

apply correction using all event information

Reimplemented from JetCorrector.

Definition at line 34 of file ChainedJetCorrector.cc.

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

36  {
37  std::unique_ptr<reco::Jet> jet(dynamic_cast<reco::Jet*>(fJet.clone()));
38  double result = 1;
39  for (size_t i = 0; i < mCorrectors.size(); ++i) {
40  double scale = mCorrectors[i]->correction(*jet, fEvent, fSetup);
41  jet->scaleEnergy(scale);
42  result *= scale;
43  }
44  return result;
45 }
std::vector< const JetCorrector * > mCorrectors
CompositePtrCandidate * clone() const override
returns a clone of the candidate

◆ correction() [4/4]

double ChainedJetCorrector::correction ( const reco::Jet fJet,
const edm::RefToBase< reco::Jet > &  fJetRef,
const edm::Event fEvent,
const edm::EventSetup fSetup 
) const
overridevirtual

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

Reimplemented from JetCorrector.

Definition at line 47 of file ChainedJetCorrector.cc.

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

50  {
51  std::unique_ptr<reco::Jet> jet(dynamic_cast<reco::Jet*>(fJet.clone()));
52  double result = 1;
53  for (size_t i = 0; i < mCorrectors.size(); ++i) {
54  double scale = mCorrectors[i]->correction(*jet, fJetRef, fEvent, fSetup);
55  jet->scaleEnergy(scale);
56  result *= scale;
57  }
58  return result;
59 }
std::vector< const JetCorrector * > mCorrectors
CompositePtrCandidate * clone() const override
returns a clone of the candidate

◆ eventRequired()

bool ChainedJetCorrector::eventRequired ( ) const
overridevirtual

if correction needs event information

Implements JetCorrector.

Definition at line 62 of file ChainedJetCorrector.cc.

References mps_fire::i, and mCorrectors.

62  {
63  for (size_t i = 0; i < mCorrectors.size(); ++i) {
64  if (mCorrectors[i]->eventRequired())
65  return true;
66  }
67  return false;
68 }
bool eventRequired() const override
if correction needs event information
std::vector< const JetCorrector * > mCorrectors

◆ push_back()

void ChainedJetCorrector::push_back ( const JetCorrector fCorrector)
inline

Definition at line 29 of file ChainedJetCorrector.h.

References mCorrectors.

29 { mCorrectors.push_back(fCorrector); }
std::vector< const JetCorrector * > mCorrectors

◆ refRequired()

bool ChainedJetCorrector::refRequired ( ) const
overridevirtual

if correction needs jet reference

Implements JetCorrector.

Definition at line 71 of file ChainedJetCorrector.cc.

References mps_fire::i, and mCorrectors.

71  {
72  for (size_t i = 0; i < mCorrectors.size(); ++i) {
73  if (mCorrectors[i]->refRequired())
74  return true;
75  }
76  return false;
77 }
std::vector< const JetCorrector * > mCorrectors
bool refRequired() const override
if correction needs jet reference

Member Data Documentation

◆ mCorrectors

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

Definition at line 33 of file ChainedJetCorrector.h.

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