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

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_
 
Init selectorInit_
 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

◆ CandidateProducer()

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  selectorInit_(consumesCollector()),
77  selector_(reco::modules::make<Selector>(cfg, consumesCollector())),
78  initialized_(false) {
79  produces<CColl>();
80  }
bool initialized_
particles initialized?
Conv converter_
converter helper
Init selectorInit_
selector
edm::EDGetTokenT< TColl > srcToken_
label of source collection and tag

◆ ~CandidateProducer()

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

82 {}

Member Function Documentation

◆ 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>
void CandidateProducer< TColl, CColl, Selector, Conv, Creator, Init >::beginRun ( const edm::Run ,
const edm::EventSetup es 
)
inlineoverrideprivate

begin job (first run)

Definition at line 86 of file CandidateProducer.h.

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

86  {
87  if (!initialized_) {
88  converter_.beginFirstRun(es);
89  initialized_ = true;
90  }
91  }
bool initialized_
particles initialized?
Conv converter_
converter helper

◆ produce()

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

References HLT_2024v12_cff::cands, CandidateProducer< TColl, CColl, Selector, Conv, Creator, Init >::converter_, beamerCreator::create(), edm::Event::getByToken(), heavyIonCSV_trainingSettings::idx, volumeBasedMagneticField_160812_cfi::master, eostools::move(), edm::Event::put(), CandidateProducer< TColl, CColl, Selector, Conv, Creator, Init >::selector_, CandidateProducer< TColl, CColl, Selector, Conv, Creator, Init >::selectorInit_, findQualityFiles::size, TrackRefitter_38T_cff::src, and CandidateProducer< TColl, CColl, Selector, Conv, Creator, Init >::srcToken_.

93  {
95  evt.getByToken(srcToken_, src);
96  selectorInit_.init(selector_, evt, es);
97  ::helper::MasterCollection<TColl> master(src, evt);
98  std::unique_ptr<CColl> cands(new CColl);
99  if (!src->empty()) {
100  size_t size = src->size();
101  cands->reserve(size);
102  for (size_t idx = 0; idx != size; ++idx) {
103  if (selector_((*src)[idx]))
105  }
106  }
107  evt.put(std::move(cands));
108  }
size
Write out results.
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:133
def create(alignables, pedeDump, additionalData, outputFile, config)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:528
Conv converter_
converter helper
Init selectorInit_
selector
edm::EDGetTokenT< TColl > srcToken_
label of source collection and tag
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

◆ converter_

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

◆ initialized_

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

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

◆ 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>
Selector CandidateProducer< TColl, CColl, Selector, Conv, Creator, Init >::selector_
private

◆ selectorInit_

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>
Init CandidateProducer< TColl, CColl, Selector, Conv, Creator, Init >::selectorInit_
private

◆ srcToken_

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

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