CMS 3D CMS Logo

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

#include <MTDDigiProducer.h>

Inheritance diagram for MTDDigiProducer:
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
 
void initializeEvent (edm::Event const &, edm::EventSetup const &) override
 
 MTDDigiProducer (edm::ParameterSet const &pset, edm::ConsumesCollector &iC)
 
 MTDDigiProducer (edm::ParameterSet const &pset, edm::ProducesCollector, edm::ConsumesCollector &iC)
 
 ~MTDDigiProducer () 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 Attributes

CLHEP::HepRandomEngine * randomEngine_ = nullptr
 
std::vector< std::unique_ptr< MTDDigitizerBase > > theDigitizers_
 

Detailed Description

Definition at line 21 of file MTDDigiProducer.h.

Constructor & Destructor Documentation

◆ MTDDigiProducer() [1/2]

MTDDigiProducer::MTDDigiProducer ( edm::ParameterSet const &  pset,
edm::ProducesCollector  producesCollector,
edm::ConsumesCollector iC 
)

Definition at line 10 of file MTDDigiProducer.cc.

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  theDigitizers_.emplace_back(MTDDigitizerFactory::get()->create(digitizerName, ps, producesCollector, iC));
22  }
23 }

References beamerCreator::create(), mtdDigitizer_cfi::digitizerName, get, muonDTDigis_cfi::pset, AlCaHLTBitMon_QueryRunRegistry::string, and theDigitizers_.

◆ MTDDigiProducer() [2/2]

MTDDigiProducer::MTDDigiProducer ( edm::ParameterSet const &  pset,
edm::ConsumesCollector iC 
)
inline

Definition at line 24 of file MTDDigiProducer.h.

24  {
25  throw cms::Exception("DeprecatedConstructor")
26  << "Please make sure you're calling this with the threaded mixing module...";
27  }

References Exception.

◆ ~MTDDigiProducer()

MTDDigiProducer::~MTDDigiProducer ( )
override

Definition at line 26 of file MTDDigiProducer.cc.

26 {}

Member Function Documentation

◆ accumulate() [1/2]

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

Implements DigiAccumulatorMixMod.

Definition at line 46 of file MTDDigiProducer.cc.

46  {
47  for (auto& digitizer : theDigitizers_) {
48  digitizer->accumulate(event, es, randomEngine_);
49  }
50 }

References randomEngine_, and theDigitizers_.

◆ accumulate() [2/2]

void MTDDigiProducer::accumulate ( PileUpEventPrincipal const &  event,
edm::EventSetup const &  es,
edm::StreamID const &  streamID 
)
overridevirtual

Implements DigiAccumulatorMixMod.

Definition at line 52 of file MTDDigiProducer.cc.

54  {
55  for (auto& digitizer : theDigitizers_) {
56  digitizer->accumulate(event, es, randomEngine_);
57  }
58 }

References randomEngine_, and theDigitizers_.

◆ beginRun()

void MTDDigiProducer::beginRun ( edm::Run const &  ,
edm::EventSetup const &  es 
)
overridevirtual

Reimplemented from DigiAccumulatorMixMod.

Definition at line 61 of file MTDDigiProducer.cc.

61  {
62  for (auto& digitizer : theDigitizers_) {
63  digitizer->beginRun(es);
64  }
65 }

References theDigitizers_.

◆ endRun()

void MTDDigiProducer::endRun ( edm::Run const &  ,
edm::EventSetup const &   
)
overridevirtual

Reimplemented from DigiAccumulatorMixMod.

Definition at line 68 of file MTDDigiProducer.cc.

68  {
69  for (auto& digitizer : theDigitizers_) {
70  digitizer->endRun();
71  }
72 }

References theDigitizers_.

◆ finalizeEvent()

void MTDDigiProducer::finalizeEvent ( edm::Event event,
edm::EventSetup const &  es 
)
overridevirtual

Implements DigiAccumulatorMixMod.

Definition at line 38 of file MTDDigiProducer.cc.

38  {
39  for (auto& digitizer : theDigitizers_) {
40  digitizer->finalizeEvent(event, es, randomEngine_);
41  }
42  randomEngine_ = nullptr; // to prevent access outside event
43 }

References randomEngine_, and theDigitizers_.

◆ initializeEvent()

void MTDDigiProducer::initializeEvent ( edm::Event const &  event,
edm::EventSetup const &  es 
)
overridevirtual

Implements DigiAccumulatorMixMod.

Definition at line 29 of file MTDDigiProducer.cc.

29  {
31  randomEngine_ = &rng->getEngine(event.streamID());
32  for (auto& digitizer : theDigitizers_) {
33  digitizer->initializeEvent(event, es);
34  }
35 }

References edm::RandomNumberGenerator::getEngine(), randomEngine_, and theDigitizers_.

Member Data Documentation

◆ randomEngine_

CLHEP::HepRandomEngine* MTDDigiProducer::randomEngine_ = nullptr
private

Definition at line 40 of file MTDDigiProducer.h.

Referenced by accumulate(), finalizeEvent(), and initializeEvent().

◆ theDigitizers_

std::vector<std::unique_ptr<MTDDigitizerBase> > MTDDigiProducer::theDigitizers_
private
edm::RandomNumberGenerator::getEngine
virtual CLHEP::HepRandomEngine & getEngine(StreamID const &)=0
Use this engine in event methods.
MTDDigiProducer::theDigitizers_
std::vector< std::unique_ptr< MTDDigitizerBase > > theDigitizers_
Definition: MTDDigiProducer.h:39
beamerCreator.create
def create(alignables, pedeDump, additionalData, outputFile, config)
Definition: beamerCreator.py:44
DigiAccumulatorMixMod::DigiAccumulatorMixMod
DigiAccumulatorMixMod()
Definition: DigiAccumulatorMixMod.cc:3
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::Service< edm::RandomNumberGenerator >
get
#define get
MTDDigiProducer::randomEngine_
CLHEP::HepRandomEngine * randomEngine_
Definition: MTDDigiProducer.h:40
Exception
Definition: hltDiff.cc:246
mtdDigitizer_cfi.digitizerName
digitizerName
Definition: mtdDigitizer_cfi.py:4
event
Definition: event.py:1
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27