test
CMS 3D CMS Logo

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

virtual double correction (const LorentzVector &fJet) const override
 apply correction using Jet information only More...
 
virtual double correction (const reco::Jet &fJet) const override
 apply correction using Jet information only More...
 
virtual 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)
 
virtual 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 ()
 
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 46 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 72 of file L6SLBCorrectorImpl.cc.

75  :
77  bTagInfoMuon_(bTagInfoMuon),
78  bTagInfoElec_(bTagInfoElec),
79  addMuonToJet_(addMuonToJet)
80 {
81 }
std::shared_ptr< FactorizedJetCorrectorCalculator const > corrector_
tuple corrector
Definition: mvaPFMET_cff.py:86
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 88 of file L6SLBCorrectorImpl.cc.

References Exception.

89 {
90  throw cms::Exception("EventRequired")
91  <<"Wrong interface correction(LorentzVector), event required!";
92  return 1.0;
93 }
double L6SLBCorrectorImpl::correction ( const reco::Jet fJet) const
overridevirtual

apply correction using Jet information only

Implements reco::JetCorrectorImpl.

Definition at line 97 of file L6SLBCorrectorImpl.cc.

References Exception.

98 {
99  throw cms::Exception("EventRequired")
100  <<"Wrong interface correction(reco::Jet), event required!";
101  return 1.0;
102 }
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 106 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.

108 {
110  values.setJetPt(fJet.pt());
111  values.setJetEta(fJet.eta());
112  values.setJetPhi(fJet.phi());
113  values.setJetE(fJet.energy());
114 
115  const reco::SoftLeptonTagInfo& sltMuon =
116  (*bTagInfoMuon_)[getBTagInfoIndex(refToRawJet,*bTagInfoMuon_)];
117  if (sltMuon.leptons()>0) {
118  edm::RefToBase<reco::Track> trackRef = sltMuon.lepton(0);
119  values.setLepPx(trackRef->px());
120  values.setLepPy(trackRef->py());
121  values.setLepPz(trackRef->pz());
123  return corrector_->getCorrection(values);
124  }
125  else {
126  const reco::SoftLeptonTagInfo& sltElec =
127  (*bTagInfoElec_)[getBTagInfoIndex(refToRawJet,*bTagInfoElec_)];
128  if (sltElec.leptons()>0) {
129  edm::RefToBase<reco::Track> trackRef = sltElec.lepton(0);
130  values.setLepPx(trackRef->px());
131  values.setLepPy(trackRef->py());
132  values.setLepPz(trackRef->pz());
133  values.setAddLepToJet(false);
134  return corrector_->getCorrection(values);
135  }
136  }
137  return 1.0;
138 }
virtual double energy() const final
energy
std::shared_ptr< FactorizedJetCorrectorCalculator const > corrector_
virtual double phi() const final
momentum azimuthal angle
double px() const
x coordinate of momentum vector
Definition: TrackBase.h:622
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:634
edm::RefProd< std::vector< reco::SoftLeptonTagInfo > > bTagInfoMuon_
edm::RefProd< std::vector< reco::SoftLeptonTagInfo > > bTagInfoElec_
virtual double eta() const final
momentum pseudorapidity
double py() const
y coordinate of momentum vector
Definition: TrackBase.h:628
virtual double pt() const final
transverse momentum
int L6SLBCorrectorImpl::getBTagInfoIndex ( const edm::RefToBase< reco::Jet > &  refToRawJet,
const std::vector< reco::SoftLeptonTagInfo > &  tags 
) const
private

Definition at line 146 of file L6SLBCorrectorImpl.cc.

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

Referenced by correction().

149 {
150  for (unsigned int i=0;i<tags.size();i++)
151  if (tags[i].jet().get()==refToRawJet.get()) return i;
152  return -1;
153 }
value_type const * get() const
Definition: RefToBase.h:234
int i
Definition: DBlmapReader.cc:9
tuple tags
Definition: o2o.py:248
virtual bool L6SLBCorrectorImpl::refRequired ( ) const
inlineoverridevirtual

if correction needs the jet reference

Implements reco::JetCorrectorImpl.

Definition at line 66 of file L6SLBCorrectorImpl.h.

66 {return true;}

Member Data Documentation

bool L6SLBCorrectorImpl::addMuonToJet_
private

Definition at line 85 of file L6SLBCorrectorImpl.h.

Referenced by correction().

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

Definition at line 84 of file L6SLBCorrectorImpl.h.

Referenced by correction().

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

Definition at line 83 of file L6SLBCorrectorImpl.h.

Referenced by correction().

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

Definition at line 82 of file L6SLBCorrectorImpl.h.

Referenced by correction().