CMS 3D CMS Logo

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

#include <HGCDigiProducer.h>

Inheritance diagram for HGCDigiProducer:
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
 
 HGCDigiProducer (edm::ParameterSet const &pset, edm::stream::EDProducerBase &mixMod, edm::ConsumesCollector &iC)
 
 HGCDigiProducer (edm::ParameterSet const &pset, edm::ConsumesCollector &iC)
 
void initializeEvent (edm::Event const &, edm::EventSetup const &) override
 
 ~HGCDigiProducer () 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::unique_ptr< HGCDigitizertheDigitizer_
 

Detailed Description

Definition at line 23 of file HGCDigiProducer.h.

Constructor & Destructor Documentation

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

Definition at line 11 of file HGCDigiProducer.cc.

References theDigitizer_.

12  :
14  theDigitizer_(new HGCDigitizer(pset, iC) )
15 {
16  if( theDigitizer_->producesEEDigis() )
17  mixMod.produces<HGCEEDigiCollection>(theDigitizer_->digiCollection());
18  if( theDigitizer_->producesHEfrontDigis() )
19  mixMod.produces<HGCHEDigiCollection>(theDigitizer_->digiCollection());
20  if( theDigitizer_->producesHEbackDigis() )
21  mixMod.produces<HGCBHDigiCollection>(theDigitizer_->digiCollection());
22 }
std::unique_ptr< HGCDigitizer > theDigitizer_
HGCDigiProducer::HGCDigiProducer ( edm::ParameterSet const &  pset,
edm::ConsumesCollector iC 
)

Definition at line 24 of file HGCDigiProducer.cc.

24  :
26  theDigitizer_(new HGCDigitizer(pset, iC)) {
27 }
std::unique_ptr< HGCDigitizer > theDigitizer_
HGCDigiProducer::~HGCDigiProducer ( )
override

Definition at line 30 of file HGCDigiProducer.cc.

31 {
32 }

Member Function Documentation

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

Implements DigiAccumulatorMixMod.

Definition at line 47 of file HGCDigiProducer.cc.

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

48 {
49  theDigitizer_->accumulate(event, es, randomEngine(event.streamID()));
50 }
CLHEP::HepRandomEngine * randomEngine(edm::StreamID const &streamID)
std::unique_ptr< HGCDigitizer > theDigitizer_
Definition: event.py:1
void HGCDigiProducer::accumulate ( PileUpEventPrincipal const &  event,
edm::EventSetup const &  es,
edm::StreamID const &  streamID 
)
overridevirtual

Implements DigiAccumulatorMixMod.

Definition at line 52 of file HGCDigiProducer.cc.

References randomEngine(), and theDigitizer_.

53 {
54  theDigitizer_->accumulate(event, es, randomEngine(streamID));
55 }
CLHEP::HepRandomEngine * randomEngine(edm::StreamID const &streamID)
std::unique_ptr< HGCDigitizer > theDigitizer_
Definition: event.py:1
void HGCDigiProducer::beginRun ( edm::Run const &  ,
edm::EventSetup const &  es 
)
overridevirtual

Reimplemented from DigiAccumulatorMixMod.

Definition at line 58 of file HGCDigiProducer.cc.

References theDigitizer_.

59 {
60  theDigitizer_->beginRun(es);
61 }
std::unique_ptr< HGCDigitizer > theDigitizer_
void HGCDigiProducer::endRun ( edm::Run const &  ,
edm::EventSetup const &   
)
overridevirtual

Reimplemented from DigiAccumulatorMixMod.

Definition at line 64 of file HGCDigiProducer.cc.

References theDigitizer_.

65 {
66  theDigitizer_->endRun();
67 }
std::unique_ptr< HGCDigitizer > theDigitizer_
void HGCDigiProducer::finalizeEvent ( edm::Event event,
edm::EventSetup const &  es 
)
overridevirtual

Implements DigiAccumulatorMixMod.

Definition at line 41 of file HGCDigiProducer.cc.

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

42 {
43  theDigitizer_->finalizeEvent(event, es, randomEngine(event.streamID()));
44 }
CLHEP::HepRandomEngine * randomEngine(edm::StreamID const &streamID)
std::unique_ptr< HGCDigitizer > theDigitizer_
StreamID streamID() const
Definition: Event.h:95
void HGCDigiProducer::initializeEvent ( edm::Event const &  event,
edm::EventSetup const &  es 
)
overridevirtual

Implements DigiAccumulatorMixMod.

Definition at line 35 of file HGCDigiProducer.cc.

References theDigitizer_.

36 {
37  theDigitizer_->initializeEvent(event, es);
38 }
std::unique_ptr< HGCDigitizer > theDigitizer_
Definition: event.py:1
CLHEP::HepRandomEngine * HGCDigiProducer::randomEngine ( edm::StreamID const &  streamID)
private

Definition at line 69 of file HGCDigiProducer.cc.

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

Referenced by accumulate(), and finalizeEvent().

69  {
70  unsigned int index = streamID.value();
71  if(index >= randomEngines_.size()) {
72  randomEngines_.resize(index + 1, nullptr);
73  }
74  CLHEP::HepRandomEngine* ptr = randomEngines_[index];
75  if(!ptr) {
77  ptr = &rng->getEngine(streamID);
78  randomEngines_[index] = ptr;
79  }
80  return ptr;
81 }
std::vector< CLHEP::HepRandomEngine * > randomEngines_
virtual CLHEP::HepRandomEngine & getEngine(StreamID const &)=0
Use this engine in event methods.

Member Data Documentation

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

Definition at line 39 of file HGCDigiProducer.h.

Referenced by randomEngine().

std::unique_ptr<HGCDigitizer> HGCDigiProducer::theDigitizer_
private