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::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper edm::DataMixingModule edm::MixingModule

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
 
virtual void beginLuminosityBlock (const edm::LuminosityBlock &l, const edm::EventSetup &setup) override
 
virtual 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)
 
virtual void endLuminosityBlock (const edm::LuminosityBlock &l, const edm::EventSetup &setup) override
 
virtual 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
 
virtual 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)
 
virtual ~BMixingModule ()
 
- Public Member Functions inherited from edm::stream::EDProducer< GlobalCache< MixingCache::Config > >
 EDProducer ()=default
 
- Public Member Functions inherited from edm::stream::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducerBase ()
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, std::unordered_multimap< std::string, edm::ProductResolverIndex > const &iIndicies, std::string const &moduleLabel)
 
virtual ~ProducerBase () noexcept(false)
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

static void globalEndJob (MixingCache::Config *)
 
static std::unique_ptr< MixingCache::ConfiginitializeGlobalCache (edm::ParameterSet const &)
 
- Static Public Member Functions inherited from edm::stream::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Protected Member Functions

virtual void beginStream (edm::StreamID) override
 
void dropUnwantedBranches (std::vector< std::string > const &wantedBranches)
 
virtual void endStream () override
 
void setupPileUpEvent (const edm::EventSetup &setup)
 
void update (edm::EventSetup const &)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

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
 
- Public Types inherited from edm::stream::EDProducerBase
typedef EDProducerAdaptorBase ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 

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 ( )
virtual

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, and edm::DataMixingModule.

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 
)
overridevirtual

Definition at line 222 of file BMixingModule.cc.

References update.

Referenced by 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 
)
overridevirtual

Definition at line 229 of file BMixingModule.cc.

References update.

Referenced by edm::MixingModule::beginRun(), and edm::DataMixingModule::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)
overrideprotectedvirtual

Reimplemented from edm::stream::EDProducerBase.

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, and edm::DataMixingModule.

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, and edm::DataMixingModule.

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, and edm::DataMixingModule.

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 
)
overridevirtual

Definition at line 236 of file BMixingModule.cc.

Referenced by edm::MixingModule::endLuminosityBlock(), and edm::DataMixingModule::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 
)
overridevirtual

Reimplemented in edm::DataMixingModule.

Definition at line 242 of file BMixingModule.cc.

Referenced by 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 ( )
overrideprotectedvirtual

Reimplemented from edm::stream::EDProducerBase.

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 
)
overridevirtual

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:1
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, and edm::DataMixingModule.

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().

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:1
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:57
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.