test
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::stream::EDProducer<> edm::stream::EDProducerBase 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::stream::EDProducer<>
 EDProducer ()=default
 
- Public Member Functions inherited from edm::stream::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducerBase ()
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 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
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (std::string const &iProcessName, std::string const &iModuleLabel, bool iPrint, std::vector< char const * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) 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::EDGetTokenT< TColl > srcToken_
 label of source collection and tag More...
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
typedef CacheContexts< T...> CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T...> HasAbility
 
typedef
CacheTypes::LuminosityBlockCache 
LuminosityBlockCache
 
typedef
LuminosityBlockContextT
< LuminosityBlockCache,
RunCache, GlobalCache
LuminosityBlockContext
 
typedef
CacheTypes::LuminosityBlockSummaryCache 
LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache,
GlobalCache
RunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDProducerBase
typedef EDProducerAdaptorBase ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::stream::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- 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.4
Id:
CandidateProducer.h,v 1.4 2010/02/11 00:10:53 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  srcToken_(consumes<TColl>(cfg.template getParameter<edm::InputTag>("src"))),
73  converter_(cfg),
74  selector_(reco::modules::make<Selector>(cfg, consumesCollector())),
75  initialized_(false) {
76  produces<CColl>();
77  }
bool initialized_
particles initialized?
Conv converter_
converter helper
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
Selector selector_
selector
edm::EDGetTokenT< TColl > srcToken_
label of source collection and tag
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::stream::EDProducerBase.

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::stream::EDProducerBase.

Definition at line 90 of file CandidateProducer.h.

References CandidateProducer< TColl, CColl, Selector, Conv, Creator, Init >::converter_, beamerCreator::create(), edm::Event::getByToken(), 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 >::srcToken_.

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

90  {
92  evt.getByToken(srcToken_, 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  }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:462
int init
Definition: HydjetWrapper.h:67
Conv converter_
converter helper
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:121
Selector selector_
selector
edm::EDGetTokenT< TColl > srcToken_
label of source collection and tag
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
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::EDGetTokenT<TColl> CandidateProducer< TColl, CColl, Selector, Conv, Creator, Init >::srcToken_
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().