CMS 3D CMS Logo

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

#include <L1JPTOffsetCorrectorImpl.h>

Inheritance diagram for L1JPTOffsetCorrectorImpl:
reco::JetCorrectorImpl

Public Types

typedef L1JPTOffsetCorrectorImplMaker Maker
 
- Public Types inherited from reco::JetCorrectorImpl
typedef reco::Particle::LorentzVector LorentzVector
 

Public Member Functions

double correction (const 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...
 
 L1JPTOffsetCorrectorImpl (std::shared_ptr< FactorizedJetCorrectorCalculator const > corrector, const reco::JetCorrector *offsetService)
 
bool refRequired () const override
 if correction needs the jet reference More...
 
- Public Member Functions inherited from reco::JetCorrectorImpl
virtual double correction (const reco::Jet &fJet, const edm::RefToBase< reco::Jet > &fJetRef) const
 apply correction using Ref More...
 
virtual double correction (const reco::Jet &fJet, const edm::RefToBase< reco::Jet > &fJetRef, LorentzVector &corrected) const
 Apply vectorial correction. More...
 
 JetCorrectorImpl ()
 
virtual bool vectorialCorrection () const
 if vectorial correction is provided More...
 
virtual ~JetCorrectorImpl ()
 

Private Attributes

std::shared_ptr< FactorizedJetCorrectorCalculator const > corrector_
 
const reco::JetCorrectoroffsetService_
 

Detailed Description

Definition at line 37 of file L1JPTOffsetCorrectorImpl.h.

Member Typedef Documentation

◆ Maker

Definition at line 39 of file L1JPTOffsetCorrectorImpl.h.

Constructor & Destructor Documentation

◆ L1JPTOffsetCorrectorImpl()

L1JPTOffsetCorrectorImpl::L1JPTOffsetCorrectorImpl ( std::shared_ptr< FactorizedJetCorrectorCalculator const >  corrector,
const reco::JetCorrector offsetService 
)

Member Function Documentation

◆ correction() [1/2]

double L1JPTOffsetCorrectorImpl::correction ( const LorentzVector fJet) const
overridevirtual

get correction using Jet information only

Implements reco::JetCorrectorImpl.

Definition at line 69 of file L1JPTOffsetCorrectorImpl.cc.

69  {
70  throw cms::Exception("EventRequired") << "Wrong interface correction(LorentzVector), event required!";
71  return 1.0;
72 }

References Exception.

◆ correction() [2/2]

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

apply correction using Jet information only

Implements reco::JetCorrectorImpl.

Definition at line 76 of file L1JPTOffsetCorrectorImpl.cc.

76  {
77  double result = 1.;
78  const reco::JPTJet& jptjet = dynamic_cast<const reco::JPTJet&>(fJet);
79  const edm::RefToBase<reco::Jet>& jptjetRef = jptjet.getCaloJetRef();
80  reco::CaloJet const* rawcalojet = dynamic_cast<reco::CaloJet const*>(&*jptjetRef);
81  //------ access the offset correction service ----------------
82  double offset = 1.0;
83  if (offsetService_) {
84  offset = offsetService_->correction(*rawcalojet);
85  }
86  //------ calculate the correction for the JPT jet ------------
87  TLorentzVector JPTrawP4(rawcalojet->px(), rawcalojet->py(), rawcalojet->pz(), rawcalojet->energy());
89  values.setJPTrawP4(JPTrawP4);
90  values.setJPTrawOff(offset);
91  values.setJetE(fJet.energy());
92  result = corrector_->getCorrection(values);
93  return result;
94 }

References reco::JetCorrector::correction(), corrector_, reco::LeafCandidate::energy(), reco::JPTJet::getCaloJetRef(), hltrates_dqm_sourceclient-live_cfg::offset, offsetService_, reco::LeafCandidate::px(), reco::LeafCandidate::py(), reco::LeafCandidate::pz(), mps_fire::result, and contentValuesCheck::values.

◆ refRequired()

bool L1JPTOffsetCorrectorImpl::refRequired ( ) const
inlineoverridevirtual

if correction needs the jet reference

Implements reco::JetCorrectorImpl.

Definition at line 52 of file L1JPTOffsetCorrectorImpl.h.

52 { return false; }

Member Data Documentation

◆ corrector_

std::shared_ptr<FactorizedJetCorrectorCalculator const> L1JPTOffsetCorrectorImpl::corrector_
private

Definition at line 57 of file L1JPTOffsetCorrectorImpl.h.

Referenced by correction().

◆ offsetService_

const reco::JetCorrector* L1JPTOffsetCorrectorImpl::offsetService_
private

Definition at line 56 of file L1JPTOffsetCorrectorImpl.h.

Referenced by correction().

reco::JPTJet
Jets made from CaloJets corrected for ZSP and tracks.
Definition: JPTJet.h:28
reco::CaloJet
Jets made from CaloTowers.
Definition: CaloJet.h:27
L1JPTOffsetCorrectorImpl::offsetService_
const reco::JetCorrector * offsetService_
Definition: L1JPTOffsetCorrectorImpl.h:56
reco::JetCorrector::correction
double correction(const LorentzVector &fJet) const
get correction using Jet information only
Definition: JetCorrector.h:47
pfClustersFromHGC3DClusters_cfi.corrector
corrector
Definition: pfClustersFromHGC3DClusters_cfi.py:4
FactorizedJetCorrectorCalculator::VariableValues
Definition: FactorizedJetCorrectorCalculator.h:18
reco::LeafCandidate::py
double py() const final
y coordinate of momentum vector
Definition: LeafCandidate.h:142
contentValuesCheck.values
values
Definition: contentValuesCheck.py:38
reco::JPTJet::getCaloJetRef
const edm::RefToBase< reco::Jet > & getCaloJetRef() const
Definition: JPTJet.h:133
L1JPTOffsetCorrectorImpl::corrector_
std::shared_ptr< FactorizedJetCorrectorCalculator const > corrector_
Definition: L1JPTOffsetCorrectorImpl.h:57
Exception
Definition: hltDiff.cc:246
edm::RefToBase< reco::Jet >
JetCorrectionServices_cff.offsetService
offsetService
Definition: JetCorrectionServices_cff.py:39
reco::LeafCandidate::energy
double energy() const final
energy
Definition: LeafCandidate.h:125
mps_fire.result
result
Definition: mps_fire.py:303
hltrates_dqm_sourceclient-live_cfg.offset
offset
Definition: hltrates_dqm_sourceclient-live_cfg.py:82
reco::LeafCandidate::px
double px() const final
x coordinate of momentum vector
Definition: LeafCandidate.h:140
reco::LeafCandidate::pz
double pz() const final
z coordinate of momentum vector
Definition: LeafCandidate.h:144