test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
L1OffsetCorrector Class Reference

#include <L1OffsetCorrector.h>

Inheritance diagram for L1OffsetCorrector:
JetCorrector

Public Member Functions

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

Constructor & Destructor Documentation

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

Definition at line 22 of file L1OffsetCorrector.cc.

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

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

Definition at line 35 of file L1OffsetCorrector.cc.

36 {
37  delete mCorrector;
38 }
FactorizedJetCorrectorCalculator * mCorrector

Member Function Documentation

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

get correction using Jet information only

Implements JetCorrector.

Definition at line 42 of file L1OffsetCorrector.cc.

References Exception.

43 {
44  throw cms::Exception("EventRequired")
45  <<"Wrong interface correction(LorentzVector), event required!";
46  return 1.0;
47 }
double L1OffsetCorrector::correction ( const reco::Jet fJet) const
virtual

apply correction using Jet information only

Implements JetCorrector.

Definition at line 51 of file L1OffsetCorrector.cc.

References Exception.

52 {
53  throw cms::Exception("EventRequired")
54  <<"Wrong interface correction(reco::Jet), event required!";
55  return 1.0;
56 }
double L1OffsetCorrector::correction ( const reco::Jet fJet,
const edm::Event fEvent,
const edm::EventSetup fSetup 
) const
virtual

apply correction using all event information

Reimplemented from JetCorrector.

Definition at line 60 of file L1OffsetCorrector.cc.

References reco::LeafCandidate::energy(), reco::LeafCandidate::eta(), edm::Event::getByLabel(), reco::LeafCandidate::pt(), mps_fire::result, FactorizedJetCorrectorCalculator::VariableValues::setJetE(), FactorizedJetCorrectorCalculator::VariableValues::setJetEta(), FactorizedJetCorrectorCalculator::VariableValues::setJetPt(), FactorizedJetCorrectorCalculator::VariableValues::setNPV(), and makeHLTPrescaleTable::values.

63 {
64  double result = 1.;
66  fEvent.getByLabel(mVertexCollName,recVtxs);
67  int NPV(0);
68  for(unsigned int ind=0;ind<recVtxs->size();ind++) {
69  if (!((*recVtxs)[ind].isFake()) && (*recVtxs)[ind].ndof() > mMinVtxNdof) {
70  NPV++;
71  }
72  }
73  if (NPV > 0) {
75  values.setJetEta(fJet.eta());
76  values.setJetPt(fJet.pt());
77  values.setJetE(fJet.energy());
78  values.setNPV(NPV);
79  result = mCorrector->getCorrection(values);
80  }
81  return result;
82 }
virtual double energy() const final
energy
tuple result
Definition: mps_fire.py:83
std::string mVertexCollName
FactorizedJetCorrectorCalculator * mCorrector
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:418
virtual double eta() const final
momentum pseudorapidity
virtual double pt() const final
transverse momentum
virtual bool L1OffsetCorrector::eventRequired ( ) const
inlinevirtual

if correction needs event information

Implements JetCorrector.

Definition at line 37 of file L1OffsetCorrector.h.

37 {return true;}
virtual bool L1OffsetCorrector::refRequired ( ) const
inlinevirtual

if correction needs the jet reference

Implements JetCorrector.

Definition at line 40 of file L1OffsetCorrector.h.

40 { return false; }

Member Data Documentation

FactorizedJetCorrectorCalculator* L1OffsetCorrector::mCorrector
private

Definition at line 46 of file L1OffsetCorrector.h.

int L1OffsetCorrector::mMinVtxNdof
private

Definition at line 45 of file L1OffsetCorrector.h.

std::string L1OffsetCorrector::mVertexCollName
private

Definition at line 44 of file L1OffsetCorrector.h.