CMS 3D CMS Logo

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

#include <L1OffsetCorrector.h>

Inheritance diagram for L1OffsetCorrector:
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...
 
 L1OffsetCorrector (const JetCorrectorParameters &fConfig, const edm::ParameterSet &fParameters)
 
bool refRequired () const override
 if correction needs the jet reference More...
 
 ~L1OffsetCorrector () 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
 
int mMinVtxNdof
 
std::string mVertexCollName
 

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 L1OffsetCorrector.h.

Constructor & Destructor Documentation

◆ L1OffsetCorrector()

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

Definition at line 21 of file L1OffsetCorrector.cc.

21  {
22  mVertexCollName = fConfig.getParameter<std::string>("vertexCollection");
23  mMinVtxNdof = fConfig.getParameter<int>("minVtxNdof");
24  if (fParam.definitions().level() != "L1Offset")
25  throw cms::Exception("L1OffsetCorrector")
26  << " correction level: " << fParam.definitions().level() << " is not L1Offset";
27  vector<JetCorrectorParameters> vParam;
28  vParam.push_back(fParam);
30 }

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

◆ ~L1OffsetCorrector()

L1OffsetCorrector::~L1OffsetCorrector ( )
override

Definition at line 34 of file L1OffsetCorrector.cc.

34 { delete mCorrector; }

Member Function Documentation

◆ correction() [1/3]

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

get correction using Jet information only

Implements JetCorrector.

Definition at line 38 of file L1OffsetCorrector.cc.

38  {
39  throw cms::Exception("EventRequired") << "Wrong interface correction(LorentzVector), event required!";
40  return 1.0;
41 }

References Exception.

◆ correction() [2/3]

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

apply correction using Jet information only

Implements JetCorrector.

Definition at line 45 of file L1OffsetCorrector.cc.

45  {
46  throw cms::Exception("EventRequired") << "Wrong interface correction(reco::Jet), event required!";
47  return 1.0;
48 }

References Exception.

◆ correction() [3/3]

double L1OffsetCorrector::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 52 of file L1OffsetCorrector.cc.

54  {
55  double result = 1.;
57  fEvent.getByLabel(mVertexCollName, recVtxs);
58  int NPV(0);
59  for (unsigned int ind = 0; ind < recVtxs->size(); ind++) {
60  if (!((*recVtxs)[ind].isFake()) && (*recVtxs)[ind].ndof() > mMinVtxNdof) {
61  NPV++;
62  }
63  }
64  if (NPV > 0) {
66  values.setJetEta(fJet.eta());
67  values.setJetPt(fJet.pt());
68  values.setJetE(fJet.energy());
69  values.setNPV(NPV);
71  }
72  return result;
73 }

References reco::LeafCandidate::energy(), reco::LeafCandidate::eta(), hcaldqm::fEvent, reco::LeafCandidate::pt(), mps_fire::result, and contentValuesCheck::values.

◆ eventRequired()

bool L1OffsetCorrector::eventRequired ( ) const
inlineoverridevirtual

if correction needs event information

Implements JetCorrector.

Definition at line 33 of file L1OffsetCorrector.h.

33 { return true; }

◆ refRequired()

bool L1OffsetCorrector::refRequired ( ) const
inlineoverridevirtual

if correction needs the jet reference

Implements JetCorrector.

Definition at line 36 of file L1OffsetCorrector.h.

36 { return false; }

Member Data Documentation

◆ mCorrector

FactorizedJetCorrectorCalculator* L1OffsetCorrector::mCorrector
private

Definition at line 42 of file L1OffsetCorrector.h.

◆ mMinVtxNdof

int L1OffsetCorrector::mMinVtxNdof
private

Definition at line 41 of file L1OffsetCorrector.h.

◆ mVertexCollName

std::string L1OffsetCorrector::mVertexCollName
private

Definition at line 40 of file L1OffsetCorrector.h.

FactorizedJetCorrectorCalculator::getCorrection
float getCorrection(VariableValues &) const
Definition: FactorizedJetCorrectorCalculator.cc:272
reco::LeafCandidate::pt
double pt() const final
transverse momentum
Definition: LeafCandidate.h:146
edm::Handle< reco::VertexCollection >
FactorizedJetCorrectorCalculator::VariableValues
Definition: FactorizedJetCorrectorCalculator.h:18
contentValuesCheck.values
values
Definition: contentValuesCheck.py:38
pvSelector_cfi.NPV
NPV
Definition: pvSelector_cfi.py:5
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
reco::LeafCandidate::eta
double eta() const final
momentum pseudorapidity
Definition: LeafCandidate.h:152
L1OffsetCorrector::mCorrector
FactorizedJetCorrectorCalculator * mCorrector
Definition: L1OffsetCorrector.h:42
L1OffsetCorrector::mMinVtxNdof
int mMinVtxNdof
Definition: L1OffsetCorrector.h:41
L1OffsetCorrector::mVertexCollName
std::string mVertexCollName
Definition: L1OffsetCorrector.h:40
hcaldqm::fEvent
Definition: DQTask.h:32
FactorizedJetCorrectorCalculator
Definition: FactorizedJetCorrectorCalculator.h:16
Exception
Definition: hltDiff.cc:246
reco::LeafCandidate::energy
double energy() const final
energy
Definition: LeafCandidate.h:125
mps_fire.result
result
Definition: mps_fire.py:303
cms::Exception
Definition: Exception.h:70