CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 initializeEvent(const edm::Event& e, const edm::EventSetup& ES) override;
28  void addSignals(const edm::Event& e, const edm::EventSetup& ES) override;
29  void addPileups(const PileUpEventPrincipal&, const edm::EventSetup& ES) override;
30  void put(edm::Event& e, const edm::EventSetup& ES, std::vector<PileupSummaryInfo> const& ps, int bs) override;
31 
32 private:
34 
36 
37  std::unique_ptr<MTDDigitizerBase> digitizer_;
38 };
39 
41  edm::ProducesCollector producesCollector,
43  : signalToken_(iC.consumes<PMTDSimAccumulator>(ps.getParameter<edm::InputTag>("digiTagSig"))),
44  pileInputTag_(ps.getParameter<edm::InputTag>("pileInputTag")),
45  digitizer_(MTDDigitizerFactory::get()->create(
46  ps.getParameter<std::string>("digitizerName"), ps, producesCollector, iC)) {}
47 
49  digitizer_->initializeEvent(e, ES);
50 }
51 
54  e.getByToken(signalToken_, handle);
55  digitizer_->accumulate(*handle);
56 }
57 
60  pep.getByLabel(pileInputTag_, handle);
61  digitizer_->accumulate(*handle);
62 }
63 
65  const edm::EventSetup& ES,
66  std::vector<PileupSummaryInfo> const& ps,
67  int bs) {
69  digitizer_->finalizeEvent(e, ES, &rng->getEngine(e.streamID()));
70 }
71 
PreMixingMTDWorker & operator=(const PreMixingMTDWorker &)=delete
edm::EDGetTokenT< PMTDSimAccumulator > signalToken_
std::unique_ptr< MTDDigitizerBase > digitizer_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:539
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
tuple handle
Definition: patZpeak.py:25
edm::InputTag pileInputTag_
void put(edm::Event &e, const edm::EventSetup &ES, std::vector< PileupSummaryInfo > const &ps, int bs) override
bool getByLabel(edm::InputTag const &tag, edm::Handle< T > &result) const
StreamID streamID() const
Definition: Event.h:98
#define get
#define DEFINE_PREMIXING_WORKER(TYPE)
~PreMixingMTDWorker() override=default
void addPileups(const PileUpEventPrincipal &, const edm::EventSetup &ES) override