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.

30 { mCorrectors.clear(); }

References 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.

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 }

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

◆ 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.

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 }

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

◆ 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.

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 }

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

◆ 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.

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 }

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

◆ eventRequired()

bool ChainedJetCorrector::eventRequired ( ) const
overridevirtual

if correction needs event information

Implements JetCorrector.

Definition at line 62 of file ChainedJetCorrector.cc.

62  {
63  for (size_t i = 0; i < mCorrectors.size(); ++i) {
64  if (mCorrectors[i]->eventRequired())
65  return true;
66  }
67  return false;
68 }

References mps_fire::i, and mCorrectors.

◆ push_back()

void ChainedJetCorrector::push_back ( const JetCorrector fCorrector)
inline

Definition at line 29 of file ChainedJetCorrector.h.

29 { mCorrectors.push_back(fCorrector); }

References mCorrectors.

◆ refRequired()

bool ChainedJetCorrector::refRequired ( ) const
overridevirtual

if correction needs jet reference

Implements JetCorrector.

Definition at line 71 of file ChainedJetCorrector.cc.

71  {
72  for (size_t i = 0; i < mCorrectors.size(); ++i) {
73  if (mCorrectors[i]->refRequired())
74  return true;
75  }
76  return false;
77 }

References mps_fire::i, and mCorrectors.

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().

mps_fire.i
i
Definition: mps_fire.py:428
L1EGammaCrystalsEmulatorProducer_cfi.scale
scale
Definition: L1EGammaCrystalsEmulatorProducer_cfi.py:10
ChainedJetCorrector::eventRequired
bool eventRequired() const override
if correction needs event information
Definition: ChainedJetCorrector.cc:62
hcaldqm::fEvent
Definition: DQTask.h:32
ChainedJetCorrector::mCorrectors
std::vector< const JetCorrector * > mCorrectors
Definition: ChainedJetCorrector.h:33
metsig::jet
Definition: SignAlgoResolutions.h:47
LorentzVector
math::XYZTLorentzVector LorentzVector
Definition: HLTMuonMatchAndPlot.h:49
mps_fire.result
result
Definition: mps_fire.py:311
ChainedJetCorrector::refRequired
bool refRequired() const override
if correction needs jet reference
Definition: ChainedJetCorrector.cc:71
reco::CompositePtrCandidate::clone
CompositePtrCandidate * clone() const override
returns a clone of the candidate
Definition: CompositePtrCandidate.cc:8