CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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

Definition at line 45 of file L6SLBCorrectorImpl.h.

Constructor & Destructor Documentation

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) {}
std::shared_ptr< FactorizedJetCorrectorCalculator const > corrector_
edm::RefProd< std::vector< reco::SoftLeptonTagInfo > > bTagInfoMuon_
edm::RefProd< std::vector< reco::SoftLeptonTagInfo > > bTagInfoElec_

Member Function Documentation

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.

References Exception.

73  {
74  throw cms::Exception("EventRequired") << "Wrong interface correction(LorentzVector), event required!";
75  return 1.0;
76 }
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.

References Exception.

79  {
80  throw cms::Exception("EventRequired") << "Wrong interface correction(reco::Jet), event required!";
81  return 1.0;
82 }
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.

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(), FactorizedJetCorrectorCalculator::VariableValues::setAddLepToJet(), FactorizedJetCorrectorCalculator::VariableValues::setJetE(), FactorizedJetCorrectorCalculator::VariableValues::setJetEta(), FactorizedJetCorrectorCalculator::VariableValues::setJetPhi(), FactorizedJetCorrectorCalculator::VariableValues::setJetPt(), FactorizedJetCorrectorCalculator::VariableValues::setLepPx(), FactorizedJetCorrectorCalculator::VariableValues::setLepPy(), FactorizedJetCorrectorCalculator::VariableValues::setLepPz(), and makeHLTPrescaleTable::values.

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());
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 }
double pt() const final
transverse momentum
std::shared_ptr< FactorizedJetCorrectorCalculator const > corrector_
double px() const
x coordinate of momentum vector
Definition: TrackBase.h:640
int getBTagInfoIndex(const edm::RefToBase< reco::Jet > &refToRawJet, const std::vector< reco::SoftLeptonTagInfo > &tags) const
double pz() const
z coordinate of momentum vector
Definition: TrackBase.h:646
edm::RefProd< std::vector< reco::SoftLeptonTagInfo > > bTagInfoMuon_
edm::RefProd< std::vector< reco::SoftLeptonTagInfo > > bTagInfoElec_
double phi() const final
momentum azimuthal angle
double py() const
y coordinate of momentum vector
Definition: TrackBase.h:643
double energy() const final
energy
double eta() const final
momentum pseudorapidity
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.

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

Referenced by correction().

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

bool L6SLBCorrectorImpl::addMuonToJet_
private

Definition at line 82 of file L6SLBCorrectorImpl.h.

Referenced by correction().

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

Definition at line 81 of file L6SLBCorrectorImpl.h.

Referenced by correction().

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

Definition at line 80 of file L6SLBCorrectorImpl.h.

Referenced by correction().

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

Definition at line 79 of file L6SLBCorrectorImpl.h.

Referenced by correction().