CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes
edm::BMixingModule Class Reference

#include <BMixingModule.h>

Inheritance diagram for edm::BMixingModule:
edm::EDProducer 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)
 
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 getEventStartInfo (edm::Event &e, const unsigned int source)
 
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 setEventStartInfo (const unsigned int s)
 
virtual void setSourceOffset (const unsigned int s)
 
virtual ~BMixingModule ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndex indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Protected Member Functions

void dropUnwantedBranches (std::vector< std::string > const &wantedBranches)
 
virtual void endJob ()
 
void update (edm::EventSetup const &)
 
- Protected Member Functions inherited from edm::EDProducer
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- 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< boost::shared_ptr
< PileUp > > 
inputSources_
 
int maxBunch_
 
int minBunch_
 
bool const mixProdStep1_
 
bool const mixProdStep2_
 
edm::ESWatcher< MixingRcdparameterWatcher_
 
bool playback_
 
bool readDB_
 
std::vector< std::string > sourceNames_
 
std::vector< float > TrueNumInteractions_
 

Static Protected Attributes

static const unsigned int maxNbSources_ =4
 
static int vertexoffset = 0
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
typedef WorkerT< EDProducerWorkerType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Detailed Description

Definition at line 30 of file BMixingModule.h.

Constructor & Destructor Documentation

BMixingModule::BMixingModule ( const edm::ParameterSet ps)
explicit

standard constructor

Definition at line 169 of file BMixingModule.cc.

References edm::ParameterSet::exists(), edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), inputSources_, maxBunch_, maxNbSources_, minBunch_, playback_, readDB_, and sourceNames_.

169  :
170  bunchSpace_(pset.getParameter<int>("bunchspace")),
171  minBunch_((pset.getParameter<int>("minBunch")*25)/pset.getParameter<int>("bunchspace")),
172  maxBunch_((pset.getParameter<int>("maxBunch")*25)/pset.getParameter<int>("bunchspace")),
173  mixProdStep1_(pset.getParameter<bool>("mixProdStep1")),
174  mixProdStep2_(pset.getParameter<bool>("mixProdStep2")),
175  readDB_(false)
176  {
177  if (pset.exists("readDB")) readDB_=pset.getParameter<bool>("readDB");
178 
179  playback_=pset.getUntrackedParameter<bool>("playback",false);
180 
181  if (playback_) {
182  //this could be explicitely checked
183  LogInfo("MixingModule") <<" ATTENTION:Mixing will be done in playback mode! \n"
184  <<" ATTENTION:Mixing Configuration must be the same as for the original mixing!";
185  }
186 
187  // Just for debugging print out.
188  sourceNames_.push_back("input");
189  sourceNames_.push_back("cosmics");
190  sourceNames_.push_back("beamhalo_plus");
191  sourceNames_.push_back("beamhalo_minus");
192 
193  for (size_t makeIdx = 0; makeIdx < maxNbSources_; makeIdx++ ) {
194  inputSources_.push_back(maybeMakePileUp(pset,sourceNames_[makeIdx],
196  if (inputSources_.back()) inputSources_.back()->input(makeIdx);
197  }
198  }
bool const mixProdStep2_
Definition: BMixingModule.h:83
static const unsigned int maxNbSources_
Definition: BMixingModule.h:87
std::vector< boost::shared_ptr< PileUp > > inputSources_
Definition: BMixingModule.h:95
bool const mixProdStep1_
Definition: BMixingModule.h:82
std::vector< std::string > sourceNames_
Definition: BMixingModule.h:88
BMixingModule::~BMixingModule ( )
virtual

Default destructor

Definition at line 201 of file BMixingModule.cc.

201 {;}

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

65 {;}
virtual void edm::BMixingModule::addSignals ( const edm::Event e,
const edm::EventSetup c 
)
inlinevirtual

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

Definition at line 64 of file BMixingModule.h.

Referenced by produce().

64 {;}
double edm::BMixingModule::averageNumber ( ) const
inline

Definition at line 58 of file BMixingModule.h.

References inputSources_.

58 {return inputSources_[0] ? inputSources_[0]->averageNumber() : 0.0; }
std::vector< boost::shared_ptr< PileUp > > inputSources_
Definition: BMixingModule.h:95
void BMixingModule::beginLuminosityBlock ( const edm::LuminosityBlock l,
const edm::EventSetup setup 
)
overridevirtual

Reimplemented from edm::EDProducer.

Reimplemented in edm::MixingModule.

Definition at line 204 of file BMixingModule.cc.

References update().

204  {
205  update(setup);
206  }
void update(edm::EventSetup const &)
void BMixingModule::beginRun ( const edm::Run r,
const edm::EventSetup setup 
)
overridevirtual

Reimplemented from edm::EDProducer.

Reimplemented in edm::MixingModule.

Definition at line 208 of file BMixingModule.cc.

References update().

208  {
209  update(setup);
210  }
void update(edm::EventSetup const &)
virtual void edm::BMixingModule::checkSignal ( const edm::Event e)
inlinevirtual

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

Definition at line 63 of file BMixingModule.h.

References gather_cfg::cout.

Referenced by produce().

63 {std::cout << "BMixingModule::checkSignal must be overwritten!" << std::endl;}
tuple cout
Definition: gather_cfg.py:121
virtual void edm::BMixingModule::createnewEDProduct ( )
inlinevirtual

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

Definition at line 62 of file BMixingModule.h.

References gather_cfg::cout.

Referenced by produce().

62 {std::cout << "BMixingModule::createnewEDProduct must be overwritten!" << std::endl;}
tuple cout
Definition: gather_cfg.py:121
virtual void edm::BMixingModule::doPileUp ( edm::Event e,
const edm::EventSetup c 
)
inlinevirtual

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

Definition at line 69 of file BMixingModule.h.

References gather_cfg::cout.

Referenced by produce().

69 {std::cout << "BMixingModule::doPileUp must be overwritten!" << std::endl;}
tuple cout
Definition: gather_cfg.py:121
void BMixingModule::dropUnwantedBranches ( std::vector< std::string > const &  wantedBranches)
protected

Definition at line 247 of file BMixingModule.cc.

References inputSources_, and maxNbSources_.

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

247  {
248  for (size_t dropIdx=0; dropIdx<maxNbSources_; dropIdx++ ) {
249  if( inputSources_[dropIdx] ) inputSources_[dropIdx]->dropUnwantedBranches(wantedBranches);
250  }
251  }
static const unsigned int maxNbSources_
Definition: BMixingModule.h:87
std::vector< boost::shared_ptr< PileUp > > inputSources_
Definition: BMixingModule.h:95
void BMixingModule::endJob ( void  )
protectedvirtual

Reimplemented from edm::EDProducer.

Definition at line 253 of file BMixingModule.cc.

References inputSources_, and maxNbSources_.

253  {
254  for (size_t endIdx=0; endIdx<maxNbSources_; endIdx++ ) {
255  if( inputSources_[endIdx] ) inputSources_[endIdx]->endJob();
256  }
257  }
static const unsigned int maxNbSources_
Definition: BMixingModule.h:87
std::vector< boost::shared_ptr< PileUp > > inputSources_
Definition: BMixingModule.h:95
virtual void edm::BMixingModule::endLuminosityBlock ( const edm::LuminosityBlock l,
const edm::EventSetup setup 
)
inlineoverridevirtual

Reimplemented from edm::EDProducer.

Reimplemented in edm::MixingModule.

Definition at line 50 of file BMixingModule.h.

50 {}
virtual void edm::BMixingModule::endRun ( const edm::Run r,
const edm::EventSetup setup 
)
inlineoverridevirtual

Reimplemented from edm::EDProducer.

Reimplemented in edm::MixingModule.

Definition at line 49 of file BMixingModule.h.

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

Reimplemented in edm::MixingModule.

Definition at line 44 of file BMixingModule.h.

Referenced by produce().

44 {}
virtual void edm::BMixingModule::getEventStartInfo ( edm::Event e,
const unsigned int  source 
)
inlinevirtual

Definition at line 71 of file BMixingModule.h.

71 {;} //to be set locally
virtual void edm::BMixingModule::initializeEvent ( const edm::Event event,
const edm::EventSetup setup 
)
inlinevirtual

Reimplemented in edm::MixingModule.

Definition at line 41 of file BMixingModule.h.

Referenced by produce().

41 {}
bool edm::BMixingModule::poisson ( ) const
inline

Definition at line 60 of file BMixingModule.h.

References inputSources_.

60 {return inputSources_[0] ? inputSources_[0]->poisson() : 0.0 ;}
std::vector< boost::shared_ptr< PileUp > > inputSources_
Definition: BMixingModule.h:95
void BMixingModule::produce ( edm::Event e1,
const edm::EventSetup c 
)
overridevirtual

Cumulates the pileup events onto this event

Implements edm::EDProducer.

Definition at line 222 of file BMixingModule.cc.

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

222  {
223 
224  // Check if the signal is present in the root file
225  // for all the objects we want to mix
226  checkSignal(e);
227 
228  // Create EDProduct
230 
232 
233  // Add signals
234  if (!mixProdStep1_){
235  addSignals(e,setup);
236  }
237 
238  doPileUp(e,setup);
239 
240  // Includes putting digi products into the edm::Event.
242 
243  // Put output into event (here only playback info)
244  put(e,setup);
245  }
virtual void addSignals(const edm::Event &e, const edm::EventSetup &c)
Definition: BMixingModule.h:64
virtual void finalizeEvent(edm::Event &event, const edm::EventSetup &setup)
Definition: BMixingModule.h:44
virtual void put(edm::Event &e, const edm::EventSetup &c)
Definition: BMixingModule.h:68
virtual void checkSignal(const edm::Event &e)
Definition: BMixingModule.h:63
virtual void initializeEvent(const edm::Event &event, const edm::EventSetup &setup)
Definition: BMixingModule.h:41
bool const mixProdStep1_
Definition: BMixingModule.h:82
virtual void doPileUp(edm::Event &e, const edm::EventSetup &c)
Definition: BMixingModule.h:69
virtual void createnewEDProduct()
Definition: BMixingModule.h:62
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")
virtual void edm::BMixingModule::put ( edm::Event e,
const edm::EventSetup c 
)
inlinevirtual

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

Definition at line 68 of file BMixingModule.h.

Referenced by produce().

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

Reimplemented in edm::MixingModule.

Definition at line 53 of file BMixingModule.h.

Referenced by update().

53 {};
virtual void edm::BMixingModule::setBcrOffset ( )
inlinevirtual

Definition at line 66 of file BMixingModule.h.

References gather_cfg::cout.

66 {std::cout << "BMixingModule::setBcrOffset must be overwritten!" << std::endl;} //FIXME: LogWarning
tuple cout
Definition: gather_cfg.py:121
virtual void edm::BMixingModule::setEventStartInfo ( const unsigned int  s)
inlinevirtual

Definition at line 70 of file BMixingModule.h.

70 {;} //to be set in CF
virtual void edm::BMixingModule::setSourceOffset ( const unsigned int  s)
inlinevirtual

Definition at line 67 of file BMixingModule.h.

References gather_cfg::cout.

67 {std::cout << "BMixingModule::setSourceOffset must be overwritten!" << std::endl;}
tuple cout
Definition: gather_cfg.py:121
void BMixingModule::update ( edm::EventSetup const &  setup)
protected

Definition at line 212 of file BMixingModule.cc.

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

Referenced by progressbar.ProgressBar::__next__(), relval_steps.Matrix::__setitem__(), relval_steps.Steps::__setitem__(), Vispa.Gui.VispaWidget.VispaWidget::autosize(), beginLuminosityBlock(), beginRun(), 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(), relval_steps.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().

212  {
214  for (size_t makeIdx = 0; makeIdx < maxNbSources_; makeIdx++ ) {
215  if (inputSources_[makeIdx]) inputSources_[makeIdx]->reload(setup);
216  }
217  reload(setup);
218  }
219  }
edm::ESWatcher< MixingRcd > parameterWatcher_
Definition: BMixingModule.h:98
static const unsigned int maxNbSources_
Definition: BMixingModule.h:87
virtual void reload(const edm::EventSetup &setup)
Definition: BMixingModule.h:53
bool check(const edm::EventSetup &iSetup)
Definition: ESWatcher.h:59
std::vector< boost::shared_ptr< PileUp > > inputSources_
Definition: BMixingModule.h:95
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")

Member Data Documentation

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

Definition at line 79 of file BMixingModule.h.

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

Definition at line 89 of file BMixingModule.h.

unsigned int edm::BMixingModule::eventId_
protected

Definition at line 92 of file BMixingModule.h.

std::vector<boost::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 82 of file BMixingModule.h.

Referenced by produce().

bool const edm::BMixingModule::mixProdStep2_
protected

Definition at line 83 of file BMixingModule.h.

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

Definition at line 98 of file BMixingModule.h.

Referenced by update().

bool edm::BMixingModule::playback_
protected

Definition at line 86 of file BMixingModule.h.

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

bool edm::BMixingModule::readDB_
protected

Definition at line 85 of file BMixingModule.h.

Referenced by BMixingModule(), and update().

std::vector<std::string> edm::BMixingModule::sourceNames_
protected

Definition at line 88 of file BMixingModule.h.

Referenced by BMixingModule().

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

Definition at line 90 of file BMixingModule.h.

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

int BMixingModule::vertexoffset = 0
staticprotected

Definition at line 78 of file BMixingModule.h.