|
|
|
void | addSignals (const edm::Event &e, const edm::EventSetup &ES) override |
|
void | beginLuminosityBlock (LuminosityBlock const &l1, EventSetup const &c) override |
|
void | beginRun (edm::Run const &run, edm::EventSetup const &eventSetup) override |
|
void | checkSignal (const edm::Event &e) override |
|
void | createnewEDProduct () override |
|
void | doPileUp (edm::Event &e, const edm::EventSetup &ES) override |
|
void | endLuminosityBlock (LuminosityBlock const &l1, EventSetup const &c) override |
|
void | endRun (const edm::Run &r, const edm::EventSetup &setup) override |
|
void | initializeEvent (edm::Event const &e, edm::EventSetup const &eventSetup) override |
|
| PreMixingModule (const edm::ParameterSet &ps, MixingCache::Config const *globalConf) |
|
void | put (edm::Event &e, const edm::EventSetup &ES) override |
|
| ~PreMixingModule () override=default |
|
virtual void | addPileups (const int bcr, EventPrincipal *ep, unsigned int eventId, unsigned int worker, const edm::EventSetup &c) |
|
double | averageNumber () const |
|
void | beginLuminosityBlock (const edm::LuminosityBlock &l, const edm::EventSetup &setup) override |
|
void | beginRun (const edm::Run &r, const edm::EventSetup &setup) override |
|
| BMixingModule (const edm::ParameterSet &ps, MixingCache::Config const *globalConf) |
|
void | endLuminosityBlock (const edm::LuminosityBlock &l, const edm::EventSetup &setup) override |
|
void | endRun (const edm::Run &r, const edm::EventSetup &setup) override |
|
virtual void | finalizeEvent (edm::Event &event, const edm::EventSetup &setup) |
|
bool | poisson () const |
|
void | produce (edm::Event &e1, const edm::EventSetup &c) override |
|
virtual void | reload (const edm::EventSetup &setup) |
|
virtual void | setBcrOffset () |
|
virtual void | setSourceOffset (const unsigned int s) |
|
| ~BMixingModule () override |
|
| EDProducer ()=default |
|
bool | hasAbilityToProduceInBeginLumis () const final |
|
bool | hasAbilityToProduceInBeginProcessBlocks () const final |
|
bool | hasAbilityToProduceInBeginRuns () const final |
|
bool | hasAbilityToProduceInEndLumis () const final |
|
bool | hasAbilityToProduceInEndProcessBlocks () const final |
|
bool | hasAbilityToProduceInEndRuns () const final |
|
Definition at line 39 of file PreMixingModule.cc.
◆ PreMixingModule()
Definition at line 105 of file PreMixingModule.cc.
109 consumesCollector()),
112 [](
const auto& ps) { return AdjustPileupDistribution(ps); })) {
114 return a.firstRun() <
b.firstRun();
118 std::vector<std::string>
names =
workers.getParameterNames();
124 std::vector<std::string>
tmp;
141 if (
name ==
"pileup") {
◆ ~PreMixingModule()
edm::PreMixingModule::~PreMixingModule |
( |
| ) |
|
|
overridedefault |
◆ addSignals()
◆ beginLuminosityBlock()
◆ beginRun()
◆ checkSignal()
void edm::PreMixingModule::checkSignal |
( |
const edm::Event & |
e | ) |
|
|
inlineoverridevirtual |
◆ createnewEDProduct()
void edm::PreMixingModule::createnewEDProduct |
( |
| ) |
|
|
inlineoverridevirtual |
◆ doPileUp()
Reimplemented from edm::BMixingModule.
Definition at line 231 of file PreMixingModule.cc.
232 using namespace std::placeholders;
234 std::vector<edm::SecondaryEventIDAndFileInfo> recordEventID;
235 std::vector<int> PileupList;
238 ModuleCallingContext
const* mcc =
e.moduleCallingContext();
240 AdjustPileupDistribution
const* pileupAdjuster =
nullptr;
247 [iRun =
e.id().run()](
const auto& elem) {
return elem.firstRun() <= iRun; });
249 throw cms::Exception(
"LogicError") <<
"Encountered run " <<
e.id().run()
250 <<
", but the first run available in the pileup adjustment configuration is "
251 <<
pileupAdjusters_.front().firstRun() <<
". Please fix the configuration.";
253 pileupAdjuster = &*it;
257 for (
unsigned int isource = 0; isource <
maxNbSources_; ++isource) {
265 int NumPU_Events = 0;
267 NumPU_Events = PileupList[bunchCrossing -
minBunch_];
274 w->initializeBunchCrossing(
e, ES, bunchCrossing);
286 w->finalizeBunchCrossing(
e, ES, bunchCrossing);
References MillePedeFileConverter_cfg::e, Exception, edm::BMixingModule::inputSources_, edm::BMixingModule::maxBunch_, edm::BMixingModule::maxNbSources_, edm::BMixingModule::minBunch_, pileupAdjusters_, pileWorker(), edm::source(), edm::BMixingModule::TrueNumInteractions_, w, and workers_.
◆ endLuminosityBlock()
◆ endRun()
◆ initializeEvent()
◆ pileWorker()
Definition at line 183 of file PreMixingModule.cc.
189 InternalContext internalContext(
ep.id(), mcc);
190 ParentContext parentContext(&internalContext);
191 ModuleCallingContext moduleCallingContext(&moduleDescription());
192 ModuleContextSentry moduleContextSentry(&moduleCallingContext, parentContext);
196 if (pileupAdjuster) {
198 double prob = pileupAdjuster->probability(static_cast<unsigned int>(trueNumInteractions));
200 CLHEP::HepRandomEngine& engine = rng->
getEngine(
ep.streamID());
201 if (engine.flat() >
prob) {
208 LogDebug(
"PreMixingModule") <<
"\n===============> adding pileups from event " <<
ep.id() <<
" for bunchcrossing "
225 w->addPileups(pep, ES);
References addedPileup_, edm::PreMixingPileupCopy::addPileupInfo(), SiStripBadComponentsDQMServiceTemplate_cfg::ep, edm::RandomNumberGenerator::getEngine(), edm::PreMixingPileupCopy::getTrueNumInteractions(), LogDebug, TtFullHadEvtBuilder_cfi::prob, edm::PreMixingModule::AdjustPileupDistribution::probability(), puWorker_, edm::BMixingModule::setupPileUpEvent(), w, and workers_.
Referenced by doPileUp().
◆ put()
◆ addedPileup_
bool edm::PreMixingModule::addedPileup_ = false |
|
private |
◆ pileupAdjusters_
◆ puWorker_
◆ workers_
std::vector<std::unique_ptr<PreMixingWorker> > edm::PreMixingModule::workers_ |
|
private |
void endRun(const edm::Run &r, const edm::EventSetup &setup) override
std::vector< std::shared_ptr< PileUp > > inputSources_
void endLuminosityBlock(const edm::LuminosityBlock &l, const edm::EventSetup &setup) override
static const std::string source("source")
virtual CLHEP::HepRandomEngine & getEngine(StreamID const &)=0
Use this engine in event methods.
int getBunchSpacing() const
void setupPileUpEvent(const edm::EventSetup &setup)
void putPileupInfo(edm::Event &e)
std::vector< float > TrueNumInteractions_
def create(alignables, pedeDump, additionalData, outputFile, config)
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
std::vector< std::unique_ptr< PreMixingWorker > > workers_
void beginLuminosityBlock(const edm::LuminosityBlock &l, const edm::EventSetup &setup) override
const std::string names[nVars_]
std::vector< AdjustPileupDistribution > pileupAdjusters_
const static unsigned int maxNbSources_
float getTrueNumInteractions(PileUpEventPrincipal const &pep) const
const std::vector< PileupSummaryInfo > & getPileupSummaryInfo() const
auto vector_transform(std::vector< InputType > const &input, Function predicate) -> std::vector< typename std::remove_cv< typename std::remove_reference< decltype(predicate(input.front()))>::type >::type >
void addPileupInfo(PileUpEventPrincipal const &pep)
PreMixingPileupCopy puWorker_
BMixingModule(const edm::ParameterSet &ps, MixingCache::Config const *globalConf)
bool pileWorker(const edm::EventPrincipal &, int bcr, int EventId, const edm::EventSetup &ES, ModuleCallingContext const *, AdjustPileupDistribution const *pileupAdjuster)
T getParameter(std::string const &) const
void beginRun(const edm::Run &r, const edm::EventSetup &setup) override