CMS 3D CMS Logo

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

Definition at line 29 of file AddCorrectionsToGenericMET.h.

29 {};
AddCorrectionsToGenericMET::~AddCorrectionsToGenericMET ( )
inline

Definition at line 30 of file AddCorrectionsToGenericMET.h.

30 {};

Member Function Documentation

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

Definition at line 7 of file AddCorrectionsToGenericMET.cc.

References CorrMETData::mex, CorrMETData::mey, DiDispStaMuonMonitor_cfi::pt, reco::LeafCandidate::px(), reco::LeafCandidate::py(), and mathSSE::sqrt().

Referenced by getCorrectedCaloMET(), getCorrectedMET(), and getCorrectedPFMET().

8  {
9  double px = met.px() + correction.mex;
10  double py = met.py() + correction.mey;
11  double pt = sqrt(px * px + py * py);
12  return reco::Candidate::LorentzVector(px, py, 0., pt);
13 }
double px() const final
x coordinate of momentum vector
T sqrt(T t)
Definition: SSEVec.h:19
double py() const final
y coordinate of momentum vector
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Candidate.h:36
double mey
Definition: CorrMETData.h:16
double mex
Definition: CorrMETData.h:15
reco::CaloMET AddCorrectionsToGenericMET::getCorrectedCaloMET ( const reco::CaloMET srcMET,
edm::Event evt 
)

Definition at line 47 of file AddCorrectionsToGenericMET.cc.

References constructP4From(), alignCSCRings::corr, getCorrection(), reco::CaloMET::getSpecific(), CorrMETData::sumet, reco::MET::sumEt(), and reco::LeafCandidate::vertex().

Referenced by CorrectedCaloMETProducer::produce().

47  {
48  CorrMETData corr = getCorrection(srcMET, evt);
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)
const Point & vertex() const override
vertex position (overwritten by PF...)
SpecificCaloMETData getSpecific() const
Definition: CaloMET.h:77
double sumEt() const
Definition: MET.h:56
reco::Candidate::LorentzVector constructP4From(const reco::MET &met, const CorrMETData &correction)
double sumet
Definition: CorrMETData.h:18
a MET correction term
Definition: CorrMETData.h:14
reco::MET AddCorrectionsToGenericMET::getCorrectedMET ( const reco::MET srcMET,
edm::Event evt 
)

Definition at line 28 of file AddCorrectionsToGenericMET.cc.

References constructP4From(), alignCSCRings::corr, getCorrection(), reco::MET::isWeighted(), CorrMETData::sumet, reco::MET::sumEt(), and reco::LeafCandidate::vertex().

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

28  {
29  CorrMETData corr = getCorrection(srcMET, evt);
30  reco::MET outMET(srcMET.sumEt() + corr.sumet, constructP4From(srcMET, corr), srcMET.vertex(), srcMET.isWeighted());
31 
32  return outMET;
33 }
int isWeighted() const
boolean if weights were applied by algorithm (e.g. PUPPI weights)
Definition: MET.h:79
CorrMETData getCorrection(const reco::MET &srcMET, edm::Event &evt)
const Point & vertex() const override
vertex position (overwritten by PF...)
double sumEt() const
Definition: MET.h:56
Definition: MET.h:41
reco::Candidate::LorentzVector constructP4From(const reco::MET &met, const CorrMETData &correction)
double sumet
Definition: CorrMETData.h:18
a MET correction term
Definition: CorrMETData.h:14
reco::PFMET AddCorrectionsToGenericMET::getCorrectedPFMET ( const reco::PFMET srcMET,
edm::Event evt 
)

Definition at line 36 of file AddCorrectionsToGenericMET.cc.

References constructP4From(), alignCSCRings::corr, getCorrection(), reco::PFMET::getSpecific(), reco::MET::isWeighted(), CorrMETData::sumet, reco::MET::sumEt(), and reco::LeafCandidate::vertex().

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

36  {
37  CorrMETData corr = getCorrection(srcMET, evt);
38  reco::PFMET outMET(srcMET.getSpecific(),
39  srcMET.sumEt() + corr.sumet,
40  constructP4From(srcMET, corr),
41  srcMET.vertex(),
42  srcMET.isWeighted());
43 
44  return outMET;
45 }
int isWeighted() const
boolean if weights were applied by algorithm (e.g. PUPPI weights)
Definition: MET.h:79
SpecificPFMETData getSpecific() const
Definition: PFMET.h:74
CorrMETData getCorrection(const reco::MET &srcMET, edm::Event &evt)
const Point & vertex() const override
vertex position (overwritten by PF...)
double sumEt() const
Definition: MET.h:56
reco::Candidate::LorentzVector constructP4From(const reco::MET &met, const CorrMETData &correction)
double sumet
Definition: CorrMETData.h:18
a MET correction term
Definition: CorrMETData.h:14
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:539
std::vector< edm::EDGetTokenT< CorrMETData > > corrTokens_
a MET correction term
Definition: CorrMETData.h:14
void AddCorrectionsToGenericMET::setCorTokens ( std::vector< edm::EDGetTokenT< CorrMETData > > const &  corrTokens)

Member Data Documentation

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

Definition at line 41 of file AddCorrectionsToGenericMET.h.

Referenced by getCorrection(), and setCorTokens().