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)
 
reco::MET getCorrectedMET (const reco::MET &srcMET, edm::Event &evt)
 
reco::PFMET getCorrectedPFMET (const reco::PFMET &srcMET, edm::Event &evt)
 
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)
 

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 
)

Definition at line 47 of file AddCorrectionsToGenericMET.cc.

47  {
49  reco::CaloMET outMET(
50  srcMET.getSpecific(), srcMET.sumEt() + corr.sumet, constructP4From(srcMET, corr), srcMET.vertex());
51 
52  return outMET;
53 }

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 
)

◆ getCorrectedPFMET()

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

Definition at line 36 of file AddCorrectionsToGenericMET.cc.

36  {
38  reco::PFMET outMET(srcMET.getSpecific(),
39  srcMET.sumEt() + corr.sumet,
41  srcMET.vertex(),
42  srcMET.isWeighted());
43 
44  return outMET;
45 }

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 
)
private

Definition at line 15 of file AddCorrectionsToGenericMET.cc.

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

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

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:539
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
trackerHitRTTI::vector
Definition: trackerHitRTTI.h:21
AddCorrectionsToGenericMET::getCorrection
CorrMETData getCorrection(const reco::MET &srcMET, edm::Event &evt)
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