#include <BMixingModule.h>
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 () |
Protected Member Functions | |
void | dropUnwantedBranches (std::vector< std::string > const &wantedBranches) |
virtual void | endJob () |
void | update (edm::EventSetup const &) |
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< MixingRcd > | parameterWatcher_ |
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 |
Definition at line 30 of file BMixingModule.h.
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_.
: bunchSpace_(pset.getParameter<int>("bunchspace")), minBunch_((pset.getParameter<int>("minBunch")*25)/pset.getParameter<int>("bunchspace")), maxBunch_((pset.getParameter<int>("maxBunch")*25)/pset.getParameter<int>("bunchspace")), mixProdStep1_(pset.getParameter<bool>("mixProdStep1")), mixProdStep2_(pset.getParameter<bool>("mixProdStep2")), readDB_(false) { if (pset.exists("readDB")) readDB_=pset.getParameter<bool>("readDB"); playback_=pset.getUntrackedParameter<bool>("playback",false); if (playback_) { //this could be explicitely checked LogInfo("MixingModule") <<" ATTENTION:Mixing will be done in playback mode! \n" <<" ATTENTION:Mixing Configuration must be the same as for the original mixing!"; } // Just for debugging print out. sourceNames_.push_back("input"); sourceNames_.push_back("cosmics"); sourceNames_.push_back("beamhalo_plus"); sourceNames_.push_back("beamhalo_minus"); for (size_t makeIdx = 0; makeIdx < maxNbSources_; makeIdx++ ) { inputSources_.push_back(maybeMakePileUp(pset,sourceNames_[makeIdx], minBunch_,maxBunch_,playback_)); if (inputSources_.back()) inputSources_.back()->input(makeIdx); } }
BMixingModule::~BMixingModule | ( | ) | [virtual] |
virtual void edm::BMixingModule::addPileups | ( | const int | bcr, |
EventPrincipal * | ep, | ||
unsigned int | eventId, | ||
unsigned int | worker, | ||
const edm::EventSetup & | c | ||
) | [inline, virtual] |
Definition at line 57 of file BMixingModule.h.
{;}
virtual void edm::BMixingModule::addSignals | ( | const edm::Event & | e, |
const edm::EventSetup & | c | ||
) | [inline, virtual] |
Reimplemented in edm::DataMixingModule, and edm::MixingModule.
Definition at line 56 of file BMixingModule.h.
Referenced by produce().
{;}
double edm::BMixingModule::averageNumber | ( | ) | const [inline] |
Definition at line 50 of file BMixingModule.h.
References inputSources_.
{return inputSources_[0] ? inputSources_[0]->averageNumber() : 0.0; }
void BMixingModule::beginLuminosityBlock | ( | edm::LuminosityBlock & | , |
edm::EventSetup const & | setup | ||
) | [virtual] |
Reimplemented from edm::EDProducer.
Definition at line 204 of file BMixingModule.cc.
References update().
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().
{ update(setup); }
virtual void edm::BMixingModule::checkSignal | ( | const edm::Event & | e | ) | [inline, virtual] |
Reimplemented in edm::DataMixingModule, and edm::MixingModule.
Definition at line 55 of file BMixingModule.h.
References gather_cfg::cout.
Referenced by produce().
{std::cout << "BMixingModule::checkSignal must be overwritten!" << std::endl;}
virtual void edm::BMixingModule::createnewEDProduct | ( | ) | [inline, virtual] |
Reimplemented in edm::DataMixingModule, and edm::MixingModule.
Definition at line 54 of file BMixingModule.h.
References gather_cfg::cout.
Referenced by produce().
{std::cout << "BMixingModule::createnewEDProduct must be overwritten!" << std::endl;}
virtual void edm::BMixingModule::doPileUp | ( | edm::Event & | e, |
const edm::EventSetup & | c | ||
) | [inline, virtual] |
Reimplemented in edm::DataMixingModule, and edm::MixingModule.
Definition at line 61 of file BMixingModule.h.
References gather_cfg::cout.
Referenced by produce().
{std::cout << "BMixingModule::doPileUp must be overwritten!" << std::endl;}
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().
{ for (size_t dropIdx=0; dropIdx<maxNbSources_; dropIdx++ ) { if( inputSources_[dropIdx] ) inputSources_[dropIdx]->dropUnwantedBranches(wantedBranches); } }
void BMixingModule::endJob | ( | void | ) | [protected, virtual] |
Reimplemented from edm::EDProducer.
Definition at line 247 of file BMixingModule.cc.
References inputSources_, and maxNbSources_.
{ for (size_t endIdx=0; endIdx<maxNbSources_; endIdx++ ) { if( inputSources_[endIdx] ) inputSources_[endIdx]->endJob(); } }
virtual void edm::BMixingModule::getEventStartInfo | ( | edm::Event & | e, |
const unsigned int | source | ||
) | [inline, virtual] |
Definition at line 63 of file BMixingModule.h.
{;} //to be set locally
bool edm::BMixingModule::poisson | ( | ) | const [inline] |
Definition at line 52 of file BMixingModule.h.
References inputSources_.
{return inputSources_[0] ? inputSources_[0]->poisson() : 0.0 ;}
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().
{ // Check if the signal is present in the root file // for all the objects we want to mix checkSignal(e); // Create EDProduct createnewEDProduct(); // Add signals if (!mixProdStep1_){ addSignals(e,setup); } doPileUp(e,setup); // Put output into event (here only playback info) put(e,setup); }
virtual void edm::BMixingModule::put | ( | edm::Event & | e, |
const edm::EventSetup & | c | ||
) | [inline, virtual] |
Reimplemented in edm::DataMixingModule, and edm::MixingModule.
Definition at line 60 of file BMixingModule.h.
Referenced by produce().
{;}
virtual void edm::BMixingModule::reload | ( | const edm::EventSetup & | setup | ) | [inline, virtual] |
Reimplemented in edm::MixingModule.
Definition at line 45 of file BMixingModule.h.
Referenced by update().
{};
virtual void edm::BMixingModule::setBcrOffset | ( | ) | [inline, virtual] |
Definition at line 58 of file BMixingModule.h.
References gather_cfg::cout.
{std::cout << "BMixingModule::setBcrOffset must be overwritten!" << std::endl;} //FIXME: LogWarning
virtual void edm::BMixingModule::setEventStartInfo | ( | const unsigned int | s | ) | [inline, virtual] |
Definition at line 62 of file BMixingModule.h.
{;} //to be set in CF
virtual void edm::BMixingModule::setSourceOffset | ( | const unsigned int | s | ) | [inline, virtual] |
Definition at line 59 of file BMixingModule.h.
References gather_cfg::cout.
{std::cout << "BMixingModule::setSourceOffset must be overwritten!" << std::endl;}
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 beginLuminosityBlock(), and beginRun().
{ if (readDB_ && parameterWatcher_.check(setup)){ for (size_t makeIdx = 0; makeIdx < maxNbSources_; makeIdx++ ) { if (inputSources_[makeIdx]) inputSources_[makeIdx]->reload(setup); } reload(setup); } }
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] |
Definition at line 87 of file BMixingModule.h.
Referenced by averageNumber(), BMixingModule(), edm::DataMixingModule::doPileUp(), edm::MixingModule::doPileUp(), dropUnwantedBranches(), endJob(), poisson(), and update().
int edm::BMixingModule::maxBunch_ [protected] |
Definition at line 73 of file BMixingModule.h.
Referenced by BMixingModule(), edm::MixingModule::createnewEDProduct(), edm::DataMixingModule::doPileUp(), edm::MixingModule::doPileUp(), edm::MixingModule::MixingModule(), and edm::MixingModule::reload().
const unsigned int BMixingModule::maxNbSources_ = 4 [static, protected] |
Definition at line 79 of file BMixingModule.h.
Referenced by BMixingModule(), edm::MixingModule::createnewEDProduct(), edm::DataMixingModule::doPileUp(), edm::MixingModule::doPileUp(), dropUnwantedBranches(), endJob(), edm::MixingModule::MixingModule(), and update().
int edm::BMixingModule::minBunch_ [protected] |
Definition at line 72 of file BMixingModule.h.
Referenced by BMixingModule(), edm::MixingModule::createnewEDProduct(), edm::DataMixingModule::doPileUp(), edm::MixingModule::doPileUp(), edm::MixingModule::MixingModule(), and edm::MixingModule::reload().
bool const edm::BMixingModule::mixProdStep1_ [protected] |
Reimplemented in edm::MixingModule.
Definition at line 74 of file BMixingModule.h.
Referenced by produce().
bool const edm::BMixingModule::mixProdStep2_ [protected] |
Reimplemented in edm::MixingModule.
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 [static, protected] |
Definition at line 70 of file BMixingModule.h.
Referenced by edm::MixingModule::pileAllWorkers().