CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
FTLDigiProducer Class Reference

#include <FTLDigiProducer.h>

Inheritance diagram for FTLDigiProducer:
DigiAccumulatorMixMod

Public Member Functions

void accumulate (edm::Event const &, edm::EventSetup const &) override
 
void accumulate (PileUpEventPrincipal const &, edm::EventSetup const &, edm::StreamID const &) override
 
void beginRun (edm::Run const &, edm::EventSetup const &) override
 
void endRun (edm::Run const &, edm::EventSetup const &) override
 
void finalizeEvent (edm::Event &, edm::EventSetup const &) override
 
 FTLDigiProducer (edm::ParameterSet const &pset, edm::stream::EDProducerBase &mixMod, edm::ConsumesCollector &iC)
 
 FTLDigiProducer (edm::ParameterSet const &pset, edm::ConsumesCollector &iC)
 
void initializeEvent (edm::Event const &, edm::EventSetup const &) override
 
 ~FTLDigiProducer () override
 
- Public Member Functions inherited from DigiAccumulatorMixMod
virtual void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup)
 
 DigiAccumulatorMixMod ()
 
virtual void endLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup)
 
virtual void finalizeBunchCrossing (edm::Event &event, edm::EventSetup const &setup, int bunchCrossing)
 
virtual PileupMixingContentgetEventPileupInfo ()
 
virtual void initializeBunchCrossing (edm::Event const &event, edm::EventSetup const &setup, int bunchCrossing)
 
virtual void StorePileupInformation (std::vector< int > &numInteractionList, std::vector< int > &bunchCrossingList, std::vector< float > &TrueInteractionList, std::vector< edm::EventID > &eventList, int bunchSpace)
 
virtual ~DigiAccumulatorMixMod ()
 

Private Member Functions

CLHEP::HepRandomEngine * randomEngine (edm::StreamID const &streamID)
 

Private Attributes

std::vector< CLHEP::HepRandomEngine * > randomEngines_
 
std::vector< std::unique_ptr< FTLDigitizerBase > > theDigitizers_
 

Detailed Description

Definition at line 23 of file FTLDigiProducer.h.

Constructor & Destructor Documentation

FTLDigiProducer::FTLDigiProducer ( edm::ParameterSet const &  pset,
edm::stream::EDProducerBase mixMod,
edm::ConsumesCollector iC 
)

Definition at line 11 of file FTLDigiProducer.cc.

References fastTimeDigitizer_cfi::digitizerName, reco::get(), edm::ParameterSet::getParameterSet(), edm::ParameterSet::getParameterSetNames(), AlCaHLTBitMon_QueryRunRegistry::string, groupFilesInBlocks::temp, and theDigitizers_.

12  :
14  std::vector<std::string> psetNames;
15 
16  pset.getParameterSetNames(psetNames);
17 
18  for(const auto& psname : psetNames) {
19  const auto& ps = pset.getParameterSet(psname);
20  const std::string& digitizerName = ps.getParameter<std::string>("digitizerName");
21  auto temp = FTLDigitizerFactory::get()->create(digitizerName,ps,iC,mixMod);
22  theDigitizers_.emplace_back(temp);
23  }
24 }
std::vector< std::unique_ptr< FTLDigitizerBase > > theDigitizers_
T get(const Candidate &c)
Definition: component.h:55
FTLDigiProducer::FTLDigiProducer ( edm::ParameterSet const &  pset,
edm::ConsumesCollector iC 
)
inline

Definition at line 26 of file FTLDigiProducer.h.

References Ecal2004TBTDCRanges_v1_cff::endRun, Exception, and randomEngine.

27  {
28  throw cms::Exception("DeprecatedConstructor") << "Please make sure you're calling this with the threaded mixing module...";
29  }
FTLDigiProducer::~FTLDigiProducer ( )
override

Definition at line 27 of file FTLDigiProducer.cc.

28 {
29 }

Member Function Documentation

void FTLDigiProducer::accumulate ( edm::Event const &  event,
edm::EventSetup const &  es 
)
overridevirtual

Implements DigiAccumulatorMixMod.

Definition at line 48 of file FTLDigiProducer.cc.

References randomEngine(), edm::Event::streamID(), and theDigitizers_.

49 {
50  for( auto& digitizer : theDigitizers_ ) {
51  digitizer->accumulate(event, es, randomEngine(event.streamID()));
52  }
53 }
CLHEP::HepRandomEngine * randomEngine(edm::StreamID const &streamID)
std::vector< std::unique_ptr< FTLDigitizerBase > > theDigitizers_
Definition: event.py:1
void FTLDigiProducer::accumulate ( PileUpEventPrincipal const &  event,
edm::EventSetup const &  es,
edm::StreamID const &  streamID 
)
overridevirtual

Implements DigiAccumulatorMixMod.

Definition at line 55 of file FTLDigiProducer.cc.

References randomEngine(), and theDigitizers_.

56 {
57  for( auto& digitizer : theDigitizers_ ) {
58  digitizer->accumulate(event, es, randomEngine(streamID));
59  }
60 }
CLHEP::HepRandomEngine * randomEngine(edm::StreamID const &streamID)
std::vector< std::unique_ptr< FTLDigitizerBase > > theDigitizers_
Definition: event.py:1
void FTLDigiProducer::beginRun ( edm::Run const &  ,
edm::EventSetup const &  es 
)
overridevirtual

Reimplemented from DigiAccumulatorMixMod.

Definition at line 63 of file FTLDigiProducer.cc.

References theDigitizers_.

64 {
65  for( auto& digitizer : theDigitizers_ ) {
66  digitizer->beginRun(es);
67  }
68 }
std::vector< std::unique_ptr< FTLDigitizerBase > > theDigitizers_
void FTLDigiProducer::endRun ( edm::Run const &  ,
edm::EventSetup const &   
)
overridevirtual

Reimplemented from DigiAccumulatorMixMod.

Definition at line 71 of file FTLDigiProducer.cc.

References theDigitizers_.

72 {
73  for( auto& digitizer : theDigitizers_ ) {
74  digitizer->endRun();
75  }
76 }
std::vector< std::unique_ptr< FTLDigitizerBase > > theDigitizers_
void FTLDigiProducer::finalizeEvent ( edm::Event event,
edm::EventSetup const &  es 
)
overridevirtual

Implements DigiAccumulatorMixMod.

Definition at line 40 of file FTLDigiProducer.cc.

References randomEngine(), edm::Event::streamID(), and theDigitizers_.

41 {
42  for( auto& digitizer : theDigitizers_ ) {
43  digitizer->finalizeEvent(event, es, randomEngine(event.streamID()));
44  }
45 }
CLHEP::HepRandomEngine * randomEngine(edm::StreamID const &streamID)
std::vector< std::unique_ptr< FTLDigitizerBase > > theDigitizers_
StreamID streamID() const
Definition: Event.h:86
void FTLDigiProducer::initializeEvent ( edm::Event const &  event,
edm::EventSetup const &  es 
)
overridevirtual

Implements DigiAccumulatorMixMod.

Definition at line 32 of file FTLDigiProducer.cc.

References theDigitizers_.

33 {
34  for( auto& digitizer : theDigitizers_ ) {
35  digitizer->initializeEvent(event, es);
36  }
37 }
std::vector< std::unique_ptr< FTLDigitizerBase > > theDigitizers_
Definition: event.py:1
CLHEP::HepRandomEngine * FTLDigiProducer::randomEngine ( edm::StreamID const &  streamID)
private

Definition at line 78 of file FTLDigiProducer.cc.

References edm::RandomNumberGenerator::getEngine(), diffTreeTool::index, randomEngines_, and edm::StreamID::value().

Referenced by accumulate(), and finalizeEvent().

78  {
79  unsigned int index = streamID.value();
80  if(index >= randomEngines_.size()) {
81  randomEngines_.resize(index + 1, nullptr);
82  }
83  CLHEP::HepRandomEngine* ptr = randomEngines_[index];
84  if(!ptr) {
86  ptr = &rng->getEngine(streamID);
87  randomEngines_[index] = ptr;
88  }
89  return ptr;
90 }
virtual CLHEP::HepRandomEngine & getEngine(StreamID const &)=0
Use this engine in event methods.
std::vector< CLHEP::HepRandomEngine * > randomEngines_

Member Data Documentation

std::vector<CLHEP::HepRandomEngine*> FTLDigiProducer::randomEngines_
private

Definition at line 42 of file FTLDigiProducer.h.

Referenced by randomEngine().

std::vector<std::unique_ptr<FTLDigitizerBase> > FTLDigiProducer::theDigitizers_
private