CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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

Definition at line 39 of file L1JPTOffsetCorrectorImpl.h.

Constructor & Destructor Documentation

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

Definition at line 59 of file L1JPTOffsetCorrectorImpl.cc.

61  : offsetService_(offsetService), corrector_(corrector) {}
const reco::JetCorrector * offsetService_
std::shared_ptr< FactorizedJetCorrectorCalculator const > corrector_

Member Function Documentation

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 }
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 runTheMatrix::const, 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 makeHLTPrescaleTable::values.

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 }
double pz() const final
z coordinate of momentum vector
Jets made from CaloTowers.
Definition: CaloJet.h:27
double correction(const LorentzVector &fJet) const
get correction using Jet information only
Definition: JetCorrector.h:46
const edm::RefToBase< reco::Jet > & getCaloJetRef() const
Definition: JPTJet.h:133
const reco::JetCorrector * offsetService_
tuple result
Definition: mps_fire.py:311
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
double py() const final
y coordinate of momentum vector
double energy() const final
energy
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

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

Definition at line 57 of file L1JPTOffsetCorrectorImpl.h.

Referenced by correction().

const reco::JetCorrector* L1JPTOffsetCorrectorImpl::offsetService_
private

Definition at line 56 of file L1JPTOffsetCorrectorImpl.h.

Referenced by correction().