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
CandidateProducer< TColl, CColl, Selector, Conv, Creator, Init > Class Template Reference

#include <CandidateProducer.h>

Inheritance diagram for CandidateProducer< TColl, CColl, Selector, Conv, Creator, Init >:
edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 CandidateProducer (const edm::ParameterSet &cfg)
 constructor from parameter set More...
 
 ~CandidateProducer ()
 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 Member Functions

void beginRun (const edm::Run &, const edm::EventSetup &es) override
 begin job (first run) More...
 
void produce (edm::Event &evt, const edm::EventSetup &es) override
 process one event More...
 

Private Attributes

Conv converter_
 converter helper More...
 
bool initialized_
 particles initialized? More...
 
Selector selector_
 selector More...
 
edm::InputTag src_
 label of source collection and tag 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 TColl, typename CColl, typename Selector = AnySelector, typename Conv = typename converter::helper::CandConverter<typename TColl::value_type>::type, typename Creator = typename converter::helper::CandCreator<CColl>::type, typename Init = typename ::reco::modules::EventSetupInit<Selector>::type>
class CandidateProducer< TColl, CColl, Selector, Conv, Creator, Init >

Framework module that produces a collection of candidates from generic compoment

Author
Luca Lista, INFN
Version
Revision:
1.5
Id:
CandidateProducer.h,v 1.5 2013/02/28 00:15:23 wmtan Exp

Definition at line 68 of file CandidateProducer.h.

Constructor & Destructor Documentation

template<typename TColl , typename CColl , typename Selector = AnySelector, typename Conv = typename converter::helper::CandConverter<typename TColl::value_type>::type, typename Creator = typename converter::helper::CandCreator<CColl>::type, typename Init = typename ::reco::modules::EventSetupInit<Selector>::type>
CandidateProducer< TColl, CColl, Selector, Conv, Creator, Init >::CandidateProducer ( const edm::ParameterSet cfg)
inline

constructor from parameter set

Definition at line 71 of file CandidateProducer.h.

71  :
72  src_(cfg.template getParameter<edm::InputTag>("src")),
73  converter_(cfg),
74  selector_(reco::modules::make<Selector>(cfg)),
75  initialized_(false) {
76  produces<CColl>();
77  }
edm::InputTag src_
label of source collection and tag
bool initialized_
particles initialized?
Conv converter_
converter helper
Selector selector_
selector
template<typename TColl , typename CColl , typename Selector = AnySelector, typename Conv = typename converter::helper::CandConverter<typename TColl::value_type>::type, typename Creator = typename converter::helper::CandCreator<CColl>::type, typename Init = typename ::reco::modules::EventSetupInit<Selector>::type>
CandidateProducer< TColl, CColl, Selector, Conv, Creator, Init >::~CandidateProducer ( )
inline

destructor

Definition at line 79 of file CandidateProducer.h.

79 { }

Member Function Documentation

template<typename TColl , typename CColl , typename Selector = AnySelector, typename Conv = typename converter::helper::CandConverter<typename TColl::value_type>::type, typename Creator = typename converter::helper::CandCreator<CColl>::type, typename Init = typename ::reco::modules::EventSetupInit<Selector>::type>
void CandidateProducer< TColl, CColl, Selector, Conv, Creator, Init >::beginRun ( const edm::Run ,
const edm::EventSetup es 
)
inlineoverrideprivatevirtual

begin job (first run)

Reimplemented from edm::EDProducer.

Definition at line 83 of file CandidateProducer.h.

References CandidateProducer< TColl, CColl, Selector, Conv, Creator, Init >::converter_, and CandidateProducer< TColl, CColl, Selector, Conv, Creator, Init >::initialized_.

83  {
84  if (!initialized_) {
85  converter_.beginFirstRun(es);
86  initialized_ = true;
87  }
88  }
bool initialized_
particles initialized?
Conv converter_
converter helper
template<typename TColl , typename CColl , typename Selector = AnySelector, typename Conv = typename converter::helper::CandConverter<typename TColl::value_type>::type, typename Creator = typename converter::helper::CandCreator<CColl>::type, typename Init = typename ::reco::modules::EventSetupInit<Selector>::type>
void CandidateProducer< TColl, CColl, Selector, Conv, Creator, Init >::produce ( edm::Event evt,
const edm::EventSetup es 
)
inlineoverrideprivatevirtual

process one event

Implements edm::EDProducer.

Definition at line 90 of file CandidateProducer.h.

References CandidateProducer< TColl, CColl, Selector, Conv, Creator, Init >::converter_, SurfaceDeformationFactory::create(), edm::Event::getByLabel(), customizeTrackingMonitorSeedNumber::idx, helper::MasterCollection< C1 >::index(), init, autoMagneticFieldProducer_cfi::master, edm::Event::put(), CandidateProducer< TColl, CColl, Selector, Conv, Creator, Init >::selector_, findQualityFiles::size, alcazmumu_cfi::src, and CandidateProducer< TColl, CColl, Selector, Conv, Creator, Init >::src_.

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

90  {
92  evt.getByLabel(src_, src);
93  Init::init(selector_, evt, es);
95  std::auto_ptr<CColl> cands(new CColl);
96  if(src->size()!= 0) {
97  size_t size = src->size();
98  cands->reserve(size);
99  for(size_t idx = 0; idx != size; ++ idx) {
100  if(selector_((*src)[idx]))
101  Creator::create(master.index(idx), *cands, master, converter_);
102  }
103  }
104  evt.put(cands);
105  }
edm::InputTag src_
label of source collection and tag
int init
Definition: HydjetWrapper.h:63
Conv converter_
converter helper
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:94
Selector selector_
selector
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:361
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
SurfaceDeformation * create(int type, const std::vector< double > &params)
tuple size
Write out results.

Member Data Documentation

template<typename TColl , typename CColl , typename Selector = AnySelector, typename Conv = typename converter::helper::CandConverter<typename TColl::value_type>::type, typename Creator = typename converter::helper::CandCreator<CColl>::type, typename Init = typename ::reco::modules::EventSetupInit<Selector>::type>
Conv CandidateProducer< TColl, CColl, Selector, Conv, Creator, Init >::converter_
private
template<typename TColl , typename CColl , typename Selector = AnySelector, typename Conv = typename converter::helper::CandConverter<typename TColl::value_type>::type, typename Creator = typename converter::helper::CandCreator<CColl>::type, typename Init = typename ::reco::modules::EventSetupInit<Selector>::type>
bool CandidateProducer< TColl, CColl, Selector, Conv, Creator, Init >::initialized_
private

particles initialized?

Definition at line 113 of file CandidateProducer.h.

Referenced by CandidateProducer< TColl, CColl, Selector, Conv, Creator, Init >::beginRun().

template<typename TColl , typename CColl , typename Selector = AnySelector, typename Conv = typename converter::helper::CandConverter<typename TColl::value_type>::type, typename Creator = typename converter::helper::CandCreator<CColl>::type, typename Init = typename ::reco::modules::EventSetupInit<Selector>::type>
Selector CandidateProducer< TColl, CColl, Selector, Conv, Creator, Init >::selector_
private
template<typename TColl , typename CColl , typename Selector = AnySelector, typename Conv = typename converter::helper::CandConverter<typename TColl::value_type>::type, typename Creator = typename converter::helper::CandCreator<CColl>::type, typename Init = typename ::reco::modules::EventSetupInit<Selector>::type>
edm::InputTag CandidateProducer< TColl, CColl, Selector, Conv, Creator, Init >::src_
private

label of source collection and tag

Definition at line 107 of file CandidateProducer.h.

Referenced by CandidateProducer< TColl, CColl, Selector, Conv, Creator, Init >::produce().