#include <RecoMuon/TrackerSeedGenerator/plugins/CollectionCombiner.h>
Public Member Functions | |
CollectionCombiner (const edm::ParameterSet &) | |
~CollectionCombiner () | |
Private Member Functions | |
virtual void | beginJob (const edm::EventSetup &) |
virtual void | endJob () |
virtual void | produce (edm::Event &, const edm::EventSetup &) |
Private Attributes | |
std::vector< edm::InputTag > | labels |
the usage is to declare a concrete combiner in SealModule: typedef CollectionCombiner<std::vector< Trajectory> > TrajectoryCombiner; DEFINE_ANOTHER_FWK_MODULE(TrajectoryCombiner); edm::View cannot be used, because the template argument is used for the input and the output type.
Definition at line 29 of file CollectionCombiner.h.
CollectionCombiner< Collection >::CollectionCombiner | ( | const edm::ParameterSet & | iConfig | ) | [inline, explicit] |
Definition at line 44 of file CollectionCombiner.h.
References edm::ParameterSet::getParameter(), and CollectionCombiner< Collection >::labels.
00044 { 00045 labels = iConfig.getParameter<std::vector<edm::InputTag> >("labels"); 00046 produces<Collection>(); 00047 }
CollectionCombiner< Collection >::~CollectionCombiner | ( | ) | [inline] |
void CollectionCombiner< Collection >::beginJob | ( | const edm::EventSetup & | ) | [inline, private, virtual] |
void CollectionCombiner< Collection >::endJob | ( | void | ) | [inline, private, virtual] |
void CollectionCombiner< Collection >::produce | ( | edm::Event & | iEvent, | |
const edm::EventSetup & | es | |||
) | [inline, private, virtual] |
Implements edm::EDProducer.
Definition at line 55 of file CollectionCombiner.h.
References edm::Event::getByLabel(), i, CollectionCombiner< Collection >::labels, and edm::Event::put().
00056 { 00057 uint i=0,i_max=labels.size(); 00058 edm::Handle<Collection> handle; 00059 std::auto_ptr<Collection> merged(new Collection()); 00060 for (;i!=i_max;++i){ 00061 iEvent.getByLabel(labels[i], handle); 00062 merged->insert(merged->end(), handle->begin(), handle->end()); 00063 } 00064 iEvent.put(merged); 00065 }
std::vector<edm::InputTag> CollectionCombiner< Collection >::labels [private] |
Definition at line 40 of file CollectionCombiner.h.
Referenced by CollectionCombiner< Collection >::CollectionCombiner(), and CollectionCombiner< Collection >::produce().