39 std::vector<int> vtmp;
43 for ( std::vector<int>::iterator
iter = vmdcHit.begin();
iter != vmdcHit.end();
iter += 2 )
46 int wire = *(
iter + 1 );
49 vtmp.push_back( layer );
50 vtmp.push_back( wire );
52 if ( layer >= 36 && layer <= 39 )
54 wire = int( wire / 2 );
55 vtmp.push_back( layer );
56 vtmp.push_back( wire );
61 for ( std::vector<int>::iterator
iter = vtmp.begin();
iter != vtmp.end();
iter += 2 )
63 bool ifsamelem =
false;
64 int layerId = *(
iter );
65 int cellId = *(
iter + 1 );
66 for ( std::vector<int>::iterator iter_tmp =
iter; iter_tmp != vtmp.end(); iter_tmp += 2 )
68 if ( ( iter_tmp + 2 ) != vtmp.end() )
70 int layerId_tmp = *( iter_tmp + 2 );
71 int cellId_tmp = *( iter_tmp + 3 );
72 if ( ( layerId == layerId_tmp ) && ( cellId == cellId_tmp ) ) ifsamelem =
true;
75 if ( ifsamelem ==
false )
77 digiId.push_back( layerId );
78 digiId.push_back( cellId );
86 for (
int i = 0; i < 48; i++ )
88 SL1PivotCellHit[i] = 0;
90 for (
int j = 0; j < 8; j++ ) { SL1HitCount[i][j] = 0; }
93 for (
int i = 0; i < 80; i++ )
95 SL2PivotCellHit[i] = 0;
97 for (
int j = 0; j < 12; j++ ) { SL2HitCount[i][j] = 0; }
100 for (
int i = 0; i < 88; i++ )
102 SL3PivotCellHit[i] = 0;
104 for (
int j = 0; j < 16; j++ ) { SL3HitCount[i][j] = 0; }
107 for (
int i = 0; i < 112; i++ )
109 SL4PivotCellHit[i] = 0;
111 for (
int j = 0; j < 22; j++ ) { SL4HitCount[i][j] = 0; }
114 for (
int i = 0; i < 128; i++ )
116 SL5PivotCellHit[i] = 0;
118 for (
int j = 0; j < 31; j++ ) { SL5HitCount[i][j] = 0; }
121 for (
int i = 0; i < 128; i++ )
123 SL10PivotCellHit[i] = 0;
125 for (
int j = 0; j < 81; j++ ) { SL10HitCount[i][j] = 0; }
130 int layer, cell, superlayer, ln;
132 for ( std::vector<int>::iterator
iter = digiId.begin();
iter != digiId.end();
iter += 2 )
135 cell = *(
iter + 1 );
138 superlayer = (int)layer / 4 + 1;
140 if ( superlayer == 1 )
142 if ( ln == 2 ) SL1PivotCellHit[cell] = 1;
143 for (
unsigned int i = 0; i < SL1.size(); i++ )
145 for (
unsigned int j = 0; j < SL1[i].size() / 4; j++ )
147 if ( SL1[i][3 - ln + j * 4] == cell + 1 ) SL1HitCount[i][j] += 1;
152 if ( superlayer == 2 )
154 if ( ln == 2 ) SL2PivotCellHit[cell] = 1;
155 for (
unsigned int i = 0; i < SL2.size(); i++ )
157 for (
unsigned int j = 0; j < SL2[i].size() / 4; j++ )
159 if ( SL2[i][3 - ln + j * 4] == cell + 1 ) SL2HitCount[i][j] += 1;
164 if ( superlayer == 3 )
166 if ( ln == 2 ) SL3PivotCellHit[cell] = 1;
167 for (
unsigned int i = 0; i < SL3.size(); i++ )
169 for (
unsigned int j = 0; j < SL3[i].size() / 4; j++ )
171 if ( SL3[i][3 - ln + j * 4] == cell + 1 ) SL3HitCount[i][j] += 1;
176 if ( superlayer == 4 )
178 if ( ln == 2 ) SL4PivotCellHit[cell] = 1;
179 for (
unsigned int i = 0; i < SL4.size(); i++ )
181 for (
unsigned int j = 0; j < SL4[i].size() / 4; j++ )
183 if ( SL4[i][3 - ln + j * 4] == cell + 1 ) SL4HitCount[i][j] += 1;
188 if ( superlayer == 5 )
190 if ( ln == 1 ) SL5PivotCellHit[cell] = 1;
191 for (
unsigned int i = 0; i < SL5.size(); i++ )
193 for (
unsigned int j = 0; j < SL5[i].size() / 4; j++ )
195 if ( SL5[i][3 - ln + j * 4] == cell + 1 ) SL5HitCount[i][j] += 1;
202 superlayer = (int)layer / 4 + 1;
204 if ( ln == 1 ) SL10PivotCellHit[cell] = 1;
205 for (
unsigned int i = 0; i < SL10.size(); i++ )
207 for (
unsigned int j = 0; j < SL10[i].size() / 4; j++ )
209 if ( SL10[i][3 - ln + j * 4] == cell + 1 ) SL10HitCount[i][j] += 1;
218 for (
int i = 0; i < 48; i++ )
219 for (
int j = 0; j < 8; j++ )
221 if ( SL1HitCount[i][j] >= 3 )
228 for (
int i = 0; i < 80; i++ )
229 for (
int j = 0; j < 12; j++ )
231 if ( SL2HitCount[i][j] >= 3 )
238 for (
int i = 0; i < 88; i++ )
239 for (
int j = 0; j < 16; j++ )
241 if ( SL3HitCount[i][j] >= 3 )
248 for (
int i = 0; i < 112; i++ )
249 for (
int j = 0; j < 22; j++ )
251 if ( SL4HitCount[i][j] >= 3 )
258 for (
int i = 0; i < 128; i++ )
259 for (
int j = 0; j < 31; j++ )
261 if ( SL5HitCount[i][j] >= 3 )
268 for (
int i = 0; i < 128; i++ )
269 for (
int j = 0; j < 81; j++ )
271 if ( SL10HitCount[i][j] >= 3 )
283 int ncell = 0, pl = 0;
284 int a, b, l4, l3, l2, l1;
291 for (
int n = 1;
n < 6;
n++ )
319 for (
int i = 1; i < ( ncell + 1 ); i++ )
321 std::vector<int> tmp;
324 TString filename = TString( getenv(
"TRIGGERROOT" ) );
325 filename +=
"/data/tsf";
327 filename +=
"/TSF-SL";
335 readin.open( filename, ios_base::in );
336 if ( !readin ) cerr <<
"can not open the file " << filename << endl;
337 while ( readin.good() )
339 readin >> a >> b >> l4 >> l3 >> l2 >> l1;
344 readin.open( filename, ios_base::in );
345 if ( !readin ) cerr <<
"can not open the file again " << filename << endl;
346 for (
int j = 0; j < (
num - 1 ); j++ )
348 readin >> a >> b >> l4 >> l3 >> l2 >> l1;
355 if (
n == 1 ) SL1.push_back( tmp );
356 if (
n == 2 ) SL2.push_back( tmp );
357 if (
n == 3 ) SL3.push_back( tmp );
358 if (
n == 4 ) SL4.push_back( tmp );
359 if (
n == 5 ) SL5.push_back( tmp );
362 for (
int i = 1; i < 129; i++ )
364 std::vector<int> tmp1;
368 TString filename = TString( getenv(
"TRIGGERROOT" ) );
369 filename +=
"/data/tsf10C/TSF-SL10C-L38-C";
373 readin.open( filename, ios_base::in );
374 if ( !readin ) cerr <<
"can not open the file " << filename << endl;
375 while ( readin.good() )
377 readin >> a >> b >> l4 >> l3 >> l2 >> l1;
382 readin.open( filename, ios_base::in );
383 if ( !readin ) cerr <<
"can not open the file again " << filename << endl;
385 for (
int j = 0; j < (
num - 1 ); j++ )
387 readin >> a >> b >> l4 >> l3 >> l2 >> l1;
388 tmp1.push_back( l4 );
389 tmp1.push_back( l3 );
390 tmp1.push_back( l2 );
391 tmp1.push_back( l1 );
394 SL10.push_back( tmp1 );
398 std::vector<int> combine_size;
400 cout <<
" ***************check data file tsf: ***************** " << endl;
401 cout <<
"*--------------------------BEGIN-------------------------------*" << endl;
404 cout <<
" -------------------SL1---------------------- " << endl;
405 combine_size.clear();
406 for (
unsigned int i = 0; i < SL1.size(); i++ )
408 cout <<
"Cell ID --> " << i << endl;
409 combine_size.push_back( SL1[i].size() );
410 for (
unsigned int j = 0; j < SL1[i].size(); j++ )
412 cout << SL1[i][j] <<
" ";
413 if ( ( j + 1 ) % 4 == 0 ) cout << endl;
417 sort( combine_size.begin(), combine_size.end() );
418 cout <<
"The Max Number of Combination is " << combine_size[combine_size.size() - 1] / 4
422 cout <<
" -------------------SL2---------------------- " << endl;
423 combine_size.clear();
424 for (
unsigned int i = 0; i < SL2.size(); i++ )
426 cout <<
"Cell ID --> " << i << endl;
427 combine_size.push_back( SL2[i].size() );
428 for (
unsigned int j = 0; j < SL2[i].size(); j++ )
430 cout << SL2[i][j] <<
" ";
431 if ( ( j + 1 ) % 4 == 0 ) cout << endl;
435 sort( combine_size.begin(), combine_size.end() );
436 cout <<
"The Max Number of Combination is " << combine_size[combine_size.size() - 1] / 4
440 cout <<
" -------------------SL3---------------------- " << endl;
441 combine_size.clear();
442 for (
unsigned int i = 0; i < SL3.size(); i++ )
444 cout <<
"Cell ID --> " << i << endl;
445 combine_size.push_back( SL3[i].size() );
446 for (
unsigned int j = 0; j < SL3[i].size(); j++ )
448 cout << SL3[i][j] <<
" ";
449 if ( ( j + 1 ) % 4 == 0 ) cout << endl;
453 sort( combine_size.begin(), combine_size.end() );
454 cout <<
"The Max Number of Combination is " << combine_size[combine_size.size() - 1] / 4
458 cout <<
" -------------------SL4---------------------- " << endl;
459 combine_size.clear();
460 for (
unsigned int i = 0; i < SL4.size(); i++ )
462 cout <<
"Cell ID --> " << i << endl;
463 combine_size.push_back( SL4[i].size() );
464 for (
unsigned int j = 0; j < SL4[i].size(); j++ )
466 cout << SL4[i][j] <<
" ";
467 if ( ( j + 1 ) % 4 == 0 ) cout << endl;
471 sort( combine_size.begin(), combine_size.end() );
472 cout <<
"The Max Number of Combination is " << combine_size[combine_size.size() - 1] / 4
476 cout <<
" -------------------SL5---------------------- " << endl;
477 combine_size.clear();
478 for (
unsigned int i = 0; i < SL5.size(); i++ )
480 cout <<
"Cell ID --> " << i << endl;
481 combine_size.push_back( SL5[i].size() );
482 for (
unsigned int j = 0; j < SL5[i].size(); j++ )
484 cout << SL5[i][j] <<
" ";
485 if ( ( j + 1 ) % 4 == 0 ) cout << endl;
489 sort( combine_size.begin(), combine_size.end() );
490 cout <<
"The Max Number of Combination is " << combine_size[combine_size.size() - 1] / 4
494 cout <<
" -------------------SL10---------------------- " << endl;
495 combine_size.clear();
496 for (
unsigned int i = 0; i < SL10.size(); i++ )
498 cout <<
"Cell ID --> " << i << endl;
499 combine_size.push_back( SL10[i].size() );
500 for (
unsigned int j = 0; j < SL10[i].size(); j++ )
502 cout << SL10[i][j] <<
" ";
503 if ( ( j + 1 ) % 4 == 0 ) cout << endl;
507 sort( combine_size.begin(), combine_size.end() );
508 cout <<
"The Max Number of Combination is " << combine_size[combine_size.size() - 1] / 4
512 cout <<
"*---------------------------END------------------------------*" << endl;