1#include "Identifier/Identifier.h"
2#include "Identifier/TofID.h"
3#include "TofCaliSvc/ITofCaliSvc.h"
6#include "DstEvent/TofHitStatus.h"
7#include "MrpcRec/TofConstants.h"
8#include "MrpcRec/MrpcTrack.h"
9#include "TofSim/BesTofDigitizerEcV4.hh"
11#include "G4LogicalVolume.hh"
38 for(
unsigned int i=0; i<5; i++ ) {
45 if( m_tofData1.size()>0 ) {
46 std::vector<TofData*>::iterator iter1 = m_tofData1.begin();
49 if( m_tofData2.size()>0 ) {
50 std::vector<TofData*>::iterator iter2 = m_tofData2.begin();
53 if( m_tofData3.size()>0 ) {
54 std::vector<TofData*>::iterator iter3 = m_tofData3.begin();
57 if( m_tofData4.size()>0 ) {
58 std::vector<TofData*>::iterator iter4 = m_tofData4.begin();
76 for(
unsigned int i=0; i<5; i++ ) {
84 m_sigma_mrpc[i]=-999.0;
109 for(
unsigned int i=0; i<5; i++ ) {
110 m_texpInner[i] = -999.0;
111 m_texpOuter[i] = -999.0;
124 mrpc_extrapolation_good=
false;
133 if( m_tofData1.size()>0 ) {
134 std::vector<TofData*>::iterator iter1 = m_tofData1.begin();
137 if( m_tofData2.size()>0 ) {
138 std::vector<TofData*>::iterator iter2 = m_tofData2.begin();
141 if( m_tofData3.size()>0 ) {
142 std::vector<TofData*>::iterator iter3 = m_tofData3.begin();
145 if( m_tofData4.size()>0 ) {
146 std::vector<TofData*>::iterator iter4 = m_tofData4.begin();
173 if(tof1volumename ==
"logical_sensitive_detector_east_1")
191 else if(tof1volumename ==
"logical_sensitive_detector_east_2")
207 else if(tof1volumename ==
"logical_sensitive_detector_west_1")
223 else if(tof1volumename ==
"logical_sensitive_detector_west_2")
238 else if(
tofId1>=0 &&
tofId1<=87 && ( tof1volumename.contains(
"ScinBr") || tof1volumename.contains(
"ScinEc") || tof2volumename.contains(
"ScinBr") || tof2volumename.contains(
"ScinEc") ))
245 else if(
tofId1>=176 &&
tofId1<=223 && ( tof1volumename.contains(
"ScinBr") || tof1volumename.contains(
"ScinEc") || tof2volumename.contains(
"ScinBr") || tof2volumename.contains(
"ScinEc" ) ))
247 m_id1 =
tofId1 - 176 + 48;
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;
266 if(
tofId2>=88 &&
tofId2<=175 && ( tof1volumename.contains(
"ScinBr") || tof1volumename.contains(
"ScinEc") || tof2volumename.contains(
"ScinBr") || tof2volumename.contains(
"ScinEc") )) {
272 else if( m_hitCase==
NoHit ) {
279 m_trackId = extTrack->
trackId();
283 for(
unsigned int i=0; i<5; i++ ) {
284 m_texpInner[i] = extTrack->
tof1(i);
293 for(
unsigned int i=0; i<5; i++ ) {
300 for(
unsigned int i=0; i<5; i++ ) {
301 m_texpInner[i] = extTrack->
tof1(i);
311 for(
unsigned int i=0; i<5; i++ ) {
320 for(
unsigned int i=0; i<5; i++ ) {
321 m_texpOuter[i] = extTrack->
tof2(i);
328 for(
unsigned int i=0; i<5; i++ ) {
334 if( m_hitCase ==
NoHit ) { m_quality = 11; }
336 for(
unsigned int i=0; i<5; i++ ) {
353 if( (
abs(m_id1-track->
id1())<=1 ) || ( m_id1==0 && track->
id1()==87 ) || ( m_id1==87 && track->
id1()==0 ) ) {
355 m_quality1 = ( m_quality1 | 0x400 );
360 if( (
abs(m_id2-track->
id2())<=1 ) || ( m_id2==88 && track->
id2()==175 ) || ( m_id2==175 && track->
id2()==88 ) ) {
362 m_quality2 = ( m_quality2 | 0x400 );
369 if( (
abs(m_id1-track->
id1())<=1 ) || ( m_id1==0 && track->
id1()==47 ) || ( m_id1==47 && track->
id1()==0 ) ) {
371 m_quality1 = ( m_quality1 | 0x400 );
377 if( (
abs(m_id1-track->
id1())<=1 ) || ( m_id1==48 && track->
id1()==95 ) || ( m_id1==95 && track->
id1()==48 ) ) {
379 m_quality1 = ( m_quality1 | 0x400 );
402 if( m_hitCase ==
NoHit )
return;
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;
412 unsigned int identify_it=0x0000c000;
413 unsigned int identify_u =0x0000c000;
414 unsigned int identify_b =0x0000c000;
415 unsigned int identify_l =0x0000c000;
416 unsigned int identify_lu=0x0000c000;
417 unsigned int identify_lb=0x0000c000;
418 unsigned int identify_r =0x0000c000;
419 unsigned int identify_ru=0x0000c000;
420 unsigned int identify_rb=0x0000c000;
422 unsigned int identify_luu =0x0000c000;
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;
429 unsigned int identify_luuu =0x0000c000;
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;
437 unsigned int identify_luuul =0x0000c000;
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;
454 unsigned int count_it =0;
455 unsigned int count_u =0;
456 unsigned int count_b =0;
457 unsigned int count_l =0;
458 unsigned int count_lu =0;
459 unsigned int count_lb =0;
460 unsigned int count_r =0;
461 unsigned int count_ru =0;
462 unsigned int count_rb =0;
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;
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;
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;
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;
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;
713 int tofid_it = m_id1;
723 if(this_partID==0){ cout <<
"MRPCREC --- MrpcTrack --- Fatal Error: PartID is not existing ---> " << this_partID << endl;
return; }
726 count_it = tofDataMap.count( identify_it );
816 if( (neighborhood==1) || (neighborhood==2) || (neighborhood==3) || (neighborhood==4) )
819 count_l = tofDataMap.count(identify_l );
821 count_r = tofDataMap.count(identify_r);
823 count_u = tofDataMap.count(identify_u);
825 count_b = tofDataMap.count(identify_b);
827 count_lu = tofDataMap.count(identify_lu);
829 count_lb = tofDataMap.count(identify_lb);
831 count_ru = tofDataMap.count(identify_ru);
833 count_rb = tofDataMap.count(identify_rb);
837 if( (neighborhood==2) || (neighborhood==3) || (neighborhood==4) )
842 count_luu = tofDataMap.count(identify_luu );
844 count_ruu = tofDataMap.count(identify_ruu);
846 count_uu = tofDataMap.count(identify_uu);
848 count_bb = tofDataMap.count(identify_bb);
850 count_lbb = tofDataMap.count(identify_lbb);
852 count_rbb = tofDataMap.count(identify_rbb);
856 if((neighborhood==3) || (neighborhood==4))
861 count_luuu = tofDataMap.count(identify_luuu );
863 count_ruuu = tofDataMap.count(identify_ruuu);
865 count_uuu = tofDataMap.count(identify_uuu);
867 count_bbb = tofDataMap.count(identify_bbb);
869 count_lbbb = tofDataMap.count(identify_lbbb);
871 count_rbbb = tofDataMap.count(identify_rbbb);
876 if((neighborhood==4))
880 count_luuul = tofDataMap.count(identify_luuul );
882 count_ruuur = tofDataMap.count(identify_ruuur);
884 count_lbbbl = tofDataMap.count(identify_lbbbl);
886 count_rbbbr = tofDataMap.count(identify_rbbbr);
889 count_luul = tofDataMap.count(identify_luul );
891 count_ruur = tofDataMap.count(identify_ruur);
893 count_lbbl = tofDataMap.count(identify_lbbl);
895 count_rbbr = tofDataMap.count(identify_rbbr);
898 count_ll = tofDataMap.count(identify_ll );
900 count_rr = tofDataMap.count(identify_rr);
902 count_lul = tofDataMap.count(identify_lul);
904 count_lbl = tofDataMap.count(identify_lbl);
906 count_rur = tofDataMap.count(identify_rur);
908 count_rbr = tofDataMap.count(identify_rbr);
914 if((neighborhood==5))
920 if((strip_number_if5)%2==0)
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);
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);
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);
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);
1204 if((neighborhood==6))
1212 if((strip_number_if6)%2==0)
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);
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);
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);
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);
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);
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);
1792 int data_map_size = tofDataMap.size();
1793 std::cout <<
"MrpcTrack setTofData Number of elements in TofDataMap " << data_map_size << std::endl;
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;
1807 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_it );
1810 for(
unsigned int i = 0; i < count_it; i++,
iter++ ) {
1819 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_u );
1821 for(
unsigned int i = 0; i < count_u; i++,
iter++ ) {
1829 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_b );
1831 for(
unsigned int i = 0; i < count_b; i++,
iter++ ) {
1840 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_l );
1842 for(
unsigned int i = 0; i < count_l; i++,
iter++ ) {
1851 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_r );
1853 for(
unsigned int i = 0; i < count_r; i++,
iter++ ) {
1861 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_lu );
1863 for(
unsigned int i = 0; i < count_lu; i++,
iter++ ) {
1872 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_ru );
1874 for(
unsigned int i = 0; i < count_ru; i++,
iter++ ) {
1883 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_lb );
1885 for(
unsigned int i = 0; i < count_lb; i++,
iter++ ) {
1894 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_rb );
1896 for(
unsigned int i = 0; i < count_rb; i++,
iter++ ) {
1905 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_bb );
1907 for(
unsigned int i = 0; i < count_bb; i++,
iter++ ) {
1914 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_uu );
1916 for(
unsigned int i = 0; i < count_uu; i++,
iter++ ) {
1925 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_lbb );
1927 for(
unsigned int i = 0; i < count_lbb; i++,
iter++ ) {
1934 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_luu );
1936 for(
unsigned int i = 0; i < count_luu; i++,
iter++ ) {
1943 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_rbb );
1945 for(
unsigned int i = 0; i < count_rbb; i++,
iter++ ) {
1953 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_ruu );
1955 for(
unsigned int i = 0; i < count_ruu; i++,
iter++ ) {
1962 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_uuu );
1964 for(
unsigned int i = 0; i < count_uuu; i++,
iter++ ) {
1971 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_bbb );
1973 for(
unsigned int i = 0; i < count_bbb; i++,
iter++ ) {
1980 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_ruuu );
1982 for(
unsigned int i = 0; i < count_ruuu; i++,
iter++ ) {
1989 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_rbbb );
1991 for(
unsigned int i = 0; i < count_rbbb; i++,
iter++ ) {
1998 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_luuu );
2000 for(
unsigned int i = 0; i < count_luuu; i++,
iter++ ) {
2007 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_lbbb );
2009 for(
unsigned int i = 0; i < count_lbbb; i++,
iter++ ) {
2018 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_lbbbl );
2020 for(
unsigned int i = 0; i < count_lbbbl; i++,
iter++ ) {
2027 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_lbbl );
2029 for(
unsigned int i = 0; i < count_lbbl; i++,
iter++ ) {
2036 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_lbl );
2038 for(
unsigned int i = 0; i < count_lbl; i++,
iter++ ) {
2045 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_ll );
2047 for(
unsigned int i = 0; i < count_ll; i++,
iter++ ) {
2054 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_luuul );
2056 for(
unsigned int i = 0; i < count_luuul; i++,
iter++ ) {
2063 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_luul );
2065 for(
unsigned int i = 0; i < count_luul; i++,
iter++ ) {
2072 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_lul );
2074 for(
unsigned int i = 0; i < count_lul; i++,
iter++ ) {
2082 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_rbbbr );
2084 for(
unsigned int i = 0; i < count_rbbbr; i++,
iter++ ) {
2091 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_rbbr );
2093 for(
unsigned int i = 0; i < count_rbbr; i++,
iter++ ) {
2100 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_rbr );
2102 for(
unsigned int i = 0; i < count_rbr; i++,
iter++ ) {
2109 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_rr );
2111 for(
unsigned int i = 0; i < count_rr; i++,
iter++ ) {
2118 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_ruuur );
2120 for(
unsigned int i = 0; i < count_ruuur; i++,
iter++ ) {
2127 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_ruur );
2129 for(
unsigned int i = 0; i < count_ruur; i++,
iter++ ) {
2136 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_rur );
2138 for(
unsigned int i = 0; i < count_rur; i++,
iter++ ) {
2148 if(identify_if5_m1==identify_if5_it)
help=1;
2149 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if5_m1);
2151 for(
unsigned int i = 0; i < count_if5_m1; i++,
iter++ ) {
2158 if(identify_if5_m2==identify_if5_it)
help=1;
2159 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if5_m2);
2161 for(
unsigned int i = 0; i < count_if5_m2; i++,
iter++ ) {
2168 if(identify_if5_m3==identify_if5_it)
help=1;
2169 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if5_m3);
2171 for(
unsigned int i = 0; i < count_if5_m3; i++,
iter++ ) {
2178 if(identify_if5_m4==identify_if5_it)
help=1;
2179 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if5_m4);
2181 for(
unsigned int i = 0; i < count_if5_m4; i++,
iter++ ) {
2188 if(identify_if5_m5==identify_if5_it)
help=1;
2189 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if5_m5);
2191 for(
unsigned int i = 0; i < count_if5_m5; i++,
iter++ ) {
2198 if(identify_if5_m6==identify_if5_it)
help=1;
2199 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if5_m6);
2201 for(
unsigned int i = 0; i < count_if5_m6; i++,
iter++ ) {
2208 if(identify_if5_m7==identify_if5_it)
help=1;
2209 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if5_m7);
2211 for(
unsigned int i = 0; i < count_if5_m7; i++,
iter++ ) {
2218 if(identify_if5_m8==identify_if5_it)
help=1;
2219 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if5_m8);
2221 for(
unsigned int i = 0; i < count_if5_m8; i++,
iter++ ) {
2228 if(identify_if5_m9==identify_if5_it)
help=1;
2229 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if5_m9);
2231 for(
unsigned int i = 0; i < count_if5_m9; i++,
iter++ ) {
2238 if(identify_if5_m10==identify_if5_it)
help=1;
2239 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if5_m10);
2241 for(
unsigned int i = 0; i < count_if5_m10; i++,
iter++ ) {
2248 if(identify_if5_m11==identify_if5_it)
help=1;
2249 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if5_m11);
2251 for(
unsigned int i = 0; i < count_if5_m11; i++,
iter++ ) {
2258 if(identify_if5_m12==identify_if5_it)
help=1;
2259 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if5_m12);
2261 for(
unsigned int i = 0; i < count_if5_m12; i++,
iter++ ) {
2267 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if5_l1);
2269 for(
unsigned int i = 0; i < count_if5_l1; i++,
iter++ ) {
2275 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if5_l2);
2277 for(
unsigned int i = 0; i < count_if5_l2; i++,
iter++ ) {
2283 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if5_l3);
2285 for(
unsigned int i = 0; i < count_if5_l3; i++,
iter++ ) {
2291 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if5_l4);
2293 for(
unsigned int i = 0; i < count_if5_l4; i++,
iter++ ) {
2299 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if5_l5);
2301 for(
unsigned int i = 0; i < count_if5_l5; i++,
iter++ ) {
2307 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if5_l6);
2309 for(
unsigned int i = 0; i < count_if5_l6; i++,
iter++ ) {
2315 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if5_l7);
2317 for(
unsigned int i = 0; i < count_if5_l7; i++,
iter++ ) {
2323 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if5_l8);
2325 for(
unsigned int i = 0; i < count_if5_l8; i++,
iter++ ) {
2331 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if5_l9);
2333 for(
unsigned int i = 0; i < count_if5_l9; i++,
iter++ ) {
2339 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if5_l10);
2341 for(
unsigned int i = 0; i < count_if5_l10; i++,
iter++ ) {
2347 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if5_l11);
2349 for(
unsigned int i = 0; i < count_if5_l11; i++,
iter++ ) {
2355 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if5_l12);
2357 for(
unsigned int i = 0; i < count_if5_l12; i++,
iter++ ) {
2364 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if5_r1);
2366 for(
unsigned int i = 0; i < count_if5_r1; i++,
iter++ ) {
2372 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if5_r2);
2374 for(
unsigned int i = 0; i < count_if5_r2; i++,
iter++ ) {
2380 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if5_r3);
2382 for(
unsigned int i = 0; i < count_if5_r3; i++,
iter++ ) {
2388 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if5_r4);
2390 for(
unsigned int i = 0; i < count_if5_r4; i++,
iter++ ) {
2396 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if5_r5);
2398 for(
unsigned int i = 0; i < count_if5_r5; i++,
iter++ ) {
2404 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if5_r6);
2406 for(
unsigned int i = 0; i < count_if5_r6; i++,
iter++ ) {
2412 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if5_r7);
2414 for(
unsigned int i = 0; i < count_if5_r7; i++,
iter++ ) {
2420 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if5_r8);
2422 for(
unsigned int i = 0; i < count_if5_r8; i++,
iter++ ) {
2428 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if5_r9);
2430 for(
unsigned int i = 0; i < count_if5_r9; i++,
iter++ ) {
2436 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if5_r10);
2438 for(
unsigned int i = 0; i < count_if5_r10; i++,
iter++ ) {
2444 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if5_r11);
2446 for(
unsigned int i = 0; i < count_if5_r11; i++,
iter++ ) {
2452 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if5_r12);
2454 for(
unsigned int i = 0; i < count_if5_r12; i++,
iter++ ) {
2461 if(identify_if6_m1==identify_if6_it)
help=1;
2462 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_m1);
2464 for(
unsigned int i = 0; i < count_if6_m1; i++,
iter++ ) {
2471 if(identify_if6_m2==identify_if6_it)
help=1;
2472 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_m2);
2474 for(
unsigned int i = 0; i < count_if6_m2; i++,
iter++ ) {
2481 if(identify_if6_m3==identify_if6_it)
help=1;
2482 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_m3);
2484 for(
unsigned int i = 0; i < count_if6_m3; i++,
iter++ ) {
2491 if(identify_if6_m4==identify_if6_it)
help=1;
2492 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_m4);
2494 for(
unsigned int i = 0; i < count_if6_m4; i++,
iter++ ) {
2501 if(identify_if6_m5==identify_if6_it)
help=1;
2502 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_m5);
2504 for(
unsigned int i = 0; i < count_if6_m5; i++,
iter++ ) {
2511 if(identify_if6_m6==identify_if6_it)
help=1;
2512 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_m6);
2514 for(
unsigned int i = 0; i < count_if6_m6; i++,
iter++ ) {
2521 if(identify_if6_m7==identify_if6_it)
help=1;
2522 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_m7);
2524 for(
unsigned int i = 0; i < count_if6_m7; i++,
iter++ ) {
2531 if(identify_if6_m8==identify_if6_it)
help=1;
2532 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_m8);
2534 for(
unsigned int i = 0; i < count_if6_m8; i++,
iter++ ) {
2541 if(identify_if6_m9==identify_if6_it)
help=1;
2542 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_m9);
2544 for(
unsigned int i = 0; i < count_if6_m9; i++,
iter++ ) {
2551 if(identify_if6_m10==identify_if6_it)
help=1;
2552 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_m10);
2554 for(
unsigned int i = 0; i < count_if6_m10; i++,
iter++ ) {
2561 if(identify_if6_m11==identify_if6_it)
help=1;
2562 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_m11);
2564 for(
unsigned int i = 0; i < count_if6_m11; i++,
iter++ ) {
2571 if(identify_if6_m12==identify_if6_it)
help=1;
2572 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_m12);
2574 for(
unsigned int i = 0; i < count_if6_m12; i++,
iter++ ) {
2580 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_l1);
2582 for(
unsigned int i = 0; i < count_if6_l1; i++,
iter++ ) {
2588 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_l2);
2590 for(
unsigned int i = 0; i < count_if6_l2; i++,
iter++ ) {
2596 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_l3);
2598 for(
unsigned int i = 0; i < count_if6_l3; i++,
iter++ ) {
2604 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_l4);
2606 for(
unsigned int i = 0; i < count_if6_l4; i++,
iter++ ) {
2612 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_l5);
2614 for(
unsigned int i = 0; i < count_if6_l5; i++,
iter++ ) {
2620 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_l6);
2622 for(
unsigned int i = 0; i < count_if6_l6; i++,
iter++ ) {
2628 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_l7);
2630 for(
unsigned int i = 0; i < count_if6_l7; i++,
iter++ ) {
2636 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_l8);
2638 for(
unsigned int i = 0; i < count_if6_l8; i++,
iter++ ) {
2644 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_l9);
2646 for(
unsigned int i = 0; i < count_if6_l9; i++,
iter++ ) {
2652 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_l10);
2654 for(
unsigned int i = 0; i < count_if6_l10; i++,
iter++ ) {
2660 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_l11);
2662 for(
unsigned int i = 0; i < count_if6_l11; i++,
iter++ ) {
2668 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_l12);
2670 for(
unsigned int i = 0; i < count_if6_l12; i++,
iter++ ) {
2677 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_r1);
2679 for(
unsigned int i = 0; i < count_if6_r1; i++,
iter++ ) {
2685 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_r2);
2687 for(
unsigned int i = 0; i < count_if6_r2; i++,
iter++ ) {
2693 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_r3);
2695 for(
unsigned int i = 0; i < count_if6_r3; i++,
iter++ ) {
2701 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_r4);
2703 for(
unsigned int i = 0; i < count_if6_r4; i++,
iter++ ) {
2709 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_r5);
2711 for(
unsigned int i = 0; i < count_if6_r5; i++,
iter++ ) {
2717 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_r6);
2719 for(
unsigned int i = 0; i < count_if6_r6; i++,
iter++ ) {
2725 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_r7);
2727 for(
unsigned int i = 0; i < count_if6_r7; i++,
iter++ ) {
2733 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_r8);
2735 for(
unsigned int i = 0; i < count_if6_r8; i++,
iter++ ) {
2741 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_r9);
2743 for(
unsigned int i = 0; i < count_if6_r9; i++,
iter++ ) {
2749 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_r10);
2751 for(
unsigned int i = 0; i < count_if6_r10; i++,
iter++ ) {
2757 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_r11);
2759 for(
unsigned int i = 0; i < count_if6_r11; i++,
iter++ ) {
2765 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_r12);
2767 for(
unsigned int i = 0; i < count_if6_r12; i++,
iter++ ) {
2773 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_ll1);
2775 for(
unsigned int i = 0; i < count_if6_ll1; i++,
iter++ ) {
2781 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_ll2);
2783 for(
unsigned int i = 0; i < count_if6_ll2; i++,
iter++ ) {
2789 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_ll3);
2791 for(
unsigned int i = 0; i < count_if6_ll3; i++,
iter++ ) {
2797 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_ll4);
2799 for(
unsigned int i = 0; i < count_if6_ll4; i++,
iter++ ) {
2805 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_ll5);
2807 for(
unsigned int i = 0; i < count_if6_ll5; i++,
iter++ ) {
2813 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_ll6);
2815 for(
unsigned int i = 0; i < count_if6_ll6; i++,
iter++ ) {
2821 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_ll7);
2823 for(
unsigned int i = 0; i < count_if6_ll7; i++,
iter++ ) {
2829 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_ll8);
2831 for(
unsigned int i = 0; i < count_if6_ll8; i++,
iter++ ) {
2837 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_ll9);
2839 for(
unsigned int i = 0; i < count_if6_ll9; i++,
iter++ ) {
2843 if(count_if6_ll10>0)
2845 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_ll10);
2847 for(
unsigned int i = 0; i < count_if6_ll10; i++,
iter++ ) {
2851 if(count_if6_ll11>0)
2853 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_ll11);
2855 for(
unsigned int i = 0; i < count_if6_ll11; i++,
iter++ ) {
2859 if(count_if6_ll12>0)
2861 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_ll12);
2863 for(
unsigned int i = 0; i < count_if6_ll12; i++,
iter++ ) {
2870 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_rr1);
2872 for(
unsigned int i = 0; i < count_if6_rr1; i++,
iter++ ) {
2878 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_rr2);
2880 for(
unsigned int i = 0; i < count_if6_rr2; i++,
iter++ ) {
2886 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_rr3);
2888 for(
unsigned int i = 0; i < count_if6_rr3; i++,
iter++ ) {
2894 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_rr4);
2896 for(
unsigned int i = 0; i < count_if6_rr4; i++,
iter++ ) {
2902 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_rr5);
2904 for(
unsigned int i = 0; i < count_if6_rr5; i++,
iter++ ) {
2910 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_rr6);
2912 for(
unsigned int i = 0; i < count_if6_rr6; i++,
iter++ ) {
2918 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_rr7);
2920 for(
unsigned int i = 0; i < count_if6_rr7; i++,
iter++ ) {
2926 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_rr8);
2928 for(
unsigned int i = 0; i < count_if6_rr8; i++,
iter++ ) {
2934 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_rr9);
2936 for(
unsigned int i = 0; i < count_if6_rr9; i++,
iter++ ) {
2940 if(count_if6_rr10>0)
2942 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_rr10);
2944 for(
unsigned int i = 0; i < count_if6_rr10; i++,
iter++ ) {
2948 if(count_if6_rr11>0)
2950 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_rr11);
2952 for(
unsigned int i = 0; i < count_if6_rr11; i++,
iter++ ) {
2956 if(count_if6_rr12>0)
2958 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_rr12);
2960 for(
unsigned int i = 0; i < count_if6_rr12; i++,
iter++ ) {
2975 count0 = tofDataMap.count( identify0 );
2976 int tofid1 = tofid0 - 1;
2977 if( tofid1 == -1 ) { tofid1 = 87; }
2979 count1 = tofDataMap.count( identify1 );
2980 int tofid2 = tofid0 + 1;
2981 if( tofid2 == 88 ) { tofid2 = 0; }
2983 count2 = tofDataMap.count( identify2 );
2987 if( ( m_hitCase ==
EastEndcap ) && ( m_id1 > -1 ) ) {
2990 count0 = tofDataMap.count( identify0 );
2991 int tofid1 = tofid0 - 1;
2992 if( tofid1 == -1 ) { tofid1 = 47; }
2994 count1 = tofDataMap.count( identify1 );
2995 int tofid2 = tofid0 + 1;
2996 if( tofid2 == 48 ) { tofid2 = 0; }
2998 count2 = tofDataMap.count( identify2 );
3003 if( ( m_hitCase ==
WestEndcap ) && ( m_id1 > -1 ) ) {
3004 int tofid0 = m_id1 - 48;
3006 count0 = tofDataMap.count( identify0 );
3007 int tofid1 = tofid0 - 1;
3008 if( tofid1 == -1 ) { tofid1 = 47; }
3010 count1 = tofDataMap.count( identify1 );
3011 int tofid2 = tofid0 + 1;
3012 if( tofid2 == 48 ) { tofid2 = 0; }
3014 count2 = tofDataMap.count( identify2 );
3020 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify0 );
3022 for(
unsigned int i = 0; i < count0; i++,
iter++ ) {
3027 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify1 );
3029 for(
unsigned int i = 0; i < count1; i++,
iter++ ) {
3034 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify2 );
3036 for(
unsigned int i = 0; i < count2; i++,
iter++ ) {
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)
3045 && (count_luuu==0) && (count_lbbb==0) && (count_ruuu==0) && (count_rbbb==0) && (count_uuu==0) && (count_bbb==0)
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)
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)
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)
3081 int tofid0 = m_id2 - 88;
3083 count0 = tofDataMap.count( identify0 );
3084 int tofid1 = tofid0 - 1;
3085 if( tofid1 == -1 ) { tofid1 = 87; }
3087 count1 = tofDataMap.count( identify1 );
3088 int tofid2 = tofid0 + 1;
3089 if( tofid2 == 88 ) { tofid2 = 0; }
3091 count2 = tofDataMap.count( identify2 );
3094 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify0 );
3096 for(
unsigned int i = 0; i < count0; i++,
iter++ ) {
3101 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify1 );
3103 for(
unsigned int i = 0; i < count1; i++,
iter++ ) {
3108 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify2 );
3110 for(
unsigned int i = 0; i < count2; i++,
iter++ ) {
3115 if( ( count0 == 0 ) && ( count1 == 0 ) && ( count2 == 0 ) ) {
3135 unsigned int qual =
tof->quality();
3137 if( ( qual & 0x10 ) == 0 ) {
3140 qual = ( qual | 0x10 );
3142 if(
tof->barrel() ) {
3143 if( (
tof->quality() == 0x7 ) || (
tof->quality() == 0xd ) ) {
3144 qual = ( qual | 0x20 );
3147 if( (
tof->quality() == 0xb ) || (
tof->quality() == 0xe ) ) {
3148 qual = ( qual | 0x40 );
3151 if( (
tof->quality() == 0x3 ) || (
tof->quality() == 0xc ) ) {
3152 qual = ( qual | 0x80 );
3155 if( (
tof->quality() & 0x5 ) == 0x5 ) {
3157 tof->setZTdc( ztdc );
3168 if( (
tof->quality() & 0xa ) == 0xa ) {
3170 tof->setZAdc( zadc );
3182 tof->setQuality( qual );
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 );
3190 cout <<
"MrpcRec::MrpcTrack::TofDataAnalylsis: the Flag should be 1-4, out of the Range!" << endl;
3202 if( m_hitCase ==
NoHit )
return;
3206 if( ( m_quality1 & 0x10 ) == 0 ) { m_hitCase =
NoHit; }
3210 if( ( m_quality2 & 0x10 ) == 0 ) { m_hitCase =
NoHit; }
3214 if( ( m_quality1 & 0x10 ) == 0 ) { m_hitCase =
OuterLayer; }
3216 if( ( m_quality2 & 0x10 ) == 0 ) {
3224 cout <<
"MrpcRec::MrpcTrack::match: 2- Impossible!" << endl;
3237 cout <<
"MrpcRec::MrpcTrack::match: 1- Impossible!" << endl;
3247void MrpcTrack::findTofDataBarrel( std::vector<TofData*> tofDataVec1, std::vector<TofData*> tofDataVec2,
double zrhit,
unsigned int iflag, std::vector<MrpcTrack*>*& tofTrackVec ) {
3249 unsigned int qual = 0xf;
3251 if( tofDataVec2.size() == 0 ) {
3252 if( tofDataVec1.size() == 0 ) {
3255 else if( tofDataVec1.size() == 1 ) {
3256 std::vector<TofData*>::iterator iter1 = tofDataVec1.begin();
3260 else if( tofDataVec1.size() > 1 ) {
3265 cout <<
"MrpcRec::MrpcTrack::findTofDataBarrel: 1- Impossible!" << endl;
3268 else if( ( tofDataVec2.size() == 1 ) ) {
3269 if( tofDataVec1.size() == 0 ) {
3270 std::vector<TofData*>::iterator iter2 = tofDataVec2.begin();
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 ) {
3280 std::vector<TofData*>::iterator iter2 = tofDataVec2.begin();
3285 else if( tofDataVec1.size() > 1 ) {
3291 std::vector<TofData*>::iterator iter2 = tofDataVec2.begin();
3297 cout <<
"MrpcRec::MrpcTrack::findTofDataBarrel: 2- Impossible!" << endl;
3300 else if( ( tofDataVec2.size() > 1 ) ) {
3301 if( tofDataVec1.size() == 0 ) {
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 ) {
3316 else if( tofDataVec1.size() > 1 ) {
3328 cout <<
"MrpcRec::MrpcTrack::findTofDataBarrel: 3- Impossible!" << endl;
3333 if( !(
tof->used()) ) {
3337 bool z1=
false, z2=
false;
3338 bool zc1=
false, zc2=
false;
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() ) {
3348 zc2 = ( (*iter)->zrhit1() >
tof->ztdc() );
3352 else if( iflag==2 ) {
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() ) {
3360 zc2 = ( (*iter)->zrhit2() >
tof->ztdc() );
3365 if( ( z1 && z2 )||( (!z1) && (!z2) ) ) {
3370 else if( !zc1 && zc2 ) {
3375 else if( z1 && !z2 ) {
3378 cout << iflag <<
" " << track->
quality1() <<
" " << track->
quality2() << endl;
3380 else if( !z1 && z2 ) {
3387 if( ( iflag == 1 ) || ( iflag == 3 ) ) {
3388 m_quality1 = ( m_quality1 | 0x300 );
3390 else if( iflag == 2 ) {
3391 m_quality2 = ( m_quality2 | 0x300 );
3394 cout <<
"MrpcRec::MrpcTrack::findTofDataBarrel: the 1- IFLAG is Out of Range!" << endl;
3398 qual = ( qual << 12 );
3399 if( ( iflag == 1 ) || ( iflag == 3 ) ) {
3400 m_quality1 = ( m_quality1 | qual );
3402 else if( iflag == 2 ) {
3403 m_quality2 = ( m_quality2 | qual );
3406 cout <<
"MrpcRec::MrpcTrack::findTofDataBarrel: the 2- IFLAG is Out of Range!" << endl;
3418 unsigned int qual = 0xf;
3419 if( tofDataVec2.size() == 0 ) {
3420 if( tofDataVec1.size() == 0 ) {
3423 else if( tofDataVec1.size() == 1 ) {
3424 std::vector<TofData*>::iterator iter1 = tofDataVec1.begin();
3427 mrpc_extrapolation_good=
true;
3429 else if( tofDataVec1.size() > 1 ) {
3432 mrpc_extrapolation_good=
true;
3435 cout <<
"MrpcRec::MrpcTrack::findTofData: 1- Impossible!" << endl;
3438 else if( ( tofDataVec2.size() == 1 ) ) {
3439 if( tofDataVec1.size() == 0 ) {
3440 std::vector<TofData*>::iterator iter2 = tofDataVec2.begin();
3444 else if( tofDataVec1.size() == 1 ) {
3445 std::vector<TofData*>::iterator iter1 = tofDataVec1.begin();
3446 std::vector<TofData*>::iterator iter2 = tofDataVec2.begin();
3450 else if( tofDataVec1.size() > 1 ) {
3452 std::vector<TofData*>::iterator iter2 = tofDataVec2.begin();
3457 cout <<
"MrpcRec::MrpcTrack::findTofData: 2- Impossible!" << endl;
3460 else if( ( tofDataVec2.size() > 1 ) ) {
3461 if( tofDataVec1.size() == 0 ) {
3465 else if( tofDataVec1.size() == 1 ) {
3466 std::vector<TofData*>::iterator iter1 = tofDataVec1.begin();
3471 else if( tofDataVec1.size() > 1 ) {
3478 cout <<
"MrpcRec::MrpcTrack::findTofData: 3- Impossible!" << endl;
3487 cout <<
"MrpcRec::MrpcTrack::findTofData: the 1- IFLAG is Out of Range!" << endl;
3491 qual = ( qual << 12 );
3492 if( ( iflag == 3 ) ) {
3493 m_quality1 = ( m_quality1 | qual );
3496 cout <<
"MrpcRec::MrpcTrack::findTofData: the 2- IFLAG is Out of Range!" << endl;
3507 if( tofDataVec.size() == 0 ) {
3508 cout <<
"MrpcRec::MrpcTrack::ChooseTofDataMRPC: Size of TofData Vector is Zero!" << endl;
3511 std::vector<TofData*>::iterator igood = tofDataVec.begin();
3512 if( tofDataVec.size() > 1 ) {
3513 std::vector<TofData*>::iterator
iter = tofDataVec.begin();
3516 for( ;
iter != tofDataVec.end();
iter++ )
3518 if( (*iter)->adc() > maxQ ) {
3519 maxQ = (*iter)->adc();
3537 mrpc_extrapolation_good=
true;
3540 mrpc_extrapolation_good=
false;
3553 if( tofDataVec.size() == 0 ) {
3554 cout <<
"MrpcRec::MrpcTrack::ChooseTofData: Size of TofData Vector is Zero!" << endl;
3557 std::vector<TofData*>::iterator igood = tofDataVec.begin();
3558 if( tofDataVec.size() > 1 ) {
3560 double deltaZ = 1000.0;
3561 std::vector<TofData*>::iterator
iter = tofDataVec.begin();
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 );
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 );
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 ) {
3591 ibad = ( (*iter)->quality() & 0xf0 );
3593 else if( ( (*iter)->quality() & 0xf0 ) == ibad ) {
3594 if( ( (*iter)->adc1() + (*iter)->adc2() ) > ( (*igood)->adc1() + (*igood)->adc2() ) ) {
3596 ibad = ( (*iter)->quality() & 0xf0 );
3636 unsigned int iflag = 3;
3637 unsigned int qual = 0xf;
3639 if( tofDataVec2.size() == 0 ) {
3640 if( tofDataVec1.size() == 0 ) {
3643 else if( tofDataVec1.size() == 1 ) {
3644 std::vector<TofData*>::iterator iter1 = tofDataVec1.begin();
3648 else if( tofDataVec1.size() > 1 ) {
3653 cout <<
"MrpcRec::MrpcTrack::findTofDataEndcap: 1- Impossible!" << endl;
3656 else if( ( tofDataVec2.size() == 1 ) ) {
3657 if( tofDataVec1.size() == 0 ) {
3658 std::vector<TofData*>::iterator iter2 = tofDataVec2.begin();
3662 else if( tofDataVec1.size() == 1 ) {
3663 std::vector<TofData*>::iterator iter1 = tofDataVec1.begin();
3664 std::vector<TofData*>::iterator iter2 = tofDataVec2.begin();
3668 else if( tofDataVec1.size() > 1 ) {
3670 std::vector<TofData*>::iterator iter2 = tofDataVec2.begin();
3675 cout <<
"MrpcRec::MrpcTrack::findTofDataBarrel: 2- Impossible!" << endl;
3678 else if( ( tofDataVec2.size() > 1 ) ) {
3679 if( tofDataVec1.size() == 0 ) {
3683 else if( tofDataVec1.size() == 1 ) {
3684 std::vector<TofData*>::iterator iter1 = tofDataVec1.begin();
3689 else if( tofDataVec1.size() > 1 ) {
3696 cout <<
"MrpcRec::MrpcTrack::findTofDataBarrel: 3- Impossible!" << endl;
3701 m_quality1 = ( m_quality1 | 0x300 );
3704 qual = ( qual << 12 );
3705 m_quality1 = ( m_quality1 | qual );
3716 if( tofDataVec.size() == 0 ) {
3717 cout <<
"MrpcRec::MrpcTrack::ChooseTofData: Size of TofData Vector is Zero!" << endl;
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; }
3728 iter = tofDataVec.begin();
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]);
3744 for( ;
iter != tofDataVec.end();
iter++ ) {
3745 if( (*iter)->adc() > maxQ ) {
3746 maxQ = (*iter)->adc();
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 );
3787 if( ( (
tof->quality() & 0xa ) != 0xa ) || ( ( (
tof->quality() & 0xa ) == 0xa ) && (
abs(
tof->zadc() - m_zrhit1 ) >
zadc_Cut ) ) ) {
3788 m_quality1 = ( m_quality1 | 0x200 );
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 );
3805 if( ( (
tof->quality() & 0xa ) != 0xa ) || ( ( (
tof->quality() & 0xa ) == 0xa ) && (
abs(
tof->zadc() - m_zrhit2 ) >
zadc_Cut ) ) ) {
3806 m_quality2 = ( m_quality2 | 0x200 );
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 );
3818 cout <<
"MrpcRec::MrpcTrack::getTofData: Flag which sign the Barrel/Endcap or Inner/Outer is wrong! Please check it!" << endl;
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 );
3847 cout <<
"MrpcRec::MrpcTrack::setTofData: Flag which sign the Barrel/Endcap or Inner/Outer is wrong! Please check it!" << endl;
3861 m_tofId1 =
tof->tofId();
3862 m_qch1 =
tof->adcChannelEast();
3863 m_adc1 =
tof->adc1();
3864 m_tdc1 =
tof->tdc1();
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 );
3874 if( ( (
tof->quality() & 0xa ) != 0xa ) || ( ( (
tof->quality() & 0xa ) == 0xa ) && (
abs(
tof->zadc() - m_zrhit1 ) >
zadc_Cut ) ) ) {
3875 m_quality1 = ( m_quality1 | 0x200 );
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();
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 );
3892 if( ( (
tof->quality() & 0xa ) != 0xa ) || ( ( (
tof->quality() & 0xa ) == 0xa ) && (
abs(
tof->zadc() - m_zrhit2 ) >
zadc_Cut ) ) ) {
3893 m_quality2 = ( m_quality2 | 0x200 );
3897 cout <<
"MrpcRec::MrpcTrack::getTofDataEast: Flag which sign the Barrel/Endcap or Inner/Outer is wrong! Please check it!" << endl;
3910 m_tofId1 =
tof->tofId();
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 );
3923 if( ( (
tof->quality() & 0xa ) != 0xa ) || ( ( (
tof->quality() & 0xa ) == 0xa ) && (
abs(
tof->zadc() - m_zrhit1 ) >
zadc_Cut ) ) ) {
3924 m_quality1 = ( m_quality1 | 0x200 );
3927 else if( iflag == 2 ) {
3928 m_tofId2 =
tof->tofId();
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 );
3941 if( ( (
tof->quality() & 0xa ) != 0xa ) || ( ( (
tof->quality() & 0xa ) == 0xa ) && (
abs(
tof->zadc() - m_zrhit2 ) >
zadc_Cut ) ) ) {
3942 m_quality2 = ( m_quality2 | 0x200 );
3946 cout <<
"MrpcRec::MrpcTrack::getTofDataWest: Flag which sign the Barrel/Endcap or Inner/Outer is wrong! Please check it!" << endl;
3968 m_quality1 = ( m_quality1 & 0x700 );
3972 else if( iflag == 2 ) {
3982 m_quality2 = ( m_quality2 & 0x700 );
3987 cout <<
"MrpcRec::MrpcTrack::getTofData: Flag which sign the Barrel/Endcap or Inner/Outer is wrong! Please check it!" << endl;
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 );
4012 bool endcapData = ( ( m_quality1 & 0xc ) == 0xc );
4013 bool newmrpcendcapData = ( ( m_quality1 & 0xc ) == 0xc );
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 );
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 );
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 );
4042 for(
unsigned int i=0; i<5; i++ ) {
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 );
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 );
4076 for(
unsigned int i=0; i<5; i++ ) {
4092 for(
unsigned int i=0; i<5; i++ ) {
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 );
4108 if( (m_quality1&0xa000)!=0 ) { m_quality = 4; }
4111 if( newmrpcendcap ) {
4112 if( newmrpcendcapData ) {
4114 for(
unsigned int i=0; i<5; i++ ) {
4125 double strip_transition_time=0;
4127 if(mrpc_extrapolation_good && my_transtime!=0)
4129 strip_transition_time=my_transtime;
4136 m_tof11[i] = m_tdc1-m_estime-strip_transition_time;;
4144 if( (m_quality1&0xa000)!=0 ) { m_quality = 4; }
4163 if( innerEast || innerWest || outerEast || outerWest ) {
4170 if( ( (m_quality1&0xa000)!=0 ) || ( (m_quality2&0xa000)!=0 ) ) {
4171 m_quality = m_quality + 3;
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; }
4180 cout <<
"MrpcRec::MrpcTrack::setCalibration: Impossible!" << endl;
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 );
4216 if( outerEast && outerWest ) {
4224 cout <<
"MrpcRec::MrpcTrack:convert2RecTofTrackCol: 11- Impossible!" << endl;
4229 recTofTrackCol->push_back( atrack11 );
4244 if( outerEast && outerWest ) {
4252 cout <<
"MrpcRec::MrpcTrack:convert2RecTofTrackCol: 12- Impossible!" << endl;
4257 recTofTrackCol->push_back( atrack12 );
4260 if( innerEast && innerWest ) {
4268 if( outerEast && outerWest ) {
4276 cout <<
"MrpcRec::TofTrack:convert2RecTofTrackCol: 1- Impossible!" << endl;
4280 recTofTrackCol->push_back( atrack1 );
4295 if( innerEast || innerWest ) {
4303 cout <<
"MrpcRec::MrpcTrack:convert2RecTofTrackCol: 21- Impossible!" << endl;
4308 recTofTrackCol->push_back( atrack21 );
4323 if( innerEast || innerWest ) {
4331 cout <<
"MrpcRec::MrpcTrack:convert2RecTofTrackCol: 22- Impossible!" << endl;
4336 recTofTrackCol->push_back( atrack22 );
4339 if( outerEast && outerWest ) {
4347 if( innerEast && innerWest ) {
4355 cout <<
"MrpcRec::MrpcTrack:convert2RecTofTrackCol: 2- Impossible!" << endl;
4359 recTofTrackCol->push_back( atrack2 );
4362 if( innerEast && innerWest && outerEast && outerWest ) {
4369 recTofTrackCol->push_back( atrack );
4389 cout <<
"MrpcRec::MrpcTrack:convert2RecTofTrackCol: endcap- Impossible!" << endl;
4395 recTofTrackCol->push_back( atrack );
4398 if( m_hitCase ==
NoHit ) {
4405 recTofTrackCol->push_back( atrack );
4425 for(
int i=0; i<6; i++ ) {
4430 track->
setT0( m_estime );
4438 if( ( layerorend == 11 ) || ( layerorend == 12 ) || ( layerorend == 1 ) ) {
4451 m_tofId1 = m_tofId1 + 100;
4457 m_tofId1 = m_tofId1 + 100 + 474;
4465 track->
setTexp( m_texpInner );
4476 if( ( layerorend==21 ) || ( layerorend==22 ) || ( layerorend==2 ) ) {
4481 track->
setTexp( m_texpOuter );
4486 if( layerorend==0 ) {
4497 if( layerorend == 3 ) {
4502 track->
setTexp( m_texpInner );
4514 for(
unsigned int i=0; i<6; i++ ) {
4518 if( layerorend == 0 ) {
4519 track->
setPh( m_ph );
4520 track->
setTof( m_tof[0] );
4522 for(
unsigned int i=0; i<5; i++ ) {
4523 toffset[i] = m_tof[0] - m_tof[i];
4526 track->
setBeta( m_path/m_tof[0]/30.0 );
4528 else if( layerorend == 1 ) {
4529 track->
setPh( m_ph1 );
4530 track->
setTof( m_tof1[0] );
4532 for(
unsigned int i=0; i<5; i++ ) {
4533 toffset[i] = m_tof1[0] - m_tof1[i];
4536 track->
setBeta( m_path1/m_tof1[0]/30.0 );
4538 else if( layerorend == 2 ) {
4539 track->
setPh( m_ph2 );
4540 track->
setTof( m_tof2[0] );
4542 for(
unsigned int i=0; i<5; i++ ) {
4543 toffset[i] = m_tof2[0] - m_tof2[i];
4546 track->
setBeta( m_path2/m_tof2[0]/30.0 );
4548 else if( layerorend == 11 ) {
4549 track->
setPh( m_ph11 );
4550 track->
setTof( m_tof11[0] );
4562 for(
unsigned int i=0; i<5; i++ ) {
4563 toffset[i] = m_tof11[0] - m_tof11[i];
4566 track->
setBeta( m_path1/m_tof11[0]/30.0 );
4570 else if( layerorend == 12 ) {
4571 track->
setPh( m_ph12 );
4572 track->
setTof( m_tof12[0] );
4574 for(
unsigned int i=0; i<5; i++ ) {
4575 toffset[i] = m_tof12[0] - m_tof12[i];
4578 track->
setBeta( m_path1/m_tof12[0]/30.0 );
4580 else if( layerorend == 21 ) {
4581 track->
setPh( m_ph21 );
4582 track->
setTof( m_tof21[0] );
4584 for(
unsigned int i=0; i<5; i++ ) {
4585 toffset[i] = m_tof21[0] - m_tof21[i];
4588 track->
setBeta( m_path2/m_tof21[0]/30.0 );
4590 else if( layerorend == 22 ) {
4591 track->
setPh( m_ph22 );
4592 track->
setTof( m_tof22[0] );
4594 for(
unsigned int i=0; i<5; i++ ) {
4595 toffset[i] = m_tof22[0] - m_tof22[i];
4598 track->
setBeta( m_path2/m_tof22[0]/30.0 );
4601 cout <<
"MrpcRec MrpcTrack::SetRecTofTrack layerorend = " << layerorend << endl;
4615 int neighbourstrip=0;
4616 int neighbourmodule=0;
4620 if(strip==0)
return 0;
4627 neighbourstrip=strip-1;
4628 if(layer==3 || layer== 6)
4629 {neighbourmodule=module;}
4631 {neighbourmodule=module;}
4635 neighbourstrip=strip+1;
4637 if(layer==3 || layer== 5)
4639 neighbourmodule=module;
4643 neighbourmodule=module+1;
4644 if(neighbourmodule==19){neighbourmodule=1;}
4656 neighbourstrip=strip-1;
4658 if(layer==4 || layer== 6)
4659 {neighbourmodule=module;}
4661 {neighbourmodule=module-1;
4662 if(neighbourmodule==0){neighbourmodule=18;}
4667 neighbourstrip=strip+1;
4668 if(layer==3 || layer== 6)
4669 {neighbourmodule=module;}
4671 {neighbourmodule=module;}
4681 if(strip==23 || strip==24) {neighbourmodule=0; neighbourstrip=0;}
4684 neighbourstrip=strip+2;
4685 neighbourmodule=module;
4693 if(strip==1 || strip==2) {neighbourmodule=0; neighbourstrip=0;}
4696 neighbourstrip=strip-2;
4697 neighbourmodule=module;
4724 if(strip%2==0) returnvalue = layer;
4727 if(layer==3) returnvalue = 4;
4728 if(layer==4) returnvalue = 3;
4729 if(layer==5) returnvalue = 6;
4730 if(layer==6) returnvalue = 5;
4736 if(strip%2!=0) returnvalue = layer;
4739 if(layer==3) returnvalue = 4;
4740 if(layer==4) returnvalue = 3;
4741 if(layer==5) returnvalue = 6;
4742 if(layer==6) returnvalue = 5;
4746 if(which==
"u")returnvalue = layer;
4747 if(which==
"b")returnvalue = layer;
std::multimap< unsigned int, TofData * > TofDataMap
std::multimap< unsignedint, TofData * >::iterator IterTofDataMap
double abs(const EvtComplex &c)
bool innerLayer(HoughHit hit1, HoughHit hit2)
double sin(const BesAngle a)
double cos(const BesAngle a)
ObjectVector< RecTofTrack > RecTofTrackCol
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
const Hep3Vector tof1Position() const
const string tof1VolumeName() const
const int tof1VolumeNumber() const
const double tof1() const
const Hep3Vector tof2Momentum() const
const Hep3Vector tof1Momentum() const
const double tof2() const
const double tof2PosSigmaAlongZ() const
const double tof1PosSigmaAlongX() const
const double tof2Path() const
const string tof2VolumeName() const
const int trackId() const
const double tof1PosSigmaAlongY() const
const double tof1PosSigmaAlongZ() const
const int tof2VolumeNumber() const
const Hep3Vector tof2Position() const
void setStatus(unsigned int status)
void setSigma(double sigma[6])
void setToffset(double toffset[6])
void setEnergy(double energy)
void setPath(double path)
void setTofTrackID(int tofTrackID)
void setSigmaMuon(double smu)
void setQuality(int quality)
void setZrHit(double zrhit)
void setSigmaProton(double sp)
void setErrTof(double etof)
void setErrT0(double errt0)
void setTexp(double texp[5])
void setBeta(double beta)
void setSigmaKaon(double sk)
void setErrEnergy(double errenergy)
void setTrackID(int trackID)
void setErrZ(double errz)
void setErrPhi(double errphi)
void setSigmaPion(double spi)
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
TofData * chooseTofDataMRPC(std::vector< TofData *, std::allocator< TofData * > >, double)
void getTofDataMRPC(TofData *, unsigned int)
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)
std::vector< TofData * > tofData1() const
void getTofDataEast(TofData *tof, unsigned int iflag)
unsigned int barrel() const
TofData * compareTofDataMRPC(TofData *tofData1, TofData *tofData2)
void getTofDataWest(TofData *tof, unsigned int iflag)
double tof(unsigned int i) const
void setQuality2(int qual2)
unsigned int quality2() const
void getTofDataNohit(unsigned int iflag)
TofData * compareTofData(TofData *tofData1, TofData *tofData2, double zrhit)
unsigned int quality1() const
void findTofDataMRPC(std::vector< TofData * > tofDataVec1, std::vector< TofData * > tofDataVec2, double zrhit, unsigned int iflag)
int kal(unsigned int i) const
void convert2RecTofTrackCol(RecTofTrackCol *recTofTrackCol)
MrpcCalibSvc * mrpcCaliSvc
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 get_mrpc_stripid_neighbour(std::string, int, int)
std::vector< TofData * > tofData2() const
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)
static value_type getIntID(int barrel_ec, int layer, int phi_module, int end)