CMS 3D CMS Logo

PreMixingMTDWorker.cc
Go to the documentation of this file.
8 
11 
15 
18 
20 public:
22  ~PreMixingMTDWorker() override = default;
23 
24  PreMixingMTDWorker(const PreMixingMTDWorker&) = delete;
26 
27  void beginRun(const edm::Run& run, const edm::EventSetup& ES) override;
28  void endRun() override;
29  void initializeEvent(const edm::Event& e, const edm::EventSetup& ES) override {}
30  void addSignals(const edm::Event& e, const edm::EventSetup& ES) override;
31  void addPileups(const PileUpEventPrincipal&, const edm::EventSetup& ES) override;
32  void put(edm::Event& e, const edm::EventSetup& ES, std::vector<PileupSummaryInfo> const& ps, int bs) override;
33 
34 private:
36 
38 
39  std::unique_ptr<MTDDigitizerBase> digitizer_;
40 };
41 
43  edm::ProducesCollector producesCollector,
45  : signalToken_(iC.consumes<PMTDSimAccumulator>(ps.getParameter<edm::InputTag>("digiTagSig"))),
46  pileInputTag_(ps.getParameter<edm::InputTag>("pileInputTag")),
48  ps.getParameter<std::string>("digitizerName"), ps, producesCollector, iC)) {}
49 
50 void PreMixingMTDWorker::beginRun(const edm::Run& run, const edm::EventSetup& ES) { digitizer_->beginRun(ES); }
51 
53 
56  e.getByToken(signalToken_, handle);
57  digitizer_->accumulate(*handle);
58 }
59 
62  pep.getByLabel(pileInputTag_, handle);
63  digitizer_->accumulate(*handle);
64 }
65 
67  const edm::EventSetup& ES,
68  std::vector<PileupSummaryInfo> const& ps,
69  int bs) {
71  digitizer_->finalizeEvent(e, ES, &rng->getEngine(e.streamID()));
72 }
73 
PreMixingMTDWorker & operator=(const PreMixingMTDWorker &)=delete
edm::EDGetTokenT< PMTDSimAccumulator > signalToken_
std::unique_ptr< MTDDigitizerBase > digitizer_
def create(alignables, pedeDump, additionalData, outputFile, config)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:525
void initializeEvent(const edm::Event &e, const edm::EventSetup &ES) override
PreMixingMTDWorker(const edm::ParameterSet &ps, edm::ProducesCollector, edm::ConsumesCollector &&iC)
virtual CLHEP::HepRandomEngine & getEngine(StreamID const &)=0
Use this engine in event methods.
void addSignals(const edm::Event &e, const edm::EventSetup &ES) override
void endRun() override
edm::InputTag pileInputTag_
void put(edm::Event &e, const edm::EventSetup &ES, std::vector< PileupSummaryInfo > const &ps, int bs) override
HLT enums.
bool getByLabel(edm::InputTag const &tag, edm::Handle< T > &result) const
void beginRun(const edm::Run &run, const edm::EventSetup &ES) override
StreamID streamID() const
Definition: Event.h:96
#define DEFINE_PREMIXING_WORKER(TYPE)
~PreMixingMTDWorker() override=default
Definition: Run.h:45
void addPileups(const PileUpEventPrincipal &, const edm::EventSetup &ES) override