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 Member Functions | Private Attributes
CandViewRefMerger Class Reference
Inheritance diagram for CandViewRefMerger:
edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

Public Member Functions

 CandViewRefMerger (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

- 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
template<class TProducer , class TMethod >
void callWhenNewProductsRegistered (TProducer *iProd, TMethod iMethod)
 

Detailed Description

Definition at line 16 of file CandViewRefMerger.cc.

Constructor & Destructor Documentation

CandViewRefMerger::CandViewRefMerger ( const edm::ParameterSet cfg)
inlineexplicit

Definition at line 18 of file CandViewRefMerger.cc.

18  :
19  src_(cfg.getParameter<std::vector<edm::InputTag> >("src")) {
20  produces<std::vector<reco::CandidateBaseRef> >();
21  }
T getParameter(std::string const &) const
std::vector< edm::InputTag > src_

Member Function Documentation

void CandViewRefMerger::produce ( edm::Event evt,
const edm::EventSetup  
)
inlineprivatevirtual

Implements edm::EDProducer.

Definition at line 23 of file CandViewRefMerger.cc.

References edm::RefToBaseVector< T >::begin(), edm::RefToBaseVector< T >::end(), edm::Event::getByLabel(), i, j, dbtoconf::out, edm::Event::put(), alcazmumu_cfi::src, and src_.

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

23  {
24  std::auto_ptr<std::vector<reco::CandidateBaseRef> > out(new std::vector<reco::CandidateBaseRef>);
25  for(std::vector<edm::InputTag>::const_iterator i = src_.begin(); i != src_.end(); ++i) {
27  evt.getByLabel(*i, src);
28  reco::CandidateBaseRefVector refs = src->refVector();
29  for(reco::CandidateBaseRefVector::const_iterator j = refs.begin(); j != refs.end(); ++j)
30  out->push_back(*j);
31  }
32  evt.put(out);
33  }
int i
Definition: DBlmapReader.cc:9
const_iterator end() const
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:85
std::vector< edm::InputTag > src_
int j
Definition: DBlmapReader.cc:9
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
tuple out
Definition: dbtoconf.py:99
const_iterator begin() const

Member Data Documentation

std::vector<edm::InputTag> CandViewRefMerger::src_
private

Definition at line 34 of file CandViewRefMerger.cc.

Referenced by produce().