CMS 3D CMS Logo

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 () override
 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
 
 ~EDProducerBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
virtual ~ProducerBase () noexcept(false)
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

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, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDProducerBase
typedef EDProducerAdaptorBase ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex >>
 
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 ( )
inlineoverride

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

begin job (first run)

Definition at line 83 of file CandidateProducer.h.

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

process one event

Definition at line 90 of file CandidateProducer.h.

References beamerCreator::create(), edm::Event::getByToken(), training_settings::idx, helper::MasterCollection< C1 >::index(), init, funct::master(), eostools::move(), edm::Event::put(), findQualityFiles::size, and TrackRefitter_38T_cff::src.

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::unique_ptr<CColl> cands(new CColl);
96  if(!src->empty()) {
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(std::move(cands));
105  }
size
Write out results.
Master< F > master(const F &f)
Definition: FunctClone.h:68
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:127
def create(alignables, pedeDump, additionalData, outputFile, config)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:508
int init
Definition: HydjetWrapper.h:67
Conv converter_
converter helper
Selector selector_
selector
edm::EDGetTokenT< TColl > srcToken_
label of source collection and tag
def move(src, dest)
Definition: eostools.py:510

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

converter helper

Definition at line 109 of file CandidateProducer.h.

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.

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

selector

Definition at line 111 of file CandidateProducer.h.

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.