CMS 3D CMS Logo

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

#include <AddCorrectionsToGenericMET.h>

Public Member Functions

 AddCorrectionsToGenericMET ()
 
reco::CaloMET getCorrectedCaloMET (const reco::CaloMET &srcMET, edm::Event &evt, const edm::EventSetup &es)
 
reco::MET getCorrectedMET (const reco::MET &srcMET, edm::Event &evt, const edm::EventSetup &es)
 
reco::PFMET getCorrectedPFMET (const reco::PFMET &srcMET, edm::Event &evt, const edm::EventSetup &es)
 
void setCorTokens (std::vector< edm::EDGetTokenT< CorrMETData > > const &corrTokens)
 
 ~AddCorrectionsToGenericMET ()
 

Private Member Functions

reco::Candidate::LorentzVector constructP4From (const reco::MET &met, const CorrMETData &correction)
 
CorrMETData getCorrection (const reco::MET &srcMET, edm::Event &evt, const edm::EventSetup &es)
 

Private Attributes

std::vector< edm::EDGetTokenT< CorrMETData > > corrTokens_
 

Detailed Description

generic class for MET corrections

Authors
Matthieu Marionneau, ETHZ

Definition at line 27 of file AddCorrectionsToGenericMET.h.

Constructor & Destructor Documentation

◆ AddCorrectionsToGenericMET()

AddCorrectionsToGenericMET::AddCorrectionsToGenericMET ( )
inline

Definition at line 29 of file AddCorrectionsToGenericMET.h.

29 {};

◆ ~AddCorrectionsToGenericMET()

AddCorrectionsToGenericMET::~AddCorrectionsToGenericMET ( )
inline

Definition at line 30 of file AddCorrectionsToGenericMET.h.

30 {};

Member Function Documentation

◆ constructP4From()

reco::Candidate::LorentzVector AddCorrectionsToGenericMET::constructP4From ( const reco::MET met,
const CorrMETData correction 
)
private

◆ getCorrectedCaloMET()

reco::CaloMET AddCorrectionsToGenericMET::getCorrectedCaloMET ( const reco::CaloMET srcMET,
edm::Event evt,
const edm::EventSetup es 
)

Definition at line 53 of file AddCorrectionsToGenericMET.cc.

55  {
57  reco::CaloMET outMET(
58  srcMET.getSpecific(), srcMET.sumEt() + corr.sumet, constructP4From(srcMET, corr), srcMET.vertex());
59 
60  return outMET;
61 }

References constructP4From(), alignCSCRings::corr, getCorrection(), and correctionTermsCaloMet_cff::srcMET.

Referenced by CorrectedCaloMETProducer::produce().

◆ getCorrectedMET()

reco::MET AddCorrectionsToGenericMET::getCorrectedMET ( const reco::MET srcMET,
edm::Event evt,
const edm::EventSetup es 
)

◆ getCorrectedPFMET()

reco::PFMET AddCorrectionsToGenericMET::getCorrectedPFMET ( const reco::PFMET srcMET,
edm::Event evt,
const edm::EventSetup es 
)

Definition at line 40 of file AddCorrectionsToGenericMET.cc.

42  {
44  reco::PFMET outMET(srcMET.getSpecific(),
45  srcMET.sumEt() + corr.sumet,
47  srcMET.vertex(),
48  srcMET.isWeighted());
49 
50  return outMET;
51 }

References constructP4From(), alignCSCRings::corr, getCorrection(), and correctionTermsCaloMet_cff::srcMET.

Referenced by CorrectedPFMETProducer::produce(), and CorrectedPatMETProducer::produce().

◆ getCorrection()

CorrMETData AddCorrectionsToGenericMET::getCorrection ( const reco::MET srcMET,
edm::Event evt,
const edm::EventSetup es 
)
private

Definition at line 15 of file AddCorrectionsToGenericMET.cc.

17  {
18  CorrMETData sumCor;
20  for (std::vector<edm::EDGetTokenT<CorrMETData> >::const_iterator corrToken = corrTokens_.begin();
21  corrToken != corrTokens_.end();
22  ++corrToken) {
23  evt.getByToken(*corrToken, corr);
24  sumCor += (*corr);
25  }
26 
27  return sumCor;
28 }

References alignCSCRings::corr, corrTokens_, and edm::Event::getByToken().

Referenced by JetReCalibrator.JetReCalibrator::correct(), getCorrectedCaloMET(), getCorrectedMET(), and getCorrectedPFMET().

◆ setCorTokens()

void AddCorrectionsToGenericMET::setCorTokens ( std::vector< edm::EDGetTokenT< CorrMETData > > const &  corrTokens)

Member Data Documentation

◆ corrTokens_

std::vector<edm::EDGetTokenT<CorrMETData> > AddCorrectionsToGenericMET::corrTokens_
private

Definition at line 41 of file AddCorrectionsToGenericMET.h.

Referenced by getCorrection(), and setCorTokens().

DiDispStaMuonMonitor_cfi.pt
pt
Definition: DiDispStaMuonMonitor_cfi.py:39
edm::EDGetTokenT< CorrMETData >
multPhiCorr_741_25nsDY_cfi.py
py
Definition: multPhiCorr_741_25nsDY_cfi.py:12
edm::Handle
Definition: AssociativeIterator.h:50
BTaggingMonitor_cfi.met
met
Definition: BTaggingMonitor_cfi.py:84
reco::CaloMET
Definition: CaloMET.h:21
reco::MET
Definition: MET.h:41
alignCSCRings.corr
dictionary corr
Definition: alignCSCRings.py:124
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
CorrMETData
a MET correction term
Definition: CorrMETData.h:14
edm::Event::getByToken
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:528
reco::PFMET
Definition: PFMET.h:18
AddCorrectionsToGenericMET::corrTokens_
std::vector< edm::EDGetTokenT< CorrMETData > > corrTokens_
Definition: AddCorrectionsToGenericMET.h:41
pfMETCorrectionType0_cfi.correction
correction
Definition: pfMETCorrectionType0_cfi.py:39
AddCorrectionsToGenericMET::getCorrection
CorrMETData getCorrection(const reco::MET &srcMET, edm::Event &evt, const edm::EventSetup &es)
Definition: AddCorrectionsToGenericMET.cc:15
multPhiCorr_741_25nsDY_cfi.px
px
Definition: multPhiCorr_741_25nsDY_cfi.py:10
AddCorrectionsToGenericMET::constructP4From
reco::Candidate::LorentzVector constructP4From(const reco::MET &met, const CorrMETData &correction)
Definition: AddCorrectionsToGenericMET.cc:7
correctionTermsCaloMet_cff.srcMET
srcMET
Definition: correctionTermsCaloMet_cff.py:14
reco::Candidate::LorentzVector
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Candidate.h:36