CGEM BOSS 6.6.5.f
BESIII Offline Software System
Loading...
Searching...
No Matches
InstallArea/include/BesEventMixer/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
 

Macros

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

Macro Definition Documentation

◆ MAX_LOOP_TIMES

#define MAX_LOOP_TIMES   1000000

Function Documentation

◆ combineDigits()

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

Definition at line 879 of file MixerAlg.cxx.

880{
881 vector<T2*> newDigiCol;
882 typename T1::iterator mc;
883 typename T1::const_iterator bg;
884 bool new_digi;
885 for(bg = bgDigits.begin(); bg != bgDigits.end(); bg++ )
886 {
887 new_digi = true;
888 for(mc = mcDigits->begin(); mc != mcDigits->end(); mc++ )
889 {
890 if((*mc)->identify()==(*bg)->identify())
891 {
892 if( verbosity < 2 )
893 {
894 cout << "****************************************"<<endl;
895 cout << "MC id " << (*mc)->identify().get_value()
896 << " BG Id " << (*bg)->identify().get_value() << endl;
897 cout<<"==> MC Digi : ";
898 (*mc)->fillStream(cout);
899 cout<<"==> BG Digi : ";
900 (*bg)->fillStream(cout);
901 }
902
903 (*mc)->setTrackIndex((*mc)->getTrackIndex() - 999);
904 *(*mc) += *(*bg);
905
906 new_digi = false;
907 if( verbosity < 2 )
908 {
909 cout<<"==> New MC Digi: ";
910 (*mc)->fillStream(cout);
911 cout << "****************************************"<<endl;
912 }
913 }
914 }
915
916 // no signal digi in this channel. Create new digi with BG only
917 if (new_digi) {
918 (*bg)->setTrackIndex(-1000);
919 newDigiCol.push_back(*bg);
920 }
921 }
922
923 for(bg=newDigiCol.begin(); bg!=newDigiCol.end(); bg++ )
924 mcDigits->push_back(*bg);
925}
void bg(int i, double p)
Definition: betagamma.cxx:1

◆ combineMdcDigits()

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

Definition at line 927 of file MixerAlg.cxx.

928{
929 vector<MdcDigi*> newDigiCol;
930 MdcDigiCol::const_iterator mc;
931 MdcDigiCol::const_iterator bg;
932 bool new_digi;
933 for(bg = bgDigits.begin(); bg != bgDigits.end(); bg++ )
934 {
935 if((*bg)->getChargeChannel() < 0x7FFFFFFF) (*bg)->setChargeChannel(0);
936 new_digi = true;
937 for(mc = mcDigits->begin(); mc != mcDigits->end(); mc++ )
938 {
939 if((*mc)->identify()==(*bg)->identify())
940 {
941 if( verbosity < 2 )
942 {
943 cout << "****************************************"<<endl;
944 cout << "MC id " << (*mc)->identify().get_value()
945 << " BG Id " << (*bg)->identify().get_value() << endl;
946 cout<<"==> MC Digi : ";
947 (*mc)->fillStream(cout);
948 cout<<"==> BG Digi : ";
949 (*bg)->fillStream(cout);
950 }
951
952 (*mc)->setTrackIndex((*mc)->getTrackIndex() - 999);
953 *(*mc) += *(*bg);
954
955 new_digi = false;
956 if( verbosity < 2 )
957 {
958 cout<<"==> New MC Digi: ";
959 (*mc)->fillStream(cout);
960 cout << "****************************************"<<endl;
961 }
962 }
963 }
964
965 // no signal digi in this channel. Create new digi with BG only
966 if (new_digi) {
967 (*bg)->setTrackIndex(-1000);
968 newDigiCol.push_back(*bg);
969 }
970 }
971
972 for(bg=newDigiCol.begin(); bg!=newDigiCol.end(); bg++ )
973 mcDigits->push_back(*bg);
974}

◆ combineTofDigits()

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

Definition at line 976 of file MixerAlg.cxx.

977{
978 vector<TofDigi*> newDigiCol;
979 //typename TofDigiCol::const_iterator bg;
980 TofDigiCol::const_iterator bgTof = bgDigits.begin();
981 for(; bgTof!=bgDigits.end(); bgTof++ )
982 {
983 (*bgTof)->setTrackIndex(-1000);
984 newDigiCol.push_back(*bgTof);
985 }
986 for(bgTof=newDigiCol.begin(); bgTof!=newDigiCol.end(); bgTof++ ) {
987 mcDigits->push_back(*bgTof);
988 }
989}