BOSS 7.0.2
BESIII Offline Software System
Loading...
Searching...
No Matches
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
 

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 882 of file MixerAlg.cxx.

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

◆ combineMdcDigits()

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

Definition at line 930 of file MixerAlg.cxx.

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

Referenced by MixerAlg::mixDigi().

◆ combineTofDigits()

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

Definition at line 979 of file MixerAlg.cxx.

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

Referenced by MixerAlg::mixDigi().