Produces a list of FwdPtr's to an input collection. More...
#include <CommonTools/UtilAlgos/interface/FwdPtrProducer.h>
Public Member Functions | |
FwdPtrProducer (edm::ParameterSet const ¶ms) | |
virtual void | produce (edm::Event &iEvent, const edm::EventSetup &iSetup) override |
~FwdPtrProducer () | |
Protected Attributes | |
edm::InputTag | src_ |
Produces a list of FwdPtr's to an input collection.
Definition at line 27 of file FwdPtrProducer.h.
edm::FwdPtrProducer< T, H >::FwdPtrProducer | ( | edm::ParameterSet const & | params | ) | [inline, explicit] |
Definition at line 29 of file FwdPtrProducer.h.
: src_( params.getParameter<edm::InputTag>("src") ) { produces< std::vector< edm::FwdPtr<T> > > (); }
edm::FwdPtrProducer< T, H >::~FwdPtrProducer | ( | ) | [inline] |
Definition at line 35 of file FwdPtrProducer.h.
{}
virtual void edm::FwdPtrProducer< T, H >::produce | ( | edm::Event & | iEvent, |
const edm::EventSetup & | iSetup | ||
) | [inline, override, virtual] |
Implements edm::EDProducer.
Definition at line 37 of file FwdPtrProducer.h.
References edm::Event::getByLabel(), i, edm::Event::put(), and edm::FwdPtrProducer< T, H >::src_.
{ edm::Handle< edm::View<T> > hSrc; iEvent.getByLabel( src_, hSrc ); std::auto_ptr< std::vector< edm::FwdPtr<T> > > pOutputFwdPtr ( new std::vector<edm::FwdPtr<T> > ); for ( typename edm::View<T>::const_iterator ibegin = hSrc->begin(), iend = hSrc->end(), i = ibegin; i!= iend; ++i ) { H factory; FwdPtr<T> ptr = factory( *hSrc, i - ibegin ); pOutputFwdPtr->push_back( ptr ); } iEvent.put( pOutputFwdPtr ); }
edm::InputTag edm::FwdPtrProducer< T, H >::src_ [protected] |
Definition at line 57 of file FwdPtrProducer.h.
Referenced by edm::FwdPtrProducer< T, H >::produce().