CMS 3D CMS Logo

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

List of all members.

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

Protected Attributes

int bunchSpace_
bool checktof_
bool doit_ [4]
unsigned int eventId_
std::vector< boost::shared_ptr
< PileUp > > 
inputSources_
int const maxBunch_
int const minBunch_
bool const mixProdStep1_
bool const mixProdStep2_
bool playback_
std::vector< std::string > sourceNames_
std::vector< float > TrueNumInteractions_

Static Protected Attributes

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

Detailed Description

Definition at line 29 of file BMixingModule.h.


Constructor & Destructor Documentation

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

standard constructor

Definition at line 172 of file BMixingModule.cc.

References spr::find(), edm::ParameterSet::getParameterNames(), edm::ParameterSet::getUntrackedParameter(), inputSources_, maxBunch_, maxNbSources_, minBunch_, playback_, 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"))      
  {  
    // FIXME: temporary to keep bwds compatibility for cfg files
    vector<string> names = pset.getParameterNames();
    if (find(names.begin(), names.end(),"playback")
        != names.end()) {
      playback_=pset.getUntrackedParameter<bool>("playback");
    } else
      playback_=false;

    //We use std::cout in order to make sure the message appears in all possible configurations of the Message Logger
    if (playback_) {
      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_));
    }
  }
BMixingModule::~BMixingModule ( ) [virtual]

Default destructor

Definition at line 206 of file BMixingModule.cc.

{;}

Member Function Documentation

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

Referenced by produce().

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

Definition at line 43 of file BMixingModule.h.

References inputSources_.

{return inputSources_[0] ? inputSources_[0]->averageNumber() : 0.0; }
virtual void edm::BMixingModule::checkSignal ( const edm::Event e) [inline, virtual]

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

Definition at line 48 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 47 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 54 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 229 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 235 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 56 of file BMixingModule.h.

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

Definition at line 45 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 209 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 53 of file BMixingModule.h.

Referenced by produce().

{;}
virtual void edm::BMixingModule::setBcrOffset ( ) [inline, virtual]

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

{;} //to be set in CF
virtual void edm::BMixingModule::setSourceOffset ( const unsigned int  s) [inline, virtual]

Definition at line 52 of file BMixingModule.h.

References gather_cfg::cout.

{std::cout << "BMixingModule::setSourceOffset must be overwritten!" << std::endl;}

Member Data Documentation

Definition at line 61 of file BMixingModule.h.

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

Definition at line 63 of file BMixingModule.h.

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

Definition at line 72 of file BMixingModule.h.

unsigned int edm::BMixingModule::eventId_ [protected]

Definition at line 75 of file BMixingModule.h.

std::vector<boost::shared_ptr<PileUp> > edm::BMixingModule::inputSources_ [protected]
int const edm::BMixingModule::maxBunch_ [protected]
const unsigned int BMixingModule::maxNbSources_ = 4 [static, protected]
int const edm::BMixingModule::minBunch_ [protected]
bool const edm::BMixingModule::mixProdStep1_ [protected]

Reimplemented in edm::MixingModule.

Definition at line 66 of file BMixingModule.h.

Referenced by produce().

bool const edm::BMixingModule::mixProdStep2_ [protected]

Reimplemented in edm::MixingModule.

Definition at line 67 of file BMixingModule.h.

Definition at line 69 of file BMixingModule.h.

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

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

Definition at line 71 of file BMixingModule.h.

Referenced by BMixingModule().

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

Definition at line 73 of file BMixingModule.h.

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

int BMixingModule::vertexoffset = 0 [static, protected]

Definition at line 62 of file BMixingModule.h.

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