CMS 3D CMS Logo

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

#include <L6SLBCorrector.h>

Inheritance diagram for L6SLBCorrector:
JetCorrector

Public Member Functions

double correction (const LorentzVector &fJet) const override
 apply 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::RefToBase< reco::Jet > &refToRawJet, 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...
 
 L6SLBCorrector (const JetCorrectorParameters &fParam, const edm::ParameterSet &fConfig)
 
bool refRequired () const override
 if correction needs the jet reference More...
 
 ~L6SLBCorrector () override
 
- Public Member Functions inherited from JetCorrector
virtual double correction (const reco::Jet &fJet, 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 Member Functions

int getBTagInfoIndex (const edm::RefToBase< reco::Jet > &refToRawJet, const std::vector< reco::SoftLeptonTagInfo > &tags) const
 

Private Attributes

bool addMuonToJet_
 
FactorizedJetCorrectorCalculatorcorrector_
 
edm::InputTag srcBTagInfoElec_
 
edm::InputTag srcBTagInfoMuon_
 
std::string tagName_
 

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 18 of file L6SLBCorrector.h.

Constructor & Destructor Documentation

◆ L6SLBCorrector()

L6SLBCorrector::L6SLBCorrector ( const JetCorrectorParameters fParam,
const edm::ParameterSet fConfig 
)

Definition at line 28 of file L6SLBCorrector.cc.

29  : addMuonToJet_(fConfig.getParameter<bool>("addMuonToJet")),
30  srcBTagInfoElec_(fConfig.getParameter<edm::InputTag>("srcBTagInfoElectron")),
31  srcBTagInfoMuon_(fConfig.getParameter<edm::InputTag>("srcBTagInfoMuon")),
32  corrector_(nullptr) {
33  vector<JetCorrectorParameters> vParam;
34  vParam.push_back(fParam);
36 }

References corrector_.

◆ ~L6SLBCorrector()

L6SLBCorrector::~L6SLBCorrector ( )
override

Definition at line 39 of file L6SLBCorrector.cc.

39 { delete corrector_; }

References corrector_.

Member Function Documentation

◆ correction() [1/3]

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

apply correction using Jet information only

Implements JetCorrector.

Definition at line 46 of file L6SLBCorrector.cc.

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

References Exception.

◆ correction() [2/3]

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

apply correction using Jet information only

Implements JetCorrector.

Definition at line 52 of file L6SLBCorrector.cc.

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

References Exception.

◆ correction() [3/3]

double L6SLBCorrector::correction ( const reco::Jet fJet,
const edm::RefToBase< reco::Jet > &  refToRawJet,
const edm::Event fEvent,
const edm::EventSetup fSetup 
) const
overridevirtual

apply correction using all event information

Reimplemented from JetCorrector.

Definition at line 58 of file L6SLBCorrector.cc.

61  {
63  values.setJetPt(fJet.pt());
64  values.setJetEta(fJet.eta());
65  values.setJetPhi(fJet.phi());
66  values.setJetE(fJet.energy());
67 
69  fEvent.getByLabel(srcBTagInfoMuon_, muoninfos);
70 
71  const reco::SoftLeptonTagInfo& sltMuon = (*muoninfos)[getBTagInfoIndex(refToRawJet, *muoninfos)];
72  if (sltMuon.leptons() > 0) {
73  const edm::RefToBase<reco::Track>& trackRef = sltMuon.lepton(0);
74  values.setLepPx(trackRef->px());
75  values.setLepPy(trackRef->py());
76  values.setLepPz(trackRef->pz());
77  values.setAddLepToJet(addMuonToJet_);
79  } else {
81  fEvent.getByLabel(srcBTagInfoElec_, elecinfos);
82  const reco::SoftLeptonTagInfo& sltElec = (*elecinfos)[getBTagInfoIndex(refToRawJet, *elecinfos)];
83  if (sltElec.leptons() > 0) {
84  const edm::RefToBase<reco::Track>& trackRef = sltElec.lepton(0);
85  values.setLepPx(trackRef->px());
86  values.setLepPy(trackRef->py());
87  values.setLepPz(trackRef->pz());
88  values.setAddLepToJet(false);
90  }
91  }
92  return 1.0;
93 }

References addMuonToJet_, corrector_, reco::LeafCandidate::energy(), reco::LeafCandidate::eta(), hcaldqm::fEvent, getBTagInfoIndex(), FactorizedJetCorrectorCalculator::getCorrection(), reco::TemplatedSoftLeptonTagInfo< REF >::lepton(), reco::TemplatedSoftLeptonTagInfo< REF >::leptons(), reco::LeafCandidate::phi(), reco::LeafCandidate::pt(), reco::TrackBase::px(), reco::TrackBase::py(), reco::TrackBase::pz(), srcBTagInfoElec_, srcBTagInfoMuon_, and contentValuesCheck::values.

◆ eventRequired()

bool L6SLBCorrector::eventRequired ( ) const
inlineoverridevirtual

if correction needs event information

Implements JetCorrector.

Definition at line 41 of file L6SLBCorrector.h.

41 { return true; }

◆ getBTagInfoIndex()

int L6SLBCorrector::getBTagInfoIndex ( const edm::RefToBase< reco::Jet > &  refToRawJet,
const std::vector< reco::SoftLeptonTagInfo > &  tags 
) const
private

Definition at line 100 of file L6SLBCorrector.cc.

101  {
102  for (unsigned int i = 0; i < tags.size(); i++)
103  if (tags[i].jet().get() == refToRawJet.get())
104  return i;
105  return -1;
106 }

References edm::RefToBase< T >::get(), mps_fire::i, metsig::jet, and triggerMatcherToHLTDebug_cfi::tags.

Referenced by correction().

◆ refRequired()

bool L6SLBCorrector::refRequired ( ) const
inlineoverridevirtual

if correction needs the jet reference

Implements JetCorrector.

Definition at line 44 of file L6SLBCorrector.h.

44 { return true; }

Member Data Documentation

◆ addMuonToJet_

bool L6SLBCorrector::addMuonToJet_
private

Definition at line 58 of file L6SLBCorrector.h.

Referenced by correction().

◆ corrector_

FactorizedJetCorrectorCalculator* L6SLBCorrector::corrector_
private

Definition at line 61 of file L6SLBCorrector.h.

Referenced by correction(), L6SLBCorrector(), and ~L6SLBCorrector().

◆ srcBTagInfoElec_

edm::InputTag L6SLBCorrector::srcBTagInfoElec_
private

Definition at line 59 of file L6SLBCorrector.h.

Referenced by correction().

◆ srcBTagInfoMuon_

edm::InputTag L6SLBCorrector::srcBTagInfoMuon_
private

Definition at line 60 of file L6SLBCorrector.h.

Referenced by correction().

◆ tagName_

std::string L6SLBCorrector::tagName_
private

Definition at line 57 of file L6SLBCorrector.h.

mps_fire.i
i
Definition: mps_fire.py:355
reco::TemplatedSoftLeptonTagInfo::leptons
unsigned int leptons(void) const
Definition: TemplatedSoftLeptonTagInfo.h:118
reco::TrackBase::px
double px() const
x coordinate of momentum vector
Definition: TrackBase.h:611
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
Definition: AssociativeIterator.h:50
L6SLBCorrector::corrector_
FactorizedJetCorrectorCalculator * corrector_
Definition: L6SLBCorrector.h:61
FactorizedJetCorrectorCalculator::VariableValues
Definition: FactorizedJetCorrectorCalculator.h:18
L6SLBCorrector::srcBTagInfoElec_
edm::InputTag srcBTagInfoElec_
Definition: L6SLBCorrector.h:59
reco::TrackBase::py
double py() const
y coordinate of momentum vector
Definition: TrackBase.h:614
contentValuesCheck.values
values
Definition: contentValuesCheck.py:38
reco::TemplatedSoftLeptonTagInfo::lepton
const REF & lepton(size_t i) const
Definition: TemplatedSoftLeptonTagInfo.h:120
edm::RefToBase::get
value_type const * get() const
Definition: RefToBase.h:209
reco::TemplatedSoftLeptonTagInfo
Definition: TemplatedSoftLeptonTagInfo.h:108
reco::LeafCandidate::eta
double eta() const final
momentum pseudorapidity
Definition: LeafCandidate.h:152
L6SLBCorrector::getBTagInfoIndex
int getBTagInfoIndex(const edm::RefToBase< reco::Jet > &refToRawJet, const std::vector< reco::SoftLeptonTagInfo > &tags) const
Definition: L6SLBCorrector.cc:100
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
hcaldqm::fEvent
Definition: DQTask.h:32
FactorizedJetCorrectorCalculator
Definition: FactorizedJetCorrectorCalculator.h:16
reco::LeafCandidate::phi
double phi() const final
momentum azimuthal angle
Definition: LeafCandidate.h:148
L6SLBCorrector::addMuonToJet_
bool addMuonToJet_
Definition: L6SLBCorrector.h:58
metsig::jet
Definition: SignAlgoResolutions.h:47
Exception
Definition: hltDiff.cc:246
edm::RefToBase< reco::Track >
reco::LeafCandidate::energy
double energy() const final
energy
Definition: LeafCandidate.h:125
triggerMatcherToHLTDebug_cfi.tags
tags
Definition: triggerMatcherToHLTDebug_cfi.py:9
reco::TrackBase::pz
double pz() const
z coordinate of momentum vector
Definition: TrackBase.h:617
L6SLBCorrector::srcBTagInfoMuon_
edm::InputTag srcBTagInfoMuon_
Definition: L6SLBCorrector.h:60
edm::InputTag
Definition: InputTag.h:15