#include <ElectronIDExternalProducer.h>
Public Member Functions | |
ElectronIDExternalProducer (const edm::ParameterSet &iConfig) | |
void | produce (edm::Event &iEvent, const edm::EventSetup &iSetup) |
virtual | ~ElectronIDExternalProducer () |
Private Attributes | |
algo | select_ |
edm::InputTag | src_ |
Definition at line 17 of file ElectronIDExternalProducer.h.
ElectronIDExternalProducer< algo >::ElectronIDExternalProducer | ( | const edm::ParameterSet & | iConfig | ) | [inline, explicit] |
Definition at line 19 of file ElectronIDExternalProducer.h.
: src_(iConfig.getParameter<edm::InputTag>("src")), select_(iConfig) { produces<edm::ValueMap<float> >(); }
virtual ElectronIDExternalProducer< algo >::~ElectronIDExternalProducer | ( | ) | [inline, virtual] |
Definition at line 26 of file ElectronIDExternalProducer.h.
{}
void ElectronIDExternalProducer< algo >::produce | ( | edm::Event & | iEvent, |
const edm::EventSetup & | iSetup | ||
) | [virtual] |
Implements edm::EDProducer.
Definition at line 37 of file ElectronIDExternalProducer.h.
References edm::helper::Filler< Map >::fill(), edm::Event::getByLabel(), edm::helper::Filler< Map >::insert(), dbtoconf::out, edm::Event::put(), and makeHLTPrescaleTable::values.
{ // read input collection edm::Handle<reco::GsfElectronCollection> electrons; iEvent.getByLabel(src_, electrons); // initialize common selector select_.newEvent(iEvent, iSetup); // prepare room for output std::vector<float> values; values.reserve(electrons->size()); for ( reco::GsfElectronCollection::const_iterator eleIt = electrons->begin () ; eleIt != electrons->end () ; ++eleIt ) { values.push_back( float( select_((*eleIt),iEvent,iSetup) ) ); } // fill in the ValueMap std::auto_ptr<edm::ValueMap<float> > out(new edm::ValueMap<float>()); edm::ValueMap<float>::Filler filler(*out); filler.insert(electrons, values.begin(), values.end()); filler.fill(); // and put it into the event iEvent.put(out); }
algo ElectronIDExternalProducer< algo >::select_ [private] |
Definition at line 32 of file ElectronIDExternalProducer.h.
edm::InputTag ElectronIDExternalProducer< algo >::src_ [private] |
Definition at line 31 of file ElectronIDExternalProducer.h.