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.

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

Referenced by CorrectedCaloMETProducer::produce().

47  {
49  reco::CaloMET outMET(
50  srcMET.getSpecific(), srcMET.sumEt() + corr.sumet, constructP4From(srcMET, corr), srcMET.vertex());
51 
52  return outMET;
53 }
CorrMETData getCorrection(const reco::MET &srcMET, edm::Event &evt)
dictionary corr
reco::Candidate::LorentzVector constructP4From(const reco::MET &met, const CorrMETData &correction)
a MET correction term
Definition: CorrMETData.h:14

◆ getCorrectedMET()

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

Definition at line 28 of file AddCorrectionsToGenericMET.cc.

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

Referenced by CorrectedPATMETProducer::produce(), CorrectedPatMETProducer::produce(), and runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties::toolCode().

28  {
30  reco::MET outMET(srcMET.sumEt() + corr.sumet, constructP4From(srcMET, corr), srcMET.vertex(), srcMET.isWeighted());
31 
32  return outMET;
33 }
CorrMETData getCorrection(const reco::MET &srcMET, edm::Event &evt)
dictionary corr
Definition: MET.h:41
reco::Candidate::LorentzVector constructP4From(const reco::MET &met, const CorrMETData &correction)
a MET correction term
Definition: CorrMETData.h:14

◆ getCorrectedPFMET()

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

Definition at line 36 of file AddCorrectionsToGenericMET.cc.

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

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

36  {
38  reco::PFMET outMET(srcMET.getSpecific(),
39  srcMET.sumEt() + corr.sumet,
41  srcMET.vertex(),
42  srcMET.isWeighted());
43 
44  return outMET;
45 }
CorrMETData getCorrection(const reco::MET &srcMET, edm::Event &evt)
dictionary corr
reco::Candidate::LorentzVector constructP4From(const reco::MET &met, const CorrMETData &correction)
a MET correction term
Definition: CorrMETData.h:14

◆ getCorrection()

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

Definition at line 15 of file AddCorrectionsToGenericMET.cc.

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

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

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 }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:528
std::vector< edm::EDGetTokenT< CorrMETData > > corrTokens_
dictionary corr
a MET correction term
Definition: CorrMETData.h:14

◆ 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().