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 hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () 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_
 
const bool mixProdStep1_
 
const bool mixProdStep2_
 
edm::ESWatcher< MixingRcdparameterWatcher_
 
bool playback_
 
bool readDB_
 
std::vector< float > TrueNumInteractions_
 
int vertexOffset_
 

Static Protected Attributes

const static 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::BMixingModule ( const edm::ParameterSet ps,
MixingCache::Config const *  globalConf 
)
explicit

standard constructor

Definition at line 179 of file BMixingModule.cc.

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_(false),
187  playback_(globalConf->playback_) {
188  if (pset.exists("readDB"))
189  readDB_ = pset.getParameter<bool>("readDB");
190 
191  for (size_t makeIdx = 0; makeIdx < maxNbSources_; makeIdx++) {
192  if (globalConf->inputConfigs_[makeIdx]) {
193  const edm::ParameterSet& psin =
194  pset.getParameter<edm::ParameterSet>(globalConf->inputConfigs_[makeIdx]->sourcename_);
195  inputSources_.push_back(std::make_shared<PileUp>(psin, globalConf->inputConfigs_[makeIdx]));
196  inputSources_.back()->input(makeIdx);
197  } else {
198  inputSources_.push_back(nullptr);
199  }
200  }
201  }

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

◆ ~BMixingModule()

BMixingModule::~BMixingModule ( )
override

Default destructor

Definition at line 204 of file BMixingModule.cc.

204 { ; }

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

79  {}

◆ 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 77 of file BMixingModule.h.

77 {}

Referenced by produce().

◆ averageNumber()

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

Definition at line 71 of file BMixingModule.h.

71 { return inputSources_[0] ? inputSources_[0]->averageNumber() : 0.0; }

References inputSources_.

◆ beginLuminosityBlock()

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

Definition at line 235 of file BMixingModule.cc.

235  {
236  update(setup);
237  for (size_t endIdx = 0; endIdx < maxNbSources_; ++endIdx) {
238  if (inputSources_[endIdx])
239  inputSources_[endIdx]->beginLuminosityBlock(lumi, setup);
240  }
241  }

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

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

◆ beginRun()

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

Definition at line 243 of file BMixingModule.cc.

243  {
244  update(setup);
245  for (size_t endIdx = 0; endIdx < maxNbSources_; ++endIdx) {
246  if (inputSources_[endIdx])
247  inputSources_[endIdx]->beginRun(run, setup);
248  }
249  }

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

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

◆ beginStream()

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

Definition at line 314 of file BMixingModule.cc.

314  {
315  for (size_t endIdx = 0; endIdx < maxNbSources_; ++endIdx) {
316  if (inputSources_[endIdx])
317  inputSources_[endIdx]->beginStream(iID);
318  }
319  }

References inputSources_, and maxNbSources_.

◆ checkSignal()

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.

332  {
333  edm::LogWarning("MixingModule") << "BMixingModule::checkSignal must be overwritten!";
334  }

Referenced by produce().

◆ createnewEDProduct()

void BMixingModule::createnewEDProduct ( )
virtual

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

Definition at line 328 of file BMixingModule.cc.

328  {
329  edm::LogWarning("MixingModule") << "BMixingModule::createnewEDProduct must be overwritten!";
330  }

Referenced by produce().

◆ doPileUp()

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.

344  {
345  edm::LogWarning("MixingModule") << "BMixingModule::doPileUp must be overwritten!";
346  }

Referenced by produce().

◆ dropUnwantedBranches()

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

Definition at line 307 of file BMixingModule.cc.

307  {
308  for (size_t dropIdx = 0; dropIdx < maxNbSources_; ++dropIdx) {
309  if (inputSources_[dropIdx])
310  inputSources_[dropIdx]->dropUnwantedBranches(wantedBranches);
311  }
312  }

References inputSources_, and maxNbSources_.

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

◆ endLuminosityBlock()

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

Definition at line 251 of file BMixingModule.cc.

251  {
252  for (size_t endIdx = 0; endIdx < maxNbSources_; ++endIdx) {
253  if (inputSources_[endIdx])
254  inputSources_[endIdx]->endLuminosityBlock(lumi, setup);
255  }
256  }

References inputSources_, maxNbSources_, and singleTopDQM_cfi::setup.

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

◆ endRun()

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

Definition at line 258 of file BMixingModule.cc.

258  {
259  for (size_t endIdx = 0; endIdx < maxNbSources_; ++endIdx) {
260  if (inputSources_[endIdx])
261  inputSources_[endIdx]->endRun(run, setup);
262  }
263  }

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

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

◆ endStream()

void BMixingModule::endStream ( )
overrideprotected

Definition at line 321 of file BMixingModule.cc.

321  {
322  for (size_t endIdx = 0; endIdx < maxNbSources_; ++endIdx) {
323  if (inputSources_[endIdx])
324  inputSources_[endIdx]->endStream();
325  }
326  }

References inputSources_, and maxNbSources_.

◆ finalizeEvent()

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

Reimplemented in edm::MixingModule.

Definition at line 54 of file BMixingModule.h.

54 {}

Referenced by produce().

◆ globalEndJob()

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

Definition at line 63 of file BMixingModule.h.

63 {}

◆ 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 51 of file BMixingModule.h.

51 {}

Referenced by produce().

◆ initializeGlobalCache()

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

Definition at line 230 of file BMixingModule.cc.

230  {
231  return std::make_unique<MixingCache::Config>(pset, maxNbSources_);
232  }

References maxNbSources_, and muonDTDigis_cfi::pset.

◆ poisson()

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

Definition at line 73 of file BMixingModule.h.

73 { return inputSources_[0] ? inputSources_[0]->poisson() : 0.0; }

References inputSources_.

◆ produce()

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.

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  }

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

◆ 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 82 of file BMixingModule.h.

82 {}

Referenced by produce().

◆ reload()

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

Reimplemented in edm::MixingModule.

Definition at line 66 of file BMixingModule.h.

66 {};

Referenced by update().

◆ setBcrOffset()

void BMixingModule::setBcrOffset ( )
virtual

Definition at line 336 of file BMixingModule.cc.

336  {
337  edm::LogWarning("MixingModule") << "BMixingModule::setBcrOffset must be overwritten!";
338  }

◆ setSourceOffset()

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  }

◆ setupPileUpEvent()

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

Definition at line 300 of file BMixingModule.cc.

300  {
301  for (size_t dropIdx = 0; dropIdx < maxNbSources_; ++dropIdx) {
302  if (inputSources_[dropIdx])
303  inputSources_[dropIdx]->setupPileUpEvent(setup);
304  }
305  }

References inputSources_, maxNbSources_, and singleTopDQM_cfi::setup.

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

◆ update()

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

Member Data Documentation

◆ bunchSpace_

int edm::BMixingModule::bunchSpace_
protected

◆ checktof_

bool edm::BMixingModule::checktof_
protected

Definition at line 93 of file BMixingModule.h.

◆ doit_

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

Definition at line 102 of file BMixingModule.h.

◆ eventId_

unsigned int edm::BMixingModule::eventId_
protected

Definition at line 105 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_

const bool edm::BMixingModule::mixProdStep1_
protected

Definition at line 96 of file BMixingModule.h.

Referenced by produce().

◆ mixProdStep2_

const bool edm::BMixingModule::mixProdStep2_
protected

Definition at line 97 of file BMixingModule.h.

◆ parameterWatcher_

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

Definition at line 111 of file BMixingModule.h.

Referenced by update().

◆ playback_

bool edm::BMixingModule::playback_
protected

◆ readDB_

bool edm::BMixingModule::readDB_
protected

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

edm::BMixingModule::reload
virtual void reload(const edm::EventSetup &setup)
Definition: BMixingModule.h:66
edm::ESWatcher::check
bool check(const edm::EventSetup &iSetup)
Definition: ESWatcher.h:52
edm::BMixingModule::inputSources_
std::vector< std::shared_ptr< PileUp > > inputSources_
Definition: BMixingModule.h:108
edm::BMixingModule::bunchSpace_
int bunchSpace_
Definition: BMixingModule.h:91
edm::BMixingModule::minBunch_
int minBunch_
Definition: BMixingModule.h:94
edm::BMixingModule::maxBunch_
int maxBunch_
Definition: BMixingModule.h:95
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
singleTopDQM_cfi.setup
setup
Definition: singleTopDQM_cfi.py:37
edm::BMixingModule::readDB_
bool readDB_
Definition: BMixingModule.h:99
edm::BMixingModule::maxNbSources_
const static unsigned int maxNbSources_
Definition: BMixingModule.h:101
edm::BMixingModule::playback_
bool playback_
Definition: BMixingModule.h:100
edm::BMixingModule::mixProdStep2_
const bool mixProdStep2_
Definition: BMixingModule.h:97
edm::BMixingModule::update
void update(edm::EventSetup const &)
Definition: BMixingModule.cc:265
edm::BMixingModule::finalizeEvent
virtual void finalizeEvent(edm::Event &event, const edm::EventSetup &setup)
Definition: BMixingModule.h:54
edm::BMixingModule::checkSignal
virtual void checkSignal(const edm::Event &e)
Definition: BMixingModule.cc:332
edm::ParameterSet
Definition: ParameterSet.h:47
edm::BMixingModule::put
virtual void put(edm::Event &e, const edm::EventSetup &c)
Definition: BMixingModule.h:82
edm::BMixingModule::addSignals
virtual void addSignals(const edm::Event &e, const edm::EventSetup &c)
Definition: BMixingModule.h:77
edm::BMixingModule::mixProdStep1_
const bool mixProdStep1_
Definition: BMixingModule.h:96
writedatasetfile.run
run
Definition: writedatasetfile.py:27
edm::BMixingModule::initializeEvent
virtual void initializeEvent(const edm::Event &event, const edm::EventSetup &setup)
Definition: BMixingModule.h:51
edm::BMixingModule::createnewEDProduct
virtual void createnewEDProduct()
Definition: BMixingModule.cc:328
edm::BMixingModule::vertexOffset_
int vertexOffset_
Definition: BMixingModule.h:92
edm::BMixingModule::parameterWatcher_
edm::ESWatcher< MixingRcd > parameterWatcher_
Definition: BMixingModule.h:111
lumi
Definition: LumiSectionData.h:20
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37
edm::BMixingModule::doPileUp
virtual void doPileUp(edm::Event &e, const edm::EventSetup &c)
Definition: BMixingModule.cc:344