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 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  if (handle.isValid())
56  digitizer_->accumulate(*handle);
57  else
58  edm::LogWarning("MtdMix") << "PreMixingMTDWorker::Cannot find Signal collection";
59 }
60 
64  if (handle.isValid())
65  digitizer_->accumulate(*handle);
66  else
67  edm::LogWarning("MtdMix") << "PreMixingMTDWorker::Cannot find PileUp collection";
68 }
69 
71  const edm::EventSetup& ES,
72  std::vector<PileupSummaryInfo> const& ps,
73  int bs) {
75  digitizer_->finalizeEvent(e, ES, &rng->getEngine(e.streamID()));
76 }
77 
PreMixingMTDWorker & operator=(const PreMixingMTDWorker &)=delete
edm::EDGetTokenT< PMTDSimAccumulator > signalToken_
std::unique_ptr< MTDDigitizerBase > digitizer_
def create(alignables, pedeDump, additionalData, outputFile, config)
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
edm::InputTag pileInputTag_
void put(edm::Event &e, const edm::EventSetup &ES, std::vector< PileupSummaryInfo > const &ps, int bs) override
HLT enums.
#define get
Log< level::Warning, false > LogWarning
#define DEFINE_PREMIXING_WORKER(TYPE)
~PreMixingMTDWorker() override=default
bool getByLabel(edm::InputTag const &tag, edm::Handle< T > &result) const
void addPileups(const PileUpEventPrincipal &, const edm::EventSetup &ES) override