CMS 3D CMS Logo

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

Definition at line 30 of file AddCorrectionsToGenericMET.h.

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

Definition at line 31 of file AddCorrectionsToGenericMET.h.

31 {};

Member Function Documentation

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

Definition at line 9 of file AddCorrectionsToGenericMET.cc.

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

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

10  {
11  double px = met.px() + correction.mex;
12  double py = met.py() + correction.mey;
13  double pt = sqrt(px*px + py*py);
14  return reco::Candidate::LorentzVector(px, py, 0., pt);
15 }
T sqrt(T t)
Definition: SSEVec.h:48
virtual double px() const
x coordinate of momentum vector
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Candidate.h:37
double mey
Definition: CorrMETData.h:18
double mex
Definition: CorrMETData.h:17
virtual double py() const
y coordinate of momentum vector
reco::CaloMET AddCorrectionsToGenericMET::getCorrectedCaloMET ( const reco::CaloMET srcMET,
edm::Event evt,
const edm::EventSetup es 
)

Definition at line 52 of file AddCorrectionsToGenericMET.cc.

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

Referenced by CorrectedCaloMETProducer::produce().

52  {
53 
54  CorrMETData corr = getCorrection(srcMET, evt, es);
55  reco::CaloMET outMET(srcMET.getSpecific(),srcMET.sumEt()+corr.sumet, constructP4From(srcMET, corr), srcMET.vertex() );
56 
57  return outMET;
58 }
virtual const Point & vertex() const
vertex position (overwritten by PF...)
SpecificCaloMETData getSpecific() const
Definition: CaloMET.h:79
double sumEt() const
Definition: MET.h:56
reco::Candidate::LorentzVector constructP4From(const reco::MET &met, const CorrMETData &correction)
double sumet
Definition: CorrMETData.h:20
JetCorrectorParameters corr
Definition: classes.h:5
a MET correction term
Definition: CorrMETData.h:14
CorrMETData getCorrection(const reco::MET &srcMET, edm::Event &evt, const edm::EventSetup &es)
reco::MET AddCorrectionsToGenericMET::getCorrectedMET ( const reco::MET srcMET,
edm::Event evt,
const edm::EventSetup es 
)

Definition at line 32 of file AddCorrectionsToGenericMET.cc.

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

Referenced by CorrectedPATMETProducer::produce().

32  {
33 
34  CorrMETData corr = getCorrection(srcMET, evt, es);
35  reco::MET outMET(srcMET.sumEt()+corr.sumet, constructP4From(srcMET, corr), srcMET.vertex() );
36 
37  return outMET;
38 }
virtual const Point & vertex() const
vertex position (overwritten by PF...)
double sumEt() const
Definition: MET.h:56
Definition: MET.h:42
reco::Candidate::LorentzVector constructP4From(const reco::MET &met, const CorrMETData &correction)
double sumet
Definition: CorrMETData.h:20
JetCorrectorParameters corr
Definition: classes.h:5
a MET correction term
Definition: CorrMETData.h:14
CorrMETData getCorrection(const reco::MET &srcMET, edm::Event &evt, const edm::EventSetup &es)
reco::PFMET AddCorrectionsToGenericMET::getCorrectedPFMET ( const reco::PFMET srcMET,
edm::Event evt,
const edm::EventSetup es 
)

Definition at line 42 of file AddCorrectionsToGenericMET.cc.

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

Referenced by CorrectedPFMETProducer::produce().

42  {
43 
44  CorrMETData corr = getCorrection(srcMET, evt, es);
45  reco::PFMET outMET(srcMET.getSpecific(),srcMET.sumEt()+corr.sumet, constructP4From(srcMET, corr), srcMET.vertex() );
46 
47  return outMET;
48 }
SpecificPFMETData getSpecific() const
Definition: PFMET.h:72
virtual const Point & vertex() const
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:20
JetCorrectorParameters corr
Definition: classes.h:5
a MET correction term
Definition: CorrMETData.h:14
CorrMETData getCorrection(const reco::MET &srcMET, edm::Event &evt, const edm::EventSetup &es)
CorrMETData AddCorrectionsToGenericMET::getCorrection ( const reco::MET srcMET,
edm::Event evt,
const edm::EventSetup es 
)
private

Definition at line 19 of file AddCorrectionsToGenericMET.cc.

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

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

19  {
20  CorrMETData sumCor;
22  for (std::vector<edm::EDGetTokenT<CorrMETData> >::const_iterator corrToken = corrTokens_.begin(); corrToken != corrTokens_.end(); ++corrToken) {
23  evt.getByToken(*corrToken, corr);
24  sumCor += (*corr);
25  }
26 
27  return sumCor;
28 }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:464
std::vector< edm::EDGetTokenT< CorrMETData > > corrTokens_
JetCorrectorParameters corr
Definition: classes.h:5
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 43 of file AddCorrectionsToGenericMET.h.

Referenced by getCorrection(), and setCorTokens().