58 std::vector<std::unique_ptr<PreMixingWorker> >
workers_;
66 std::vector<std::string>
names =
workers.getParameterNames();
72 std::vector<std::string>
tmp;
75 if(
i != names.end()) {
84 std::copy(names.begin(), names.end(), std::back_inserter(tmp));
88 for(
const auto&
name: names) {
89 if(
name ==
"pileup") {
101 w->initializeEvent(e, ES);
109 w->beginRun(run, ES);
123 LogDebug(
"PreMixingModule")<<
"===============> adding MC signals for "<<e.
id();
126 w->addSignals(e, ES);
140 LogDebug(
"PreMixingModule") <<
"\n===============> adding pileups from event "<<ep.
id()<<
" for bunchcrossing "<<bcr;
156 w->addPileups(pep, ES);
164 std::vector<edm::SecondaryEventIDAndFileInfo> recordEventID;
165 std::vector<int> PileupList;
171 for (
unsigned int isource=0;isource<
maxNbSources_;++isource) {
173 if (!source || !(source->doPileUp(bunchCrossing)))
179 int NumPU_Events = 0;
181 NumPU_Events = PileupList[bunchCrossing -
minBunch_];
188 w->initializeBunchCrossing(e, ES, bunchCrossing);
195 _1, bunchCrossing, _2, std::cref(ES), mcc),
200 for(
auto&
w: workers_) {
201 w->finalizeBunchCrossing(e, ES, bunchCrossing);
214 w->put(e, ES, ps, bunchSpacing);
223 w->beginLuminosityBlock(l1,c);
T getParameter(std::string const &) const
void createnewEDProduct() override
void beginRun(const edm::Run &r, const edm::EventSetup &setup) override
static std::string const source("source")
def create(alignables, pedeDump, additionalData, outputFile, config)
#define DEFINE_FWK_MODULE(type)
std::vector< float > TrueNumInteractions_
void endRun(const edm::Run &r, const edm::EventSetup &setup) override
EventID const & id() const
def setup(process, global_tag, zero_tesla=False)
void beginRun(edm::Run const &run, edm::EventSetup const &eventSetup) override
void putPileupInfo(edm::Event &e)
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
const std::string names[nVars_]
void endRun(const edm::Run &r, const edm::EventSetup &setup) override
void initializeEvent(edm::Event const &e, edm::EventSetup const &eventSetup) override
void endLuminosityBlock(LuminosityBlock const &l1, EventSetup const &c) override
void addPileupInfo(PileUpEventPrincipal const &pep)
ModuleCallingContext const * moduleCallingContext() const
void put(edm::Event &e, const edm::EventSetup &ES) override
static const unsigned int maxNbSources_
void beginLuminosityBlock(LuminosityBlock const &l1, EventSetup const &c) override
void pileWorker(const edm::EventPrincipal &, int bcr, int EventId, const edm::EventSetup &ES, ModuleCallingContext const *)
std::vector< std::vector< double > > tmp
int getBunchSpacing() const
~PreMixingModule() override=default
std::vector< std::shared_ptr< PileUp > > inputSources_
std::vector< std::unique_ptr< PreMixingWorker > > workers_
void checkSignal(const edm::Event &e) override
void addSignals(const edm::Event &e, const edm::EventSetup &ES) override
StreamID streamID() const
void beginLuminosityBlock(const edm::LuminosityBlock &l, const edm::EventSetup &setup) override
PreMixingPileupCopy puWorker_
const std::vector< PileupSummaryInfo > & getPileupSummaryInfo() const
void setupPileUpEvent(const edm::EventSetup &setup)
void endLuminosityBlock(const edm::LuminosityBlock &l, const edm::EventSetup &setup) override
T get(const Candidate &c)
PreMixingModule(const edm::ParameterSet &ps, MixingCache::Config const *globalConf)
void doPileUp(edm::Event &e, const edm::EventSetup &ES) override