CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | 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

Public Types

typedef C collection
 
- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
typedef WorkerT< EDProducerWorkerType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 

Public Member Functions

 CollectionAdder (const edm::ParameterSet &cfg)
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
boost::function< void(const
BranchDescription &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 

Private Member Functions

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

Private Attributes

std::vector< edm::InputTagsrc_
 

Additional Inherited Members

- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDProducer
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::ProducerBase
template<class TProducer , class TMethod >
void callWhenNewProductsRegistered (TProducer *iProd, TMethod iMethod)
 

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.

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

Member Function Documentation

template<typename C >
void CollectionAdder< C >::produce ( edm::Event evt,
const edm::EventSetup  
)
inlineprivatevirtual

Implements edm::EDProducer.

Definition at line 25 of file CollectionAdder.h.

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

Referenced by JSONExport.JsonExport::export(), HTMLExport.HTMLExport::export(), and HTMLExport.HTMLExportStatic::export().

25  {
26  std::auto_ptr<collection> coll(new collection);
27  typename collection::Filler filler(*coll);
28  for(size_t i = 0; i < src_.size(); ++i ) {
30  evt.getByLabel(src_[i], src);
31  *coll += *src;
32  }
33  evt.put(coll);
34  }
int i
Definition: DBlmapReader.cc:9
std::vector< edm::InputTag > src_
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:85
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
JetCorrectorParametersCollection coll
Definition: classes.h:14

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().