CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Types | Private Member Functions | Private Attributes
Merger< InputCollection, OutputCollection, P > Class Template Reference

#include <Merger.h>

Inheritance diagram for Merger< InputCollection, OutputCollection, P >:
edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 Merger (const edm::ParameterSet &)
 constructor from parameter set More...
 
 ~Merger ()
 destructor More...
 
- 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 Types

typedef std::vector
< edm::InputTag
vtag
 vector of strings More...
 

Private Member Functions

virtual void produce (edm::Event &, const edm::EventSetup &) override
 process an event More...
 

Private Attributes

vtag src_
 labels of the collections to be merged More...
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
typedef WorkerT< EDProducerWorkerType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- 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 InputCollection, typename OutputCollection = InputCollection, typename P = typename edm::clonehelper::CloneTrait<InputCollection>::type>
class Merger< InputCollection, OutputCollection, P >

Merges an arbitrary number of collections into a single collection.

Template parameters:

Author
Luca Lista, INFN
Version
Revision:
1.3
Id:
Merger.h,v 1.3 2013/02/28 00:34:12 wmtan Exp

Definition at line 30 of file Merger.h.

Member Typedef Documentation

template<typename InputCollection , typename OutputCollection = InputCollection, typename P = typename edm::clonehelper::CloneTrait<InputCollection>::type>
typedef std::vector<edm::InputTag> Merger< InputCollection, OutputCollection, P >::vtag
private

vector of strings

Definition at line 41 of file Merger.h.

Constructor & Destructor Documentation

template<typename InputCollection , typename OutputCollection , typename P >
Merger< InputCollection, OutputCollection, P >::Merger ( const edm::ParameterSet par)
explicit

constructor from parameter set

Definition at line 47 of file Merger.h.

47  :
48  src_( par.template getParameter<vtag>( "src" ) ) {
49  produces<OutputCollection>();
50 }
vtag src_
labels of the collections to be merged
Definition: Merger.h:43
template<typename InputCollection , typename OutputCollection , typename P >
Merger< InputCollection, OutputCollection, P >::~Merger ( )

destructor

Definition at line 53 of file Merger.h.

53  {
54 }

Member Function Documentation

template<typename InputCollection , typename OutputCollection , typename P >
void Merger< InputCollection, OutputCollection, P >::produce ( edm::Event evt,
const edm::EventSetup  
)
overrideprivatevirtual

process an event

Implements edm::EDProducer.

Definition at line 57 of file Merger.h.

References trackerHits::c, clone(), coll, edm::Event::getByLabel(), h, edm::Event::put(), and alignCSCRings::s.

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

57  {
58  std::auto_ptr<OutputCollection> coll( new OutputCollection );
59  for( vtag::const_iterator s = src_.begin(); s != src_.end(); ++ s ) {
61  evt.getByLabel( * s, h );
62  for( typename InputCollection::const_iterator c = h->begin(); c != h->end(); ++c ) {
63  coll->push_back( P::clone( * c ) );
64  }
65  }
66  evt.put( coll );
67 }
std::vector< ProtoJet > OutputCollection
Definition: JetRecoTypes.h:63
vtag src_
labels of the collections to be merged
Definition: Merger.h:43
void push_back(key_type i, value_type const &j, label_type const &flav="")
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
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
Definition: eve_macros.cc:135

Member Data Documentation

template<typename InputCollection , typename OutputCollection = InputCollection, typename P = typename edm::clonehelper::CloneTrait<InputCollection>::type>
vtag Merger< InputCollection, OutputCollection, P >::src_
private

labels of the collections to be merged

Definition at line 43 of file Merger.h.