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)
 
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
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

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 > >
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 

Detailed Description

Definition at line 40 of file BMixingModule.h.

Constructor & Destructor Documentation

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

standard constructor

Definition at line 177 of file BMixingModule.cc.

References edm::ParameterSet::exists(), edm::ParameterSet::getParameter(), edm::MixingCache::Config::inputConfigs_, inputSources_, maxNbSources_, and readDB_.

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

Default destructor

Definition at line 202 of file BMixingModule.cc.

202 { ; }

Member Function Documentation

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

Definition at line 78 of file BMixingModule.h.

References alignCSCRings::s.

79  {}
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 77 of file BMixingModule.h.

77 {}
double edm::BMixingModule::averageNumber ( ) const
inline

Definition at line 71 of file BMixingModule.h.

71 { return inputSources_[0] ? inputSources_[0]->averageNumber() : 0.0; }
std::vector< std::shared_ptr< PileUp > > inputSources_
void BMixingModule::beginLuminosityBlock ( const edm::LuminosityBlock l,
const edm::EventSetup setup 
)
override

Definition at line 233 of file BMixingModule.cc.

References update.

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

233  {
234  update(setup);
235  for (size_t endIdx = 0; endIdx < maxNbSources_; ++endIdx) {
236  if (inputSources_[endIdx])
237  inputSources_[endIdx]->beginLuminosityBlock(lumi, setup);
238  }
239  }
static const unsigned int maxNbSources_
std::vector< std::shared_ptr< PileUp > > inputSources_
void update(edm::EventSetup const &)
void BMixingModule::beginRun ( const edm::Run r,
const edm::EventSetup setup 
)
override

Definition at line 241 of file BMixingModule.cc.

References update.

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

241  {
242  update(setup);
243  for (size_t endIdx = 0; endIdx < maxNbSources_; ++endIdx) {
244  if (inputSources_[endIdx])
245  inputSources_[endIdx]->beginRun(run, setup);
246  }
247  }
static const unsigned int maxNbSources_
std::vector< std::shared_ptr< PileUp > > inputSources_
void update(edm::EventSetup const &)
void BMixingModule::beginStream ( edm::StreamID  iID)
overrideprotected

Definition at line 312 of file BMixingModule.cc.

312  {
313  for (size_t endIdx = 0; endIdx < maxNbSources_; ++endIdx) {
314  if (inputSources_[endIdx])
315  inputSources_[endIdx]->beginStream(iID);
316  }
317  }
static const unsigned int maxNbSources_
std::vector< std::shared_ptr< PileUp > > inputSources_
void BMixingModule::checkSignal ( const edm::Event e)
virtual

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

Definition at line 330 of file BMixingModule.cc.

330  {
331  edm::LogWarning("MixingModule") << "BMixingModule::checkSignal must be overwritten!";
332  }
void BMixingModule::createnewEDProduct ( )
virtual

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

Definition at line 326 of file BMixingModule.cc.

326  {
327  edm::LogWarning("MixingModule") << "BMixingModule::createnewEDProduct must be overwritten!";
328  }
void BMixingModule::doPileUp ( edm::Event e,
const edm::EventSetup c 
)
virtual

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

Definition at line 342 of file BMixingModule.cc.

342  {
343  edm::LogWarning("MixingModule") << "BMixingModule::doPileUp must be overwritten!";
344  }
void BMixingModule::dropUnwantedBranches ( std::vector< std::string > const &  wantedBranches)
protected

Definition at line 305 of file BMixingModule.cc.

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

305  {
306  for (size_t dropIdx = 0; dropIdx < maxNbSources_; ++dropIdx) {
307  if (inputSources_[dropIdx])
308  inputSources_[dropIdx]->dropUnwantedBranches(wantedBranches);
309  }
310  }
static const unsigned int maxNbSources_
std::vector< std::shared_ptr< PileUp > > inputSources_
void BMixingModule::endLuminosityBlock ( const edm::LuminosityBlock l,
const edm::EventSetup setup 
)
override

Definition at line 249 of file BMixingModule.cc.

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

249  {
250  for (size_t endIdx = 0; endIdx < maxNbSources_; ++endIdx) {
251  if (inputSources_[endIdx])
252  inputSources_[endIdx]->endLuminosityBlock(lumi, setup);
253  }
254  }
static const unsigned int maxNbSources_
std::vector< std::shared_ptr< PileUp > > inputSources_
void BMixingModule::endRun ( const edm::Run r,
const edm::EventSetup setup 
)
override

Definition at line 256 of file BMixingModule.cc.

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

256  {
257  for (size_t endIdx = 0; endIdx < maxNbSources_; ++endIdx) {
258  if (inputSources_[endIdx])
259  inputSources_[endIdx]->endRun(run, setup);
260  }
261  }
static const unsigned int maxNbSources_
std::vector< std::shared_ptr< PileUp > > inputSources_
void BMixingModule::endStream ( )
overrideprotected

Definition at line 319 of file BMixingModule.cc.

319  {
320  for (size_t endIdx = 0; endIdx < maxNbSources_; ++endIdx) {
321  if (inputSources_[endIdx])
322  inputSources_[endIdx]->endStream();
323  }
324  }
static const unsigned int maxNbSources_
std::vector< std::shared_ptr< PileUp > > inputSources_
virtual void edm::BMixingModule::finalizeEvent ( edm::Event event,
const edm::EventSetup setup 
)
inlinevirtual
static void edm::BMixingModule::globalEndJob ( MixingCache::Config )
inlinestatic

Definition at line 63 of file BMixingModule.h.

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

Definition at line 51 of file BMixingModule.h.

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

Definition at line 228 of file BMixingModule.cc.

References helper::Config.

228  {
229  return std::unique_ptr<MixingCache::Config>(new MixingCache::Config(pset, maxNbSources_));
230  }
Config
Definition: helper.py:10
static const unsigned int maxNbSources_
bool edm::BMixingModule::poisson ( ) const
inline

Definition at line 73 of file BMixingModule.h.

References MillePedeFileConverter_cfg::e.

73 { return inputSources_[0] ? inputSources_[0]->poisson() : 0.0; }
std::vector< std::shared_ptr< PileUp > > inputSources_
void BMixingModule::produce ( edm::Event e1,
const edm::EventSetup c 
)
override

Cumulates the pileup events onto this event

Definition at line 274 of file BMixingModule.cc.

References put().

274  {
275  // Check if the signal is present in the root file
276  // for all the objects we want to mix
277  checkSignal(e);
278 
279  // Create EDProduct
281 
283 
284  // Add signals
285  if (!mixProdStep1_) {
286  addSignals(e, setup);
287  }
288 
289  doPileUp(e, setup);
290 
291  // Includes putting digi products into the edm::Event.
293 
294  // Put output into event (here only playback info)
295  put(e, setup);
296  }
virtual void addSignals(const edm::Event &e, const edm::EventSetup &c)
Definition: BMixingModule.h:77
virtual void finalizeEvent(edm::Event &event, const edm::EventSetup &setup)
Definition: BMixingModule.h:54
virtual void checkSignal(const edm::Event &e)
virtual void put(edm::Event &e, const edm::EventSetup &c)
Definition: BMixingModule.h:82
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:51
bool const mixProdStep1_
Definition: BMixingModule.h:96
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 82 of file BMixingModule.h.

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

Reimplemented in edm::MixingModule.

Definition at line 66 of file BMixingModule.h.

66 {};
void BMixingModule::setBcrOffset ( )
virtual

Definition at line 334 of file BMixingModule.cc.

334  {
335  edm::LogWarning("MixingModule") << "BMixingModule::setBcrOffset must be overwritten!";
336  }
void BMixingModule::setSourceOffset ( const unsigned int  s)
virtual

Definition at line 338 of file BMixingModule.cc.

338  {
339  edm::LogWarning("MixingModule") << "BMixingModule::setSourceOffset must be overwritten!";
340  }
void BMixingModule::setupPileUpEvent ( const edm::EventSetup setup)
protected

Definition at line 298 of file BMixingModule.cc.

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

298  {
299  for (size_t dropIdx = 0; dropIdx < maxNbSources_; ++dropIdx) {
300  if (inputSources_[dropIdx])
301  inputSources_[dropIdx]->setupPileUpEvent(setup);
302  }
303  }
static const unsigned int maxNbSources_
std::vector< std::shared_ptr< PileUp > > inputSources_
void BMixingModule::update ( edm::EventSetup const &  )
protected

Definition at line 263 of file BMixingModule.cc.

Referenced by progressbar.ProgressBar::__next__(), MatrixUtil.Matrix::__setitem__(), MatrixUtil.Steps::__setitem__(), Vispa.Gui.VispaWidget.VispaWidget::autosize(), Vispa.Views.LineDecayView.LineDecayContainer::createObject(), Vispa.Views.LineDecayView.LineDecayContainer::deselectAllObjects(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::deselectAllWidgets(), Vispa.Gui.VispaWidget.VispaWidget::enableAutosizing(), progressbar.ProgressBar::finish(), Vispa.Gui.MenuWidget.MenuWidget::leaveEvent(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseMoveEvent(), Vispa.Gui.MenuWidget.MenuWidget::mouseMoveEvent(), Vispa.Views.LineDecayView.LineDecayContainer::mouseMoveEvent(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseReleaseEvent(), Vispa.Views.LineDecayView.LineDecayContainer::objectMoved(), MatrixUtil.Steps::overwrite(), Vispa.Views.LineDecayView.LineDecayContainer::removeObject(), Vispa.Gui.ConnectableWidget.ConnectableWidget::removePorts(), Vispa.Gui.FindDialog.FindDialog::reset(), Vispa.Gui.PortConnection.PointToPointConnection::select(), Vispa.Gui.VispaWidget.VispaWidget::select(), Vispa.Views.LineDecayView.LineDecayContainer::select(), Vispa.Gui.VispaWidget.VispaWidget::setText(), Vispa.Gui.VispaWidget.VispaWidget::setTitle(), Vispa.Gui.ZoomableWidget.ZoomableWidget::setZoom(), Vispa.Views.LineDecayView.LineDecayContainer::setZoom(), and Vispa.Gui.PortConnection.PointToPointConnection::updateConnection().

263  {
265  for (size_t makeIdx = 0; makeIdx < maxNbSources_; makeIdx++) {
266  if (inputSources_[makeIdx])
267  inputSources_[makeIdx]->reload(setup);
268  }
269  reload(setup);
270  }
271  }
edm::ESWatcher< MixingRcd > parameterWatcher_
static const unsigned int maxNbSources_
virtual void reload(const edm::EventSetup &setup)
Definition: BMixingModule.h:66
bool check(const edm::EventSetup &iSetup)
Definition: ESWatcher.h:52
std::vector< std::shared_ptr< PileUp > > inputSources_

Member Data Documentation

int edm::BMixingModule::bunchSpace_
protected
bool edm::BMixingModule::checktof_
protected

Definition at line 93 of file BMixingModule.h.

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

Definition at line 102 of file BMixingModule.h.

unsigned int edm::BMixingModule::eventId_
protected

Definition at line 105 of file BMixingModule.h.

std::vector<std::shared_ptr<PileUp> > edm::BMixingModule::inputSources_
protected
int edm::BMixingModule::maxBunch_
protected
const unsigned int BMixingModule::maxNbSources_ = 4
staticprotected
int edm::BMixingModule::minBunch_
protected
bool const edm::BMixingModule::mixProdStep1_
protected

Definition at line 96 of file BMixingModule.h.

bool const edm::BMixingModule::mixProdStep2_
protected

Definition at line 97 of file BMixingModule.h.

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

Definition at line 111 of file BMixingModule.h.

bool edm::BMixingModule::playback_
protected
bool edm::BMixingModule::readDB_
protected

Definition at line 99 of file BMixingModule.h.

Referenced by BMixingModule().

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

Definition at line 92 of file BMixingModule.h.