/home/bes3soft/bes3soft/Boss/7.0.2/dist/7.0.2/Simulation/BesEventMixer/BesEventMixer-00-00-35/BesEventMixer/MixerAlg.h File Reference

#include "RawDataCnv/EventManagement/RAWEVENT.h"
#include "GaudiKernel/Algorithm.h"
#include "GaudiKernel/SmartDataPtr.h"
#include "RawFile/RawFileReader.h"
#include "RawDataCnv/EventManagement/EmcBuilder.h"
#include "RawDataCnv/EventManagement/MdcBuilder.h"
#include "RawDataCnv/EventManagement/MucBuilder.h"
#include "RawDataCnv/EventManagement/TofBuilder.h"
#include "EmcRawEvent/EmcDigi.h"
#include "MdcRawEvent/MdcDigi.h"
#include "TofRawEvent/TofDigi.h"
#include "MucRawEvent/MucDigi.h"
#include "RawEvent/RawDataUtil.h"
#include "RealizationSvc/RealizationSvc.h"
#include "RealizationSvc/IRealizationSvc.h"
#include "DataInfoSvc/DataInfoSvc.h"
#include "DataInfoSvc/IDataInfoSvc.h"
#include "BesTimerSvc/IBesTimerSvc.h"
#include "BesTimerSvc/BesTimerSvc.h"
#include "GaudiKernel/NTuple.h"

Go to the source code of this file.

Classes

class  MixerAlg

Defines

#define MAX_LOOP_TIMES   1000000

Functions

template<class T1, class T2>
void combineDigits (SmartDataPtr< T1 > &mcDigits, T1 &bgDigits, int verbosity)
void combineMdcDigits (SmartDataPtr< MdcDigiCol > &mcDigits, MdcDigiCol &bgDigits, int verbosity)
void combineTofDigits (SmartDataPtr< TofDigiCol > &mcDigits, TofDigiCol &bgDigits, int verbosity)


Define Documentation

#define MAX_LOOP_TIMES   1000000

Definition at line 30 of file MixerAlg.h.

Referenced by MixerAlg::execute().


Function Documentation

template<class T1, class T2>
void combineDigits ( SmartDataPtr< T1 > &  mcDigits,
T1 &  bgDigits,
int  verbosity 
)

Definition at line 882 of file MixerAlg.cxx.

References bg().

00883 {
00884   vector<T2*> newDigiCol;
00885   typename T1::iterator mc;
00886   typename T1::const_iterator bg;
00887   bool new_digi;
00888   for(bg = bgDigits.begin(); bg != bgDigits.end(); bg++ )
00889     {
00890       new_digi = true;
00891       for(mc = mcDigits->begin(); mc != mcDigits->end(); mc++ )
00892         {
00893           if((*mc)->identify()==(*bg)->identify())
00894             {
00895               if( verbosity < 2 )
00896                 {
00897                   cout << "****************************************"<<endl;
00898                   cout << "MC id " << (*mc)->identify().get_value() 
00899                        << " BG Id " << (*bg)->identify().get_value() << endl;
00900                   cout<<"==> MC Digi : ";
00901                   (*mc)->fillStream(cout);
00902                   cout<<"==> BG Digi : ";
00903                   (*bg)->fillStream(cout);
00904                 }
00905               
00906               (*mc)->setTrackIndex((*mc)->getTrackIndex() - 999);
00907               *(*mc) += *(*bg);
00908 
00909               new_digi = false;
00910               if( verbosity < 2 )
00911                 {
00912                   cout<<"==> New MC Digi: ";
00913                   (*mc)->fillStream(cout);
00914                   cout << "****************************************"<<endl;
00915                 }
00916             }
00917         }
00918       
00919       // no signal digi in this channel. Create new digi with BG only
00920       if (new_digi) {
00921         (*bg)->setTrackIndex(-1000);
00922         newDigiCol.push_back(*bg);
00923       }
00924     }
00925  
00926   for(bg=newDigiCol.begin(); bg!=newDigiCol.end(); bg++ )
00927     mcDigits->push_back(*bg);
00928 }

void combineMdcDigits ( SmartDataPtr< MdcDigiCol > &  mcDigits,
MdcDigiCol bgDigits,
int  verbosity 
)

Definition at line 930 of file MixerAlg.cxx.

References bg().

Referenced by MixerAlg::mixDigi().

00931 {
00932   vector<MdcDigi*> newDigiCol;
00933   MdcDigiCol::const_iterator mc;
00934   MdcDigiCol::const_iterator bg;
00935   bool new_digi;
00936   for(bg = bgDigits.begin(); bg != bgDigits.end(); bg++ )
00937     {
00938       if((*bg)->getChargeChannel() < 0x7FFFFFFF)  (*bg)->setChargeChannel(0);
00939       new_digi = true;
00940       for(mc = mcDigits->begin(); mc != mcDigits->end(); mc++ )
00941         {
00942           if((*mc)->identify()==(*bg)->identify())
00943             {
00944               if( verbosity < 2 )
00945                 {
00946                   cout << "****************************************"<<endl;
00947                   cout << "MC id " << (*mc)->identify().get_value()
00948                        << " BG Id " << (*bg)->identify().get_value() << endl;
00949                   cout<<"==> MC Digi : ";
00950                   (*mc)->fillStream(cout);
00951                   cout<<"==> BG Digi : ";
00952                   (*bg)->fillStream(cout);
00953                 }
00954 
00955               (*mc)->setTrackIndex((*mc)->getTrackIndex() - 999);
00956               *(*mc) += *(*bg);
00957 
00958               new_digi = false;
00959               if( verbosity < 2 )
00960                 {
00961                   cout<<"==> New MC Digi: ";
00962                   (*mc)->fillStream(cout);
00963                   cout << "****************************************"<<endl;
00964                 }
00965             }
00966         }
00967 
00968       // no signal digi in this channel. Create new digi with BG only
00969       if (new_digi) {
00970         (*bg)->setTrackIndex(-1000);
00971         newDigiCol.push_back(*bg);
00972       }
00973     }
00974 
00975   for(bg=newDigiCol.begin(); bg!=newDigiCol.end(); bg++ )
00976     mcDigits->push_back(*bg);
00977 }

void combineTofDigits ( SmartDataPtr< TofDigiCol > &  mcDigits,
TofDigiCol bgDigits,
int  verbosity 
)

Definition at line 979 of file MixerAlg.cxx.

Referenced by MixerAlg::mixDigi().

00980 {
00981   vector<TofDigi*> newDigiCol;
00982   //typename TofDigiCol::const_iterator bg;
00983   TofDigiCol::const_iterator bgTof = bgDigits.begin();
00984   for(; bgTof!=bgDigits.end(); bgTof++ )
00985     {
00986       (*bgTof)->setTrackIndex(-1000);
00987       newDigiCol.push_back(*bgTof);
00988     } 
00989   for(bgTof=newDigiCol.begin(); bgTof!=newDigiCol.end(); bgTof++ ) {
00990     mcDigits->push_back(*bgTof);
00991   }
00992 }


Generated on Tue Nov 29 23:17:09 2016 for BOSS_7.0.2 by  doxygen 1.4.7