![]() |
![]() |
Public Member Functions | |
CorrectedCaloMETProducer2 (const edm::ParameterSet &cfg) | |
~CorrectedCaloMETProducer2 () | |
Private Types | |
typedef std::vector < reco::CaloMET > | METCollection |
Private Member Functions | |
reco::CaloMET | applyCorrection (const reco::CaloMET &srcMET, const CorrMETData &correction) |
reco::Candidate::LorentzVector | constructP4From (const reco::CaloMET &met, const CorrMETData &correction) |
void | produce (edm::Event &evt, const edm::EventSetup &es) |
CorrMETData | readAndSumCorrections (edm::Event &evt, const edm::EventSetup &es) |
Private Attributes | |
edm::InputTag | src_ |
std::vector< edm::InputTag > | srcCorrections_ |
Definition at line 21 of file CorrectedCaloMETProducer2.cc.
typedef std::vector<reco::CaloMET> CorrectedCaloMETProducer2::METCollection [private] |
Definition at line 37 of file CorrectedCaloMETProducer2.cc.
CorrectedCaloMETProducer2::CorrectedCaloMETProducer2 | ( | const edm::ParameterSet & | cfg | ) | [inline, explicit] |
Definition at line 26 of file CorrectedCaloMETProducer2.cc.
: src_(cfg.getParameter<edm::InputTag>("src")), srcCorrections_(cfg.getParameter<std::vector<edm::InputTag> >("srcCorrections")) { produces<METCollection>(""); }
CorrectedCaloMETProducer2::~CorrectedCaloMETProducer2 | ( | ) | [inline] |
Definition at line 33 of file CorrectedCaloMETProducer2.cc.
{ }
reco::CaloMET CorrectedCaloMETProducer2::applyCorrection | ( | const reco::CaloMET & | srcMET, |
const CorrMETData & | correction | ||
) | [inline, private] |
Definition at line 71 of file CorrectedCaloMETProducer2.cc.
References constructP4From(), reco::CaloMET::getSpecific(), reco::MET::mEtCorr(), CorrMETData::sumet, reco::MET::sumEt(), and reco::LeafCandidate::vertex().
Referenced by produce().
{ std::vector<CorrMETData> corrections = srcMET.mEtCorr(); corrections.push_back(correction); return reco::CaloMET(srcMET.getSpecific(), srcMET.sumEt() + correction.sumet, corrections, constructP4From(srcMET, correction), srcMET.vertex()); }
reco::Candidate::LorentzVector CorrectedCaloMETProducer2::constructP4From | ( | const reco::CaloMET & | met, |
const CorrMETData & | correction | ||
) | [inline, private] |
Definition at line 78 of file CorrectedCaloMETProducer2.cc.
References CorrMETData::mex, CorrMETData::mey, reco::LeafCandidate::px(), reco::LeafCandidate::py(), and mathSSE::sqrt().
Referenced by applyCorrection().
void CorrectedCaloMETProducer2::produce | ( | edm::Event & | evt, |
const edm::EventSetup & | es | ||
) | [inline, private, virtual] |
Implements edm::EDProducer.
Definition at line 42 of file CorrectedCaloMETProducer2.cc.
References applyCorrection(), edm::Event::getByLabel(), edm::Event::put(), readAndSumCorrections(), and src_.
{ edm::Handle<METCollection> srcMETCollection; evt.getByLabel(src_, srcMETCollection); const reco::CaloMET& srcMET = (*srcMETCollection)[0]; CorrMETData correction = readAndSumCorrections(evt, es); reco::CaloMET outMET = applyCorrection(srcMET, correction); std::auto_ptr<METCollection> product(new METCollection); product->push_back(outMET); evt.put(product); }
CorrMETData CorrectedCaloMETProducer2::readAndSumCorrections | ( | edm::Event & | evt, |
const edm::EventSetup & | es | ||
) | [inline, private] |
Definition at line 58 of file CorrectedCaloMETProducer2.cc.
References corr, edm::Event::getByLabel(), run_regression::ret, and srcCorrections_.
Referenced by produce().
{ CorrMETData ret; edm::Handle<CorrMETData> corr; for (std::vector<edm::InputTag>::const_iterator inputTag = srcCorrections_.begin(); inputTag != srcCorrections_.end(); ++inputTag) { evt.getByLabel(*inputTag, corr); ret += (*corr); } return ret; }
edm::InputTag CorrectedCaloMETProducer2::src_ [private] |
Definition at line 39 of file CorrectedCaloMETProducer2.cc.
Referenced by produce().
std::vector<edm::InputTag> CorrectedCaloMETProducer2::srcCorrections_ [private] |
Definition at line 40 of file CorrectedCaloMETProducer2.cc.
Referenced by readAndSumCorrections().