#include <TrigMdc.h>
Public Member Functions | |
int | getMdcHitAft (int layer, int wire) const |
int | getMdcHitAft (int layer, int wire) const |
int | getMdcHitOne (int layer, int wire) const |
int | getMdcHitOne (int layer, int wire) const |
int | getMdcHitPre (int layer, int wire) const |
int | getMdcHitPre (int layer, int wire) const |
int | getMdcHitSOne (int layer, int wire) const |
int | getMdcHitSOne (int layer, int wire) const |
uint32_t | getMdcHitWin (int layer, int wire) const |
uint32_t | getMdcHitWin (int layer, int wire) const |
int | getMdcLtrkAft (int id) const |
int | getMdcLtrkAft (int id) const |
int | getMdcLtrkCoutOne (int id) const |
int | getMdcLtrkCoutOne (int id) const |
int | getMdcLtrkCoutSOne (int id) const |
int | getMdcLtrkCoutSOne (int id) const |
int | getMdcLtrkOne (int id) const |
int | getMdcLtrkOne (int id) const |
int | getMdcLtrkPre (int id) const |
int | getMdcLtrkPre (int id) const |
int | getMdcLtrkSOne (int id) const |
int | getMdcLtrkSOne (int id) const |
uint32_t | getMdcLtrkWin (int id) const |
uint32_t | getMdcLtrkWin (int id) const |
int | getMdcStrkAft (int id) const |
int | getMdcStrkAft (int id) const |
int | getMdcStrkCoutOne (int id) const |
int | getMdcStrkCoutOne (int id) const |
int | getMdcStrkCoutSOne (int id) const |
int | getMdcStrkCoutSOne (int id) const |
int | getMdcStrkOne (int id) const |
int | getMdcStrkOne (int id) const |
int | getMdcStrkPre (int id) const |
int | getMdcStrkPre (int id) const |
int | getMdcStrkSOne (int id) const |
int | getMdcStrkSOne (int id) const |
uint32_t | getMdcStrkWin (int id) const |
uint32_t | getMdcStrkWin (int id) const |
int | getMdcTrigCondi (int id) const |
int | getMdcTrigCondi (int id) const |
int | getMdcTSFAft (int layer, int wire) const |
int | getMdcTSFAft (int layer, int wire) const |
int | getMdcTSFOne (int layer, int wire) const |
int | getMdcTSFOne (int layer, int wire) const |
int | getMdcTSFPre (int layer, int wire) const |
int | getMdcTSFPre (int layer, int wire) const |
int | getMdcTSFSOne (int layer, int wire) const |
int | getMdcTSFSOne (int layer, int wire) const |
uint32_t | getMdcTSFWin (int layer, int wire) const |
uint32_t | getMdcTSFWin (int layer, int wire) const |
const std::string & | getName () const |
const std::string & | getName () const |
void | initialize () |
void | initialize () |
void | print () |
void | print () |
void | setMdcTrigData (uint32_t boardId, uint32_t window, uint32_t datasize, const uint32_t *data) |
void | setMdcTrigData (uint32_t boardId, uint32_t window, uint32_t datasize, const uint32_t *data) |
TrigMdc (const char *name) | |
TrigMdc (const char *name) | |
virtual | ~TrigMdc () |
virtual | ~TrigMdc () |
Private Attributes | |
std::string | filename |
std::map< uint32_t, std::vector< uint32_t > > | m_datamap |
std::map< uint32_t, std::vector< uint32_t > > | m_datamap |
int ** | m_mdchit_aft |
int ** | m_mdchit_aft |
int ** | m_mdchit_one |
int ** | m_mdchit_one |
int ** | m_mdchit_pre |
int ** | m_mdchit_pre |
int ** | m_mdchit_sone |
int ** | m_mdchit_sone |
uint32_t ** | m_mdchit_win |
uint32_t ** | m_mdchit_win |
int * | m_mdcltrk_aft |
int * | m_mdcltrk_aft |
int * | m_mdcltrk_one |
int * | m_mdcltrk_one |
int * | m_mdcltrk_pre |
int * | m_mdcltrk_pre |
int * | m_mdcltrk_sone |
int * | m_mdcltrk_sone |
uint32_t * | m_mdcltrk_win |
uint32_t * | m_mdcltrk_win |
int * | m_mdcltrkc_one |
int * | m_mdcltrkc_one |
int * | m_mdcltrkc_sone |
int * | m_mdcltrkc_sone |
int * | m_mdcstrk_aft |
int * | m_mdcstrk_aft |
int * | m_mdcstrk_one |
int * | m_mdcstrk_one |
int * | m_mdcstrk_pre |
int * | m_mdcstrk_pre |
int * | m_mdcstrk_sone |
int * | m_mdcstrk_sone |
uint32_t * | m_mdcstrk_win |
uint32_t * | m_mdcstrk_win |
int * | m_mdcstrkc_one |
int * | m_mdcstrkc_one |
int * | m_mdcstrkc_sone |
int * | m_mdcstrkc_sone |
int * | m_mdcTrigCondi |
int * | m_mdcTrigCondi |
int ** | m_mdctsf_aft |
int ** | m_mdctsf_aft |
int ** | m_mdctsf_one |
int ** | m_mdctsf_one |
int ** | m_mdctsf_pre |
int ** | m_mdctsf_pre |
int ** | m_mdctsf_sone |
int ** | m_mdctsf_sone |
uint32_t ** | m_mdctsf_win |
uint32_t ** | m_mdctsf_win |
std::string | m_name |
|
00006 : m_name(name){ 00007 // hit 00008 m_mdchit_one = new int*[24]; 00009 for (int i = 0; i < 24; i++) m_mdchit_one[i] = new int[256]; 00010 m_mdchit_sone = new int*[24]; 00011 for (int i = 0; i < 24; i++) m_mdchit_sone[i] = new int[256]; 00012 m_mdchit_pre = new int*[24]; 00013 for(int i=0; i<24; i++) m_mdchit_pre[i] = new int[256]; 00014 m_mdchit_aft = new int*[24]; 00015 for(int i=0; i<24; i++) m_mdchit_aft[i] = new int[256]; 00016 m_mdchit_win = new uint32_t*[24]; 00017 for(int i=0; i<24; i++) m_mdchit_win[i] = new uint32_t[256]; 00018 // tsf 00019 m_mdctsf_one = new int*[6]; 00020 for (int i=0; i<6; i++) m_mdctsf_one[i] = new int[256]; 00021 m_mdctsf_sone = new int*[6]; 00022 for (int i=0; i<6; i++) m_mdctsf_sone[i] = new int[256]; 00023 m_mdctsf_pre = new int*[6]; 00024 for(int i=0; i<6; i++) m_mdctsf_pre[i] = new int[256]; 00025 m_mdctsf_aft = new int*[6]; 00026 for(int i=0; i<6; i++) m_mdctsf_aft[i] = new int[256]; 00027 m_mdctsf_win = new uint32_t*[6]; 00028 for(int i=0; i<6; i++) m_mdctsf_win[i] = new uint32_t[256]; 00029 // ltrk 00030 m_mdcltrk_one = new int[128]; 00031 m_mdcltrk_sone = new int[128]; 00032 m_mdcltrk_pre = new int[128]; 00033 m_mdcltrk_aft = new int[128]; 00034 m_mdcltrk_win = new uint32_t[128]; 00035 // strk 00036 m_mdcstrk_one = new int[128]; 00037 m_mdcstrk_sone = new int[128]; 00038 m_mdcstrk_pre = new int[128]; 00039 m_mdcstrk_aft = new int[128]; 00040 m_mdcstrk_win = new uint32_t[128]; 00041 // ltrk in ltrk counter 00042 m_mdcltrkc_one = new int[132]; 00043 m_mdcltrkc_sone= new int[132]; 00044 // strk in strk counter 00045 m_mdcstrkc_one = new int[132]; 00046 m_mdcstrkc_sone = new int[132]; 00047 // trigger condition 00048 m_mdcTrigCondi = new int[10]; 00049 00050 filename = getenv("TRIGEVENTROOT"); 00051 filename += "/dat/trig_mdc.txt"; 00052 ifstream inputfile; 00053 inputfile.open(filename.c_str()); 00054 string data[6]; 00055 std::vector<uint32_t> vtmp; 00056 uint32_t mark = 226; 00057 for(uint32_t i = 0; i < 6; i++) inputfile >> data[i]; 00058 for(uint32_t j = 0; j < 4680; j++) { 00059 for(uint32_t k = 0; k < 6; k++) inputfile >> data[k]; 00060 if((uint32_t (atoi(data[0].c_str())) != mark) || j == 4679) { 00061 if(j == 4679) { 00062 for(int m = 1; m < 6; m++) vtmp.push_back(atoi(data[m].c_str())); 00063 } 00064 typedef pair<uint32_t, vector<uint32_t> > vpair; 00065 m_datamap.insert(vpair(mark,vtmp)); 00066 mark = atoi(data[0].c_str()); 00067 vtmp.clear(); 00068 } 00069 if((uint32_t (atoi(data[0].c_str())) == mark) && j != 4679) { 00070 for(int l = 1; l < 6; l++) vtmp.push_back(atoi(data[l].c_str())); 00071 } 00072 } 00073 }
|
|
00075 { 00076 delete m_mdchit_one; 00077 delete m_mdctsf_one; 00078 delete m_mdchit_sone; 00079 delete m_mdctsf_sone; 00080 00081 delete m_mdchit_pre; 00082 // delete m_mdchit_aft; 00083 00084 delete m_mdcltrk_one; 00085 delete m_mdcstrk_one; 00086 delete m_mdcltrkc_one; 00087 delete m_mdcstrkc_one; 00088 00089 delete m_mdcltrk_sone; 00090 delete m_mdcstrk_sone; 00091 delete m_mdcltrkc_sone; 00092 delete m_mdcstrkc_sone; 00093 00094 delete m_mdcTrigCondi; 00095 }
|
|
|
|
|
|
00028 { return m_mdchit_aft[layer][wire]; } // first down in windows after first up
|
|
00028 { return m_mdchit_aft[layer][wire]; } // first down in windows after first up
|
|
00020 { return m_mdchit_one[layer][wire]; }
|
|
00020 { return m_mdchit_one[layer][wire]; }
|
|
00027 { return m_mdchit_pre[layer][wire]; } // first up in windows
|
|
00027 { return m_mdchit_pre[layer][wire]; } // first up in windows
|
|
00021 { 00022 if(m_mdchit_sone[layer][wire] != 0) { 00023 return (m_mdchit_sone[layer][wire] + 1); 00024 } 00025 else return 0; 00026 }
|
|
00021 { 00022 if(m_mdchit_sone[layer][wire] != 0) { 00023 return (m_mdchit_sone[layer][wire] + 1); 00024 } 00025 else return 0; 00026 }
|
|
00029 { return m_mdchit_win[layer][wire]; } // hit distributions in windows
|
|
00029 { return m_mdchit_win[layer][wire]; } // hit distributions in windows
|
|
00052 { return m_mdcltrk_aft[id]; } // first down in windows after first up
|
|
00052 { return m_mdcltrk_aft[id]; } // first down in windows after first up
|
|
00068 { return m_mdcltrkc_one[id]; }
|
|
00068 { return m_mdcltrkc_one[id]; }
|
|
00069 { 00070 if(m_mdcltrkc_sone[id] != 0) { 00071 return (m_mdcltrkc_sone[id] + 1); 00072 } 00073 else return 0; 00074 }
|
|
00069 { 00070 if(m_mdcltrkc_sone[id] != 0) { 00071 return (m_mdcltrkc_sone[id] + 1); 00072 } 00073 else return 0; 00074 }
|
|
00044 { return m_mdcltrk_one[id]; }
|
|
00044 { return m_mdcltrk_one[id]; }
|
|
00051 { return m_mdcltrk_pre[id]; } // first up in windows
|
|
00051 { return m_mdcltrk_pre[id]; } // first up in windows
|
|
00045 { 00046 if(m_mdcltrk_sone[id] != 0) { 00047 return (m_mdcltrk_sone[id] + 1); 00048 } 00049 else return 0; 00050 }
|
|
00045 { 00046 if(m_mdcltrk_sone[id] != 0) { 00047 return (m_mdcltrk_sone[id] + 1); 00048 } 00049 else return 0; 00050 }
|
|
00053 { return m_mdcltrk_win[id]; } // hit distributions in windows
|
|
00053 { return m_mdcltrk_win[id]; } // hit distributions in windows
|
|
00064 { return m_mdcstrk_aft[id]; } // first down in windows after first up
|
|
00064 { return m_mdcstrk_aft[id]; } // first down in windows after first up
|
|
00077 { return m_mdcstrkc_one[id]; }
|
|
00077 { return m_mdcstrkc_one[id]; }
|
|
00078 { 00079 if(m_mdcstrkc_sone[id] != 0) { 00080 return (m_mdcstrkc_sone[id] + 1); 00081 } 00082 else return 0; 00083 }
|
|
00078 { 00079 if(m_mdcstrkc_sone[id] != 0) { 00080 return (m_mdcstrkc_sone[id] + 1); 00081 } 00082 else return 0; 00083 }
|
|
00056 { return m_mdcstrk_one[id]; }
|
|
00056 { return m_mdcstrk_one[id]; }
|
|
00063 { return m_mdcstrk_pre[id]; } // first up in windows
|
|
00063 { return m_mdcstrk_pre[id]; } // first up in windows
|
|
00057 { 00058 if(m_mdcstrk_sone[id] != 0) { 00059 return (m_mdcstrk_sone[id] + 1); 00060 } 00061 else return 0; 00062 }
|
|
00057 { 00058 if(m_mdcstrk_sone[id] != 0) { 00059 return (m_mdcstrk_sone[id] + 1); 00060 } 00061 else return 0; 00062 }
|
|
00065 { return m_mdcstrk_win[id]; } // hit distributions in windows
|
|
00065 { return m_mdcstrk_win[id]; } // hit distributions in windows
|
|
00085 { return m_mdcTrigCondi[id]; }
|
|
00085 { return m_mdcTrigCondi[id]; }
|
|
00040 { return m_mdctsf_aft[layer][wire]; } // first down in windows after first up
|
|
00040 { return m_mdctsf_aft[layer][wire]; } // first down in windows after first up
|
|
00032 { return m_mdctsf_one[layer][wire]; }
|
|
00032 { return m_mdctsf_one[layer][wire]; }
|
|
00039 { return m_mdctsf_pre[layer][wire]; } // first up in windows
|
|
00039 { return m_mdctsf_pre[layer][wire]; } // first up in windows
|
|
00033 { 00034 if(m_mdctsf_sone[layer][wire] != 0) { 00035 return (m_mdctsf_sone[layer][wire] + 1); 00036 } 00037 else return 0; 00038 }
|
|
00033 { 00034 if(m_mdctsf_sone[layer][wire] != 0) { 00035 return (m_mdctsf_sone[layer][wire] + 1); 00036 } 00037 else return 0; 00038 }
|
|
00041 { return m_mdctsf_win[layer][wire]; } // hit distributions in windows
|
|
00041 { return m_mdctsf_win[layer][wire]; } // hit distributions in windows
|
|
00018 { return m_name; }
|
|
00018 { return m_name; }
|
|
|
|
00097 { 00098 //initialize 00099 for(int i = 0; i < 24; i++) 00100 for(int j = 0; j < 256; j++) 00101 { 00102 m_mdchit_one[i][j] = 0; 00103 m_mdchit_sone[i][j] = 0; 00104 m_mdchit_pre[i][j] = 0; 00105 m_mdchit_aft[i][j] = 0; 00106 m_mdchit_win[i][j] = 0; 00107 if(i < 6) { 00108 m_mdctsf_one[i][j] = 0; 00109 m_mdctsf_sone[i][j] = 0; 00110 m_mdctsf_pre[i][j] = 0; 00111 m_mdctsf_aft[i][j] = 0; 00112 m_mdctsf_win[i][j] = 0; 00113 } 00114 } 00115 for(int k = 0; k < 132; k++) 00116 { 00117 if(k < 10) m_mdcTrigCondi[k] = 0; 00118 m_mdcltrkc_one[k] = 0; 00119 m_mdcstrkc_one[k] = 0; 00120 m_mdcltrkc_sone[k] = 0; 00121 m_mdcstrkc_sone[k] = 0; 00122 if(k < 128) { 00123 m_mdcltrk_one[k] = 0; 00124 m_mdcltrk_sone[k] = 0; 00125 m_mdcltrk_pre[k] = 0; 00126 m_mdcltrk_aft[k] = 0; 00127 m_mdcltrk_win[k] = 0; 00128 00129 m_mdcstrk_one[k] = 0; 00130 m_mdcstrk_sone[k] = 0; 00131 m_mdcstrk_pre[k] = 0; 00132 m_mdcstrk_aft[k] = 0; 00133 m_mdcstrk_win[k] = 0; 00134 00135 } 00136 } 00137 }
|
|
|
|
00317 { 00318 cout<<"The number of board is "<<m_datamap.size()<<endl; 00319 std::map<uint32_t, std::vector<uint32_t> >::iterator iter = m_datamap.begin(); 00320 if(iter->first == 0xe2) 00321 cout<<"The data size of E2 board is "<<iter->second.size()<<endl; 00322 00323 for(int i = 0; i < 24; i++) 00324 for(int j = 0; j < 256; j++) 00325 { 00326 m_mdchit_one[i][j] = 0; 00327 m_mdchit_sone[i][j] = 0; 00328 cout<<"MDC hits: "<<i<<" "<<j<<" "<<m_mdchit_one[i][j]<<endl; 00329 cout<<"MDC hits: "<<i<<" "<<j<<" "<<m_mdchit_sone[i][j]<<endl; 00330 if(i < 6) { 00331 m_mdctsf_one[i][j] = 0; 00332 m_mdctsf_sone[i][j] = 0; 00333 cout<<"MDC tsf: "<<i<<" "<<j<<" "<<m_mdctsf_one[i][j]<<endl; 00334 cout<<"MDC tsf: "<<i<<" "<<j<<" "<<m_mdctsf_sone[i][j]<<endl; 00335 } 00336 } 00337 for(int k = 0; k < 132; k++) 00338 { 00339 m_mdcltrkc_one[k] = 0; 00340 m_mdcstrkc_one[k] = 0; 00341 m_mdcltrkc_sone[k] = 0; 00342 m_mdcstrkc_sone[k] = 0; 00343 cout<<"MDC ltrkc: "<<k<<" "<<m_mdcltrkc_one[k]<<endl; 00344 cout<<"MDC strkc: "<<k<<" "<<m_mdcstrkc_one[k]<<endl; 00345 cout<<"MDC ltrkc: "<<k<<" "<<m_mdcltrkc_sone[k]<<endl; 00346 cout<<"MDC strkc: "<<k<<" "<<m_mdcstrkc_sone[k]<<endl; 00347 if(k < 128) { 00348 m_mdcltrk_one[k] = 0; 00349 m_mdcstrk_one[k] = 0; 00350 m_mdcltrk_sone[k] = 0; 00351 m_mdcstrk_sone[k] = 0; 00352 cout<<"MDC ltrk: "<<k<<" "<<m_mdcltrk_one[k]<<endl; 00353 cout<<"MDC strk: "<<k<<" "<<m_mdcstrk_one[k]<<endl; 00354 cout<<"MDC ltrk: "<<k<<" "<<m_mdcltrk_sone[k]<<endl; 00355 cout<<"MDC strk: "<<k<<" "<<m_mdcstrk_sone[k]<<endl; 00356 } 00357 } 00358 }
|
|
|
|
00139 { 00140 if(datasize%window != 0) cerr<<"ERROR: The data size is not completed in time windows"<<endl; 00141 uint32_t periods = datasize/window; 00142 std::map<uint32_t, std::vector<uint32_t> >::iterator iter=m_datamap.begin(); 00143 for(; iter != m_datamap.end(); iter++){ 00144 if(iter->first != boardId) continue; 00145 std::vector<uint32_t>::iterator iter1 = iter->second.begin(); 00146 for(; iter1 != iter->second.end(); iter1+=5){ 00147 uint32_t byteId = *(iter1+0) -1; 00148 uint32_t bitId = *(iter1+1); 00149 int layerId = *(iter1+2) -1; 00150 int wireId = *(iter1+3) -1; 00151 uint32_t data_type = *(iter1+4); 00152 int seriesOne = -100; 00153 bool firstSOne = true; // this is a flag of first continue "1" signals 00154 bool flag_firstone(true), flag_lastone(true); // whether to book up or down 00155 for(uint32_t i=0; i<window; i++){ 00156 if(layerId < 0 || wireId < 0) continue; 00157 if((iter->first) >= 226 && (iter->first) <= 233){ // TKF1-8 information 00158 if(data_type == 1){ // hit 00159 if((data[byteId + i*periods] >> bitId) & 1){ 00160 if(layerId >= 36 && layerId <= 39 ){ 00161 if(flag_firstone && (i-seriesOne!=1) && (i!=0)){ m_mdchit_pre[layerId-16][wireId] = i+1; flag_firstone = false;} 00162 if( ((i-seriesOne)!=1) && (m_mdchit_aft[layerId-16][wireId]!=0) ) flag_lastone = false; 00163 if( (flag_firstone==false) && ((i-seriesOne)==1) && flag_lastone) m_mdchit_aft[layerId-16][wireId]=i+1; 00164 if(((i-seriesOne)==1) && firstSOne) m_mdchit_sone[layerId-16][wireId] += 1; 00165 if(m_mdchit_sone[layerId-16][wireId] != 0 && (i-seriesOne) != 1) firstSOne = false; 00166 seriesOne = i; 00167 m_mdchit_one[layerId-16][wireId] += 1; 00168 m_mdchit_win[layerId-16][wireId] += 1<<i; 00169 } 00170 else { 00171 if(flag_firstone && (i-seriesOne!=1) && (i!=0)){ m_mdchit_pre[layerId][wireId] = i+1; flag_firstone = false;} 00172 if( ((i-seriesOne)!=1) && (m_mdchit_aft[layerId][wireId]!=0) ) flag_lastone = false; 00173 if( (flag_firstone==false) && ((i-seriesOne)==1) && flag_lastone) m_mdchit_aft[layerId][wireId]=i+1; 00174 if(((i-seriesOne) == 1) && firstSOne) m_mdchit_sone[layerId][wireId] += 1; 00175 if(m_mdchit_sone[layerId][wireId] != 0 && (i-seriesOne) != 1) firstSOne = false; 00176 seriesOne = i; 00177 m_mdchit_one[layerId][wireId] += 1; 00178 m_mdchit_win[layerId][wireId] += 1<<i; 00179 } 00180 } 00181 } 00182 if(data_type == 0) { // TSF 00183 if((data[byteId + i*periods] >> bitId) & 1) { 00184 if(layerId == 10) { 00185 if(flag_firstone && (i-seriesOne!=1) && (i!=0)){ m_mdctsf_pre[2][wireId] = i+1; flag_firstone = false;} 00186 if( ((i-seriesOne)!=1) && (m_mdctsf_aft[2][wireId]!=0) ) flag_lastone = false; 00187 if( (flag_firstone==false) && ((i-seriesOne)==1) && flag_lastone) m_mdctsf_aft[2][wireId]=i+1; 00188 00189 if((i-seriesOne) == 1 && firstSOne) m_mdctsf_sone[2][wireId] += 1; 00190 if(m_mdctsf_sone[2][wireId] != 0 && (i-seriesOne) != 1) firstSOne = false; 00191 seriesOne = i; 00192 m_mdctsf_one[2][wireId] += 1; 00193 m_mdctsf_win[2][wireId] += 1<<i; 00194 } 00195 if(layerId == 14) { 00196 if(flag_firstone && (i-seriesOne!=1) && (i!=0)){ m_mdctsf_pre[3][wireId] = i+1; flag_firstone = false;} 00197 if( ((i-seriesOne)!=1) && (m_mdctsf_aft[3][wireId]!=0) ) flag_lastone = false; 00198 if( (flag_firstone==false) && ((i-seriesOne)==1) && flag_lastone) m_mdctsf_aft[3][wireId]=i+1; 00199 00200 if((i-seriesOne) == 1 && firstSOne) m_mdctsf_sone[3][wireId] += 1; 00201 if(m_mdctsf_sone[3][wireId] != 0 && (i-seriesOne) != 1) firstSOne = false; 00202 seriesOne = i; 00203 m_mdctsf_one[3][wireId] += 1; 00204 m_mdctsf_win[3][wireId] += 1<<i; 00205 } 00206 if(layerId == 17) { 00207 if(flag_firstone && (i-seriesOne!=1) && (i!=0)){ m_mdctsf_pre[4][wireId] = i+1; flag_firstone = false;} 00208 if( ((i-seriesOne)!=1) && (m_mdctsf_aft[4][wireId]!=0) ) flag_lastone = false; 00209 if( (flag_firstone==false) && ((i-seriesOne)==1) && flag_lastone) m_mdctsf_aft[4][wireId]=i+1; 00210 00211 if((i-seriesOne) == 1 && firstSOne) m_mdctsf_sone[4][wireId] += 1; 00212 if(m_mdctsf_sone[4][wireId] != 0 && (i-seriesOne) != 1) firstSOne = false; 00213 seriesOne = i; 00214 m_mdctsf_one[4][wireId] += 1; 00215 m_mdctsf_win[4][wireId] += 1<<i; 00216 } 00217 if(layerId == 37) { 00218 if(flag_firstone && (i-seriesOne!=1) && (i!=0)){ m_mdctsf_pre[5][wireId] = i+1; flag_firstone = false;} 00219 if( ((i-seriesOne)!=1) && (m_mdctsf_aft[5][wireId]!=0) ) flag_lastone = false; 00220 if( (flag_firstone==false) && ((i-seriesOne)==1) && flag_lastone) m_mdctsf_aft[5][wireId]=i+1; 00221 00222 if((i-seriesOne) == 1 && firstSOne) m_mdctsf_sone[5][wireId] += 1; 00223 if(m_mdctsf_sone[5][wireId] != 0 && (i-seriesOne) != 1) firstSOne = false; 00224 seriesOne = i; 00225 m_mdctsf_one[5][wireId] += 1; 00226 m_mdctsf_win[5][wireId] += 1<<i; 00227 } 00228 } 00229 } 00230 if(data_type == 2) { // LTK 00231 if((data[byteId + i*periods] >> bitId) & 1) { 00232 if(flag_firstone && (i-seriesOne!=1) && (i!=0)){ m_mdcltrk_pre[wireId] = i+1; flag_firstone = false;} 00233 if( ((i-seriesOne)!=1) && (m_mdcltrk_aft[wireId]!=0) ) flag_lastone = false; 00234 if( (flag_firstone==false) && ((i-seriesOne)==1) && flag_lastone) m_mdcltrk_aft[wireId]=i+1; 00235 00236 if((i-seriesOne) == 1 && firstSOne) m_mdcltrk_sone[wireId] += 1; 00237 if(m_mdcltrk_sone[wireId] != 0 && (i-seriesOne) != 1) firstSOne = false; 00238 seriesOne = i; 00239 m_mdcltrk_one[wireId] += 1; 00240 m_mdcltrk_win[wireId] += 1<<i; 00241 } 00242 } 00243 if(data_type == 3) { // STK 00244 if((data[byteId + i*periods] >> bitId) & 1) { 00245 if(flag_firstone && (i-seriesOne!=1) && (i!=0)){ m_mdcstrk_pre[wireId] = i+1; flag_firstone = false;} 00246 if( ((i-seriesOne)!=1) && (m_mdcstrk_aft[wireId]!=0) ) flag_lastone = false; 00247 if( (flag_firstone==false) && ((i-seriesOne)==1) && flag_lastone) m_mdcstrk_aft[wireId]=i+1; 00248 00249 if((i-seriesOne) == 1 && firstSOne) m_mdcstrk_sone[wireId] += 1; 00250 if(m_mdcstrk_sone[wireId] != 0 && (i-seriesOne) != 1) firstSOne = false; 00251 seriesOne = i; 00252 m_mdcstrk_one[wireId] += 1; 00253 m_mdcstrk_win[wireId] += 1<<i; 00254 } 00255 } 00256 } // end of TKF1-8 00257 00258 if((iter->first) == 234) { // ITKF information 00259 if(data_type == 0) { 00260 if((data[byteId + i*periods] >> bitId) & 1) { 00261 if(layerId == 2) { 00262 if((i - seriesOne) == 1 && firstSOne) m_mdctsf_sone[0][wireId] += 1; 00263 if(m_mdctsf_sone[0][wireId] != 0 && (i - seriesOne) != 1) firstSOne = false; 00264 seriesOne = i; 00265 m_mdctsf_one[0][wireId] += 1; 00266 } 00267 if(layerId == 6) { 00268 if((i - seriesOne) == 1 && firstSOne) m_mdctsf_sone[1][wireId] += 1; 00269 if(m_mdctsf_sone[1][wireId] != 0 && (i - seriesOne) != 1) firstSOne = false; 00270 seriesOne = i; 00271 m_mdctsf_one[1][wireId] += 1; 00272 } 00273 } 00274 } 00275 if(data_type == 1) { 00276 if((data[byteId + i*periods] >> bitId) & 1) { 00277 if((i - seriesOne) == 1 && firstSOne) m_mdchit_sone[layerId][wireId] += 1; 00278 if(m_mdchit_sone[layerId][wireId] != 0 && (i - seriesOne) != 1) firstSOne = false; 00279 seriesOne = i; 00280 m_mdchit_one[layerId][wireId] += 1; 00281 } 00282 } 00283 if(data_type == 4) { 00284 if((data[byteId + i*periods] >> bitId) & 1) { 00285 m_mdcTrigCondi[wireId] = 1; 00286 } 00287 } 00288 } // end of ITKF 00289 00290 if((iter->first) == 235 || (iter->first) == 236) { // LTKC or STKC information 00291 if(data_type == 2) { 00292 if((data[byteId + i*periods] >> bitId) & 1) { 00293 if((i - seriesOne) == 1 && firstSOne) m_mdcltrkc_sone[wireId] += 1; 00294 if(m_mdcltrkc_sone[wireId] != 0 && (i - seriesOne) != 1) firstSOne = false; 00295 seriesOne = i; 00296 m_mdcltrkc_one[wireId] += 1; 00297 if(wireId >= 128) m_mdcTrigCondi[wireId - 126] = 1; 00298 } 00299 } 00300 if(data_type == 3) { 00301 if((data[byteId + i*periods] >> bitId) & 1) { 00302 if((i - seriesOne) == 1 && firstSOne) m_mdcstrkc_sone[wireId] += 1; 00303 if(m_mdcstrkc_sone[wireId] != 0 && (i - seriesOne) != 1) firstSOne = false; 00304 seriesOne = i; 00305 m_mdcstrkc_one[wireId] += 1; 00306 if(wireId >= 128) m_mdcTrigCondi[wireId - 122] = 1; 00307 } 00308 } 00309 } //end of LTKC or STKC 00310 00311 } // loop in windows 00312 00313 } 00314 } 00315 }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|