CMS 3D CMS Logo

Public Types | Public Member Functions | Private Member Functions | Private Attributes

CollectionAdder< C > Class Template Reference

#include <CollectionAdder.h>

Inheritance diagram for CollectionAdder< C >:
edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

List of all members.

Public Types

typedef C collection

Public Member Functions

 CollectionAdder (const edm::ParameterSet &cfg)

Private Member Functions

void produce (edm::Event &evt, const edm::EventSetup &)

Private Attributes

std::vector< edm::InputTagsrc_

Detailed Description

template<typename C>
class CollectionAdder< C >

Definition at line 16 of file CollectionAdder.h.


Member Typedef Documentation

template<typename C >
typedef C CollectionAdder< C >::collection

Definition at line 18 of file CollectionAdder.h.


Constructor & Destructor Documentation

template<typename C >
CollectionAdder< C >::CollectionAdder ( const edm::ParameterSet cfg) [inline]

Definition at line 19 of file CollectionAdder.h.

                                                :
    src_(cfg.template getParameter<std::vector<edm::InputTag> >("src")) {
    produces<collection>();
  }

Member Function Documentation

template<typename C >
void CollectionAdder< C >::produce ( edm::Event evt,
const edm::EventSetup  
) [inline, private, virtual]

Implements edm::EDProducer.

Definition at line 25 of file CollectionAdder.h.

References coll, edm::Event::getByLabel(), i, edm::Event::put(), align_tpl::src, and CollectionAdder< C >::src_.

                                                     {
    std::auto_ptr<collection> coll(new collection);
    typename collection::Filler filler(*coll);
    for(size_t i = 0; i < src_.size(); ++i ) {
      edm::Handle<collection> src;
      evt.getByLabel(src_[i], src);
      *coll += *src;
    }
    evt.put(coll);
  }

Member Data Documentation

template<typename C >
std::vector<edm::InputTag> CollectionAdder< C >::src_ [private]

Definition at line 24 of file CollectionAdder.h.

Referenced by CollectionAdder< C >::produce().