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 ()
 
 JetCorrectorImpl (const JetCorrectorImpl &)=delete
 
const JetCorrectorImploperator= (const JetCorrectorImpl &)=delete
 
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 
)

Definition at line 59 of file L1JPTOffsetCorrectorImpl.cc.

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.

References Exception.

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

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

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.

76  {
77  double result = 1.;
78  const reco::JPTJet& jptjet = dynamic_cast<const reco::JPTJet&>(fJet);
79  const edm::RefToBase<reco::Jet>& rawcalojet = jptjet.getCaloJetRef();
80  //------ access the offset correction service ----------------
81  double offset = 1.0;
82  if (offsetService_) {
83  offset = offsetService_->correction(*rawcalojet);
84  }
85  //------ calculate the correction for the JPT jet ------------
86  TLorentzVector JPTrawP4(rawcalojet->px(), rawcalojet->py(), rawcalojet->pz(), rawcalojet->energy());
88  values.setJPTrawP4(JPTrawP4);
89  values.setJPTrawOff(offset);
90  values.setJetE(fJet.energy());
91  result = corrector_->getCorrection(values);
92  return result;
93 }
double pz() const final
z coordinate of momentum vector
double correction(const LorentzVector &fJet) const
get correction using Jet information only
Definition: JetCorrector.h:46
const reco::JetCorrector * offsetService_
double px() const final
x coordinate of momentum vector
std::shared_ptr< FactorizedJetCorrectorCalculator const > corrector_
Jets made from CaloJets corrected for ZSP and tracks.
Definition: JPTJet.h:28
const edm::RefToBase< reco::Jet > & getCaloJetRef() const
Definition: JPTJet.h:118
double py() const final
y coordinate of momentum vector
double energy() const final
energy

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