CMS 3D CMS Logo

PreMixingHGCalWorker.cc
Go to the documentation of this file.
8 
11 
15 
18 
20 public:
22  ~PreMixingHGCalWorker() override = default;
23 
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 
40 };
41 
43  signalToken_(iC.consumes<PHGCSimAccumulator>(ps.getParameter<edm::InputTag>("digiTagSig"))),
44  pileInputTag_(ps.getParameter<edm::InputTag>("pileInputTag")),
45  digitizer_(ps, iC)
46 {
48 }
49 
51  digitizer_.beginRun(ES);
52 }
53 
56 }
57 
60  e.getByToken(signalToken_, handle);
61  digitizer_.accumulate(*handle);
62 }
63 
66  pep.getByLabel(pileInputTag_, handle);
67  digitizer_.accumulate(*handle);
68 }
69 
70 void PreMixingHGCalWorker::put(edm::Event &e,const edm::EventSetup& ES, std::vector<PileupSummaryInfo> const& ps, int bs) {
72  digitizer_.finalizeEvent(e, ES, &rng->getEngine(e.streamID()));
73 }
74 
BranchAliasSetterT< ProductType > produces()
declare what type of product will make and with which optional label
void finalizeEvent(edm::Event &e, edm::EventSetup const &c, CLHEP::HepRandomEngine *hre)
PreMixingHGCalWorker(const edm::ParameterSet &ps, edm::ProducerBase &producer, edm::ConsumesCollector &&iC)
void addSignals(const edm::Event &e, const edm::EventSetup &ES) override
~PreMixingHGCalWorker() override=default
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:579
PreMixingHGCalWorker & operator=(const PreMixingHGCalWorker &)=delete
virtual CLHEP::HepRandomEngine & getEngine(StreamID const &)=0
Use this engine in event methods.
void beginRun(const edm::EventSetup &es)
actions at the start/end of run
void addPileups(const PileUpEventPrincipal &, const edm::EventSetup &ES) override
void beginRun(const edm::Run &run, const edm::EventSetup &ES) override
void put(edm::Event &e, const edm::EventSetup &ES, std::vector< PileupSummaryInfo > const &ps, int bs) override
void accumulate(edm::Event const &e, edm::EventSetup const &c, CLHEP::HepRandomEngine *hre)
handle SimHit accumulation
HLT enums.
bool getByLabel(edm::InputTag const &tag, edm::Handle< T > &result) const
StreamID streamID() const
Definition: Event.h:96
void initializeEvent(const edm::Event &e, const edm::EventSetup &ES) override
#define DEFINE_PREMIXING_WORKER(TYPE)
std::string digiCollection()
Definition: HGCDigitizer.h:76
Definition: Run.h:44
edm::EDGetTokenT< PHGCSimAccumulator > signalToken_