CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes
edm::BMixingModule Class Reference

#include <BMixingModule.h>

Inheritance diagram for edm::BMixingModule:
edm::stream::EDProducer< GlobalCache< MixingCache::Config > > edm::DataMixingModule edm::MixingModule edm::PreMixingModule

Public Member Functions

virtual void addPileups (const int bcr, EventPrincipal *ep, unsigned int eventId, unsigned int worker, const edm::EventSetup &c)
 
virtual void addSignals (const edm::Event &e, 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)
 
virtual void checkSignal (const edm::Event &e)
 
virtual void createnewEDProduct ()
 
virtual void doPileUp (edm::Event &e, const edm::EventSetup &c)
 
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)
 
virtual void initializeEvent (const edm::Event &event, const edm::EventSetup &setup)
 
bool poisson () const
 
void produce (edm::Event &e1, const edm::EventSetup &c) override
 
virtual void put (edm::Event &e, const edm::EventSetup &c)
 
void registerLateConsumes (eventsetup::ESRecordsToProxyIndices const &) override
 
virtual void reload (const edm::EventSetup &setup)
 
virtual void setBcrOffset ()
 
virtual void setSourceOffset (const unsigned int s)
 
 ~BMixingModule () override
 
- Public Member Functions inherited from edm::stream::EDProducer< GlobalCache< MixingCache::Config > >
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Static Public Member Functions

static void globalEndJob (MixingCache::Config *)
 
static std::unique_ptr< MixingCache::ConfiginitializeGlobalCache (edm::ParameterSet const &)
 

Protected Member Functions

void beginStream (edm::StreamID) override
 
void dropUnwantedBranches (std::vector< std::string > const &wantedBranches)
 
void endStream () override
 
void setupPileUpEvent (const edm::EventSetup &setup)
 
void update (edm::EventSetup const &)
 

Protected Attributes

int bunchSpace_
 
bool checktof_
 
bool doit_ [4]
 
unsigned int eventId_
 
std::vector< std::shared_ptr< PileUp > > inputSources_
 
int maxBunch_
 
int minBunch_
 
bool const mixProdStep1_
 
bool const mixProdStep2_
 
edm::ESWatcher< MixingRcdparameterWatcher_
 
bool playback_
 
bool readDB_
 
std::vector< float > TrueNumInteractions_
 
int vertexOffset_
 

Static Protected Attributes

static const unsigned int maxNbSources_ = 4
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer< GlobalCache< MixingCache::Config > >
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 

Detailed Description

Definition at line 41 of file BMixingModule.h.

Constructor & Destructor Documentation

◆ BMixingModule()

BMixingModule::BMixingModule ( const edm::ParameterSet ps,
MixingCache::Config const *  globalConf 
)
explicit

standard constructor

Definition at line 179 of file BMixingModule.cc.

References edm::MixingCache::Config::inputConfigs_, inputSources_, maxNbSources_, muonDTDigis_cfi::pset, and readDB_.

180  : bunchSpace_(globalConf->bunchSpace_),
181  vertexOffset_(0),
182  minBunch_(globalConf->minBunch_),
183  maxBunch_(globalConf->maxBunch_),
184  mixProdStep1_(pset.getParameter<bool>("mixProdStep1")),
185  mixProdStep2_(pset.getParameter<bool>("mixProdStep2")),
186  readDB_(globalConf->configFromDB_),
187  playback_(globalConf->playback_) {
188  for (size_t makeIdx = 0; makeIdx < maxNbSources_; makeIdx++) {
189  if (globalConf->inputConfigs_[makeIdx]) {
190  const edm::ParameterSet& psin =
191  pset.getParameter<edm::ParameterSet>(globalConf->inputConfigs_[makeIdx]->sourcename_);
192  inputSources_.push_back(
193  std::make_shared<PileUp>(psin, globalConf->inputConfigs_[makeIdx], consumesCollector(), readDB_));
194  inputSources_.back()->input(makeIdx);
195  } else {
196  inputSources_.push_back(nullptr);
197  }
198  }
199  }
bool const mixProdStep2_
static const unsigned int maxNbSources_
bool const mixProdStep1_
Definition: BMixingModule.h:99
std::vector< std::shared_ptr< PileUp > > inputSources_

◆ ~BMixingModule()

BMixingModule::~BMixingModule ( )
override

Default destructor

Definition at line 202 of file BMixingModule.cc.

202 { ; }

Member Function Documentation

◆ addPileups()

virtual void edm::BMixingModule::addPileups ( const int  bcr,
EventPrincipal ep,
unsigned int  eventId,
unsigned int  worker,
const edm::EventSetup c 
)
inlinevirtual

Definition at line 81 of file BMixingModule.h.

82  {}

◆ addSignals()

virtual void edm::BMixingModule::addSignals ( const edm::Event e,
const edm::EventSetup c 
)
inlinevirtual

Reimplemented in edm::MixingModule, edm::DataMixingModule, and edm::PreMixingModule.

Definition at line 80 of file BMixingModule.h.

Referenced by produce().

80 {}

◆ averageNumber()

double edm::BMixingModule::averageNumber ( ) const
inline

Definition at line 74 of file BMixingModule.h.

References inputSources_.

74 { return inputSources_[0] ? inputSources_[0]->averageNumber() : 0.0; }
std::vector< std::shared_ptr< PileUp > > inputSources_

◆ beginLuminosityBlock()

void BMixingModule::beginLuminosityBlock ( const edm::LuminosityBlock l,
const edm::EventSetup setup 
)
override

Definition at line 243 of file BMixingModule.cc.

References inputSources_, maxNbSources_, singleTopDQM_cfi::setup, and update().

Referenced by edm::PreMixingModule::beginLuminosityBlock(), edm::MixingModule::beginLuminosityBlock(), and edm::DataMixingModule::beginLuminosityBlock().

243  {
244  update(setup);
245  for (size_t endIdx = 0; endIdx < maxNbSources_; ++endIdx) {
246  if (inputSources_[endIdx])
247  inputSources_[endIdx]->beginLuminosityBlock(lumi, setup);
248  }
249  }
static const unsigned int maxNbSources_
std::vector< std::shared_ptr< PileUp > > inputSources_
void update(edm::EventSetup const &)

◆ beginRun()

void BMixingModule::beginRun ( const edm::Run r,
const edm::EventSetup setup 
)
override

Definition at line 251 of file BMixingModule.cc.

References inputSources_, maxNbSources_, writedatasetfile::run, and singleTopDQM_cfi::setup.

Referenced by edm::PreMixingModule::beginRun(), edm::DataMixingModule::beginRun(), and edm::MixingModule::beginRun().

251  {
252  for (size_t endIdx = 0; endIdx < maxNbSources_; ++endIdx) {
253  if (inputSources_[endIdx])
254  inputSources_[endIdx]->beginRun(run, setup);
255  }
256  }
static const unsigned int maxNbSources_
std::vector< std::shared_ptr< PileUp > > inputSources_

◆ beginStream()

void BMixingModule::beginStream ( edm::StreamID  iID)
overrideprotected

Definition at line 321 of file BMixingModule.cc.

References inputSources_, and maxNbSources_.

321  {
322  for (size_t endIdx = 0; endIdx < maxNbSources_; ++endIdx) {
323  if (inputSources_[endIdx])
324  inputSources_[endIdx]->beginStream(iID);
325  }
326  }
static const unsigned int maxNbSources_
std::vector< std::shared_ptr< PileUp > > inputSources_

◆ checkSignal()

void BMixingModule::checkSignal ( const edm::Event e)
virtual

Reimplemented in edm::MixingModule, edm::DataMixingModule, and edm::PreMixingModule.

Definition at line 339 of file BMixingModule.cc.

Referenced by produce().

339  {
340  edm::LogWarning("MixingModule") << "BMixingModule::checkSignal must be overwritten!";
341  }
Log< level::Warning, false > LogWarning

◆ createnewEDProduct()

void BMixingModule::createnewEDProduct ( )
virtual

Reimplemented in edm::MixingModule, edm::DataMixingModule, and edm::PreMixingModule.

Definition at line 335 of file BMixingModule.cc.

Referenced by produce().

335  {
336  edm::LogWarning("MixingModule") << "BMixingModule::createnewEDProduct must be overwritten!";
337  }
Log< level::Warning, false > LogWarning

◆ doPileUp()

void BMixingModule::doPileUp ( edm::Event e,
const edm::EventSetup c 
)
virtual

Reimplemented in edm::MixingModule, edm::DataMixingModule, and edm::PreMixingModule.

Definition at line 351 of file BMixingModule.cc.

Referenced by produce().

351  {
352  edm::LogWarning("MixingModule") << "BMixingModule::doPileUp must be overwritten!";
353  }
Log< level::Warning, false > LogWarning

◆ dropUnwantedBranches()

void BMixingModule::dropUnwantedBranches ( std::vector< std::string > const &  wantedBranches)
protected

Definition at line 314 of file BMixingModule.cc.

References inputSources_, and maxNbSources_.

Referenced by edm::MixingModule::MixingModule().

314  {
315  for (size_t dropIdx = 0; dropIdx < maxNbSources_; ++dropIdx) {
316  if (inputSources_[dropIdx])
317  inputSources_[dropIdx]->dropUnwantedBranches(wantedBranches);
318  }
319  }
static const unsigned int maxNbSources_
std::vector< std::shared_ptr< PileUp > > inputSources_

◆ endLuminosityBlock()

void BMixingModule::endLuminosityBlock ( const edm::LuminosityBlock l,
const edm::EventSetup setup 
)
override

Definition at line 258 of file BMixingModule.cc.

References inputSources_, maxNbSources_, and singleTopDQM_cfi::setup.

Referenced by edm::PreMixingModule::endLuminosityBlock(), edm::DataMixingModule::endLuminosityBlock(), and edm::MixingModule::endLuminosityBlock().

258  {
259  for (size_t endIdx = 0; endIdx < maxNbSources_; ++endIdx) {
260  if (inputSources_[endIdx])
261  inputSources_[endIdx]->endLuminosityBlock(lumi, setup);
262  }
263  }
static const unsigned int maxNbSources_
std::vector< std::shared_ptr< PileUp > > inputSources_

◆ endRun()

void BMixingModule::endRun ( const edm::Run r,
const edm::EventSetup setup 
)
override

Definition at line 265 of file BMixingModule.cc.

References inputSources_, maxNbSources_, writedatasetfile::run, and singleTopDQM_cfi::setup.

Referenced by edm::PreMixingModule::endRun(), edm::MixingModule::endRun(), and edm::DataMixingModule::endRun().

265  {
266  for (size_t endIdx = 0; endIdx < maxNbSources_; ++endIdx) {
267  if (inputSources_[endIdx])
268  inputSources_[endIdx]->endRun(run, setup);
269  }
270  }
static const unsigned int maxNbSources_
std::vector< std::shared_ptr< PileUp > > inputSources_

◆ endStream()

void BMixingModule::endStream ( )
overrideprotected

Definition at line 328 of file BMixingModule.cc.

References inputSources_, and maxNbSources_.

328  {
329  for (size_t endIdx = 0; endIdx < maxNbSources_; ++endIdx) {
330  if (inputSources_[endIdx])
331  inputSources_[endIdx]->endStream();
332  }
333  }
static const unsigned int maxNbSources_
std::vector< std::shared_ptr< PileUp > > inputSources_

◆ finalizeEvent()

virtual void edm::BMixingModule::finalizeEvent ( edm::Event event,
const edm::EventSetup setup 
)
inlinevirtual

Reimplemented in edm::MixingModule.

Definition at line 57 of file BMixingModule.h.

Referenced by produce().

57 {}

◆ globalEndJob()

static void edm::BMixingModule::globalEndJob ( MixingCache::Config )
inlinestatic

Definition at line 66 of file BMixingModule.h.

66 {}

◆ initializeEvent()

virtual void edm::BMixingModule::initializeEvent ( const edm::Event event,
const edm::EventSetup setup 
)
inlinevirtual

Reimplemented in edm::MixingModule, edm::DataMixingModule, and edm::PreMixingModule.

Definition at line 54 of file BMixingModule.h.

Referenced by produce().

54 {}

◆ initializeGlobalCache()

std::unique_ptr< MixingCache::Config > BMixingModule::initializeGlobalCache ( edm::ParameterSet const &  pset)
static

Definition at line 238 of file BMixingModule.cc.

References maxNbSources_, and muonDTDigis_cfi::pset.

238  {
239  return std::make_unique<MixingCache::Config>(pset, maxNbSources_);
240  }
static const unsigned int maxNbSources_

◆ poisson()

bool edm::BMixingModule::poisson ( ) const
inline

Definition at line 76 of file BMixingModule.h.

References inputSources_.

76 { return inputSources_[0] ? inputSources_[0]->poisson() : 0.0; }
std::vector< std::shared_ptr< PileUp > > inputSources_

◆ produce()

void BMixingModule::produce ( edm::Event e1,
const edm::EventSetup c 
)
override

Cumulates the pileup events onto this event

Definition at line 283 of file BMixingModule.cc.

References addSignals(), checkSignal(), createnewEDProduct(), doPileUp(), MillePedeFileConverter_cfg::e, finalizeEvent(), initializeEvent(), mixProdStep1_, put(), and singleTopDQM_cfi::setup.

283  {
284  // Check if the signal is present in the root file
285  // for all the objects we want to mix
286  checkSignal(e);
287 
288  // Create EDProduct
290 
292 
293  // Add signals
294  if (!mixProdStep1_) {
295  addSignals(e, setup);
296  }
297 
298  doPileUp(e, setup);
299 
300  // Includes putting digi products into the edm::Event.
302 
303  // Put output into event (here only playback info)
304  put(e, setup);
305  }
virtual void addSignals(const edm::Event &e, const edm::EventSetup &c)
Definition: BMixingModule.h:80
virtual void finalizeEvent(edm::Event &event, const edm::EventSetup &setup)
Definition: BMixingModule.h:57
virtual void checkSignal(const edm::Event &e)
virtual void put(edm::Event &e, const edm::EventSetup &c)
Definition: BMixingModule.h:85
virtual void createnewEDProduct()
virtual void doPileUp(edm::Event &e, const edm::EventSetup &c)
virtual void initializeEvent(const edm::Event &event, const edm::EventSetup &setup)
Definition: BMixingModule.h:54
bool const mixProdStep1_
Definition: BMixingModule.h:99

◆ put()

virtual void edm::BMixingModule::put ( edm::Event e,
const edm::EventSetup c 
)
inlinevirtual

Reimplemented in edm::MixingModule, edm::DataMixingModule, and edm::PreMixingModule.

Definition at line 85 of file BMixingModule.h.

Referenced by produce().

85 {}

◆ registerLateConsumes()

void BMixingModule::registerLateConsumes ( eventsetup::ESRecordsToProxyIndices const &  iES)
override

Definition at line 204 of file BMixingModule.cc.

References inputSources_, and maxNbSources_.

204  {
205  for (size_t endIdx = 0; endIdx < maxNbSources_; ++endIdx) {
206  if (inputSources_[endIdx])
207  inputSources_[endIdx]->beginJob(iES);
208  }
209  }
static const unsigned int maxNbSources_
std::vector< std::shared_ptr< PileUp > > inputSources_

◆ reload()

virtual void edm::BMixingModule::reload ( const edm::EventSetup setup)
inlinevirtual

Reimplemented in edm::MixingModule.

Definition at line 69 of file BMixingModule.h.

Referenced by update().

69 {};

◆ setBcrOffset()

void BMixingModule::setBcrOffset ( )
virtual

Definition at line 343 of file BMixingModule.cc.

343  {
344  edm::LogWarning("MixingModule") << "BMixingModule::setBcrOffset must be overwritten!";
345  }
Log< level::Warning, false > LogWarning

◆ setSourceOffset()

void BMixingModule::setSourceOffset ( const unsigned int  s)
virtual

Definition at line 347 of file BMixingModule.cc.

347  {
348  edm::LogWarning("MixingModule") << "BMixingModule::setSourceOffset must be overwritten!";
349  }
Log< level::Warning, false > LogWarning

◆ setupPileUpEvent()

void BMixingModule::setupPileUpEvent ( const edm::EventSetup setup)
protected

Definition at line 307 of file BMixingModule.cc.

References inputSources_, maxNbSources_, and singleTopDQM_cfi::setup.

Referenced by edm::MixingModule::pileAllWorkers(), edm::DataMixingModule::pileWorker(), and edm::PreMixingModule::pileWorker().

307  {
308  for (size_t dropIdx = 0; dropIdx < maxNbSources_; ++dropIdx) {
309  if (inputSources_[dropIdx])
310  inputSources_[dropIdx]->setupPileUpEvent(setup);
311  }
312  }
static const unsigned int maxNbSources_
std::vector< std::shared_ptr< PileUp > > inputSources_

◆ update()

void BMixingModule::update ( edm::EventSetup const &  setup)
protected

Definition at line 272 of file BMixingModule.cc.

References edm::ESWatcher< T >::check(), inputSources_, maxNbSources_, parameterWatcher_, readDB_, reload(), and singleTopDQM_cfi::setup.

Referenced by progressbar.ProgressBar::__next__(), MatrixUtil.Matrix::__setitem__(), MatrixUtil.Steps::__setitem__(), beginLuminosityBlock(), progressbar.ProgressBar::finish(), and MatrixUtil.Steps::overwrite().

272  {
274  for (size_t makeIdx = 0; makeIdx < maxNbSources_; makeIdx++) {
275  if (inputSources_[makeIdx])
276  inputSources_[makeIdx]->reload(setup);
277  }
278  reload(setup);
279  }
280  }
edm::ESWatcher< MixingRcd > parameterWatcher_
static const unsigned int maxNbSources_
virtual void reload(const edm::EventSetup &setup)
Definition: BMixingModule.h:69
bool check(const edm::EventSetup &iSetup)
Definition: ESWatcher.h:57
std::vector< std::shared_ptr< PileUp > > inputSources_

Member Data Documentation

◆ bunchSpace_

int edm::BMixingModule::bunchSpace_
protected

◆ checktof_

bool edm::BMixingModule::checktof_
protected

Definition at line 96 of file BMixingModule.h.

◆ doit_

bool edm::BMixingModule::doit_[4]
protected

Definition at line 105 of file BMixingModule.h.

◆ eventId_

unsigned int edm::BMixingModule::eventId_
protected

Definition at line 108 of file BMixingModule.h.

◆ inputSources_

std::vector<std::shared_ptr<PileUp> > edm::BMixingModule::inputSources_
protected

◆ maxBunch_

int edm::BMixingModule::maxBunch_
protected

◆ maxNbSources_

const unsigned int BMixingModule::maxNbSources_ = 4
staticprotected

◆ minBunch_

int edm::BMixingModule::minBunch_
protected

◆ mixProdStep1_

bool const edm::BMixingModule::mixProdStep1_
protected

Definition at line 99 of file BMixingModule.h.

Referenced by produce().

◆ mixProdStep2_

bool const edm::BMixingModule::mixProdStep2_
protected

Definition at line 100 of file BMixingModule.h.

◆ parameterWatcher_

edm::ESWatcher<MixingRcd> edm::BMixingModule::parameterWatcher_
protected

Definition at line 114 of file BMixingModule.h.

Referenced by update().

◆ playback_

bool edm::BMixingModule::playback_
protected

◆ readDB_

bool edm::BMixingModule::readDB_
protected

Definition at line 102 of file BMixingModule.h.

Referenced by BMixingModule(), and update().

◆ TrueNumInteractions_

std::vector<float> edm::BMixingModule::TrueNumInteractions_
protected

◆ vertexOffset_

int edm::BMixingModule::vertexOffset_
protected

Definition at line 95 of file BMixingModule.h.