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 ( const JetCorrectorParameters fParam,
const edm::ParameterSet fConfig 
)

Definition at line 28 of file L6SLBCorrector.cc.

References corrector_.

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 }
T getParameter(std::string const &) const
FactorizedJetCorrectorCalculator * corrector_
edm::InputTag srcBTagInfoMuon_
edm::InputTag srcBTagInfoElec_
L6SLBCorrector::~L6SLBCorrector ( )
override

Definition at line 39 of file L6SLBCorrector.cc.

References corrector_.

39 { delete corrector_; }
FactorizedJetCorrectorCalculator * corrector_

Member Function Documentation

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

apply correction using Jet information only

Implements JetCorrector.

Definition at line 46 of file L6SLBCorrector.cc.

References Exception.

46  {
47  throw cms::Exception("EventRequired") << "Wrong interface correction(LorentzVector), event required!";
48  return 1.0;
49 }
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.

References Exception.

52  {
53  throw cms::Exception("EventRequired") << "Wrong interface correction(reco::Jet), event required!";
54  return 1.0;
55 }
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.

References addMuonToJet_, corrector_, reco::LeafCandidate::energy(), reco::LeafCandidate::eta(), getBTagInfoIndex(), edm::Event::getByLabel(), 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(), FactorizedJetCorrectorCalculator::VariableValues::setAddLepToJet(), FactorizedJetCorrectorCalculator::VariableValues::setJetE(), FactorizedJetCorrectorCalculator::VariableValues::setJetEta(), FactorizedJetCorrectorCalculator::VariableValues::setJetPhi(), FactorizedJetCorrectorCalculator::VariableValues::setJetPt(), FactorizedJetCorrectorCalculator::VariableValues::setLepPx(), FactorizedJetCorrectorCalculator::VariableValues::setLepPy(), FactorizedJetCorrectorCalculator::VariableValues::setLepPz(), srcBTagInfoElec_, srcBTagInfoMuon_, and contentValuesCheck::values.

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());
78  return corrector_->getCorrection(values);
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);
89  return corrector_->getCorrection(values);
90  }
91  }
92  return 1.0;
93 }
double eta() const final
momentum pseudorapidity
double pt() const final
transverse momentum
double px() const
x coordinate of momentum vector
Definition: TrackBase.h:605
FactorizedJetCorrectorCalculator * corrector_
double energy() const final
energy
edm::InputTag srcBTagInfoMuon_
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:488
double pz() const
z coordinate of momentum vector
Definition: TrackBase.h:611
int getBTagInfoIndex(const edm::RefToBase< reco::Jet > &refToRawJet, const std::vector< reco::SoftLeptonTagInfo > &tags) const
edm::InputTag srcBTagInfoElec_
double phi() const final
momentum azimuthal angle
double py() const
y coordinate of momentum vector
Definition: TrackBase.h:608
bool L6SLBCorrector::eventRequired ( ) const
inlineoverridevirtual

if correction needs event information

Implements JetCorrector.

Definition at line 41 of file L6SLBCorrector.h.

41 { return true; }
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.

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

Referenced by correction(), and refRequired().

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 }
value_type const * get() const
Definition: RefToBase.h:209
bool L6SLBCorrector::refRequired ( ) const
inlineoverridevirtual

if correction needs the jet reference

Implements JetCorrector.

Definition at line 44 of file L6SLBCorrector.h.

References getBTagInfoIndex(), and triggerMatcherToHLTDebug_cfi::tags.

44 { return true; }

Member Data Documentation

bool L6SLBCorrector::addMuonToJet_
private

Definition at line 58 of file L6SLBCorrector.h.

Referenced by correction().

FactorizedJetCorrectorCalculator* L6SLBCorrector::corrector_
private

Definition at line 61 of file L6SLBCorrector.h.

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

edm::InputTag L6SLBCorrector::srcBTagInfoElec_
private

Definition at line 59 of file L6SLBCorrector.h.

Referenced by correction().

edm::InputTag L6SLBCorrector::srcBTagInfoMuon_
private

Definition at line 60 of file L6SLBCorrector.h.

Referenced by correction().

std::string L6SLBCorrector::tagName_
private

Definition at line 57 of file L6SLBCorrector.h.