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::ProducerBase &mixMod, edm::ConsumesCollector &iC)
 
 MTDDigiProducer (edm::ParameterSet const &pset, 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_ = 0
 
std::vector< std::unique_ptr< MTDDigitizerBase > > theDigitizers_
 

Detailed Description

Definition at line 21 of file MTDDigiProducer.h.

Constructor & Destructor Documentation

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

Definition at line 11 of file MTDDigiProducer.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 = MTDDigitizerFactory::get()->create(digitizerName,ps,iC,mixMod);
22  theDigitizers_.emplace_back(temp);
23  }
24 }
std::vector< std::unique_ptr< MTDDigitizerBase > > theDigitizers_
T get(const Candidate &c)
Definition: component.h:55
MTDDigiProducer::MTDDigiProducer ( edm::ParameterSet const &  pset,
edm::ConsumesCollector iC 
)
inline

Definition at line 24 of file MTDDigiProducer.h.

References Ecal2004TBTDCRanges_v1_cff::endRun, and Exception.

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

Definition at line 27 of file MTDDigiProducer.cc.

28 {
29 }

Member Function Documentation

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

Implements DigiAccumulatorMixMod.

Definition at line 51 of file MTDDigiProducer.cc.

References randomEngine_, and theDigitizers_.

52 {
53  for( auto& digitizer : theDigitizers_ ) {
54  digitizer->accumulate(event, es, randomEngine_);
55  }
56 }
std::vector< std::unique_ptr< MTDDigitizerBase > > theDigitizers_
CLHEP::HepRandomEngine * randomEngine_
Definition: event.py:1
void MTDDigiProducer::accumulate ( PileUpEventPrincipal const &  event,
edm::EventSetup const &  es,
edm::StreamID const &  streamID 
)
overridevirtual

Implements DigiAccumulatorMixMod.

Definition at line 58 of file MTDDigiProducer.cc.

References randomEngine_, and theDigitizers_.

59 {
60  for( auto& digitizer : theDigitizers_ ) {
61  digitizer->accumulate(event, es, randomEngine_);
62  }
63 }
std::vector< std::unique_ptr< MTDDigitizerBase > > theDigitizers_
CLHEP::HepRandomEngine * randomEngine_
Definition: event.py:1
void MTDDigiProducer::beginRun ( edm::Run const &  ,
edm::EventSetup const &  es 
)
overridevirtual

Reimplemented from DigiAccumulatorMixMod.

Definition at line 66 of file MTDDigiProducer.cc.

References theDigitizers_.

67 {
68  for( auto& digitizer : theDigitizers_ ) {
69  digitizer->beginRun(es);
70  }
71 }
std::vector< std::unique_ptr< MTDDigitizerBase > > theDigitizers_
void MTDDigiProducer::endRun ( edm::Run const &  ,
edm::EventSetup const &   
)
overridevirtual

Reimplemented from DigiAccumulatorMixMod.

Definition at line 74 of file MTDDigiProducer.cc.

References theDigitizers_.

75 {
76  for( auto& digitizer : theDigitizers_ ) {
77  digitizer->endRun();
78  }
79 }
std::vector< std::unique_ptr< MTDDigitizerBase > > theDigitizers_
void MTDDigiProducer::finalizeEvent ( edm::Event event,
edm::EventSetup const &  es 
)
overridevirtual

Implements DigiAccumulatorMixMod.

Definition at line 42 of file MTDDigiProducer.cc.

References randomEngine_, and theDigitizers_.

43 {
44  for( auto& digitizer : theDigitizers_ ) {
45  digitizer->finalizeEvent(event, es, randomEngine_);
46  }
47  randomEngine_ = nullptr; // to prevent access outside event
48 }
std::vector< std::unique_ptr< MTDDigitizerBase > > theDigitizers_
CLHEP::HepRandomEngine * randomEngine_
void MTDDigiProducer::initializeEvent ( edm::Event const &  event,
edm::EventSetup const &  es 
)
overridevirtual

Implements DigiAccumulatorMixMod.

Definition at line 32 of file MTDDigiProducer.cc.

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

33 {
35  randomEngine_ = &rng->getEngine(event.streamID());
36  for( auto& digitizer : theDigitizers_ ) {
37  digitizer->initializeEvent(event, es);
38  }
39 }
virtual CLHEP::HepRandomEngine & getEngine(StreamID const &)=0
Use this engine in event methods.
std::vector< std::unique_ptr< MTDDigitizerBase > > theDigitizers_
CLHEP::HepRandomEngine * randomEngine_
Definition: event.py:1

Member Data Documentation

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

Definition at line 39 of file MTDDigiProducer.h.

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

std::vector<std::unique_ptr<MTDDigitizerBase> > MTDDigiProducer::theDigitizers_
private