CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups 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<>

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
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

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<>
using CacheTypes = CacheContexts< T...>
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T...>
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 

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 70 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 73 of file CandidateProducer.h.

74  : srcToken_(consumes<TColl>(cfg.template getParameter<edm::InputTag>("src"))),
75  converter_(cfg, consumesCollector()),
76  selector_(reco::modules::make<Selector>(cfg, consumesCollector())),
77  initialized_(false) {
78  produces<CColl>();
79  }
bool initialized_
particles initialized?
Conv converter_
converter helper
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 81 of file CandidateProducer.h.

81 {}

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 85 of file CandidateProducer.h.

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

85  {
86  if (!initialized_) {
87  converter_.beginFirstRun(es);
88  initialized_ = true;
89  }
90  }
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 92 of file CandidateProducer.h.

References HLT_FULL_cff::cands, CandidateProducer< TColl, CColl, Selector, Conv, Creator, Init >::converter_, beamerCreator::create(), edm::Event::getByToken(), init, funct::master(), eostools::move(), 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_.

92  {
94  evt.getByToken(srcToken_, src);
95  Init::init(selector_, evt, es);
96  ::helper::MasterCollection<TColl> master(src, evt);
97  std::unique_ptr<CColl> cands(new CColl);
98  if (!src->empty()) {
99  size_t size = src->size();
100  cands->reserve(size);
101  for (size_t idx = 0; idx != size; ++idx) {
102  if (selector_((*src)[idx]))
103  Creator::create(master.index(idx), *cands, master, converter_);
104  }
105  }
106  evt.put(std::move(cands));
107  }
Master< F > master(const F &f)
Definition: FunctClone.h:63
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:133
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:539
int init
Definition: HydjetWrapper.h:64
Conv converter_
converter helper
def move
Definition: eostools.py:511
Selector selector_
selector
edm::EDGetTokenT< TColl > srcToken_
label of source collection and tag
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 115 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 109 of file CandidateProducer.h.

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