CMS 3D CMS Logo

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

#include <L1JPTOffsetCorrector.h>

Inheritance diagram for L1JPTOffsetCorrector:
JetCorrector

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...
 
double correction (const reco::Jet &fJet, const edm::Event &fEvent, const edm::EventSetup &fSetup) const override
 apply correction using all event information More...
 
bool eventRequired () const override
 if correction needs event information More...
 
 L1JPTOffsetCorrector (const JetCorrectorParameters &fConfig, const edm::ParameterSet &fParameters)
 
bool refRequired () const override
 if correction needs the jet reference More...
 
 ~L1JPTOffsetCorrector () 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) const
 apply correction using all event information More...
 
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

FactorizedJetCorrectorCalculatormCorrector
 
bool mIsOffsetSet
 
std::string mOffsetService
 

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 16 of file L1JPTOffsetCorrector.h.

Constructor & Destructor Documentation

◆ L1JPTOffsetCorrector()

L1JPTOffsetCorrector::L1JPTOffsetCorrector ( const JetCorrectorParameters fConfig,
const edm::ParameterSet fParameters 
)

Definition at line 23 of file L1JPTOffsetCorrector.cc.

23  {
24  mOffsetService = fConfig.getParameter<std::string>("offsetService");
25  mIsOffsetSet = false;
26  if (!mOffsetService.empty())
27  mIsOffsetSet = true;
28  if (fParam.definitions().level() != "L1JPTOffset")
29  throw cms::Exception("L1OffsetCorrector")
30  << " correction level: " << fParam.definitions().level() << " is not L1JPTOffset";
31  vector<JetCorrectorParameters> vParam;
32  vParam.push_back(fParam);
34 }

References JetCorrectorParameters::definitions(), edm::ParameterSet::getParameter(), JetCorrectorParameters::Definitions::level(), and AlCaHLTBitMon_QueryRunRegistry::string.

◆ ~L1JPTOffsetCorrector()

L1JPTOffsetCorrector::~L1JPTOffsetCorrector ( )
override

Definition at line 38 of file L1JPTOffsetCorrector.cc.

38 { delete mCorrector; }

Member Function Documentation

◆ correction() [1/3]

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

get correction using Jet information only

Implements JetCorrector.

Definition at line 42 of file L1JPTOffsetCorrector.cc.

42  {
43  throw cms::Exception("EventRequired") << "Wrong interface correction(LorentzVector), event required!";
44  return 1.0;
45 }

References Exception.

◆ correction() [2/3]

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

apply correction using Jet information only

Implements JetCorrector.

Definition at line 49 of file L1JPTOffsetCorrector.cc.

49  {
50  throw cms::Exception("EventRequired") << "Wrong interface correction(reco::Jet), event required!";
51  return 1.0;
52 }

References Exception.

◆ correction() [3/3]

double L1JPTOffsetCorrector::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 56 of file L1JPTOffsetCorrector.cc.

58  {
59  double result = 1.;
60  const reco::JPTJet& jptjet = dynamic_cast<const reco::JPTJet&>(fJet);
61  const edm::RefToBase<reco::Jet>& jptjetRef = jptjet.getCaloJetRef();
62  reco::CaloJet const* rawcalojet = dynamic_cast<reco::CaloJet const*>(&*jptjetRef);
63  //------ access the offset correction service ----------------
64  double offset = 1.0;
65  if (mIsOffsetSet) {
66  const JetCorrector* OffsetCorrector = JetCorrector::getJetCorrector(mOffsetService, fSetup);
67  offset = OffsetCorrector->correction(*rawcalojet, fEvent, fSetup);
68  }
69  //------ calculate the correction for the JPT jet ------------
70  TLorentzVector JPTrawP4(rawcalojet->px(), rawcalojet->py(), rawcalojet->pz(), rawcalojet->energy());
72  values.setJPTrawP4(JPTrawP4);
73  values.setJPTrawOff(offset);
74  values.setJetE(fJet.energy());
76  return result;
77 }

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

◆ eventRequired()

bool L1JPTOffsetCorrector::eventRequired ( ) const
inlineoverridevirtual

if correction needs event information

Implements JetCorrector.

Definition at line 33 of file L1JPTOffsetCorrector.h.

33 { return true; }

◆ refRequired()

bool L1JPTOffsetCorrector::refRequired ( ) const
inlineoverridevirtual

if correction needs the jet reference

Implements JetCorrector.

Definition at line 34 of file L1JPTOffsetCorrector.h.

34 { return false; }

Member Data Documentation

◆ mCorrector

FactorizedJetCorrectorCalculator* L1JPTOffsetCorrector::mCorrector
private

Definition at line 40 of file L1JPTOffsetCorrector.h.

◆ mIsOffsetSet

bool L1JPTOffsetCorrector::mIsOffsetSet
private

Definition at line 39 of file L1JPTOffsetCorrector.h.

◆ mOffsetService

std::string L1JPTOffsetCorrector::mOffsetService
private

Definition at line 38 of file L1JPTOffsetCorrector.h.

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
L1JPTOffsetCorrector::mIsOffsetSet
bool mIsOffsetSet
Definition: L1JPTOffsetCorrector.h:39
FactorizedJetCorrectorCalculator::getCorrection
float getCorrection(VariableValues &) const
Definition: FactorizedJetCorrectorCalculator.cc:272
JetCorrector
Definition: JetCorrector.h:19
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
L1JPTOffsetCorrector::mCorrector
FactorizedJetCorrectorCalculator * mCorrector
Definition: L1JPTOffsetCorrector.h:40
JetCorrector::getJetCorrector
static const JetCorrector * getJetCorrector(const std::string &fName, const edm::EventSetup &fSetup)
retrieve corrector from the event setup. troughs exception if something is missing
Definition: JetCorrector.cc:48
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
L1JPTOffsetCorrector::mOffsetService
std::string mOffsetService
Definition: L1JPTOffsetCorrector.h:38
hcaldqm::fEvent
Definition: DQTask.h:32
JetCorrector::correction
virtual double correction(const LorentzVector &fJet) const =0
get correction using Jet information only
FactorizedJetCorrectorCalculator
Definition: FactorizedJetCorrectorCalculator.h:16
Exception
Definition: hltDiff.cc:245
edm::RefToBase< reco::Jet >
reco::LeafCandidate::energy
double energy() const final
energy
Definition: LeafCandidate.h:125
mps_fire.result
result
Definition: mps_fire.py:311
cms::Exception
Definition: Exception.h:70
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