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  signalToken_(iC.consumes<PMTDSimAccumulator>(ps.getParameter<edm::InputTag>("digiTagSig"))),
44  pileInputTag_(ps.getParameter<edm::InputTag>("pileInputTag")),
45  digitizer_(MTDDigitizerFactory::get()->create(ps.getParameter<std::string>("digitizerName"),
46  ps,iC,producer))
47 {}
48 
50  digitizer_->beginRun(ES);
51 }
52 
54  digitizer_->endRun();
55 }
56 
59  e.getByToken(signalToken_, handle);
60  digitizer_->accumulate(*handle);
61 }
62 
65  pep.getByLabel(pileInputTag_, handle);
66  digitizer_->accumulate(*handle);
67 }
68 
69 void PreMixingMTDWorker::put(edm::Event &e,const edm::EventSetup& ES, std::vector<PileupSummaryInfo> const& ps, 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:517
void initializeEvent(const edm::Event &e, const edm::EventSetup &ES) override
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
PreMixingMTDWorker(const edm::ParameterSet &ps, edm::ProducerBase &producer, edm::ConsumesCollector &&iC)
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:95
#define DEFINE_PREMIXING_WORKER(TYPE)
T get(const Candidate &c)
Definition: component.h:55
~PreMixingMTDWorker() override=default
Definition: Run.h:45
void addPileups(const PileUpEventPrincipal &, const edm::EventSetup &ES) override