#include <CandidateProducer.h>
Public Member Functions | |
CandidateProducer (const edm::ParameterSet &cfg) | |
constructor from parameter set | |
~CandidateProducer () | |
destructor | |
Private Member Functions | |
void | beginRun (edm::Run &, const edm::EventSetup &es) |
begin job (first run) | |
void | produce (edm::Event &evt, const edm::EventSetup &es) |
process one event | |
Private Attributes | |
Conv | converter_ |
converter helper | |
bool | initialized_ |
particles initialized? | |
Selector | selector_ |
selector | |
edm::InputTag | src_ |
label of source collection and tag |
Framework module that produces a collection of candidates from generic compoment
Definition at line 68 of file CandidateProducer.h.
CandidateProducer< TColl, CColl, Selector, Conv, Creator, Init >::CandidateProducer | ( | const edm::ParameterSet & | cfg | ) | [inline] |
constructor from parameter set
Definition at line 71 of file CandidateProducer.h.
: src_(cfg.template getParameter<edm::InputTag>("src")), converter_(cfg), selector_(reco::modules::make<Selector>(cfg)), initialized_(false) { produces<CColl>(); }
CandidateProducer< TColl, CColl, Selector, Conv, Creator, Init >::~CandidateProducer | ( | ) | [inline] |
void CandidateProducer< TColl, CColl, Selector, Conv, Creator, Init >::beginRun | ( | edm::Run & | , |
const edm::EventSetup & | es | ||
) | [inline, private, virtual] |
begin job (first run)
Reimplemented from edm::EDProducer.
Definition at line 83 of file CandidateProducer.h.
References CandidateProducer< TColl, CColl, Selector, Conv, Creator, Init >::converter_, and CandidateProducer< TColl, CColl, Selector, Conv, Creator, Init >::initialized_.
{ if (!initialized_) { converter_.beginFirstRun(es); initialized_ = true; } }
void CandidateProducer< TColl, CColl, Selector, Conv, Creator, Init >::produce | ( | edm::Event & | evt, |
const edm::EventSetup & | es | ||
) | [inline, private, virtual] |
process one event
Implements edm::EDProducer.
Definition at line 90 of file CandidateProducer.h.
References CandidateProducer< TColl, CColl, Selector, Conv, Creator, Init >::converter_, SurfaceDeformationFactory::create(), edm::Event::getByLabel(), init, funct::master(), edm::Event::put(), CandidateProducer< TColl, CColl, Selector, Conv, Creator, Init >::selector_, findQualityFiles::size, alcazmumu_cfi::src, and CandidateProducer< TColl, CColl, Selector, Conv, Creator, Init >::src_.
{ edm::Handle<TColl> src; evt.getByLabel(src_, src); Init::init(selector_, evt, es); ::helper::MasterCollection<TColl> master(src); std::auto_ptr<CColl> cands(new CColl); if(src->size()!= 0) { size_t size = src->size(); cands->reserve(size); for(size_t idx = 0; idx != size; ++ idx) { if(selector_((*src)[idx])) Creator::create(master.index(idx), *cands, master, converter_); } } evt.put(cands); }
Conv CandidateProducer< TColl, CColl, Selector, Conv, Creator, Init >::converter_ [private] |
converter helper
Definition at line 109 of file CandidateProducer.h.
Referenced by CandidateProducer< TColl, CColl, Selector, Conv, Creator, Init >::beginRun(), and CandidateProducer< TColl, CColl, Selector, Conv, Creator, Init >::produce().
bool CandidateProducer< TColl, CColl, Selector, Conv, Creator, Init >::initialized_ [private] |
particles initialized?
Definition at line 113 of file CandidateProducer.h.
Referenced by CandidateProducer< TColl, CColl, Selector, Conv, Creator, Init >::beginRun().
Selector CandidateProducer< TColl, CColl, Selector, Conv, Creator, Init >::selector_ [private] |
selector
Definition at line 111 of file CandidateProducer.h.
Referenced by CandidateProducer< TColl, CColl, Selector, Conv, Creator, Init >::produce().
edm::InputTag CandidateProducer< TColl, CColl, Selector, Conv, Creator, Init >::src_ [private] |
label of source collection and tag
Definition at line 107 of file CandidateProducer.h.
Referenced by CandidateProducer< TColl, CColl, Selector, Conv, Creator, Init >::produce().