CMS 3D CMS Logo

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

#include <L6SLBCorrectorImpl.h>

Inheritance diagram for L6SLBCorrectorImpl:
reco::JetCorrectorImpl

Public Types

typedef L6SLBCorrectorImplMaker Maker
 
- Public Types inherited from reco::JetCorrectorImpl
typedef reco::Particle::LorentzVector LorentzVector
 

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 override
 apply correction using all event information More...
 
 L6SLBCorrectorImpl (std::shared_ptr< FactorizedJetCorrectorCalculator const > corrector, edm::RefProd< std::vector< reco::SoftLeptonTagInfo >> const &bTagInfoMuon, edm::RefProd< std::vector< reco::SoftLeptonTagInfo >> const &bTagInfoElec, bool addMuonToJet)
 
bool refRequired () const override
 if correction needs the jet reference More...
 
- Public Member Functions inherited from reco::JetCorrectorImpl
virtual double correction (const reco::Jet &fJet, const edm::RefToBase< reco::Jet > &fJetRef, LorentzVector &corrected) const
 Apply vectorial correction. More...
 
 JetCorrectorImpl ()
 
 JetCorrectorImpl (const JetCorrectorImpl &)=delete
 
const JetCorrectorImploperator= (const JetCorrectorImpl &)=delete
 
virtual bool vectorialCorrection () const
 if vectorial correction is provided More...
 
virtual ~JetCorrectorImpl ()
 

Private Member Functions

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

Private Attributes

bool addMuonToJet_
 
edm::RefProd< std::vector< reco::SoftLeptonTagInfo > > bTagInfoElec_
 
edm::RefProd< std::vector< reco::SoftLeptonTagInfo > > bTagInfoMuon_
 
std::shared_ptr< FactorizedJetCorrectorCalculator const > corrector_
 

Detailed Description

Definition at line 40 of file L6SLBCorrectorImpl.h.

Member Typedef Documentation

◆ Maker

Definition at line 45 of file L6SLBCorrectorImpl.h.

Constructor & Destructor Documentation

◆ L6SLBCorrectorImpl()

L6SLBCorrectorImpl::L6SLBCorrectorImpl ( std::shared_ptr< FactorizedJetCorrectorCalculator const >  corrector,
edm::RefProd< std::vector< reco::SoftLeptonTagInfo >> const &  bTagInfoMuon,
edm::RefProd< std::vector< reco::SoftLeptonTagInfo >> const &  bTagInfoElec,
bool  addMuonToJet 
)

Definition at line 62 of file L6SLBCorrectorImpl.cc.

66  : corrector_(corrector), bTagInfoMuon_(bTagInfoMuon), bTagInfoElec_(bTagInfoElec), addMuonToJet_(addMuonToJet) {}

Member Function Documentation

◆ correction() [1/3]

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

apply correction using Jet information only

Implements reco::JetCorrectorImpl.

Definition at line 73 of file L6SLBCorrectorImpl.cc.

73  {
74  throw cms::Exception("EventRequired") << "Wrong interface correction(LorentzVector), event required!";
75  return 1.0;
76 }

References Exception.

◆ correction() [2/3]

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

apply correction using Jet information only

Implements reco::JetCorrectorImpl.

Definition at line 79 of file L6SLBCorrectorImpl.cc.

79  {
80  throw cms::Exception("EventRequired") << "Wrong interface correction(reco::Jet), event required!";
81  return 1.0;
82 }

References Exception.

◆ correction() [3/3]

double L6SLBCorrectorImpl::correction ( const reco::Jet fJet,
const edm::RefToBase< reco::Jet > &  refToRawJet 
) const
overridevirtual

apply correction using all event information

Reimplemented from reco::JetCorrectorImpl.

Definition at line 85 of file L6SLBCorrectorImpl.cc.

85  {
87  values.setJetPt(fJet.pt());
88  values.setJetEta(fJet.eta());
89  values.setJetPhi(fJet.phi());
90  values.setJetE(fJet.energy());
91 
92  const reco::SoftLeptonTagInfo& sltMuon = (*bTagInfoMuon_)[getBTagInfoIndex(refToRawJet, *bTagInfoMuon_)];
93  if (sltMuon.leptons() > 0) {
94  const edm::RefToBase<reco::Track>& trackRef = sltMuon.lepton(0);
95  values.setLepPx(trackRef->px());
96  values.setLepPy(trackRef->py());
97  values.setLepPz(trackRef->pz());
98  values.setAddLepToJet(addMuonToJet_);
99  return corrector_->getCorrection(values);
100  } else {
101  const reco::SoftLeptonTagInfo& sltElec = (*bTagInfoElec_)[getBTagInfoIndex(refToRawJet, *bTagInfoElec_)];
102  if (sltElec.leptons() > 0) {
103  const edm::RefToBase<reco::Track>& trackRef = sltElec.lepton(0);
104  values.setLepPx(trackRef->px());
105  values.setLepPy(trackRef->py());
106  values.setLepPz(trackRef->pz());
107  values.setAddLepToJet(false);
108  return corrector_->getCorrection(values);
109  }
110  }
111  return 1.0;
112 }

References addMuonToJet_, bTagInfoElec_, bTagInfoMuon_, corrector_, reco::LeafCandidate::energy(), reco::LeafCandidate::eta(), getBTagInfoIndex(), reco::TemplatedSoftLeptonTagInfo< REF >::lepton(), reco::TemplatedSoftLeptonTagInfo< REF >::leptons(), reco::LeafCandidate::phi(), reco::LeafCandidate::pt(), reco::TrackBase::px(), reco::TrackBase::py(), reco::TrackBase::pz(), and contentValuesCheck::values.

◆ getBTagInfoIndex()

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

Definition at line 119 of file L6SLBCorrectorImpl.cc.

120  {
121  for (unsigned int i = 0; i < tags.size(); i++)
122  if (tags[i].jet().get() == refToRawJet.get())
123  return i;
124  return -1;
125 }

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

Referenced by correction().

◆ refRequired()

bool L6SLBCorrectorImpl::refRequired ( ) const
inlineoverridevirtual

if correction needs the jet reference

Implements reco::JetCorrectorImpl.

Definition at line 64 of file L6SLBCorrectorImpl.h.

64 { return true; }

Member Data Documentation

◆ addMuonToJet_

bool L6SLBCorrectorImpl::addMuonToJet_
private

Definition at line 82 of file L6SLBCorrectorImpl.h.

Referenced by correction().

◆ bTagInfoElec_

edm::RefProd<std::vector<reco::SoftLeptonTagInfo> > L6SLBCorrectorImpl::bTagInfoElec_
private

Definition at line 81 of file L6SLBCorrectorImpl.h.

Referenced by correction().

◆ bTagInfoMuon_

edm::RefProd<std::vector<reco::SoftLeptonTagInfo> > L6SLBCorrectorImpl::bTagInfoMuon_
private

Definition at line 80 of file L6SLBCorrectorImpl.h.

Referenced by correction().

◆ corrector_

std::shared_ptr<FactorizedJetCorrectorCalculator const> L6SLBCorrectorImpl::corrector_
private

Definition at line 79 of file L6SLBCorrectorImpl.h.

Referenced by correction().

L6SLBCorrectorImpl::getBTagInfoIndex
int getBTagInfoIndex(const edm::RefToBase< reco::Jet > &refToRawJet, const std::vector< reco::SoftLeptonTagInfo > &tags) const
Definition: L6SLBCorrectorImpl.cc:119
mps_fire.i
i
Definition: mps_fire.py:428
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:640
reco::LeafCandidate::pt
double pt() const final
transverse momentum
Definition: LeafCandidate.h:146
L6SLBCorrectorImpl::bTagInfoMuon_
edm::RefProd< std::vector< reco::SoftLeptonTagInfo > > bTagInfoMuon_
Definition: L6SLBCorrectorImpl.h:80
pfClustersFromHGC3DClusters_cfi.corrector
corrector
Definition: pfClustersFromHGC3DClusters_cfi.py:5
FactorizedJetCorrectorCalculator::VariableValues
Definition: FactorizedJetCorrectorCalculator.h:18
JetCorrectionServices_cff.addMuonToJet
addMuonToJet
Definition: JetCorrectionServices_cff.py:107
reco::TrackBase::py
double py() const
y coordinate of momentum vector
Definition: TrackBase.h:643
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
L6SLBCorrectorImpl::addMuonToJet_
bool addMuonToJet_
Definition: L6SLBCorrectorImpl.h:82
L6SLBCorrectorImpl::bTagInfoElec_
edm::RefProd< std::vector< reco::SoftLeptonTagInfo > > bTagInfoElec_
Definition: L6SLBCorrectorImpl.h:81
reco::LeafCandidate::phi
double phi() const final
momentum azimuthal angle
Definition: LeafCandidate.h:148
metsig::jet
Definition: SignAlgoResolutions.h:47
Exception
Definition: hltDiff.cc:245
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:646
L6SLBCorrectorImpl::corrector_
std::shared_ptr< FactorizedJetCorrectorCalculator const > corrector_
Definition: L6SLBCorrectorImpl.h:79