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::EDConsumerBase 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 &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndex indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Member Functions

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

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
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

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  
)
inlineoverrideprivatevirtual

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:94
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:361
JetCorrectorParametersCollection coll
Definition: classes.h:16

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