#include <PFchsMETcorrInputProducer.h>
Public Member Functions | |
PFchsMETcorrInputProducer (const edm::ParameterSet &) | |
~PFchsMETcorrInputProducer () | |
Private Member Functions | |
void | produce (edm::Event &, const edm::EventSetup &) |
Private Attributes | |
unsigned | goodVtxNdof_ |
double | goodVtxZ_ |
std::string | moduleLabel_ |
edm::InputTag | src_ |
Sum PF Charged Particles Originating from the primary vertices which are not primary vertex of the high-pT events needed as input for Type 0 MET corrections
Definition at line 32 of file PFchsMETcorrInputProducer.h.
PFchsMETcorrInputProducer::PFchsMETcorrInputProducer | ( | const edm::ParameterSet & | cfg | ) | [explicit] |
Definition at line 7 of file PFchsMETcorrInputProducer.cc.
: moduleLabel_(cfg.getParameter<std::string>("@module_label")), src_(cfg.getParameter<edm::InputTag>("src")), goodVtxNdof_(cfg.getParameter<unsigned int>("goodVtxNdof")), goodVtxZ_(cfg.getParameter<double>("goodVtxZ")) { produces<CorrMETData>("type0"); }
PFchsMETcorrInputProducer::~PFchsMETcorrInputProducer | ( | ) |
Definition at line 16 of file PFchsMETcorrInputProducer.cc.
{ }
void PFchsMETcorrInputProducer::produce | ( | edm::Event & | evt, |
const edm::EventSetup & | es | ||
) | [private, virtual] |
Implements edm::EDProducer.
Definition at line 21 of file PFchsMETcorrInputProducer.cc.
References edm::Event::getByLabel(), goodVtxNdof_, goodVtxZ_, i, reco::Vertex::isFake(), reco::Vertex::ndof(), edm::Event::put(), src_, reco::Vertex::tracks_begin(), reco::Vertex::tracks_end(), findQualityFiles::v, and reco::Vertex::z().
{ edm::Handle<reco::VertexCollection> recVtxs; evt.getByLabel(src_, recVtxs); std::auto_ptr<CorrMETData> chsSum(new CorrMETData()); for (unsigned i = 1; i < recVtxs->size(); ++i) { const reco::Vertex& v = recVtxs->at(i); if (v.isFake()) continue; if (v.ndof() < goodVtxNdof_) continue; if (fabs(v.z()) > goodVtxZ_) continue; for (reco::Vertex::trackRef_iterator track = v.tracks_begin(); track != v.tracks_end(); ++track) { if ((*track)->charge() != 0) { chsSum->mex += (*track)->px(); chsSum->mey += (*track)->py(); chsSum->sumet += (*track)->pt(); } } } evt.put(chsSum, "type0"); }
unsigned PFchsMETcorrInputProducer::goodVtxNdof_ [private] |
Definition at line 47 of file PFchsMETcorrInputProducer.h.
Referenced by produce().
double PFchsMETcorrInputProducer::goodVtxZ_ [private] |
Definition at line 48 of file PFchsMETcorrInputProducer.h.
Referenced by produce().
std::string PFchsMETcorrInputProducer::moduleLabel_ [private] |
Definition at line 43 of file PFchsMETcorrInputProducer.h.
edm::InputTag PFchsMETcorrInputProducer::src_ [private] |
Definition at line 45 of file PFchsMETcorrInputProducer.h.
Referenced by produce().