BOSS 7.0.9
BESIII Offline Software System
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
MixerAlg.h File Reference

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

Definition at line 30 of file MixerAlg.h.

Function Documentation

◆ combineDigits()

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

Definition at line 887 of file MixerAlg.cxx.

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

◆ combineMdcDigits()

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

Definition at line 935 of file MixerAlg.cxx.

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

Referenced by MixerAlg::mixDigi().

◆ combineTofDigits()

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

Definition at line 984 of file MixerAlg.cxx.

985{
986 vector<TofDigi*> newDigiCol;
987 //typename TofDigiCol::const_iterator bg;
988 TofDigiCol::const_iterator bgTof = bgDigits.begin();
989 for(; bgTof!=bgDigits.end(); bgTof++ )
990 {
991 (*bgTof)->setTrackIndex(-1000);
992 newDigiCol.push_back(*bgTof);
993 }
994 for(bgTof=newDigiCol.begin(); bgTof!=newDigiCol.end(); bgTof++ ) {
995 mcDigits->push_back(*bgTof);
996 }
997}

Referenced by MixerAlg::mixDigi().