CGEM BOSS 6.6.5.i
BESIII Offline Software System
Loading...
Searching...
No Matches
MrpcTrack.cxx
Go to the documentation of this file.
2#include "Identifier/TofID.h"
4// #include "TofQCorrSvc/ITofQCorrSvc.h"
5// #include "TofQElecSvc/ITofQElecSvc.h"
8#include "MrpcRec/MrpcTrack.h"
10
11#include "G4LogicalVolume.hh"
12#include "globals.hh"
13#include <G4String.hh>
14
15
16
17
18
19
21// extern ITofQCorrSvc* tofQCorrSvc;
22// extern ITofQElecSvc* tofQElecSvc;
23
25 m_trackId = -1;
26 m_tofTrackId = -1;
27 m_id1 = -99;
28 m_id2 = -99;
29 m_hitCase = NoHit;
30 m_momentum = -99.0;
31 m_path = 0.0;
32 m_path1 = 0.0;
33 m_path2 = 0.0;
34 m_zrhit1 = 9999.0;
35 m_errzr1 = 9999.0;
36 m_zrhit2 = 9999.0;
37 m_errzr2 = 9999.0;
38 for( unsigned int i=0; i<5; i++ ) {
39 m_kal[i] = -1;
40 m_zr1[i] = 9999.0;
41 m_zr2[i] = 9999.0;
42 m_ezr1[i] = 9999.0;
43 m_ezr2[i] = 9999.0;
44 }
45 if( m_tofData1.size()>0 ) {
46 std::vector<TofData*>::iterator iter1 = m_tofData1.begin();
47 m_tofData1.clear();
48 }
49 if( m_tofData2.size()>0 ) {
50 std::vector<TofData*>::iterator iter2 = m_tofData2.begin();
51 m_tofData2.clear();
52 }
53 if( m_tofData3.size()>0 ) {
54 std::vector<TofData*>::iterator iter3 = m_tofData3.begin();
55 m_tofData3.clear();
56 }
57 if( m_tofData4.size()>0 ) {
58 std::vector<TofData*>::iterator iter4 = m_tofData4.begin();
59 m_tofData4.clear();
60 }
61 m_quality1 = 0;
62 m_quality2 = 0;
63 m_quality = 10;
64
65 m_tofId1 = -99;
66 m_tofId2 = -99;
67
68 m_ph11 = -999.0;
69 m_ph12 = -999.0;
70 m_ph21 = -999.0;
71 m_ph22 = -999.0;
72 m_ph1 = -999.0;
73 m_ph2 = -999.0;
74 m_ph = -999.0;
75
76 for( unsigned int i=0; i<5; i++ ) {
77 m_tof11[i] = 0.0;
78 m_tof12[i] = 0.0;
79 m_tof21[i] = 0.0;
80 m_tof22[i] = 0.0;
81 m_tof1[i] = 0.0;
82 m_tof2[i] = 0.0;
83 m_tof[i] = 0.0;
84 m_sigma_mrpc[i]=-999.0;
85
86 }
87
88 m_sigma11 = -999.0;
89 m_sigma12 = -999.0;
90 m_sigma21 = -999.0;
91 m_sigma22 = -999.0;
92 m_sigma1 = -999.0;
93 m_sigma2 = -999.0;
94 m_sigma = -999.0;
95
96 m_qch1 = -999.0;
97 m_qch2 = -999.0;
98 m_qch3 = -999.0;
99 m_qch4 = -999.0;
100 m_adc1 = -999.0;
101 m_adc2 = -999.0;
102 m_adc3 = -999.0;
103 m_adc4 = -999.0;
104 m_tdc1 = -999.0;
105 m_tdc2 = -999.0;
106 m_tdc3 = -999.0;
107 m_tdc4 = -999.0;
108
109 for( unsigned int i=0; i<5; i++ ) {
110 m_texpInner[i] = -999.0;
111 m_texpOuter[i] = -999.0;
112 m_texp[i] = -999.0;
113 }
114
115 m_ztdc1 = -999.0;
116 m_ztdc2 = -999.0;
117 m_zadc1 = -999.0;
118 m_zadc2 = -999.0;
119
120 m_estime = -999.0;
121 m_tdiff1 = -999.0;
122 m_tdiff2 = -999.0;
123
124 mrpc_extrapolation_good=false;
125
126 m_flag = 0;
127
128 return;
129}
130
131
133 if( m_tofData1.size()>0 ) {
134 std::vector<TofData*>::iterator iter1 = m_tofData1.begin();
135 m_tofData1.clear();
136 }
137 if( m_tofData2.size()>0 ) {
138 std::vector<TofData*>::iterator iter2 = m_tofData2.begin();
139 m_tofData2.clear();
140 }
141 if( m_tofData3.size()>0 ) {
142 std::vector<TofData*>::iterator iter3 = m_tofData3.begin();
143 m_tofData3.clear();
144 }
145 if( m_tofData4.size()>0 ) {
146 std::vector<TofData*>::iterator iter4 = m_tofData4.begin();
147 m_tofData4.clear();
148 }
149 return;
150}
151
152//------- setExtTrack ----------------------------------------------
153// get information from RecExtTrackCol
154// tofId1(), tofId2(), hitCase(),
155// p(), path1(), path2(), zrhit1(), zrhit2(), errz1(), errz2()
156// quality() = 3 ( no hit )
157//
158void MrpcTrack::setExtTrack( RecExtTrack* extTrack, int kal[5], double t0, int t0Stat ) {
159
160
161
162 m_estime = t0;
163 m_t0Stat = t0Stat;
164
165 int tofId1 = extTrack->tof1VolumeNumber();
166 int tofId2 = extTrack->tof2VolumeNumber();
167
168 G4String tof1volumename = extTrack->tof1VolumeName();
169 G4String tof2volumename = extTrack->tof2VolumeName();
170
171
172 m_barrel = 7;
173 if(tof1volumename == "logical_sensitive_detector_east_1")
174 {
175 m_id1 = tofId1;
176
177 if(m_id1%25==0)
178 {
179 m_barrel = 7;
180 m_hitCase = NoHit;
181 }
182 else
183 {
184 m_barrel = 4;
185 m_hitCase = eastendcap_1;
186 }
187
188 //std::cout << "MrpcTrack m_barrel | m_id1 | m_hitCase " << m_barrel << " | " << m_id1 << " | " << m_hitCase << std::endl;
189
190 }
191 else if(tof1volumename == "logical_sensitive_detector_east_2")
192 {
193 m_id1 = tofId1;
194
195 if(m_id1%25==0)
196 {
197 m_barrel = 7;
198 m_hitCase = NoHit;
199 }
200 else
201 {
202 m_barrel = 3;
203 m_hitCase = eastendcap_2;
204 }
205 //std::cout << "MrpcTrack m_barrel | m_id1 | m_hitCase " << m_barrel << " | " << m_id1 << " | " << m_hitCase << std::endl;
206 }
207 else if(tof1volumename == "logical_sensitive_detector_west_1")
208 {
209 m_id1 = tofId1;
210
211 if(m_id1%25==0)
212 {
213 m_barrel = 7;
214 m_hitCase = NoHit;
215 }
216 else
217 {
218 m_barrel =5 ;
219 m_hitCase = westendcap_1;
220 }
221 //std::cout << "MrpcTrack m_barrel | m_id1 | m_hitCase " << m_barrel << " | " << m_id1 << " | " << m_hitCase << std::endl;
222 }
223 else if(tof1volumename == "logical_sensitive_detector_west_2")
224 {
225 m_id1 = tofId1;
226 if(m_id1%25==0)
227 {
228 m_barrel = 7;
229 m_hitCase = NoHit;
230 }
231 else
232 {
233 m_barrel =6 ;
234 m_hitCase = westendcap_2;
235 }
236 //std::cout << "MrpcTrack m_barrel | m_id1 | m_hitCase " << m_barrel << " | " << m_id1 << " | " << m_hitCase << std::endl;
237 }
238 else if( tofId1>=0 && tofId1<=87 && ( tof1volumename.contains("ScinBr") || tof1volumename.contains("ScinEc") || tof2volumename.contains("ScinBr") || tof2volumename.contains("ScinEc") ))
239 {
240 m_id1 = tofId1;
241 m_barrel = 1;
242 m_hitCase = InnerLayer;
243 //std::cout << "MrpcTrack 0<i<87 m_barrel | m_id1 | m_hitCase " << m_barrel << " | " << m_id1 << " | " << m_hitCase << std::endl;
244 }
245 else if( tofId1>=176 && tofId1<=223 && ( tof1volumename.contains("ScinBr") || tof1volumename.contains("ScinEc") || tof2volumename.contains("ScinBr") || tof2volumename.contains("ScinEc" ) ))
246 {
247 m_id1 = tofId1 - 176 + 48;
248 m_barrel = 2;
249 m_hitCase = WestEndcap;
250
251 //std::cout << "MrpcTrack setExTrck 176<i<223 m_barrel | m_id5B1 | m_hitCase " << m_barrel << " | " << m_id1 << " | " << m_hitCase << std::endl;
252 }
253 else if( tofId1>=224 && tofId1<=271 && ( tof1volumename.contains("ScinBr") || tof1volumename.contains("ScinEc") || tof2volumename.contains("ScinBr") || tof2volumename.contains("ScinEc") )) {
254 m_id1 = tofId1 - 176 - 48;
255 m_barrel = 0;
256 m_hitCase = EastEndcap;
257 //std::cout << "MrpcTrack setExTrck 224<i<271 m_barrel | m_id1 | m_hitCase " << m_barrel << " | " << m_id1 << " | " << m_hitCase << std::endl;
258 }
259 else {
260 m_barrel = 7;
261 m_hitCase = NoHit;
262 //std::cout << "MrpcTrack nohit m_barrel | m_id1 | m_hitCase " << m_barrel << " | " << m_id1 << " | " << m_hitCase << std::endl;
263 }
264
265
266 if( tofId2>=88 && tofId2<=175 && ( tof1volumename.contains("ScinBr") || tof1volumename.contains("ScinEc") || tof2volumename.contains("ScinBr") || tof2volumename.contains("ScinEc") )) {
267 m_id2 = tofId2;
268 m_barrel = 1;
269 if( m_hitCase == InnerLayer ) {
270 m_hitCase = DoubleLayer;
271 }
272 else if( m_hitCase==NoHit ) {
273 m_hitCase = OuterLayer;
274 }
275 //std::cout << "MrpcTrack 88<i<175 m_barrel | m_id1 | m_hitCase " << m_barrel << " | " << m_id1 << " | " << m_hitCase << std::endl;
276 }
277
278
279 m_trackId = extTrack->trackId();
280
281 m_momentum = extTrack->tof1Momentum().r();
282 if( m_hitCase == InnerLayer || m_hitCase == DoubleLayer ) {
283 for( unsigned int i=0; i<5; i++ ) {
284 m_texpInner[i] = extTrack->tof1(i);
285 // std::cout << "MrpcTrack setExtTrack - BR: m_texpInner[" << i<< "] " << m_texpInner[i] << std::endl;
286 }
287 m_path1 = extTrack->tof1Path();
288 m_zrhit1 = extTrack->tof1Position().z();
289 // std::cout << "MrpcTrack setExtTrack - BR: m_zrhit1 extTrack->tof1Position().rho() " << m_zrhit1 << std::endl;
290 m_errzr1 = extTrack->tof1PosSigmaAlongZ();
291 m_theta1 = extTrack->tof1Momentum().rho()/extTrack->tof1Momentum().r();
292 m_phi1 = extTrack->tof1Position().phi();
293 for( unsigned int i=0; i<5; i++ ) {
294 m_zr1[i] = extTrack->tof1Position(i).z();
295 m_ezr1[i] = extTrack->tof1PosSigmaAlongZ(i);
296 //std::cout << "MrpcTrack setExtTrack - BR: m_zr1["<<i<< "] extTrack->tof1Position(i).rho() " << m_zr1 << std::endl;
297 }
298 }
299 else if( m_hitCase == EastEndcap || m_hitCase == WestEndcap || m_hitCase == eastendcap_1 || m_hitCase == eastendcap_2 || m_hitCase == westendcap_1 || m_hitCase == westendcap_2){
300 for( unsigned int i=0; i<5; i++ ) {
301 m_texpInner[i] = extTrack->tof1(i);
302 //std::cout << "MrpcTrack setExtTrack - EC: m_texpInner[" << i<< "] " << m_texpInner[i] << std::endl;
303
304 }
305 m_path1 = extTrack->tof1Path();
306 m_zrhit1 = extTrack->tof1Position().rho();
307 //std::cout << "MrpcTrack setExtTrack - EC: m_zrhit1 extTrack->tof1Position().rho() " << m_zrhit1 << std::endl;
308 m_errzr1 = sqrt( extTrack->tof1PosSigmaAlongX()*extTrack->tof1PosSigmaAlongX() + extTrack->tof1PosSigmaAlongY()*extTrack->tof1PosSigmaAlongY() );
309 m_theta1 = extTrack->tof1Momentum().z()/extTrack->tof1Momentum().r();
310 m_phi1 = extTrack->tof1Position().phi();
311 for( unsigned int i=0; i<5; i++ ) {
312 m_zr1[i] = extTrack->tof1Position(i).rho();
313 m_ezr1[i] = sqrt( extTrack->tof1PosSigmaAlongX(i)*extTrack->tof1PosSigmaAlongX(i) + extTrack->tof1PosSigmaAlongY(i)*extTrack->tof1PosSigmaAlongY(i) );
314
315 //std::cout << "MrpcTrack setExtTrack - EC: m_zr1["<<i<< "] extTrack->tof1Position(i).rho() " << m_zr1 << std::endl;
316 }
317 }
318
319 if( m_hitCase == OuterLayer || m_hitCase == DoubleLayer ) {
320 for( unsigned int i=0; i<5; i++ ) {
321 m_texpOuter[i] = extTrack->tof2(i);
322 }
323 m_path2 = extTrack->tof2Path();
324 m_zrhit2 = extTrack->tof2Position().z();
325 m_errzr2 = extTrack->tof2PosSigmaAlongZ();
326 m_theta2 = extTrack->tof2Momentum().rho()/extTrack->tof2Momentum().r();
327 m_phi2 = extTrack->tof2Position().phi();
328 for( unsigned int i=0; i<5; i++ ) {
329 m_zr2[i] = extTrack->tof2Position(i).z();
330 m_ezr2[i] = extTrack->tof2PosSigmaAlongZ(i);
331 }
332 }
333
334 if( m_hitCase == NoHit ) { m_quality = 11; }
335
336 for( unsigned int i=0; i<5; i++ ) {
337 m_kal[i] = kal[i];
338 }
339
340 return;
341
342}
343
344
345
346//------- get Multi hit ----------------------------------------------
347// get Multi-hit of one TOF Counter
348//
350 if( m_hitCase == InnerLayer || m_hitCase == OuterLayer || m_hitCase == DoubleLayer ) {
351
352 if( ( m_hitCase==InnerLayer || m_hitCase==DoubleLayer ) && ( track->hitCase()==InnerLayer || track->hitCase()==DoubleLayer ) ) {
353 if( ( abs(m_id1-track->id1())<=1 ) || ( m_id1==0 && track->id1()==87 ) || ( m_id1==87 && track->id1()==0 ) ) {
354 track->setQuality1( ( track->quality1() | 0x400 ) );
355 m_quality1 = ( m_quality1 | 0x400 );
356 }
357 }
358
359 if( ( m_hitCase==OuterLayer || m_hitCase==DoubleLayer ) && ( track->hitCase()==OuterLayer || track->hitCase()==DoubleLayer ) ) {
360 if( ( abs(m_id2-track->id2())<=1 ) || ( m_id2==88 && track->id2()==175 ) || ( m_id2==175 && track->id2()==88 ) ) {
361 track->setQuality2( ( track->quality2() | 0x400 ) );
362 m_quality2 = ( m_quality2 | 0x400 );
363 }
364 }
365
366 }
367 else if( m_hitCase == EastEndcap ) {
368 if( track->hitCase()==EastEndcap ) {
369 if( ( abs(m_id1-track->id1())<=1 ) || ( m_id1==0 && track->id1()==47 ) || ( m_id1==47 && track->id1()==0 ) ) {
370 track->setQuality1( ( track->quality1() | 0x400 ) );
371 m_quality1 = ( m_quality1 | 0x400 );
372 }
373 }
374 }
375 else if( m_hitCase == WestEndcap ) {
376 if( track->hitCase()==WestEndcap ) {
377 if( ( abs(m_id1-track->id1())<=1 ) || ( m_id1==48 && track->id1()==95 ) || ( m_id1==95 && track->id1()==48 ) ) {
378 track->setQuality1( ( track->quality1() | 0x400 ) );
379 m_quality1 = ( m_quality1 | 0x400 );
380 }
381 }
382 }
383 else if( m_hitCase == westendcap_1 || m_hitCase == westendcap_2 || m_hitCase == eastendcap_1 || m_hitCase == eastendcap_2)
384 {
385 //We do not consider the multihits yet.(This feature was not implemented in 6.5.5) (It seems also not to affect the colected endcap data!)
386 //How to do it:
387 // Search within the (direct) neighborhood for hits
388
389 }
390
391 return;
392}
393
394
395//------- setTofData --------------------------------------------
396// do TOF hits and extrapolated track match
397// tofTrackId(), tofMod1(), tofMod2()
398// quality() = 3 ( no hit )
399//
400void MrpcTrack::setTofData( TofDataMap tofDataMap,int neighborhood ) {
401
402 if( m_hitCase == NoHit ) return;
403
404 unsigned int identify0 = 0x0000c000;
405 unsigned int identify1 = 0x0000c000;
406 unsigned int identify2 = 0x0000c000;
407 unsigned int count0 = 0;
408 unsigned int count1 = 0;
409 unsigned int count2 = 0;
410
411
412 unsigned int identify_it=0x0000c000;
413 unsigned int identify_u =0x0000c000; // upper strip
414 unsigned int identify_b =0x0000c000; // strip below
415 unsigned int identify_l =0x0000c000; // strip left
416 unsigned int identify_lu=0x0000c000; // strip left upper
417 unsigned int identify_lb=0x0000c000; // strip left below
418 unsigned int identify_r =0x0000c000; // strip right
419 unsigned int identify_ru=0x0000c000; // strip right upper
420 unsigned int identify_rb=0x0000c000; // strip right below
421 //weitere Nachbarschicht
422 unsigned int identify_luu =0x0000c000; // strip left up up
423 unsigned int identify_lbb =0x0000c000;
424 unsigned int identify_ruu =0x0000c000;
425 unsigned int identify_rbb =0x0000c000;
426 unsigned int identify_uu =0x0000c000;
427 unsigned int identify_bb =0x0000c000;
428 //weitere Nachbarschicht
429 unsigned int identify_luuu =0x0000c000; // strip left up up up
430 unsigned int identify_lbbb =0x0000c000;
431 unsigned int identify_ruuu =0x0000c000;
432 unsigned int identify_rbbb =0x0000c000;
433 unsigned int identify_uuu =0x0000c000;
434 unsigned int identify_bbb =0x0000c000;
435
436 //weitere Nachbarschicht nach links und rechts
437 unsigned int identify_luuul =0x0000c000; // strip left up up up left
438 unsigned int identify_lbbbl =0x0000c000;
439 unsigned int identify_ruuur =0x0000c000;
440 unsigned int identify_rbbbr =0x0000c000;
441 unsigned int identify_luul =0x0000c000;
442 unsigned int identify_lbbl =0x0000c000;
443 unsigned int identify_ruur =0x0000c000;
444 unsigned int identify_rbbr =0x0000c000;
445 unsigned int identify_ll =0x0000c000;
446 unsigned int identify_lul=0x0000c000;
447 unsigned int identify_lbl=0x0000c000;
448 unsigned int identify_rr =0x0000c000;
449 unsigned int identify_rur=0x0000c000;
450 unsigned int identify_rbr=0x0000c000;
451
452
453
454 unsigned int count_it =0;
455 unsigned int count_u =0; // upper strip
456 unsigned int count_b =0; // strip below
457 unsigned int count_l =0; // strip left
458 unsigned int count_lu =0; // strip left upper
459 unsigned int count_lb =0; // strip left below
460 unsigned int count_r =0; // strip right
461 unsigned int count_ru =0; // strip right upper
462 unsigned int count_rb =0; // strip right below
463
464 //weitere Nachbarschicht (if=2)
465 unsigned int count_luu =0;
466 unsigned int count_lbb =0;
467 unsigned int count_ruu =0;
468 unsigned int count_rbb =0;
469 unsigned int count_uu =0;
470 unsigned int count_bb =0;
471
472 //weitere Nachbarschicht (if=3)
473 unsigned int count_luuu =0;
474 unsigned int count_lbbb =0;
475 unsigned int count_ruuu =0;
476 unsigned int count_rbbb =0;
477 unsigned int count_uuu =0;
478 unsigned int count_bbb =0;
479
480 //erweitere weitere Nachbarschicht nach links und rechts um eine weitere (if=4)
481 unsigned int count_luuul =0;
482 unsigned int count_lbbbl =0;
483 unsigned int count_ruuur =0;
484 unsigned int count_rbbbr =0;
485 unsigned int count_luul =0;
486 unsigned int count_lbbl =0;
487 unsigned int count_ruur =0;
488 unsigned int count_rbbr =0;
489 unsigned int count_ll =0;
490 unsigned int count_lul =0;
491 unsigned int count_lbl =0;
492 unsigned int count_rr =0;
493 unsigned int count_rur =0;
494 unsigned int count_rbr =0;
495
496
497 //The neighboorhood are all upper and lower strips at the left and at the right side (if=5)
498 // ^^^
499 // - - -
500 // - - -
501 // - - -
502 // - - -
503 // vvv
504
505
506 unsigned int identify_if5_it=0x0000c000;
507 unsigned int identify_if5_m1=0x0000c000;
508 unsigned int identify_if5_m2=0x0000c000;
509 unsigned int identify_if5_m3=0x0000c000;
510 unsigned int identify_if5_m4=0x0000c000;
511 unsigned int identify_if5_m5=0x0000c000;
512 unsigned int identify_if5_m6=0x0000c000;
513 unsigned int identify_if5_m7=0x0000c000;
514 unsigned int identify_if5_m8=0x0000c000;
515 unsigned int identify_if5_m9=0x0000c000;
516 unsigned int identify_if5_m10=0x0000c000;
517 unsigned int identify_if5_m11=0x0000c000;
518 unsigned int identify_if5_m12=0x0000c000;
519 unsigned int identify_if5_l1=0x0000c000;
520 unsigned int identify_if5_l2=0x0000c000;
521 unsigned int identify_if5_l3=0x0000c000;
522 unsigned int identify_if5_l4=0x0000c000;
523 unsigned int identify_if5_l5=0x0000c000;
524 unsigned int identify_if5_l6=0x0000c000;
525 unsigned int identify_if5_l7=0x0000c000;
526 unsigned int identify_if5_l8=0x0000c000;
527 unsigned int identify_if5_l9=0x0000c000;
528 unsigned int identify_if5_l10=0x0000c000;
529 unsigned int identify_if5_l11=0x0000c000;
530 unsigned int identify_if5_l12=0x0000c000;
531 unsigned int identify_if5_r1=0x0000c000;
532 unsigned int identify_if5_r2=0x0000c000;
533 unsigned int identify_if5_r3=0x0000c000;
534 unsigned int identify_if5_r4=0x0000c000;
535 unsigned int identify_if5_r5=0x0000c000;
536 unsigned int identify_if5_r6=0x0000c000;
537 unsigned int identify_if5_r7=0x0000c000;
538 unsigned int identify_if5_r8=0x0000c000;
539 unsigned int identify_if5_r9=0x0000c000;
540 unsigned int identify_if5_r10=0x0000c000;
541 unsigned int identify_if5_r11=0x0000c000;
542 unsigned int identify_if5_r12=0x0000c000;
543 unsigned int count_if5_m1=0;
544 unsigned int count_if5_m2=0;
545 unsigned int count_if5_m3=0;
546 unsigned int count_if5_m4=0;
547 unsigned int count_if5_m5=0;
548 unsigned int count_if5_m6=0;
549 unsigned int count_if5_m7=0;
550 unsigned int count_if5_m8=0;
551 unsigned int count_if5_m9=0;
552 unsigned int count_if5_m10=0;
553 unsigned int count_if5_m11=0;
554 unsigned int count_if5_m12=0;
555 unsigned int count_if5_l1=0;
556 unsigned int count_if5_l2=0;
557 unsigned int count_if5_l3=0;
558 unsigned int count_if5_l4=0;
559 unsigned int count_if5_l5=0;
560 unsigned int count_if5_l6=0;
561 unsigned int count_if5_l7=0;
562 unsigned int count_if5_l8=0;
563 unsigned int count_if5_l9=0;
564 unsigned int count_if5_l10=0;
565 unsigned int count_if5_l11=0;
566 unsigned int count_if5_l12=0;
567 unsigned int count_if5_r1=0;
568 unsigned int count_if5_r2=0;
569 unsigned int count_if5_r3=0;
570 unsigned int count_if5_r4=0;
571 unsigned int count_if5_r5=0;
572 unsigned int count_if5_r6=0;
573 unsigned int count_if5_r7=0;
574 unsigned int count_if5_r8=0;
575 unsigned int count_if5_r9=0;
576 unsigned int count_if5_r10=0;
577 unsigned int count_if5_r11=0;
578 unsigned int count_if5_r12=0;
579
580 //The neighboorhood are all upper and lower strips at the left and at the right side and as well the left and right side of these (if=6)
581 // ^^^
582 // - - - - -
583 // - - - - -
584 // - - - - -
585 // - - - - -
586 // vvv
587
588
589 unsigned int identify_if6_it=0x0000c000;
590 unsigned int identify_if6_m1=0x0000c000;
591 unsigned int identify_if6_m2=0x0000c000;
592 unsigned int identify_if6_m3=0x0000c000;
593 unsigned int identify_if6_m4=0x0000c000;
594 unsigned int identify_if6_m5=0x0000c000;
595 unsigned int identify_if6_m6=0x0000c000;
596 unsigned int identify_if6_m7=0x0000c000;
597 unsigned int identify_if6_m8=0x0000c000;
598 unsigned int identify_if6_m9=0x0000c000;
599 unsigned int identify_if6_m10=0x0000c000;
600 unsigned int identify_if6_m11=0x0000c000;
601 unsigned int identify_if6_m12=0x0000c000;
602 unsigned int identify_if6_l1=0x0000c000;
603 unsigned int identify_if6_l2=0x0000c000;
604 unsigned int identify_if6_l3=0x0000c000;
605 unsigned int identify_if6_l4=0x0000c000;
606 unsigned int identify_if6_l5=0x0000c000;
607 unsigned int identify_if6_l6=0x0000c000;
608 unsigned int identify_if6_l7=0x0000c000;
609 unsigned int identify_if6_l8=0x0000c000;
610 unsigned int identify_if6_l9=0x0000c000;
611 unsigned int identify_if6_l10=0x0000c000;
612 unsigned int identify_if6_l11=0x0000c000;
613 unsigned int identify_if6_l12=0x0000c000;
614 unsigned int identify_if6_r1=0x0000c000;
615 unsigned int identify_if6_r2=0x0000c000;
616 unsigned int identify_if6_r3=0x0000c000;
617 unsigned int identify_if6_r4=0x0000c000;
618 unsigned int identify_if6_r5=0x0000c000;
619 unsigned int identify_if6_r6=0x0000c000;
620 unsigned int identify_if6_r7=0x0000c000;
621 unsigned int identify_if6_r8=0x0000c000;
622 unsigned int identify_if6_r9=0x0000c000;
623 unsigned int identify_if6_r10=0x0000c000;
624 unsigned int identify_if6_r11=0x0000c000;
625 unsigned int identify_if6_r12=0x0000c000;
626 unsigned int identify_if6_ll1=0x0000c000;
627 unsigned int identify_if6_ll2=0x0000c000;
628 unsigned int identify_if6_ll3=0x0000c000;
629 unsigned int identify_if6_ll4=0x0000c000;
630 unsigned int identify_if6_ll5=0x0000c000;
631 unsigned int identify_if6_ll6=0x0000c000;
632 unsigned int identify_if6_ll7=0x0000c000;
633 unsigned int identify_if6_ll8=0x0000c000;
634 unsigned int identify_if6_ll9=0x0000c000;
635 unsigned int identify_if6_ll10=0x0000c000;
636 unsigned int identify_if6_ll11=0x0000c000;
637 unsigned int identify_if6_ll12=0x0000c000;
638 unsigned int identify_if6_rr1=0x0000c000;
639 unsigned int identify_if6_rr2=0x0000c000;
640 unsigned int identify_if6_rr3=0x0000c000;
641 unsigned int identify_if6_rr4=0x0000c000;
642 unsigned int identify_if6_rr5=0x0000c000;
643 unsigned int identify_if6_rr6=0x0000c000;
644 unsigned int identify_if6_rr7=0x0000c000;
645 unsigned int identify_if6_rr8=0x0000c000;
646 unsigned int identify_if6_rr9=0x0000c000;
647 unsigned int identify_if6_rr10=0x0000c000;
648 unsigned int identify_if6_rr11=0x0000c000;
649 unsigned int identify_if6_rr12=0x0000c000;
650 unsigned int count_if6_m1=0;
651 unsigned int count_if6_m2=0;
652 unsigned int count_if6_m3=0;
653 unsigned int count_if6_m4=0;
654 unsigned int count_if6_m5=0;
655 unsigned int count_if6_m6=0;
656 unsigned int count_if6_m7=0;
657 unsigned int count_if6_m8=0;
658 unsigned int count_if6_m9=0;
659 unsigned int count_if6_m10=0;
660 unsigned int count_if6_m11=0;
661 unsigned int count_if6_m12=0;
662 unsigned int count_if6_l1=0;
663 unsigned int count_if6_l2=0;
664 unsigned int count_if6_l3=0;
665 unsigned int count_if6_l4=0;
666 unsigned int count_if6_l5=0;
667 unsigned int count_if6_l6=0;
668 unsigned int count_if6_l7=0;
669 unsigned int count_if6_l8=0;
670 unsigned int count_if6_l9=0;
671 unsigned int count_if6_l10=0;
672 unsigned int count_if6_l11=0;
673 unsigned int count_if6_l12=0;
674 unsigned int count_if6_r1=0;
675 unsigned int count_if6_r2=0;
676 unsigned int count_if6_r3=0;
677 unsigned int count_if6_r4=0;
678 unsigned int count_if6_r5=0;
679 unsigned int count_if6_r6=0;
680 unsigned int count_if6_r7=0;
681 unsigned int count_if6_r8=0;
682 unsigned int count_if6_r9=0;
683 unsigned int count_if6_r10=0;
684 unsigned int count_if6_r11=0;
685 unsigned int count_if6_r12=0;
686 unsigned int count_if6_ll1=0;
687 unsigned int count_if6_ll2=0;
688 unsigned int count_if6_ll3=0;
689 unsigned int count_if6_ll4=0;
690 unsigned int count_if6_ll5=0;
691 unsigned int count_if6_ll6=0;
692 unsigned int count_if6_ll7=0;
693 unsigned int count_if6_ll8=0;
694 unsigned int count_if6_ll9=0;
695 unsigned int count_if6_ll10=0;
696 unsigned int count_if6_ll11=0;
697 unsigned int count_if6_ll12=0;
698 unsigned int count_if6_rr1=0;
699 unsigned int count_if6_rr2=0;
700 unsigned int count_if6_rr3=0;
701 unsigned int count_if6_rr4=0;
702 unsigned int count_if6_rr5=0;
703 unsigned int count_if6_rr6=0;
704 unsigned int count_if6_rr7=0;
705 unsigned int count_if6_rr8=0;
706 unsigned int count_if6_rr9=0;
707 unsigned int count_if6_rr10=0;
708 unsigned int count_if6_rr11=0;
709 unsigned int count_if6_rr12=0;
710
711 if( ((m_hitCase==eastendcap_1) || (m_hitCase==eastendcap_2) || (m_hitCase==westendcap_1) || (m_hitCase==westendcap_2)) && (m_id1 > 25))
712 {
713 int tofid_it = m_id1; //This is my stripidentifier
714
715 int this_partID=0;
716 if((m_hitCase==eastendcap_1)) this_partID=4;
717 if((m_hitCase==eastendcap_2)) this_partID=3;
718 if((m_hitCase==westendcap_1)) this_partID=5;
719 if((m_hitCase==westendcap_2)) this_partID=6;
720
721
722
723 if(this_partID==0){ cout <<"MRPCREC --- MrpcTrack --- Fatal Error: PartID is not existing ---> " << this_partID << endl;return; }
724
725 identify_it = TofID::getIntID_mrpc(this_partID,tofid_it); //Get the whole identifier for the MRPC cell
726 count_it = tofDataMap.count( identify_it );
727
728
729
730
731
732 //Get ID and part ID from neighbours
733 int tofid_l = get_mrpc_stripid_neighbour("l",tofid_it,this_partID);
734 int partid_l = get_mrpc_partid_neighbour("l",tofid_it,this_partID);
735 int tofid_r = get_mrpc_stripid_neighbour("r",tofid_it,this_partID);
736 int partid_r = get_mrpc_partid_neighbour("r",tofid_it,this_partID);
737 int tofid_u = get_mrpc_stripid_neighbour("u",tofid_it,this_partID);
738 int partid_u = get_mrpc_partid_neighbour("u",tofid_it,this_partID);
739 int tofid_b = get_mrpc_stripid_neighbour("b",tofid_it,this_partID);
740 int partid_b = get_mrpc_partid_neighbour("b",tofid_it,this_partID);
741 //Now from neighbours where we need two operation
742 int tofid_lu = get_mrpc_stripid_neighbour("u",tofid_l,partid_l);
743 int partid_lu = get_mrpc_partid_neighbour("u",tofid_l,partid_l);
744 int tofid_lb = get_mrpc_stripid_neighbour("b",tofid_l,partid_l);
745 int partid_lb = get_mrpc_partid_neighbour("b",tofid_l,partid_l);
746 int tofid_ru = get_mrpc_stripid_neighbour("u",tofid_r,partid_r);
747 int partid_ru = get_mrpc_partid_neighbour("u",tofid_r,partid_r);
748 int tofid_rb = get_mrpc_stripid_neighbour("b",tofid_r,partid_r);
749 int partid_rb = get_mrpc_partid_neighbour("b",tofid_r,partid_r);
750
751 // Now one additional neighbourlayer up and down but not left and right
752 int tofid_luu = get_mrpc_stripid_neighbour("u",tofid_lu,partid_lu);
753 int partid_luu = get_mrpc_partid_neighbour("u",tofid_lu,partid_lu);
754 int tofid_lbb = get_mrpc_stripid_neighbour("b",tofid_lb,partid_lb);
755 int partid_lbb = get_mrpc_partid_neighbour("b",tofid_lb,partid_lb);
756 int tofid_ruu = get_mrpc_stripid_neighbour("u",tofid_ru,partid_ru);
757 int partid_ruu = get_mrpc_partid_neighbour("u",tofid_ru,partid_ru);
758 int tofid_rbb = get_mrpc_stripid_neighbour("b",tofid_rb,partid_rb);
759 int partid_rbb = get_mrpc_partid_neighbour("b",tofid_rb,partid_rb);
760 int tofid_uu = get_mrpc_stripid_neighbour("u",tofid_u,partid_u);
761 int partid_uu = get_mrpc_partid_neighbour("u",tofid_u,partid_u);
762 int tofid_bb = get_mrpc_stripid_neighbour("b",tofid_b,partid_b);
763 int partid_bb = get_mrpc_partid_neighbour("b",tofid_b,partid_b);
764
765 // And again an layer up and down!
766 int tofid_luuu = get_mrpc_stripid_neighbour("u",tofid_luu,partid_luu);
767 int partid_luuu = get_mrpc_partid_neighbour("u",tofid_luu,partid_luu);
768 int tofid_lbbb = get_mrpc_stripid_neighbour("b",tofid_lbb,partid_lbb);
769 int partid_lbbb = get_mrpc_partid_neighbour("b",tofid_lbb,partid_lbb);
770 int tofid_ruuu = get_mrpc_stripid_neighbour("u",tofid_ruu,partid_ruu);
771 int partid_ruuu = get_mrpc_partid_neighbour("u",tofid_ruu,partid_ruu);
772 int tofid_rbbb = get_mrpc_stripid_neighbour("b",tofid_rbb,partid_rbb);
773 int partid_rbbb = get_mrpc_partid_neighbour("b",tofid_rbb,partid_rbb);
774 int tofid_uuu = get_mrpc_stripid_neighbour("u",tofid_uu,partid_uu);
775 int partid_uuu = get_mrpc_partid_neighbour("u",tofid_uu,partid_uu);
776 int tofid_bbb = get_mrpc_stripid_neighbour("b",tofid_bb,partid_bb);
777 int partid_bbb = get_mrpc_partid_neighbour("b",tofid_bb,partid_bb);
778
779
780
781
782 //And again an layer to the left and to the right
783 int tofid_luuul = get_mrpc_stripid_neighbour("l",tofid_luuu,partid_luuu);
784 int partid_luuul = get_mrpc_partid_neighbour("l",tofid_luuu,partid_luuu);
785 int tofid_lbbbl = get_mrpc_stripid_neighbour("l",tofid_lbbb,partid_lbbb);
786 int partid_lbbbl = get_mrpc_partid_neighbour("l",tofid_lbbb,partid_lbbb);
787 int tofid_ruuur = get_mrpc_stripid_neighbour("r",tofid_ruuu,partid_ruuu);
788 int partid_ruuur = get_mrpc_partid_neighbour("r",tofid_ruuu,partid_ruuu);
789 int tofid_rbbbr = get_mrpc_stripid_neighbour("r",tofid_rbbb,partid_rbbb);
790 int partid_rbbbr = get_mrpc_partid_neighbour("r",tofid_rbbb,partid_rbbb);
791 int tofid_luul = get_mrpc_stripid_neighbour("l",tofid_luu,partid_luu);
792 int partid_luul = get_mrpc_partid_neighbour("l",tofid_luu,partid_luu);
793 int tofid_lbbl = get_mrpc_stripid_neighbour("l",tofid_lbb,partid_lbb);
794 int partid_lbbl = get_mrpc_partid_neighbour("l",tofid_lbb,partid_lbb);
795 int tofid_ruur = get_mrpc_stripid_neighbour("r",tofid_ruu,partid_ruu);
796 int partid_ruur = get_mrpc_partid_neighbour("r",tofid_ruu,partid_ruu);
797 int tofid_rbbr = get_mrpc_stripid_neighbour("r",tofid_rbb,partid_rbb);
798 int partid_rbbr = get_mrpc_partid_neighbour("r",tofid_rbb,partid_rbb);
799 int tofid_lul = get_mrpc_stripid_neighbour("l",tofid_lu,partid_lu);
800 int partid_lul = get_mrpc_partid_neighbour("l",tofid_lu,partid_lu);
801 int tofid_lbl = get_mrpc_stripid_neighbour("l",tofid_lb,partid_lb);
802 int partid_lbl = get_mrpc_partid_neighbour("l",tofid_lb,partid_lb);
803 int tofid_rur = get_mrpc_stripid_neighbour("r",tofid_ru,partid_ru);
804 int partid_rur = get_mrpc_partid_neighbour("r",tofid_ru,partid_ru);
805 int tofid_rbr = get_mrpc_stripid_neighbour("r",tofid_rb,partid_rb);
806 int partid_rbr = get_mrpc_partid_neighbour("r",tofid_rb,partid_rb);
807 int tofid_ll = get_mrpc_stripid_neighbour("l",tofid_l,partid_l);
808 int partid_ll = get_mrpc_partid_neighbour("l",tofid_l,partid_l);
809 int tofid_rr = get_mrpc_stripid_neighbour("r",tofid_r,partid_r);
810 int partid_rr = get_mrpc_partid_neighbour("r",tofid_r,partid_r);
811
812
813
814
815 //Get the identifier and search the datamap for those identifier
816 if( (neighborhood==1) || (neighborhood==2) || (neighborhood==3) || (neighborhood==4) )
817 {
818 identify_l = TofID::getIntID_mrpc(partid_l,tofid_l);
819 count_l = tofDataMap.count(identify_l );
820 identify_r = TofID::getIntID_mrpc(partid_r,tofid_r);
821 count_r = tofDataMap.count(identify_r);
822 identify_u = TofID::getIntID_mrpc(partid_u,tofid_u);
823 count_u = tofDataMap.count(identify_u);
824 identify_b = TofID::getIntID_mrpc(partid_b,tofid_b);
825 count_b = tofDataMap.count(identify_b);
826 identify_lu = TofID::getIntID_mrpc(partid_lu,tofid_lu);
827 count_lu = tofDataMap.count(identify_lu);
828 identify_lb = TofID::getIntID_mrpc(partid_lb,tofid_lb);
829 count_lb = tofDataMap.count(identify_lb);
830 identify_ru = TofID::getIntID_mrpc(partid_ru,tofid_ru);
831 count_ru = tofDataMap.count(identify_ru);
832 identify_rb = TofID::getIntID_mrpc(partid_rb,tofid_rb);
833 count_rb = tofDataMap.count(identify_rb);
834 }
835
836
837 if( (neighborhood==2) || (neighborhood==3) || (neighborhood==4) )
838 {
839 //std::cout << "Neighborhood is 2or 3 or 4" << std::endl;
840
841 identify_luu = TofID::getIntID_mrpc(partid_luu,tofid_luu);
842 count_luu = tofDataMap.count(identify_luu );
843 identify_ruu = TofID::getIntID_mrpc(partid_ruu,tofid_ruu);
844 count_ruu = tofDataMap.count(identify_ruu);
845 identify_uu = TofID::getIntID_mrpc(partid_uu,tofid_uu);
846 count_uu = tofDataMap.count(identify_uu);
847 identify_bb = TofID::getIntID_mrpc(partid_bb,tofid_bb);
848 count_bb = tofDataMap.count(identify_bb);
849 identify_lbb = TofID::getIntID_mrpc(partid_lbb,tofid_lbb);
850 count_lbb = tofDataMap.count(identify_lbb);
851 identify_rbb = TofID::getIntID_mrpc(partid_rbb,tofid_rbb);
852 count_rbb = tofDataMap.count(identify_rbb);
853
854 }
855
856 if((neighborhood==3) || (neighborhood==4))
857 {
858
859 //std::cout << "Neighborhood is 3 or 4" << std::endl;
860 identify_luuu = TofID::getIntID_mrpc(partid_luuu,tofid_luuu);
861 count_luuu = tofDataMap.count(identify_luuu );
862 identify_ruuu = TofID::getIntID_mrpc(partid_ruuu,tofid_ruuu);
863 count_ruuu = tofDataMap.count(identify_ruuu);
864 identify_uuu = TofID::getIntID_mrpc(partid_uuu,tofid_uuu);
865 count_uuu = tofDataMap.count(identify_uuu);
866 identify_bbb = TofID::getIntID_mrpc(partid_bbb,tofid_bbb);
867 count_bbb = tofDataMap.count(identify_bbb);
868 identify_lbbb = TofID::getIntID_mrpc(partid_lbbb,tofid_lbbb);
869 count_lbbb = tofDataMap.count(identify_lbbb);
870 identify_rbbb = TofID::getIntID_mrpc(partid_rbbb,tofid_rbbb);
871 count_rbbb = tofDataMap.count(identify_rbbb);
872
873 }
874
875
876 if((neighborhood==4))
877 {
878
879 identify_luuul = TofID::getIntID_mrpc(partid_luuul,tofid_luuul);
880 count_luuul = tofDataMap.count(identify_luuul );
881 identify_ruuur = TofID::getIntID_mrpc(partid_ruuur,tofid_ruuur);
882 count_ruuur = tofDataMap.count(identify_ruuur);
883 identify_lbbbl = TofID::getIntID_mrpc(partid_lbbbl,tofid_lbbbl);
884 count_lbbbl = tofDataMap.count(identify_lbbbl);
885 identify_rbbbr = TofID::getIntID_mrpc(partid_rbbbr,tofid_rbbbr);
886 count_rbbbr = tofDataMap.count(identify_rbbbr);
887
888 identify_luul = TofID::getIntID_mrpc(partid_luul,tofid_luul);
889 count_luul = tofDataMap.count(identify_luul );
890 identify_ruur = TofID::getIntID_mrpc(partid_ruur,tofid_ruur);
891 count_ruur = tofDataMap.count(identify_ruur);
892 identify_lbbl = TofID::getIntID_mrpc(partid_lbbl,tofid_lbbl);
893 count_lbbl = tofDataMap.count(identify_lbbl);
894 identify_rbbr = TofID::getIntID_mrpc(partid_rbbr,tofid_rbbr);
895 count_rbbr = tofDataMap.count(identify_rbbr);
896
897 identify_ll = TofID::getIntID_mrpc(partid_ll,tofid_ll);
898 count_ll = tofDataMap.count(identify_ll );
899 identify_rr = TofID::getIntID_mrpc(partid_rr,tofid_rr);
900 count_rr = tofDataMap.count(identify_rr);
901 identify_lul = TofID::getIntID_mrpc(partid_lul,tofid_lul);
902 count_lul = tofDataMap.count(identify_lul);
903 identify_lbl = TofID::getIntID_mrpc(partid_lbl,tofid_lbl);
904 count_lbl = tofDataMap.count(identify_lbl);
905 identify_rur = TofID::getIntID_mrpc(partid_rur,tofid_rur);
906 count_rur = tofDataMap.count(identify_rur);
907 identify_rbr = TofID::getIntID_mrpc(partid_rbr,tofid_rbr);
908 count_rbr = tofDataMap.count(identify_rbr);
909 }
910
911
912
913 //if=5
914 if((neighborhood==5))
915 {
916
919
920 if((strip_number_if5)%2==0)
921 {
922 identify_if5_it=TofID::getIntID_mrpc(this_partID, BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if5,strip_number_if5));
923
924 identify_if5_m1=TofID::getIntID_mrpc(this_partID, BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if5,2));
925 identify_if5_m2=TofID::getIntID_mrpc(this_partID, BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if5,4));
926 identify_if5_m3=TofID::getIntID_mrpc(this_partID, BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if5,6));
927 identify_if5_m4=TofID::getIntID_mrpc(this_partID, BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if5,8));
928 identify_if5_m5=TofID::getIntID_mrpc(this_partID, BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if5,10));
929 identify_if5_m6=TofID::getIntID_mrpc(this_partID, BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if5,12));
930 identify_if5_m7=TofID::getIntID_mrpc(this_partID, BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if5,14));
931 identify_if5_m8=TofID::getIntID_mrpc(this_partID, BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if5,16));
932 identify_if5_m9=TofID::getIntID_mrpc(this_partID, BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if5,18));
933 identify_if5_m10=TofID::getIntID_mrpc(this_partID, BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if5,20));
934 identify_if5_m11=TofID::getIntID_mrpc(this_partID, BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if5,22));
935 identify_if5_m12=TofID::getIntID_mrpc(this_partID, BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if5,24));
936
937
938 if(identify_it!=identify_if5_m1 )count_if5_m1=tofDataMap.count(identify_if5_m1);
939 if(identify_it!=identify_if5_m2 )count_if5_m2=tofDataMap.count(identify_if5_m2);
940 if(identify_it!=identify_if5_m3 )count_if5_m3=tofDataMap.count(identify_if5_m3);
941 if(identify_it!=identify_if5_m4 )count_if5_m4=tofDataMap.count(identify_if5_m4);
942 if(identify_it!=identify_if5_m5 )count_if5_m5=tofDataMap.count(identify_if5_m5);
943 if(identify_it!=identify_if5_m6 )count_if5_m6=tofDataMap.count(identify_if5_m6);
944 if(identify_it!=identify_if5_m7 )count_if5_m7=tofDataMap.count(identify_if5_m7);
945 if(identify_it!=identify_if5_m8 )count_if5_m8=tofDataMap.count(identify_if5_m8);
946 if(identify_it!=identify_if5_m9 )count_if5_m9=tofDataMap.count(identify_if5_m9);
947 if(identify_it!=identify_if5_m10 )count_if5_m10=tofDataMap.count(identify_if5_m10);
948 if(identify_it!=identify_if5_m11 )count_if5_m11=tofDataMap.count(identify_if5_m11);
949 if(identify_it!=identify_if5_m12 )count_if5_m12=tofDataMap.count(identify_if5_m12);
950
951 int help1 =BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if5,2);
952 identify_if5_l1=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("l",help1,this_partID), get_mrpc_stripid_neighbour("l",help1,this_partID));
953 int help2 = BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if5,4);
954 identify_if5_l2=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("l",help2,this_partID), get_mrpc_stripid_neighbour("l",help2,this_partID));
955 int help3 = BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if5,6);
956 identify_if5_l3=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("l",help3,this_partID), get_mrpc_stripid_neighbour("l",help3,this_partID));
957 int help4 = BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if5,8);
958 identify_if5_l4=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("l",help4,this_partID), get_mrpc_stripid_neighbour("l",help4,this_partID));
959 int help5 = BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if5,10);
960 identify_if5_l5=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("l",help5,this_partID), get_mrpc_stripid_neighbour("l",help5,this_partID));
961 int help6 = BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if5,12);
962 identify_if5_l6=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("l",help6,this_partID), get_mrpc_stripid_neighbour("l",help6,this_partID));
963 int help7 = BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if5,14);
964 identify_if5_l7=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("l",help7,this_partID), get_mrpc_stripid_neighbour("l",help7,this_partID));
965 int help8 = BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if5,16);
966 identify_if5_l8=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("l",help8,this_partID), get_mrpc_stripid_neighbour("l",help8,this_partID));
967 int help9 = BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if5,18);
968 identify_if5_l9=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("l",help9,this_partID), get_mrpc_stripid_neighbour("l",help9,this_partID));
969 int help10 = BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if5,20);
970 identify_if5_l10=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("l",help10,this_partID), get_mrpc_stripid_neighbour("l",help10,this_partID));
971 int help11 = BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if5,22);
972 identify_if5_l11=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("l",help11,this_partID), get_mrpc_stripid_neighbour("l",help11,this_partID));
973 int help12 = BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if5,24);
974 identify_if5_l12=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("l",help12,this_partID), get_mrpc_stripid_neighbour("l",help12,this_partID));
975
976 identify_if5_r1=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("r",help1,this_partID), get_mrpc_stripid_neighbour("r",help1,this_partID));
977 identify_if5_r2=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("r",help2,this_partID), get_mrpc_stripid_neighbour("r",help2,this_partID));
978 identify_if5_r3=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("r",help3,this_partID), get_mrpc_stripid_neighbour("r",help3,this_partID));
979 identify_if5_r4=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("r",help4,this_partID), get_mrpc_stripid_neighbour("r",help4,this_partID));
980 identify_if5_r5=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("r",help5,this_partID), get_mrpc_stripid_neighbour("r",help5,this_partID));
981 identify_if5_r6=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("r",help6,this_partID), get_mrpc_stripid_neighbour("r",help6,this_partID));
982 identify_if5_r7=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("r",help7,this_partID), get_mrpc_stripid_neighbour("r",help7,this_partID));
983 identify_if5_r8=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("r",help8,this_partID), get_mrpc_stripid_neighbour("r",help8,this_partID));
984 identify_if5_r9=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("r",help9,this_partID), get_mrpc_stripid_neighbour("r",help9,this_partID));
985 identify_if5_r10=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("r",help10,this_partID), get_mrpc_stripid_neighbour("r",help10,this_partID));
986 identify_if5_r11=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("r",help11,this_partID), get_mrpc_stripid_neighbour("r",help11,this_partID));
987 identify_if5_r12=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("r",help12,this_partID), get_mrpc_stripid_neighbour("r",help12,this_partID));
988
989
990 count_if5_l1=tofDataMap.count(identify_if5_l1);
991 count_if5_l2=tofDataMap.count(identify_if5_l2);
992 count_if5_l3=tofDataMap.count(identify_if5_l3);
993 count_if5_l4=tofDataMap.count(identify_if5_l4);
994 count_if5_l5=tofDataMap.count(identify_if5_l5);
995 count_if5_l6=tofDataMap.count(identify_if5_l6);
996 count_if5_l7=tofDataMap.count(identify_if5_l7);
997 count_if5_l8=tofDataMap.count(identify_if5_l8);
998 count_if5_l9=tofDataMap.count(identify_if5_l9);
999 count_if5_l10=tofDataMap.count(identify_if5_l10);
1000 count_if5_l11=tofDataMap.count(identify_if5_l11);
1001 count_if5_l12=tofDataMap.count(identify_if5_l12);
1002 count_if5_r1=tofDataMap.count(identify_if5_r1);
1003 count_if5_r2=tofDataMap.count(identify_if5_r2);
1004 count_if5_r3=tofDataMap.count(identify_if5_r3);
1005 count_if5_r4=tofDataMap.count(identify_if5_r4);
1006 count_if5_r5=tofDataMap.count(identify_if5_r5);
1007 count_if5_r6=tofDataMap.count(identify_if5_r6);
1008 count_if5_r7=tofDataMap.count(identify_if5_r7);
1009 count_if5_r8=tofDataMap.count(identify_if5_r8);
1010 count_if5_r9=tofDataMap.count(identify_if5_r9);
1011 count_if5_r10=tofDataMap.count(identify_if5_r10);
1012 count_if5_r11=tofDataMap.count(identify_if5_r11);
1013 count_if5_r12=tofDataMap.count(identify_if5_r12);
1014 /*
1015 cout << "Partid = 4"<< endl;
1016 cout << "it " <<BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if5,strip_number_if5)<<endl;
1017 cout << "row it " <<BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if5,2) << endl;
1018 cout << "row it " <<BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if5,4) << endl;
1019 cout << "row it " <<BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if5,6) << endl;
1020 cout << "row it " <<BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if5,8) << endl;
1021 cout << "row it " <<BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if5,10) << endl;
1022 cout << "row it " <<BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if5,12) << endl;
1023 cout << "row it " <<BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if5,14) << endl;
1024 cout << "row it " <<BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if5,16) << endl;
1025 cout << "row it " <<BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if5,18) << endl;
1026 cout << "row it " <<BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if5,20) << endl;
1027 cout << "row it " <<BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if5,22) << endl;
1028 cout << "row it " <<BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if5,24) << endl;
1029 cout << "row ri " <<get_mrpc_stripid_neighbour("r",help1,this_partID) << endl;
1030 cout << "row ri " <<get_mrpc_stripid_neighbour("r",help2,this_partID) << endl;
1031 cout << "row ri " <<get_mrpc_stripid_neighbour("r",help3,this_partID) << endl;
1032 cout << "row ri " <<get_mrpc_stripid_neighbour("r",help4,this_partID) << endl;
1033 cout << "row ri " <<get_mrpc_stripid_neighbour("r",help5,this_partID) << endl;
1034 cout << "row ri " <<get_mrpc_stripid_neighbour("r",help6,this_partID) << endl;
1035 cout << "row ri " <<get_mrpc_stripid_neighbour("r",help7,this_partID) << endl;
1036 cout << "row ri " <<get_mrpc_stripid_neighbour("r",help8,this_partID) << endl;
1037 cout << "row ri " <<get_mrpc_stripid_neighbour("r",help9,this_partID) << endl;
1038 cout << "row ri " <<get_mrpc_stripid_neighbour("r",help10,this_partID) << endl;
1039 cout << "row ri " <<get_mrpc_stripid_neighbour("r",help11,this_partID) << endl;
1040 cout << "row ri " <<get_mrpc_stripid_neighbour("r",help12,this_partID) << endl;
1041 cout << "row le " <<get_mrpc_stripid_neighbour("l",help1,this_partID) << endl;
1042 cout << "row le " <<get_mrpc_stripid_neighbour("l",help2,this_partID) << endl;
1043 cout << "row le " <<get_mrpc_stripid_neighbour("l",help3,this_partID) << endl;
1044 cout << "row le " <<get_mrpc_stripid_neighbour("l",help4,this_partID) << endl;
1045 cout << "row le " <<get_mrpc_stripid_neighbour("l",help5,this_partID) << endl;
1046 cout << "row le " <<get_mrpc_stripid_neighbour("l",help6,this_partID) << endl;
1047 cout << "row le " <<get_mrpc_stripid_neighbour("l",help7,this_partID) << endl;
1048 cout << "row le " <<get_mrpc_stripid_neighbour("l",help8,this_partID) << endl;
1049 cout << "row le " <<get_mrpc_stripid_neighbour("l",help9,this_partID) << endl;
1050 cout << "row le " <<get_mrpc_stripid_neighbour("l",help10,this_partID) << endl;
1051 cout << "row le " <<get_mrpc_stripid_neighbour("l",help11,this_partID) << endl;
1052 cout << "row le " <<get_mrpc_stripid_neighbour("l",help12,this_partID) << endl << endl;
1053 */
1054
1055
1056 }//close if stripnumber
1057 else
1058 {
1059 identify_if5_it=TofID::getIntID_mrpc(this_partID, BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if5,strip_number_if5));
1060 identify_if5_m1=TofID::getIntID_mrpc(this_partID, BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if5,1));
1061 identify_if5_m2=TofID::getIntID_mrpc(this_partID, BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if5,3));
1062 identify_if5_m3=TofID::getIntID_mrpc(this_partID, BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if5,5));
1063 identify_if5_m4=TofID::getIntID_mrpc(this_partID, BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if5,7));
1064 identify_if5_m5=TofID::getIntID_mrpc(this_partID, BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if5,9));
1065 identify_if5_m6=TofID::getIntID_mrpc(this_partID, BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if5,11));
1066 identify_if5_m7=TofID::getIntID_mrpc(this_partID, BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if5,13));
1067 identify_if5_m8=TofID::getIntID_mrpc(this_partID, BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if5,15));
1068 identify_if5_m9=TofID::getIntID_mrpc(this_partID, BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if5,17));
1069 identify_if5_m10=TofID::getIntID_mrpc(this_partID, BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if5,19));
1070 identify_if5_m11=TofID::getIntID_mrpc(this_partID, BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if5,21));
1071 identify_if5_m12=TofID::getIntID_mrpc(this_partID, BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if5,23));
1072
1073 if(identify_it!=identify_if5_m1 )count_if5_m1=tofDataMap.count(identify_if5_m1);
1074 if(identify_it!=identify_if5_m2 )count_if5_m2=tofDataMap.count(identify_if5_m2);
1075 if(identify_it!=identify_if5_m3 )count_if5_m3=tofDataMap.count(identify_if5_m3);
1076 if(identify_it!=identify_if5_m4 )count_if5_m4=tofDataMap.count(identify_if5_m4);
1077 if(identify_it!=identify_if5_m5 )count_if5_m5=tofDataMap.count(identify_if5_m5);
1078 if(identify_it!=identify_if5_m6 ) count_if5_m6=tofDataMap.count(identify_if5_m6);
1079 if(identify_it!=identify_if5_m7 )count_if5_m7=tofDataMap.count(identify_if5_m7);
1080 if(identify_it!=identify_if5_m8 )count_if5_m8=tofDataMap.count(identify_if5_m8);
1081 if(identify_it!=identify_if5_m9 )count_if5_m9=tofDataMap.count(identify_if5_m9);
1082 if(identify_it!=identify_if5_m10 )count_if5_m10=tofDataMap.count(identify_if5_m10);
1083 if(identify_it!=identify_if5_m11 )count_if5_m11=tofDataMap.count(identify_if5_m11);
1084 if(identify_it!=identify_if5_m12 )count_if5_m12=tofDataMap.count(identify_if5_m12);
1085
1086 int help1 = BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if5,1);
1087 identify_if5_l1=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("l",help1,this_partID), get_mrpc_stripid_neighbour("l",help1,this_partID));
1088 int help2 = BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if5,3);
1089 identify_if5_l2=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("l",help2,this_partID), get_mrpc_stripid_neighbour("l",help2,this_partID));
1090 int help3 = BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if5,5);
1091 identify_if5_l3=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("l",help3,this_partID), get_mrpc_stripid_neighbour("l",help3,this_partID));
1092 int help4 = BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if5,7);
1093 identify_if5_l4=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("l",help4,this_partID), get_mrpc_stripid_neighbour("l",help4,this_partID));
1094 int help5 = BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if5,9);
1095 identify_if5_l5=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("l",help5,this_partID), get_mrpc_stripid_neighbour("l",help5,this_partID));
1096 int help6 = BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if5,11);
1097 identify_if5_l6=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("l",help6,this_partID), get_mrpc_stripid_neighbour("l",help6,this_partID));
1098 int help7 = BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if5,13);
1099 identify_if5_l7=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("l",help7,this_partID), get_mrpc_stripid_neighbour("l",help7,this_partID));
1100 int help8 = BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if5,15);
1101 identify_if5_l8=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("l",help8,this_partID), get_mrpc_stripid_neighbour("l",help8,this_partID));
1102 int help9 = BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if5,17);
1103 identify_if5_l9=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("l",help9,this_partID), get_mrpc_stripid_neighbour("l",help9,this_partID));
1104 int help10 = BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if5,19);
1105 identify_if5_l10=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("l",help10,this_partID), get_mrpc_stripid_neighbour("l",help10,this_partID));
1106 int help11 = BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if5,21);
1107 identify_if5_l11=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("l",help11,this_partID), get_mrpc_stripid_neighbour("l",help11,this_partID));
1108 int help12 = BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if5,23);
1109 identify_if5_l12=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("l",help12,this_partID), get_mrpc_stripid_neighbour("l",help12,this_partID));
1110
1111
1112
1113 /*
1114 cout << "Partid = 4"<< endl;
1115 cout << "it " <<BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if5,strip_number_if5)<<endl;
1116 cout << "row it " <<BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if5,1) << endl;
1117 cout << "row it " <<BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if5,3) << endl;
1118 cout << "row it " <<BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if5,5) << endl;
1119 cout << "row it " <<BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if5,7) << endl;
1120 cout << "row it " <<BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if5,9) << endl;
1121 cout << "row it " <<BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if5,11) << endl;
1122 cout << "row it " <<BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if5,13) << endl;
1123 cout << "row it " <<BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if5,15) << endl;
1124 cout << "row it " <<BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if5,17) << endl;
1125 cout << "row it " <<BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if5,19) << endl;
1126 cout << "row it " <<BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if5,21) << endl;
1127 cout << "row it " <<BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if5,23) << endl;
1128 cout << "row ri " << get_mrpc_stripid_neighbour("r",help1,this_partID) << endl;
1129 cout << "row ri " <<get_mrpc_stripid_neighbour("r",help2,this_partID) << endl;
1130 cout << "row ri " <<get_mrpc_stripid_neighbour("r",help3,this_partID) << endl;
1131 cout << "row ri " <<get_mrpc_stripid_neighbour("r",help4,this_partID) << endl;
1132 cout << "row ri " <<get_mrpc_stripid_neighbour("r",help5,this_partID) << endl;
1133 cout << "row ri " <<get_mrpc_stripid_neighbour("r",help6,this_partID) << endl;
1134 cout << "row ri " <<get_mrpc_stripid_neighbour("r",help7,this_partID) << endl;
1135 cout << "row ri " <<get_mrpc_stripid_neighbour("r",help8,this_partID) << endl;
1136 cout << "row ri " <<get_mrpc_stripid_neighbour("r",help9,this_partID) << endl;
1137 cout << "row ri " <<get_mrpc_stripid_neighbour("r",help10,this_partID) << endl;
1138 cout << "row ri " <<get_mrpc_stripid_neighbour("r",help11,this_partID) << endl;
1139 cout << "row ri " <<get_mrpc_stripid_neighbour("r",help12,this_partID) << endl;
1140 cout << "row le " <<get_mrpc_stripid_neighbour("l",help1,this_partID) << endl;
1141 cout << "row le " <<get_mrpc_stripid_neighbour("l",help2,this_partID) << endl;
1142 cout << "row le " <<get_mrpc_stripid_neighbour("l",help3,this_partID) << endl;
1143 cout << "row le " <<get_mrpc_stripid_neighbour("l",help4,this_partID) << endl;
1144 cout << "row le " <<get_mrpc_stripid_neighbour("l",help5,this_partID) << endl;
1145 cout << "row le " <<get_mrpc_stripid_neighbour("l",help6,this_partID) << endl;
1146 cout << "row le " <<get_mrpc_stripid_neighbour("l",help7,this_partID) << endl;
1147 cout << "row le " <<get_mrpc_stripid_neighbour("l",help8,this_partID) << endl;
1148 cout << "row le " <<get_mrpc_stripid_neighbour("l",help9,this_partID) << endl;
1149 cout << "row le " <<get_mrpc_stripid_neighbour("l",help10,this_partID) << endl;
1150 cout << "row le " <<get_mrpc_stripid_neighbour("l",help11,this_partID) << endl;
1151 cout << "row le " <<get_mrpc_stripid_neighbour("l",help12,this_partID) << endl << endl;
1152 */
1153
1154
1155
1156
1157 identify_if5_r1=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("r",help1,this_partID), get_mrpc_stripid_neighbour("r",help1,this_partID));
1158 identify_if5_r2=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("r",help2,this_partID), get_mrpc_stripid_neighbour("r",help2,this_partID));
1159 identify_if5_r3=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("r",help3,this_partID), get_mrpc_stripid_neighbour("r",help3,this_partID));
1160 identify_if5_r4=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("r",help4,this_partID), get_mrpc_stripid_neighbour("r",help4,this_partID));
1161 identify_if5_r5=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("r",help5,this_partID), get_mrpc_stripid_neighbour("r",help5,this_partID));
1162 identify_if5_r6=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("r",help6,this_partID), get_mrpc_stripid_neighbour("r",help6,this_partID));
1163 identify_if5_r7=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("r",help7,this_partID), get_mrpc_stripid_neighbour("r",help7,this_partID));
1164 identify_if5_r8=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("r",help8,this_partID), get_mrpc_stripid_neighbour("r",help8,this_partID));
1165 identify_if5_r9=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("r",help9,this_partID), get_mrpc_stripid_neighbour("r",help9,this_partID));
1166 identify_if5_r10=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("r",help10,this_partID), get_mrpc_stripid_neighbour("r",help10,this_partID));
1167 identify_if5_r11=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("r",help11,this_partID), get_mrpc_stripid_neighbour("r",help11,this_partID));
1168 identify_if5_r12=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("r",help12,this_partID), get_mrpc_stripid_neighbour("r",help12,this_partID));
1169
1170
1171 count_if5_l1=tofDataMap.count(identify_if5_l1);
1172 count_if5_l2=tofDataMap.count(identify_if5_l2);
1173 count_if5_l3=tofDataMap.count(identify_if5_l3);
1174 count_if5_l4=tofDataMap.count(identify_if5_l4);
1175 count_if5_l5=tofDataMap.count(identify_if5_l5);
1176 count_if5_l6=tofDataMap.count(identify_if5_l6);
1177 count_if5_l7=tofDataMap.count(identify_if5_l7);
1178 count_if5_l8=tofDataMap.count(identify_if5_l8);
1179 count_if5_l9=tofDataMap.count(identify_if5_l9);
1180 count_if5_l10=tofDataMap.count(identify_if5_l10);
1181 count_if5_l11=tofDataMap.count(identify_if5_l11);
1182 count_if5_l12=tofDataMap.count(identify_if5_l12);
1183 count_if5_r1=tofDataMap.count(identify_if5_r1);
1184 count_if5_r2=tofDataMap.count(identify_if5_r2);
1185 count_if5_r3=tofDataMap.count(identify_if5_r3);
1186 count_if5_r4=tofDataMap.count(identify_if5_r4);
1187 count_if5_r5=tofDataMap.count(identify_if5_r5);
1188 count_if5_r6=tofDataMap.count(identify_if5_r6);
1189 count_if5_r7=tofDataMap.count(identify_if5_r7);
1190 count_if5_r8=tofDataMap.count(identify_if5_r8);
1191 count_if5_r9=tofDataMap.count(identify_if5_r9);
1192 count_if5_r10=tofDataMap.count(identify_if5_r10);
1193 count_if5_r11=tofDataMap.count(identify_if5_r11);
1194 count_if5_r12=tofDataMap.count(identify_if5_r12);
1195
1196
1197 }//close else
1198
1199}//close if neighboorhood=5
1200
1201
1202
1203
1204 if((neighborhood==6))
1205 {
1206
1207
1208
1209 int strip_number_if6 = BesTofDigitizerEcV4::Get_stripnumber_from_unique_identifier(tofid_it);
1210 int module_number_if6= BesTofDigitizerEcV4::Get_module_mrpc_from_unique_identifier(tofid_it);
1211
1212 if((strip_number_if6)%2==0)
1213 {
1214 identify_if6_it=TofID::getIntID_mrpc(this_partID, BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6,strip_number_if6));
1215
1216 identify_if6_m1=TofID::getIntID_mrpc(this_partID, BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6,2));
1217 identify_if6_m2=TofID::getIntID_mrpc(this_partID, BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6,4));
1218 identify_if6_m3=TofID::getIntID_mrpc(this_partID, BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6,6));
1219 identify_if6_m4=TofID::getIntID_mrpc(this_partID, BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6,8));
1220 identify_if6_m5=TofID::getIntID_mrpc(this_partID, BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6,10));
1221 identify_if6_m6=TofID::getIntID_mrpc(this_partID, BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6,12));
1222 identify_if6_m7=TofID::getIntID_mrpc(this_partID, BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6,14));
1223 identify_if6_m8=TofID::getIntID_mrpc(this_partID, BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6,16));
1224 identify_if6_m9=TofID::getIntID_mrpc(this_partID, BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6,18));
1225 identify_if6_m10=TofID::getIntID_mrpc(this_partID, BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6,20));
1226 identify_if6_m11=TofID::getIntID_mrpc(this_partID, BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6,22));
1227 identify_if6_m12=TofID::getIntID_mrpc(this_partID, BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6,24));
1228
1229
1230
1231 if(identify_it!=identify_if6_m1 )count_if6_m1=tofDataMap.count(identify_if6_m1);
1232 if(identify_it!=identify_if6_m2 )count_if6_m2=tofDataMap.count(identify_if6_m2);
1233 if(identify_it!=identify_if6_m3 )count_if6_m3=tofDataMap.count(identify_if6_m3);
1234 if(identify_it!=identify_if6_m4 )count_if6_m4=tofDataMap.count(identify_if6_m4);
1235 if(identify_it!=identify_if6_m5 )count_if6_m5=tofDataMap.count(identify_if6_m5);
1236 if(identify_it!=identify_if6_m6 )count_if6_m6=tofDataMap.count(identify_if6_m6);
1237 if(identify_it!=identify_if6_m7 )count_if6_m7=tofDataMap.count(identify_if6_m7);
1238 if(identify_it!=identify_if6_m8 )count_if6_m8=tofDataMap.count(identify_if6_m8);
1239 if(identify_it!=identify_if6_m9 )count_if6_m9=tofDataMap.count(identify_if6_m9);
1240 if(identify_it!=identify_if6_m10 )count_if6_m10=tofDataMap.count(identify_if6_m10);
1241 if(identify_it!=identify_if6_m11 )count_if6_m11=tofDataMap.count(identify_if6_m11);
1242 if(identify_it!=identify_if6_m12 )count_if6_m12=tofDataMap.count(identify_if6_m12);
1243
1244 int help1 = BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6,2);
1245 int help2 = BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6,4);
1246 int help3 = BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6,6);
1247 int help4 = BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6,8);
1248 int help5 = BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6,10);
1249 int help6 = BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6,12);
1250 int help7 = BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6,14);
1251 int help8 = BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6,16);
1252 int help9 = BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6,18);
1253 int help10 = BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6,20);
1254 int help11 = BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6,22);
1255 int help12 = BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6,24);
1256
1257 identify_if6_l1=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("l",help1,this_partID), get_mrpc_stripid_neighbour("l",help1,this_partID));
1258 identify_if6_l2=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("l",help2,this_partID), get_mrpc_stripid_neighbour("l",help2,this_partID));
1259 identify_if6_l3=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("l",help3,this_partID), get_mrpc_stripid_neighbour("l",help3,this_partID));
1260 identify_if6_l4=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("l",help4,this_partID), get_mrpc_stripid_neighbour("l",help4,this_partID));
1261 identify_if6_l5=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("l",help5,this_partID), get_mrpc_stripid_neighbour("l",help5,this_partID));
1262 identify_if6_l6=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("l",help6,this_partID), get_mrpc_stripid_neighbour("l",help6,this_partID));
1263 identify_if6_l7=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("l",help7,this_partID), get_mrpc_stripid_neighbour("l",help7,this_partID));
1264 identify_if6_l8=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("l",help8,this_partID), get_mrpc_stripid_neighbour("l",help8,this_partID));
1265 identify_if6_l9=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("l",help9,this_partID), get_mrpc_stripid_neighbour("l",help9,this_partID));
1266 identify_if6_l10=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("l",help10,this_partID), get_mrpc_stripid_neighbour("l",help10,this_partID));
1267 identify_if6_l11=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("l",help11,this_partID), get_mrpc_stripid_neighbour("l",help11,this_partID));
1268 identify_if6_l12=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("l",help12,this_partID), get_mrpc_stripid_neighbour("l",help12,this_partID));
1269
1270 identify_if6_r1=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("r",help1,this_partID), get_mrpc_stripid_neighbour("r",help1,this_partID));
1271 identify_if6_r2=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("r",help2,this_partID), get_mrpc_stripid_neighbour("r",help2,this_partID));
1272 identify_if6_r3=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("r",help3,this_partID), get_mrpc_stripid_neighbour("r",help3,this_partID));
1273 identify_if6_r4=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("r",help4,this_partID), get_mrpc_stripid_neighbour("r",help4,this_partID));
1274 identify_if6_r5=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("r",help5,this_partID), get_mrpc_stripid_neighbour("r",help5,this_partID));
1275 identify_if6_r6=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("r",help6,this_partID), get_mrpc_stripid_neighbour("r",help6,this_partID));
1276 identify_if6_r7=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("r",help7,this_partID), get_mrpc_stripid_neighbour("r",help7,this_partID));
1277 identify_if6_r8=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("r",help8,this_partID), get_mrpc_stripid_neighbour("r",help8,this_partID));
1278 identify_if6_r9=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("r",help9,this_partID), get_mrpc_stripid_neighbour("r",help9,this_partID));
1279 identify_if6_r10=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("r",help10,this_partID), get_mrpc_stripid_neighbour("r",help10,this_partID));
1280 identify_if6_r11=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("r",help11,this_partID), get_mrpc_stripid_neighbour("r",help11,this_partID));
1281 identify_if6_r12=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("r",help12,this_partID), get_mrpc_stripid_neighbour("r",help12,this_partID));
1282
1283
1284 count_if6_l1=tofDataMap.count(identify_if6_l1);
1285 count_if6_l2=tofDataMap.count(identify_if6_l2);
1286 count_if6_l3=tofDataMap.count(identify_if6_l3);
1287 count_if6_l4=tofDataMap.count(identify_if6_l4);
1288 count_if6_l5=tofDataMap.count(identify_if6_l5);
1289 count_if6_l6=tofDataMap.count(identify_if6_l6);
1290 count_if6_l7=tofDataMap.count(identify_if6_l7);
1291 count_if6_l8=tofDataMap.count(identify_if6_l8);
1292 count_if6_l9=tofDataMap.count(identify_if6_l9);
1293 count_if6_l10=tofDataMap.count(identify_if6_l10);
1294 count_if6_l11=tofDataMap.count(identify_if6_l11);
1295 count_if6_l12=tofDataMap.count(identify_if6_l12);
1296 count_if6_r1=tofDataMap.count(identify_if6_r1);
1297 count_if6_r2=tofDataMap.count(identify_if6_r2);
1298 count_if6_r3=tofDataMap.count(identify_if6_r3);
1299 count_if6_r4=tofDataMap.count(identify_if6_r4);
1300 count_if6_r5=tofDataMap.count(identify_if6_r5);
1301 count_if6_r6=tofDataMap.count(identify_if6_r6);
1302 count_if6_r7=tofDataMap.count(identify_if6_r7);
1303 count_if6_r8=tofDataMap.count(identify_if6_r8);
1304 count_if6_r9=tofDataMap.count(identify_if6_r9);
1305 count_if6_r10=tofDataMap.count(identify_if6_r10);
1306 count_if6_r11=tofDataMap.count(identify_if6_r11);
1307 count_if6_r12=tofDataMap.count(identify_if6_r12);
1308
1309//Now go again one to the left and one to the right!
1310
1311
1312
1313
1314
1315 int module_number_if6_l= BesTofDigitizerEcV4::Get_module_mrpc_from_unique_identifier(get_mrpc_stripid_neighbour("l",help1,this_partID));//Get the module number!!! from the left module.
1316 int part_id_if6_l = get_mrpc_partid_neighbour("l",help1,this_partID);
1317
1318
1319
1320 //We are here within the "even stripid slope": I.e the left and right neighbor are odd in stripid. Hence, use odd number for help13-help36
1321 int help13 = BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6_l,1);
1322 int help14 = BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6_l,3);
1323 int help15 = BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6_l,5);
1324 int help16 = BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6_l,7);
1325 int help17 = BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6_l,9);
1326 int help18 = BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6_l,11);
1327 int help19 = BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6_l,13);
1328 int help20 = BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6_l,15);
1329 int help21 = BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6_l,17);
1330 int help22 = BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6_l,19);
1331 int help23 = BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6_l,21);
1332 int help24 = BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6_l,23);
1333
1334 identify_if6_ll1=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("l",help13,part_id_if6_l), get_mrpc_stripid_neighbour("l",help13,part_id_if6_l));
1335 identify_if6_ll2=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("l",help14,part_id_if6_l), get_mrpc_stripid_neighbour("l",help14,part_id_if6_l));
1336 identify_if6_ll3=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("l",help15,part_id_if6_l), get_mrpc_stripid_neighbour("l",help15,part_id_if6_l));
1337 identify_if6_ll4=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("l",help16,part_id_if6_l), get_mrpc_stripid_neighbour("l",help16,part_id_if6_l));
1338 identify_if6_ll5=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("l",help17,part_id_if6_l), get_mrpc_stripid_neighbour("l",help17,part_id_if6_l));
1339 identify_if6_ll6=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("l",help18,part_id_if6_l), get_mrpc_stripid_neighbour("l",help18,part_id_if6_l));
1340 identify_if6_ll7=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("l",help19,part_id_if6_l), get_mrpc_stripid_neighbour("l",help19,part_id_if6_l));
1341 identify_if6_ll8=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("l",help20,part_id_if6_l), get_mrpc_stripid_neighbour("l",help20,part_id_if6_l));
1342 identify_if6_ll9=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("l",help21,part_id_if6_l), get_mrpc_stripid_neighbour("l",help21,part_id_if6_l));
1343 identify_if6_ll10=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("l",help22,part_id_if6_l), get_mrpc_stripid_neighbour("l",help22,part_id_if6_l));
1344 identify_if6_ll11=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("l",help23,part_id_if6_l), get_mrpc_stripid_neighbour("l",help23,part_id_if6_l));
1345 identify_if6_ll12=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("l",help24,part_id_if6_l), get_mrpc_stripid_neighbour("l",help24,part_id_if6_l));
1346
1347 int module_number_if6_r= BesTofDigitizerEcV4::Get_module_mrpc_from_unique_identifier(get_mrpc_stripid_neighbour("r",help1,this_partID));//Get the module number!!! from the left module.
1348 int part_id_if6_r = get_mrpc_partid_neighbour("r",help1,this_partID);
1349
1350 //We are here within the "even stripid slope": I.e the left and right neighbor are odd. Hence, use odd number for help13-help36
1351 int help25 = BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6_r,1);
1352 int help26 = BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6_r,3);
1353 int help27 = BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6_r,5);
1354 int help28 = BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6_r,7);
1355 int help29 = BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6_r,9);
1356 int help30 = BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6_r,11);
1357 int help31 = BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6_r,13);
1358 int help32 = BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6_r,15);
1359 int help33 = BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6_r,17);
1360 int help34 = BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6_r,19);
1361 int help35 = BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6_r,21);
1362 int help36 = BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6_r,23);
1363
1364 identify_if6_rr1=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("r",help25,part_id_if6_r), get_mrpc_stripid_neighbour("r",help25,part_id_if6_r));
1365 identify_if6_rr2=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("r",help26,part_id_if6_r), get_mrpc_stripid_neighbour("r",help26,part_id_if6_r));
1366 identify_if6_rr3=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("r",help27,part_id_if6_r), get_mrpc_stripid_neighbour("r",help27,part_id_if6_r));
1367 identify_if6_rr4=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("r",help28,part_id_if6_r), get_mrpc_stripid_neighbour("r",help28,part_id_if6_r));
1368 identify_if6_rr5=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("r",help29,part_id_if6_r), get_mrpc_stripid_neighbour("r",help29,part_id_if6_r));
1369 identify_if6_rr6=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("r",help30,part_id_if6_r), get_mrpc_stripid_neighbour("r",help30,part_id_if6_r));
1370 identify_if6_rr7=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("r",help31,part_id_if6_r), get_mrpc_stripid_neighbour("r",help31,part_id_if6_r));
1371 identify_if6_rr8=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("r",help32,part_id_if6_r), get_mrpc_stripid_neighbour("r",help32,part_id_if6_r));
1372 identify_if6_rr9=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("r",help33,part_id_if6_r), get_mrpc_stripid_neighbour("r",help33,part_id_if6_r));
1373 identify_if6_rr10=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("r",help34,part_id_if6_r), get_mrpc_stripid_neighbour("r",help34,part_id_if6_r));
1374 identify_if6_rr11=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("r",help35,part_id_if6_r), get_mrpc_stripid_neighbour("r",help35,part_id_if6_r));
1375 identify_if6_rr12=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("r",help36,part_id_if6_r), get_mrpc_stripid_neighbour("r",help36,part_id_if6_r));
1376
1377
1378 count_if6_ll1=tofDataMap.count(identify_if6_ll1);
1379 count_if6_ll2=tofDataMap.count(identify_if6_ll2);
1380 count_if6_ll3=tofDataMap.count(identify_if6_ll3);
1381 count_if6_ll4=tofDataMap.count(identify_if6_ll4);
1382 count_if6_ll5=tofDataMap.count(identify_if6_ll5);
1383 count_if6_ll6=tofDataMap.count(identify_if6_ll6);
1384 count_if6_ll7=tofDataMap.count(identify_if6_ll7);
1385 count_if6_ll8=tofDataMap.count(identify_if6_ll8);
1386 count_if6_ll9=tofDataMap.count(identify_if6_ll9);
1387 count_if6_ll10=tofDataMap.count(identify_if6_ll10);
1388 count_if6_ll11=tofDataMap.count(identify_if6_ll11);
1389 count_if6_ll12=tofDataMap.count(identify_if6_ll12);
1390 count_if6_rr1=tofDataMap.count(identify_if6_rr1);
1391 count_if6_rr2=tofDataMap.count(identify_if6_rr2);
1392 count_if6_rr3=tofDataMap.count(identify_if6_rr3);
1393 count_if6_rr4=tofDataMap.count(identify_if6_rr4);
1394 count_if6_rr5=tofDataMap.count(identify_if6_rr5);
1395 count_if6_rr6=tofDataMap.count(identify_if6_rr6);
1396 count_if6_rr7=tofDataMap.count(identify_if6_rr7);
1397 count_if6_rr8=tofDataMap.count(identify_if6_rr8);
1398 count_if6_rr9=tofDataMap.count(identify_if6_rr9);
1399 count_if6_rr10=tofDataMap.count(identify_if6_rr10);
1400 count_if6_rr11=tofDataMap.count(identify_if6_rr11);
1401 count_if6_rr12=tofDataMap.count(identify_if6_rr12);
1402 /*
1403 cout << "Partid = 4"<< endl;
1404 cout << "it " <<BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6,strip_number_if6)<<endl;
1405 cout << "row it " <<BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6,2) << endl;
1406 cout << "row it " <<BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6,4) << endl;
1407 cout << "row it " <<BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6,6) << endl;
1408 cout << "row it " <<BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6,8) << endl;
1409 cout << "row it " <<BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6,10) << endl;
1410 cout << "row it " <<BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6,12) << endl;
1411 cout << "row it " <<BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6,14) << endl;
1412 cout << "row it " <<BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6,16) << endl;
1413 cout << "row it " <<BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6,18) << endl;
1414 cout << "row it " <<BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6,20) << endl;
1415 cout << "row it " <<BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6,22) << endl;
1416 cout << "row it " <<BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6,24) << endl;
1417 cout << "row ri " <<get_mrpc_stripid_neighbour("r",help1,this_partID) << endl;
1418 cout << "row ri " <<get_mrpc_stripid_neighbour("r",help2,this_partID) << endl;
1419 cout << "row ri " <<get_mrpc_stripid_neighbour("r",help3,this_partID) << endl;
1420 cout << "row ri " <<get_mrpc_stripid_neighbour("r",help4,this_partID) << endl;
1421 cout << "row ri " <<get_mrpc_stripid_neighbour("r",help5,this_partID) << endl;
1422 cout << "row ri " <<get_mrpc_stripid_neighbour("r",help6,this_partID) << endl;
1423 cout << "row ri " <<get_mrpc_stripid_neighbour("r",help7,this_partID) << endl;
1424 cout << "row ri " <<get_mrpc_stripid_neighbour("r",help8,this_partID) << endl;
1425 cout << "row ri " <<get_mrpc_stripid_neighbour("r",help9,this_partID) << endl;
1426 cout << "row ri " <<get_mrpc_stripid_neighbour("r",help10,this_partID) << endl;
1427 cout << "row ri " <<get_mrpc_stripid_neighbour("r",help11,this_partID) << endl;
1428 cout << "row ri " <<get_mrpc_stripid_neighbour("r",help12,this_partID) << endl;
1429 cout << "row le " <<get_mrpc_stripid_neighbour("l",help1,this_partID) << endl;
1430 cout << "row le " <<get_mrpc_stripid_neighbour("l",help2,this_partID) << endl;
1431 cout << "row le " <<get_mrpc_stripid_neighbour("l",help3,this_partID) << endl;
1432 cout << "row le " <<get_mrpc_stripid_neighbour("l",help4,this_partID) << endl;
1433 cout << "row le " <<get_mrpc_stripid_neighbour("l",help5,this_partID) << endl;
1434 cout << "row le " <<get_mrpc_stripid_neighbour("l",help6,this_partID) << endl;
1435 cout << "row le " <<get_mrpc_stripid_neighbour("l",help7,this_partID) << endl;
1436 cout << "row le " <<get_mrpc_stripid_neighbour("l",help8,this_partID) << endl;
1437 cout << "row le " <<get_mrpc_stripid_neighbour("l",help9,this_partID) << endl;
1438 cout << "row le " <<get_mrpc_stripid_neighbour("l",help10,this_partID) << endl;
1439 cout << "row le " <<get_mrpc_stripid_neighbour("l",help11,this_partID) << endl;
1440 cout << "row le " <<get_mrpc_stripid_neighbour("l",help12,this_partID) << endl ;
1441 cout << "row riri " << get_mrpc_stripid_neighbour("r",help25,part_id_if6_r)<<" " <<get_mrpc_partid_neighbour("r",help25,part_id_if6_r) << endl;
1442 cout << "row riri " << get_mrpc_stripid_neighbour("r",help26,part_id_if6_r)<<" " <<get_mrpc_partid_neighbour("r",help26,part_id_if6_r)<<endl;
1443 cout << "row riri " << get_mrpc_stripid_neighbour("r",help27,part_id_if6_r)<<" " <<get_mrpc_partid_neighbour("r",help27,part_id_if6_r)<<endl;
1444 cout << "row riri " << get_mrpc_stripid_neighbour("r",help28,part_id_if6_r)<<" " <<get_mrpc_partid_neighbour("r",help28,part_id_if6_r)<<endl;
1445 cout << "row riri " << get_mrpc_stripid_neighbour("r",help29,part_id_if6_r)<<" " <<get_mrpc_partid_neighbour("r",help29,part_id_if6_r)<<endl;
1446 cout << "row riri " << get_mrpc_stripid_neighbour("r",help30,part_id_if6_r)<<" " <<get_mrpc_partid_neighbour("r",help30,part_id_if6_r)<<endl;
1447 cout << "row riri " << get_mrpc_stripid_neighbour("r",help31,part_id_if6_r)<<" " <<get_mrpc_partid_neighbour("r",help31,part_id_if6_r)<<endl;
1448 cout << "row riri " << get_mrpc_stripid_neighbour("r",help32,part_id_if6_r)<<" " <<get_mrpc_partid_neighbour("r",help32,part_id_if6_r)<<endl;
1449 cout << "row riri " << get_mrpc_stripid_neighbour("r",help33,part_id_if6_r)<<" " <<get_mrpc_partid_neighbour("r",help33,part_id_if6_r)<<endl;
1450 cout << "row riri " << get_mrpc_stripid_neighbour("r",help34,part_id_if6_r)<<" " <<get_mrpc_partid_neighbour("r",help34,part_id_if6_r)<<endl;
1451 cout << "row riri " << get_mrpc_stripid_neighbour("r",help35,part_id_if6_r)<<" " <<get_mrpc_partid_neighbour("r",help35,part_id_if6_r)<<endl;
1452 cout << "row riri " << get_mrpc_stripid_neighbour("r",help36,part_id_if6_r)<<" " <<get_mrpc_partid_neighbour("r",help36,part_id_if6_r)<<endl;
1453 cout << "row lele "<< get_mrpc_stripid_neighbour("l",help13,part_id_if6_l)<<" " <<get_mrpc_partid_neighbour("l",help13,part_id_if6_l) << endl;
1454 cout << "row lele "<< get_mrpc_stripid_neighbour("l",help14,part_id_if6_l)<<" " <<get_mrpc_partid_neighbour("l",help14,part_id_if6_l) << endl;
1455 cout << "row lele "<< get_mrpc_stripid_neighbour("l",help15,part_id_if6_l)<<" " <<get_mrpc_partid_neighbour("l",help15,part_id_if6_l) << endl;
1456 cout << "row lele "<< get_mrpc_stripid_neighbour("l",help16,part_id_if6_l)<<" " <<get_mrpc_partid_neighbour("l",help16,part_id_if6_l) << endl;
1457 cout << "row lele "<< get_mrpc_stripid_neighbour("l",help17,part_id_if6_l)<<" " <<get_mrpc_partid_neighbour("l",help17,part_id_if6_l) << endl;
1458 cout << "row lele "<< get_mrpc_stripid_neighbour("l",help18,part_id_if6_l)<<" " <<get_mrpc_partid_neighbour("l",help18,part_id_if6_l) << endl;
1459 cout << "row lele "<< get_mrpc_stripid_neighbour("l",help19,part_id_if6_l)<<" " <<get_mrpc_partid_neighbour("l",help19,part_id_if6_l) << endl;
1460 cout << "row lele "<< get_mrpc_stripid_neighbour("l",help20,part_id_if6_l)<<" " <<get_mrpc_partid_neighbour("l",help20,part_id_if6_l) << endl;
1461 cout << "row lele "<< get_mrpc_stripid_neighbour("l",help21,part_id_if6_l)<<" " <<get_mrpc_partid_neighbour("l",help21,part_id_if6_l) << endl;
1462 cout << "row lele "<< get_mrpc_stripid_neighbour("l",help22,part_id_if6_l)<<" " <<get_mrpc_partid_neighbour("l",help22,part_id_if6_l) << endl;
1463 cout << "row lele "<< get_mrpc_stripid_neighbour("l",help23,part_id_if6_l)<<" " <<get_mrpc_partid_neighbour("l",help23,part_id_if6_l) << endl;
1464 cout << "row lele "<< get_mrpc_stripid_neighbour("l",help24,part_id_if6_l)<<" " <<get_mrpc_partid_neighbour("l",help24,part_id_if6_l) << endl;
1465 cout << "l help13 "<< help13 << endl;
1466 cout << "l help14 "<< help14 << endl;
1467 cout << "l help15 "<< help15<< endl;
1468 cout << "l help16 "<< help16<< endl;
1469 cout << "l help17 "<< help17<< endl;
1470 cout << "l help18 "<< help18<< endl;
1471 cout << "l help19 "<< help19<< endl;
1472 cout << "l help20 "<< help20<< endl;
1473 cout << "l help21 "<< help21<< endl;
1474 cout << "l help22 "<< help22<< endl;
1475 cout << "l help23 "<< help23<< endl;
1476 cout << "l help24 "<< help24<< endl;
1477 cout << "r help25 "<< help25<< endl;
1478 cout << "r help26 "<< help26<< endl;
1479 cout << "r help27 "<< help27<< endl;
1480 cout << "r help28 "<< help28<< endl;
1481 cout << "r help29 "<< help29<< endl;
1482 cout << "r help30 "<< help30<< endl;
1483 cout << "r help31 "<< help31<< endl;
1484 cout << "r help32 "<< help32<< endl;
1485 cout << "r help33 "<< help33<< endl;
1486 cout << "r help34 "<< help34<< endl;
1487 cout << "r help35 "<< help35<< endl;
1488 cout << "r help36 "<< help36<< endl;
1489 */
1490
1491
1492
1493
1494
1495
1496 }//close if stripnumber
1497 else
1498 {
1499 identify_if6_it=TofID::getIntID_mrpc(this_partID, BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6,strip_number_if6));
1500 identify_if6_m1=TofID::getIntID_mrpc(this_partID, BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6,1));
1501 identify_if6_m2=TofID::getIntID_mrpc(this_partID, BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6,3));
1502 identify_if6_m3=TofID::getIntID_mrpc(this_partID, BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6,5));
1503 identify_if6_m4=TofID::getIntID_mrpc(this_partID, BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6,7));
1504 identify_if6_m5=TofID::getIntID_mrpc(this_partID, BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6,9));
1505 identify_if6_m6=TofID::getIntID_mrpc(this_partID, BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6,11));
1506 identify_if6_m7=TofID::getIntID_mrpc(this_partID, BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6,13));
1507 identify_if6_m8=TofID::getIntID_mrpc(this_partID, BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6,15));
1508 identify_if6_m9=TofID::getIntID_mrpc(this_partID, BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6,17));
1509 identify_if6_m10=TofID::getIntID_mrpc(this_partID, BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6,19));
1510 identify_if6_m11=TofID::getIntID_mrpc(this_partID, BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6,21));
1511 identify_if6_m12=TofID::getIntID_mrpc(this_partID, BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6,23));
1512 if(identify_it!=identify_if6_m1 )count_if6_m1=tofDataMap.count(identify_if6_m1);
1513 if(identify_it!=identify_if6_m2 )count_if6_m2=tofDataMap.count(identify_if6_m2);
1514 if(identify_it!=identify_if6_m3 )count_if6_m3=tofDataMap.count(identify_if6_m3);
1515 if(identify_it!=identify_if6_m4 )count_if6_m4=tofDataMap.count(identify_if6_m4);
1516 if(identify_it!=identify_if6_m5 )count_if6_m5=tofDataMap.count(identify_if6_m5);
1517 if(identify_it!=identify_if6_m6 )count_if6_m6=tofDataMap.count(identify_if6_m6);
1518 if(identify_it!=identify_if6_m7 )count_if6_m7=tofDataMap.count(identify_if6_m7);
1519 if(identify_it!=identify_if6_m8 )count_if6_m8=tofDataMap.count(identify_if6_m8);
1520 if(identify_it!=identify_if6_m9 )count_if6_m9=tofDataMap.count(identify_if6_m9);
1521 if(identify_it!=identify_if6_m10 )count_if6_m10=tofDataMap.count(identify_if6_m10);
1522 if(identify_it!=identify_if6_m11 )count_if6_m11=tofDataMap.count(identify_if6_m11);
1523 if(identify_it!=identify_if6_m12 )count_if6_m12=tofDataMap.count(identify_if6_m12);
1524
1525
1526 int help1 = BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6,1);
1527 int help2 = BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6,3);
1528 int help3 = BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6,5);
1529 int help4 = BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6,7);
1530 int help5 = BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6,9);
1531 int help6 = BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6,11);
1532 int help7 = BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6,13);
1533 int help8 = BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6,15);
1534 int help9 = BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6,17);
1535 int help10 = BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6,19);
1536 int help11 = BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6,21);
1537 int help12 = BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6,23);
1538
1539
1540 identify_if6_l1=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("l",help1,this_partID), get_mrpc_stripid_neighbour("l",help1,this_partID));
1541 identify_if6_l2=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("l",help2,this_partID), get_mrpc_stripid_neighbour("l",help2,this_partID));
1542 identify_if6_l3=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("l",help3,this_partID), get_mrpc_stripid_neighbour("l",help3,this_partID));
1543 identify_if6_l4=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("l",help4,this_partID), get_mrpc_stripid_neighbour("l",help4,this_partID));
1544 identify_if6_l5=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("l",help5,this_partID), get_mrpc_stripid_neighbour("l",help5,this_partID));
1545 identify_if6_l6=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("l",help6,this_partID), get_mrpc_stripid_neighbour("l",help6,this_partID));
1546 identify_if6_l7=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("l",help7,this_partID), get_mrpc_stripid_neighbour("l",help7,this_partID));
1547 identify_if6_l8=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("l",help8,this_partID), get_mrpc_stripid_neighbour("l",help8,this_partID));
1548 identify_if6_l9=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("l",help9,this_partID), get_mrpc_stripid_neighbour("l",help9,this_partID));
1549 identify_if6_l10=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("l",help10,this_partID), get_mrpc_stripid_neighbour("l",help10,this_partID));
1550 identify_if6_l11=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("l",help11,this_partID), get_mrpc_stripid_neighbour("l",help11,this_partID));
1551 identify_if6_l12=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("l",help12,this_partID), get_mrpc_stripid_neighbour("l",help12,this_partID));
1552
1553 identify_if6_r1=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("r",help1,this_partID), get_mrpc_stripid_neighbour("r",help1,this_partID));
1554 identify_if6_r2=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("r",help2,this_partID), get_mrpc_stripid_neighbour("r",help2,this_partID));
1555 identify_if6_r3=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("r",help3,this_partID), get_mrpc_stripid_neighbour("r",help3,this_partID));
1556 identify_if6_r4=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("r",help4,this_partID), get_mrpc_stripid_neighbour("r",help4,this_partID));
1557 identify_if6_r5=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("r",help5,this_partID), get_mrpc_stripid_neighbour("r",help5,this_partID));
1558 identify_if6_r6=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("r",help6,this_partID), get_mrpc_stripid_neighbour("r",help6,this_partID));
1559 identify_if6_r7=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("r",help7,this_partID), get_mrpc_stripid_neighbour("r",help7,this_partID));
1560 identify_if6_r8=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("r",help8,this_partID), get_mrpc_stripid_neighbour("r",help8,this_partID));
1561 identify_if6_r9=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("r",help9,this_partID), get_mrpc_stripid_neighbour("r",help9,this_partID));
1562 identify_if6_r10=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("r",help10,this_partID), get_mrpc_stripid_neighbour("r",help10,this_partID));
1563 identify_if6_r11=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("r",help11,this_partID), get_mrpc_stripid_neighbour("r",help11,this_partID));
1564 identify_if6_r12=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("r",help12,this_partID), get_mrpc_stripid_neighbour("r",help12,this_partID));
1565
1566 count_if6_l1=tofDataMap.count(identify_if6_l1);
1567 count_if6_l2=tofDataMap.count(identify_if6_l2);
1568 count_if6_l3=tofDataMap.count(identify_if6_l3);
1569 count_if6_l4=tofDataMap.count(identify_if6_l4);
1570 count_if6_l5=tofDataMap.count(identify_if6_l5);
1571 count_if6_l6=tofDataMap.count(identify_if6_l6);
1572 count_if6_l7=tofDataMap.count(identify_if6_l7);
1573 count_if6_l8=tofDataMap.count(identify_if6_l8);
1574 count_if6_l9=tofDataMap.count(identify_if6_l9);
1575 count_if6_l10=tofDataMap.count(identify_if6_l10);
1576 count_if6_l11=tofDataMap.count(identify_if6_l11);
1577 count_if6_l12=tofDataMap.count(identify_if6_l12);
1578 count_if6_r1=tofDataMap.count(identify_if6_r1);
1579 count_if6_r2=tofDataMap.count(identify_if6_r2);
1580 count_if6_r3=tofDataMap.count(identify_if6_r3);
1581 count_if6_r4=tofDataMap.count(identify_if6_r4);
1582 count_if6_r5=tofDataMap.count(identify_if6_r5);
1583 count_if6_r6=tofDataMap.count(identify_if6_r6);
1584 count_if6_r7=tofDataMap.count(identify_if6_r7);
1585 count_if6_r8=tofDataMap.count(identify_if6_r8);
1586 count_if6_r9=tofDataMap.count(identify_if6_r9);
1587 count_if6_r10=tofDataMap.count(identify_if6_r10);
1588 count_if6_r11=tofDataMap.count(identify_if6_r11);
1589 count_if6_r12=tofDataMap.count(identify_if6_r12);
1590
1591
1592
1593
1594
1595 //Now go again one to the left and one to the right!
1596
1597
1598 int module_number_if6_l= BesTofDigitizerEcV4::Get_module_mrpc_from_unique_identifier(get_mrpc_stripid_neighbour("l",help1,this_partID));//Get the module number!!! from the left module.
1599 int part_id_if6_l = get_mrpc_partid_neighbour("l",help1,this_partID);
1600
1601 //We are here within the "odd stripid slope": I.e the left and right neighbor are even. Hence, use even number for help13-help36
1602 int help13 = BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6_l,2);
1603 int help14 = BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6_l,4);
1604 int help15 = BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6_l,6);
1605 int help16 = BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6_l,8);
1606 int help17 = BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6_l,10);
1607 int help18 = BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6_l,12);
1608 int help19 = BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6_l,14);
1609 int help20 = BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6_l,16);
1610 int help21 = BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6_l,18);
1611 int help22 = BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6_l,20);
1612 int help23 = BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6_l,22);
1613 int help24 = BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6_l,24);
1614
1615 identify_if6_ll1=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("l",help13,part_id_if6_l), get_mrpc_stripid_neighbour("l",help13,part_id_if6_l));
1616 identify_if6_ll2=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("l",help14,part_id_if6_l), get_mrpc_stripid_neighbour("l",help14,part_id_if6_l));
1617 identify_if6_ll3=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("l",help15,part_id_if6_l), get_mrpc_stripid_neighbour("l",help15,part_id_if6_l));
1618 identify_if6_ll4=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("l",help16,part_id_if6_l), get_mrpc_stripid_neighbour("l",help16,part_id_if6_l));
1619 identify_if6_ll5=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("l",help17,part_id_if6_l), get_mrpc_stripid_neighbour("l",help17,part_id_if6_l));
1620 identify_if6_ll6=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("l",help18,part_id_if6_l), get_mrpc_stripid_neighbour("l",help18,part_id_if6_l));
1621 identify_if6_ll7=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("l",help19,part_id_if6_l), get_mrpc_stripid_neighbour("l",help19,part_id_if6_l));
1622 identify_if6_ll8=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("l",help20,part_id_if6_l), get_mrpc_stripid_neighbour("l",help20,part_id_if6_l));
1623 identify_if6_ll9=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("l",help21,part_id_if6_l), get_mrpc_stripid_neighbour("l",help21,part_id_if6_l));
1624 identify_if6_ll10=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("l",help22,part_id_if6_l), get_mrpc_stripid_neighbour("l",help22,part_id_if6_l));
1625 identify_if6_ll11=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("l",help23,part_id_if6_l), get_mrpc_stripid_neighbour("l",help23,part_id_if6_l));
1626 identify_if6_ll12=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("l",help24,part_id_if6_l), get_mrpc_stripid_neighbour("l",help24,part_id_if6_l));
1627
1628 int module_number_if6_r= BesTofDigitizerEcV4::Get_module_mrpc_from_unique_identifier(get_mrpc_stripid_neighbour("r",help1,4));//Get the module number!!! from the left module.
1629 int part_id_if6_r = get_mrpc_partid_neighbour("r",help1,4);
1630
1631 //We are here within the "odd stripid slope": I.e the left and right neighbor are even. Hence, use even number for help13-help36
1632 int help25 = BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6_r,2);
1633 int help26 = BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6_r,4);
1634 int help27 = BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6_r,6);
1635 int help28 = BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6_r,8);
1636 int help29 = BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6_r,10);
1637 int help30 = BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6_r,12);
1638 int help31 = BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6_r,14);
1639 int help32 = BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6_r,16);
1640 int help33 = BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6_r,18);
1641 int help34 = BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6_r,20);
1642 int help35 = BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6_r,22);
1643 int help36 = BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6_r,24);
1644
1645 identify_if6_rr1=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("r",help25,part_id_if6_r), get_mrpc_stripid_neighbour("r",help25,part_id_if6_r));
1646 identify_if6_rr2=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("r",help26,part_id_if6_r), get_mrpc_stripid_neighbour("r",help26,part_id_if6_r));
1647 identify_if6_rr3=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("r",help27,part_id_if6_r), get_mrpc_stripid_neighbour("r",help27,part_id_if6_r));
1648 identify_if6_rr4=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("r",help28,part_id_if6_r), get_mrpc_stripid_neighbour("r",help28,part_id_if6_r));
1649 identify_if6_rr5=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("r",help29,part_id_if6_r), get_mrpc_stripid_neighbour("r",help29,part_id_if6_r));
1650 identify_if6_rr6=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("r",help30,part_id_if6_r), get_mrpc_stripid_neighbour("r",help30,part_id_if6_r));
1651 identify_if6_rr7=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("r",help31,part_id_if6_r), get_mrpc_stripid_neighbour("r",help31,part_id_if6_r));
1652 identify_if6_rr8=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("r",help32,part_id_if6_r), get_mrpc_stripid_neighbour("r",help32,part_id_if6_r));
1653 identify_if6_rr9=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("r",help33,part_id_if6_r), get_mrpc_stripid_neighbour("r",help33,part_id_if6_r));
1654 identify_if6_rr10=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("r",help34,part_id_if6_r), get_mrpc_stripid_neighbour("r",help34,part_id_if6_r));
1655 identify_if6_rr11=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("r",help35,part_id_if6_r), get_mrpc_stripid_neighbour("r",help35,part_id_if6_r));
1656 identify_if6_rr12=TofID::getIntID_mrpc(get_mrpc_partid_neighbour("r",help36,part_id_if6_r), get_mrpc_stripid_neighbour("r",help36,part_id_if6_r));
1657
1658 count_if6_ll1=tofDataMap.count(identify_if6_ll1);
1659 count_if6_ll2=tofDataMap.count(identify_if6_ll2);
1660 count_if6_ll3=tofDataMap.count(identify_if6_ll3);
1661 count_if6_ll4=tofDataMap.count(identify_if6_ll4);
1662 count_if6_ll5=tofDataMap.count(identify_if6_ll5);
1663 count_if6_ll6=tofDataMap.count(identify_if6_ll6);
1664 count_if6_ll7=tofDataMap.count(identify_if6_ll7);
1665 count_if6_ll8=tofDataMap.count(identify_if6_ll8);
1666 count_if6_ll9=tofDataMap.count(identify_if6_ll9);
1667 count_if6_ll10=tofDataMap.count(identify_if6_ll10);
1668 count_if6_ll11=tofDataMap.count(identify_if6_ll11);
1669 count_if6_ll12=tofDataMap.count(identify_if6_ll12);
1670 count_if6_rr1=tofDataMap.count(identify_if6_rr1);
1671 count_if6_rr2=tofDataMap.count(identify_if6_rr2);
1672 count_if6_rr3=tofDataMap.count(identify_if6_rr3);
1673 count_if6_rr4=tofDataMap.count(identify_if6_rr4);
1674 count_if6_rr5=tofDataMap.count(identify_if6_rr5);
1675 count_if6_rr6=tofDataMap.count(identify_if6_rr6);
1676 count_if6_rr7=tofDataMap.count(identify_if6_rr7);
1677 count_if6_rr8=tofDataMap.count(identify_if6_rr8);
1678 count_if6_rr9=tofDataMap.count(identify_if6_rr9);
1679 count_if6_rr10=tofDataMap.count(identify_if6_rr10);
1680 count_if6_rr11=tofDataMap.count(identify_if6_rr11);
1681 count_if6_rr12=tofDataMap.count(identify_if6_rr12);
1682
1683
1684
1685 /* cout << "Partid = 4"<< endl;
1686 cout << "it " <<BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6,strip_number_if6)<<endl;
1687 cout << "row it " <<BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6,1) << endl;
1688 cout << "row it " <<BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6,3) << endl;
1689 cout << "row it " <<BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6,5) << endl;
1690 cout << "row it " <<BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6,7) << endl;
1691 cout << "row it " <<BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6,9) << endl;
1692 cout << "row it " <<BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6,11) << endl;
1693 cout << "row it " <<BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6,13) << endl;
1694 cout << "row it " <<BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6,15) << endl;
1695 cout << "row it " <<BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6,17) << endl;
1696 cout << "row it " <<BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6,19) << endl;
1697 cout << "row it " <<BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6,21) << endl;
1698 cout << "row it " <<BesTofDigitizerEcV4::Produce_unique_identifier(module_number_if6,23) << endl;
1699 cout << "row ri " <<get_mrpc_stripid_neighbour("r",help1,this_partID) << endl;
1700 cout << "row ri " <<get_mrpc_stripid_neighbour("r",help2,this_partID) << endl;
1701 cout << "row ri " <<get_mrpc_stripid_neighbour("r",help3,this_partID) << endl;
1702 cout << "row ri " <<get_mrpc_stripid_neighbour("r",help4,this_partID) << endl;
1703 cout << "row ri " <<get_mrpc_stripid_neighbour("r",help5,this_partID) << endl;
1704 cout << "row ri " <<get_mrpc_stripid_neighbour("r",help6,this_partID) << endl;
1705 cout << "row ri " <<get_mrpc_stripid_neighbour("r",help7,this_partID) << endl;
1706 cout << "row ri " <<get_mrpc_stripid_neighbour("r",help8,this_partID) << endl;
1707 cout << "row ri " <<get_mrpc_stripid_neighbour("r",help9,this_partID) << endl;
1708 cout << "row ri " <<get_mrpc_stripid_neighbour("r",help10,this_partID) << endl;
1709 cout << "row ri " <<get_mrpc_stripid_neighbour("r",help11,this_partID) << endl;
1710 cout << "row ri " <<get_mrpc_stripid_neighbour("r",help12,this_partID) << endl;
1711 cout << "row le " <<get_mrpc_stripid_neighbour("l",help1,this_partID) << endl;
1712 cout << "row le " <<get_mrpc_stripid_neighbour("l",help2,this_partID) << endl;
1713 cout << "row le " <<get_mrpc_stripid_neighbour("l",help3,this_partID) << endl;
1714 cout << "row le " <<get_mrpc_stripid_neighbour("l",help4,this_partID) << endl;
1715 cout << "row le " <<get_mrpc_stripid_neighbour("l",help5,this_partID) << endl;
1716 cout << "row le " <<get_mrpc_stripid_neighbour("l",help6,this_partID) << endl;
1717 cout << "row le " <<get_mrpc_stripid_neighbour("l",help7,this_partID) << endl;
1718 cout << "row le " <<get_mrpc_stripid_neighbour("l",help8,this_partID) << endl;
1719 cout << "row le " <<get_mrpc_stripid_neighbour("l",help9,this_partID) << endl;
1720 cout << "row le " <<get_mrpc_stripid_neighbour("l",help10,this_partID) << endl;
1721 cout << "row le " <<get_mrpc_stripid_neighbour("l",help11,this_partID) << endl;
1722 cout << "row le " <<get_mrpc_stripid_neighbour("l",help12,this_partID) << endl ;
1723 cout << "row riri " << get_mrpc_stripid_neighbour("r",help25,part_id_if6_r)<<endl;
1724 cout << "row riri " << get_mrpc_stripid_neighbour("r",help26,part_id_if6_r)<<endl;
1725 cout << "row riri " << get_mrpc_stripid_neighbour("r",help27,part_id_if6_r)<<endl;
1726 cout << "row riri " << get_mrpc_stripid_neighbour("r",help28,part_id_if6_r)<<endl;
1727 cout << "row riri " << get_mrpc_stripid_neighbour("r",help29,part_id_if6_r)<<endl;
1728 cout << "row riri " << get_mrpc_stripid_neighbour("r",help30,part_id_if6_r)<<endl;
1729 cout << "row riri " << get_mrpc_stripid_neighbour("r",help31,part_id_if6_r)<<endl;
1730 cout << "row riri " << get_mrpc_stripid_neighbour("r",help32,part_id_if6_r)<<endl;
1731 cout << "row riri " << get_mrpc_stripid_neighbour("r",help33,part_id_if6_r)<<endl;
1732 cout << "row riri " << get_mrpc_stripid_neighbour("r",help34,part_id_if6_r)<<endl;
1733 cout << "row riri " << get_mrpc_stripid_neighbour("r",help35,part_id_if6_r)<<endl;
1734 cout << "row riri " << get_mrpc_stripid_neighbour("r",help36,part_id_if6_r)<<endl;
1735 cout << "row lele "<< get_mrpc_stripid_neighbour("l",help13,part_id_if6_l) << endl;
1736 cout << "row lele "<< get_mrpc_stripid_neighbour("l",help14,part_id_if6_l) << endl;
1737 cout << "row lele "<< get_mrpc_stripid_neighbour("l",help15,part_id_if6_l) << endl;
1738 cout << "row lele "<< get_mrpc_stripid_neighbour("l",help16,part_id_if6_l) << endl;
1739 cout << "row lele "<< get_mrpc_stripid_neighbour("l",help17,part_id_if6_l) << endl;
1740 cout << "row lele "<< get_mrpc_stripid_neighbour("l",help18,part_id_if6_l) << endl;
1741 cout << "row lele "<< get_mrpc_stripid_neighbour("l",help19,part_id_if6_l) << endl;
1742 cout << "row lele "<< get_mrpc_stripid_neighbour("l",help20,part_id_if6_l) << endl;
1743 cout << "row lele "<< get_mrpc_stripid_neighbour("l",help21,part_id_if6_l) << endl;
1744 cout << "row lele "<< get_mrpc_stripid_neighbour("l",help22,part_id_if6_l) << endl;
1745 cout << "row lele "<< get_mrpc_stripid_neighbour("l",help23,part_id_if6_l) << endl;
1746 cout << "row lele "<< get_mrpc_stripid_neighbour("l",help24,part_id_if6_l) << endl;
1747 */
1748
1749
1750 }//close else
1751 }//close if neighboorhood=6
1752
1753
1754
1755
1756
1757
1758 /*std::cout << "MrpcTrack setTofData - partid_it | tofid_it " << "4" << " | " << tofid_it << std::endl;
1759 std::cout << "MrpcTrack setTofData - partid_u | tofid_u " << partid_u << " | " << tofid_u <<std::endl;
1760 std::cout << "MrpcTrack setTofData - partid_b | tofid_b " << partid_b << " | " << tofid_b <<std::endl;
1761 std::cout << "MrpcTrack setTofData - partid_l | tofid_l " << partid_l << " | " << tofid_l <<std::endl;
1762 std::cout << "MrpcTrack setTofData - partid_r | tofid_r " << partid_r << " | " << tofid_r <<std::endl;
1763 std::cout << "MrpcTrack setTofData - partid_lu | tofid_lu " << partid_lu << " | " << tofid_lu <<std::endl;
1764 std::cout << "MrpcTrack setTofData - partid_lb | tofid_lb " << partid_lb << " | " << tofid_lb <<std::endl;
1765 std::cout << "MrpcTrack setTofData - partid_ru | tofid_ru " << partid_ru << " | " << tofid_ru <<std::endl;
1766 std::cout << "MrpcTrack setTofData - partid_rb | tofid_rb " << partid_rb << " | " << tofid_rb <<std::endl;
1767
1768 std::cout << "MrpcTrack setTofData - partid_uu | tofid_uu " << partid_uu << " | " << tofid_uu <<std::endl;
1769 std::cout << "MrpcTrack setTofData - partid_bb | tofid_bb " << partid_bb << " | " << tofid_bb <<std::endl;
1770 std::cout << "MrpcTrack setTofData - partid_rbb | tofid_rbb " << partid_rbb << " | " << tofid_rbb <<std::endl;
1771 std::cout << "MrpcTrack setTofData - partid_ruu | tofid_ruu " << partid_ruu << " | " << tofid_ruu <<std::endl;
1772 std::cout << "MrpcTrack setTofData - partid_lbb | tofid_lbb " << partid_lbb << " | " << tofid_lbb <<std::endl;
1773 std::cout << "MrpcTrack setTofData - partid_luu | tofid_luu " << partid_luu << " | " << tofid_luu <<std::endl;
1774 std::cout << "MrpcTrack setTofData - partid_uuu | tofid_uuu " << partid_uuu << " | " << tofid_uuu <<std::endl;
1775 std::cout << "MrpcTrack setTofData - partid_bbb | tofid_bbb " << partid_bbb << " | " << tofid_bbb <<std::endl;
1776 std::cout << "MrpcTrack setTofData - partid_rbbb | tofid_rbbb " << partid_rbbb << " | " << tofid_rbbb <<std::endl;
1777 std::cout << "MrpcTrack setTofData - partid_ruuu | tofid_ruuu " << partid_ruuu << " | " << tofid_ruuu <<std::endl;
1778 std::cout << "MrpcTrack setTofData - partid_luuu | tofid_luuu " << partid_luuu << " | " << tofid_luuu <<std::endl;
1779 std::cout << "MrpcTrack setTofData - partid_lbbb | tofid_lbbb " << partid_lbbb << " | " << tofid_lbbb <<std::endl;
1780 */
1781
1782
1783
1784 }//close if (m_hitCase)
1785
1786
1787
1788
1789
1790 if(0) //List all entries of Tofdatamap
1791 {
1792 int data_map_size = tofDataMap.size();
1793 std::cout << "MrpcTrack setTofData Number of elements in TofDataMap " << data_map_size << std::endl;
1794
1795 IterTofDataMap it=tofDataMap.begin();
1796
1797 for ( it=tofDataMap.begin() ; it != tofDataMap.end(); it++ )
1798 std::cout << "MrpcTrack setTofData TofDataMap entries id | stripnumber "<< (*it).first <<" | " << (*it).second->tofId() << std::endl;
1799 }
1800
1801
1802
1803 if(count_it >0)
1804 {
1805 //std::cout << "MrpcTrack setTofData -match count_it > 0 count_it = " << count_it << std::endl;
1806
1807 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_it );
1808 IterTofDataMap iter = range.first;
1809
1810 for( unsigned int i = 0; i < count_it; i++, iter++ ) {
1811 tofDataAnalysis( (*iter).second, 1 );
1812 }
1813 }//close if(count_it >0)
1814
1815 if(count_u >0)
1816 {
1817 //std::cout << "MrpcTrack setTofData -match count_u > 0 count_u = " << count_u << std::endl;
1818
1819 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_u );
1820 IterTofDataMap iter = range.first;
1821 for( unsigned int i = 0; i < count_u; i++, iter++ ) {
1822 tofDataAnalysis( (*iter).second, 2 );
1823 }
1824 }//close if(count_u >0)
1825 if(count_b >0)
1826 {
1827 //std::cout << "MrpcTrack setTofData -match count_b > 0 count_b = " << count_b << std::endl;
1828
1829 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_b );
1830 IterTofDataMap iter = range.first;
1831 for( unsigned int i = 0; i < count_b; i++, iter++ ) {
1832 tofDataAnalysis( (*iter).second, 2 );
1833 }
1834 }//close if(count_b >0)
1835
1836 if(count_l >0)
1837 {
1838 //std::cout << "MrpcTrack setTofData -match count_l > 0 count_l = " << count_l << std::endl;
1839
1840 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_l );
1841 IterTofDataMap iter = range.first;
1842 for( unsigned int i = 0; i < count_l; i++, iter++ ) {
1843 tofDataAnalysis( (*iter).second, 2 );
1844 }
1845 }//close if(count_l >0)
1846
1847 if(count_r >0)
1848 {
1849 //std::cout << "MrpcTrack setTofData -match count_r > 0 count_r = " << count_r << std::endl;
1850
1851 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_r );
1852 IterTofDataMap iter = range.first;
1853 for( unsigned int i = 0; i < count_r; i++, iter++ ) {
1854 tofDataAnalysis( (*iter).second, 2 );
1855 }
1856 }//close if(count_r >0)
1857 if(count_lu >0)
1858 {
1859 //std::cout << "MrpcTrack setTofData -match count_lu > 0 count_lu = " << count_lu << std::endl;
1860
1861 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_lu );
1862 IterTofDataMap iter = range.first;
1863 for( unsigned int i = 0; i < count_lu; i++, iter++ ) {
1864 tofDataAnalysis( (*iter).second, 2 );
1865 }
1866 }//close if(count_lu >0)
1867
1868 if(count_ru >0)
1869 {
1870 //std::cout << "MrpcTrack setTofData -match count_ru > 0 count_ru = " << count_ru << std::endl;
1871
1872 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_ru );
1873 IterTofDataMap iter = range.first;
1874 for( unsigned int i = 0; i < count_ru; i++, iter++ ) {
1875 tofDataAnalysis( (*iter).second, 2 );
1876 }
1877 }//close if(count_ru >0)
1878
1879 if(count_lb >0)
1880 {
1881 //std::cout << "MrpcTrack setTofData -match count_lb > 0 count_lb = " << count_lb << std::endl;
1882
1883 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_lb );
1884 IterTofDataMap iter = range.first;
1885 for( unsigned int i = 0; i < count_lb; i++, iter++ ) {
1886 tofDataAnalysis( (*iter).second, 2 );
1887 }
1888 }//close if(count_lb >0)
1889
1890 if(count_rb >0)
1891 {
1892 //std::cout << "MrpcTrack setTofData -match count_rb > 0 count_rb = " << count_rb << std::endl;
1893
1894 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_rb );
1895 IterTofDataMap iter = range.first;
1896 for( unsigned int i = 0; i < count_rb; i++, iter++ ) {
1897 tofDataAnalysis( (*iter).second, 2 );
1898 }
1899 }//close if(count_rb >0)
1900
1901 if(count_bb >0)
1902 {
1903
1904 //std::cout << "MrpcTrack setTofData -match count_bb > 0 count_bb = " << count_bb << std::endl;
1905 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_bb );
1906 IterTofDataMap iter = range.first;
1907 for( unsigned int i = 0; i < count_bb; i++, iter++ ) {
1908 tofDataAnalysis( (*iter).second, 2 );
1909 }
1910 }//close if(count_bb >0)
1911 if(count_uu >0)
1912 {
1913 //std::cout << "MrpcTrack setTofData -match count_uu > 0 count_uu = " << count_uu << std::endl;
1914 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_uu );
1915 IterTofDataMap iter = range.first;
1916 for( unsigned int i = 0; i < count_uu; i++, iter++ ) {
1917 tofDataAnalysis( (*iter).second, 2 );
1918 }
1919 }//close if(count_uu >0)
1920
1921 if(count_lbb >0)
1922 {
1923
1924 //std::cout << "MrpcTrack setTofData -match count_lbb > 0 count_lbb = " << count_lbb << std::endl;
1925 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_lbb );
1926 IterTofDataMap iter = range.first;
1927 for( unsigned int i = 0; i < count_lbb; i++, iter++ ) {
1928 tofDataAnalysis( (*iter).second, 2 );
1929 }
1930 }//close if(count_lbb >0)
1931 if(count_luu >0)
1932 {
1933 //std::cout << "MrpcTrack setTofData -match count_luu > 0 count_luu = " << count_luu << std::endl;
1934 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_luu );
1935 IterTofDataMap iter = range.first;
1936 for( unsigned int i = 0; i < count_luu; i++, iter++ ) {
1937 tofDataAnalysis( (*iter).second, 2 );
1938 }
1939 }//close if(count_luu >0)
1940 if(count_rbb >0)
1941 {
1942 //std::cout << "MrpcTrack setTofData -match count_rbb > 0 count_rbb = " << count_rbb << std::endl;
1943 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_rbb );
1944 IterTofDataMap iter = range.first;
1945 for( unsigned int i = 0; i < count_rbb; i++, iter++ ) {
1946 tofDataAnalysis( (*iter).second, 2 );
1947 }
1948 }//close if(count_rbb >0)
1949
1950 if(count_ruu >0)
1951 {
1952 //std::cout << "MrpcTrack setTofData -match count_ruu > 0 count_ruu = " << count_ruu << std::endl;
1953 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_ruu );
1954 IterTofDataMap iter = range.first;
1955 for( unsigned int i = 0; i < count_ruu; i++, iter++ ) {
1956 tofDataAnalysis( (*iter).second, 2 );
1957 }
1958 }//close if(count_ruu >0)
1959 if(count_uuu >0)
1960 {
1961 //std::cout << "MrpcTrack setTofData -match count_uuu > 0 count_uuu = " << count_uuu << std::endl;
1962 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_uuu );
1963 IterTofDataMap iter = range.first;
1964 for( unsigned int i = 0; i < count_uuu; i++, iter++ ) {
1965 tofDataAnalysis( (*iter).second, 2 );
1966 }
1967 }//close if(count_uuu >0)
1968 if(count_bbb >0)
1969 {
1970 //std::cout << "MrpcTrack setTofData -match count_bbb > 0 count_bbb = " << count_bbb << std::endl;
1971 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_bbb );
1972 IterTofDataMap iter = range.first;
1973 for( unsigned int i = 0; i < count_bbb; i++, iter++ ) {
1974 tofDataAnalysis( (*iter).second, 2 );
1975 }
1976 }//close if(count_bbb >0)
1977 if(count_ruuu >0)
1978 {
1979 //std::cout << "MrpcTrack setTofData -match count_ruuu > 0 count_ruuu = " << count_ruuu << std::endl;
1980 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_ruuu );
1981 IterTofDataMap iter = range.first;
1982 for( unsigned int i = 0; i < count_ruuu; i++, iter++ ) {
1983 tofDataAnalysis( (*iter).second, 2 );
1984 }
1985 }//close if(count_ruuu >0)
1986 if(count_rbbb >0)
1987 {
1988 //std::cout << "MrpcTrack setTofData -match count_rbbb > 0 count_rbbb = " << count_rbbb << std::endl;
1989 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_rbbb );
1990 IterTofDataMap iter = range.first;
1991 for( unsigned int i = 0; i < count_rbbb; i++, iter++ ) {
1992 tofDataAnalysis( (*iter).second, 2 );
1993 }
1994 }//close if(count_rbbb >0
1995 if(count_luuu >0)
1996 {
1997 //std::cout << "MrpcTrack setTofData -match count_luuu > 0 count_luuu = " << count_luuu << std::endl;
1998 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_luuu );
1999 IterTofDataMap iter = range.first;
2000 for( unsigned int i = 0; i < count_luuu; i++, iter++ ) {
2001 tofDataAnalysis( (*iter).second, 2 );
2002 }
2003 }//close if(count_luuu >0)
2004 if(count_lbbb >0)
2005 {
2006 //std::cout << "MrpcTrack setTofData -match count_lbbb > 0 count_lbbb = " << count_lbbb << std::endl;
2007 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_lbbb );
2008 IterTofDataMap iter = range.first;
2009 for( unsigned int i = 0; i < count_lbbb; i++, iter++ ) {
2010 tofDataAnalysis( (*iter).second, 2 );
2011 }
2012 }//close if(count_lbbb >0
2013
2014 //if=4 Faelle
2015 if(count_lbbbl >0)
2016 {
2017 //std::cout << "MrpcTrack setTofData -match count_lbbbl > 0 count_lbbbl = " << count_lbbbl << std::endl;
2018 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_lbbbl );
2019 IterTofDataMap iter = range.first;
2020 for( unsigned int i = 0; i < count_lbbbl; i++, iter++ ) {
2021 tofDataAnalysis( (*iter).second, 2 );
2022 }
2023 }//close if(count_lbbbl >0
2024 if(count_lbbl >0)
2025 {
2026 //std::cout << "MrpcTrack setTofData -match count_lbbl > 0 count_lbbl = " << count_lbbl << std::endl;
2027 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_lbbl );
2028 IterTofDataMap iter = range.first;
2029 for( unsigned int i = 0; i < count_lbbl; i++, iter++ ) {
2030 tofDataAnalysis( (*iter).second, 2 );
2031 }
2032 }//close if(count_lbbl >0
2033 if(count_lbl >0)
2034 {
2035 //std::cout << "MrpcTrack setTofData -match count_lbl > 0 count_lbl = " << count_lbl << std::endl;
2036 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_lbl );
2037 IterTofDataMap iter = range.first;
2038 for( unsigned int i = 0; i < count_lbl; i++, iter++ ) {
2039 tofDataAnalysis( (*iter).second, 2 );
2040 }
2041 }//close if(count_lbl >0
2042 if(count_ll >0)
2043 {
2044 //std::cout << "MrpcTrack setTofData -match count_ll > 0 count_ll = " << count_ll << std::endl;
2045 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_ll );
2046 IterTofDataMap iter = range.first;
2047 for( unsigned int i = 0; i < count_ll; i++, iter++ ) {
2048 tofDataAnalysis( (*iter).second, 2 );
2049 }
2050 }//close if(count_ll >0
2051 if(count_luuul >0)
2052 {
2053 //std::cout << "MrpcTrack setTofData -match count_luuul > 0 count_luuul = " << count_luuul << std::endl;
2054 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_luuul );
2055 IterTofDataMap iter = range.first;
2056 for( unsigned int i = 0; i < count_luuul; i++, iter++ ) {
2057 tofDataAnalysis( (*iter).second, 2 );
2058 }
2059 }//close if(count_luuul >0
2060 if(count_luul >0)
2061 {
2062 //std::cout << "MrpcTrack setTofData -match count_luul > 0 count_luul = " << count_luul << std::endl;
2063 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_luul );
2064 IterTofDataMap iter = range.first;
2065 for( unsigned int i = 0; i < count_luul; i++, iter++ ) {
2066 tofDataAnalysis( (*iter).second, 2 );
2067 }
2068 }//close if(count_luul >0
2069 if(count_lul >0)
2070 {
2071 //std::cout << "MrpcTrack setTofData -match count_lul > 0 count_lul = " << count_lul << std::endl;
2072 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_lul );
2073 IterTofDataMap iter = range.first;
2074 for( unsigned int i = 0; i < count_lul; i++, iter++ ) {
2075 tofDataAnalysis( (*iter).second, 2 );
2076 }
2077 }//close if(count_lul >0
2078
2079 if(count_rbbbr >0)
2080 {
2081 //std::cout << "MrpcTrack setTofData -match count_rbbbr> 0 count_rbbbr = " << count_rbbbr << std::endl;
2082 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_rbbbr );
2083 IterTofDataMap iter = range.first;
2084 for( unsigned int i = 0; i < count_rbbbr; i++, iter++ ) {
2085 tofDataAnalysis( (*iter).second, 2 );
2086 }
2087 }//close if(count_rbbbr >0
2088 if(count_rbbr >0)
2089 {
2090 //std::cout << "MrpcTrack setTofData -match count_rbbr > 0 count_rbbr = " << count_rbbr << std::endl;
2091 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_rbbr );
2092 IterTofDataMap iter = range.first;
2093 for( unsigned int i = 0; i < count_rbbr; i++, iter++ ) {
2094 tofDataAnalysis( (*iter).second, 2 );
2095 }
2096 }//close if(count_rbbr >0
2097 if(count_rbr >0)
2098 {
2099 //std::cout << "MrpcTrack setTofData -match count_rbr > 0 count_rbr= " << count_rbr<< std::endl;
2100 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_rbr );
2101 IterTofDataMap iter = range.first;
2102 for( unsigned int i = 0; i < count_rbr; i++, iter++ ) {
2103 tofDataAnalysis( (*iter).second, 2 );
2104 }
2105 }//close if(count_rbr >0
2106 if(count_rr >0)
2107 {
2108 //std::cout << "MrpcTrack setTofData -match count_rr > 0 count_rr = " << count_rr << std::endl;
2109 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_rr );
2110 IterTofDataMap iter = range.first;
2111 for( unsigned int i = 0; i < count_rr; i++, iter++ ) {
2112 tofDataAnalysis( (*iter).second, 2 );
2113 }
2114 }//close if(count_ll >0
2115 if(count_ruuur >0)
2116 {
2117 //std::cout << "MrpcTrack setTofData -match count_ruuur > 0 count_ruuur = " << count_ruuur << std::endl;
2118 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_ruuur );
2119 IterTofDataMap iter = range.first;
2120 for( unsigned int i = 0; i < count_ruuur; i++, iter++ ) {
2121 tofDataAnalysis( (*iter).second, 2 );
2122 }
2123 }//close if(count_ruuur >0
2124 if(count_ruur >0)
2125 {
2126 //std::cout << "MrpcTrack setTofData -match count_ruur > 0 count_ruur = " << count_ruur << std::endl;
2127 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_ruur );
2128 IterTofDataMap iter = range.first;
2129 for( unsigned int i = 0; i < count_ruur; i++, iter++ ) {
2130 tofDataAnalysis( (*iter).second, 2 );
2131 }
2132 }//close if(count_ruur >0
2133 if(count_rur >0)
2134 {
2135 //std::cout << "MrpcTrack setTofData -match count_rur > 0 count_rur = " << count_rur << std::endl;
2136 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_rur );
2137 IterTofDataMap iter = range.first;
2138 for( unsigned int i = 0; i < count_rur; i++, iter++ ) {
2139 tofDataAnalysis( (*iter).second, 2 );
2140 }
2141 }//close if(count_rur >0
2142
2143 ///IF 5 part
2144
2145 if(count_if5_m1>0)
2146 {
2147 int help=2;
2148 if(identify_if5_m1==identify_if5_it) help=1;
2149 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if5_m1);
2150 IterTofDataMap iter = range.first;
2151 for( unsigned int i = 0; i < count_if5_m1; i++, iter++ ) {
2152 tofDataAnalysis( (*iter).second, help );
2153 }
2154 }
2155 if(count_if5_m2>0)
2156 {
2157 int help=2;
2158 if(identify_if5_m2==identify_if5_it) help=1;
2159 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if5_m2);
2160 IterTofDataMap iter = range.first;
2161 for( unsigned int i = 0; i < count_if5_m2; i++, iter++ ) {
2162 tofDataAnalysis( (*iter).second, help );
2163 }
2164 }
2165 if(count_if5_m3>0)
2166 {
2167 int help=2;
2168 if(identify_if5_m3==identify_if5_it) help=1;
2169 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if5_m3);
2170 IterTofDataMap iter = range.first;
2171 for( unsigned int i = 0; i < count_if5_m3; i++, iter++ ) {
2172 tofDataAnalysis( (*iter).second, help );
2173 }
2174 }
2175 if(count_if5_m4>0)
2176 {
2177 int help=2;
2178 if(identify_if5_m4==identify_if5_it) help=1;
2179 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if5_m4);
2180 IterTofDataMap iter = range.first;
2181 for( unsigned int i = 0; i < count_if5_m4; i++, iter++ ) {
2182 tofDataAnalysis( (*iter).second, help );
2183 }
2184 }
2185 if(count_if5_m5>0)
2186 {
2187 int help=2;
2188 if(identify_if5_m5==identify_if5_it) help=1;
2189 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if5_m5);
2190 IterTofDataMap iter = range.first;
2191 for( unsigned int i = 0; i < count_if5_m5; i++, iter++ ) {
2192 tofDataAnalysis( (*iter).second, help );
2193 }
2194 }
2195 if(count_if5_m6>0)
2196 {
2197 int help=2;
2198 if(identify_if5_m6==identify_if5_it) help=1;
2199 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if5_m6);
2200 IterTofDataMap iter = range.first;
2201 for( unsigned int i = 0; i < count_if5_m6; i++, iter++ ) {
2202 tofDataAnalysis( (*iter).second, help );
2203 }
2204 }
2205 if(count_if5_m7>0)
2206 {
2207 int help=2;
2208 if(identify_if5_m7==identify_if5_it) help=1;
2209 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if5_m7);
2210 IterTofDataMap iter = range.first;
2211 for( unsigned int i = 0; i < count_if5_m7; i++, iter++ ) {
2212 tofDataAnalysis( (*iter).second, help );
2213 }
2214 }
2215 if(count_if5_m8>0)
2216 {
2217 int help=2;
2218 if(identify_if5_m8==identify_if5_it) help=1;
2219 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if5_m8);
2220 IterTofDataMap iter = range.first;
2221 for( unsigned int i = 0; i < count_if5_m8; i++, iter++ ) {
2222 tofDataAnalysis( (*iter).second, help );
2223 }
2224 }
2225 if(count_if5_m9>0)
2226 {
2227 int help=2;
2228 if(identify_if5_m9==identify_if5_it) help=1;
2229 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if5_m9);
2230 IterTofDataMap iter = range.first;
2231 for( unsigned int i = 0; i < count_if5_m9; i++, iter++ ) {
2232 tofDataAnalysis( (*iter).second, help );
2233 }
2234 }
2235 if(count_if5_m10>0)
2236 {
2237 int help=2;
2238 if(identify_if5_m10==identify_if5_it) help=1;
2239 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if5_m10);
2240 IterTofDataMap iter = range.first;
2241 for( unsigned int i = 0; i < count_if5_m10; i++, iter++ ) {
2242 tofDataAnalysis( (*iter).second, help );
2243 }
2244 }
2245 if(count_if5_m11>0)
2246 {
2247 int help=2;
2248 if(identify_if5_m11==identify_if5_it) help=1;
2249 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if5_m11);
2250 IterTofDataMap iter = range.first;
2251 for( unsigned int i = 0; i < count_if5_m11; i++, iter++ ) {
2252 tofDataAnalysis( (*iter).second, help );
2253 }
2254 }
2255 if(count_if5_m12>0)
2256 {
2257 int help=2;
2258 if(identify_if5_m12==identify_if5_it) help=1;
2259 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if5_m12);
2260 IterTofDataMap iter = range.first;
2261 for( unsigned int i = 0; i < count_if5_m12; i++, iter++ ) {
2262 tofDataAnalysis( (*iter).second, help );
2263 }
2264 }
2265 if(count_if5_l1>0)
2266 {
2267 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if5_l1);
2268 IterTofDataMap iter = range.first;
2269 for( unsigned int i = 0; i < count_if5_l1; i++, iter++ ) {
2270 tofDataAnalysis( (*iter).second, 2 );
2271 }
2272 }
2273 if(count_if5_l2>0)
2274 {
2275 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if5_l2);
2276 IterTofDataMap iter = range.first;
2277 for( unsigned int i = 0; i < count_if5_l2; i++, iter++ ) {
2278 tofDataAnalysis( (*iter).second, 2 );
2279 }
2280 }
2281 if(count_if5_l3>0)
2282 {
2283 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if5_l3);
2284 IterTofDataMap iter = range.first;
2285 for( unsigned int i = 0; i < count_if5_l3; i++, iter++ ) {
2286 tofDataAnalysis( (*iter).second, 2 );
2287 }
2288 }
2289 if(count_if5_l4>0)
2290 {
2291 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if5_l4);
2292 IterTofDataMap iter = range.first;
2293 for( unsigned int i = 0; i < count_if5_l4; i++, iter++ ) {
2294 tofDataAnalysis( (*iter).second, 2 );
2295 }
2296 }
2297 if(count_if5_l5>0)
2298 {
2299 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if5_l5);
2300 IterTofDataMap iter = range.first;
2301 for( unsigned int i = 0; i < count_if5_l5; i++, iter++ ) {
2302 tofDataAnalysis( (*iter).second, 2 );
2303 }
2304 }
2305 if(count_if5_l6>0)
2306 {
2307 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if5_l6);
2308 IterTofDataMap iter = range.first;
2309 for( unsigned int i = 0; i < count_if5_l6; i++, iter++ ) {
2310 tofDataAnalysis( (*iter).second, 2 );
2311 }
2312 }
2313 if(count_if5_l7>0)
2314 {
2315 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if5_l7);
2316 IterTofDataMap iter = range.first;
2317 for( unsigned int i = 0; i < count_if5_l7; i++, iter++ ) {
2318 tofDataAnalysis( (*iter).second, 2 );
2319 }
2320 }
2321 if(count_if5_l8>0)
2322 {
2323 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if5_l8);
2324 IterTofDataMap iter = range.first;
2325 for( unsigned int i = 0; i < count_if5_l8; i++, iter++ ) {
2326 tofDataAnalysis( (*iter).second, 2 );
2327 }
2328 }
2329 if(count_if5_l9>0)
2330 {
2331 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if5_l9);
2332 IterTofDataMap iter = range.first;
2333 for( unsigned int i = 0; i < count_if5_l9; i++, iter++ ) {
2334 tofDataAnalysis( (*iter).second, 2 );
2335 }
2336 }
2337 if(count_if5_l10>0)
2338 {
2339 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if5_l10);
2340 IterTofDataMap iter = range.first;
2341 for( unsigned int i = 0; i < count_if5_l10; i++, iter++ ) {
2342 tofDataAnalysis( (*iter).second, 2 );
2343 }
2344 }
2345 if(count_if5_l11>0)
2346 {
2347 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if5_l11);
2348 IterTofDataMap iter = range.first;
2349 for( unsigned int i = 0; i < count_if5_l11; i++, iter++ ) {
2350 tofDataAnalysis( (*iter).second, 2 );
2351 }
2352 }
2353 if(count_if5_l12>0)
2354 {
2355 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if5_l12);
2356 IterTofDataMap iter = range.first;
2357 for( unsigned int i = 0; i < count_if5_l12; i++, iter++ ) {
2358 tofDataAnalysis( (*iter).second, 2 );
2359 }
2360 }
2361
2362 if(count_if5_r1>0)
2363 {
2364 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if5_r1);
2365 IterTofDataMap iter = range.first;
2366 for( unsigned int i = 0; i < count_if5_r1; i++, iter++ ) {
2367 tofDataAnalysis( (*iter).second, 2 );
2368 }
2369 }
2370 if(count_if5_r2>0)
2371 {
2372 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if5_r2);
2373 IterTofDataMap iter = range.first;
2374 for( unsigned int i = 0; i < count_if5_r2; i++, iter++ ) {
2375 tofDataAnalysis( (*iter).second, 2 );
2376 }
2377 }
2378 if(count_if5_r3>0)
2379 {
2380 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if5_r3);
2381 IterTofDataMap iter = range.first;
2382 for( unsigned int i = 0; i < count_if5_r3; i++, iter++ ) {
2383 tofDataAnalysis( (*iter).second, 2 );
2384 }
2385 }
2386 if(count_if5_r4>0)
2387 {
2388 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if5_r4);
2389 IterTofDataMap iter = range.first;
2390 for( unsigned int i = 0; i < count_if5_r4; i++, iter++ ) {
2391 tofDataAnalysis( (*iter).second, 2 );
2392 }
2393 }
2394 if(count_if5_r5>0)
2395 {
2396 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if5_r5);
2397 IterTofDataMap iter = range.first;
2398 for( unsigned int i = 0; i < count_if5_r5; i++, iter++ ) {
2399 tofDataAnalysis( (*iter).second, 2 );
2400 }
2401 }
2402 if(count_if5_r6>0)
2403 {
2404 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if5_r6);
2405 IterTofDataMap iter = range.first;
2406 for( unsigned int i = 0; i < count_if5_r6; i++, iter++ ) {
2407 tofDataAnalysis( (*iter).second, 2 );
2408 }
2409 }
2410 if(count_if5_r7>0)
2411 {
2412 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if5_r7);
2413 IterTofDataMap iter = range.first;
2414 for( unsigned int i = 0; i < count_if5_r7; i++, iter++ ) {
2415 tofDataAnalysis( (*iter).second, 2 );
2416 }
2417 }
2418 if(count_if5_r8>0)
2419 {
2420 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if5_r8);
2421 IterTofDataMap iter = range.first;
2422 for( unsigned int i = 0; i < count_if5_r8; i++, iter++ ) {
2423 tofDataAnalysis( (*iter).second, 2 );
2424 }
2425 }
2426 if(count_if5_r9>0)
2427 {
2428 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if5_r9);
2429 IterTofDataMap iter = range.first;
2430 for( unsigned int i = 0; i < count_if5_r9; i++, iter++ ) {
2431 tofDataAnalysis( (*iter).second, 2 );
2432 }
2433 }
2434 if(count_if5_r10>0)
2435 {
2436 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if5_r10);
2437 IterTofDataMap iter = range.first;
2438 for( unsigned int i = 0; i < count_if5_r10; i++, iter++ ) {
2439 tofDataAnalysis( (*iter).second, 2 );
2440 }
2441 }
2442 if(count_if5_r11>0)
2443 {
2444 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if5_r11);
2445 IterTofDataMap iter = range.first;
2446 for( unsigned int i = 0; i < count_if5_r11; i++, iter++ ) {
2447 tofDataAnalysis( (*iter).second, 2 );
2448 }
2449 }
2450 if(count_if5_r12>0)
2451 {
2452 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if5_r12);
2453 IterTofDataMap iter = range.first;
2454 for( unsigned int i = 0; i < count_if5_r12; i++, iter++ ) {
2455 tofDataAnalysis( (*iter).second, 2 );
2456 }
2457 }
2458 if(count_if6_m1>0)
2459 {
2460 int help=2;
2461 if(identify_if6_m1==identify_if6_it) help=1;
2462 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_m1);
2463 IterTofDataMap iter = range.first;
2464 for( unsigned int i = 0; i < count_if6_m1; i++, iter++ ) {
2465 tofDataAnalysis( (*iter).second, help );
2466 }
2467 }
2468 if(count_if6_m2>0)
2469 {
2470 int help=2;
2471 if(identify_if6_m2==identify_if6_it) help=1;
2472 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_m2);
2473 IterTofDataMap iter = range.first;
2474 for( unsigned int i = 0; i < count_if6_m2; i++, iter++ ) {
2475 tofDataAnalysis( (*iter).second, help );
2476 }
2477 }
2478 if(count_if6_m3>0)
2479 {
2480 int help=2;
2481 if(identify_if6_m3==identify_if6_it) help=1;
2482 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_m3);
2483 IterTofDataMap iter = range.first;
2484 for( unsigned int i = 0; i < count_if6_m3; i++, iter++ ) {
2485 tofDataAnalysis( (*iter).second, help );
2486 }
2487 }
2488 if(count_if6_m4>0)
2489 {
2490 int help=2;
2491 if(identify_if6_m4==identify_if6_it) help=1;
2492 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_m4);
2493 IterTofDataMap iter = range.first;
2494 for( unsigned int i = 0; i < count_if6_m4; i++, iter++ ) {
2495 tofDataAnalysis( (*iter).second, help );
2496 }
2497 }
2498 if(count_if6_m5>0)
2499 {
2500 int help=2;
2501 if(identify_if6_m5==identify_if6_it) help=1;
2502 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_m5);
2503 IterTofDataMap iter = range.first;
2504 for( unsigned int i = 0; i < count_if6_m5; i++, iter++ ) {
2505 tofDataAnalysis( (*iter).second, help );
2506 }
2507 }
2508 if(count_if6_m6>0)
2509 {
2510 int help=2;
2511 if(identify_if6_m6==identify_if6_it) help=1;
2512 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_m6);
2513 IterTofDataMap iter = range.first;
2514 for( unsigned int i = 0; i < count_if6_m6; i++, iter++ ) {
2515 tofDataAnalysis( (*iter).second, help );
2516 }
2517 }
2518 if(count_if6_m7>0)
2519 {
2520 int help=2;
2521 if(identify_if6_m7==identify_if6_it) help=1;
2522 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_m7);
2523 IterTofDataMap iter = range.first;
2524 for( unsigned int i = 0; i < count_if6_m7; i++, iter++ ) {
2525 tofDataAnalysis( (*iter).second, help );
2526 }
2527 }
2528 if(count_if6_m8>0)
2529 {
2530 int help=2;
2531 if(identify_if6_m8==identify_if6_it) help=1;
2532 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_m8);
2533 IterTofDataMap iter = range.first;
2534 for( unsigned int i = 0; i < count_if6_m8; i++, iter++ ) {
2535 tofDataAnalysis( (*iter).second, help );
2536 }
2537 }
2538 if(count_if6_m9>0)
2539 {
2540 int help=2;
2541 if(identify_if6_m9==identify_if6_it) help=1;
2542 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_m9);
2543 IterTofDataMap iter = range.first;
2544 for( unsigned int i = 0; i < count_if6_m9; i++, iter++ ) {
2545 tofDataAnalysis( (*iter).second, help );
2546 }
2547 }
2548 if(count_if6_m10>0)
2549 {
2550 int help=2;
2551 if(identify_if6_m10==identify_if6_it) help=1;
2552 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_m10);
2553 IterTofDataMap iter = range.first;
2554 for( unsigned int i = 0; i < count_if6_m10; i++, iter++ ) {
2555 tofDataAnalysis( (*iter).second, help );
2556 }
2557 }
2558 if(count_if6_m11>0)
2559 {
2560 int help=2;
2561 if(identify_if6_m11==identify_if6_it) help=1;
2562 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_m11);
2563 IterTofDataMap iter = range.first;
2564 for( unsigned int i = 0; i < count_if6_m11; i++, iter++ ) {
2565 tofDataAnalysis( (*iter).second, help );
2566 }
2567 }
2568 if(count_if6_m12>0)
2569 {
2570 int help=2;
2571 if(identify_if6_m12==identify_if6_it) help=1;
2572 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_m12);
2573 IterTofDataMap iter = range.first;
2574 for( unsigned int i = 0; i < count_if6_m12; i++, iter++ ) {
2575 tofDataAnalysis( (*iter).second, help );
2576 }
2577 }
2578 if(count_if6_l1>0)
2579 {
2580 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_l1);
2581 IterTofDataMap iter = range.first;
2582 for( unsigned int i = 0; i < count_if6_l1; i++, iter++ ) {
2583 tofDataAnalysis( (*iter).second, 2 );
2584 }
2585 }
2586 if(count_if6_l2>0)
2587 {
2588 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_l2);
2589 IterTofDataMap iter = range.first;
2590 for( unsigned int i = 0; i < count_if6_l2; i++, iter++ ) {
2591 tofDataAnalysis( (*iter).second, 2 );
2592 }
2593 }
2594 if(count_if6_l3>0)
2595 {
2596 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_l3);
2597 IterTofDataMap iter = range.first;
2598 for( unsigned int i = 0; i < count_if6_l3; i++, iter++ ) {
2599 tofDataAnalysis( (*iter).second, 2 );
2600 }
2601 }
2602 if(count_if6_l4>0)
2603 {
2604 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_l4);
2605 IterTofDataMap iter = range.first;
2606 for( unsigned int i = 0; i < count_if6_l4; i++, iter++ ) {
2607 tofDataAnalysis( (*iter).second, 2 );
2608 }
2609 }
2610 if(count_if6_l5>0)
2611 {
2612 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_l5);
2613 IterTofDataMap iter = range.first;
2614 for( unsigned int i = 0; i < count_if6_l5; i++, iter++ ) {
2615 tofDataAnalysis( (*iter).second, 2 );
2616 }
2617 }
2618 if(count_if6_l6>0)
2619 {
2620 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_l6);
2621 IterTofDataMap iter = range.first;
2622 for( unsigned int i = 0; i < count_if6_l6; i++, iter++ ) {
2623 tofDataAnalysis( (*iter).second, 2 );
2624 }
2625 }
2626 if(count_if6_l7>0)
2627 {
2628 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_l7);
2629 IterTofDataMap iter = range.first;
2630 for( unsigned int i = 0; i < count_if6_l7; i++, iter++ ) {
2631 tofDataAnalysis( (*iter).second, 2 );
2632 }
2633 }
2634 if(count_if6_l8>0)
2635 {
2636 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_l8);
2637 IterTofDataMap iter = range.first;
2638 for( unsigned int i = 0; i < count_if6_l8; i++, iter++ ) {
2639 tofDataAnalysis( (*iter).second, 2 );
2640 }
2641 }
2642 if(count_if6_l9>0)
2643 {
2644 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_l9);
2645 IterTofDataMap iter = range.first;
2646 for( unsigned int i = 0; i < count_if6_l9; i++, iter++ ) {
2647 tofDataAnalysis( (*iter).second, 2 );
2648 }
2649 }
2650 if(count_if6_l10>0)
2651 {
2652 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_l10);
2653 IterTofDataMap iter = range.first;
2654 for( unsigned int i = 0; i < count_if6_l10; i++, iter++ ) {
2655 tofDataAnalysis( (*iter).second, 2 );
2656 }
2657 }
2658 if(count_if6_l11>0)
2659 {
2660 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_l11);
2661 IterTofDataMap iter = range.first;
2662 for( unsigned int i = 0; i < count_if6_l11; i++, iter++ ) {
2663 tofDataAnalysis( (*iter).second, 2 );
2664 }
2665 }
2666 if(count_if6_l12>0)
2667 {
2668 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_l12);
2669 IterTofDataMap iter = range.first;
2670 for( unsigned int i = 0; i < count_if6_l12; i++, iter++ ) {
2671 tofDataAnalysis( (*iter).second, 2 );
2672 }
2673 }
2674
2675 if(count_if6_r1>0)
2676 {
2677 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_r1);
2678 IterTofDataMap iter = range.first;
2679 for( unsigned int i = 0; i < count_if6_r1; i++, iter++ ) {
2680 tofDataAnalysis( (*iter).second, 2 );
2681 }
2682 }
2683 if(count_if6_r2>0)
2684 {
2685 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_r2);
2686 IterTofDataMap iter = range.first;
2687 for( unsigned int i = 0; i < count_if6_r2; i++, iter++ ) {
2688 tofDataAnalysis( (*iter).second, 2 );
2689 }
2690 }
2691 if(count_if6_r3>0)
2692 {
2693 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_r3);
2694 IterTofDataMap iter = range.first;
2695 for( unsigned int i = 0; i < count_if6_r3; i++, iter++ ) {
2696 tofDataAnalysis( (*iter).second, 2 );
2697 }
2698 }
2699 if(count_if6_r4>0)
2700 {
2701 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_r4);
2702 IterTofDataMap iter = range.first;
2703 for( unsigned int i = 0; i < count_if6_r4; i++, iter++ ) {
2704 tofDataAnalysis( (*iter).second, 2 );
2705 }
2706 }
2707 if(count_if6_r5>0)
2708 {
2709 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_r5);
2710 IterTofDataMap iter = range.first;
2711 for( unsigned int i = 0; i < count_if6_r5; i++, iter++ ) {
2712 tofDataAnalysis( (*iter).second, 2 );
2713 }
2714 }
2715 if(count_if6_r6>0)
2716 {
2717 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_r6);
2718 IterTofDataMap iter = range.first;
2719 for( unsigned int i = 0; i < count_if6_r6; i++, iter++ ) {
2720 tofDataAnalysis( (*iter).second, 2 );
2721 }
2722 }
2723 if(count_if6_r7>0)
2724 {
2725 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_r7);
2726 IterTofDataMap iter = range.first;
2727 for( unsigned int i = 0; i < count_if6_r7; i++, iter++ ) {
2728 tofDataAnalysis( (*iter).second, 2 );
2729 }
2730 }
2731 if(count_if6_r8>0)
2732 {
2733 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_r8);
2734 IterTofDataMap iter = range.first;
2735 for( unsigned int i = 0; i < count_if6_r8; i++, iter++ ) {
2736 tofDataAnalysis( (*iter).second, 2 );
2737 }
2738 }
2739 if(count_if6_r9>0)
2740 {
2741 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_r9);
2742 IterTofDataMap iter = range.first;
2743 for( unsigned int i = 0; i < count_if6_r9; i++, iter++ ) {
2744 tofDataAnalysis( (*iter).second, 2 );
2745 }
2746 }
2747 if(count_if6_r10>0)
2748 {
2749 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_r10);
2750 IterTofDataMap iter = range.first;
2751 for( unsigned int i = 0; i < count_if6_r10; i++, iter++ ) {
2752 tofDataAnalysis( (*iter).second, 2 );
2753 }
2754 }
2755 if(count_if6_r11>0)
2756 {
2757 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_r11);
2758 IterTofDataMap iter = range.first;
2759 for( unsigned int i = 0; i < count_if6_r11; i++, iter++ ) {
2760 tofDataAnalysis( (*iter).second, 2 );
2761 }
2762 }
2763 if(count_if6_r12>0)
2764 {
2765 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_r12);
2766 IterTofDataMap iter = range.first;
2767 for( unsigned int i = 0; i < count_if6_r12; i++, iter++ ) {
2768 tofDataAnalysis( (*iter).second, 2 );
2769 }
2770 }
2771 if(count_if6_ll1>0)
2772 {
2773 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_ll1);
2774 IterTofDataMap iter = range.first;
2775 for( unsigned int i = 0; i < count_if6_ll1; i++, iter++ ) {
2776 tofDataAnalysis( (*iter).second, 2 );
2777 }
2778 }
2779 if(count_if6_ll2>0)
2780 {
2781 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_ll2);
2782 IterTofDataMap iter = range.first;
2783 for( unsigned int i = 0; i < count_if6_ll2; i++, iter++ ) {
2784 tofDataAnalysis( (*iter).second, 2 );
2785 }
2786 }
2787 if(count_if6_ll3>0)
2788 {
2789 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_ll3);
2790 IterTofDataMap iter = range.first;
2791 for( unsigned int i = 0; i < count_if6_ll3; i++, iter++ ) {
2792 tofDataAnalysis( (*iter).second, 2 );
2793 }
2794 }
2795 if(count_if6_ll4>0)
2796 {
2797 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_ll4);
2798 IterTofDataMap iter = range.first;
2799 for( unsigned int i = 0; i < count_if6_ll4; i++, iter++ ) {
2800 tofDataAnalysis( (*iter).second, 2 );
2801 }
2802 }
2803 if(count_if6_ll5>0)
2804 {
2805 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_ll5);
2806 IterTofDataMap iter = range.first;
2807 for( unsigned int i = 0; i < count_if6_ll5; i++, iter++ ) {
2808 tofDataAnalysis( (*iter).second, 2 );
2809 }
2810 }
2811 if(count_if6_ll6>0)
2812 {
2813 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_ll6);
2814 IterTofDataMap iter = range.first;
2815 for( unsigned int i = 0; i < count_if6_ll6; i++, iter++ ) {
2816 tofDataAnalysis( (*iter).second, 2 );
2817 }
2818 }
2819 if(count_if6_ll7>0)
2820 {
2821 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_ll7);
2822 IterTofDataMap iter = range.first;
2823 for( unsigned int i = 0; i < count_if6_ll7; i++, iter++ ) {
2824 tofDataAnalysis( (*iter).second, 2 );
2825 }
2826 }
2827 if(count_if6_ll8>0)
2828 {
2829 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_ll8);
2830 IterTofDataMap iter = range.first;
2831 for( unsigned int i = 0; i < count_if6_ll8; i++, iter++ ) {
2832 tofDataAnalysis( (*iter).second, 2 );
2833 }
2834 }
2835 if(count_if6_ll9>0)
2836 {
2837 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_ll9);
2838 IterTofDataMap iter = range.first;
2839 for( unsigned int i = 0; i < count_if6_ll9; i++, iter++ ) {
2840 tofDataAnalysis( (*iter).second, 2 );
2841 }
2842 }
2843 if(count_if6_ll10>0)
2844 {
2845 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_ll10);
2846 IterTofDataMap iter = range.first;
2847 for( unsigned int i = 0; i < count_if6_ll10; i++, iter++ ) {
2848 tofDataAnalysis( (*iter).second, 2 );
2849 }
2850 }
2851 if(count_if6_ll11>0)
2852 {
2853 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_ll11);
2854 IterTofDataMap iter = range.first;
2855 for( unsigned int i = 0; i < count_if6_ll11; i++, iter++ ) {
2856 tofDataAnalysis( (*iter).second, 2 );
2857 }
2858 }
2859 if(count_if6_ll12>0)
2860 {
2861 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_ll12);
2862 IterTofDataMap iter = range.first;
2863 for( unsigned int i = 0; i < count_if6_ll12; i++, iter++ ) {
2864 tofDataAnalysis( (*iter).second, 2 );
2865 }
2866 }
2867
2868 if(count_if6_rr1>0)
2869 {
2870 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_rr1);
2871 IterTofDataMap iter = range.first;
2872 for( unsigned int i = 0; i < count_if6_rr1; i++, iter++ ) {
2873 tofDataAnalysis( (*iter).second, 2 );
2874 }
2875 }
2876 if(count_if6_rr2>0)
2877 {
2878 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_rr2);
2879 IterTofDataMap iter = range.first;
2880 for( unsigned int i = 0; i < count_if6_rr2; i++, iter++ ) {
2881 tofDataAnalysis( (*iter).second, 2 );
2882 }
2883 }
2884 if(count_if6_rr3>0)
2885 {
2886 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_rr3);
2887 IterTofDataMap iter = range.first;
2888 for( unsigned int i = 0; i < count_if6_rr3; i++, iter++ ) {
2889 tofDataAnalysis( (*iter).second, 2 );
2890 }
2891 }
2892 if(count_if6_rr4>0)
2893 {
2894 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_rr4);
2895 IterTofDataMap iter = range.first;
2896 for( unsigned int i = 0; i < count_if6_rr4; i++, iter++ ) {
2897 tofDataAnalysis( (*iter).second, 2 );
2898 }
2899 }
2900 if(count_if6_rr5>0)
2901 {
2902 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_rr5);
2903 IterTofDataMap iter = range.first;
2904 for( unsigned int i = 0; i < count_if6_rr5; i++, iter++ ) {
2905 tofDataAnalysis( (*iter).second, 2 );
2906 }
2907 }
2908 if(count_if6_rr6>0)
2909 {
2910 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_rr6);
2911 IterTofDataMap iter = range.first;
2912 for( unsigned int i = 0; i < count_if6_rr6; i++, iter++ ) {
2913 tofDataAnalysis( (*iter).second, 2 );
2914 }
2915 }
2916 if(count_if6_rr7>0)
2917 {
2918 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_rr7);
2919 IterTofDataMap iter = range.first;
2920 for( unsigned int i = 0; i < count_if6_rr7; i++, iter++ ) {
2921 tofDataAnalysis( (*iter).second, 2 );
2922 }
2923 }
2924 if(count_if6_rr8>0)
2925 {
2926 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_rr8);
2927 IterTofDataMap iter = range.first;
2928 for( unsigned int i = 0; i < count_if6_rr8; i++, iter++ ) {
2929 tofDataAnalysis( (*iter).second, 2 );
2930 }
2931 }
2932 if(count_if6_rr9>0)
2933 {
2934 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_rr9);
2935 IterTofDataMap iter = range.first;
2936 for( unsigned int i = 0; i < count_if6_rr9; i++, iter++ ) {
2937 tofDataAnalysis( (*iter).second, 2 );
2938 }
2939 }
2940 if(count_if6_rr10>0)
2941 {
2942 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_rr10);
2943 IterTofDataMap iter = range.first;
2944 for( unsigned int i = 0; i < count_if6_rr10; i++, iter++ ) {
2945 tofDataAnalysis( (*iter).second, 2 );
2946 }
2947 }
2948 if(count_if6_rr11>0)
2949 {
2950 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_rr11);
2951 IterTofDataMap iter = range.first;
2952 for( unsigned int i = 0; i < count_if6_rr11; i++, iter++ ) {
2953 tofDataAnalysis( (*iter).second, 2 );
2954 }
2955 }
2956 if(count_if6_rr12>0)
2957 {
2958 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_rr12);
2959 IterTofDataMap iter = range.first;
2960 for( unsigned int i = 0; i < count_if6_rr12; i++, iter++ ) {
2961 tofDataAnalysis( (*iter).second, 2 );
2962 }
2963 }
2964
2965
2966
2967
2968
2969 // ------------------------------------------------------------------------
2970 // --------------------Old Tof analyis, but also barrel part! -------------
2971 // ------------------------------------------------------------------------
2972 if( ( ( m_hitCase == InnerLayer ) || ( m_hitCase == DoubleLayer ) ) && ( m_id1 > -1 ) ) {
2973 int tofid0 = m_id1;
2974 identify0 = TofID::getIntID( 1, 0, tofid0, 0 );
2975 count0 = tofDataMap.count( identify0 );
2976 int tofid1 = tofid0 - 1;
2977 if( tofid1 == -1 ) { tofid1 = 87; }
2978 identify1 = TofID::getIntID( 1, 0, tofid1, 0 );
2979 count1 = tofDataMap.count( identify1 );
2980 int tofid2 = tofid0 + 1;
2981 if( tofid2 == 88 ) { tofid2 = 0; }
2982 identify2 = TofID::getIntID( 1, 0, tofid2, 0 );
2983 count2 = tofDataMap.count( identify2 );
2984
2985 }
2986
2987 if( ( m_hitCase == EastEndcap ) && ( m_id1 > -1 ) ) {
2988 int tofid0 = m_id1;
2989 identify0 = TofID::getIntID( 0, 0, tofid0, 0 );
2990 count0 = tofDataMap.count( identify0 );
2991 int tofid1 = tofid0 - 1;
2992 if( tofid1 == -1 ) { tofid1 = 47; }
2993 identify1 = TofID::getIntID( 0, 0, tofid1, 0 );
2994 count1 = tofDataMap.count( identify1 );
2995 int tofid2 = tofid0 + 1;
2996 if( tofid2 == 48 ) { tofid2 = 0; }
2997 identify2 = TofID::getIntID( 0, 0, tofid2, 0 );
2998 count2 = tofDataMap.count( identify2 );
2999
3000 //std::cout << "MrpcTrack setTofData EastEndcap c0 c1 c2 : " << count0 << " | " << count1 << " | " << count2 << std::endl;
3001 }
3002
3003 if( ( m_hitCase == WestEndcap ) && ( m_id1 > -1 ) ) {
3004 int tofid0 = m_id1 - 48;
3005 identify0 = TofID::getIntID( 2, 0, tofid0, 0 );
3006 count0 = tofDataMap.count( identify0 );
3007 int tofid1 = tofid0 - 1;
3008 if( tofid1 == -1 ) { tofid1 = 47; }
3009 identify1 = TofID::getIntID( 2, 0, tofid1, 0 );
3010 count1 = tofDataMap.count( identify1 );
3011 int tofid2 = tofid0 + 1;
3012 if( tofid2 == 48 ) { tofid2 = 0; }
3013 identify2 = TofID::getIntID( 2, 0, tofid2, 0 );
3014 count2 = tofDataMap.count( identify2 );
3015
3016 //std::cout << "MrpcTrack setTofData WsstEndcap c0 c1 c2 : " << count0 << " | "<< count1 << " | " << count2 <<std::endl;
3017 }
3018
3019 if( count0 > 0 ) {
3020 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify0 );
3021 IterTofDataMap iter = range.first;
3022 for( unsigned int i = 0; i < count0; i++, iter++ ) {
3023 tofDataAnalysis( (*iter).second, 1 );
3024 }
3025 }
3026 if( count1 > 0 ) {
3027 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify1 );
3028 IterTofDataMap iter = range.first;
3029 for( unsigned int i = 0; i < count1; i++, iter++ ) {
3030 tofDataAnalysis( (*iter).second, 2 );
3031 }
3032 }
3033 if( count2 > 0 ) {
3034 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify2 );
3035 IterTofDataMap iter = range.first;
3036 for( unsigned int i = 0; i < count2; i++, iter++ ) {
3037 tofDataAnalysis( (*iter).second, 2 );
3038 }
3039 }
3040
3041 if( ( count0 == 0 ) && ( count1 == 0 ) && ( count2 == 0 )
3042 && (count_it==0) && (count_l==0) && (count_r==0) && (count_b==0) && (count_u==0) && (count_ru==0) && (count_rb==0) && (count_lu==0) && (count_lb==0)
3043 && (count_uu==0) && (count_bb==0) && (count_ruu==0) && (count_luu==0) && (count_rbb==0) && (count_lbb==0)
3044 //Neighborhood if=3:
3045 && (count_luuu==0) && (count_lbbb==0) && (count_ruuu==0) && (count_rbbb==0) && (count_uuu==0) && (count_bbb==0)
3046 //Neighborhood if=4:
3047 && (count_luuul==0) && (count_lbbbl==0) && (count_ruuur==0) && (count_rbbbr==0) && (count_luul==0) && (count_lbbl==0) && (count_ruur==0) && (count_rbbr==0)
3048 && (count_lul==0) && (count_lbl==0) && (count_rur==0) && (count_rbr==0) && (count_ll==0) && (count_rr==0)
3049 //Neighborhood if=5
3050 && (count_if5_m1 ==0) && (count_if5_m2 ==0) && (count_if5_m3 ==0) && (count_if5_m4 ==0) && (count_if5_m5 ==0) && (count_if5_m6 ==0) && (count_if5_m7 ==0) && (count_if5_m8 ==0) && (count_if5_m9 ==0)
3051 && (count_if5_m10 ==0) && (count_if5_m11 ==0) && (count_if5_m12 ==0)
3052 && (count_if5_l1 ==0) && (count_if5_l2 ==0) && (count_if5_l3 ==0)&& (count_if5_l4 ==0) && (count_if5_l5 ==0) && (count_if5_l6 ==0) && (count_if5_l7 ==0)&& (count_if5_l8 ==0) && (count_if5_l9 ==0)
3053 && (count_if5_l10 ==0) && (count_if5_l11 ==0) && (count_if5_l12 ==0)
3054 && (count_if5_r1 ==0) && (count_if5_r2 ==0) && (count_if5_r3 ==0)&& (count_if5_r4 ==0) && (count_if5_r5 ==0) && (count_if5_r6 ==0) && (count_if5_r7 ==0)&& (count_if5_r8 ==0) && (count_if5_r9 ==0)
3055 && (count_if5_r10 ==0) && (count_if5_r11 ==0) && (count_if5_r12 ==0)
3056 //Neighborhood if=6
3057 && (count_if6_m1 ==0) && (count_if6_m2 ==0) && (count_if6_m3 ==0) && (count_if6_m4 ==0) && (count_if6_m5 ==0) && (count_if6_m6 ==0) && (count_if6_m7 ==0) && (count_if6_m8 ==0) && (count_if6_m9 ==0)
3058 && (count_if6_m10 ==0) && (count_if6_m11 ==0) && (count_if6_m12 ==0)
3059 && (count_if6_l1 ==0) && (count_if6_l2 ==0) && (count_if6_l3 ==0)&& (count_if6_l4 ==0) && (count_if6_l5 ==0) && (count_if6_l6 ==0) && (count_if6_l7 ==0)&& (count_if6_l8 ==0) && (count_if6_l9 ==0)
3060 && (count_if6_l10 ==0) && (count_if6_l11 ==0) && (count_if6_l12 ==0)
3061 && (count_if6_r1 ==0) && (count_if6_r2 ==0) && (count_if6_r3 ==0)&& (count_if6_r4 ==0) && (count_if6_r5 ==0) && (count_if6_r6 ==0) && (count_if6_r7 ==0)&& (count_if6_r8 ==0) && (count_if6_r9 ==0)
3062 && (count_if6_r10 ==0) && (count_if6_r11 ==0) && (count_if6_r12 ==0)
3063 && (count_if6_ll1 ==0) && (count_if6_ll2 ==0) && (count_if6_ll3 ==0)&& (count_if6_ll4 ==0) && (count_if6_ll5 ==0) && (count_if6_ll6 ==0) && (count_if6_ll7 ==0)&& (count_if6_ll8 ==0)
3064 && (count_if6_ll9 ==0) && (count_if6_ll10 ==0) && (count_if6_ll11 ==0) && (count_if6_ll12 ==0)
3065 && (count_if6_rr1 ==0) && (count_if6_rr2 ==0) && (count_if6_rr3 ==0)&& (count_if6_rr4 ==0) && (count_if6_rr5 ==0) && (count_if6_rr6 ==0) && (count_if6_rr7 ==0)&& (count_if6_rr8 ==0)
3066 && (count_if6_rr9 ==0) && (count_if6_rr10 ==0) && (count_if6_rr11 ==0) && (count_if6_rr12 ==0)
3067
3068 ) {
3069
3070 //std::cout << "MrpcTrack setTofData - All count variables are equal 0. m_hitCase | m_id1 " << m_hitCase << " | " << m_id1 << std::endl;
3071 if( m_hitCase != DoubleLayer ) {
3072 m_hitCase = NoHit;
3073 m_quality = 12;
3074 }
3075 else {
3076 m_hitCase = OuterLayer;
3077 }
3078 }
3079
3080 if( ( ( m_hitCase == OuterLayer ) || ( m_hitCase == DoubleLayer ) ) && ( m_id2 > 87 ) ) {
3081 int tofid0 = m_id2 - 88;
3082 identify0 = TofID::getIntID( 1, 1, tofid0, 0 );
3083 count0 = tofDataMap.count( identify0 );
3084 int tofid1 = tofid0 - 1;
3085 if( tofid1 == -1 ) { tofid1 = 87; }
3086 identify1 = TofID::getIntID( 1, 1, tofid1, 0 );
3087 count1 = tofDataMap.count( identify1 );
3088 int tofid2 = tofid0 + 1;
3089 if( tofid2 == 88 ) { tofid2 = 0; }
3090 identify2 = TofID::getIntID( 1, 1, tofid2, 0 );
3091 count2 = tofDataMap.count( identify2 );
3092
3093 if( count0 > 0 ) {
3094 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify0 );
3095 IterTofDataMap iter = range.first;
3096 for( unsigned int i = 0; i < count0; i++, iter++ ) {
3097 tofDataAnalysis( (*iter).second, 3 );
3098 }
3099 }
3100 if( count1 > 0 ) {
3101 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify1 );
3102 IterTofDataMap iter = range.first;
3103 for( unsigned int i = 0; i < count1; i++, iter++ ) {
3104 tofDataAnalysis( (*iter).second, 4 );
3105 }
3106 }
3107 if( count2 > 0 ) {
3108 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify2 );
3109 IterTofDataMap iter = range.first;
3110 for( unsigned int i = 0; i < count2; i++, iter++ ) {
3111 tofDataAnalysis( (*iter).second, 4 );
3112 }
3113 }
3114
3115 if( ( count0 == 0 ) && ( count1 == 0 ) && ( count2 == 0 ) ) {
3116 if( m_hitCase != DoubleLayer ) {
3117 m_hitCase = NoHit;
3118 m_quality = 12;
3119 }
3120 else {
3121 m_hitCase = InnerLayer;
3122 }
3123 }
3124 }
3125
3126 return;
3127}
3128
3129
3130//------- tofDataAnalysis ----------------------------------------
3131// analysis tof data
3132//
3133void MrpcTrack::tofDataAnalysis( TofData* tof, unsigned int iflag ) {
3134
3135 unsigned int qual = tof->quality();
3136
3137 if( ( qual & 0x10 ) == 0 ) {
3138
3139 // qual = ( qual | 0x310 ); // zadc, ztdc unmatched, and track matched
3140 qual = ( qual | 0x10 ); // zadc, ztdc unmatched, and track matched
3141
3142 if( tof->barrel() ) { // Barrel, Endcap has been done
3143 if( ( tof->quality() == 0x7 ) || ( tof->quality() == 0xd ) ) {
3144 qual = ( qual | 0x20 ); // lost one Q
3145 }
3146
3147 if( ( tof->quality() == 0xb ) || ( tof->quality() == 0xe ) ) {
3148 qual = ( qual | 0x40 ); // lost one T
3149 }
3150
3151 if( ( tof->quality() == 0x3 ) || ( tof->quality() == 0xc ) ) {
3152 qual = ( qual | 0x80 ); // single end
3153 }
3154
3155 if( ( tof->quality() & 0x5 ) == 0x5 ) {
3156 double ztdc = tofCaliSvc->ZTDC( tof->tdc1(), tof->tdc2(), tof->tofId() );
3157 tof->setZTdc( ztdc );
3158 /*
3159 if( ( ( (iflag==1) || (iflag==2) ) && ( abs(ztdc-m_zrhit1)<ztdc_Cut ) ) || ( ( (iflag==3) || (iflag==4) ) && ( abs(ztdc-m_zrhit2)<ztdc_Cut ) ) ) {
3160 qual = ( qual & 0xeffffeff ); // Z_tdc un-matched.
3161 }
3162 else {
3163 qual = ( qual | 0x100 );
3164 }
3165 */
3166 }
3167
3168 if( ( tof->quality() & 0xa ) == 0xa ) {
3169 double zadc = tofCaliSvc->ZADC( tof->adc1(), tof->adc2(), tof->tofId() );
3170 tof->setZAdc( zadc );
3171 /*
3172 if( ( ( (iflag==1) || (iflag==2) ) && ( abs(zadc-m_zrhit1)<zadc_Cut ) ) || ( ( (iflag==3) || (iflag==4) ) && ( abs(zadc-m_zrhit2)<zadc_Cut ) ) ) {
3173 qual = ( qual & 0xeffffbff ); // Z_adc un-matched.
3174 }
3175 else {
3176 qual = ( qual | 0x200 );
3177 }
3178 */
3179 }
3180 }//close if barrel
3181
3182 tof->setQuality( qual );
3183 }
3184
3185 if( iflag == 1 ) m_tofData1.push_back( tof );
3186 else if( iflag == 2 ) m_tofData2.push_back( tof );
3187 else if( iflag == 3 ) m_tofData3.push_back( tof );
3188 else if( iflag == 4 ) m_tofData4.push_back( tof );
3189 else {
3190 cout << "MrpcRec::MrpcTrack::TofDataAnalylsis: the Flag should be 1-4, out of the Range!" << endl;
3191 }
3192
3193 return;
3194}
3195
3196
3197//------- match --------------------------------------------------
3198// Tof Data - Extrapolated Track Match
3199//
3200void MrpcTrack::match(std::vector<MrpcTrack*>*& tofTrackVec ) {
3201
3202 if( m_hitCase == NoHit ) return;
3203
3204 if( m_hitCase == InnerLayer ) {
3205 findTofDataBarrel( m_tofData1, m_tofData2, m_zrhit1, 1, tofTrackVec );
3206 if( ( m_quality1 & 0x10 ) == 0 ) { m_hitCase = NoHit; }
3207 }
3208 else if( m_hitCase == OuterLayer ) {
3209 findTofDataBarrel( m_tofData3, m_tofData4, m_zrhit2, 2, tofTrackVec );
3210 if( ( m_quality2 & 0x10 ) == 0 ) { m_hitCase = NoHit; }
3211 }
3212 else if( m_hitCase == DoubleLayer ) {
3213 findTofDataBarrel( m_tofData1, m_tofData2, m_zrhit1, 1, tofTrackVec );
3214 if( ( m_quality1 & 0x10 ) == 0 ) { m_hitCase = OuterLayer; }
3215 findTofDataBarrel( m_tofData3, m_tofData4, m_zrhit2, 2, tofTrackVec );
3216 if( ( m_quality2 & 0x10 ) == 0 ) {
3217 if( m_hitCase == DoubleLayer ) {
3218 m_hitCase = InnerLayer;
3219 }
3220 else if( m_hitCase == OuterLayer ) {
3221 m_hitCase = NoHit;
3222 }
3223 else {
3224 cout << "MrpcRec::MrpcTrack::match: 2- Impossible!" << endl;
3225 }
3226 }
3227 }
3228 else if( ( m_hitCase == EastEndcap ) || ( m_hitCase == WestEndcap ) ) {
3229 findTofDataEndcap( m_tofData1, m_tofData2, m_zr1 );
3230 }
3231 else if((m_hitCase==westendcap_1) || (m_hitCase==westendcap_2) || (m_hitCase==eastendcap_2) || (m_hitCase==eastendcap_1))
3232 {
3233 //std::cout << "MrpcTrack match(): New mrpc Endcap. m_zrhit1 = " << m_zrhit1 << std::endl;
3234 findTofDataMRPC( m_tofData1, m_tofData2, m_zrhit1, 3 );
3235 }
3236 else {
3237 cout << "MrpcRec::MrpcTrack::match: 1- Impossible!" << endl;
3238 }
3239 return;
3240}
3241
3242
3243//------- findTofDataBarrel ----------------------------------------
3244// find the right TOF information in TOF data vector
3245// of the exact TOF ID and of the neighbor
3246//
3247void MrpcTrack::findTofDataBarrel( std::vector<TofData*> tofDataVec1, std::vector<TofData*> tofDataVec2, double zrhit, unsigned int iflag, std::vector<MrpcTrack*>*& tofTrackVec ) {
3248
3249 unsigned int qual = 0xf;
3250 TofData* tof = 0;
3251 if( tofDataVec2.size() == 0 ) {
3252 if( tofDataVec1.size() == 0 ) {
3253 qual = 0;
3254 }
3255 else if( tofDataVec1.size() == 1 ) {
3256 std::vector<TofData*>::iterator iter1 = tofDataVec1.begin();
3257 tof = (*iter1);
3258 qual = 0x1;
3259 }
3260 else if( tofDataVec1.size() > 1 ) {
3261 tof= chooseTofData( tofDataVec1, zrhit );
3262 qual = 0x2;
3263 }
3264 else {
3265 cout << "MrpcRec::MrpcTrack::findTofDataBarrel: 1- Impossible!" << endl;
3266 }
3267 }
3268 else if( ( tofDataVec2.size() == 1 ) ) {
3269 if( tofDataVec1.size() == 0 ) {
3270 std::vector<TofData*>::iterator iter2 = tofDataVec2.begin();
3271 tof = (*iter2);
3272 qual = 0x4;
3273 }
3274 else if( tofDataVec1.size() == 1 ) {
3275 std::vector<TofData*>::iterator iter1 = tofDataVec1.begin();
3276 if( ((*iter1)->quality()&0x1ff)==0x01f && abs((*iter1)->ztdc()-zrhit)<ztdc_Cut ) {
3277 tof = (*iter1);
3278 }
3279 else {
3280 std::vector<TofData*>::iterator iter2 = tofDataVec2.begin();
3281 tof = compareTofData( (*iter1), (*iter2), zrhit );
3282 }
3283 qual = 0x5;
3284 }
3285 else if( tofDataVec1.size() > 1 ) {
3286 TofData* tofData1 = chooseTofData( tofDataVec1, zrhit );
3287 if( (tofData1->quality()&0x1ff)==0x01f && abs(tofData1->ztdc()-zrhit)<ztdc_Cut ) {
3288 tof = tofData1;
3289 }
3290 else {
3291 std::vector<TofData*>::iterator iter2 = tofDataVec2.begin();
3292 tof = compareTofData( tofData1, (*iter2), zrhit );
3293 }
3294 qual = 0x6;
3295 }
3296 else {
3297 cout << "MrpcRec::MrpcTrack::findTofDataBarrel: 2- Impossible!" << endl;
3298 }
3299 }
3300 else if( ( tofDataVec2.size() > 1 ) ) {
3301 if( tofDataVec1.size() == 0 ) {
3302 tof = chooseTofData( tofDataVec2, zrhit );
3303 qual = 0x8;
3304 }
3305 else if( tofDataVec1.size() == 1 ) {
3306 std::vector<TofData*>::iterator iter1 = tofDataVec1.begin();
3307 if( ((*iter1)->quality()&0x1ff)==0x01f && abs((*iter1)->ztdc()-zrhit)<ztdc_Cut ) {
3308 tof = (*iter1);
3309 }
3310 else {
3311 TofData* tofData2 = chooseTofData( tofDataVec2, zrhit );
3312 tof = compareTofData( (*iter1), tofData2, zrhit );
3313 }
3314 qual = 0x9;
3315 }
3316 else if( tofDataVec1.size() > 1 ) {
3317 TofData* tofData1 = chooseTofData( tofDataVec1, zrhit );
3318 if( (tofData1->quality()&0x1ff)==0x01f && abs(tofData1->ztdc()-zrhit)<ztdc_Cut ) {
3319 tof = tofData1;
3320 }
3321 else {
3322 TofData* tofData2 = chooseTofData( tofDataVec2, zrhit );
3323 tof = compareTofData( tofData1, tofData2, zrhit );
3324 }
3325 qual = 0xa;
3326 }
3327 else {
3328 cout << "MrpcRec::MrpcTrack::findTofDataBarrel: 3- Impossible!" << endl;
3329 }
3330 }
3331
3332 if( qual != 0 ) {
3333 if( !(tof->used()) ) {
3334 getTofData( tof, iflag );
3335 }
3336 else {
3337 bool z1=false, z2=false;
3338 bool zc1=false, zc2=false;
3339 MrpcTrack* track=0;
3340 if( iflag==1 ) {
3341 z1 = ( abs( m_zrhit1 - tof->ztdc() ) < ztdc_Cut );
3342 zc1 = ( m_zrhit1 > tof->ztdc() );
3343 std::vector<MrpcTrack*>::iterator iter = tofTrackVec->begin();
3344 for( ; iter!=tofTrackVec->end(); iter++ ) {
3345 if( tof->tofId()==(*iter)->tofId1() ) {
3346 track = (*iter);
3347 z2 = ( abs( (*iter)->zrhit1() - tof->ztdc() ) < ztdc_Cut );
3348 zc2 = ( (*iter)->zrhit1() > tof->ztdc() );
3349 }
3350 }
3351 }
3352 else if( iflag==2 ) {
3353 z1 = ( abs( m_zrhit2 - tof->ztdc() ) < ztdc_Cut );
3354 zc1 = ( m_zrhit2 > tof->ztdc() );
3355 std::vector<MrpcTrack*>::iterator iter = tofTrackVec->begin();
3356 for( ; iter!=tofTrackVec->end(); iter++ ) {
3357 if( tof->tofId()==(*iter)->tofId2() ) {
3358 track = (*iter);
3359 z2 = ( abs( (*iter)->zrhit2() - tof->ztdc() ) < ztdc_Cut );
3360 zc2 = ( (*iter)->zrhit2() > tof->ztdc() );
3361 }
3362 }
3363 }
3364
3365 if( ( z1 && z2 )||( (!z1) && (!z2) ) ) {
3366 if( zc1 && !zc2 ) {
3367 getTofDataEast( tof, iflag );
3368 track->getTofDataWest( tof, iflag );
3369 }
3370 else if( !zc1 && zc2 ) {
3371 getTofDataWest( tof, iflag );
3372 track->getTofDataEast( tof, iflag );
3373 }
3374 }
3375 else if( z1 && !z2 ) {
3376 getTofData( tof, iflag );
3377 track->getTofDataNohit( iflag );
3378 cout << iflag << " " << track->quality1() << " " << track->quality2() << endl;
3379 }
3380 else if( !z1 && z2 ) {
3381 qual = 0;
3382 }
3383 }
3384 }
3385
3386 if( qual == 0 ) {
3387 if( ( iflag == 1 ) || ( iflag == 3 ) ) {
3388 m_quality1 = ( m_quality1 | 0x300 );
3389 }
3390 else if( iflag == 2 ) {
3391 m_quality2 = ( m_quality2 | 0x300 );
3392 }
3393 else {
3394 cout << "MrpcRec::MrpcTrack::findTofDataBarrel: the 1- IFLAG is Out of Range!" << endl;
3395 }
3396 }
3397 else {
3398 qual = ( qual << 12 );
3399 if( ( iflag == 1 ) || ( iflag == 3 ) ) {
3400 m_quality1 = ( m_quality1 | qual );
3401 }
3402 else if( iflag == 2 ) {
3403 m_quality2 = ( m_quality2 | qual );
3404 }
3405 else {
3406 cout << "MrpcRec::MrpcTrack::findTofDataBarrel: the 2- IFLAG is Out of Range!" << endl;
3407 }
3408 }
3409
3410 return;
3411}
3412
3413
3414
3415void MrpcTrack::findTofDataMRPC( std::vector<TofData*> tofDataVec1, std::vector<TofData*> tofDataVec2, double zrhit, unsigned int iflag )
3416{
3417
3418 unsigned int qual = 0xf;
3419 if( tofDataVec2.size() == 0 ) {
3420 if( tofDataVec1.size() == 0 ) {
3421 qual = 0;
3422 }
3423 else if( tofDataVec1.size() == 1 ) {
3424 std::vector<TofData*>::iterator iter1 = tofDataVec1.begin();
3425 getTofDataMRPC( (*iter1), iflag );
3426 qual = 0x1;
3427 mrpc_extrapolation_good=true;//There is no neighbour cell. The extrapolation of the MRPC track was fine!
3428 }
3429 else if( tofDataVec1.size() > 1 ) {
3430 getTofDataMRPC( chooseTofDataMRPC( tofDataVec1, zrhit ), iflag );
3431 qual = 0x2;
3432 mrpc_extrapolation_good=true;//There is no neighbour cell. The extrapolation of the MRPC track was fine!
3433 }
3434 else {
3435 cout << "MrpcRec::MrpcTrack::findTofData: 1- Impossible!" << endl;
3436 }
3437 }
3438 else if( ( tofDataVec2.size() == 1 ) ) {
3439 if( tofDataVec1.size() == 0 ) {
3440 std::vector<TofData*>::iterator iter2 = tofDataVec2.begin();
3441 getTofDataMRPC( (*iter2), iflag );
3442 qual = 0x4;
3443 }
3444 else if( tofDataVec1.size() == 1 ) {
3445 std::vector<TofData*>::iterator iter1 = tofDataVec1.begin();
3446 std::vector<TofData*>::iterator iter2 = tofDataVec2.begin();
3447 getTofDataMRPC( compareTofDataMRPC( (*iter1), (*iter2)), iflag );
3448 qual = 0x5;
3449 }
3450 else if( tofDataVec1.size() > 1 ) {
3451 TofData* tofData1 = chooseTofDataMRPC( tofDataVec1, zrhit );
3452 std::vector<TofData*>::iterator iter2 = tofDataVec2.begin();
3453 getTofDataMRPC( compareTofDataMRPC( tofData1, (*iter2)), iflag );
3454 qual = 0x6;
3455 }
3456 else {
3457 cout << "MrpcRec::MrpcTrack::findTofData: 2- Impossible!" << endl;
3458 }
3459 }
3460 else if( ( tofDataVec2.size() > 1 ) ) {
3461 if( tofDataVec1.size() == 0 ) {
3462 getTofDataMRPC( chooseTofDataMRPC( tofDataVec2, zrhit ), iflag );
3463 qual = 0x8;
3464 }
3465 else if( tofDataVec1.size() == 1 ) {
3466 std::vector<TofData*>::iterator iter1 = tofDataVec1.begin();
3467 TofData* tofData2 = chooseTofDataMRPC( tofDataVec2, zrhit );
3468 getTofDataMRPC( compareTofDataMRPC( (*iter1), tofData2), iflag );
3469 qual = 0x9;
3470 }
3471 else if( tofDataVec1.size() > 1 ) {
3472 TofData* tofData1 = chooseTofDataMRPC( tofDataVec1, zrhit );
3473 TofData* tofData2 = chooseTofDataMRPC( tofDataVec2, zrhit );
3475 qual = 0xa;
3476 }
3477 else {
3478 cout << "MrpcRec::MrpcTrack::findTofData: 3- Impossible!" << endl;
3479 }
3480 }
3481
3482 if( qual == 0 ) {
3483 if( iflag == 3 ) {
3484 m_quality1 = 0x300;
3485 }
3486 else {
3487 cout << "MrpcRec::MrpcTrack::findTofData: the 1- IFLAG is Out of Range!" << endl;
3488 }
3489 }
3490 else {
3491 qual = ( qual << 12 );
3492 if( ( iflag == 3 ) ) {
3493 m_quality1 = ( m_quality1 | qual );
3494 }
3495 else {
3496 cout << "MrpcRec::MrpcTrack::findTofData: the 2- IFLAG is Out of Range!" << endl;
3497 }
3498 }
3499
3500 return;
3501}
3502
3503
3504//------- chooseTofDataMRPC -------------------------------------------
3505// choose the most possible TofData from TofDataVector -> Max charged is the winner!
3506TofData* MrpcTrack::chooseTofDataMRPC( std::vector<TofData*> tofDataVec, double zrhit ) {
3507 if( tofDataVec.size() == 0 ) {
3508 cout << "MrpcRec::MrpcTrack::ChooseTofDataMRPC: Size of TofData Vector is Zero!" << endl;
3509 return 0;
3510 }
3511 std::vector<TofData*>::iterator igood = tofDataVec.begin();
3512 if( tofDataVec.size() > 1 ) {
3513 std::vector<TofData*>::iterator iter = tofDataVec.begin();
3514
3515 double maxQ = 0.0;
3516 for( ; iter != tofDataVec.end(); iter++ )
3517 {
3518 if( (*iter)->adc() > maxQ ) {
3519 maxQ = (*iter)->adc();
3520 igood = iter;
3521 }
3522 }
3523 }
3524
3525 return (*igood);
3526}
3527
3528
3529
3530
3531
3532//------- compareTofDataMRPC -------------------------------
3533// choose the most possible TofData from TofDataVector
3534//
3536 TofData* tof = tofData1;
3537 mrpc_extrapolation_good=true; //TofData1 contains the correct extrapolated tracks!
3538 if( tof->adc() < tofData2->adc() ) {
3539 tof = tofData2;
3540 mrpc_extrapolation_good=false;
3541 }
3542 return tof;
3543}
3544
3545
3546
3547
3548//------- chooseTofData -------------------------------------------
3549// choose the most possible TofData from TofDataVector
3550// ZTDC, ZADC, SingleEnd/NoQ/NoT are jugded.
3551//
3552TofData* MrpcTrack::chooseTofData( std::vector<TofData*> tofDataVec, double zrhit ) {
3553 if( tofDataVec.size() == 0 ) {
3554 cout << "MrpcRec::MrpcTrack::ChooseTofData: Size of TofData Vector is Zero!" << endl;
3555 return 0;
3556 }
3557 std::vector<TofData*>::iterator igood = tofDataVec.begin();
3558 if( tofDataVec.size() > 1 ) {
3559
3560 double deltaZ = 1000.0;
3561 std::vector<TofData*>::iterator iter = tofDataVec.begin();
3562 // ZTDC compare
3563 for( ; iter != tofDataVec.end(); iter++ ) {
3564 if( ( (*iter)->quality() & 0x5 ) == 0x5 ) {
3565 if( abs( (*iter)->ztdc() - zrhit ) < deltaZ ) {
3566 deltaZ = abs( (*iter)->ztdc() - zrhit );
3567 igood = iter;
3568 }
3569 }
3570 }
3571 // ZADC compare
3572 if( deltaZ > 999.0 ) {
3573 iter = tofDataVec.begin();
3574 for( ; iter != tofDataVec.end(); iter++ ) {
3575 if( ( (*iter)->quality() & 0xa ) == 0xa ) {
3576 if( abs( (*iter)->zadc() - zrhit ) < deltaZ ) {
3577 deltaZ = abs( (*iter)->zadc() - zrhit );
3578 igood = iter;
3579 }
3580 }
3581 }
3582
3583 }
3584 // Max Q
3585 if( deltaZ > 999.0 ) {
3586 unsigned int ibad = 0xf0;
3587 iter = tofDataVec.begin();
3588 for( ; iter != tofDataVec.end(); iter++ ) {
3589 if( ( (*iter)->quality() & 0xf0 ) < ibad ) {
3590 igood = iter;
3591 ibad = ( (*iter)->quality() & 0xf0 );
3592 }
3593 else if( ( (*iter)->quality() & 0xf0 ) == ibad ) {
3594 if( ( (*iter)->adc1() + (*iter)->adc2() ) > ( (*igood)->adc1() + (*igood)->adc2() ) ) {
3595 igood = iter;
3596 ibad = ( (*iter)->quality() & 0xf0 );
3597 }
3598 }
3599 }
3600
3601 }
3602 }
3603
3604 return (*igood);
3605}
3606
3607
3608//------- compareTofData -------------------------------------------
3609// choose the most possible TofData from TofDataVector
3610// ZTDC, ZADC, SingleEnd/NoQ/NoT are jugded.
3611//
3612TofData* MrpcTrack::compareTofData( TofData* tofData1, TofData* tofData2, double zrhit ) {
3613 TofData* tof = tofData1;
3614 // ZTDC compare
3615 if( abs(tofData1->ztdc() - zrhit ) > abs(tofData2->ztdc() - zrhit ) ) {
3616 // SingleEnd/NoT/NoQ compare
3617 if( ( tofData1->quality() & 0xf0 ) >= ( tofData1->quality() & 0xf0 ) ) {
3618 // QDC compare
3619 //if( ( tofData1->adc1() + tofData1->adc2() ) < ( tofData2->adc1() + tofData2->adc2() ) ) {
3620 tof = tofData2;
3621 //}
3622 }
3623 // }
3624 }
3625
3626 return tof;
3627}
3628
3629
3630//------- findTofDataEndcap --------------------------------------
3631// find the right TOF information in TOF data vector
3632// of the exact TOF ID and of the neighbor
3633//
3634void MrpcTrack::findTofDataEndcap( std::vector<TofData*> tofDataVec1, std::vector<TofData*> tofDataVec2, double zr1[5] ) {
3635
3636 unsigned int iflag = 3;
3637 unsigned int qual = 0xf;
3638
3639 if( tofDataVec2.size() == 0 ) {
3640 if( tofDataVec1.size() == 0 ) {
3641 qual = 0;
3642 }
3643 else if( tofDataVec1.size() == 1 ) {
3644 std::vector<TofData*>::iterator iter1 = tofDataVec1.begin();
3645 getTofData( (*iter1), iflag );
3646 qual = 0x1;
3647 }
3648 else if( tofDataVec1.size() > 1 ) {
3649 getTofData( chooseTofDataEndcap( tofDataVec1, zr1 ), iflag );
3650 qual = 0x2;
3651 }
3652 else {
3653 cout << "MrpcRec::MrpcTrack::findTofDataEndcap: 1- Impossible!" << endl;
3654 }
3655 }
3656 else if( ( tofDataVec2.size() == 1 ) ) {
3657 if( tofDataVec1.size() == 0 ) {
3658 std::vector<TofData*>::iterator iter2 = tofDataVec2.begin();
3659 getTofData( (*iter2), iflag );
3660 qual = 0x4;
3661 }
3662 else if( tofDataVec1.size() == 1 ) {
3663 std::vector<TofData*>::iterator iter1 = tofDataVec1.begin();
3664 std::vector<TofData*>::iterator iter2 = tofDataVec2.begin();
3665 getTofData( compareTofDataEndcap( (*iter1), (*iter2) ), iflag );
3666 qual = 0x5;
3667 }
3668 else if( tofDataVec1.size() > 1 ) {
3669 TofData* tofData1 = chooseTofDataEndcap( tofDataVec1, zr1 );
3670 std::vector<TofData*>::iterator iter2 = tofDataVec2.begin();
3671 getTofData( compareTofDataEndcap( tofData1, (*iter2) ), iflag );
3672 qual = 0x6;
3673 }
3674 else {
3675 cout << "MrpcRec::MrpcTrack::findTofDataBarrel: 2- Impossible!" << endl;
3676 }
3677 }
3678 else if( ( tofDataVec2.size() > 1 ) ) {
3679 if( tofDataVec1.size() == 0 ) {
3680 getTofData( chooseTofDataEndcap( tofDataVec2, zr1 ), iflag );
3681 qual = 0x8;
3682 }
3683 else if( tofDataVec1.size() == 1 ) {
3684 std::vector<TofData*>::iterator iter1 = tofDataVec1.begin();
3685 TofData* tofData2 = chooseTofDataEndcap( tofDataVec2, zr1 );
3686 getTofData( compareTofDataEndcap( (*iter1), tofData2 ), iflag );
3687 qual = 0x9;
3688 }
3689 else if( tofDataVec1.size() > 1 ) {
3690 TofData* tofData1 = chooseTofDataEndcap( tofDataVec1, zr1 );
3691 TofData* tofData2 = chooseTofDataEndcap( tofDataVec2, zr1 );
3693 qual = 0xa;
3694 }
3695 else {
3696 cout << "MrpcRec::MrpcTrack::findTofDataBarrel: 3- Impossible!" << endl;
3697 }
3698 }
3699
3700 if( qual == 0 ) {
3701 m_quality1 = ( m_quality1 | 0x300 );
3702 }
3703 else {
3704 qual = ( qual << 12 );
3705 m_quality1 = ( m_quality1 | qual );
3706 }
3707
3708 return;
3709}
3710
3711
3712//------- chooseTofDataEndcap --------------------------------
3713// choose the most possible TofData from TofDataVector
3714//
3715TofData* MrpcTrack::chooseTofDataEndcap( std::vector<TofData*> tofDataVec, double zr1[5] ) {
3716 if( tofDataVec.size() == 0 ) {
3717 cout << "MrpcRec::MrpcTrack::ChooseTofData: Size of TofData Vector is Zero!" << endl;
3718 return 0;
3719 }
3720 std::vector<TofData*>::iterator igood = tofDataVec.begin();
3721 if( tofDataVec.size() > 1 ) {
3722 bool multihit = false;
3723 std::vector<TofData*>::iterator iter = tofDataVec.begin();
3724 for( ; iter != tofDataVec.end(); iter++ ) {
3725 if( (*iter)->qtimes1()>1 ) { multihit = true; }
3726 }
3727
3728 iter = tofDataVec.begin();
3729 if( multihit ) {
3730 double tcorr = -999.0;
3731 double deltaTMin = 999.0;
3732 for( ; iter != tofDataVec.end(); iter++ ) {
3733 tcorr = tofCaliSvc->ETime( (*iter)->adc(), (*iter)->tdc()-m_estime, zr1[2], (*iter)->tofId() );
3734 for( unsigned int i=0; i<5; i++ ) {
3735 if( abs(tcorr-m_texpInner[i]) < deltaTMin ) {
3736 deltaTMin = abs(tcorr-m_texpInner[i]);
3737 igood = iter;
3738 }
3739 }
3740 }
3741 }//close if multihit
3742 else {
3743 double maxQ = 0.0;
3744 for( ; iter != tofDataVec.end(); iter++ ) {
3745 if( (*iter)->adc() > maxQ ) {
3746 maxQ = (*iter)->adc();
3747 igood = iter;
3748 }
3749 }
3750 }
3751 }//close else
3752 return (*igood);
3753}
3754
3755
3756//------- compareTofDataEndcap -------------------------------
3757// choose the most possible TofData from TofDataVector
3758//
3760 TofData* tof = tofData1;
3761 if( tof->adc() < tofData2->adc() ) {
3762 tof = tofData2;
3763 }
3764 return tof;
3765}
3766
3767
3768//------- getTofData -----------------------------------------
3769// set Tof Data of Inner / Outer Layer Barrel TOF and Endcap TOF
3770//
3771void MrpcTrack::getTofData( TofData* tof, unsigned int iflag ) {
3772
3773 if( iflag == 1 ) {
3774 m_tofId1 = tof->tofId();
3775 m_qch1 = tof->adcChannelEast();
3776 m_adc1 = tof->adc1();
3777 m_tdc1 = tof->tdc1();
3778 m_qch2 = tof->adcChannelWest();
3779 m_adc2 = tof->adc2();
3780 m_tdc2 = tof->tdc2();
3781 m_ztdc1 = tof->ztdc();
3782 m_zadc1 = tof->zadc();
3783 m_quality1 = ( m_quality1 | ( 0x1f & tof->quality() ) );
3784 if( ( ( tof->quality() & 0x5 ) != 0x5 ) || ( ( ( tof->quality() & 0x5 ) == 0x5 ) && ( abs( tof->ztdc() - m_zrhit1 ) > ztdc_Cut ) ) ) {
3785 m_quality1 = ( m_quality1 | 0x100 );
3786 }
3787 if( ( ( tof->quality() & 0xa ) != 0xa ) || ( ( ( tof->quality() & 0xa ) == 0xa ) && ( abs( tof->zadc() - m_zrhit1 ) > zadc_Cut ) ) ) {
3788 m_quality1 = ( m_quality1 | 0x200 );
3789 }
3790 }
3791 else if( iflag == 2 ) {
3792 m_tofId2 = tof->tofId();
3793 m_qch3 = tof->adcChannelEast();
3794 m_adc3 = tof->adc1();
3795 m_tdc3 = tof->tdc1();
3796 m_qch4 = tof->adcChannelWest();
3797 m_adc4 = tof->adc2();
3798 m_tdc4 = tof->tdc2();
3799 m_ztdc2 = tof->ztdc();
3800 m_zadc2 = tof->zadc();
3801 m_quality2 = ( m_quality2 | ( 0x1f & tof->quality() ) );
3802 if( ( ( tof->quality() & 0x5 ) != 0x5 ) || ( ( ( tof->quality() & 0x5 ) == 0x5 ) && ( abs( tof->ztdc() - m_zrhit2 ) > ztdc_Cut ) ) ) {
3803 m_quality2 = ( m_quality2 | 0x100 );
3804 }
3805 if( ( ( tof->quality() & 0xa ) != 0xa ) || ( ( ( tof->quality() & 0xa ) == 0xa ) && ( abs( tof->zadc() - m_zrhit2 ) > zadc_Cut ) ) ) {
3806 m_quality2 = ( m_quality2 | 0x200 );
3807 }
3808 }
3809 else if( iflag == 3 ) {
3810 m_tofId1 = tof->tofId();
3811 m_qch1 = tof->adcChannel();
3812 m_adc1 = tof->adc();
3813 m_tdc1 = tof->tdc();
3814 m_quality1 = ( m_quality1 | ( 0x1f & tof->quality() ) );
3815 m_quality1 = ( m_quality1 | 0x300 );
3816 }
3817 else {
3818 cout << "MrpcRec::MrpcTrack::getTofData: Flag which sign the Barrel/Endcap or Inner/Outer is wrong! Please check it!" << endl;
3819 }
3820 tof->setUsed();
3821 return;
3822}
3823
3824
3825//------- getTofDataMRPC -----------------------------------------
3826// set Tof Data of Inner / Outer Layer Barrel TOF and Endcap TOF
3827//
3828void MrpcTrack::getTofDataMRPC( TofData* tof, unsigned int iflag ) {
3829
3830if( iflag == 3 ) {
3831 m_tofId1 = tof->tofId();
3832 m_adc1 = tof->adc();
3833 m_tdc1 = tof->tdc();
3834 m_quality1 = tof->quality();
3835 m_quality1 = ( m_quality1 | 0x300 );
3836 /*
3837 std::cout << "MrpcTrack ::getTofdata() EC begin" << std::endl;
3838 std::cout << " m_tofId1 = "<< m_tofId1 << std::endl;
3839 std::cout << " m_identify "<< tof->identify() << std::endl;
3840 std::cout << " m_adc1 = "<< m_adc1 << std::endl;
3841 std::cout << " m_tdc1 = "<< m_tdc1 << std::endl;
3842 std::cout << " m_quality = "<< m_quality1 << std::endl;
3843 std::cout << "MrpcTrack ::getTofdata() EC end "<< std::endl;
3844 */
3845 }
3846 else {
3847 cout << "MrpcRec::MrpcTrack::setTofData: Flag which sign the Barrel/Endcap or Inner/Outer is wrong! Please check it!" << endl;
3848 }
3849 tof->setUsed();
3850 return;
3851}
3852
3853
3854
3855//------- getTofDataEast ------------------------------------
3856// set Tof Data of Inner / Outer Layer Barrel TOF and Endcap TOF
3857//
3858void MrpcTrack::getTofDataEast( TofData* tof, unsigned int iflag ) {
3859
3860 if( iflag == 1 ) {
3861 m_tofId1 = tof->tofId();
3862 m_qch1 = tof->adcChannelEast();
3863 m_adc1 = tof->adc1();
3864 m_tdc1 = tof->tdc1();
3865 m_qch2 = -999.0;
3866 m_adc2 = -999.0;
3867 m_tdc2 = -999.0;
3868 m_ztdc1 = tof->ztdc();
3869 m_zadc1 = tof->zadc();
3870 m_quality1 = ( ( m_quality1 & 0xfffffff0 ) | ( 0x1c & tof->quality() ) );
3871 if( ( ( tof->quality() & 0x5 ) != 0x5 ) || ( ( ( tof->quality() & 0x5 ) == 0x5 ) && ( abs( tof->ztdc() - m_zrhit1 ) > ztdc_Cut ) ) ) {
3872 m_quality1 = ( m_quality1 | 0x100 );
3873 }
3874 if( ( ( tof->quality() & 0xa ) != 0xa ) || ( ( ( tof->quality() & 0xa ) == 0xa ) && ( abs( tof->zadc() - m_zrhit1 ) > zadc_Cut ) ) ) {
3875 m_quality1 = ( m_quality1 | 0x200 );
3876 }
3877 }
3878 else if( iflag == 2 ) {
3879 m_tofId2 = tof->tofId();
3880 m_qch3 = tof->adcChannelEast();
3881 m_adc3 = tof->adc1();
3882 m_tdc3 = tof->tdc1();
3883 m_qch4 = -999.0;
3884 m_adc4 = -999.0;
3885 m_tdc4 = -999.0;
3886 m_ztdc2 = tof->ztdc();
3887 m_zadc2 = tof->zadc();
3888 m_quality2 = ( ( m_quality2 & 0xfffffff0 ) | ( 0x1c & tof->quality() ) );
3889 if( ( ( tof->quality() & 0x5 ) != 0x5 ) || ( ( ( tof->quality() & 0x5 ) == 0x5 ) && ( abs( tof->ztdc() - m_zrhit2 ) > ztdc_Cut ) ) ) {
3890 m_quality2 = ( m_quality2 | 0x100 );
3891 }
3892 if( ( ( tof->quality() & 0xa ) != 0xa ) || ( ( ( tof->quality() & 0xa ) == 0xa ) && ( abs( tof->zadc() - m_zrhit2 ) > zadc_Cut ) ) ) {
3893 m_quality2 = ( m_quality2 | 0x200 );
3894 }
3895 }
3896 else {
3897 cout << "MrpcRec::MrpcTrack::getTofDataEast: Flag which sign the Barrel/Endcap or Inner/Outer is wrong! Please check it!" << endl;
3898 }
3899 tof->setUsed();
3900 return;
3901}
3902
3903
3904//------- getTofDataWest ------------------------------------
3905// set Tof Data of Inner / Outer Layer Barrel TOF and Endcap TOF
3906//
3907void MrpcTrack::getTofDataWest( TofData* tof, unsigned int iflag ) {
3908
3909 if( iflag == 1 ) {
3910 m_tofId1 = tof->tofId();
3911 m_qch1 = -999.0;
3912 m_adc1 = -999.0;
3913 m_tdc1 = -999.0;
3914 m_qch2 = tof->adcChannelWest();
3915 m_adc2 = tof->adc2();
3916 m_tdc2 = tof->tdc2();
3917 m_ztdc1 = tof->ztdc();
3918 m_zadc1 = tof->zadc();
3919 m_quality1 = ( ( m_quality1 & 0xfffffff0 ) | ( 0x13 & tof->quality() ) );
3920 if( ( ( tof->quality() & 0x5 ) != 0x5 ) || ( ( ( tof->quality() & 0x5 ) == 0x5 ) && ( abs( tof->ztdc() - m_zrhit1 ) > ztdc_Cut ) ) ) {
3921 m_quality1 = ( m_quality1 | 0x100 );
3922 }
3923 if( ( ( tof->quality() & 0xa ) != 0xa ) || ( ( ( tof->quality() & 0xa ) == 0xa ) && ( abs( tof->zadc() - m_zrhit1 ) > zadc_Cut ) ) ) {
3924 m_quality1 = ( m_quality1 | 0x200 );
3925 }
3926 }
3927 else if( iflag == 2 ) {
3928 m_tofId2 = tof->tofId();
3929 m_qch3 = -999.0;
3930 m_adc3 = -999.0;
3931 m_tdc3 = -999.0;
3932 m_qch4 = tof->adcChannelWest();
3933 m_adc4 = tof->adc2();
3934 m_tdc4 = tof->tdc2();
3935 m_ztdc2 = tof->ztdc();
3936 m_zadc2 = tof->zadc();
3937 m_quality2 = ( ( m_quality2 & 0xfffffff0 ) | ( 0x13 & tof->quality() ) );
3938 if( ( ( tof->quality() & 0x5 ) != 0x5 ) || ( ( ( tof->quality() & 0x5 ) == 0x5 ) && ( abs( tof->ztdc() - m_zrhit2 ) > ztdc_Cut ) ) ) {
3939 m_quality2 = ( m_quality2 | 0x100 );
3940 }
3941 if( ( ( tof->quality() & 0xa ) != 0xa ) || ( ( ( tof->quality() & 0xa ) == 0xa ) && ( abs( tof->zadc() - m_zrhit2 ) > zadc_Cut ) ) ) {
3942 m_quality2 = ( m_quality2 | 0x200 );
3943 }
3944 }
3945 else {
3946 cout << "MrpcRec::MrpcTrack::getTofDataWest: Flag which sign the Barrel/Endcap or Inner/Outer is wrong! Please check it!" << endl;
3947 }
3948 tof->setUsed();
3949 return;
3950}
3951
3952
3953//------- getTofData -----------------------------------------
3954// set Tof Data of Inner / Outer Layer Barrel TOF and Endcap TOF
3955//
3956void MrpcTrack::getTofDataNohit( unsigned int iflag ) {
3957
3958 if( iflag == 1 ) {
3959 m_tofId1 = -99;
3960 m_qch1 = -999.0;
3961 m_adc1 = -999.0;
3962 m_tdc1 = -999.0;
3963 m_qch2 = -999.0;
3964 m_adc2 = -999.0;
3965 m_tdc2 = -999.0;
3966 m_ztdc1 = -999.0;
3967 m_zadc1 = -999.0;
3968 m_quality1 = ( m_quality1 & 0x700 );
3969 if( m_hitCase == InnerLayer ) { m_hitCase = NoHit; }
3970 else if( m_hitCase == DoubleLayer ) { m_hitCase = OuterLayer; }
3971 }
3972 else if( iflag == 2 ) {
3973 m_tofId2 = -99;
3974 m_qch3 = -999.0;
3975 m_adc3 = -999.0;
3976 m_tdc3 = -999.0;
3977 m_qch4 = -999.0;
3978 m_adc4 = -999.0;
3979 m_tdc4 = -999.0;
3980 m_ztdc2 = -999.0;
3981 m_zadc2 = -999.0;
3982 m_quality2 = ( m_quality2 & 0x700 );
3983 if( m_hitCase == OuterLayer ) { m_hitCase = NoHit; }
3984 else if( m_hitCase == DoubleLayer ) { m_hitCase = InnerLayer; }
3985 }
3986 else {
3987 cout << "MrpcRec::MrpcTrack::getTofData: Flag which sign the Barrel/Endcap or Inner/Outer is wrong! Please check it!" << endl;
3988 }
3989
3990 return;
3991}
3992
3993
3994//------- setCalibration() ----------------------------------------
3995// get calibration constants
3996// ph11() - ph22(), tof11() -- tof22()
3997// ph1() ph2() ph(), tof1() tof2() tof()
3998//
4000
4001 bool barrel = ( ( m_hitCase == InnerLayer ) || ( m_hitCase == OuterLayer ) || ( m_hitCase == DoubleLayer ) );
4002 bool endcap = ( ( m_hitCase == EastEndcap ) || ( m_hitCase == WestEndcap ) );
4003 bool newmrpcendcap = ((m_hitCase == westendcap_1) || (m_hitCase == westendcap_2) || (m_hitCase == eastendcap_1) || (m_hitCase == eastendcap_2));
4004
4005 bool innerEast = ( ( m_quality1 & 0xc ) == 0xc );
4006 bool innerWest = ( ( m_quality1 & 0x3 ) == 0x3 );
4007 bool outerEast = ( ( m_quality2 & 0xc ) == 0xc );
4008 bool outerWest = ( ( m_quality2 & 0x3 ) == 0x3 );
4009 bool innerLayer = ( ( m_quality1 & 0xf ) == 0xf );
4010 bool outerLayer = ( ( m_quality2 & 0xf ) == 0xf );
4011
4012 bool endcapData = ( ( m_quality1 & 0xc ) == 0xc );
4013 bool newmrpcendcapData = ( ( m_quality1 & 0xc ) == 0xc );
4014
4015 if( m_hitCase == DoubleLayer ) {
4016 for( unsigned int i=0; i<5; i++ ) {
4017 m_texp[i] = tofCaliSvc->BTimeCluster( m_texpInner[i], m_texpOuter[i], m_zr1[i], m_zr2[i], m_tofId1, m_tofId2 );
4018 }
4019 m_path = tofCaliSvc->BTimeCluster( m_path1, m_path2, m_zrhit1, m_zrhit2, m_tofId1, m_tofId2 );
4020 }
4021
4022 if( barrel ) {
4023 if( innerEast ) {
4024 for( unsigned int i=0; i<5; i++ ) {
4025 m_tof11[i] = tofCaliSvc->BTime1( m_adc1, m_tdc1-m_estime, m_zr1[i], m_tofId1,m_estime );
4026 //m_tof11[i] = tofCaliSvc->BTime1( m_adc1, m_tdc1-m_estime, m_zr1[i], m_tofId1 );
4027 }
4028 m_sigma11 = tofCaliSvc->BSigma1( m_zrhit1, m_tofId1 );
4029 m_ph11 = m_adc1;
4030 }
4031
4032 if( innerWest ) {
4033 for( unsigned int i=0; i<5; i++ ) {
4034 m_tof12[i] = tofCaliSvc->BTime2( m_adc2, m_tdc2-m_estime, m_zr1[i], m_tofId1,m_estime );
4035 //m_tof12[i] = tofCaliSvc->BTime2( m_adc2, m_tdc2-m_estime, m_zr1[i], m_tofId1);
4036 }
4037 m_sigma12 = tofCaliSvc->BSigma2( m_zrhit1, m_tofId1 );
4038 m_ph12 = m_adc2;
4039 }
4040
4041 if( innerLayer ) {
4042 for( unsigned int i=0; i<5; i++ ) {
4043 m_tof1[i] = tofCaliSvc->BTimeCounter( m_tof11[i], m_tof12[i], m_zr1[i], m_tofId1 );
4044 }
4045 m_sigma1 = tofCaliSvc->BSigmaCounter( m_zrhit1, m_tofId1 );
4046 m_ph1 = tofCaliSvc->BPulseHeight( m_adc1, m_adc2, m_zrhit1, m_theta1, m_tofId1 );
4047 /*
4048 if( m_hitCase == InnerLayer ) {
4049 for( unsigned int i=0; i<5; i++ ) {
4050 m_tof[i] = m_tof1[i];
4051 }
4052 m_sigma = m_sigma1;
4053 }
4054 */
4055 }
4056
4057 if( outerEast ) {
4058 for( unsigned int i=0; i<5; i++ ) {
4059 m_tof21[i] = tofCaliSvc->BTime1( m_adc3, m_tdc3-m_estime, m_zr2[i], m_tofId2,m_estime );
4060 //m_tof21[i] = tofCaliSvc->BTime1( m_adc3, m_tdc3-m_estime, m_zr2[i], m_tofId2 );
4061 }
4062 m_sigma21 = tofCaliSvc->BSigma1( m_zrhit2, m_tofId2 );
4063 m_ph21 = m_adc3;
4064 }
4065
4066 if( outerWest ) {
4067 for( unsigned int i=0; i<5; i++ ) {
4068 m_tof22[i] = tofCaliSvc->BTime2( m_adc4, m_tdc4-m_estime, m_zr2[i], m_tofId2,m_estime );
4069 //m_tof22[i] = tofCaliSvc->BTime2( m_adc4, m_tdc4-m_estime, m_zr2[i], m_tofId2 );
4070 }
4071 m_sigma22 = tofCaliSvc->BSigma2( m_zrhit2, m_tofId2 );
4072 m_ph22 = m_adc4;
4073 }
4074
4075 if( outerLayer ) {
4076 for( unsigned int i=0; i<5; i++ ) {
4077 m_tof2[i] = tofCaliSvc->BTimeCounter( m_tof21[i], m_tof22[i], m_zr2[i], m_tofId2 );
4078 }
4079 m_sigma2 = tofCaliSvc->BSigmaCounter( m_zrhit2, m_tofId2 );
4080 m_ph2 = tofCaliSvc->BPulseHeight( m_adc3, m_adc4, m_zrhit2, m_theta2, m_tofId2 );
4081 /*
4082 if( m_hitCase == OuterLayer ) {
4083 for( unsigned int i=0; i<5; i++ ) {
4084 m_tof[i] = m_tof2[i];
4085 }
4086 m_sigma = m_sigma2;
4087 }
4088 */
4089 }
4090
4091 if( innerLayer && outerLayer ) {
4092 for( unsigned int i=0; i<5; i++ ) {
4093 m_tof[i] = tofCaliSvc->BTimeCluster( m_tof1[i], m_tof2[i], m_zr1[i], m_zr2[i], m_tofId1, m_tofId2 );
4094 }
4095 m_sigma = tofCaliSvc->BSigmaCluster( m_zrhit1, m_zrhit2, m_tofId1, m_tofId2 );
4096 m_ph = tofCaliSvc->BTimeCluster( m_ph1, m_ph2, m_zrhit1, m_zrhit2, m_tofId1, m_tofId2 );
4097 }
4098 }
4099
4100 if( endcap ) {
4101 if( endcapData ) {
4102 for( unsigned int i=0; i<5; i++ ) {
4103 m_tof11[i] = tofCaliSvc->ETime( m_adc1, m_tdc1-m_estime, m_zr1[i], m_tofId1 );
4104 }
4105 m_sigma11 = tofCaliSvc->ESigma( m_zrhit1, m_tofId1 );
4106 m_ph11 = tofCaliSvc->EPulseHeight( m_adc1, m_zrhit1, m_theta1, m_tofId1 );
4107 m_quality = 1;
4108 if( (m_quality1&0xa000)!=0 ) { m_quality = 4; }
4109 }
4110 }
4111 if( newmrpcendcap ) {
4112 if( newmrpcendcapData ) {
4113 //std::cout << "MrpcTrack setCalibration(): Set the values for the new endcap!" << std::endl;
4114 for( unsigned int i=0; i<5; i++ ) {
4115
4116
4117 //Calculate the transitiontime for the signal!
4118 double my_partID=0;
4119 if(m_hitCase==eastendcap_2) my_partID=3;
4120 if(m_hitCase==eastendcap_1) my_partID=4;
4121 if(m_hitCase==westendcap_1) my_partID=5;
4122 if(m_hitCase==westendcap_2) my_partID=6;
4124 double my_transtime = BesTofDigitizerEcV4::Calculate_strip_transition_time_cont( m_zrhit1*cos(m_phi1)*10., m_zrhit1*sin(m_phi1)*10., my_partID,my_module);
4125 double strip_transition_time=0;
4126
4127 if(mrpc_extrapolation_good && my_transtime!=0)
4128 {
4129 strip_transition_time=my_transtime;
4130 }
4131 else
4132 {
4134 }
4135
4136 m_tof11[i] = m_tdc1-m_estime-strip_transition_time;;
4137
4138 m_sigma_mrpc[i] = mrpcCaliSvc->GetSigma(m_momentum, m_tofId1, i, false);// 0 = GetSigmaElectron, 1 = GetSigmaMuon, 2 = GetSigmaPion, 3 = GetSigmaKaon, 4=GetSigmaProton, - false = SE Readout
4139
4140 }
4141 m_ph11 = m_adc1;
4142
4143 m_quality = 1;
4144 if( (m_quality1&0xa000)!=0 ) { m_quality = 4; }
4145
4146 }
4147 }
4148
4149 // set Quality of Barrel TOF
4150 if( barrel ) {
4151
4152 // double layer
4153 if( innerLayer && outerLayer ) {
4154 m_quality = 1;
4155 }
4156 else {
4157 // single layer
4158 if( innerLayer || outerLayer ) {
4159 m_quality = 2;
4160 }
4161 else {
4162 // single-end of one layer
4163 if( innerEast || innerWest || outerEast || outerWest ) {
4164 m_quality = 3;
4165 }
4166 }
4167 }
4168
4169 // multi-hit
4170 if( ( (m_quality1&0xa000)!=0 ) || ( (m_quality2&0xa000)!=0 ) ) {
4171 m_quality = m_quality + 3;
4172 }
4173
4174 // ztdc and extrapolated zhit is not matched
4175 if( ( (m_quality1&0x100)==0x100 ) || ( (m_quality2&0x100)==0x100 ) ) {
4176 if( ( m_quality == 1 ) || ( m_quality == 4 ) ) { m_quality = 7; }
4177 else if( ( m_quality == 2 ) || ( m_quality == 5 ) ) { m_quality = 8; }
4178 else if( ( m_quality == 3 ) || ( m_quality == 6 ) ) { m_quality = 9; }
4179 else {
4180 cout << "MrpcRec::MrpcTrack::setCalibration: Impossible!" << endl;
4181 }
4182 }
4183
4184 }
4185
4186 return;
4187}
4188
4189
4190//------- convert2RecMrpcTrackCol() -----------------------------------
4191// generate RecMrpcTrackCol
4192//
4194
4195 bool barrel = ( ( m_hitCase == InnerLayer ) || ( m_hitCase == OuterLayer ) || ( m_hitCase == DoubleLayer ) );
4196
4197 bool innerEast = ( ( m_quality1 & 0xc ) == 0xc );
4198 bool innerWest = ( ( m_quality1 & 0x3 ) == 0x3 );
4199 bool outerEast = ( ( m_quality2 & 0xc ) == 0xc );
4200 bool outerWest = ( ( m_quality2 & 0x3 ) == 0x3 );
4201
4202 if( barrel ) {
4203
4204 if( innerEast ) {
4205 RecTofTrack* atrack11 = new RecTofTrack;
4206 buildRecTofTrack( atrack11, 11 ); // innerlayer east readout
4207 TofHitStatus* hitStatus11 = new TofHitStatus;
4208 if( innerWest ) {
4209 hitStatus11->setBarrelReadout( 1, true ); // innerlayer east readout
4210 }
4211 else {
4212 if( m_hitCase == InnerLayer ) {
4213 hitStatus11->setBarrelCluster( 11 ); // innerlayer east cluster
4214 }
4215 else if( m_hitCase == DoubleLayer ) {
4216 if( outerEast && outerWest ) {
4217 hitStatus11->setBarrelCounter( 11 ); // innerlayer east counter
4218 }
4219 else {
4220 hitStatus11->setBarrelCluster( 11 ); // innerlayer east cluster
4221 }
4222 }
4223 else {
4224 cout << "MrpcRec::MrpcTrack:convert2RecTofTrackCol: 11- Impossible!" << endl;
4225 }
4226 }
4227 atrack11->setStatus( hitStatus11->value() );
4228 delete hitStatus11;
4229 recTofTrackCol->push_back( atrack11 );
4230 } //close innerEast
4231
4232 if( innerWest ) {
4233 RecTofTrack* atrack12 = new RecTofTrack;
4234 buildRecTofTrack( atrack12, 12 ); // innerlayer west readout
4235 TofHitStatus* hitStatus12 = new TofHitStatus;
4236 if( innerEast ) {
4237 hitStatus12->setBarrelReadout( 1, false ); // innerlayer west
4238 }
4239 else {
4240 if( m_hitCase == InnerLayer ) {
4241 hitStatus12->setBarrelCluster( 12 ); // innerlayer west cluster
4242 }
4243 else if( m_hitCase == DoubleLayer ) {
4244 if( outerEast && outerWest ) {
4245 hitStatus12->setBarrelCounter( 12 ); // innerlayer west counter
4246 }
4247 else {
4248 hitStatus12->setBarrelCluster( 12 ); // innerlayer west cluster
4249 }
4250 }
4251 else {
4252 cout << "MrpcRec::MrpcTrack:convert2RecTofTrackCol: 12- Impossible!" << endl;
4253 }
4254 }
4255 atrack12->setStatus( hitStatus12->value() );
4256 delete hitStatus12;
4257 recTofTrackCol->push_back( atrack12 );
4258 } //close innerWest
4259
4260 if( innerEast && innerWest ) {
4261 RecTofTrack* atrack1 = new RecTofTrack;
4262 buildRecTofTrack( atrack1, 1 ); // innerlayer counter
4263 TofHitStatus* hitStatus1 = new TofHitStatus;
4264 if( m_hitCase == InnerLayer ) {
4265 hitStatus1->setBarrelCluster( 1 ); // innerlayer cluster and counter
4266 }
4267 else if( m_hitCase == DoubleLayer ) {
4268 if( outerEast && outerWest ) {
4269 hitStatus1->setBarrelCounter( 1 ); // innerlayer counter
4270 }
4271 else {
4272 hitStatus1->setBarrelCluster( 1 ); // innerlayer cluster and counter
4273 }
4274 }
4275 else {
4276 cout << "MrpcRec::TofTrack:convert2RecTofTrackCol: 1- Impossible!" << endl;
4277 }
4278 atrack1->setStatus( hitStatus1->value() );
4279 delete hitStatus1;
4280 recTofTrackCol->push_back( atrack1 );
4281 }//close innerEast && innerWest
4282
4283 if( outerEast ) {
4284 RecTofTrack* atrack21 = new RecTofTrack;
4285 buildRecTofTrack( atrack21, 21 ); // outerlayer east readout
4286 TofHitStatus* hitStatus21 = new TofHitStatus;
4287 if( outerWest ) {
4288 hitStatus21->setBarrelReadout( 2, true ); // outerlayer east readout
4289 }
4290 else {
4291 if( m_hitCase == OuterLayer ) {
4292 hitStatus21->setBarrelCluster( 21 ); // outerlayer east cluster
4293 }
4294 else if( m_hitCase == DoubleLayer ) {
4295 if( innerEast || innerWest ) {
4296 hitStatus21->setBarrelCounter( 21 ); // outerlayer east counter
4297 }
4298 // else {
4299 // hitStatus21->setBarrelCluster( 21 ); // outerlayer east cluster
4300 // }
4301 }
4302 else {
4303 cout << "MrpcRec::MrpcTrack:convert2RecTofTrackCol: 21- Impossible!" << endl;
4304 }
4305 }
4306 atrack21->setStatus( hitStatus21->value() );
4307 delete hitStatus21;
4308 recTofTrackCol->push_back( atrack21 );
4309 }//close outerEast
4310
4311 if( outerWest ) {
4312 RecTofTrack* atrack22 = new RecTofTrack;
4313 buildRecTofTrack( atrack22, 22 ); // outerlayer west readout
4314 TofHitStatus* hitStatus22 = new TofHitStatus;
4315 if( outerEast ) {
4316 hitStatus22->setBarrelReadout( 2, false ); // outerlayer west readout
4317 }
4318 else {
4319 if( m_hitCase == OuterLayer ) {
4320 hitStatus22->setBarrelCluster( 22 ); // outerlayer west cluster
4321 }
4322 else if( m_hitCase == DoubleLayer ) {
4323 if( innerEast || innerWest ) {
4324 hitStatus22->setBarrelCounter( 22 ); // outerlayer west counter
4325 }
4326 // else {
4327 // hitStatus22->setBarrelCluster( 22 ); // outerlayer west cluster
4328 // }
4329 }
4330 else {
4331 cout << "MrpcRec::MrpcTrack:convert2RecTofTrackCol: 22- Impossible!" << endl;
4332 }
4333 }
4334 atrack22->setStatus( hitStatus22->value() );
4335 delete hitStatus22;
4336 recTofTrackCol->push_back( atrack22 );
4337 }//close oterWest
4338
4339 if( outerEast && outerWest ) {
4340 RecTofTrack* atrack2 = new RecTofTrack;
4341 buildRecTofTrack( atrack2, 2 ); // outerlayer counter
4342 TofHitStatus* hitStatus2 = new TofHitStatus;
4343 if( m_hitCase == OuterLayer ) {
4344 hitStatus2->setBarrelCluster( 2 ); // outerlayer cluster and counter
4345 }
4346 else if( m_hitCase == DoubleLayer ) {
4347 if( innerEast && innerWest ) {
4348 hitStatus2->setBarrelCounter( 2 ); // outerlayer counter
4349 }
4350 else {
4351 hitStatus2->setBarrelCluster( 2 ); // outerlayer cluster and counter
4352 }
4353 }
4354 else {
4355 cout << "MrpcRec::MrpcTrack:convert2RecTofTrackCol: 2- Impossible!" << endl;
4356 }
4357 atrack2->setStatus( hitStatus2->value() );
4358 delete hitStatus2;
4359 recTofTrackCol->push_back( atrack2 );
4360 } //close outerEast && outerWest
4361
4362 if( innerEast && innerWest && outerEast && outerWest ) {
4363 RecTofTrack* atrack = new RecTofTrack;
4364 buildRecTofTrack( atrack, 0 ); // doublelayer cluster
4365 TofHitStatus* hitStatus = new TofHitStatus;
4366 hitStatus->setBarrelCluster( 3 ); // doublelayer cluster
4367 atrack->setStatus( hitStatus->value() );
4368 delete hitStatus;
4369 recTofTrackCol->push_back( atrack );
4370 } //close innerEast && innerWest && outerEast && outerWest
4371
4372 } //close if(barrel)
4373
4374 if( ( m_hitCase == EastEndcap ) || ( m_hitCase == WestEndcap ) || (m_hitCase ==eastendcap_1) || (m_hitCase ==eastendcap_2) || (m_hitCase ==westendcap_1) || (m_hitCase ==westendcap_2)) {
4375
4376 RecTofTrack* atrack = new RecTofTrack;
4377 buildRecTofTrack( atrack, 11 ); // eastendcap counter
4378
4379 TofHitStatus* hitStatus = new TofHitStatus;
4380 // std::cout << "MrpcTrack convert2RecTofTrackCol hitStatus->value() after initialize= " << hitStatus->value() << std::endl;
4381
4382 if( m_hitCase == EastEndcap ||(m_hitCase ==eastendcap_1) || (m_hitCase ==eastendcap_2) ) {
4383 hitStatus->setEndcapCluster( true ); // east endcap cluster counter readout
4384 }
4385 else if( (m_hitCase == WestEndcap) || (m_hitCase ==westendcap_1) || (m_hitCase ==westendcap_2) ) {
4386 hitStatus->setEndcapCluster( false ); // west endcap cluster counter readout
4387 }
4388 else {
4389 cout << "MrpcRec::MrpcTrack:convert2RecTofTrackCol: endcap- Impossible!" << endl;
4390 }
4391 // std::cout << "MrpcTrack convert2RecTofTrackCol hitStatus->value() = " << hitStatus->value() << std::endl;
4392 atrack->setStatus( hitStatus->value() );//Set m_status within DstTofTrack.h
4393
4394 delete hitStatus;
4395 recTofTrackCol->push_back( atrack );
4396 }
4397
4398 if( m_hitCase == NoHit ) {
4399 RecTofTrack* atrack = new RecTofTrack;
4400 buildRecTofTrack( atrack, 3 ); // no hit
4401 TofHitStatus* hitStatus = new TofHitStatus;
4402 hitStatus->setNoHit(); // no hit
4403 atrack->setStatus( hitStatus->value() );
4404 delete hitStatus;
4405 recTofTrackCol->push_back( atrack );
4406 }
4407
4408 return;
4409}
4410
4411
4412
4413void MrpcTrack::buildRecTofTrack( RecTofTrack* track, int layerorend ) {
4414
4415 track->setTofTrackID( m_tofTrackId );
4416 track->setTrackID( m_trackId );
4417
4418 // std::cout << "MrpcTrack::buildRecTofTrack m_tofTrackId= " << m_tofTrackId <<std::endl;
4419 // std::cout << "MrpcTrack::buildRecTofTrack m_trackId= " << m_trackId <<std::endl;
4420
4421 track->setErrTof( 0.0 );
4422 track->setBeta( 0.0 );
4423
4424 double sigma[6];
4425 for( int i=0; i<6; i++ ) {
4426 sigma[i] = 0.0;
4427 }
4428 track->setSigma( sigma );
4429 track->setQuality( m_quality );
4430 track->setT0( m_estime );
4431 // std::cout << "MrpcTrack buildRecTofTrack : Set m_quality | m_estime " << m_quality << " | " << m_estime << std::endl;
4432 track->setErrT0( 0.0 );
4433 track->setPhi( 9999.0 );
4434 track->setErrPhi( 9999.0 );
4435 track->setEnergy( 9999.0 );
4436 track->setErrEnergy( 9999.0 );
4437
4438 if( ( layerorend == 11 ) || ( layerorend == 12 ) || ( layerorend == 1 ) ) {
4439
4440
4441
4442
4443
4444 //Within RecTofTrack and DstTrack the partID or the identifier is not stored anymore. Only the cellID and an east or westinformation (within TofHitstatus).
4445 //In order to identfy the elements correctly we add to the new MRPC innerlayer +100 : They will have a larger number than the old Tof EC.
4446 //For the the outer layer we add +100 +474.
4447 //Hence it is possible to identify the correct readoutstrip with east/west information and unique number.
4448
4449 if( (m_hitCase ==eastendcap_1) || (m_hitCase == westendcap_1))
4450 {
4451 m_tofId1 = m_tofId1 + 100;
4452 //std::cout << "MrpcTrack Layer --- 1 : m_tofId1+100 = "<< m_tofId1 << std::endl;
4453 }
4454
4455 if( (m_hitCase ==eastendcap_2) || (m_hitCase == westendcap_2))
4456 {
4457 m_tofId1 = m_tofId1 + 100 + 474;
4458 //std::cout <<"MrpcTrack Layer --- 2 : m_tofId1+474 = "<< m_tofId1 << std::endl;
4459 }
4460
4461 track->setTofID( m_tofId1 );
4462 track->setPath( m_path1 );
4463 track->setZrHit( m_zrhit1 );
4464 track->setErrZ( m_errzr1 );
4465 track->setTexp( m_texpInner );
4466
4467 //std::cout << "MrpcTrack buildRecMrpcTrack :layerorend == 11,12,1 Set m_tofId1 = " << m_tofId1 << std::endl;
4468 //std::cout << "MrpcTrack buildRecMrpcTrack : Set m_path1 = " << m_path1 << std::endl;
4469 //std::cout << "MrpcTrack buildRecTofTrack : Set m_zrhit1 = " << m_zrhit1 << std::endl;
4470 //std::cout << "MrpcTrack buildRecTofTrack : Set m_errzr1 = " << m_errzr1 << std::endl;
4471 //std::cout << "MrpcTrack buildRecTofTrack : Set m_texpInner = " << m_texpInner << std::endl;
4472
4473 setRecTofTrack( track, layerorend );
4474 }
4475
4476 if( ( layerorend==21 ) || ( layerorend==22 ) || ( layerorend==2 ) ) {
4477 track->setTofID( m_tofId2 );
4478 track->setPath( m_path2 );
4479 track->setZrHit( m_zrhit2 );
4480 track->setErrZ( m_errzr2 );
4481 track->setTexp( m_texpOuter );
4482 //std::cout << "MrpcTrack buildRecTofTrack :layerorend == 21,22,2 Set m_tofId2 = " << m_tofId2 << std::endl;
4483 setRecTofTrack( track, layerorend );
4484 }
4485
4486 if( layerorend==0 ) {
4487 track->setTofID( m_tofId1 );
4488 track->setPath( m_path2 );
4489 track->setZrHit( m_zrhit2 );
4490 track->setErrZ( m_errzr2 );
4491 track->setTexp( m_texp );
4492
4493 //std::cout << "MrpcTrack buildRecTofTrack :layerorend == 0 Set m_tofId1 = " << m_tofId1 << std::endl;
4494 setRecTofTrack( track, layerorend );
4495 }
4496
4497 if( layerorend == 3 ) {
4498 track->setTofID( m_id1 );
4499 track->setPath( m_path1 );
4500 track->setZrHit( m_zrhit1 );
4501 track->setErrZ( m_errzr1 );
4502 track->setTexp( m_texpInner );
4503
4504 //std::cout << "MrpcTrack buildRecTofTrack :layerorend == 3 Set m_tofId1 = " << m_id1 << std::endl;
4505 }
4506
4507 return;
4508}
4509
4510
4511void MrpcTrack::setRecTofTrack( RecTofTrack* track, int layerorend ) {
4512
4513 double toffset[6];
4514 for( unsigned int i=0; i<6; i++ ) {
4515 toffset[i] = 0.0;
4516 }
4517
4518 if( layerorend == 0 ) { // cluster or double layer hit
4519 track->setPh( m_ph );
4520 track->setTof( m_tof[0] );
4521 track->setSigmaElectron( m_sigma );
4522 for( unsigned int i=0; i<5; i++ ) {
4523 toffset[i] = m_tof[0] - m_tof[i];
4524 }
4525 track->setToffset( toffset );
4526 track->setBeta( m_path/m_tof[0]/30.0 );
4527 }
4528 else if( layerorend == 1 ) { // inner layer
4529 track->setPh( m_ph1 );
4530 track->setTof( m_tof1[0] );
4531 track->setSigmaElectron( m_sigma1 );
4532 for( unsigned int i=0; i<5; i++ ) {
4533 toffset[i] = m_tof1[0] - m_tof1[i];
4534 }
4535 track->setToffset( toffset );
4536 track->setBeta( m_path1/m_tof1[0]/30.0 );
4537 }
4538 else if( layerorend == 2 ) { // outer layer
4539 track->setPh( m_ph2 );
4540 track->setTof( m_tof2[0] );
4541 track->setSigmaElectron( m_sigma2 );
4542 for( unsigned int i=0; i<5; i++ ) {
4543 toffset[i] = m_tof2[0] - m_tof2[i];
4544 }
4545 track->setToffset( toffset );
4546 track->setBeta( m_path2/m_tof2[0]/30.0 );
4547 }
4548 else if( layerorend == 11 ) { // inner layer east end readout
4549 track->setPh( m_ph11 );
4550 track->setTof( m_tof11[0] );
4551 track->setSigmaElectron( m_sigma11 );
4552
4553 if((m_hitCase ==eastendcap_1) || (m_hitCase ==eastendcap_2) || (m_hitCase ==westendcap_1) || (m_hitCase ==westendcap_2))
4554 {
4555 track->setSigmaElectron(m_sigma_mrpc[0]);
4556 track->setSigmaMuon(m_sigma_mrpc[1]);
4557 track->setSigmaPion(m_sigma_mrpc[2]);
4558 track->setSigmaKaon(m_sigma_mrpc[3]);
4559 track->setSigmaProton(m_sigma_mrpc[4]);
4560 }
4561
4562 for( unsigned int i=0; i<5; i++ ) {
4563 toffset[i] = m_tof11[0] - m_tof11[i];
4564 }
4565 track->setToffset( toffset );
4566 track->setBeta( m_path1/m_tof11[0]/30.0 );
4567 //std::cout << "MrpcTrack setRecTofTrack : Set Beta = " <<m_path1/m_tof11[0]/30.0 << std::endl;
4568
4569 }
4570 else if( layerorend == 12 ) { // inner layer west end readout
4571 track->setPh( m_ph12 );
4572 track->setTof( m_tof12[0] );
4573 track->setSigmaElectron( m_sigma12 );
4574 for( unsigned int i=0; i<5; i++ ) {
4575 toffset[i] = m_tof12[0] - m_tof12[i];
4576 }
4577 track->setToffset( toffset );
4578 track->setBeta( m_path1/m_tof12[0]/30.0 );
4579 }
4580 else if( layerorend == 21 ) { // outer layer east end readout
4581 track->setPh( m_ph21 );
4582 track->setTof( m_tof21[0] );
4583 track->setSigmaElectron( m_sigma21 );
4584 for( unsigned int i=0; i<5; i++ ) {
4585 toffset[i] = m_tof21[0] - m_tof21[i];
4586 }
4587 track->setToffset( toffset );
4588 track->setBeta( m_path2/m_tof21[0]/30.0 );
4589 }
4590 else if( layerorend == 22 ) { // outer layer west end readout
4591 track->setPh( m_ph22 );
4592 track->setTof( m_tof22[0] );
4593 track->setSigmaElectron( m_sigma22 );
4594 for( unsigned int i=0; i<5; i++ ) {
4595 toffset[i] = m_tof22[0] - m_tof22[i];
4596 }
4597 track->setToffset( toffset );
4598 track->setBeta( m_path2/m_tof22[0]/30.0 );
4599 }
4600 else{
4601 cout << "MrpcRec MrpcTrack::SetRecTofTrack layerorend = " << layerorend << endl;
4602 }
4603 return;
4604}
4605
4606
4607
4608//Be carefull: As I did have problems with the linking, the following function does
4609//exist in TofShower.cxx in TofEnergyRec, too.
4610int MrpcTrack::get_mrpc_stripid_neighbour(string which,int stripid,int layer)
4611{
4614
4615 int neighbourstrip=0;
4616 int neighbourmodule=0;
4617
4618 int returnvalue=0;
4619
4620 if(strip==0) return 0; //Falls vorher schon strip 1,2 oder 23,24 gibt die Funtion 0 zurück, diese vlt. nochmalige Eingabe wird hier abgefangen und wieder eine 0 zureuckgegebn!
4621
4622
4623 if(which=="l")
4624 {
4625 if(strip%2==0) //gerade Stripnummer
4626 {
4627 neighbourstrip=strip-1; //linke Nachbar ist dann immer -1
4628 if(layer==3 || layer== 6)
4629 {neighbourmodule=module;}//Nachbarmodul ist selbes Modul
4630 else
4631 {neighbourmodule=module;}//Nachbarmodul ist selbes Modul
4632 }
4633 else //ungerade stripnummer
4634 {
4635 neighbourstrip=strip+1;
4636
4637 if(layer==3 || layer== 5)
4638 {
4639 neighbourmodule=module; //In diesem Fall sind die Nachbarschaftsmodule immer gleich
4640 }
4641 else
4642 {
4643 neighbourmodule=module+1;
4644 if(neighbourmodule==19){neighbourmodule=1;}
4645 }
4646
4647 }
4648
4649 returnvalue= BesTofDigitizerEcV4::Produce_unique_identifier(neighbourmodule, neighbourstrip);
4650 } //close if which==l
4651
4652 else if(which=="r")
4653 {
4654 if(strip%2==0) //gerade Stripnummer
4655 {
4656 neighbourstrip=strip-1; //rechte Nachbar ist dann immer -1
4657
4658 if(layer==4 || layer== 6)
4659 {neighbourmodule=module;}//In diesem Fall ist das rechte Nachbarmodul immer die gleiche modulnummer
4660 else
4661 {neighbourmodule=module-1;
4662 if(neighbourmodule==0){neighbourmodule=18;}
4663 }
4664 }
4665 else //ungerade stripnummer
4666 {
4667 neighbourstrip=strip+1;
4668 if(layer==3 || layer== 6)
4669 {neighbourmodule=module;}//Nachbarmodul ist selbes Modul
4670 else
4671 {neighbourmodule=module;} //Nachbarmodul ist selbes Modul
4672
4673 }
4674
4675 returnvalue=BesTofDigitizerEcV4::Produce_unique_identifier(neighbourmodule, neighbourstrip);//geaendert: neighbourmodule=module in dieser und unter Funktionen entfernt..
4676 } //close if which==r
4677
4678
4679 else if(which=="u")
4680 {
4681 if(strip==23 || strip==24) {neighbourmodule=0; neighbourstrip=0;}
4682 else
4683 {
4684 neighbourstrip=strip+2;
4685 neighbourmodule=module;
4686 }
4687
4688 returnvalue= BesTofDigitizerEcV4::Produce_unique_identifier(neighbourmodule, neighbourstrip);
4689 } //close if which==u
4690
4691 else if(which=="b")
4692 {
4693 if(strip==1 || strip==2) {neighbourmodule=0; neighbourstrip=0;}
4694 else
4695 {
4696 neighbourstrip=strip-2;
4697 neighbourmodule=module;
4698 }
4699
4700 returnvalue=BesTofDigitizerEcV4::Produce_unique_identifier(neighbourmodule, neighbourstrip);
4701 } //close if which==b
4702
4703
4704 return returnvalue;
4705}
4706
4707
4708
4709
4710
4711//Be carefull: As I did have problems with the linking, the following function does
4712//exist in TofShower.cxx in TofEnergyRec, too.
4713int MrpcTrack::get_mrpc_partid_neighbour(string which,int stripid,int layer)
4714{
4715
4716
4717
4719
4720 int returnvalue=0;
4721
4722 if(which=="l")
4723 {
4724 if(strip%2==0) returnvalue = layer;
4725 else
4726 {
4727 if(layer==3) returnvalue = 4;
4728 if(layer==4) returnvalue = 3;
4729 if(layer==5) returnvalue = 6;
4730 if(layer==6) returnvalue = 5;
4731 }
4732 }
4733
4734 if(which=="r")
4735 {
4736 if(strip%2!=0) returnvalue = layer;
4737 else
4738 {
4739 if(layer==3) returnvalue = 4;
4740 if(layer==4) returnvalue = 3;
4741 if(layer==5) returnvalue = 6;
4742 if(layer==6) returnvalue = 5;
4743 }
4744 }
4745
4746 if(which=="u")returnvalue = layer;
4747 if(which=="b")returnvalue = layer;
4748
4749
4750
4751 return returnvalue;
4752
4753
4754}
4755
4756
double sin(const BesAngle a)
Definition BesAngle.h:210
double cos(const BesAngle a)
Definition BesAngle.h:213
double abs(const EvtComplex &c)
EvtStreamInputIterator< typename Generator::result_type > iter(Generator gen, int N=0)
std::string help()
bool innerLayer(HoughHit hit1, HoughHit hit2)
ITofCaliSvc * tofCaliSvc
const double zadc_Cut
Definition MrpcTrack.h:16
@ WestEndcap
Definition MrpcTrack.h:20
@ westendcap_2
Definition MrpcTrack.h:20
@ OuterLayer
Definition MrpcTrack.h:20
@ westendcap_1
Definition MrpcTrack.h:20
@ InnerLayer
Definition MrpcTrack.h:20
@ eastendcap_2
Definition MrpcTrack.h:20
@ EastEndcap
Definition MrpcTrack.h:20
@ DoubleLayer
Definition MrpcTrack.h:20
@ eastendcap_1
Definition MrpcTrack.h:20
@ NoHit
Definition MrpcTrack.h:20
const double ztdc_Cut
Definition MrpcTrack.h:13
ObjectVector< RecTofTrack > RecTofTrackCol
Definition RecTofTrack.h:33
std::multimap< unsigned int, TofData * > TofDataMap
Definition TofData.h:244
std::multimap< unsignedint, TofData * >::iterator IterTofDataMap
Definition TofData.h:245
ITofCaliSvc * tofCaliSvc
static G4double Average_transition_time(G4int my_module)
static G4int Produce_unique_identifier(G4int module_mrpc_f, G4int readoutstripnumber_f)
static G4int Get_module_mrpc_from_unique_identifier(G4int unique_identifier_f)
static G4double Calculate_strip_transition_time_cont(G4double x_mm, G4double y_mm, G4int partId_f, G4int module_mrpc_f)
static G4int Get_stripnumber_from_unique_identifier(G4int unique_identifier_f)
const double tof1Path() const
Definition DstExtTrack.h:68
const Hep3Vector tof1Position() const
Definition DstExtTrack.h:58
const string tof1VolumeName() const
Definition DstExtTrack.h:62
const int tof1VolumeNumber() const
Definition DstExtTrack.h:64
const double tof1() const
Definition DstExtTrack.h:66
const Hep3Vector tof2Momentum() const
Definition DstExtTrack.h:96
const Hep3Vector tof1Momentum() const
Definition DstExtTrack.h:60
const double tof2() const
const double tof2PosSigmaAlongZ() const
const double tof1PosSigmaAlongX() const
Definition DstExtTrack.h:74
const double tof2Path() const
const string tof2VolumeName() const
Definition DstExtTrack.h:98
const int trackId() const
Definition DstExtTrack.h:43
const double tof1PosSigmaAlongY() const
Definition DstExtTrack.h:76
const double tof1PosSigmaAlongZ() const
Definition DstExtTrack.h:70
const int tof2VolumeNumber() const
const Hep3Vector tof2Position() const
Definition DstExtTrack.h:94
void setStatus(unsigned int status)
Definition DstTofTrack.h:92
void setSigma(double sigma[6])
void setToffset(double toffset[6])
void setEnergy(double energy)
void setPath(double path)
Definition DstTofTrack.h:94
void setTofTrackID(int tofTrackID)
Definition DstTofTrack.h:89
void setPh(double ph)
Definition DstTofTrack.h:96
void setSigmaMuon(double smu)
void setQuality(int quality)
void setZrHit(double zrhit)
Definition DstTofTrack.h:95
void setTof(double tof)
Definition DstTofTrack.h:97
void setSigmaProton(double sp)
void setPhi(double phi)
void setErrTof(double etof)
Definition DstTofTrack.h:98
void setErrT0(double errt0)
void setTexp(double texp[5])
void setBeta(double beta)
Definition DstTofTrack.h:99
void setSigmaKaon(double sk)
void setErrEnergy(double errenergy)
void setTrackID(int trackID)
Definition DstTofTrack.h:90
void setT0(double t0)
void setErrZ(double errz)
void setErrPhi(double errphi)
void setSigmaPion(double spi)
void setTofID(int tofID)
Definition DstTofTrack.h:91
void setSigmaElectron(double se)
virtual const double BSigmaCounter(double zHit, unsigned id)=0
virtual const double BSigma2(double zHit, unsigned id)=0
virtual const double BTimeCluster(double tlayer1, double tlayer2, double z1, double z2, unsigned id1, unsigned int id2)=0
virtual const double EPulseHeight(double ADC, double rHit, double cost, unsigned int id)=0
virtual const double BTime2(double ADC, double TDC, double zHit, unsigned id, double t0)=0
virtual const double BTime1(double ADC, double TDC, double zHit, unsigned id, double t0)=0
virtual const double BTimeCounter(double tleft, double tright, double z, unsigned id)=0
virtual const double ZTDC(double tleft, double tright, unsigned id)=0
virtual const double BSigmaCluster(double zHit1, double zHit2, unsigned id1, unsigned id2)=0
virtual const double BPulseHeight(double ADC1, double ADC2, double zHit, double sint, unsigned int id)=0
virtual const double BSigma1(double zHit, unsigned id)=0
virtual const double ESigma(double rHit, unsigned id)=0
virtual const double ZADC(double qleft, double qright, unsigned id)=0
virtual const double ETime(double ADC, double TDC, double rHit, unsigned id)=0
double GetSigma(double, unsigned, int, bool)
void match(std::vector< MrpcTrack * > *&tofTrackVec)
void getMultiHit(MrpcTrack *&)
void buildRecTofTrack(RecTofTrack *track, int layerorend)
TofData * chooseTofData(std::vector< TofData * > tofDataVec, double zrhit)
TofData * compareTofDataEndcap(TofData *tofData1, TofData *tofData2)
ExtTrackCase hitCase() const
Definition MrpcTrack.h:33
TofData * chooseTofDataMRPC(std::vector< TofData *, std::allocator< TofData * > >, double)
void getTofDataMRPC(TofData *, unsigned int)
MrpcCalibSvc * mrpcCaliSvc
Definition MrpcTrack.h:112
int id2() const
Definition MrpcTrack.h:31
void setTofData(TofDataMap tofDataMap, int)
int get_mrpc_partid_neighbour(std::string, int, int)
void getTofData(TofData *tof, unsigned int iflag)
void setQuality1(int qual1)
Definition MrpcTrack.h:118
int id1() const
Definition MrpcTrack.h:30
int t0Stat() const
Definition MrpcTrack.h:106
std::vector< TofData * > tofData1() const
Definition MrpcTrack.h:47
void getTofDataEast(TofData *tof, unsigned int iflag)
unsigned int barrel() const
Definition MrpcTrack.h:32
TofData * compareTofDataMRPC(TofData *tofData1, TofData *tofData2)
void setCalibration()
void getTofDataWest(TofData *tof, unsigned int iflag)
double tof(unsigned int i) const
Definition MrpcTrack.h:78
void setQuality2(int qual2)
Definition MrpcTrack.h:119
unsigned int quality2() const
Definition MrpcTrack.h:58
void getTofDataNohit(unsigned int iflag)
TofData * compareTofData(TofData *tofData1, TofData *tofData2, double zrhit)
unsigned int quality1() const
Definition MrpcTrack.h:57
void findTofDataMRPC(std::vector< TofData * > tofDataVec1, std::vector< TofData * > tofDataVec2, double zrhit, unsigned int iflag)
int kal(unsigned int i) const
Definition MrpcTrack.h:42
void convert2RecTofTrackCol(RecTofTrackCol *recTofTrackCol)
void setRecTofTrack(RecTofTrack *track, int layerorend)
TofData * chooseTofDataEndcap(std::vector< TofData * > tofDataVec, double zr1[5])
void tofDataAnalysis(TofData *tof, unsigned int iflag)
void setExtTrack(RecExtTrack *extTrack, int kal[5], double t0, int t0Stat)
void findTofDataBarrel(std::vector< TofData * > tofDataVec1, std::vector< TofData * > tofDataVec2, double zrhit, unsigned int iflag, std::vector< MrpcTrack * > *&tofTrackVec)
void findTofDataEndcap(std::vector< TofData * > tofDataVec1, std::vector< TofData * > tofDataVec2, double zr1[5])
int tofId2() const
Definition MrpcTrack.h:62
int tofId1() const
Definition MrpcTrack.h:61
int get_mrpc_stripid_neighbour(std::string, int, int)
std::vector< TofData * > tofData2() const
Definition MrpcTrack.h:48
void setUsed()
Definition TofData.cxx:945
unsigned int value() const
void setBarrelReadout(unsigned int layer, bool east)
void setEndcapCluster(bool east)
void setBarrelCounter(unsigned int layer)
void setBarrelCluster(unsigned int layer)
static value_type getIntID_mrpc(int partID, int scinNum)
Definition TofID.cxx:216
static value_type getIntID(int barrel_ec, int layer, int phi_module, int end)
Definition TofID.cxx:200