#include <ShallowCloneProducer.h>
Public Member Functions | |
ShallowCloneProducer (const edm::ParameterSet &) | |
constructor from parameter set | |
~ShallowCloneProducer () | |
destructor | |
Private Member Functions | |
virtual void | produce (edm::Event &, const edm::EventSetup &) |
process an event | |
Private Attributes | |
edm::InputTag | src_ |
labels of the collection to be converted |
Clones a concrete Candidate collection to a CandidateCollection (i.e.: OwnVector<Candidate>) filled with shallow clones of the original candidate collection
Template parameters:
Definition at line 23 of file ShallowCloneProducer.h.
ShallowCloneProducer< C >::ShallowCloneProducer | ( | const edm::ParameterSet & | par | ) | [explicit] |
constructor from parameter set
Definition at line 38 of file ShallowCloneProducer.h.
: src_( par.template getParameter<edm::InputTag>( "src" ) ) { produces<reco::CandidateCollection>(); }
ShallowCloneProducer< C >::~ShallowCloneProducer | ( | ) |
void ShallowCloneProducer< C >::produce | ( | edm::Event & | evt, |
const edm::EventSetup & | |||
) | [private, virtual] |
process an event
Implements edm::EDProducer.
Definition at line 48 of file ShallowCloneProducer.h.
References coll, edm::Event::getByLabel(), i, and edm::Event::put().
{ std::auto_ptr<reco::CandidateCollection> coll( new reco::CandidateCollection ); edm::Handle<C> masterCollection; evt.getByLabel( src_, masterCollection ); for( size_t i = 0; i < masterCollection->size(); ++i ) { reco::CandidateBaseRef masterClone( edm::Ref<C>( masterCollection, i ) ); coll->push_back( new reco::ShallowCloneCandidate( masterClone ) ); } evt.put( coll ); }
edm::InputTag ShallowCloneProducer< C >::src_ [private] |
labels of the collection to be converted
Definition at line 34 of file ShallowCloneProducer.h.