CMS 3D CMS Logo

MixingWorker Class Reference

MixingWorker is an auxiliary class for the MixingModule. More...

#include <SimGeneral/MixingModule/plugins/MixingWorker.h>

List of all members.

Public Member Functions

template<>
void addPileups (const int bcr, Event *e, unsigned int eventNr, int vertexoffset)
template<>
void addPileups (const int bcr, Event *e, unsigned int eventNr, int vertexoffset)
template<>
void addPileups (const int bcr, Event *e, unsigned int eventNr, int vertexoffset)
template<>
void addPileups (const int bcr, Event *e, unsigned int eventNr, int vertexoffset)
template<>
void addSignals (const Event &e)
template<>
const int highTrackTof
template<>
const int limHighLowTof
template<>
const int lowTrackTof


Detailed Description

MixingWorker is an auxiliary class for the MixingModule.

Author:
Ursula Berthon, LLR Palaiseau
Version:
1st Version JMarch 2008

Member Function Documentation

template<>
void MixingWorker< HepMCProduct >::addPileups ( const int  bcr,
Event e,
unsigned int  eventNr,
int  vertexoffset 
) [inline]

Definition at line 89 of file MixingWorker.cc.

References LogDebug.

00090 {
00091   //HepMC - we are creating a dummy vector, to have the same interfaces as for the other objects
00092   Handle<HepMCProduct>  result_mc;
00093   bool got = e->getByLabel(tag_,result_mc);
00094   if (got){
00095     LogDebug("MixingModule") <<"  pileup HepMCProduct added";
00096     std::vector<HepMCProduct> vec;
00097     vec.push_back(*(result_mc.product()));
00098     crFrame_->addPileups(bcr,&vec,eventNr);
00099   }
00100 }

template<>
void MixingWorker< SimVertex >::addPileups ( const int  bcr,
Event e,
unsigned int  eventNr,
int  vertexoffset 
) [inline]

Definition at line 74 of file MixingWorker.cc.

References LogDebug, and HLT_VtxMuL3::result.

00075 {
00076   // default version changed to take care of vertexoffset
00077   Handle<std::vector<SimVertex> >  result;
00078   bool got = e->getByLabel(tag_,result);
00079   if (got) {
00080     LogDebug("MixingModule") <<result.product()->size()<<"  pileup vertices  added, eventNr "<<eventNr;
00081     crFrame_->addPileups(bcr,result.product(),eventNr);
00082     vertexoffset+=result.product()->size();
00083   }
00084 
00085 }

template<>
void MixingWorker< SimTrack >::addPileups ( const int  bcr,
Event e,
unsigned int  eventNr,
int  vertexoffset 
) [inline]

Definition at line 62 of file MixingWorker.cc.

References LogDebug.

00063 {
00064   // default version changed to transmit vertexoffset
00065   Handle<std::vector<SimTrack> >  result_t;
00066   bool got =   e->getByLabel(tag_,result_t);
00067   if (got) {
00068     LogDebug("MixingModule") <<result_t.product()->size()<<"  pileup tracks  added, eventNr "<<eventNr;
00069     crFrame_->addPileups(bcr,result_t.product(),eventNr,vertexoffset);
00070   }
00071 }

template<>
void MixingWorker< PSimHit >::addPileups ( const int  bcr,
Event e,
unsigned int  eventNr,
int  vertexoffset 
) [inline]

Definition at line 13 of file MixingWorker.cc.

References highTrackTof(), limHighLowTof(), LogDebug, and lowTrackTof().

00014 {
00015   // default version changed for high/low treatment
00016   if (!isTracker_) {
00017     Handle<std::vector<PSimHit> >  result_t;
00018     bool got =e->getByLabel(tag_,result_t);
00019     if (got) {
00020       LogDebug("MixingModule") <<"For "<<subdet_<<", "<<result_t.product()->size()<<"  pileup objects  added, eventNr "<<eventNr;
00021       crFrame_->addPileups(bcr,result_t.product(),eventNr,vertexoffset);
00022     }
00023   }else {
00024     // Tracker treatment
00025     // do not read branches if clearly outside of tof bounds (and verification is asked for, default)
00026     // we have to add hits from this subdetector + opposite one
00027 
00028     Handle<std::vector<PSimHit> >  simhitshigh,simhitslow;
00029     bool gotHigh,gotLow;
00030 
00031     if(trackerHigh_) {
00032       gotHigh=e->getByLabel(tag_,simhitshigh);
00033       gotLow=e->getByLabel(opp_,simhitslow);
00034     }
00035     else {
00036       gotHigh=e->getByLabel(opp_,simhitshigh);
00037       gotLow=e->getByLabel(tag_,simhitslow);
00038     }
00039 
00040     // add HighTof simhits to high and low signals
00041     float tof = bcr*crFrame_->getBunchSpace();
00042     if (gotHigh) {
00043       if ( !checktof_ || ((limHighLowTof +tof ) <= highTrackTof)) { 
00044         crFrame_->addPileups(bcr,simhitshigh.product(),eventNr,0,checktof_,trackerHigh_);
00045         LogDebug("MixingModule") <<"For bcr "<<bcr<<", "<<subdet_<<", evNr "<<eventNr<<", "<<simhitshigh->size()<<" Hits added from high";
00046       }
00047     }
00048 
00049     // add LowTof simhits to high and low signals
00050     if (gotLow) {
00051       if (  !checktof_ || ((tof+limHighLowTof) >= lowTrackTof && tof <= highTrackTof)) {
00052         crFrame_->addPileups(bcr,simhitslow.product(),eventNr,0,checktof_,trackerHigh_);
00053         LogDebug("MixingModule") <<"For bcr "<<bcr<<", "<<subdet_<<", evNr "<<eventNr<<", "<<simhitslow->size()<<" Hits added from low";
00054       }
00055     }
00056   }
00057 
00058 }

template<>
void MixingWorker< HepMCProduct >::addSignals ( const Event e  )  [inline]

Definition at line 103 of file MixingWorker.cc.

References LogDebug.

00103                                                          {
00104   // version for HepMCProduct is specific since it doesnt come as a vector
00105   // we have to read it differently, and to store it in a (fake) vector
00106   Handle<HepMCProduct>  result_t;
00107   bool got = e.getByLabel(tag_,result_t);
00108   if (got) {
00109     LogDebug("MixingModule") <<" adding HepMCProduct from signal event  with "<<tag_;
00110     std::vector<HepMCProduct> vec;
00111     vec.push_back(*(result_t.product()));
00112     crFrame_->addSignals(&vec,e.id());
00113   }
00114   else    LogWarning("MixingModule") <<"!!!!!!! Did not get any signal data for HepMCProduct with "<<tag_;
00115 }

template<>
const int MixingWorker< PSimHit >::highTrackTof (  )  [inline]

Definition at line 7 of file MixingWorker.cc.

Referenced by addPileups().

template<>
const int MixingWorker< PSimHit >::limHighLowTof (  )  [inline]

Definition at line 8 of file MixingWorker.cc.

Referenced by addPileups().

template<>
const int MixingWorker< PSimHit >::lowTrackTof (  )  [inline]

Definition at line 6 of file MixingWorker.cc.

Referenced by addPileups().


The documentation for this class was generated from the following file:
Generated on Tue Jun 9 18:28:18 2009 for CMSSW by  doxygen 1.5.4