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 hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () 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 165 of file BMixingModule.cc.

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

165  :
166  bunchSpace_(globalConf->bunchSpace_),
167  vertexOffset_(0),
168  minBunch_(globalConf->minBunch_),
169  maxBunch_(globalConf->maxBunch_),
170  mixProdStep1_(pset.getParameter<bool>("mixProdStep1")),
171  mixProdStep2_(pset.getParameter<bool>("mixProdStep2")),
172  readDB_(false),
173  playback_(globalConf->playback_)
174  {
175  if (pset.exists("readDB")) readDB_=pset.getParameter<bool>("readDB");
176 
177  for (size_t makeIdx = 0; makeIdx < maxNbSources_; makeIdx++ ) {
178  if (globalConf->inputConfigs_[makeIdx]) {
179  const edm::ParameterSet & psin=pset.getParameter<edm::ParameterSet>(globalConf->inputConfigs_[makeIdx]->sourcename_);
180  inputSources_.push_back(std::make_shared<PileUp>(psin, globalConf->inputConfigs_[makeIdx]));
181  inputSources_.back()->input(makeIdx);
182  } else {
183  inputSources_.push_back(nullptr);
184  }
185  }
186  }
bool const mixProdStep2_
Definition: BMixingModule.h:96
static const unsigned int maxNbSources_
bool const mixProdStep1_
Definition: BMixingModule.h:95
std::vector< std::shared_ptr< PileUp > > inputSources_
BMixingModule::~BMixingModule ( )
override

Default destructor

Definition at line 189 of file BMixingModule.cc.

189 {;}

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.

78 {}
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 222 of file BMixingModule.cc.

References update.

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

222  {
223  update(setup);
224  for (size_t endIdx=0; endIdx<maxNbSources_; ++endIdx) {
225  if(inputSources_[endIdx]) inputSources_[endIdx]->beginLuminosityBlock(lumi, setup);
226  }
227  }
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 229 of file BMixingModule.cc.

References update.

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

229  {
230  update(setup);
231  for (size_t endIdx=0; endIdx<maxNbSources_; ++endIdx) {
232  if(inputSources_[endIdx]) inputSources_[endIdx]->beginRun(run, setup);
233  }
234  }
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 294 of file BMixingModule.cc.

294  {
295  for (size_t endIdx=0; endIdx<maxNbSources_; ++endIdx) {
296  if(inputSources_[endIdx]) inputSources_[endIdx]->beginStream(iID);
297  }
298  }
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 310 of file BMixingModule.cc.

310  {
311  edm::LogWarning("MixingModule") << "BMixingModule::checkSignal must be overwritten!";
312  }
void BMixingModule::createnewEDProduct ( )
virtual

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

Definition at line 306 of file BMixingModule.cc.

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

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

Definition at line 322 of file BMixingModule.cc.

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

Definition at line 288 of file BMixingModule.cc.

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

288  {
289  for (size_t dropIdx=0; dropIdx<maxNbSources_; ++dropIdx) {
290  if(inputSources_[dropIdx]) inputSources_[dropIdx]->dropUnwantedBranches(wantedBranches);
291  }
292  }
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 236 of file BMixingModule.cc.

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

236  {
237  for (size_t endIdx=0; endIdx<maxNbSources_; ++endIdx) {
238  if(inputSources_[endIdx]) inputSources_[endIdx]->endLuminosityBlock(lumi, setup);
239  }
240  }
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 242 of file BMixingModule.cc.

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

242  {
243  for (size_t endIdx=0; endIdx<maxNbSources_; ++endIdx) {
244  if(inputSources_[endIdx]) inputSources_[endIdx]->endRun(run, setup);
245  }
246  }
static const unsigned int maxNbSources_
std::vector< std::shared_ptr< PileUp > > inputSources_
void BMixingModule::endStream ( )
overrideprotected

Definition at line 300 of file BMixingModule.cc.

300  {
301  for (size_t endIdx=0; endIdx<maxNbSources_; ++endIdx) {
302  if(inputSources_[endIdx]) inputSources_[endIdx]->endStream();
303  }
304  }
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 217 of file BMixingModule.cc.

217  {
218  return std::unique_ptr<MixingCache::Config>(new MixingCache::Config(pset, maxNbSources_));
219  }
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 258 of file BMixingModule.cc.

References put().

258  {
259  // Check if the signal is present in the root file
260  // for all the objects we want to mix
261  checkSignal(e);
262 
263  // Create EDProduct
265 
267 
268  // Add signals
269  if (!mixProdStep1_){
270  addSignals(e,setup);
271  }
272 
273  doPileUp(e, setup);
274 
275  // Includes putting digi products into the edm::Event.
277 
278  // Put output into event (here only playback info)
279  put(e,setup);
280  }
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)
def setup(process, global_tag, zero_tesla=False)
Definition: GeneralSetup.py:2
virtual void put(edm::Event &e, const edm::EventSetup &c)
Definition: BMixingModule.h:81
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:95
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 81 of file BMixingModule.h.

81 {}
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 314 of file BMixingModule.cc.

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

Definition at line 318 of file BMixingModule.cc.

318  {
319  edm::LogWarning("MixingModule") << "BMixingModule::setSourceOffset must be overwritten!";
320  }
void BMixingModule::setupPileUpEvent ( const edm::EventSetup setup)
protected

Definition at line 282 of file BMixingModule.cc.

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

282  {
283  for (size_t dropIdx=0; dropIdx<maxNbSources_; ++dropIdx) {
284  if(inputSources_[dropIdx]) inputSources_[dropIdx]->setupPileUpEvent(setup);
285  }
286  }
static const unsigned int maxNbSources_
std::vector< std::shared_ptr< PileUp > > inputSources_
void BMixingModule::update ( edm::EventSetup const &  )
protected

Definition at line 248 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().

248  {
250  for (size_t makeIdx = 0; makeIdx < maxNbSources_; makeIdx++ ) {
251  if (inputSources_[makeIdx]) inputSources_[makeIdx]->reload(setup);
252  }
253  reload(setup);
254  }
255  }
edm::ESWatcher< MixingRcd > parameterWatcher_
def setup(process, global_tag, zero_tesla=False)
Definition: GeneralSetup.py:2
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 92 of file BMixingModule.h.

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

Definition at line 101 of file BMixingModule.h.

unsigned int edm::BMixingModule::eventId_
protected

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

bool const edm::BMixingModule::mixProdStep2_
protected

Definition at line 96 of file BMixingModule.h.

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

Definition at line 110 of file BMixingModule.h.

bool edm::BMixingModule::playback_
protected

Definition at line 99 of file BMixingModule.h.

Referenced by edm::MixingModule::doPileUp(), and edm::MixingModule::MixingModule().

bool edm::BMixingModule::readDB_
protected

Definition at line 98 of file BMixingModule.h.

Referenced by BMixingModule().

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

Definition at line 91 of file BMixingModule.h.