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::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 (edm::LuminosityBlock &, edm::EventSetup const &)
 
virtual void beginRun (edm::Run &r, const edm::EventSetup &setup)
 
 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 getEventStartInfo (edm::Event &e, const unsigned int source)
 
bool poisson () const
 
virtual void produce (edm::Event &e1, const edm::EventSetup &c)
 
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 &)
 
boost::function< void(const
BranchDescription &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 

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
template<class TProducer , class TMethod >
void callWhenNewProductsRegistered (TProducer *iProd, TMethod iMethod)
 

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:75
static const unsigned int maxNbSources_
Definition: BMixingModule.h:79
std::vector< boost::shared_ptr< PileUp > > inputSources_
Definition: BMixingModule.h:87
bool const mixProdStep1_
Definition: BMixingModule.h:74
std::vector< std::string > sourceNames_
Definition: BMixingModule.h:80
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 57 of file BMixingModule.h.

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

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

Definition at line 56 of file BMixingModule.h.

Referenced by produce().

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

Definition at line 50 of file BMixingModule.h.

References inputSources_.

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

Reimplemented from edm::EDProducer.

Definition at line 204 of file BMixingModule.cc.

References update().

204  {
205  update(setup);
206  }
void update(edm::EventSetup const &)
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")
void BMixingModule::beginRun ( edm::Run r,
const edm::EventSetup setup 
)
virtual

Reimplemented from edm::EDProducer.

Definition at line 207 of file BMixingModule.cc.

References update().

207  {
208  update(setup);
209  }
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 55 of file BMixingModule.h.

References gather_cfg::cout.

Referenced by produce().

55 {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 54 of file BMixingModule.h.

References gather_cfg::cout.

Referenced by produce().

54 {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 61 of file BMixingModule.h.

References gather_cfg::cout.

Referenced by produce().

61 {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 241 of file BMixingModule.cc.

References inputSources_, and maxNbSources_.

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

241  {
242  for (size_t dropIdx=0; dropIdx<maxNbSources_; dropIdx++ ) {
243  if( inputSources_[dropIdx] ) inputSources_[dropIdx]->dropUnwantedBranches(wantedBranches);
244  }
245  }
static const unsigned int maxNbSources_
Definition: BMixingModule.h:79
std::vector< boost::shared_ptr< PileUp > > inputSources_
Definition: BMixingModule.h:87
void BMixingModule::endJob ( void  )
protectedvirtual

Reimplemented from edm::EDProducer.

Definition at line 247 of file BMixingModule.cc.

References inputSources_, and maxNbSources_.

247  {
248  for (size_t endIdx=0; endIdx<maxNbSources_; endIdx++ ) {
249  if( inputSources_[endIdx] ) inputSources_[endIdx]->endJob();
250  }
251  }
static const unsigned int maxNbSources_
Definition: BMixingModule.h:79
std::vector< boost::shared_ptr< PileUp > > inputSources_
Definition: BMixingModule.h:87
virtual void edm::BMixingModule::getEventStartInfo ( edm::Event e,
const unsigned int  source 
)
inlinevirtual

Definition at line 63 of file BMixingModule.h.

63 {;} //to be set locally
bool edm::BMixingModule::poisson ( ) const
inline

Definition at line 52 of file BMixingModule.h.

References inputSources_.

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

Cumulates the pileup events onto this event

Implements edm::EDProducer.

Definition at line 221 of file BMixingModule.cc.

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

221  {
222 
223  // Check if the signal is present in the root file
224  // for all the objects we want to mix
225  checkSignal(e);
226 
227  // Create EDProduct
229 
230  // Add signals
231  if (!mixProdStep1_){
232  addSignals(e,setup);
233  }
234 
235  doPileUp(e,setup);
236 
237  // Put output into event (here only playback info)
238  put(e,setup);
239  }
virtual void addSignals(const edm::Event &e, const edm::EventSetup &c)
Definition: BMixingModule.h:56
virtual void put(edm::Event &e, const edm::EventSetup &c)
Definition: BMixingModule.h:60
virtual void checkSignal(const edm::Event &e)
Definition: BMixingModule.h:55
bool const mixProdStep1_
Definition: BMixingModule.h:74
virtual void doPileUp(edm::Event &e, const edm::EventSetup &c)
Definition: BMixingModule.h:61
virtual void createnewEDProduct()
Definition: BMixingModule.h:54
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::DataMixingModule, and edm::MixingModule.

Definition at line 60 of file BMixingModule.h.

Referenced by produce().

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

Reimplemented in edm::MixingModule.

Definition at line 45 of file BMixingModule.h.

Referenced by update().

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

Definition at line 58 of file BMixingModule.h.

References gather_cfg::cout.

58 {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 62 of file BMixingModule.h.

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

Definition at line 59 of file BMixingModule.h.

References gather_cfg::cout.

59 {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 211 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().

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

Member Data Documentation

int edm::BMixingModule::bunchSpace_
protected

Definition at line 69 of file BMixingModule.h.

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

bool edm::BMixingModule::checktof_
protected

Definition at line 71 of file BMixingModule.h.

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

Definition at line 81 of file BMixingModule.h.

unsigned int edm::BMixingModule::eventId_
protected

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

Referenced by produce().

bool const edm::BMixingModule::mixProdStep2_
protected

Definition at line 75 of file BMixingModule.h.

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

Definition at line 90 of file BMixingModule.h.

Referenced by update().

bool edm::BMixingModule::playback_
protected

Definition at line 78 of file BMixingModule.h.

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

bool edm::BMixingModule::readDB_
protected

Definition at line 77 of file BMixingModule.h.

Referenced by BMixingModule(), and update().

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

Definition at line 80 of file BMixingModule.h.

Referenced by BMixingModule().

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

Definition at line 82 of file BMixingModule.h.

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

int BMixingModule::vertexoffset = 0
staticprotected

Definition at line 70 of file BMixingModule.h.

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