CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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
 
 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::Config
initializeGlobalCache (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 ( const edm::ParameterSet ps,
MixingCache::Config const *  globalConf 
)
explicit

standard constructor

Definition at line 179 of file BMixingModule.cc.

References edm::ParameterSet::getParameter(), edm::MixingCache::Config::inputConfigs_, inputSources_, maxNbSources_, 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_
Definition: BMixingModule.h:98
static const unsigned int maxNbSources_
bool const mixProdStep1_
Definition: BMixingModule.h:97
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 79 of file BMixingModule.h.

80  {}
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 78 of file BMixingModule.h.

Referenced by produce().

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

Definition at line 72 of file BMixingModule.h.

References inputSources_.

72 { 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 236 of file BMixingModule.cc.

References inputSources_, maxNbSources_, and update().

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

236  {
237  update(setup);
238  for (size_t endIdx = 0; endIdx < maxNbSources_; ++endIdx) {
239  if (inputSources_[endIdx])
240  inputSources_[endIdx]->beginLuminosityBlock(lumi, setup);
241  }
242  }
static const unsigned int maxNbSources_
list lumi
Definition: dqmdumpme.py:53
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 244 of file BMixingModule.cc.

References inputSources_, and maxNbSources_.

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

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

Definition at line 314 of file BMixingModule.cc.

References inputSources_, and maxNbSources_.

314  {
315  for (size_t endIdx = 0; endIdx < maxNbSources_; ++endIdx) {
316  if (inputSources_[endIdx])
317  inputSources_[endIdx]->beginStream(iID);
318  }
319  }
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 332 of file BMixingModule.cc.

Referenced by produce().

332  {
333  edm::LogWarning("MixingModule") << "BMixingModule::checkSignal must be overwritten!";
334  }
Log< level::Warning, false > LogWarning
void BMixingModule::createnewEDProduct ( )
virtual

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

Definition at line 328 of file BMixingModule.cc.

Referenced by produce().

328  {
329  edm::LogWarning("MixingModule") << "BMixingModule::createnewEDProduct must be overwritten!";
330  }
Log< level::Warning, false > LogWarning
void BMixingModule::doPileUp ( edm::Event e,
const edm::EventSetup c 
)
virtual

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

Definition at line 344 of file BMixingModule.cc.

Referenced by produce().

344  {
345  edm::LogWarning("MixingModule") << "BMixingModule::doPileUp must be overwritten!";
346  }
Log< level::Warning, false > LogWarning
void BMixingModule::dropUnwantedBranches ( std::vector< std::string > const &  wantedBranches)
protected

Definition at line 307 of file BMixingModule.cc.

References inputSources_, and maxNbSources_.

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

307  {
308  for (size_t dropIdx = 0; dropIdx < maxNbSources_; ++dropIdx) {
309  if (inputSources_[dropIdx])
310  inputSources_[dropIdx]->dropUnwantedBranches(wantedBranches);
311  }
312  }
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 251 of file BMixingModule.cc.

References inputSources_, and maxNbSources_.

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

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

Definition at line 258 of file BMixingModule.cc.

References inputSources_, and maxNbSources_.

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

258  {
259  for (size_t endIdx = 0; endIdx < maxNbSources_; ++endIdx) {
260  if (inputSources_[endIdx])
261  inputSources_[endIdx]->endRun(run, setup);
262  }
263  }
static const unsigned int maxNbSources_
std::vector< std::shared_ptr< PileUp > > inputSources_
void BMixingModule::endStream ( )
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]->endStream();
325  }
326  }
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

Reimplemented in edm::MixingModule.

Definition at line 55 of file BMixingModule.h.

Referenced by produce().

55 {}
static void edm::BMixingModule::globalEndJob ( MixingCache::Config )
inlinestatic

Definition at line 64 of file BMixingModule.h.

64 {}
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 52 of file BMixingModule.h.

Referenced by produce().

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

Definition at line 231 of file BMixingModule.cc.

References maxNbSources_, and TrackValidation_cff::pset.

231  {
232  return std::make_unique<MixingCache::Config>(pset, maxNbSources_);
233  }
static const unsigned int maxNbSources_
bool edm::BMixingModule::poisson ( ) const
inline

Definition at line 74 of file BMixingModule.h.

References inputSources_.

74 { 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 276 of file BMixingModule.cc.

References addSignals(), checkSignal(), createnewEDProduct(), doPileUp(), finalizeEvent(), initializeEvent(), mixProdStep1_, and put().

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

Referenced by produce().

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

Reimplemented in edm::MixingModule.

Definition at line 67 of file BMixingModule.h.

Referenced by update().

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

Definition at line 336 of file BMixingModule.cc.

336  {
337  edm::LogWarning("MixingModule") << "BMixingModule::setBcrOffset must be overwritten!";
338  }
Log< level::Warning, false > LogWarning
void BMixingModule::setSourceOffset ( const unsigned int  s)
virtual

Definition at line 340 of file BMixingModule.cc.

340  {
341  edm::LogWarning("MixingModule") << "BMixingModule::setSourceOffset must be overwritten!";
342  }
Log< level::Warning, false > LogWarning
void BMixingModule::setupPileUpEvent ( const edm::EventSetup setup)
protected

Definition at line 300 of file BMixingModule.cc.

References inputSources_, and maxNbSources_.

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

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

Definition at line 265 of file BMixingModule.cc.

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

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

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

Member Data Documentation

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

Definition at line 94 of file BMixingModule.h.

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

Definition at line 103 of file BMixingModule.h.

unsigned int edm::BMixingModule::eventId_
protected

Definition at line 106 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 97 of file BMixingModule.h.

Referenced by produce().

bool const edm::BMixingModule::mixProdStep2_
protected

Definition at line 98 of file BMixingModule.h.

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

Definition at line 112 of file BMixingModule.h.

Referenced by update().

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

Definition at line 100 of file BMixingModule.h.

Referenced by BMixingModule(), and update().

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

Definition at line 93 of file BMixingModule.h.