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

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...
 
 L1JPTOffsetCorrector (const JetCorrectorParameters &fConfig, const edm::ParameterSet &fParameters)
 
virtual bool refRequired () const
 if correction needs the jet reference More...
 
virtual ~L1JPTOffsetCorrector ()
 
- 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 17 of file L1JPTOffsetCorrector.h.

Constructor & Destructor Documentation

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

Definition at line 24 of file L1JPTOffsetCorrector.cc.

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

25 {
26  mOffsetService = fConfig.getParameter<std::string>("offsetService");
27  mIsOffsetSet = false;
28  if (mOffsetService != "")
29  mIsOffsetSet = true;
30  if (fParam.definitions().level() != "L1JPTOffset")
31  throw cms::Exception("L1OffsetCorrector")<<" correction level: "<<fParam.definitions().level()<<" is not L1JPTOffset";
32  vector<JetCorrectorParameters> vParam;
33  vParam.push_back(fParam);
35 }
FactorizedJetCorrectorCalculator * mCorrector
L1JPTOffsetCorrector::~L1JPTOffsetCorrector ( )
virtual

Definition at line 39 of file L1JPTOffsetCorrector.cc.

40 {
41  delete mCorrector;
42 }
FactorizedJetCorrectorCalculator * mCorrector

Member Function Documentation

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

get correction using Jet information only

Implements JetCorrector.

Definition at line 46 of file L1JPTOffsetCorrector.cc.

References Exception.

47 {
48  throw cms::Exception("EventRequired")
49  <<"Wrong interface correction(LorentzVector), event required!";
50  return 1.0;
51 }
double L1JPTOffsetCorrector::correction ( const reco::Jet fJet) const
virtual

apply correction using Jet information only

Implements JetCorrector.

Definition at line 55 of file L1JPTOffsetCorrector.cc.

References Exception.

56 {
57  throw cms::Exception("EventRequired")
58  <<"Wrong interface correction(reco::Jet), event required!";
59  return 1.0;
60 }
double L1JPTOffsetCorrector::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 64 of file L1JPTOffsetCorrector.cc.

References JetCorrector::correction(), reco::LeafCandidate::energy(), reco::JPTJet::getCaloJetRef(), JetCorrector::getJetCorrector(), PFRecoTauDiscriminationByIsolation_cfi::offset, reco::LeafCandidate::px(), reco::LeafCandidate::py(), reco::LeafCandidate::pz(), mps_fire::result, and MuonErrorMatrixValues_cff::values.

67 {
68  double result = 1.;
69  const reco::JPTJet& jptjet = dynamic_cast <const reco::JPTJet&> (fJet);
70  edm::RefToBase<reco::Jet> jptjetRef = jptjet.getCaloJetRef();
71  reco::CaloJet const * rawcalojet = dynamic_cast<reco::CaloJet const *>( &* jptjetRef);
72  //------ access the offset correction service ----------------
73  double offset = 1.0;
74  if (mIsOffsetSet) {
75  const JetCorrector* OffsetCorrector = JetCorrector::getJetCorrector(mOffsetService,fSetup);
76  offset = OffsetCorrector->correction(*rawcalojet,fEvent,fSetup);
77  }
78  //------ calculate the correction for the JPT jet ------------
79  TLorentzVector JPTrawP4(rawcalojet->px(),rawcalojet->py(),rawcalojet->pz(),rawcalojet->energy());
81  values.setJPTrawP4(JPTrawP4);
82  values.setJPTrawOff(offset);
83  values.setJetE(fJet.energy());
84  result = mCorrector->getCorrection(values);
85  return result;
86 }
Jets made from CaloTowers.
Definition: CaloJet.h:29
double px() const final
x coordinate of momentum vector
const edm::RefToBase< reco::Jet > & getCaloJetRef() const
Definition: JPTJet.h:130
double pz() const final
z coordinate of momentum vector
Jets made from CaloJets corrected for ZSP and tracks.
Definition: JPTJet.h:29
double energy() const final
energy
FactorizedJetCorrectorCalculator * mCorrector
virtual double correction(const LorentzVector &fJet) const =0
get correction using Jet information only
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:50
double py() const final
y coordinate of momentum vector
virtual bool L1JPTOffsetCorrector::eventRequired ( ) const
inlinevirtual

if correction needs event information

Implements JetCorrector.

Definition at line 37 of file L1JPTOffsetCorrector.h.

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

if correction needs the jet reference

Implements JetCorrector.

Definition at line 38 of file L1JPTOffsetCorrector.h.

38 {return false;}

Member Data Documentation

FactorizedJetCorrectorCalculator* L1JPTOffsetCorrector::mCorrector
private

Definition at line 44 of file L1JPTOffsetCorrector.h.

bool L1JPTOffsetCorrector::mIsOffsetSet
private

Definition at line 43 of file L1JPTOffsetCorrector.h.

std::string L1JPTOffsetCorrector::mOffsetService
private

Definition at line 42 of file L1JPTOffsetCorrector.h.