11#include "G4LogicalVolume.hh"
37 for(
unsigned int i=0; i<5; i++ ) {
44 if( m_tofData1.size()>0 ) {
45 std::vector<TofData*>::iterator iter1 = m_tofData1.begin();
48 if( m_tofData2.size()>0 ) {
49 std::vector<TofData*>::iterator iter2 = m_tofData2.begin();
52 if( m_tofData3.size()>0 ) {
53 std::vector<TofData*>::iterator iter3 = m_tofData3.begin();
56 if( m_tofData4.size()>0 ) {
57 std::vector<TofData*>::iterator iter4 = m_tofData4.begin();
75 for(
unsigned int i=0; i<5; i++ ) {
106 for(
unsigned int i=0; i<5; i++ ) {
107 m_texpInner[i] = -999.0;
108 m_texpOuter[i] = -999.0;
121 mrpc_extrapolation_good=
false;
130 if( m_tofData1.size()>0 ) {
131 std::vector<TofData*>::iterator iter1 = m_tofData1.begin();
134 if( m_tofData2.size()>0 ) {
135 std::vector<TofData*>::iterator iter2 = m_tofData2.begin();
138 if( m_tofData3.size()>0 ) {
139 std::vector<TofData*>::iterator iter3 = m_tofData3.begin();
142 if( m_tofData4.size()>0 ) {
143 std::vector<TofData*>::iterator iter4 = m_tofData4.begin();
168 if(tof1volumename ==
"logical_sensitive_detector_east_1")
186 else if(tof1volumename ==
"logical_sensitive_detector_east_2")
202 else if(tof1volumename ==
"logical_sensitive_detector_west_1")
218 else if(tof1volumename ==
"logical_sensitive_detector_west_2")
233 else if(
tofId1>=0 &&
tofId1<=87 && ( tof1volumename.contains(
"ScinBr") || tof1volumename.contains(
"ScinEc") || tof2volumename.contains(
"ScinBr") || tof2volumename.contains(
"ScinEc") ))
240 else if(
tofId1>=176 &&
tofId1<=223 && ( tof1volumename.contains(
"ScinBr") || tof1volumename.contains(
"ScinEc") || tof2volumename.contains(
"ScinBr") || tof2volumename.contains(
"ScinEc" ) ))
242 m_id1 =
tofId1 - 176 + 48;
248 else if(
tofId1>=224 &&
tofId1<=271 && ( tof1volumename.contains(
"ScinBr") || tof1volumename.contains(
"ScinEc") || tof2volumename.contains(
"ScinBr") || tof2volumename.contains(
"ScinEc") )) {
249 m_id1 =
tofId1 - 176 - 48;
261 if(
tofId2>=88 &&
tofId2<=175 && ( tof1volumename.contains(
"ScinBr") || tof1volumename.contains(
"ScinEc") || tof2volumename.contains(
"ScinBr") || tof2volumename.contains(
"ScinEc") )) {
267 else if( m_hitCase==
NoHit ) {
274 m_trackId = extTrack->
trackId();
278 for(
unsigned int i=0; i<5; i++ ) {
279 m_texpInner[i] = extTrack->
tof1(i);
288 for(
unsigned int i=0; i<5; i++ ) {
295 for(
unsigned int i=0; i<5; i++ ) {
296 m_texpInner[i] = extTrack->
tof1(i);
306 for(
unsigned int i=0; i<5; i++ ) {
315 for(
unsigned int i=0; i<5; i++ ) {
316 m_texpOuter[i] = extTrack->
tof2(i);
323 for(
unsigned int i=0; i<5; i++ ) {
329 if( m_hitCase ==
NoHit ) { m_quality = 11; }
331 for(
unsigned int i=0; i<5; i++ ) {
348 if( (
abs(m_id1-track->
id1())<=1 ) || ( m_id1==0 && track->
id1()==87 ) || ( m_id1==87 && track->
id1()==0 ) ) {
350 m_quality1 = ( m_quality1 | 0x400 );
355 if( (
abs(m_id2-track->
id2())<=1 ) || ( m_id2==88 && track->
id2()==175 ) || ( m_id2==175 && track->
id2()==88 ) ) {
357 m_quality2 = ( m_quality2 | 0x400 );
364 if( (
abs(m_id1-track->
id1())<=1 ) || ( m_id1==0 && track->
id1()==47 ) || ( m_id1==47 && track->
id1()==0 ) ) {
366 m_quality1 = ( m_quality1 | 0x400 );
372 if( (
abs(m_id1-track->
id1())<=1 ) || ( m_id1==48 && track->
id1()==95 ) || ( m_id1==95 && track->
id1()==48 ) ) {
374 m_quality1 = ( m_quality1 | 0x400 );
397 if( m_hitCase ==
NoHit )
return;
399 unsigned int identify0 = 0x0000c000;
400 unsigned int identify1 = 0x0000c000;
401 unsigned int identify2 = 0x0000c000;
402 unsigned int count0 = 0;
403 unsigned int count1 = 0;
404 unsigned int count2 = 0;
407 unsigned int identify_it=0x0000c000;
408 unsigned int identify_u =0x0000c000;
409 unsigned int identify_b =0x0000c000;
410 unsigned int identify_l =0x0000c000;
411 unsigned int identify_lu=0x0000c000;
412 unsigned int identify_lb=0x0000c000;
413 unsigned int identify_r =0x0000c000;
414 unsigned int identify_ru=0x0000c000;
415 unsigned int identify_rb=0x0000c000;
417 unsigned int identify_luu =0x0000c000;
418 unsigned int identify_lbb =0x0000c000;
419 unsigned int identify_ruu =0x0000c000;
420 unsigned int identify_rbb =0x0000c000;
421 unsigned int identify_uu =0x0000c000;
422 unsigned int identify_bb =0x0000c000;
424 unsigned int identify_luuu =0x0000c000;
425 unsigned int identify_lbbb =0x0000c000;
426 unsigned int identify_ruuu =0x0000c000;
427 unsigned int identify_rbbb =0x0000c000;
428 unsigned int identify_uuu =0x0000c000;
429 unsigned int identify_bbb =0x0000c000;
432 unsigned int identify_luuul =0x0000c000;
433 unsigned int identify_lbbbl =0x0000c000;
434 unsigned int identify_ruuur =0x0000c000;
435 unsigned int identify_rbbbr =0x0000c000;
436 unsigned int identify_luul =0x0000c000;
437 unsigned int identify_lbbl =0x0000c000;
438 unsigned int identify_ruur =0x0000c000;
439 unsigned int identify_rbbr =0x0000c000;
440 unsigned int identify_ll =0x0000c000;
441 unsigned int identify_lul=0x0000c000;
442 unsigned int identify_lbl=0x0000c000;
443 unsigned int identify_rr =0x0000c000;
444 unsigned int identify_rur=0x0000c000;
445 unsigned int identify_rbr=0x0000c000;
449 unsigned int count_it =0;
450 unsigned int count_u =0;
451 unsigned int count_b =0;
452 unsigned int count_l =0;
453 unsigned int count_lu =0;
454 unsigned int count_lb =0;
455 unsigned int count_r =0;
456 unsigned int count_ru =0;
457 unsigned int count_rb =0;
460 unsigned int count_luu =0;
461 unsigned int count_lbb =0;
462 unsigned int count_ruu =0;
463 unsigned int count_rbb =0;
464 unsigned int count_uu =0;
465 unsigned int count_bb =0;
468 unsigned int count_luuu =0;
469 unsigned int count_lbbb =0;
470 unsigned int count_ruuu =0;
471 unsigned int count_rbbb =0;
472 unsigned int count_uuu =0;
473 unsigned int count_bbb =0;
476 unsigned int count_luuul =0;
477 unsigned int count_lbbbl =0;
478 unsigned int count_ruuur =0;
479 unsigned int count_rbbbr =0;
480 unsigned int count_luul =0;
481 unsigned int count_lbbl =0;
482 unsigned int count_ruur =0;
483 unsigned int count_rbbr =0;
484 unsigned int count_ll =0;
485 unsigned int count_lul =0;
486 unsigned int count_lbl =0;
487 unsigned int count_rr =0;
488 unsigned int count_rur =0;
489 unsigned int count_rbr =0;
501 unsigned int identify_if5_it=0x0000c000;
502 unsigned int identify_if5_m1=0x0000c000;
503 unsigned int identify_if5_m2=0x0000c000;
504 unsigned int identify_if5_m3=0x0000c000;
505 unsigned int identify_if5_m4=0x0000c000;
506 unsigned int identify_if5_m5=0x0000c000;
507 unsigned int identify_if5_m6=0x0000c000;
508 unsigned int identify_if5_m7=0x0000c000;
509 unsigned int identify_if5_m8=0x0000c000;
510 unsigned int identify_if5_m9=0x0000c000;
511 unsigned int identify_if5_m10=0x0000c000;
512 unsigned int identify_if5_m11=0x0000c000;
513 unsigned int identify_if5_m12=0x0000c000;
514 unsigned int identify_if5_l1=0x0000c000;
515 unsigned int identify_if5_l2=0x0000c000;
516 unsigned int identify_if5_l3=0x0000c000;
517 unsigned int identify_if5_l4=0x0000c000;
518 unsigned int identify_if5_l5=0x0000c000;
519 unsigned int identify_if5_l6=0x0000c000;
520 unsigned int identify_if5_l7=0x0000c000;
521 unsigned int identify_if5_l8=0x0000c000;
522 unsigned int identify_if5_l9=0x0000c000;
523 unsigned int identify_if5_l10=0x0000c000;
524 unsigned int identify_if5_l11=0x0000c000;
525 unsigned int identify_if5_l12=0x0000c000;
526 unsigned int identify_if5_r1=0x0000c000;
527 unsigned int identify_if5_r2=0x0000c000;
528 unsigned int identify_if5_r3=0x0000c000;
529 unsigned int identify_if5_r4=0x0000c000;
530 unsigned int identify_if5_r5=0x0000c000;
531 unsigned int identify_if5_r6=0x0000c000;
532 unsigned int identify_if5_r7=0x0000c000;
533 unsigned int identify_if5_r8=0x0000c000;
534 unsigned int identify_if5_r9=0x0000c000;
535 unsigned int identify_if5_r10=0x0000c000;
536 unsigned int identify_if5_r11=0x0000c000;
537 unsigned int identify_if5_r12=0x0000c000;
538 unsigned int count_if5_m1=0;
539 unsigned int count_if5_m2=0;
540 unsigned int count_if5_m3=0;
541 unsigned int count_if5_m4=0;
542 unsigned int count_if5_m5=0;
543 unsigned int count_if5_m6=0;
544 unsigned int count_if5_m7=0;
545 unsigned int count_if5_m8=0;
546 unsigned int count_if5_m9=0;
547 unsigned int count_if5_m10=0;
548 unsigned int count_if5_m11=0;
549 unsigned int count_if5_m12=0;
550 unsigned int count_if5_l1=0;
551 unsigned int count_if5_l2=0;
552 unsigned int count_if5_l3=0;
553 unsigned int count_if5_l4=0;
554 unsigned int count_if5_l5=0;
555 unsigned int count_if5_l6=0;
556 unsigned int count_if5_l7=0;
557 unsigned int count_if5_l8=0;
558 unsigned int count_if5_l9=0;
559 unsigned int count_if5_l10=0;
560 unsigned int count_if5_l11=0;
561 unsigned int count_if5_l12=0;
562 unsigned int count_if5_r1=0;
563 unsigned int count_if5_r2=0;
564 unsigned int count_if5_r3=0;
565 unsigned int count_if5_r4=0;
566 unsigned int count_if5_r5=0;
567 unsigned int count_if5_r6=0;
568 unsigned int count_if5_r7=0;
569 unsigned int count_if5_r8=0;
570 unsigned int count_if5_r9=0;
571 unsigned int count_if5_r10=0;
572 unsigned int count_if5_r11=0;
573 unsigned int count_if5_r12=0;
584 unsigned int identify_if6_it=0x0000c000;
585 unsigned int identify_if6_m1=0x0000c000;
586 unsigned int identify_if6_m2=0x0000c000;
587 unsigned int identify_if6_m3=0x0000c000;
588 unsigned int identify_if6_m4=0x0000c000;
589 unsigned int identify_if6_m5=0x0000c000;
590 unsigned int identify_if6_m6=0x0000c000;
591 unsigned int identify_if6_m7=0x0000c000;
592 unsigned int identify_if6_m8=0x0000c000;
593 unsigned int identify_if6_m9=0x0000c000;
594 unsigned int identify_if6_m10=0x0000c000;
595 unsigned int identify_if6_m11=0x0000c000;
596 unsigned int identify_if6_m12=0x0000c000;
597 unsigned int identify_if6_l1=0x0000c000;
598 unsigned int identify_if6_l2=0x0000c000;
599 unsigned int identify_if6_l3=0x0000c000;
600 unsigned int identify_if6_l4=0x0000c000;
601 unsigned int identify_if6_l5=0x0000c000;
602 unsigned int identify_if6_l6=0x0000c000;
603 unsigned int identify_if6_l7=0x0000c000;
604 unsigned int identify_if6_l8=0x0000c000;
605 unsigned int identify_if6_l9=0x0000c000;
606 unsigned int identify_if6_l10=0x0000c000;
607 unsigned int identify_if6_l11=0x0000c000;
608 unsigned int identify_if6_l12=0x0000c000;
609 unsigned int identify_if6_r1=0x0000c000;
610 unsigned int identify_if6_r2=0x0000c000;
611 unsigned int identify_if6_r3=0x0000c000;
612 unsigned int identify_if6_r4=0x0000c000;
613 unsigned int identify_if6_r5=0x0000c000;
614 unsigned int identify_if6_r6=0x0000c000;
615 unsigned int identify_if6_r7=0x0000c000;
616 unsigned int identify_if6_r8=0x0000c000;
617 unsigned int identify_if6_r9=0x0000c000;
618 unsigned int identify_if6_r10=0x0000c000;
619 unsigned int identify_if6_r11=0x0000c000;
620 unsigned int identify_if6_r12=0x0000c000;
621 unsigned int identify_if6_ll1=0x0000c000;
622 unsigned int identify_if6_ll2=0x0000c000;
623 unsigned int identify_if6_ll3=0x0000c000;
624 unsigned int identify_if6_ll4=0x0000c000;
625 unsigned int identify_if6_ll5=0x0000c000;
626 unsigned int identify_if6_ll6=0x0000c000;
627 unsigned int identify_if6_ll7=0x0000c000;
628 unsigned int identify_if6_ll8=0x0000c000;
629 unsigned int identify_if6_ll9=0x0000c000;
630 unsigned int identify_if6_ll10=0x0000c000;
631 unsigned int identify_if6_ll11=0x0000c000;
632 unsigned int identify_if6_ll12=0x0000c000;
633 unsigned int identify_if6_rr1=0x0000c000;
634 unsigned int identify_if6_rr2=0x0000c000;
635 unsigned int identify_if6_rr3=0x0000c000;
636 unsigned int identify_if6_rr4=0x0000c000;
637 unsigned int identify_if6_rr5=0x0000c000;
638 unsigned int identify_if6_rr6=0x0000c000;
639 unsigned int identify_if6_rr7=0x0000c000;
640 unsigned int identify_if6_rr8=0x0000c000;
641 unsigned int identify_if6_rr9=0x0000c000;
642 unsigned int identify_if6_rr10=0x0000c000;
643 unsigned int identify_if6_rr11=0x0000c000;
644 unsigned int identify_if6_rr12=0x0000c000;
645 unsigned int count_if6_m1=0;
646 unsigned int count_if6_m2=0;
647 unsigned int count_if6_m3=0;
648 unsigned int count_if6_m4=0;
649 unsigned int count_if6_m5=0;
650 unsigned int count_if6_m6=0;
651 unsigned int count_if6_m7=0;
652 unsigned int count_if6_m8=0;
653 unsigned int count_if6_m9=0;
654 unsigned int count_if6_m10=0;
655 unsigned int count_if6_m11=0;
656 unsigned int count_if6_m12=0;
657 unsigned int count_if6_l1=0;
658 unsigned int count_if6_l2=0;
659 unsigned int count_if6_l3=0;
660 unsigned int count_if6_l4=0;
661 unsigned int count_if6_l5=0;
662 unsigned int count_if6_l6=0;
663 unsigned int count_if6_l7=0;
664 unsigned int count_if6_l8=0;
665 unsigned int count_if6_l9=0;
666 unsigned int count_if6_l10=0;
667 unsigned int count_if6_l11=0;
668 unsigned int count_if6_l12=0;
669 unsigned int count_if6_r1=0;
670 unsigned int count_if6_r2=0;
671 unsigned int count_if6_r3=0;
672 unsigned int count_if6_r4=0;
673 unsigned int count_if6_r5=0;
674 unsigned int count_if6_r6=0;
675 unsigned int count_if6_r7=0;
676 unsigned int count_if6_r8=0;
677 unsigned int count_if6_r9=0;
678 unsigned int count_if6_r10=0;
679 unsigned int count_if6_r11=0;
680 unsigned int count_if6_r12=0;
681 unsigned int count_if6_ll1=0;
682 unsigned int count_if6_ll2=0;
683 unsigned int count_if6_ll3=0;
684 unsigned int count_if6_ll4=0;
685 unsigned int count_if6_ll5=0;
686 unsigned int count_if6_ll6=0;
687 unsigned int count_if6_ll7=0;
688 unsigned int count_if6_ll8=0;
689 unsigned int count_if6_ll9=0;
690 unsigned int count_if6_ll10=0;
691 unsigned int count_if6_ll11=0;
692 unsigned int count_if6_ll12=0;
693 unsigned int count_if6_rr1=0;
694 unsigned int count_if6_rr2=0;
695 unsigned int count_if6_rr3=0;
696 unsigned int count_if6_rr4=0;
697 unsigned int count_if6_rr5=0;
698 unsigned int count_if6_rr6=0;
699 unsigned int count_if6_rr7=0;
700 unsigned int count_if6_rr8=0;
701 unsigned int count_if6_rr9=0;
702 unsigned int count_if6_rr10=0;
703 unsigned int count_if6_rr11=0;
704 unsigned int count_if6_rr12=0;
708 int tofid_it = m_id1;
710 count_it = tofDataMap.count( identify_it );
796 if( (neighborhood==1) || (neighborhood==2) || (neighborhood==3) || (neighborhood==4) )
799 count_l = tofDataMap.count(identify_l );
801 count_r = tofDataMap.count(identify_r);
803 count_u = tofDataMap.count(identify_u);
805 count_b = tofDataMap.count(identify_b);
807 count_lu = tofDataMap.count(identify_lu);
809 count_lb = tofDataMap.count(identify_lb);
811 count_ru = tofDataMap.count(identify_ru);
813 count_rb = tofDataMap.count(identify_rb);
817 if( (neighborhood==2) || (neighborhood==3) || (neighborhood==4) )
822 count_luu = tofDataMap.count(identify_luu );
824 count_ruu = tofDataMap.count(identify_ruu);
826 count_uu = tofDataMap.count(identify_uu);
828 count_bb = tofDataMap.count(identify_bb);
830 count_lbb = tofDataMap.count(identify_lbb);
832 count_rbb = tofDataMap.count(identify_rbb);
836 if((neighborhood==3) || (neighborhood==4))
841 count_luuu = tofDataMap.count(identify_luuu );
843 count_ruuu = tofDataMap.count(identify_ruuu);
845 count_uuu = tofDataMap.count(identify_uuu);
847 count_bbb = tofDataMap.count(identify_bbb);
849 count_lbbb = tofDataMap.count(identify_lbbb);
851 count_rbbb = tofDataMap.count(identify_rbbb);
856 if((neighborhood==4))
860 count_luuul = tofDataMap.count(identify_luuul );
862 count_ruuur = tofDataMap.count(identify_ruuur);
864 count_lbbbl = tofDataMap.count(identify_lbbbl);
866 count_rbbbr = tofDataMap.count(identify_rbbbr);
869 count_luul = tofDataMap.count(identify_luul );
871 count_ruur = tofDataMap.count(identify_ruur);
873 count_lbbl = tofDataMap.count(identify_lbbl);
875 count_rbbr = tofDataMap.count(identify_rbbr);
878 count_ll = tofDataMap.count(identify_ll );
880 count_rr = tofDataMap.count(identify_rr);
882 count_lul = tofDataMap.count(identify_lul);
884 count_lbl = tofDataMap.count(identify_lbl);
886 count_rur = tofDataMap.count(identify_rur);
888 count_rbr = tofDataMap.count(identify_rbr);
894 if((neighborhood==5))
900 if((strip_number_if5)%2==0)
916 count_if5_m1=tofDataMap.count(identify_if5_m1);
917 count_if5_m2=tofDataMap.count(identify_if5_m2);
918 count_if5_m3=tofDataMap.count(identify_if5_m3);
919 count_if5_m4=tofDataMap.count(identify_if5_m4);
920 count_if5_m5=tofDataMap.count(identify_if5_m5);
921 count_if5_m6=tofDataMap.count(identify_if5_m6);
922 count_if5_m7=tofDataMap.count(identify_if5_m7);
923 count_if5_m8=tofDataMap.count(identify_if5_m8);
924 count_if5_m9=tofDataMap.count(identify_if5_m9);
925 count_if5_m10=tofDataMap.count(identify_if5_m10);
926 count_if5_m11=tofDataMap.count(identify_if5_m11);
927 count_if5_m12=tofDataMap.count(identify_if5_m12);
968 count_if5_l1=tofDataMap.count(identify_if5_l1);
969 count_if5_l2=tofDataMap.count(identify_if5_l2);
970 count_if5_l3=tofDataMap.count(identify_if5_l3);
971 count_if5_l4=tofDataMap.count(identify_if5_l4);
972 count_if5_l5=tofDataMap.count(identify_if5_l5);
973 count_if5_l6=tofDataMap.count(identify_if5_l6);
974 count_if5_l7=tofDataMap.count(identify_if5_l7);
975 count_if5_l8=tofDataMap.count(identify_if5_l8);
976 count_if5_l9=tofDataMap.count(identify_if5_l9);
977 count_if5_l10=tofDataMap.count(identify_if5_l10);
978 count_if5_l11=tofDataMap.count(identify_if5_l11);
979 count_if5_l12=tofDataMap.count(identify_if5_l12);
980 count_if5_r1=tofDataMap.count(identify_if5_r1);
981 count_if5_r2=tofDataMap.count(identify_if5_r2);
982 count_if5_r3=tofDataMap.count(identify_if5_r3);
983 count_if5_r4=tofDataMap.count(identify_if5_r4);
984 count_if5_r5=tofDataMap.count(identify_if5_r5);
985 count_if5_r6=tofDataMap.count(identify_if5_r6);
986 count_if5_r7=tofDataMap.count(identify_if5_r7);
987 count_if5_r8=tofDataMap.count(identify_if5_r8);
988 count_if5_r9=tofDataMap.count(identify_if5_r9);
989 count_if5_r10=tofDataMap.count(identify_if5_r10);
990 count_if5_r11=tofDataMap.count(identify_if5_r11);
991 count_if5_r12=tofDataMap.count(identify_if5_r12);
1050 count_if5_m1=tofDataMap.count(identify_if5_m1);
1051 count_if5_m2=tofDataMap.count(identify_if5_m2);
1052 count_if5_m3=tofDataMap.count(identify_if5_m3);
1053 count_if5_m4=tofDataMap.count(identify_if5_m4);
1054 count_if5_m5=tofDataMap.count(identify_if5_m5);
1055 count_if5_m6=tofDataMap.count(identify_if5_m6);
1056 count_if5_m7=tofDataMap.count(identify_if5_m7);
1057 count_if5_m8=tofDataMap.count(identify_if5_m8);
1058 count_if5_m9=tofDataMap.count(identify_if5_m9);
1059 count_if5_m10=tofDataMap.count(identify_if5_m10);
1060 count_if5_m11=tofDataMap.count(identify_if5_m11);
1061 count_if5_m12=tofDataMap.count(identify_if5_m12);
1148 count_if5_l1=tofDataMap.count(identify_if5_l1);
1149 count_if5_l2=tofDataMap.count(identify_if5_l2);
1150 count_if5_l3=tofDataMap.count(identify_if5_l3);
1151 count_if5_l4=tofDataMap.count(identify_if5_l4);
1152 count_if5_l5=tofDataMap.count(identify_if5_l5);
1153 count_if5_l6=tofDataMap.count(identify_if5_l6);
1154 count_if5_l7=tofDataMap.count(identify_if5_l7);
1155 count_if5_l8=tofDataMap.count(identify_if5_l8);
1156 count_if5_l9=tofDataMap.count(identify_if5_l9);
1157 count_if5_l10=tofDataMap.count(identify_if5_l10);
1158 count_if5_l11=tofDataMap.count(identify_if5_l11);
1159 count_if5_l12=tofDataMap.count(identify_if5_l12);
1160 count_if5_r1=tofDataMap.count(identify_if5_r1);
1161 count_if5_r2=tofDataMap.count(identify_if5_r2);
1162 count_if5_r3=tofDataMap.count(identify_if5_r3);
1163 count_if5_r4=tofDataMap.count(identify_if5_r4);
1164 count_if5_r5=tofDataMap.count(identify_if5_r5);
1165 count_if5_r6=tofDataMap.count(identify_if5_r6);
1166 count_if5_r7=tofDataMap.count(identify_if5_r7);
1167 count_if5_r8=tofDataMap.count(identify_if5_r8);
1168 count_if5_r9=tofDataMap.count(identify_if5_r9);
1169 count_if5_r10=tofDataMap.count(identify_if5_r10);
1170 count_if5_r11=tofDataMap.count(identify_if5_r11);
1171 count_if5_r12=tofDataMap.count(identify_if5_r12);
1181 if((neighborhood==6))
1189 if((strip_number_if6)%2==0)
1208 count_if6_m1=tofDataMap.count(identify_if6_m1);
1209 count_if6_m2=tofDataMap.count(identify_if6_m2);
1210 count_if6_m3=tofDataMap.count(identify_if6_m3);
1211 count_if6_m4=tofDataMap.count(identify_if6_m4);
1212 count_if6_m5=tofDataMap.count(identify_if6_m5);
1213 count_if6_m6=tofDataMap.count(identify_if6_m6);
1214 count_if6_m7=tofDataMap.count(identify_if6_m7);
1215 count_if6_m8=tofDataMap.count(identify_if6_m8);
1216 count_if6_m9=tofDataMap.count(identify_if6_m9);
1217 count_if6_m10=tofDataMap.count(identify_if6_m10);
1218 count_if6_m11=tofDataMap.count(identify_if6_m11);
1219 count_if6_m12=tofDataMap.count(identify_if6_m12);
1261 count_if6_l1=tofDataMap.count(identify_if6_l1);
1262 count_if6_l2=tofDataMap.count(identify_if6_l2);
1263 count_if6_l3=tofDataMap.count(identify_if6_l3);
1264 count_if6_l4=tofDataMap.count(identify_if6_l4);
1265 count_if6_l5=tofDataMap.count(identify_if6_l5);
1266 count_if6_l6=tofDataMap.count(identify_if6_l6);
1267 count_if6_l7=tofDataMap.count(identify_if6_l7);
1268 count_if6_l8=tofDataMap.count(identify_if6_l8);
1269 count_if6_l9=tofDataMap.count(identify_if6_l9);
1270 count_if6_l10=tofDataMap.count(identify_if6_l10);
1271 count_if6_l11=tofDataMap.count(identify_if6_l11);
1272 count_if6_l12=tofDataMap.count(identify_if6_l12);
1273 count_if6_r1=tofDataMap.count(identify_if6_r1);
1274 count_if6_r2=tofDataMap.count(identify_if6_r2);
1275 count_if6_r3=tofDataMap.count(identify_if6_r3);
1276 count_if6_r4=tofDataMap.count(identify_if6_r4);
1277 count_if6_r5=tofDataMap.count(identify_if6_r5);
1278 count_if6_r6=tofDataMap.count(identify_if6_r6);
1279 count_if6_r7=tofDataMap.count(identify_if6_r7);
1280 count_if6_r8=tofDataMap.count(identify_if6_r8);
1281 count_if6_r9=tofDataMap.count(identify_if6_r9);
1282 count_if6_r10=tofDataMap.count(identify_if6_r10);
1283 count_if6_r11=tofDataMap.count(identify_if6_r11);
1284 count_if6_r12=tofDataMap.count(identify_if6_r12);
1352 count_if6_ll1=tofDataMap.count(identify_if6_ll1);
1353 count_if6_ll2=tofDataMap.count(identify_if6_ll2);
1354 count_if6_ll3=tofDataMap.count(identify_if6_ll3);
1355 count_if6_ll4=tofDataMap.count(identify_if6_ll4);
1356 count_if6_ll5=tofDataMap.count(identify_if6_ll5);
1357 count_if6_ll6=tofDataMap.count(identify_if6_ll6);
1358 count_if6_ll7=tofDataMap.count(identify_if6_ll7);
1359 count_if6_ll8=tofDataMap.count(identify_if6_ll8);
1360 count_if6_ll9=tofDataMap.count(identify_if6_ll9);
1361 count_if6_ll10=tofDataMap.count(identify_if6_ll10);
1362 count_if6_ll11=tofDataMap.count(identify_if6_ll11);
1363 count_if6_ll12=tofDataMap.count(identify_if6_ll12);
1364 count_if6_rr1=tofDataMap.count(identify_if6_rr1);
1365 count_if6_rr2=tofDataMap.count(identify_if6_rr2);
1366 count_if6_rr3=tofDataMap.count(identify_if6_rr3);
1367 count_if6_rr4=tofDataMap.count(identify_if6_rr4);
1368 count_if6_rr5=tofDataMap.count(identify_if6_rr5);
1369 count_if6_rr6=tofDataMap.count(identify_if6_rr6);
1370 count_if6_rr7=tofDataMap.count(identify_if6_rr7);
1371 count_if6_rr8=tofDataMap.count(identify_if6_rr8);
1372 count_if6_rr9=tofDataMap.count(identify_if6_rr9);
1373 count_if6_rr10=tofDataMap.count(identify_if6_rr10);
1374 count_if6_rr11=tofDataMap.count(identify_if6_rr11);
1375 count_if6_rr12=tofDataMap.count(identify_if6_rr12);
1486 count_if6_m1=tofDataMap.count(identify_if6_m1);
1487 count_if6_m2=tofDataMap.count(identify_if6_m2);
1488 count_if6_m3=tofDataMap.count(identify_if6_m3);
1489 count_if6_m4=tofDataMap.count(identify_if6_m4);
1490 count_if6_m5=tofDataMap.count(identify_if6_m5);
1491 count_if6_m6=tofDataMap.count(identify_if6_m6);
1492 count_if6_m7=tofDataMap.count(identify_if6_m7);
1493 count_if6_m8=tofDataMap.count(identify_if6_m8);
1494 count_if6_m9=tofDataMap.count(identify_if6_m9);
1495 count_if6_m10=tofDataMap.count(identify_if6_m10);
1496 count_if6_m11=tofDataMap.count(identify_if6_m11);
1497 count_if6_m12=tofDataMap.count(identify_if6_m12);
1540 count_if6_l1=tofDataMap.count(identify_if6_l1);
1541 count_if6_l2=tofDataMap.count(identify_if6_l2);
1542 count_if6_l3=tofDataMap.count(identify_if6_l3);
1543 count_if6_l4=tofDataMap.count(identify_if6_l4);
1544 count_if6_l5=tofDataMap.count(identify_if6_l5);
1545 count_if6_l6=tofDataMap.count(identify_if6_l6);
1546 count_if6_l7=tofDataMap.count(identify_if6_l7);
1547 count_if6_l8=tofDataMap.count(identify_if6_l8);
1548 count_if6_l9=tofDataMap.count(identify_if6_l9);
1549 count_if6_l10=tofDataMap.count(identify_if6_l10);
1550 count_if6_l11=tofDataMap.count(identify_if6_l11);
1551 count_if6_l12=tofDataMap.count(identify_if6_l12);
1552 count_if6_r1=tofDataMap.count(identify_if6_r1);
1553 count_if6_r2=tofDataMap.count(identify_if6_r2);
1554 count_if6_r3=tofDataMap.count(identify_if6_r3);
1555 count_if6_r4=tofDataMap.count(identify_if6_r4);
1556 count_if6_r5=tofDataMap.count(identify_if6_r5);
1557 count_if6_r6=tofDataMap.count(identify_if6_r6);
1558 count_if6_r7=tofDataMap.count(identify_if6_r7);
1559 count_if6_r8=tofDataMap.count(identify_if6_r8);
1560 count_if6_r9=tofDataMap.count(identify_if6_r9);
1561 count_if6_r10=tofDataMap.count(identify_if6_r10);
1562 count_if6_r11=tofDataMap.count(identify_if6_r11);
1563 count_if6_r12=tofDataMap.count(identify_if6_r12);
1632 count_if6_ll1=tofDataMap.count(identify_if6_ll1);
1633 count_if6_ll2=tofDataMap.count(identify_if6_ll2);
1634 count_if6_ll3=tofDataMap.count(identify_if6_ll3);
1635 count_if6_ll4=tofDataMap.count(identify_if6_ll4);
1636 count_if6_ll5=tofDataMap.count(identify_if6_ll5);
1637 count_if6_ll6=tofDataMap.count(identify_if6_ll6);
1638 count_if6_ll7=tofDataMap.count(identify_if6_ll7);
1639 count_if6_ll8=tofDataMap.count(identify_if6_ll8);
1640 count_if6_ll9=tofDataMap.count(identify_if6_ll9);
1641 count_if6_ll10=tofDataMap.count(identify_if6_ll10);
1642 count_if6_ll11=tofDataMap.count(identify_if6_ll11);
1643 count_if6_ll12=tofDataMap.count(identify_if6_ll12);
1644 count_if6_rr1=tofDataMap.count(identify_if6_rr1);
1645 count_if6_rr2=tofDataMap.count(identify_if6_rr2);
1646 count_if6_rr3=tofDataMap.count(identify_if6_rr3);
1647 count_if6_rr4=tofDataMap.count(identify_if6_rr4);
1648 count_if6_rr5=tofDataMap.count(identify_if6_rr5);
1649 count_if6_rr6=tofDataMap.count(identify_if6_rr6);
1650 count_if6_rr7=tofDataMap.count(identify_if6_rr7);
1651 count_if6_rr8=tofDataMap.count(identify_if6_rr8);
1652 count_if6_rr9=tofDataMap.count(identify_if6_rr9);
1653 count_if6_rr10=tofDataMap.count(identify_if6_rr10);
1654 count_if6_rr11=tofDataMap.count(identify_if6_rr11);
1655 count_if6_rr12=tofDataMap.count(identify_if6_rr12);
1767 int tofid_it = m_id1;
1769 count_it = tofDataMap.count( identify_it );
1854 if( (neighborhood==1) || (neighborhood==2) || (neighborhood==3) || (neighborhood==4) )
1857 count_l = tofDataMap.count(identify_l );
1859 count_r = tofDataMap.count(identify_r);
1861 count_u = tofDataMap.count(identify_u);
1863 count_b = tofDataMap.count(identify_b);
1865 count_lu = tofDataMap.count(identify_lu);
1867 count_lb = tofDataMap.count(identify_lb);
1869 count_ru = tofDataMap.count(identify_ru);
1871 count_rb = tofDataMap.count(identify_rb);
1876 if((neighborhood==2) || (neighborhood==3)|| (neighborhood==4))
1879 count_luu = tofDataMap.count(identify_luu );
1881 count_ruu = tofDataMap.count(identify_ruu);
1883 count_uu = tofDataMap.count(identify_uu);
1885 count_bb = tofDataMap.count(identify_bb);
1887 count_lbb = tofDataMap.count(identify_lbb);
1889 count_rbb = tofDataMap.count(identify_rbb);
1895 if((neighborhood==3)|| (neighborhood==4))
1898 count_luuu = tofDataMap.count(identify_luuu );
1900 count_ruuu = tofDataMap.count(identify_ruuu);
1902 count_uuu = tofDataMap.count(identify_uuu);
1904 count_bbb = tofDataMap.count(identify_bbb);
1906 count_lbbb = tofDataMap.count(identify_lbbb);
1908 count_rbbb = tofDataMap.count(identify_rbbb);
1913 if((neighborhood==4))
1916 count_luuul = tofDataMap.count(identify_luuul );
1918 count_ruuur = tofDataMap.count(identify_ruuur);
1920 count_lbbbl = tofDataMap.count(identify_lbbbl);
1922 count_rbbbr = tofDataMap.count(identify_rbbbr);
1925 count_luul = tofDataMap.count(identify_luul );
1927 count_ruur = tofDataMap.count(identify_ruur);
1929 count_lbbl = tofDataMap.count(identify_lbbl);
1931 count_rbbr = tofDataMap.count(identify_rbbr);
1934 count_ll = tofDataMap.count(identify_ll );
1936 count_rr = tofDataMap.count(identify_rr);
1938 count_lul = tofDataMap.count(identify_lul);
1940 count_lbl = tofDataMap.count(identify_lbl);
1942 count_rur = tofDataMap.count(identify_rur);
1944 count_rbr = tofDataMap.count(identify_rbr);
1950 if((neighborhood==5))
1955 if((strip_number_if5)%2==0)
1970 count_if5_m1=tofDataMap.count(identify_if5_m1);
1971 count_if5_m2=tofDataMap.count(identify_if5_m2);
1972 count_if5_m3=tofDataMap.count(identify_if5_m3);
1973 count_if5_m4=tofDataMap.count(identify_if5_m4);
1974 count_if5_m5=tofDataMap.count(identify_if5_m5);
1975 count_if5_m6=tofDataMap.count(identify_if5_m6);
1976 count_if5_m7=tofDataMap.count(identify_if5_m7);
1977 count_if5_m8=tofDataMap.count(identify_if5_m8);
1978 count_if5_m9=tofDataMap.count(identify_if5_m9);
1979 count_if5_m10=tofDataMap.count(identify_if5_m10);
1980 count_if5_m11=tofDataMap.count(identify_if5_m11);
1981 count_if5_m12=tofDataMap.count(identify_if5_m12);
2025 count_if5_l1=tofDataMap.count(identify_if5_l1);
2026 count_if5_l2=tofDataMap.count(identify_if5_l2);
2027 count_if5_l3=tofDataMap.count(identify_if5_l3);
2028 count_if5_l4=tofDataMap.count(identify_if5_l4);
2029 count_if5_l5=tofDataMap.count(identify_if5_l5);
2030 count_if5_l6=tofDataMap.count(identify_if5_l6);
2031 count_if5_l7=tofDataMap.count(identify_if5_l7);
2032 count_if5_l8=tofDataMap.count(identify_if5_l8);
2033 count_if5_l9=tofDataMap.count(identify_if5_l9);
2034 count_if5_l10=tofDataMap.count(identify_if5_l10);
2035 count_if5_l11=tofDataMap.count(identify_if5_l11);
2036 count_if5_l12=tofDataMap.count(identify_if5_l12);
2037 count_if5_r1=tofDataMap.count(identify_if5_r1);
2038 count_if5_r2=tofDataMap.count(identify_if5_r2);
2039 count_if5_r3=tofDataMap.count(identify_if5_r3);
2040 count_if5_r4=tofDataMap.count(identify_if5_r4);
2041 count_if5_r5=tofDataMap.count(identify_if5_r5);
2042 count_if5_r6=tofDataMap.count(identify_if5_r6);
2043 count_if5_r7=tofDataMap.count(identify_if5_r7);
2044 count_if5_r8=tofDataMap.count(identify_if5_r8);
2045 count_if5_r9=tofDataMap.count(identify_if5_r9);
2046 count_if5_r10=tofDataMap.count(identify_if5_r10);
2047 count_if5_r11=tofDataMap.count(identify_if5_r11);
2048 count_if5_r12=tofDataMap.count(identify_if5_r12);
2067 count_if5_m1=tofDataMap.count(identify_if5_m1);
2068 count_if5_m2=tofDataMap.count(identify_if5_m2);
2069 count_if5_m3=tofDataMap.count(identify_if5_m3);
2070 count_if5_m4=tofDataMap.count(identify_if5_m4);
2071 count_if5_m5=tofDataMap.count(identify_if5_m5);
2072 count_if5_m6=tofDataMap.count(identify_if5_m6);
2073 count_if5_m7=tofDataMap.count(identify_if5_m7);
2074 count_if5_m8=tofDataMap.count(identify_if5_m8);
2075 count_if5_m9=tofDataMap.count(identify_if5_m9);
2076 count_if5_m10=tofDataMap.count(identify_if5_m10);
2077 count_if5_m11=tofDataMap.count(identify_if5_m11);
2078 count_if5_m12=tofDataMap.count(identify_if5_m12);
2121 count_if5_l1=tofDataMap.count(identify_if5_l1);
2122 count_if5_l2=tofDataMap.count(identify_if5_l2);
2123 count_if5_l3=tofDataMap.count(identify_if5_l3);
2124 count_if5_l4=tofDataMap.count(identify_if5_l4);
2125 count_if5_l5=tofDataMap.count(identify_if5_l5);
2126 count_if5_l6=tofDataMap.count(identify_if5_l6);
2127 count_if5_l7=tofDataMap.count(identify_if5_l7);
2128 count_if5_l8=tofDataMap.count(identify_if5_l8);
2129 count_if5_l9=tofDataMap.count(identify_if5_l9);
2130 count_if5_l10=tofDataMap.count(identify_if5_l10);
2131 count_if5_l11=tofDataMap.count(identify_if5_l11);
2132 count_if5_l12=tofDataMap.count(identify_if5_l12);
2133 count_if5_r1=tofDataMap.count(identify_if5_r1);
2134 count_if5_r2=tofDataMap.count(identify_if5_r2);
2135 count_if5_r3=tofDataMap.count(identify_if5_r3);
2136 count_if5_r4=tofDataMap.count(identify_if5_r4);
2137 count_if5_r5=tofDataMap.count(identify_if5_r5);
2138 count_if5_r6=tofDataMap.count(identify_if5_r6);
2139 count_if5_r7=tofDataMap.count(identify_if5_r7);
2140 count_if5_r8=tofDataMap.count(identify_if5_r8);
2141 count_if5_r9=tofDataMap.count(identify_if5_r9);
2142 count_if5_r10=tofDataMap.count(identify_if5_r10);
2143 count_if5_r11=tofDataMap.count(identify_if5_r11);
2144 count_if5_r12=tofDataMap.count(identify_if5_r12);
2152 if((neighborhood==6))
2158 if((strip_number_if6)%2==0)
2176 count_if6_m1=tofDataMap.count(identify_if6_m1);
2177 count_if6_m2=tofDataMap.count(identify_if6_m2);
2178 count_if6_m3=tofDataMap.count(identify_if6_m3);
2179 count_if6_m4=tofDataMap.count(identify_if6_m4);
2180 count_if6_m5=tofDataMap.count(identify_if6_m5);
2181 count_if6_m6=tofDataMap.count(identify_if6_m6);
2182 count_if6_m7=tofDataMap.count(identify_if6_m7);
2183 count_if6_m8=tofDataMap.count(identify_if6_m8);
2184 count_if6_m9=tofDataMap.count(identify_if6_m9);
2185 count_if6_m10=tofDataMap.count(identify_if6_m10);
2186 count_if6_m11=tofDataMap.count(identify_if6_m11);
2187 count_if6_m12=tofDataMap.count(identify_if6_m12);
2229 count_if6_l1=tofDataMap.count(identify_if6_l1);
2230 count_if6_l2=tofDataMap.count(identify_if6_l2);
2231 count_if6_l3=tofDataMap.count(identify_if6_l3);
2232 count_if6_l4=tofDataMap.count(identify_if6_l4);
2233 count_if6_l5=tofDataMap.count(identify_if6_l5);
2234 count_if6_l6=tofDataMap.count(identify_if6_l6);
2235 count_if6_l7=tofDataMap.count(identify_if6_l7);
2236 count_if6_l8=tofDataMap.count(identify_if6_l8);
2237 count_if6_l9=tofDataMap.count(identify_if6_l9);
2238 count_if6_l10=tofDataMap.count(identify_if6_l10);
2239 count_if6_l11=tofDataMap.count(identify_if6_l11);
2240 count_if6_l12=tofDataMap.count(identify_if6_l12);
2241 count_if6_r1=tofDataMap.count(identify_if6_r1);
2242 count_if6_r2=tofDataMap.count(identify_if6_r2);
2243 count_if6_r3=tofDataMap.count(identify_if6_r3);
2244 count_if6_r4=tofDataMap.count(identify_if6_r4);
2245 count_if6_r5=tofDataMap.count(identify_if6_r5);
2246 count_if6_r6=tofDataMap.count(identify_if6_r6);
2247 count_if6_r7=tofDataMap.count(identify_if6_r7);
2248 count_if6_r8=tofDataMap.count(identify_if6_r8);
2249 count_if6_r9=tofDataMap.count(identify_if6_r9);
2250 count_if6_r10=tofDataMap.count(identify_if6_r10);
2251 count_if6_r11=tofDataMap.count(identify_if6_r11);
2252 count_if6_r12=tofDataMap.count(identify_if6_r12);
2318 count_if6_ll1=tofDataMap.count(identify_if6_ll1);
2319 count_if6_ll2=tofDataMap.count(identify_if6_ll2);
2320 count_if6_ll3=tofDataMap.count(identify_if6_ll3);
2321 count_if6_ll4=tofDataMap.count(identify_if6_ll4);
2322 count_if6_ll5=tofDataMap.count(identify_if6_ll5);
2323 count_if6_ll6=tofDataMap.count(identify_if6_ll6);
2324 count_if6_ll7=tofDataMap.count(identify_if6_ll7);
2325 count_if6_ll8=tofDataMap.count(identify_if6_ll8);
2326 count_if6_ll9=tofDataMap.count(identify_if6_ll9);
2327 count_if6_ll10=tofDataMap.count(identify_if6_ll10);
2328 count_if6_ll11=tofDataMap.count(identify_if6_ll11);
2329 count_if6_ll12=tofDataMap.count(identify_if6_ll12);
2330 count_if6_rr1=tofDataMap.count(identify_if6_rr1);
2331 count_if6_rr2=tofDataMap.count(identify_if6_rr2);
2332 count_if6_rr3=tofDataMap.count(identify_if6_rr3);
2333 count_if6_rr4=tofDataMap.count(identify_if6_rr4);
2334 count_if6_rr5=tofDataMap.count(identify_if6_rr5);
2335 count_if6_rr6=tofDataMap.count(identify_if6_rr6);
2336 count_if6_rr7=tofDataMap.count(identify_if6_rr7);
2337 count_if6_rr8=tofDataMap.count(identify_if6_rr8);
2338 count_if6_rr9=tofDataMap.count(identify_if6_rr9);
2339 count_if6_rr10=tofDataMap.count(identify_if6_rr10);
2340 count_if6_rr11=tofDataMap.count(identify_if6_rr11);
2341 count_if6_rr12=tofDataMap.count(identify_if6_rr12);
2362 count_if6_m1=tofDataMap.count(identify_if6_m1);
2363 count_if6_m2=tofDataMap.count(identify_if6_m2);
2364 count_if6_m3=tofDataMap.count(identify_if6_m3);
2365 count_if6_m4=tofDataMap.count(identify_if6_m4);
2366 count_if6_m5=tofDataMap.count(identify_if6_m5);
2367 count_if6_m6=tofDataMap.count(identify_if6_m6);
2368 count_if6_m7=tofDataMap.count(identify_if6_m7);
2369 count_if6_m8=tofDataMap.count(identify_if6_m8);
2370 count_if6_m9=tofDataMap.count(identify_if6_m9);
2371 count_if6_m10=tofDataMap.count(identify_if6_m10);
2372 count_if6_m11=tofDataMap.count(identify_if6_m11);
2373 count_if6_m12=tofDataMap.count(identify_if6_m12);
2416 count_if6_l1=tofDataMap.count(identify_if6_l1);
2417 count_if6_l2=tofDataMap.count(identify_if6_l2);
2418 count_if6_l3=tofDataMap.count(identify_if6_l3);
2419 count_if6_l4=tofDataMap.count(identify_if6_l4);
2420 count_if6_l5=tofDataMap.count(identify_if6_l5);
2421 count_if6_l6=tofDataMap.count(identify_if6_l6);
2422 count_if6_l7=tofDataMap.count(identify_if6_l7);
2423 count_if6_l8=tofDataMap.count(identify_if6_l8);
2424 count_if6_l9=tofDataMap.count(identify_if6_l9);
2425 count_if6_l10=tofDataMap.count(identify_if6_l10);
2426 count_if6_l11=tofDataMap.count(identify_if6_l11);
2427 count_if6_l12=tofDataMap.count(identify_if6_l12);
2428 count_if6_r1=tofDataMap.count(identify_if6_r1);
2429 count_if6_r2=tofDataMap.count(identify_if6_r2);
2430 count_if6_r3=tofDataMap.count(identify_if6_r3);
2431 count_if6_r4=tofDataMap.count(identify_if6_r4);
2432 count_if6_r5=tofDataMap.count(identify_if6_r5);
2433 count_if6_r6=tofDataMap.count(identify_if6_r6);
2434 count_if6_r7=tofDataMap.count(identify_if6_r7);
2435 count_if6_r8=tofDataMap.count(identify_if6_r8);
2436 count_if6_r9=tofDataMap.count(identify_if6_r9);
2437 count_if6_r10=tofDataMap.count(identify_if6_r10);
2438 count_if6_r11=tofDataMap.count(identify_if6_r11);
2439 count_if6_r12=tofDataMap.count(identify_if6_r12);
2508 count_if6_ll1=tofDataMap.count(identify_if6_ll1);
2509 count_if6_ll2=tofDataMap.count(identify_if6_ll2);
2510 count_if6_ll3=tofDataMap.count(identify_if6_ll3);
2511 count_if6_ll4=tofDataMap.count(identify_if6_ll4);
2512 count_if6_ll5=tofDataMap.count(identify_if6_ll5);
2513 count_if6_ll6=tofDataMap.count(identify_if6_ll6);
2514 count_if6_ll7=tofDataMap.count(identify_if6_ll7);
2515 count_if6_ll8=tofDataMap.count(identify_if6_ll8);
2516 count_if6_ll9=tofDataMap.count(identify_if6_ll9);
2517 count_if6_ll10=tofDataMap.count(identify_if6_ll10);
2518 count_if6_ll11=tofDataMap.count(identify_if6_ll11);
2519 count_if6_ll12=tofDataMap.count(identify_if6_ll12);
2520 count_if6_rr1=tofDataMap.count(identify_if6_rr1);
2521 count_if6_rr2=tofDataMap.count(identify_if6_rr2);
2522 count_if6_rr3=tofDataMap.count(identify_if6_rr3);
2523 count_if6_rr4=tofDataMap.count(identify_if6_rr4);
2524 count_if6_rr5=tofDataMap.count(identify_if6_rr5);
2525 count_if6_rr6=tofDataMap.count(identify_if6_rr6);
2526 count_if6_rr7=tofDataMap.count(identify_if6_rr7);
2527 count_if6_rr8=tofDataMap.count(identify_if6_rr8);
2528 count_if6_rr9=tofDataMap.count(identify_if6_rr9);
2529 count_if6_rr10=tofDataMap.count(identify_if6_rr10);
2530 count_if6_rr11=tofDataMap.count(identify_if6_rr11);
2531 count_if6_rr12=tofDataMap.count(identify_if6_rr12);
2570 int tofid_it = m_id1;
2572 count_it = tofDataMap.count( identify_it );
2656 if( (neighborhood==1) || (neighborhood==2) || (neighborhood==3) || (neighborhood==4) )
2659 count_l = tofDataMap.count(identify_l );
2661 count_r = tofDataMap.count(identify_r);
2663 count_u = tofDataMap.count(identify_u);
2665 count_b = tofDataMap.count(identify_b);
2667 count_lu = tofDataMap.count(identify_lu);
2669 count_lb = tofDataMap.count(identify_lb);
2671 count_ru = tofDataMap.count(identify_ru);
2673 count_rb = tofDataMap.count(identify_rb);
2676 if((neighborhood==2) || (neighborhood==3)|| (neighborhood==4))
2679 count_luu = tofDataMap.count(identify_luu );
2681 count_ruu = tofDataMap.count(identify_ruu);
2683 count_uu = tofDataMap.count(identify_uu);
2685 count_bb = tofDataMap.count(identify_bb);
2687 count_lbb = tofDataMap.count(identify_lbb);
2689 count_rbb = tofDataMap.count(identify_rbb);
2693 if((neighborhood==3)|| (neighborhood==4))
2696 count_luuu = tofDataMap.count(identify_luuu );
2698 count_ruuu = tofDataMap.count(identify_ruuu);
2700 count_uuu = tofDataMap.count(identify_uuu);
2702 count_bbb = tofDataMap.count(identify_bbb);
2704 count_lbbb = tofDataMap.count(identify_lbbb);
2706 count_rbbb = tofDataMap.count(identify_rbbb);
2711 if((neighborhood==4))
2714 count_luuul = tofDataMap.count(identify_luuul );
2716 count_ruuur = tofDataMap.count(identify_ruuur);
2718 count_lbbbl = tofDataMap.count(identify_lbbbl);
2720 count_rbbbr = tofDataMap.count(identify_rbbbr);
2723 count_luul = tofDataMap.count(identify_luul );
2725 count_ruur = tofDataMap.count(identify_ruur);
2727 count_lbbl = tofDataMap.count(identify_lbbl);
2729 count_rbbr = tofDataMap.count(identify_rbbr);
2732 count_ll = tofDataMap.count(identify_ll );
2734 count_rr = tofDataMap.count(identify_rr);
2736 count_lul = tofDataMap.count(identify_lul);
2738 count_lbl = tofDataMap.count(identify_lbl);
2740 count_rur = tofDataMap.count(identify_rur);
2742 count_rbr = tofDataMap.count(identify_rbr);
2749 if((neighborhood==5))
2754 if((strip_number_if5)%2==0)
2770 count_if5_m1=tofDataMap.count(identify_if5_m1);
2771 count_if5_m2=tofDataMap.count(identify_if5_m2);
2772 count_if5_m3=tofDataMap.count(identify_if5_m3);
2773 count_if5_m4=tofDataMap.count(identify_if5_m4);
2774 count_if5_m5=tofDataMap.count(identify_if5_m5);
2775 count_if5_m6=tofDataMap.count(identify_if5_m6);
2776 count_if5_m7=tofDataMap.count(identify_if5_m7);
2777 count_if5_m8=tofDataMap.count(identify_if5_m8);
2778 count_if5_m9=tofDataMap.count(identify_if5_m9);
2779 count_if5_m10=tofDataMap.count(identify_if5_m10);
2780 count_if5_m11=tofDataMap.count(identify_if5_m11);
2781 count_if5_m12=tofDataMap.count(identify_if5_m12);
2824 count_if5_l1=tofDataMap.count(identify_if5_l1);
2825 count_if5_l2=tofDataMap.count(identify_if5_l2);
2826 count_if5_l3=tofDataMap.count(identify_if5_l3);
2827 count_if5_l4=tofDataMap.count(identify_if5_l4);
2828 count_if5_l5=tofDataMap.count(identify_if5_l5);
2829 count_if5_l6=tofDataMap.count(identify_if5_l6);
2830 count_if5_l7=tofDataMap.count(identify_if5_l7);
2831 count_if5_l8=tofDataMap.count(identify_if5_l8);
2832 count_if5_l9=tofDataMap.count(identify_if5_l9);
2833 count_if5_l10=tofDataMap.count(identify_if5_l10);
2834 count_if5_l11=tofDataMap.count(identify_if5_l11);
2835 count_if5_l12=tofDataMap.count(identify_if5_l12);
2836 count_if5_r1=tofDataMap.count(identify_if5_r1);
2837 count_if5_r2=tofDataMap.count(identify_if5_r2);
2838 count_if5_r3=tofDataMap.count(identify_if5_r3);
2839 count_if5_r4=tofDataMap.count(identify_if5_r4);
2840 count_if5_r5=tofDataMap.count(identify_if5_r5);
2841 count_if5_r6=tofDataMap.count(identify_if5_r6);
2842 count_if5_r7=tofDataMap.count(identify_if5_r7);
2843 count_if5_r8=tofDataMap.count(identify_if5_r8);
2844 count_if5_r9=tofDataMap.count(identify_if5_r9);
2845 count_if5_r10=tofDataMap.count(identify_if5_r10);
2846 count_if5_r11=tofDataMap.count(identify_if5_r11);
2847 count_if5_r12=tofDataMap.count(identify_if5_r12);
2865 count_if5_m1=tofDataMap.count(identify_if5_m1);
2866 count_if5_m2=tofDataMap.count(identify_if5_m2);
2867 count_if5_m3=tofDataMap.count(identify_if5_m3);
2868 count_if5_m4=tofDataMap.count(identify_if5_m4);
2869 count_if5_m5=tofDataMap.count(identify_if5_m5);
2870 count_if5_m6=tofDataMap.count(identify_if5_m6);
2871 count_if5_m7=tofDataMap.count(identify_if5_m7);
2872 count_if5_m8=tofDataMap.count(identify_if5_m8);
2873 count_if5_m9=tofDataMap.count(identify_if5_m9);
2874 count_if5_m10=tofDataMap.count(identify_if5_m10);
2875 count_if5_m11=tofDataMap.count(identify_if5_m11);
2876 count_if5_m12=tofDataMap.count(identify_if5_m12);
2919 count_if5_l1=tofDataMap.count(identify_if5_l1);
2920 count_if5_l2=tofDataMap.count(identify_if5_l2);
2921 count_if5_l3=tofDataMap.count(identify_if5_l3);
2922 count_if5_l4=tofDataMap.count(identify_if5_l4);
2923 count_if5_l5=tofDataMap.count(identify_if5_l5);
2924 count_if5_l6=tofDataMap.count(identify_if5_l6);
2925 count_if5_l7=tofDataMap.count(identify_if5_l7);
2926 count_if5_l8=tofDataMap.count(identify_if5_l8);
2927 count_if5_l9=tofDataMap.count(identify_if5_l9);
2928 count_if5_l10=tofDataMap.count(identify_if5_l10);
2929 count_if5_l11=tofDataMap.count(identify_if5_l11);
2930 count_if5_l12=tofDataMap.count(identify_if5_l12);
2931 count_if5_r1=tofDataMap.count(identify_if5_r1);
2932 count_if5_r2=tofDataMap.count(identify_if5_r2);
2933 count_if5_r3=tofDataMap.count(identify_if5_r3);
2934 count_if5_r4=tofDataMap.count(identify_if5_r4);
2935 count_if5_r5=tofDataMap.count(identify_if5_r5);
2936 count_if5_r6=tofDataMap.count(identify_if5_r6);
2937 count_if5_r7=tofDataMap.count(identify_if5_r7);
2938 count_if5_r8=tofDataMap.count(identify_if5_r8);
2939 count_if5_r9=tofDataMap.count(identify_if5_r9);
2940 count_if5_r10=tofDataMap.count(identify_if5_r10);
2941 count_if5_r11=tofDataMap.count(identify_if5_r11);
2942 count_if5_r12=tofDataMap.count(identify_if5_r12);
2950 if((neighborhood==6))
2956 if((strip_number_if6)%2==0)
2974 count_if6_m1=tofDataMap.count(identify_if6_m1);
2975 count_if6_m2=tofDataMap.count(identify_if6_m2);
2976 count_if6_m3=tofDataMap.count(identify_if6_m3);
2977 count_if6_m4=tofDataMap.count(identify_if6_m4);
2978 count_if6_m5=tofDataMap.count(identify_if6_m5);
2979 count_if6_m6=tofDataMap.count(identify_if6_m6);
2980 count_if6_m7=tofDataMap.count(identify_if6_m7);
2981 count_if6_m8=tofDataMap.count(identify_if6_m8);
2982 count_if6_m9=tofDataMap.count(identify_if6_m9);
2983 count_if6_m10=tofDataMap.count(identify_if6_m10);
2984 count_if6_m11=tofDataMap.count(identify_if6_m11);
2985 count_if6_m12=tofDataMap.count(identify_if6_m12);
3027 count_if6_l1=tofDataMap.count(identify_if6_l1);
3028 count_if6_l2=tofDataMap.count(identify_if6_l2);
3029 count_if6_l3=tofDataMap.count(identify_if6_l3);
3030 count_if6_l4=tofDataMap.count(identify_if6_l4);
3031 count_if6_l5=tofDataMap.count(identify_if6_l5);
3032 count_if6_l6=tofDataMap.count(identify_if6_l6);
3033 count_if6_l7=tofDataMap.count(identify_if6_l7);
3034 count_if6_l8=tofDataMap.count(identify_if6_l8);
3035 count_if6_l9=tofDataMap.count(identify_if6_l9);
3036 count_if6_l10=tofDataMap.count(identify_if6_l10);
3037 count_if6_l11=tofDataMap.count(identify_if6_l11);
3038 count_if6_l12=tofDataMap.count(identify_if6_l12);
3039 count_if6_r1=tofDataMap.count(identify_if6_r1);
3040 count_if6_r2=tofDataMap.count(identify_if6_r2);
3041 count_if6_r3=tofDataMap.count(identify_if6_r3);
3042 count_if6_r4=tofDataMap.count(identify_if6_r4);
3043 count_if6_r5=tofDataMap.count(identify_if6_r5);
3044 count_if6_r6=tofDataMap.count(identify_if6_r6);
3045 count_if6_r7=tofDataMap.count(identify_if6_r7);
3046 count_if6_r8=tofDataMap.count(identify_if6_r8);
3047 count_if6_r9=tofDataMap.count(identify_if6_r9);
3048 count_if6_r10=tofDataMap.count(identify_if6_r10);
3049 count_if6_r11=tofDataMap.count(identify_if6_r11);
3050 count_if6_r12=tofDataMap.count(identify_if6_r12);
3116 count_if6_ll1=tofDataMap.count(identify_if6_ll1);
3117 count_if6_ll2=tofDataMap.count(identify_if6_ll2);
3118 count_if6_ll3=tofDataMap.count(identify_if6_ll3);
3119 count_if6_ll4=tofDataMap.count(identify_if6_ll4);
3120 count_if6_ll5=tofDataMap.count(identify_if6_ll5);
3121 count_if6_ll6=tofDataMap.count(identify_if6_ll6);
3122 count_if6_ll7=tofDataMap.count(identify_if6_ll7);
3123 count_if6_ll8=tofDataMap.count(identify_if6_ll8);
3124 count_if6_ll9=tofDataMap.count(identify_if6_ll9);
3125 count_if6_ll10=tofDataMap.count(identify_if6_ll10);
3126 count_if6_ll11=tofDataMap.count(identify_if6_ll11);
3127 count_if6_ll12=tofDataMap.count(identify_if6_ll12);
3128 count_if6_rr1=tofDataMap.count(identify_if6_rr1);
3129 count_if6_rr2=tofDataMap.count(identify_if6_rr2);
3130 count_if6_rr3=tofDataMap.count(identify_if6_rr3);
3131 count_if6_rr4=tofDataMap.count(identify_if6_rr4);
3132 count_if6_rr5=tofDataMap.count(identify_if6_rr5);
3133 count_if6_rr6=tofDataMap.count(identify_if6_rr6);
3134 count_if6_rr7=tofDataMap.count(identify_if6_rr7);
3135 count_if6_rr8=tofDataMap.count(identify_if6_rr8);
3136 count_if6_rr9=tofDataMap.count(identify_if6_rr9);
3137 count_if6_rr10=tofDataMap.count(identify_if6_rr10);
3138 count_if6_rr11=tofDataMap.count(identify_if6_rr11);
3139 count_if6_rr12=tofDataMap.count(identify_if6_rr12);
3160 count_if6_m1=tofDataMap.count(identify_if6_m1);
3161 count_if6_m2=tofDataMap.count(identify_if6_m2);
3162 count_if6_m3=tofDataMap.count(identify_if6_m3);
3163 count_if6_m4=tofDataMap.count(identify_if6_m4);
3164 count_if6_m5=tofDataMap.count(identify_if6_m5);
3165 count_if6_m6=tofDataMap.count(identify_if6_m6);
3166 count_if6_m7=tofDataMap.count(identify_if6_m7);
3167 count_if6_m8=tofDataMap.count(identify_if6_m8);
3168 count_if6_m9=tofDataMap.count(identify_if6_m9);
3169 count_if6_m10=tofDataMap.count(identify_if6_m10);
3170 count_if6_m11=tofDataMap.count(identify_if6_m11);
3171 count_if6_m12=tofDataMap.count(identify_if6_m12);
3214 count_if6_l1=tofDataMap.count(identify_if6_l1);
3215 count_if6_l2=tofDataMap.count(identify_if6_l2);
3216 count_if6_l3=tofDataMap.count(identify_if6_l3);
3217 count_if6_l4=tofDataMap.count(identify_if6_l4);
3218 count_if6_l5=tofDataMap.count(identify_if6_l5);
3219 count_if6_l6=tofDataMap.count(identify_if6_l6);
3220 count_if6_l7=tofDataMap.count(identify_if6_l7);
3221 count_if6_l8=tofDataMap.count(identify_if6_l8);
3222 count_if6_l9=tofDataMap.count(identify_if6_l9);
3223 count_if6_l10=tofDataMap.count(identify_if6_l10);
3224 count_if6_l11=tofDataMap.count(identify_if6_l11);
3225 count_if6_l12=tofDataMap.count(identify_if6_l12);
3226 count_if6_r1=tofDataMap.count(identify_if6_r1);
3227 count_if6_r2=tofDataMap.count(identify_if6_r2);
3228 count_if6_r3=tofDataMap.count(identify_if6_r3);
3229 count_if6_r4=tofDataMap.count(identify_if6_r4);
3230 count_if6_r5=tofDataMap.count(identify_if6_r5);
3231 count_if6_r6=tofDataMap.count(identify_if6_r6);
3232 count_if6_r7=tofDataMap.count(identify_if6_r7);
3233 count_if6_r8=tofDataMap.count(identify_if6_r8);
3234 count_if6_r9=tofDataMap.count(identify_if6_r9);
3235 count_if6_r10=tofDataMap.count(identify_if6_r10);
3236 count_if6_r11=tofDataMap.count(identify_if6_r11);
3237 count_if6_r12=tofDataMap.count(identify_if6_r12);
3304 count_if6_ll1=tofDataMap.count(identify_if6_ll1);
3305 count_if6_ll2=tofDataMap.count(identify_if6_ll2);
3306 count_if6_ll3=tofDataMap.count(identify_if6_ll3);
3307 count_if6_ll4=tofDataMap.count(identify_if6_ll4);
3308 count_if6_ll5=tofDataMap.count(identify_if6_ll5);
3309 count_if6_ll6=tofDataMap.count(identify_if6_ll6);
3310 count_if6_ll7=tofDataMap.count(identify_if6_ll7);
3311 count_if6_ll8=tofDataMap.count(identify_if6_ll8);
3312 count_if6_ll9=tofDataMap.count(identify_if6_ll9);
3313 count_if6_ll10=tofDataMap.count(identify_if6_ll10);
3314 count_if6_ll11=tofDataMap.count(identify_if6_ll11);
3315 count_if6_ll12=tofDataMap.count(identify_if6_ll12);
3316 count_if6_rr1=tofDataMap.count(identify_if6_rr1);
3317 count_if6_rr2=tofDataMap.count(identify_if6_rr2);
3318 count_if6_rr3=tofDataMap.count(identify_if6_rr3);
3319 count_if6_rr4=tofDataMap.count(identify_if6_rr4);
3320 count_if6_rr5=tofDataMap.count(identify_if6_rr5);
3321 count_if6_rr6=tofDataMap.count(identify_if6_rr6);
3322 count_if6_rr7=tofDataMap.count(identify_if6_rr7);
3323 count_if6_rr8=tofDataMap.count(identify_if6_rr8);
3324 count_if6_rr9=tofDataMap.count(identify_if6_rr9);
3325 count_if6_rr10=tofDataMap.count(identify_if6_rr10);
3326 count_if6_rr11=tofDataMap.count(identify_if6_rr11);
3327 count_if6_rr12=tofDataMap.count(identify_if6_rr12);
3366 int tofid_it = m_id1;
3368 count_it = tofDataMap.count( identify_it );
3452 if( (neighborhood==1) || (neighborhood==2) || (neighborhood==3) || (neighborhood==4) )
3455 count_l = tofDataMap.count(identify_l );
3457 count_r = tofDataMap.count(identify_r);
3459 count_u = tofDataMap.count(identify_u);
3461 count_b = tofDataMap.count(identify_b);
3463 count_lu = tofDataMap.count(identify_lu);
3465 count_lb = tofDataMap.count(identify_lb);
3467 count_ru = tofDataMap.count(identify_ru);
3469 count_rb = tofDataMap.count(identify_rb);
3472 if((neighborhood==2) || (neighborhood==3)|| (neighborhood==4))
3475 count_luu = tofDataMap.count(identify_luu );
3477 count_ruu = tofDataMap.count(identify_ruu);
3479 count_uu = tofDataMap.count(identify_uu);
3481 count_bb = tofDataMap.count(identify_bb);
3483 count_lbb = tofDataMap.count(identify_lbb);
3485 count_rbb = tofDataMap.count(identify_rbb);
3490 if((neighborhood==3)|| (neighborhood==4))
3493 count_luuu = tofDataMap.count(identify_luuu );
3495 count_ruuu = tofDataMap.count(identify_ruuu);
3497 count_uuu = tofDataMap.count(identify_uuu);
3499 count_bbb = tofDataMap.count(identify_bbb);
3501 count_lbbb = tofDataMap.count(identify_lbbb);
3503 count_rbbb = tofDataMap.count(identify_rbbb);
3508 if((neighborhood==4))
3511 count_luuul = tofDataMap.count(identify_luuul );
3513 count_ruuur = tofDataMap.count(identify_ruuur);
3515 count_lbbbl = tofDataMap.count(identify_lbbbl);
3517 count_rbbbr = tofDataMap.count(identify_rbbbr);
3520 count_luul = tofDataMap.count(identify_luul );
3522 count_ruur = tofDataMap.count(identify_ruur);
3524 count_lbbl = tofDataMap.count(identify_lbbl);
3526 count_rbbr = tofDataMap.count(identify_rbbr);
3529 count_ll = tofDataMap.count(identify_ll );
3531 count_rr = tofDataMap.count(identify_rr);
3533 count_lul = tofDataMap.count(identify_lul);
3535 count_lbl = tofDataMap.count(identify_lbl);
3537 count_rur = tofDataMap.count(identify_rur);
3539 count_rbr = tofDataMap.count(identify_rbr);
3546 if((neighborhood==5))
3551 if((strip_number_if5)%2==0)
3566 count_if5_m1=tofDataMap.count(identify_if5_m1);
3567 count_if5_m2=tofDataMap.count(identify_if5_m2);
3568 count_if5_m3=tofDataMap.count(identify_if5_m3);
3569 count_if5_m4=tofDataMap.count(identify_if5_m4);
3570 count_if5_m5=tofDataMap.count(identify_if5_m5);
3571 count_if5_m6=tofDataMap.count(identify_if5_m6);
3572 count_if5_m7=tofDataMap.count(identify_if5_m7);
3573 count_if5_m8=tofDataMap.count(identify_if5_m8);
3574 count_if5_m9=tofDataMap.count(identify_if5_m9);
3575 count_if5_m10=tofDataMap.count(identify_if5_m10);
3576 count_if5_m11=tofDataMap.count(identify_if5_m11);
3577 count_if5_m12=tofDataMap.count(identify_if5_m12);
3620 count_if5_l1=tofDataMap.count(identify_if5_l1);
3621 count_if5_l2=tofDataMap.count(identify_if5_l2);
3622 count_if5_l3=tofDataMap.count(identify_if5_l3);
3623 count_if5_l4=tofDataMap.count(identify_if5_l4);
3624 count_if5_l5=tofDataMap.count(identify_if5_l5);
3625 count_if5_l6=tofDataMap.count(identify_if5_l6);
3626 count_if5_l7=tofDataMap.count(identify_if5_l7);
3627 count_if5_l8=tofDataMap.count(identify_if5_l8);
3628 count_if5_l9=tofDataMap.count(identify_if5_l9);
3629 count_if5_l10=tofDataMap.count(identify_if5_l10);
3630 count_if5_l11=tofDataMap.count(identify_if5_l11);
3631 count_if5_l12=tofDataMap.count(identify_if5_l12);
3632 count_if5_r1=tofDataMap.count(identify_if5_r1);
3633 count_if5_r2=tofDataMap.count(identify_if5_r2);
3634 count_if5_r3=tofDataMap.count(identify_if5_r3);
3635 count_if5_r4=tofDataMap.count(identify_if5_r4);
3636 count_if5_r5=tofDataMap.count(identify_if5_r5);
3637 count_if5_r6=tofDataMap.count(identify_if5_r6);
3638 count_if5_r7=tofDataMap.count(identify_if5_r7);
3639 count_if5_r8=tofDataMap.count(identify_if5_r8);
3640 count_if5_r9=tofDataMap.count(identify_if5_r9);
3641 count_if5_r10=tofDataMap.count(identify_if5_r10);
3642 count_if5_r11=tofDataMap.count(identify_if5_r11);
3643 count_if5_r12=tofDataMap.count(identify_if5_r12);
3662 count_if5_m1=tofDataMap.count(identify_if5_m1);
3663 count_if5_m2=tofDataMap.count(identify_if5_m2);
3664 count_if5_m3=tofDataMap.count(identify_if5_m3);
3665 count_if5_m4=tofDataMap.count(identify_if5_m4);
3666 count_if5_m5=tofDataMap.count(identify_if5_m5);
3667 count_if5_m6=tofDataMap.count(identify_if5_m6);
3668 count_if5_m7=tofDataMap.count(identify_if5_m7);
3669 count_if5_m8=tofDataMap.count(identify_if5_m8);
3670 count_if5_m9=tofDataMap.count(identify_if5_m9);
3671 count_if5_m10=tofDataMap.count(identify_if5_m10);
3672 count_if5_m11=tofDataMap.count(identify_if5_m11);
3673 count_if5_m12=tofDataMap.count(identify_if5_m12);
3716 count_if5_l1=tofDataMap.count(identify_if5_l1);
3717 count_if5_l2=tofDataMap.count(identify_if5_l2);
3718 count_if5_l3=tofDataMap.count(identify_if5_l3);
3719 count_if5_l4=tofDataMap.count(identify_if5_l4);
3720 count_if5_l5=tofDataMap.count(identify_if5_l5);
3721 count_if5_l6=tofDataMap.count(identify_if5_l6);
3722 count_if5_l7=tofDataMap.count(identify_if5_l7);
3723 count_if5_l8=tofDataMap.count(identify_if5_l8);
3724 count_if5_l9=tofDataMap.count(identify_if5_l9);
3725 count_if5_l10=tofDataMap.count(identify_if5_l10);
3726 count_if5_l11=tofDataMap.count(identify_if5_l11);
3727 count_if5_l12=tofDataMap.count(identify_if5_l12);
3728 count_if5_r1=tofDataMap.count(identify_if5_r1);
3729 count_if5_r2=tofDataMap.count(identify_if5_r2);
3730 count_if5_r3=tofDataMap.count(identify_if5_r3);
3731 count_if5_r4=tofDataMap.count(identify_if5_r4);
3732 count_if5_r5=tofDataMap.count(identify_if5_r5);
3733 count_if5_r6=tofDataMap.count(identify_if5_r6);
3734 count_if5_r7=tofDataMap.count(identify_if5_r7);
3735 count_if5_r8=tofDataMap.count(identify_if5_r8);
3736 count_if5_r9=tofDataMap.count(identify_if5_r9);
3737 count_if5_r10=tofDataMap.count(identify_if5_r10);
3738 count_if5_r11=tofDataMap.count(identify_if5_r11);
3739 count_if5_r12=tofDataMap.count(identify_if5_r12);
3750 if((neighborhood==6))
3756 if((strip_number_if6)%2==0)
3774 count_if6_m1=tofDataMap.count(identify_if6_m1);
3775 count_if6_m2=tofDataMap.count(identify_if6_m2);
3776 count_if6_m3=tofDataMap.count(identify_if6_m3);
3777 count_if6_m4=tofDataMap.count(identify_if6_m4);
3778 count_if6_m5=tofDataMap.count(identify_if6_m5);
3779 count_if6_m6=tofDataMap.count(identify_if6_m6);
3780 count_if6_m7=tofDataMap.count(identify_if6_m7);
3781 count_if6_m8=tofDataMap.count(identify_if6_m8);
3782 count_if6_m9=tofDataMap.count(identify_if6_m9);
3783 count_if6_m10=tofDataMap.count(identify_if6_m10);
3784 count_if6_m11=tofDataMap.count(identify_if6_m11);
3785 count_if6_m12=tofDataMap.count(identify_if6_m12);
3827 count_if6_l1=tofDataMap.count(identify_if6_l1);
3828 count_if6_l2=tofDataMap.count(identify_if6_l2);
3829 count_if6_l3=tofDataMap.count(identify_if6_l3);
3830 count_if6_l4=tofDataMap.count(identify_if6_l4);
3831 count_if6_l5=tofDataMap.count(identify_if6_l5);
3832 count_if6_l6=tofDataMap.count(identify_if6_l6);
3833 count_if6_l7=tofDataMap.count(identify_if6_l7);
3834 count_if6_l8=tofDataMap.count(identify_if6_l8);
3835 count_if6_l9=tofDataMap.count(identify_if6_l9);
3836 count_if6_l10=tofDataMap.count(identify_if6_l10);
3837 count_if6_l11=tofDataMap.count(identify_if6_l11);
3838 count_if6_l12=tofDataMap.count(identify_if6_l12);
3839 count_if6_r1=tofDataMap.count(identify_if6_r1);
3840 count_if6_r2=tofDataMap.count(identify_if6_r2);
3841 count_if6_r3=tofDataMap.count(identify_if6_r3);
3842 count_if6_r4=tofDataMap.count(identify_if6_r4);
3843 count_if6_r5=tofDataMap.count(identify_if6_r5);
3844 count_if6_r6=tofDataMap.count(identify_if6_r6);
3845 count_if6_r7=tofDataMap.count(identify_if6_r7);
3846 count_if6_r8=tofDataMap.count(identify_if6_r8);
3847 count_if6_r9=tofDataMap.count(identify_if6_r9);
3848 count_if6_r10=tofDataMap.count(identify_if6_r10);
3849 count_if6_r11=tofDataMap.count(identify_if6_r11);
3850 count_if6_r12=tofDataMap.count(identify_if6_r12);
3914 count_if6_ll1=tofDataMap.count(identify_if6_ll1);
3915 count_if6_ll2=tofDataMap.count(identify_if6_ll2);
3916 count_if6_ll3=tofDataMap.count(identify_if6_ll3);
3917 count_if6_ll4=tofDataMap.count(identify_if6_ll4);
3918 count_if6_ll5=tofDataMap.count(identify_if6_ll5);
3919 count_if6_ll6=tofDataMap.count(identify_if6_ll6);
3920 count_if6_ll7=tofDataMap.count(identify_if6_ll7);
3921 count_if6_ll8=tofDataMap.count(identify_if6_ll8);
3922 count_if6_ll9=tofDataMap.count(identify_if6_ll9);
3923 count_if6_ll10=tofDataMap.count(identify_if6_ll10);
3924 count_if6_ll11=tofDataMap.count(identify_if6_ll11);
3925 count_if6_ll12=tofDataMap.count(identify_if6_ll12);
3926 count_if6_rr1=tofDataMap.count(identify_if6_rr1);
3927 count_if6_rr2=tofDataMap.count(identify_if6_rr2);
3928 count_if6_rr3=tofDataMap.count(identify_if6_rr3);
3929 count_if6_rr4=tofDataMap.count(identify_if6_rr4);
3930 count_if6_rr5=tofDataMap.count(identify_if6_rr5);
3931 count_if6_rr6=tofDataMap.count(identify_if6_rr6);
3932 count_if6_rr7=tofDataMap.count(identify_if6_rr7);
3933 count_if6_rr8=tofDataMap.count(identify_if6_rr8);
3934 count_if6_rr9=tofDataMap.count(identify_if6_rr9);
3935 count_if6_rr10=tofDataMap.count(identify_if6_rr10);
3936 count_if6_rr11=tofDataMap.count(identify_if6_rr11);
3937 count_if6_rr12=tofDataMap.count(identify_if6_rr12);
3958 count_if6_m1=tofDataMap.count(identify_if6_m1);
3959 count_if6_m2=tofDataMap.count(identify_if6_m2);
3960 count_if6_m3=tofDataMap.count(identify_if6_m3);
3961 count_if6_m4=tofDataMap.count(identify_if6_m4);
3962 count_if6_m5=tofDataMap.count(identify_if6_m5);
3963 count_if6_m6=tofDataMap.count(identify_if6_m6);
3964 count_if6_m7=tofDataMap.count(identify_if6_m7);
3965 count_if6_m8=tofDataMap.count(identify_if6_m8);
3966 count_if6_m9=tofDataMap.count(identify_if6_m9);
3967 count_if6_m10=tofDataMap.count(identify_if6_m10);
3968 count_if6_m11=tofDataMap.count(identify_if6_m11);
3969 count_if6_m12=tofDataMap.count(identify_if6_m12);
4012 count_if6_l1=tofDataMap.count(identify_if6_l1);
4013 count_if6_l2=tofDataMap.count(identify_if6_l2);
4014 count_if6_l3=tofDataMap.count(identify_if6_l3);
4015 count_if6_l4=tofDataMap.count(identify_if6_l4);
4016 count_if6_l5=tofDataMap.count(identify_if6_l5);
4017 count_if6_l6=tofDataMap.count(identify_if6_l6);
4018 count_if6_l7=tofDataMap.count(identify_if6_l7);
4019 count_if6_l8=tofDataMap.count(identify_if6_l8);
4020 count_if6_l9=tofDataMap.count(identify_if6_l9);
4021 count_if6_l10=tofDataMap.count(identify_if6_l10);
4022 count_if6_l11=tofDataMap.count(identify_if6_l11);
4023 count_if6_l12=tofDataMap.count(identify_if6_l12);
4024 count_if6_r1=tofDataMap.count(identify_if6_r1);
4025 count_if6_r2=tofDataMap.count(identify_if6_r2);
4026 count_if6_r3=tofDataMap.count(identify_if6_r3);
4027 count_if6_r4=tofDataMap.count(identify_if6_r4);
4028 count_if6_r5=tofDataMap.count(identify_if6_r5);
4029 count_if6_r6=tofDataMap.count(identify_if6_r6);
4030 count_if6_r7=tofDataMap.count(identify_if6_r7);
4031 count_if6_r8=tofDataMap.count(identify_if6_r8);
4032 count_if6_r9=tofDataMap.count(identify_if6_r9);
4033 count_if6_r10=tofDataMap.count(identify_if6_r10);
4034 count_if6_r11=tofDataMap.count(identify_if6_r11);
4035 count_if6_r12=tofDataMap.count(identify_if6_r12);
4102 count_if6_ll1=tofDataMap.count(identify_if6_ll1);
4103 count_if6_ll2=tofDataMap.count(identify_if6_ll2);
4104 count_if6_ll3=tofDataMap.count(identify_if6_ll3);
4105 count_if6_ll4=tofDataMap.count(identify_if6_ll4);
4106 count_if6_ll5=tofDataMap.count(identify_if6_ll5);
4107 count_if6_ll6=tofDataMap.count(identify_if6_ll6);
4108 count_if6_ll7=tofDataMap.count(identify_if6_ll7);
4109 count_if6_ll8=tofDataMap.count(identify_if6_ll8);
4110 count_if6_ll9=tofDataMap.count(identify_if6_ll9);
4111 count_if6_ll10=tofDataMap.count(identify_if6_ll10);
4112 count_if6_ll11=tofDataMap.count(identify_if6_ll11);
4113 count_if6_ll12=tofDataMap.count(identify_if6_ll12);
4114 count_if6_rr1=tofDataMap.count(identify_if6_rr1);
4115 count_if6_rr2=tofDataMap.count(identify_if6_rr2);
4116 count_if6_rr3=tofDataMap.count(identify_if6_rr3);
4117 count_if6_rr4=tofDataMap.count(identify_if6_rr4);
4118 count_if6_rr5=tofDataMap.count(identify_if6_rr5);
4119 count_if6_rr6=tofDataMap.count(identify_if6_rr6);
4120 count_if6_rr7=tofDataMap.count(identify_if6_rr7);
4121 count_if6_rr8=tofDataMap.count(identify_if6_rr8);
4122 count_if6_rr9=tofDataMap.count(identify_if6_rr9);
4123 count_if6_rr10=tofDataMap.count(identify_if6_rr10);
4124 count_if6_rr11=tofDataMap.count(identify_if6_rr11);
4125 count_if6_rr12=tofDataMap.count(identify_if6_rr12);
4167 int data_map_size = tofDataMap.size();
4168 std::cout <<
"MrpcTrack setTofData Number of elements in TofDataMap " << data_map_size << std::endl;
4172 for ( it=tofDataMap.begin() ; it != tofDataMap.end(); it++ )
4173 std::cout <<
"MrpcTrack setTofData TofDataMap entries id | stripnumber "<< (*it).first <<
" | " << (*it).second->tofId() << std::endl;
4182 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_it );
4185 for(
unsigned int i = 0; i < count_it; i++,
iter++ ) {
4194 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_u );
4196 for(
unsigned int i = 0; i < count_u; i++,
iter++ ) {
4204 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_b );
4206 for(
unsigned int i = 0; i < count_b; i++,
iter++ ) {
4215 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_l );
4217 for(
unsigned int i = 0; i < count_l; i++,
iter++ ) {
4226 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_r );
4228 for(
unsigned int i = 0; i < count_r; i++,
iter++ ) {
4236 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_lu );
4238 for(
unsigned int i = 0; i < count_lu; i++,
iter++ ) {
4247 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_ru );
4249 for(
unsigned int i = 0; i < count_ru; i++,
iter++ ) {
4258 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_lb );
4260 for(
unsigned int i = 0; i < count_lb; i++,
iter++ ) {
4269 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_rb );
4271 for(
unsigned int i = 0; i < count_rb; i++,
iter++ ) {
4280 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_bb );
4282 for(
unsigned int i = 0; i < count_bb; i++,
iter++ ) {
4289 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_uu );
4291 for(
unsigned int i = 0; i < count_uu; i++,
iter++ ) {
4300 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_lbb );
4302 for(
unsigned int i = 0; i < count_lbb; i++,
iter++ ) {
4309 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_luu );
4311 for(
unsigned int i = 0; i < count_luu; i++,
iter++ ) {
4318 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_rbb );
4320 for(
unsigned int i = 0; i < count_rbb; i++,
iter++ ) {
4328 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_ruu );
4330 for(
unsigned int i = 0; i < count_ruu; i++,
iter++ ) {
4337 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_uuu );
4339 for(
unsigned int i = 0; i < count_uuu; i++,
iter++ ) {
4346 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_bbb );
4348 for(
unsigned int i = 0; i < count_bbb; i++,
iter++ ) {
4355 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_ruuu );
4357 for(
unsigned int i = 0; i < count_ruuu; i++,
iter++ ) {
4364 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_rbbb );
4366 for(
unsigned int i = 0; i < count_rbbb; i++,
iter++ ) {
4373 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_luuu );
4375 for(
unsigned int i = 0; i < count_luuu; i++,
iter++ ) {
4382 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_lbbb );
4384 for(
unsigned int i = 0; i < count_lbbb; i++,
iter++ ) {
4393 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_lbbbl );
4395 for(
unsigned int i = 0; i < count_lbbbl; i++,
iter++ ) {
4402 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_lbbl );
4404 for(
unsigned int i = 0; i < count_lbbl; i++,
iter++ ) {
4411 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_lbl );
4413 for(
unsigned int i = 0; i < count_lbl; i++,
iter++ ) {
4420 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_ll );
4422 for(
unsigned int i = 0; i < count_ll; i++,
iter++ ) {
4429 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_luuul );
4431 for(
unsigned int i = 0; i < count_luuul; i++,
iter++ ) {
4438 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_luul );
4440 for(
unsigned int i = 0; i < count_luul; i++,
iter++ ) {
4447 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_lul );
4449 for(
unsigned int i = 0; i < count_lul; i++,
iter++ ) {
4457 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_rbbbr );
4459 for(
unsigned int i = 0; i < count_rbbbr; i++,
iter++ ) {
4466 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_rbbr );
4468 for(
unsigned int i = 0; i < count_rbbr; i++,
iter++ ) {
4475 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_rbr );
4477 for(
unsigned int i = 0; i < count_rbr; i++,
iter++ ) {
4484 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_rr );
4486 for(
unsigned int i = 0; i < count_rr; i++,
iter++ ) {
4493 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_ruuur );
4495 for(
unsigned int i = 0; i < count_ruuur; i++,
iter++ ) {
4502 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_ruur );
4504 for(
unsigned int i = 0; i < count_ruur; i++,
iter++ ) {
4511 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_rur );
4513 for(
unsigned int i = 0; i < count_rur; i++,
iter++ ) {
4523 if(identify_if5_m1==identify_if5_it)
help=1;
4524 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if5_m1);
4526 for(
unsigned int i = 0; i < count_if5_m1; i++,
iter++ ) {
4533 if(identify_if5_m2==identify_if5_it)
help=1;
4534 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if5_m2);
4536 for(
unsigned int i = 0; i < count_if5_m2; i++,
iter++ ) {
4543 if(identify_if5_m3==identify_if5_it)
help=1;
4544 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if5_m3);
4546 for(
unsigned int i = 0; i < count_if5_m3; i++,
iter++ ) {
4553 if(identify_if5_m4==identify_if5_it)
help=1;
4554 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if5_m4);
4556 for(
unsigned int i = 0; i < count_if5_m4; i++,
iter++ ) {
4563 if(identify_if5_m5==identify_if5_it)
help=1;
4564 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if5_m5);
4566 for(
unsigned int i = 0; i < count_if5_m5; i++,
iter++ ) {
4573 if(identify_if5_m6==identify_if5_it)
help=1;
4574 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if5_m6);
4576 for(
unsigned int i = 0; i < count_if5_m6; i++,
iter++ ) {
4583 if(identify_if5_m7==identify_if5_it)
help=1;
4584 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if5_m7);
4586 for(
unsigned int i = 0; i < count_if5_m7; i++,
iter++ ) {
4593 if(identify_if5_m8==identify_if5_it)
help=1;
4594 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if5_m8);
4596 for(
unsigned int i = 0; i < count_if5_m8; i++,
iter++ ) {
4603 if(identify_if5_m9==identify_if5_it)
help=1;
4604 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if5_m9);
4606 for(
unsigned int i = 0; i < count_if5_m9; i++,
iter++ ) {
4613 if(identify_if5_m10==identify_if5_it)
help=1;
4614 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if5_m10);
4616 for(
unsigned int i = 0; i < count_if5_m10; i++,
iter++ ) {
4623 if(identify_if5_m11==identify_if5_it)
help=1;
4624 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if5_m11);
4626 for(
unsigned int i = 0; i < count_if5_m11; i++,
iter++ ) {
4633 if(identify_if5_m12==identify_if5_it)
help=1;
4634 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if5_m12);
4636 for(
unsigned int i = 0; i < count_if5_m12; i++,
iter++ ) {
4642 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if5_l1);
4644 for(
unsigned int i = 0; i < count_if5_l1; i++,
iter++ ) {
4650 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if5_l2);
4652 for(
unsigned int i = 0; i < count_if5_l2; i++,
iter++ ) {
4658 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if5_l3);
4660 for(
unsigned int i = 0; i < count_if5_l3; i++,
iter++ ) {
4666 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if5_l4);
4668 for(
unsigned int i = 0; i < count_if5_l4; i++,
iter++ ) {
4674 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if5_l5);
4676 for(
unsigned int i = 0; i < count_if5_l5; i++,
iter++ ) {
4682 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if5_l6);
4684 for(
unsigned int i = 0; i < count_if5_l6; i++,
iter++ ) {
4690 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if5_l7);
4692 for(
unsigned int i = 0; i < count_if5_l7; i++,
iter++ ) {
4698 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if5_l8);
4700 for(
unsigned int i = 0; i < count_if5_l8; i++,
iter++ ) {
4706 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if5_l9);
4708 for(
unsigned int i = 0; i < count_if5_l9; i++,
iter++ ) {
4714 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if5_l10);
4716 for(
unsigned int i = 0; i < count_if5_l10; i++,
iter++ ) {
4722 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if5_l11);
4724 for(
unsigned int i = 0; i < count_if5_l11; i++,
iter++ ) {
4730 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if5_l12);
4732 for(
unsigned int i = 0; i < count_if5_l12; i++,
iter++ ) {
4739 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if5_r1);
4741 for(
unsigned int i = 0; i < count_if5_r1; i++,
iter++ ) {
4747 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if5_r2);
4749 for(
unsigned int i = 0; i < count_if5_r2; i++,
iter++ ) {
4755 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if5_r3);
4757 for(
unsigned int i = 0; i < count_if5_r3; i++,
iter++ ) {
4763 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if5_r4);
4765 for(
unsigned int i = 0; i < count_if5_r4; i++,
iter++ ) {
4771 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if5_r5);
4773 for(
unsigned int i = 0; i < count_if5_r5; i++,
iter++ ) {
4779 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if5_r6);
4781 for(
unsigned int i = 0; i < count_if5_r6; i++,
iter++ ) {
4787 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if5_r7);
4789 for(
unsigned int i = 0; i < count_if5_r7; i++,
iter++ ) {
4795 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if5_r8);
4797 for(
unsigned int i = 0; i < count_if5_r8; i++,
iter++ ) {
4803 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if5_r9);
4805 for(
unsigned int i = 0; i < count_if5_r9; i++,
iter++ ) {
4811 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if5_r10);
4813 for(
unsigned int i = 0; i < count_if5_r10; i++,
iter++ ) {
4819 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if5_r11);
4821 for(
unsigned int i = 0; i < count_if5_r11; i++,
iter++ ) {
4827 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if5_r12);
4829 for(
unsigned int i = 0; i < count_if5_r12; i++,
iter++ ) {
4836 if(identify_if6_m1==identify_if6_it)
help=1;
4837 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_m1);
4839 for(
unsigned int i = 0; i < count_if6_m1; i++,
iter++ ) {
4846 if(identify_if6_m2==identify_if6_it)
help=1;
4847 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_m2);
4849 for(
unsigned int i = 0; i < count_if6_m2; i++,
iter++ ) {
4856 if(identify_if6_m3==identify_if6_it)
help=1;
4857 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_m3);
4859 for(
unsigned int i = 0; i < count_if6_m3; i++,
iter++ ) {
4866 if(identify_if6_m4==identify_if6_it)
help=1;
4867 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_m4);
4869 for(
unsigned int i = 0; i < count_if6_m4; i++,
iter++ ) {
4876 if(identify_if6_m5==identify_if6_it)
help=1;
4877 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_m5);
4879 for(
unsigned int i = 0; i < count_if6_m5; i++,
iter++ ) {
4886 if(identify_if6_m6==identify_if6_it)
help=1;
4887 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_m6);
4889 for(
unsigned int i = 0; i < count_if6_m6; i++,
iter++ ) {
4896 if(identify_if6_m7==identify_if6_it)
help=1;
4897 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_m7);
4899 for(
unsigned int i = 0; i < count_if6_m7; i++,
iter++ ) {
4906 if(identify_if6_m8==identify_if6_it)
help=1;
4907 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_m8);
4909 for(
unsigned int i = 0; i < count_if6_m8; i++,
iter++ ) {
4916 if(identify_if6_m9==identify_if6_it)
help=1;
4917 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_m9);
4919 for(
unsigned int i = 0; i < count_if6_m9; i++,
iter++ ) {
4926 if(identify_if6_m10==identify_if6_it)
help=1;
4927 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_m10);
4929 for(
unsigned int i = 0; i < count_if6_m10; i++,
iter++ ) {
4936 if(identify_if6_m11==identify_if6_it)
help=1;
4937 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_m11);
4939 for(
unsigned int i = 0; i < count_if6_m11; i++,
iter++ ) {
4946 if(identify_if6_m12==identify_if6_it)
help=1;
4947 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_m12);
4949 for(
unsigned int i = 0; i < count_if6_m12; i++,
iter++ ) {
4955 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_l1);
4957 for(
unsigned int i = 0; i < count_if6_l1; i++,
iter++ ) {
4963 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_l2);
4965 for(
unsigned int i = 0; i < count_if6_l2; i++,
iter++ ) {
4971 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_l3);
4973 for(
unsigned int i = 0; i < count_if6_l3; i++,
iter++ ) {
4979 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_l4);
4981 for(
unsigned int i = 0; i < count_if6_l4; i++,
iter++ ) {
4987 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_l5);
4989 for(
unsigned int i = 0; i < count_if6_l5; i++,
iter++ ) {
4995 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_l6);
4997 for(
unsigned int i = 0; i < count_if6_l6; i++,
iter++ ) {
5003 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_l7);
5005 for(
unsigned int i = 0; i < count_if6_l7; i++,
iter++ ) {
5011 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_l8);
5013 for(
unsigned int i = 0; i < count_if6_l8; i++,
iter++ ) {
5019 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_l9);
5021 for(
unsigned int i = 0; i < count_if6_l9; i++,
iter++ ) {
5027 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_l10);
5029 for(
unsigned int i = 0; i < count_if6_l10; i++,
iter++ ) {
5035 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_l11);
5037 for(
unsigned int i = 0; i < count_if6_l11; i++,
iter++ ) {
5043 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_l12);
5045 for(
unsigned int i = 0; i < count_if6_l12; i++,
iter++ ) {
5052 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_r1);
5054 for(
unsigned int i = 0; i < count_if6_r1; i++,
iter++ ) {
5060 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_r2);
5062 for(
unsigned int i = 0; i < count_if6_r2; i++,
iter++ ) {
5068 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_r3);
5070 for(
unsigned int i = 0; i < count_if6_r3; i++,
iter++ ) {
5076 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_r4);
5078 for(
unsigned int i = 0; i < count_if6_r4; i++,
iter++ ) {
5084 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_r5);
5086 for(
unsigned int i = 0; i < count_if6_r5; i++,
iter++ ) {
5092 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_r6);
5094 for(
unsigned int i = 0; i < count_if6_r6; i++,
iter++ ) {
5100 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_r7);
5102 for(
unsigned int i = 0; i < count_if6_r7; i++,
iter++ ) {
5108 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_r8);
5110 for(
unsigned int i = 0; i < count_if6_r8; i++,
iter++ ) {
5116 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_r9);
5118 for(
unsigned int i = 0; i < count_if6_r9; i++,
iter++ ) {
5124 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_r10);
5126 for(
unsigned int i = 0; i < count_if6_r10; i++,
iter++ ) {
5132 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_r11);
5134 for(
unsigned int i = 0; i < count_if6_r11; i++,
iter++ ) {
5140 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_r12);
5142 for(
unsigned int i = 0; i < count_if6_r12; i++,
iter++ ) {
5148 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_ll1);
5150 for(
unsigned int i = 0; i < count_if6_ll1; i++,
iter++ ) {
5156 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_ll2);
5158 for(
unsigned int i = 0; i < count_if6_ll2; i++,
iter++ ) {
5164 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_ll3);
5166 for(
unsigned int i = 0; i < count_if6_ll3; i++,
iter++ ) {
5172 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_ll4);
5174 for(
unsigned int i = 0; i < count_if6_ll4; i++,
iter++ ) {
5180 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_ll5);
5182 for(
unsigned int i = 0; i < count_if6_ll5; i++,
iter++ ) {
5188 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_ll6);
5190 for(
unsigned int i = 0; i < count_if6_ll6; i++,
iter++ ) {
5196 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_ll7);
5198 for(
unsigned int i = 0; i < count_if6_ll7; i++,
iter++ ) {
5204 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_ll8);
5206 for(
unsigned int i = 0; i < count_if6_ll8; i++,
iter++ ) {
5212 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_ll9);
5214 for(
unsigned int i = 0; i < count_if6_ll9; i++,
iter++ ) {
5218 if(count_if6_ll10>0)
5220 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_ll10);
5222 for(
unsigned int i = 0; i < count_if6_ll10; i++,
iter++ ) {
5226 if(count_if6_ll11>0)
5228 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_ll11);
5230 for(
unsigned int i = 0; i < count_if6_ll11; i++,
iter++ ) {
5234 if(count_if6_ll12>0)
5236 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_ll12);
5238 for(
unsigned int i = 0; i < count_if6_ll12; i++,
iter++ ) {
5245 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_rr1);
5247 for(
unsigned int i = 0; i < count_if6_rr1; i++,
iter++ ) {
5253 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_rr2);
5255 for(
unsigned int i = 0; i < count_if6_rr2; i++,
iter++ ) {
5261 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_rr3);
5263 for(
unsigned int i = 0; i < count_if6_rr3; i++,
iter++ ) {
5269 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_rr4);
5271 for(
unsigned int i = 0; i < count_if6_rr4; i++,
iter++ ) {
5277 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_rr5);
5279 for(
unsigned int i = 0; i < count_if6_rr5; i++,
iter++ ) {
5285 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_rr6);
5287 for(
unsigned int i = 0; i < count_if6_rr6; i++,
iter++ ) {
5293 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_rr7);
5295 for(
unsigned int i = 0; i < count_if6_rr7; i++,
iter++ ) {
5301 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_rr8);
5303 for(
unsigned int i = 0; i < count_if6_rr8; i++,
iter++ ) {
5309 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_rr9);
5311 for(
unsigned int i = 0; i < count_if6_rr9; i++,
iter++ ) {
5315 if(count_if6_rr10>0)
5317 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_rr10);
5319 for(
unsigned int i = 0; i < count_if6_rr10; i++,
iter++ ) {
5323 if(count_if6_rr11>0)
5325 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_rr11);
5327 for(
unsigned int i = 0; i < count_if6_rr11; i++,
iter++ ) {
5331 if(count_if6_rr12>0)
5333 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify_if6_rr12);
5335 for(
unsigned int i = 0; i < count_if6_rr12; i++,
iter++ ) {
5350 count0 = tofDataMap.count( identify0 );
5351 int tofid1 = tofid0 - 1;
5352 if( tofid1 == -1 ) { tofid1 = 87; }
5354 count1 = tofDataMap.count( identify1 );
5355 int tofid2 = tofid0 + 1;
5356 if( tofid2 == 88 ) { tofid2 = 0; }
5358 count2 = tofDataMap.count( identify2 );
5362 if( ( m_hitCase ==
EastEndcap ) && ( m_id1 > -1 ) ) {
5365 count0 = tofDataMap.count( identify0 );
5366 int tofid1 = tofid0 - 1;
5367 if( tofid1 == -1 ) { tofid1 = 47; }
5369 count1 = tofDataMap.count( identify1 );
5370 int tofid2 = tofid0 + 1;
5371 if( tofid2 == 48 ) { tofid2 = 0; }
5373 count2 = tofDataMap.count( identify2 );
5378 if( ( m_hitCase ==
WestEndcap ) && ( m_id1 > -1 ) ) {
5379 int tofid0 = m_id1 - 48;
5381 count0 = tofDataMap.count( identify0 );
5382 int tofid1 = tofid0 - 1;
5383 if( tofid1 == -1 ) { tofid1 = 47; }
5385 count1 = tofDataMap.count( identify1 );
5386 int tofid2 = tofid0 + 1;
5387 if( tofid2 == 48 ) { tofid2 = 0; }
5389 count2 = tofDataMap.count( identify2 );
5395 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify0 );
5397 for(
unsigned int i = 0; i < count0; i++,
iter++ ) {
5402 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify1 );
5404 for(
unsigned int i = 0; i < count1; i++,
iter++ ) {
5409 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify2 );
5411 for(
unsigned int i = 0; i < count2; i++,
iter++ ) {
5416 if( ( count0 == 0 ) && ( count1 == 0 ) && ( count2 == 0 )
5417 && (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)
5418 && (count_uu==0) && (count_bb==0) && (count_ruu==0) && (count_luu==0) && (count_rbb==0) && (count_lbb==0)
5420 && (count_luuu==0) && (count_lbbb==0) && (count_ruuu==0) && (count_rbbb==0) && (count_uuu==0) && (count_bbb==0)
5422 && (count_luuul==0) && (count_lbbbl==0) && (count_ruuur==0) && (count_rbbbr==0) && (count_luul==0) && (count_lbbl==0) && (count_ruur==0) && (count_rbbr==0)
5423 && (count_lul==0) && (count_lbl==0) && (count_rur==0) && (count_rbr==0) && (count_ll==0) && (count_rr==0)
5425 && (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)
5426 && (count_if5_m10 ==0) && (count_if5_m11 ==0) && (count_if5_m12 ==0)
5427 && (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)
5428 && (count_if5_l10 ==0) && (count_if5_l11 ==0) && (count_if5_l12 ==0)
5429 && (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)
5430 && (count_if5_r10 ==0) && (count_if5_r11 ==0) && (count_if5_r12 ==0)
5432 && (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)
5433 && (count_if6_m10 ==0) && (count_if6_m11 ==0) && (count_if6_m12 ==0)
5434 && (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)
5435 && (count_if6_l10 ==0) && (count_if6_l11 ==0) && (count_if6_l12 ==0)
5436 && (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)
5437 && (count_if6_r10 ==0) && (count_if6_r11 ==0) && (count_if6_r12 ==0)
5438 && (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)
5439 && (count_if6_ll9 ==0) && (count_if6_ll10 ==0) && (count_if6_ll11 ==0) && (count_if6_ll12 ==0)
5440 && (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)
5441 && (count_if6_rr9 ==0) && (count_if6_rr10 ==0) && (count_if6_rr11 ==0) && (count_if6_rr12 ==0)
5456 int tofid0 = m_id2 - 88;
5458 count0 = tofDataMap.count( identify0 );
5459 int tofid1 = tofid0 - 1;
5460 if( tofid1 == -1 ) { tofid1 = 87; }
5462 count1 = tofDataMap.count( identify1 );
5463 int tofid2 = tofid0 + 1;
5464 if( tofid2 == 88 ) { tofid2 = 0; }
5466 count2 = tofDataMap.count( identify2 );
5469 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify0 );
5471 for(
unsigned int i = 0; i < count0; i++,
iter++ ) {
5476 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify1 );
5478 for(
unsigned int i = 0; i < count1; i++,
iter++ ) {
5483 pair< IterTofDataMap, IterTofDataMap > range = tofDataMap.equal_range( identify2 );
5485 for(
unsigned int i = 0; i < count2; i++,
iter++ ) {
5490 if( ( count0 == 0 ) && ( count1 == 0 ) && ( count2 == 0 ) ) {
5510 unsigned int qual =
tof->quality();
5512 if( ( qual & 0x10 ) == 0 ) {
5515 qual = ( qual | 0x10 );
5517 if(
tof->barrel() ) {
5518 if( (
tof->quality() == 0x7 ) || (
tof->quality() == 0xd ) ) {
5519 qual = ( qual | 0x20 );
5522 if( (
tof->quality() == 0xb ) || (
tof->quality() == 0xe ) ) {
5523 qual = ( qual | 0x40 );
5526 if( (
tof->quality() == 0x3 ) || (
tof->quality() == 0xc ) ) {
5527 qual = ( qual | 0x80 );
5530 if( (
tof->quality() & 0x5 ) == 0x5 ) {
5532 tof->setZTdc( ztdc );
5543 if( (
tof->quality() & 0xa ) == 0xa ) {
5545 tof->setZAdc( zadc );
5557 tof->setQuality( qual );
5560 if( iflag == 1 ) m_tofData1.push_back(
tof );
5561 else if( iflag == 2 ) m_tofData2.push_back(
tof );
5562 else if( iflag == 3 ) m_tofData3.push_back(
tof );
5563 else if( iflag == 4 ) m_tofData4.push_back(
tof );
5565 cout <<
"MrpcRec::MrpcTrack::TofDataAnalylsis: the Flag should be 1-4, out of the Range!" << endl;
5575void MrpcTrack::match(
bool forCalibration, std::vector<int> deadId, std::vector<MrpcTrack*>*& tofTrackVec ) {
5577 if( m_hitCase ==
NoHit )
return;
5581 if( ( m_quality1 & 0x10 ) == 0 ) { m_hitCase =
NoHit; }
5585 if( ( m_quality2 & 0x10 ) == 0 ) { m_hitCase =
NoHit; }
5589 if( ( m_quality1 & 0x10 ) == 0 ) { m_hitCase =
OuterLayer; }
5591 if( ( m_quality2 & 0x10 ) == 0 ) {
5599 cout <<
"MrpcRec::MrpcTrack::match: 2- Impossible!" << endl;
5612 cout <<
"MrpcRec::MrpcTrack::match: 1- Impossible!" << endl;
5615 if( forCalibration ) {
5618 if( ( ( m_quality1 & 0xf ) == 0xf ) && ( ( m_quality2 & 0xf ) == 0xf ) ) {
5619 m_quality1 = ( m_quality1 | 0x800 );
5620 m_quality2 = ( m_quality2 | 0x800 );
5623 std::vector<int>::iterator
iter = deadId.begin();
5624 for( ;
iter != deadId.end();
iter++ ) {
5632 if( m_tofId1 == tofId ) {
5633 if( ( m_quality2 & 0xf ) == 0xf ) {
5634 if( ( ( east == 0 ) && ( ( m_quality1 & 0xf ) == 0x3 ) ) || ( ( east == 1 ) && ( ( m_quality1 & 0xf ) == 0xc ) ) ) {
5635 m_quality1 = ( m_quality1 | 0x800 );
5636 m_quality2 = ( m_quality2 | 0x800 );
5642 else if( layer == 1 ) {
5643 if( m_tofId2 == (tofId+88) ) {
5644 if( ( m_quality1 & 0xf ) == 0xf ) {
5645 if( ( ( east == 0 ) && ( ( m_quality2 & 0xf ) == 0x3 ) ) || ( ( east == 1 ) && ( ( m_quality2 & 0xf ) == 0xc ) ) ) {
5646 m_quality1 = ( m_quality1 | 0x800 );
5647 m_quality2 = ( m_quality2 | 0x800 );
5658 if( ( m_quality1 & 0xf ) == 0xf ) {
5659 m_quality1 = ( m_quality1 | 0x800 );
5662 std::vector<int>::iterator
iter = deadId.begin();
5663 for( ;
iter != deadId.end();
iter++ ) {
5671 if( m_tofId1 == tofId ) {
5672 if( ( ( east == 0 ) && ( ( m_quality1 & 0xf ) == 0x3 ) ) || ( ( east == 1 ) && ( ( m_quality1 & 0xf ) == 0xc ) ) ) {
5673 m_quality1 = ( m_quality1 | 0x800 );
5683 if( ( ( m_hitCase ==
EastEndcap ) || ( m_hitCase ==
WestEndcap ) ) && ( ( m_quality1 & 0xf ) == 0xc ) ) {
5684 m_quality1 = ( m_quality1 | 0x800 );
5696void MrpcTrack::findTofDataBarrel( std::vector<TofData*> tofDataVec1, std::vector<TofData*> tofDataVec2,
double zrhit,
unsigned int iflag, std::vector<MrpcTrack*>*& tofTrackVec ) {
5698 unsigned int qual = 0xf;
5700 if( tofDataVec2.size() == 0 ) {
5701 if( tofDataVec1.size() == 0 ) {
5704 else if( tofDataVec1.size() == 1 ) {
5705 std::vector<TofData*>::iterator iter1 = tofDataVec1.begin();
5709 else if( tofDataVec1.size() > 1 ) {
5714 cout <<
"MrpcRec::MrpcTrack::findTofDataBarrel: 1- Impossible!" << endl;
5717 else if( ( tofDataVec2.size() == 1 ) ) {
5718 if( tofDataVec1.size() == 0 ) {
5719 std::vector<TofData*>::iterator iter2 = tofDataVec2.begin();
5723 else if( tofDataVec1.size() == 1 ) {
5724 std::vector<TofData*>::iterator iter1 = tofDataVec1.begin();
5725 if( ((*iter1)->quality()&0x1ff)==0x01f &&
abs((*iter1)->ztdc()-zrhit)<
ztdc_Cut ) {
5729 std::vector<TofData*>::iterator iter2 = tofDataVec2.begin();
5734 else if( tofDataVec1.size() > 1 ) {
5740 std::vector<TofData*>::iterator iter2 = tofDataVec2.begin();
5746 cout <<
"MrpcRec::MrpcTrack::findTofDataBarrel: 2- Impossible!" << endl;
5749 else if( ( tofDataVec2.size() > 1 ) ) {
5750 if( tofDataVec1.size() == 0 ) {
5754 else if( tofDataVec1.size() == 1 ) {
5755 std::vector<TofData*>::iterator iter1 = tofDataVec1.begin();
5756 if( ((*iter1)->quality()&0x1ff)==0x01f &&
abs((*iter1)->ztdc()-zrhit)<
ztdc_Cut ) {
5765 else if( tofDataVec1.size() > 1 ) {
5777 cout <<
"MrpcRec::MrpcTrack::findTofDataBarrel: 3- Impossible!" << endl;
5782 if( !(
tof->used()) ) {
5786 bool z1=
false, z2=
false;
5787 bool zc1=
false, zc2=
false;
5791 zc1 = ( m_zrhit1 >
tof->ztdc() );
5792 std::vector<MrpcTrack*>::iterator
iter = tofTrackVec->begin();
5793 for( ;
iter!=tofTrackVec->end();
iter++ ) {
5794 if(
tof->tofId()==(*iter)->tofId1() ) {
5797 zc2 = ( (*iter)->zrhit1() >
tof->ztdc() );
5801 else if( iflag==2 ) {
5803 zc1 = ( m_zrhit2 >
tof->ztdc() );
5804 std::vector<MrpcTrack*>::iterator
iter = tofTrackVec->begin();
5805 for( ;
iter!=tofTrackVec->end();
iter++ ) {
5806 if(
tof->tofId()==(*iter)->tofId2() ) {
5809 zc2 = ( (*iter)->zrhit2() >
tof->ztdc() );
5814 if( ( z1 && z2 )||( (!z1) && (!z2) ) ) {
5819 else if( !zc1 && zc2 ) {
5824 else if( z1 && !z2 ) {
5827 cout << iflag <<
" " << track->
quality1() <<
" " << track->
quality2() << endl;
5829 else if( !z1 && z2 ) {
5836 if( ( iflag == 1 ) || ( iflag == 3 ) ) {
5837 m_quality1 = ( m_quality1 | 0x300 );
5839 else if( iflag == 2 ) {
5840 m_quality2 = ( m_quality2 | 0x300 );
5843 cout <<
"MrpcRec::MrpcTrack::findTofDataBarrel: the 1- IFLAG is Out of Range!" << endl;
5847 qual = ( qual << 12 );
5848 if( ( iflag == 1 ) || ( iflag == 3 ) ) {
5849 m_quality1 = ( m_quality1 | qual );
5851 else if( iflag == 2 ) {
5852 m_quality2 = ( m_quality2 | qual );
5855 cout <<
"MrpcRec::MrpcTrack::findTofDataBarrel: the 2- IFLAG is Out of Range!" << endl;
5867 unsigned int qual = 0xf;
5868 if( tofDataVec2.size() == 0 ) {
5869 if( tofDataVec1.size() == 0 ) {
5872 else if( tofDataVec1.size() == 1 ) {
5873 std::vector<TofData*>::iterator iter1 = tofDataVec1.begin();
5876 mrpc_extrapolation_good=
true;
5878 else if( tofDataVec1.size() > 1 ) {
5881 mrpc_extrapolation_good=
true;
5884 cout <<
"MrpcRec::MrpcTrack::findTofData: 1- Impossible!" << endl;
5887 else if( ( tofDataVec2.size() == 1 ) ) {
5888 if( tofDataVec1.size() == 0 ) {
5889 std::vector<TofData*>::iterator iter2 = tofDataVec2.begin();
5893 else if( tofDataVec1.size() == 1 ) {
5894 std::vector<TofData*>::iterator iter1 = tofDataVec1.begin();
5895 std::vector<TofData*>::iterator iter2 = tofDataVec2.begin();
5899 else if( tofDataVec1.size() > 1 ) {
5901 std::vector<TofData*>::iterator iter2 = tofDataVec2.begin();
5906 cout <<
"MrpcRec::MrpcTrack::findTofData: 2- Impossible!" << endl;
5909 else if( ( tofDataVec2.size() > 1 ) ) {
5910 if( tofDataVec1.size() == 0 ) {
5914 else if( tofDataVec1.size() == 1 ) {
5915 std::vector<TofData*>::iterator iter1 = tofDataVec1.begin();
5920 else if( tofDataVec1.size() > 1 ) {
5927 cout <<
"MrpcRec::MrpcTrack::findTofData: 3- Impossible!" << endl;
5936 cout <<
"MrpcRec::MrpcTrack::findTofData: the 1- IFLAG is Out of Range!" << endl;
5940 qual = ( qual << 12 );
5941 if( ( iflag == 3 ) ) {
5942 m_quality1 = ( m_quality1 | qual );
5945 cout <<
"MrpcRec::MrpcTrack::findTofData: the 2- IFLAG is Out of Range!" << endl;
5956 if( tofDataVec.size() == 0 ) {
5957 cout <<
"MrpcRec::MrpcTrack::ChooseTofDataMRPC: Size of TofData Vector is Zero!" << endl;
5960 std::vector<TofData*>::iterator igood = tofDataVec.begin();
5961 if( tofDataVec.size() > 1 ) {
5962 std::vector<TofData*>::iterator
iter = tofDataVec.begin();
5965 for( ;
iter != tofDataVec.end();
iter++ )
5967 if( (*iter)->adc() > maxQ ) {
5968 maxQ = (*iter)->adc();
5986 mrpc_extrapolation_good=
true;
5989 mrpc_extrapolation_good=
false;
6002 if( tofDataVec.size() == 0 ) {
6003 cout <<
"MrpcRec::MrpcTrack::ChooseTofData: Size of TofData Vector is Zero!" << endl;
6006 std::vector<TofData*>::iterator igood = tofDataVec.begin();
6007 if( tofDataVec.size() > 1 ) {
6009 double deltaZ = 1000.0;
6010 std::vector<TofData*>::iterator
iter = tofDataVec.begin();
6012 for( ;
iter != tofDataVec.end();
iter++ ) {
6013 if( ( (*iter)->quality() & 0x5 ) == 0x5 ) {
6014 if(
abs( (*iter)->ztdc() - zrhit ) < deltaZ ) {
6015 deltaZ =
abs( (*iter)->ztdc() - zrhit );
6021 if( deltaZ > 999.0 ) {
6022 iter = tofDataVec.begin();
6023 for( ;
iter != tofDataVec.end();
iter++ ) {
6024 if( ( (*iter)->quality() & 0xa ) == 0xa ) {
6025 if(
abs( (*iter)->zadc() - zrhit ) < deltaZ ) {
6026 deltaZ =
abs( (*iter)->zadc() - zrhit );
6034 if( deltaZ > 999.0 ) {
6035 unsigned int ibad = 0xf0;
6036 iter = tofDataVec.begin();
6037 for( ;
iter != tofDataVec.end();
iter++ ) {
6038 if( ( (*iter)->quality() & 0xf0 ) < ibad ) {
6040 ibad = ( (*iter)->quality() & 0xf0 );
6042 else if( ( (*iter)->quality() & 0xf0 ) == ibad ) {
6043 if( ( (*iter)->adc1() + (*iter)->adc2() ) > ( (*igood)->adc1() + (*igood)->adc2() ) ) {
6045 ibad = ( (*iter)->quality() & 0xf0 );
6085 unsigned int iflag = 3;
6086 unsigned int qual = 0xf;
6088 if( tofDataVec2.size() == 0 ) {
6089 if( tofDataVec1.size() == 0 ) {
6092 else if( tofDataVec1.size() == 1 ) {
6093 std::vector<TofData*>::iterator iter1 = tofDataVec1.begin();
6097 else if( tofDataVec1.size() > 1 ) {
6102 cout <<
"MrpcRec::MrpcTrack::findTofDataEndcap: 1- Impossible!" << endl;
6105 else if( ( tofDataVec2.size() == 1 ) ) {
6106 if( tofDataVec1.size() == 0 ) {
6107 std::vector<TofData*>::iterator iter2 = tofDataVec2.begin();
6111 else if( tofDataVec1.size() == 1 ) {
6112 std::vector<TofData*>::iterator iter1 = tofDataVec1.begin();
6113 std::vector<TofData*>::iterator iter2 = tofDataVec2.begin();
6117 else if( tofDataVec1.size() > 1 ) {
6119 std::vector<TofData*>::iterator iter2 = tofDataVec2.begin();
6124 cout <<
"MrpcRec::MrpcTrack::findTofDataBarrel: 2- Impossible!" << endl;
6127 else if( ( tofDataVec2.size() > 1 ) ) {
6128 if( tofDataVec1.size() == 0 ) {
6132 else if( tofDataVec1.size() == 1 ) {
6133 std::vector<TofData*>::iterator iter1 = tofDataVec1.begin();
6138 else if( tofDataVec1.size() > 1 ) {
6145 cout <<
"MrpcRec::MrpcTrack::findTofDataBarrel: 3- Impossible!" << endl;
6150 m_quality1 = ( m_quality1 | 0x300 );
6153 qual = ( qual << 12 );
6154 m_quality1 = ( m_quality1 | qual );
6165 if( tofDataVec.size() == 0 ) {
6166 cout <<
"MrpcRec::MrpcTrack::ChooseTofData: Size of TofData Vector is Zero!" << endl;
6169 std::vector<TofData*>::iterator igood = tofDataVec.begin();
6170 if( tofDataVec.size() > 1 ) {
6171 bool multihit =
false;
6172 std::vector<TofData*>::iterator
iter = tofDataVec.begin();
6173 for( ;
iter != tofDataVec.end();
iter++ ) {
6174 if( (*iter)->qtimes1()>1 ) { multihit =
true; }
6177 iter = tofDataVec.begin();
6179 double tcorr = -999.0;
6180 double deltaTMin = 999.0;
6181 for( ;
iter != tofDataVec.end();
iter++ ) {
6182 tcorr =
tofCaliSvc->
ETime( (*iter)->adc(), (*iter)->tdc()-m_estime, zr1[2], (*iter)->tofId() );
6183 for(
unsigned int i=0; i<5; i++ ) {
6184 if(
abs(tcorr-m_texpInner[i]) < deltaTMin ) {
6185 deltaTMin =
abs(tcorr-m_texpInner[i]);
6193 for( ;
iter != tofDataVec.end();
iter++ ) {
6194 if( (*iter)->adc() > maxQ ) {
6195 maxQ = (*iter)->adc();
6223 m_tofId1 =
tof->tofId();
6224 m_qch1 =
tof->adcChannelEast();
6225 m_adc1 =
tof->adc1();
6226 m_tdc1 =
tof->tdc1();
6227 m_qch2 =
tof->adcChannelWest();
6228 m_adc2 =
tof->adc2();
6229 m_tdc2 =
tof->tdc2();
6230 m_ztdc1 =
tof->ztdc();
6231 m_zadc1 =
tof->zadc();
6232 m_quality1 = ( m_quality1 | ( 0x1f &
tof->quality() ) );
6233 if( ( (
tof->quality() & 0x5 ) != 0x5 ) || ( ( (
tof->quality() & 0x5 ) == 0x5 ) && (
abs(
tof->ztdc() - m_zrhit1 ) >
ztdc_Cut ) ) ) {
6234 m_quality1 = ( m_quality1 | 0x100 );
6236 if( ( (
tof->quality() & 0xa ) != 0xa ) || ( ( (
tof->quality() & 0xa ) == 0xa ) && (
abs(
tof->zadc() - m_zrhit1 ) >
zadc_Cut ) ) ) {
6237 m_quality1 = ( m_quality1 | 0x200 );
6240 else if( iflag == 2 ) {
6241 m_tofId2 =
tof->tofId();
6242 m_qch3 =
tof->adcChannelEast();
6243 m_adc3 =
tof->adc1();
6244 m_tdc3 =
tof->tdc1();
6245 m_qch4 =
tof->adcChannelWest();
6246 m_adc4 =
tof->adc2();
6247 m_tdc4 =
tof->tdc2();
6248 m_ztdc2 =
tof->ztdc();
6249 m_zadc2 =
tof->zadc();
6250 m_quality2 = ( m_quality2 | ( 0x1f &
tof->quality() ) );
6251 if( ( (
tof->quality() & 0x5 ) != 0x5 ) || ( ( (
tof->quality() & 0x5 ) == 0x5 ) && (
abs(
tof->ztdc() - m_zrhit2 ) >
ztdc_Cut ) ) ) {
6252 m_quality2 = ( m_quality2 | 0x100 );
6254 if( ( (
tof->quality() & 0xa ) != 0xa ) || ( ( (
tof->quality() & 0xa ) == 0xa ) && (
abs(
tof->zadc() - m_zrhit2 ) >
zadc_Cut ) ) ) {
6255 m_quality2 = ( m_quality2 | 0x200 );
6258 else if( iflag == 3 ) {
6259 m_tofId1 =
tof->tofId();
6260 m_qch1 =
tof->adcChannel();
6261 m_adc1 =
tof->adc();
6262 m_tdc1 =
tof->tdc();
6263 m_quality1 = ( m_quality1 | ( 0x1f &
tof->quality() ) );
6264 m_quality1 = ( m_quality1 | 0x300 );
6267 cout <<
"MrpcRec::MrpcTrack::getTofData: Flag which sign the Barrel/Endcap or Inner/Outer is wrong! Please check it!" << endl;
6280 m_tofId1 =
tof->tofId();
6281 m_adc1 =
tof->adc();
6282 m_tdc1 =
tof->tdc();
6283 m_quality1 =
tof->quality();
6284 m_quality1 = ( m_quality1 | 0x300 );
6296 cout <<
"MrpcRec::MrpcTrack::setTofData: Flag which sign the Barrel/Endcap or Inner/Outer is wrong! Please check it!" << endl;
6310 m_tofId1 =
tof->tofId();
6311 m_qch1 =
tof->adcChannelEast();
6312 m_adc1 =
tof->adc1();
6313 m_tdc1 =
tof->tdc1();
6317 m_ztdc1 =
tof->ztdc();
6318 m_zadc1 =
tof->zadc();
6319 m_quality1 = ( ( m_quality1 & 0xfffffff0 ) | ( 0x1c &
tof->quality() ) );
6320 if( ( (
tof->quality() & 0x5 ) != 0x5 ) || ( ( (
tof->quality() & 0x5 ) == 0x5 ) && (
abs(
tof->ztdc() - m_zrhit1 ) >
ztdc_Cut ) ) ) {
6321 m_quality1 = ( m_quality1 | 0x100 );
6323 if( ( (
tof->quality() & 0xa ) != 0xa ) || ( ( (
tof->quality() & 0xa ) == 0xa ) && (
abs(
tof->zadc() - m_zrhit1 ) >
zadc_Cut ) ) ) {
6324 m_quality1 = ( m_quality1 | 0x200 );
6327 else if( iflag == 2 ) {
6328 m_tofId2 =
tof->tofId();
6329 m_qch3 =
tof->adcChannelEast();
6330 m_adc3 =
tof->adc1();
6331 m_tdc3 =
tof->tdc1();
6335 m_ztdc2 =
tof->ztdc();
6336 m_zadc2 =
tof->zadc();
6337 m_quality2 = ( ( m_quality2 & 0xfffffff0 ) | ( 0x1c &
tof->quality() ) );
6338 if( ( (
tof->quality() & 0x5 ) != 0x5 ) || ( ( (
tof->quality() & 0x5 ) == 0x5 ) && (
abs(
tof->ztdc() - m_zrhit2 ) >
ztdc_Cut ) ) ) {
6339 m_quality2 = ( m_quality2 | 0x100 );
6341 if( ( (
tof->quality() & 0xa ) != 0xa ) || ( ( (
tof->quality() & 0xa ) == 0xa ) && (
abs(
tof->zadc() - m_zrhit2 ) >
zadc_Cut ) ) ) {
6342 m_quality2 = ( m_quality2 | 0x200 );
6346 cout <<
"MrpcRec::MrpcTrack::getTofDataEast: Flag which sign the Barrel/Endcap or Inner/Outer is wrong! Please check it!" << endl;
6359 m_tofId1 =
tof->tofId();
6363 m_qch2 =
tof->adcChannelWest();
6364 m_adc2 =
tof->adc2();
6365 m_tdc2 =
tof->tdc2();
6366 m_ztdc1 =
tof->ztdc();
6367 m_zadc1 =
tof->zadc();
6368 m_quality1 = ( ( m_quality1 & 0xfffffff0 ) | ( 0x13 &
tof->quality() ) );
6369 if( ( (
tof->quality() & 0x5 ) != 0x5 ) || ( ( (
tof->quality() & 0x5 ) == 0x5 ) && (
abs(
tof->ztdc() - m_zrhit1 ) >
ztdc_Cut ) ) ) {
6370 m_quality1 = ( m_quality1 | 0x100 );
6372 if( ( (
tof->quality() & 0xa ) != 0xa ) || ( ( (
tof->quality() & 0xa ) == 0xa ) && (
abs(
tof->zadc() - m_zrhit1 ) >
zadc_Cut ) ) ) {
6373 m_quality1 = ( m_quality1 | 0x200 );
6376 else if( iflag == 2 ) {
6377 m_tofId2 =
tof->tofId();
6381 m_qch4 =
tof->adcChannelWest();
6382 m_adc4 =
tof->adc2();
6383 m_tdc4 =
tof->tdc2();
6384 m_ztdc2 =
tof->ztdc();
6385 m_zadc2 =
tof->zadc();
6386 m_quality2 = ( ( m_quality2 & 0xfffffff0 ) | ( 0x13 &
tof->quality() ) );
6387 if( ( (
tof->quality() & 0x5 ) != 0x5 ) || ( ( (
tof->quality() & 0x5 ) == 0x5 ) && (
abs(
tof->ztdc() - m_zrhit2 ) >
ztdc_Cut ) ) ) {
6388 m_quality2 = ( m_quality2 | 0x100 );
6390 if( ( (
tof->quality() & 0xa ) != 0xa ) || ( ( (
tof->quality() & 0xa ) == 0xa ) && (
abs(
tof->zadc() - m_zrhit2 ) >
zadc_Cut ) ) ) {
6391 m_quality2 = ( m_quality2 | 0x200 );
6395 cout <<
"MrpcRec::MrpcTrack::getTofDataWest: Flag which sign the Barrel/Endcap or Inner/Outer is wrong! Please check it!" << endl;
6417 m_quality1 = ( m_quality1 & 0x700 );
6421 else if( iflag == 2 ) {
6431 m_quality2 = ( m_quality2 & 0x700 );
6436 cout <<
"MrpcRec::MrpcTrack::getTofData: Flag which sign the Barrel/Endcap or Inner/Outer is wrong! Please check it!" << endl;
6454 bool innerEast = ( ( m_quality1 & 0xc ) == 0xc );
6455 bool innerWest = ( ( m_quality1 & 0x3 ) == 0x3 );
6456 bool outerEast = ( ( m_quality2 & 0xc ) == 0xc );
6457 bool outerWest = ( ( m_quality2 & 0x3 ) == 0x3 );
6458 bool innerLayer = ( ( m_quality1 & 0xf ) == 0xf );
6459 bool outerLayer = ( ( m_quality2 & 0xf ) == 0xf );
6461 bool endcapData = ( ( m_quality1 & 0xc ) == 0xc );
6462 bool newmrpcendcapData = ( ( m_quality1 & 0xc ) == 0xc );
6465 for(
unsigned int i=0; i<5; i++ ) {
6466 m_texp[i] =
tofCaliSvc->
BTimeCluster( m_texpInner[i], m_texpOuter[i], m_zr1[i], m_zr2[i], m_tofId1, m_tofId2 );
6473 for(
unsigned int i=0; i<5; i++ ) {
6474 m_tof11[i] =
tofCaliSvc->
BTime1( m_adc1, m_tdc1-m_estime, m_zr1[i], m_tofId1,m_estime );
6481 for(
unsigned int i=0; i<5; i++ ) {
6482 m_tof12[i] =
tofCaliSvc->
BTime2( m_adc2, m_tdc2-m_estime, m_zr1[i], m_tofId1,m_estime );
6489 for(
unsigned int i=0; i<5; i++ ) {
6505 for(
unsigned int i=0; i<5; i++ ) {
6506 m_tof21[i] =
tofCaliSvc->
BTime1( m_adc3, m_tdc3-m_estime, m_zr2[i], m_tofId2,m_estime );
6513 for(
unsigned int i=0; i<5; i++ ) {
6514 m_tof22[i] =
tofCaliSvc->
BTime2( m_adc4, m_tdc4-m_estime, m_zr2[i], m_tofId2,m_estime );
6521 for(
unsigned int i=0; i<5; i++ ) {
6536 if( innerLayer && outerLayer ) {
6537 for(
unsigned int i=0; i<5; i++ ) {
6547 for(
unsigned int i=0; i<5; i++ ) {
6548 m_tof11[i] =
tofCaliSvc->
ETime( m_adc1, m_tdc1-m_estime, m_zr1[i], m_tofId1 );
6553 if( (m_quality1&0xa000)!=0 ) { m_quality = 4; }
6556 if( newmrpcendcap ) {
6557 if( newmrpcendcapData ) {
6559 for(
unsigned int i=0; i<5; i++ ) {
6570 double strip_transition_time=0;
6572 if(mrpc_extrapolation_good && my_transtime!=0)
6574 strip_transition_time=my_transtime;
6581 m_tof11[i] = m_tdc1-m_estime-strip_transition_time;;
6591 if( (m_quality1&0xa000)!=0 ) { m_quality = 4; }
6602 if( innerLayer && outerLayer ) {
6607 if( innerLayer || outerLayer ) {
6612 if( innerEast || innerWest || outerEast || outerWest ) {
6619 if( ( (m_quality1&0xa000)!=0 ) || ( (m_quality2&0xa000)!=0 ) ) {
6620 m_quality = m_quality + 3;
6624 if( ( (m_quality1&0x100)==0x100 ) || ( (m_quality2&0x100)==0x100 ) ) {
6625 if( ( m_quality == 1 ) || ( m_quality == 4 ) ) { m_quality = 7; }
6626 else if( ( m_quality == 2 ) || ( m_quality == 5 ) ) { m_quality = 8; }
6627 else if( ( m_quality == 3 ) || ( m_quality == 6 ) ) { m_quality = 9; }
6629 cout <<
"MrpcRec::MrpcTrack::setCalibration: Impossible!" << endl;
6646 bool innerEast = ( ( m_quality1 & 0xc ) == 0xc );
6647 bool innerWest = ( ( m_quality1 & 0x3 ) == 0x3 );
6648 bool outerEast = ( ( m_quality2 & 0xc ) == 0xc );
6649 bool outerWest = ( ( m_quality2 & 0x3 ) == 0x3 );
6665 if( outerEast && outerWest ) {
6673 cout <<
"MrpcRec::MrpcTrack:convert2RecTofTrackCol: 11- Impossible!" << endl;
6678 recTofTrackCol->push_back( atrack11 );
6693 if( outerEast && outerWest ) {
6701 cout <<
"MrpcRec::MrpcTrack:convert2RecTofTrackCol: 12- Impossible!" << endl;
6706 recTofTrackCol->push_back( atrack12 );
6709 if( innerEast && innerWest ) {
6717 if( outerEast && outerWest ) {
6725 cout <<
"MrpcRec::TofTrack:convert2RecTofTrackCol: 1- Impossible!" << endl;
6729 recTofTrackCol->push_back( atrack1 );
6744 if( innerEast || innerWest ) {
6752 cout <<
"MrpcRec::MrpcTrack:convert2RecTofTrackCol: 21- Impossible!" << endl;
6757 recTofTrackCol->push_back( atrack21 );
6772 if( innerEast || innerWest ) {
6780 cout <<
"MrpcRec::MrpcTrack:convert2RecTofTrackCol: 22- Impossible!" << endl;
6785 recTofTrackCol->push_back( atrack22 );
6788 if( outerEast && outerWest ) {
6796 if( innerEast && innerWest ) {
6804 cout <<
"MrpcRec::MrpcTrack:convert2RecTofTrackCol: 2- Impossible!" << endl;
6808 recTofTrackCol->push_back( atrack2 );
6811 if( innerEast && innerWest && outerEast && outerWest ) {
6818 recTofTrackCol->push_back( atrack );
6838 cout <<
"MrpcRec::MrpcTrack:convert2RecTofTrackCol: endcap- Impossible!" << endl;
6844 recTofTrackCol->push_back( atrack );
6847 if( m_hitCase ==
NoHit ) {
6854 recTofTrackCol->push_back( atrack );
6874 for(
int i=0; i<6; i++ ) {
6879 track->
setT0( m_estime );
6887 if( ( layerorend == 11 ) || ( layerorend == 12 ) || ( layerorend == 1 ) ) {
6900 m_tofId1 = m_tofId1 + 100;
6906 m_tofId1 = m_tofId1 + 100 + 474;
6914 track->
setTexp( m_texpInner );
6925 if( ( layerorend==21 ) || ( layerorend==22 ) || ( layerorend==2 ) ) {
6930 track->
setTexp( m_texpOuter );
6935 if( layerorend==0 ) {
6946 if( layerorend == 3 ) {
6951 track->
setTexp( m_texpInner );
6963 for(
unsigned int i=0; i<6; i++ ) {
6967 if( layerorend == 0 ) {
6968 track->
setPh( m_ph );
6969 track->
setTof( m_tof[0] );
6971 for(
unsigned int i=0; i<5; i++ ) {
6972 toffset[i] = m_tof[0] - m_tof[i];
6975 track->
setBeta( m_path/m_tof[0]/30.0 );
6977 else if( layerorend == 1 ) {
6978 track->
setPh( m_ph1 );
6979 track->
setTof( m_tof1[0] );
6981 for(
unsigned int i=0; i<5; i++ ) {
6982 toffset[i] = m_tof1[0] - m_tof1[i];
6985 track->
setBeta( m_path1/m_tof1[0]/30.0 );
6987 else if( layerorend == 2 ) {
6988 track->
setPh( m_ph2 );
6989 track->
setTof( m_tof2[0] );
6991 for(
unsigned int i=0; i<5; i++ ) {
6992 toffset[i] = m_tof2[0] - m_tof2[i];
6995 track->
setBeta( m_path2/m_tof2[0]/30.0 );
6997 else if( layerorend == 11 ) {
6998 track->
setPh( m_ph11 );
6999 track->
setTof( m_tof11[0] );
7007 for(
unsigned int i=0; i<5; i++ ) {
7008 toffset[i] = m_tof11[0] - m_tof11[i];
7011 track->
setBeta( m_path1/m_tof11[0]/30.0 );
7015 else if( layerorend == 12 ) {
7016 track->
setPh( m_ph12 );
7017 track->
setTof( m_tof12[0] );
7019 for(
unsigned int i=0; i<5; i++ ) {
7020 toffset[i] = m_tof12[0] - m_tof12[i];
7023 track->
setBeta( m_path1/m_tof12[0]/30.0 );
7025 else if( layerorend == 21 ) {
7026 track->
setPh( m_ph21 );
7027 track->
setTof( m_tof21[0] );
7029 for(
unsigned int i=0; i<5; i++ ) {
7030 toffset[i] = m_tof21[0] - m_tof21[i];
7033 track->
setBeta( m_path2/m_tof21[0]/30.0 );
7035 else if( layerorend == 22 ) {
7036 track->
setPh( m_ph22 );
7037 track->
setTof( m_tof22[0] );
7039 for(
unsigned int i=0; i<5; i++ ) {
7040 toffset[i] = m_tof22[0] - m_tof22[i];
7043 track->
setBeta( m_path2/m_tof22[0]/30.0 );
7046 cout <<
"MrpcRec MrpcTrack::SetRecTofTrack layerorend = " << layerorend << endl;
7054 if( ( m_quality1 & 0x800 ) == 0x800 ) {
7057 ahit->
setRun( runNumber );
7059 ahit->
setMod( m_tofId1 );
7062 for(
int i=0; i<5; i++ ) {
7063 ahit->
setTpred( i, m_texpInner[i] );
7065 if( calibData ==
"Dimu" ) {
7076 ahit->
setTdc1( m_tdc1-m_estime );
7077 ahit->
setTdc2( m_tdc2-m_estime );
7084 ahit->
setP( m_momentum );
7085 ahit->
setQ( m_ph1 );
7088 btofCalHitCol->push_back( ahit );
7090 if( ( m_quality2 & 0x800 ) == 0x800 ) {
7093 bhit->
setRun( runNumber );
7095 bhit->
setMod( m_tofId2 );
7098 for(
int i=0; i<5; i++ ) {
7099 bhit->
setTpred( i, m_texpOuter[i] );
7101 if( calibData ==
"Dimu" ) {
7112 bhit->
setTdc1( m_tdc3-m_estime );
7113 bhit->
setTdc2( m_tdc4-m_estime );
7120 bhit->
setP( m_momentum );
7121 bhit->
setQ( m_ph2 );
7126 btofCalHitCol->push_back( bhit );
7137 if( ( m_quality1 & 0x800 ) != 0x800 )
return;
7140 chit->
setRun( runNumber );
7142 chit->
setMod( m_tofId1 );
7145 for(
int i=0; i<5; i++ ) {
7146 chit->
setTpred( i, m_texpInner[i] );
7148 if( calibData ==
"Dimu" ) {
7159 chit->
setTdc( m_tdc1-m_estime );
7165 chit->
setQ( m_ph1 );
7166 chit->
setP( m_momentum );
7169 etofCalHitCol->push_back( chit );
7189 int neighbourstrip=0;
7190 int neighbourmodule=0;
7194 if(strip==0)
return 0;
7201 neighbourstrip=strip-1;
7202 if(layer==3 || layer== 6)
7203 {neighbourmodule=module;}
7205 {neighbourmodule=module;}
7209 neighbourstrip=strip+1;
7211 if(layer==3 || layer== 5)
7213 neighbourmodule=module;
7217 neighbourmodule=module+1;
7218 if(neighbourmodule==19){neighbourmodule=1;}
7230 neighbourstrip=strip-1;
7232 if(layer==4 || layer== 6)
7233 {neighbourmodule=module;}
7235 {neighbourmodule=module-1;
7236 if(neighbourmodule==0){neighbourmodule=18;}
7241 neighbourstrip=strip+1;
7242 if(layer==3 || layer== 6)
7243 {neighbourmodule=module;}
7245 {neighbourmodule=module;}
7255 if(strip==23 || strip==24) {neighbourmodule=0; neighbourstrip=0;}
7258 neighbourstrip=strip+2;
7259 neighbourmodule=module;
7267 if(strip==1 || strip==2) {neighbourmodule=0; neighbourstrip=0;}
7270 neighbourstrip=strip-2;
7271 neighbourmodule=module;
7298 if(strip%2==0) returnvalue = layer;
7301 if(layer==3) returnvalue = 4;
7302 if(layer==4) returnvalue = 3;
7303 if(layer==5) returnvalue = 6;
7304 if(layer==6) returnvalue = 5;
7310 if(strip%2!=0) returnvalue = layer;
7313 if(layer==3) returnvalue = 4;
7314 if(layer==4) returnvalue = 3;
7315 if(layer==5) returnvalue = 6;
7316 if(layer==6) returnvalue = 5;
7320 if(which==
"u")returnvalue = layer;
7321 if(which==
"b")returnvalue = layer;
double sin(const BesAngle a)
double cos(const BesAngle a)
double abs(const EvtComplex &c)
ObjectVector< RecBTofCalHit > RecBTofCalHitCol
ObjectVector< RecETofCalHit > RecETofCalHitCol
ObjectVector< RecTofTrack > RecTofTrackCol
std::multimap< unsigned int, TofData * > TofDataMap
std::multimap< unsignedint, TofData * >::iterator IterTofDataMap
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 setQuality(int quality)
void setZrHit(double zrhit)
void setErrTof(double etof)
void setErrT0(double errt0)
void setTexp(double texp[5])
void setBeta(double beta)
void setErrEnergy(double errenergy)
void setTrackID(int trackID)
void setErrZ(double errz)
void setErrPhi(double errphi)
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
void getMultiHit(MrpcTrack *&)
void convert2RecBTofCalHitCol(int runNumber, int eventNumber, RecBTofCalHitCol *btofCalHitCol, std::string calibData)
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 match(bool forCalibration, std::vector< int > deadId, std::vector< MrpcTrack * > *&tofTrackVec)
void getTofDataWest(TofData *tof, unsigned int iflag)
double tof(unsigned int i) const
void setQuality2(int qual2)
unsigned int quality2() const
void convert2RecETofCalHitCol(int runNumber, int eventNumber, RecETofCalHitCol *etofCalHitCol, std::string calibData)
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)
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
void setsinTheta(double sint)
void setnext(RecBTofCalHit *n)
void setTdc2(double tdc2)
void setdZHit(double dzHit)
void setAdc2(double adc2)
void setTdc1(double tdc1)
void setZHit(double zHit)
void setDeltaPhi(double deltaPhi)
void setTpred(int idx, double t)
void setAdc1(double adc1)
void setdRHit(double drHit)
void setDeltaPhi(double deltaPhi)
void setRHit(double rHit)
void setcosTheta(double cost)
void setTpred(int idx, double t)
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 int end(const Identifier &id)
static int phi_module(const Identifier &id)
static int barrel_ec(const Identifier &id)
Values of different levels (failure returns 0)
static value_type getIntID(int barrel_ec, int layer, int phi_module, int end)
static int layer(const Identifier &id)