SimFastTiming
FastTimingCommon
plugins
MTDDigiProducer.cc
Go to the documentation of this file.
1
#include "
FWCore/Framework/interface/MakerMacros.h
"
2
#include "
SimGeneral/MixingModule/interface/DigiAccumulatorMixModFactory.h
"
3
#include "
SimFastTiming/FastTimingCommon/plugins/MTDDigiProducer.h
"
4
#include "
FWCore/Framework/interface/Event.h
"
5
#include "
FWCore/ServiceRegistry/interface/Service.h
"
6
#include "
FWCore/Utilities/interface/RandomNumberGenerator.h
"
7
#include "
FWCore/Utilities/interface/StreamID.h
"
8
9
//
10
MTDDigiProducer::MTDDigiProducer
(
edm::ParameterSet
const
&
pset
,
11
edm::ProducesCollector
producesCollector,
12
edm::ConsumesCollector
& iC)
13
:
DigiAccumulatorMixMod
() {
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
}
24
25
//
26
MTDDigiProducer::~MTDDigiProducer
() {}
27
28
//
29
void
MTDDigiProducer::initializeEvent
(
edm::Event
const
&
event
,
edm::EventSetup
const
& es) {
30
edm::Service<edm::RandomNumberGenerator>
rng;
31
randomEngine_
= &rng->
getEngine
(
event
.streamID());
32
for
(
auto
&
digitizer
:
theDigitizers_
) {
33
digitizer
->initializeEvent(
event
, es);
34
}
35
}
36
37
//
38
void
MTDDigiProducer::finalizeEvent
(
edm::Event
&
event
,
edm::EventSetup
const
& es) {
39
for
(
auto
&
digitizer
:
theDigitizers_
) {
40
digitizer
->finalizeEvent(
event
, es,
randomEngine_
);
41
}
42
randomEngine_
=
nullptr
;
// to prevent access outside event
43
}
44
45
//
46
void
MTDDigiProducer::accumulate
(
edm::Event
const
&
event
,
edm::EventSetup
const
& es) {
47
for
(
auto
&
digitizer
:
theDigitizers_
) {
48
digitizer
->accumulate(
event
, es,
randomEngine_
);
49
}
50
}
51
52
void
MTDDigiProducer::accumulate
(
PileUpEventPrincipal
const
&
event
,
53
edm::EventSetup
const
& es,
54
edm::StreamID
const
& streamID) {
55
for
(
auto
&
digitizer
:
theDigitizers_
) {
56
digitizer
->accumulate(
event
, es,
randomEngine_
);
57
}
58
}
edm::StreamID
Definition:
StreamID.h:30
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:32
hgcalDigitizer_cfi.digitizer
digitizer
Definition:
hgcalDigitizer_cfi.py:76
MTDDigiProducer::~MTDDigiProducer
~MTDDigiProducer() override
Definition:
MTDDigiProducer.cc:26
RandomNumberGenerator.h
PileUpEventPrincipal
Definition:
PileUpEventPrincipal.h:19
beamerCreator.create
def create(alignables, pedeDump, additionalData, outputFile, config)
Definition:
beamerCreator.py:44
MakerMacros.h
MTDDigiProducer::initializeEvent
void initializeEvent(edm::Event const &, edm::EventSetup const &) override
Definition:
MTDDigiProducer.cc:29
Service.h
DigiAccumulatorMixMod
Definition:
DigiAccumulatorMixMod.h:41
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ParameterSet
Definition:
ParameterSet.h:47
MTDDigiProducer::MTDDigiProducer
MTDDigiProducer(edm::ParameterSet const &pset, edm::ProducesCollector, edm::ConsumesCollector &iC)
Definition:
MTDDigiProducer.cc:10
Event.h
edm::Service< edm::RandomNumberGenerator >
edm::EventSetup
Definition:
EventSetup.h:58
get
#define get
MTDDigiProducer::finalizeEvent
void finalizeEvent(edm::Event &, edm::EventSetup const &) override
Definition:
MTDDigiProducer.cc:38
MTDDigiProducer::randomEngine_
CLHEP::HepRandomEngine * randomEngine_
Definition:
MTDDigiProducer.h:33
edm::ProducesCollector
Definition:
ProducesCollector.h:43
MTDDigiProducer::accumulate
void accumulate(edm::Event const &, edm::EventSetup const &) override
Definition:
MTDDigiProducer.cc:46
MTDDigiProducer.h
DigiAccumulatorMixModFactory.h
mtdDigitizer_cfi.digitizerName
digitizerName
Definition:
mtdDigitizer_cfi.py:4
event
Definition:
event.py:1
edm::Event
Definition:
Event.h:73
StreamID.h
edm::ConsumesCollector
Definition:
ConsumesCollector.h:45
muonDTDigis_cfi.pset
pset
Definition:
muonDTDigis_cfi.py:27
Generated for CMSSW Reference Manual by
1.8.16