#include <PFCandMETcorrInputProducer.h>
Classes | |
struct | binningEntryType |
Public Member Functions | |
PFCandMETcorrInputProducer (const edm::ParameterSet &) | |
~PFCandMETcorrInputProducer () | |
Private Member Functions | |
void | produce (edm::Event &, const edm::EventSetup &) |
Private Attributes | |
std::vector< binningEntryType * > | binning_ |
std::string | moduleLabel_ |
edm::InputTag | src_ |
Sum PFCandidates not within jets ("unclustered energy"), needed as input for Type 2 MET corrections
Definition at line 32 of file PFCandMETcorrInputProducer.h.
PFCandMETcorrInputProducer::PFCandMETcorrInputProducer | ( | const edm::ParameterSet & | cfg | ) | [explicit] |
Definition at line 5 of file PFCandMETcorrInputProducer.cc.
References binning_, edm::ParameterSet::exists(), edm::ParameterSet::getParameter(), and src_.
: moduleLabel_(cfg.getParameter<std::string>("@module_label")) { src_ = cfg.getParameter<edm::InputTag>("src"); if ( cfg.exists("binning") ) { typedef std::vector<edm::ParameterSet> vParameterSet; vParameterSet cfgBinning = cfg.getParameter<vParameterSet>("binning"); for ( vParameterSet::const_iterator cfgBinningEntry = cfgBinning.begin(); cfgBinningEntry != cfgBinning.end(); ++cfgBinningEntry ) { binning_.push_back(new binningEntryType(*cfgBinningEntry)); } } else { binning_.push_back(new binningEntryType()); } for ( std::vector<binningEntryType*>::const_iterator binningEntry = binning_.begin(); binningEntry != binning_.end(); ++binningEntry ) { produces<CorrMETData>((*binningEntry)->binLabel_); } }
PFCandMETcorrInputProducer::~PFCandMETcorrInputProducer | ( | ) |
Definition at line 27 of file PFCandMETcorrInputProducer.cc.
References binning_.
void PFCandMETcorrInputProducer::produce | ( | edm::Event & | evt, |
const edm::EventSetup & | es | ||
) | [private, virtual] |
Implements edm::EDProducer.
Definition at line 35 of file PFCandMETcorrInputProducer.cc.
References binning_, edm::Event::getByLabel(), edm::Event::put(), and src_.
{ for ( std::vector<binningEntryType*>::iterator binningEntry = binning_.begin(); binningEntry != binning_.end(); ++binningEntry ) { (*binningEntry)->binUnclEnergySum_ = CorrMETData(); } typedef edm::View<reco::Candidate> CandidateView; edm::Handle<CandidateView> cands; evt.getByLabel(src_, cands); for ( edm::View<reco::Candidate>::const_iterator cand = cands->begin(); cand != cands->end(); ++cand ) { for ( std::vector<binningEntryType*>::iterator binningEntry = binning_.begin(); binningEntry != binning_.end(); ++binningEntry ) { if ( !(*binningEntry)->binSelection_ || (*(*binningEntry)->binSelection_)(cand->p4()) ) { (*binningEntry)->binUnclEnergySum_.mex += cand->px(); (*binningEntry)->binUnclEnergySum_.mey += cand->py(); (*binningEntry)->binUnclEnergySum_.sumet += cand->et(); } } } //--- add momentum sum of PFCandidates not within jets ("unclustered energy") to the event for ( std::vector<binningEntryType*>::const_iterator binningEntry = binning_.begin(); binningEntry != binning_.end(); ++binningEntry ) { evt.put(std::auto_ptr<CorrMETData>(new CorrMETData((*binningEntry)->binUnclEnergySum_)), (*binningEntry)->binLabel_); } }
std::vector<binningEntryType*> PFCandMETcorrInputProducer::binning_ [private] |
Definition at line 65 of file PFCandMETcorrInputProducer.h.
Referenced by PFCandMETcorrInputProducer(), produce(), and ~PFCandMETcorrInputProducer().
std::string PFCandMETcorrInputProducer::moduleLabel_ [private] |
Definition at line 43 of file PFCandMETcorrInputProducer.h.
Definition at line 45 of file PFCandMETcorrInputProducer.h.
Referenced by PFCandMETcorrInputProducer(), and produce().