387 {
388
390
391
420
421
422
466
467
478
479
480 const float timeCor = comTimeObject ? comTimeObject->
getTime() : 0;
481
482 auto p_trk = trackCollection.
begin();
483
487
488 int ntrackstack[2][64];
489 int nTotalTracks = 0;
490 int nTracksB[2] = {0, 0};
491 int nTracksEC[2] = {0, 0};
492 int nTracksEC_B[2] = {0, 0};
493 int nTrksperLB_B = 0;
494 int nTrksperLB_E[2] = {0, 0};
495
496 for (int ibe = 0; ibe < 2; ibe++) {
497 std::fill(ntrackstack[ibe], ntrackstack[ibe] + 64, 0);
498 }
499
500for (; p_trk != trackCollection.
end(); ++p_trk) {
501
505
506
507 if (nTRTHits < m_minTRThits) continue;
508
509 AllTrkPar = ((*p_trk)->track())->trackParameters();
510
511
512
513
514
515 for (p_trkpariter = AllTrkPar->begin(); p_trkpariter != AllTrkPar->end(); ++p_trkpariter) {
516
517 if ((mPer =
dynamic_cast<const Trk::Perigee *
>(*p_trkpariter)))
break;
518 }
519
520 if (!mPer) continue;
521
526
527 if (p < m_minP) continue;
528
529 const Trk::TrackStates *trackStates = ((*p_trk)->track())->trackStateOnSurfaces();
530
531 if (trackStates == nullptr) continue;
532
537
539 int n_trt_hits =
unsigned(tempHitsVariable);
540
541 bool is_pT_over_20GeV = false;
542
543 if (mPer->
pT() > 20 * CLHEP::GeV) {
544 is_pT_over_20GeV = true;
545 } else {
546 is_pT_over_20GeV = false;
547 }
548
549 const bool cnst_is_pT_over_20GeV = is_pT_over_20GeV;
550
551 const bool passed_track_preselection = (
static_cast<bool>(
m_trackSelTool->accept(**p_trk)) || m_isCosmics) &&
554 if (!passed_track_preselection) continue;
555
556 nTotalTracks++;
557 int checkB[2] = {0, 0};
558 int checkEC[2] = {0, 0};
559 int checkEC_B[2] = {0, 0};
560 int nTRTHitsW[2][2];
561 int nTRTHits_side[2][2];
562 int nTRTHitsW_perwheel[2][18];
563 int hitontrack[2] = {0, 0};
564 int hitontrack_E_side[2] = {0, 0};
565
566 for (int ibe = 0; ibe < 2; ibe++) {
567 for (int iside = 0; iside < 2; iside++) {
568 nTRTHits_side[ibe][iside] = -1;
569 nTRTHitsW[ibe][iside] = 0;
570 }
571 std::fill(nTRTHitsW_perwheel[ibe], nTRTHitsW_perwheel[ibe] + 18, 0);
572 }
573
574 int barrel_ec = 0;
575 int layer_or_wheel = 0;
576 int phi_module = 0;
577 int straw_layer = 0;
579 int nearest_straw_layer[2] = {100, 100};
580 int nearest_straw[2] = {0, 0};
581 int testLayer[2] = {100, 100};
582 float phi2D[2] = {-100, -100};
583
584 for (TSOSItBeginTemp = TSOSItBegin0; TSOSItBeginTemp != TSOSItEnd; ++TSOSItBeginTemp) {
585 if ((*TSOSItBeginTemp) == nullptr) continue;
586
588 const InDet::TRT_DriftCircleOnTrack *trtCircle = dynamic_cast<const InDet::TRT_DriftCircleOnTrack *>((*TSOSItBeginTemp)->measurementOnTrack());
589
590 if (!trtCircle) continue;
592
593 if (!aTrackParam) continue;
594 Identifier DCoTId = trtCircle->
identify();
596 int ibe = std::abs(barrel_ec) - 1;
600
601
602 if (layer_or_wheel >= testLayer[ibe]) continue;
603 testLayer[ibe] = layer_or_wheel;
604
605 if (straw_layer < nearest_straw_layer[ibe]) {
606 nearest_straw_layer[ibe] = straw_layer;
607 nearest_straw[ibe] =
straw;
608 const InDetDD::TRT_BaseElement *circleElement = nullptr;
611 circleElement = nullptr;
612 }
613 }
614
615 if (phi2D[0] == -999) {
616 ATH_MSG_DEBUG(
"Track did not go through inner layer of Barrel.");
617 } else {
619 testLayer[0] << " m_straw_layer: " <<
620 nearest_straw_layer[0] << " (in the Barrel).");
621 }
622
623 if (phi2D[1] == -999) {
624 ATH_MSG_DEBUG(
"Track did not go through any inner layer of EndCap A or C.");
625 } else {
627 testLayer[1] << " m_straw_layer: " <<
628 nearest_straw_layer[1] << " (in the EndCaps).");
629 }
630
631 bool trackfound[2][64];
632
633 for (
int i = 0;
i < 2;
i++) {
634 std::fill(trackfound[i], trackfound[i] + 64, false);
635 }
636
637 for (TSOSItBegin = TSOSItBegin0; TSOSItBegin != TSOSItEnd; ++TSOSItBegin) {
638
639 if ((*TSOSItBegin) == nullptr) continue;
640
642
643 const InDet::TRT_DriftCircleOnTrack *trtCircle = dynamic_cast<const InDet::TRT_DriftCircleOnTrack *>((*TSOSItBegin)->measurementOnTrack());
644
645 if (!trtCircle) continue;
646
648
649 if (!aTrackParam) continue;
650
651 Identifier DCoTId = trtCircle->
identify();
657 int ibe = std::abs(barrel_ec) - 1;
658 int iside = barrel_ec > 0 ? 0 : 1;
659 int thisStrawNumber[2] = {-1, -1};
660 int chip[2] = {0, 0};
661
662 if (ibe == 0) {
663 thisStrawNumber[ibe] =
strawNumber(straw, straw_layer, layer_or_wheel);
664
665 if (thisStrawNumber[ibe] >= 0 && thisStrawNumber[ibe] < s_Straw_max[ibe]) {
666 chip[ibe] =
m_mat_chip_B.at(phi_module).at(thisStrawNumber[ibe]);
667 }
668 } else if (ibe == 1) {
669 thisStrawNumber[ibe] =
strawNumberEndCap(straw, straw_layer, layer_or_wheel, phi_module, barrel_ec);
670
671 if (thisStrawNumber[ibe] >= 0 && thisStrawNumber[ibe] < s_Straw_max[ibe]) {
672 chip[ibe] =
m_mat_chip_E.at(phi_module).at(thisStrawNumber[ibe]);
673 }
674 } else {
675 thisStrawNumber[ibe] = -1;
676 }
677
678 if (thisStrawNumber[ibe] < 0 || thisStrawNumber[ibe] >= s_Straw_max[ibe]) continue;
679
680 if (checkB[iside] == 0 && ibe == 0) {
681 nTracksB[iside]++;
682 checkB[iside] = 1;
683 }
684
685 if (checkEC[iside] == 0 && ibe == 1) {
686 nTracksEC[iside]++;
687 checkEC[iside] = 1;
688 }
689
690 if (checkEC_B[iside] == 0 && checkB[iside] == 1 && ibe == 1 ) {
691 nTracksEC_B[iside]++;
692 checkEC_B[iside] = 1;
693 }
694
695 Identifier surfaceID;
696 const Trk::MeasurementBase *mesb = (*TSOSItBegin)->measurementOnTrack();
699
701 TRTCond::RtRelation
const *rtr =
m_TRTCalDbTool->getRtRelation(surfaceID);
702 int iphi_module = -9999;
703
704 if (iside == 0) iphi_module = phi_module;
705 else if (iside == 1) iphi_module = phi_module + 32;
706
707 if (iphi_module >= 0 && iphi_module < 64) trackfound[ibe][iphi_module] = true;
709
710 if (((ibe == 0) && (temp_locr < m_DistToStraw)) ||
714 (temp_locr < m_DistToStraw))) {
716 if (ibe == 0) {
717 hitontrack[ibe]++;
718 } else if (ibe == 1) {
719 hitontrack[ibe]++;
720 hitontrack_E_side[iside]++;
721 }
722 }
723 }
724 const InDet::TRT_DriftCircle *RawDriftCircle =
dynamic_cast<const InDet::TRT_DriftCircle *
>(trtCircle->
prepRawData());
726 if (RawDriftCircle) {
727 nTRTHits_side[ibe][iside]++;
729
731
732 if (driftTimeValid) {
733 const float validRawDriftTime = RawDriftCircle->
rawDriftTime();
734
735 if (m_doExpert && m_doStraws) {
736 ValidRawDriftTimeonTrkS_x = thisStrawNumber[ibe];
737 ValidRawDriftTimeonTrkS_y = validRawDriftTime;
738 fill(
"TRTTrackHistograms"+std::to_string(ibe)+std::to_string(iphi_module), ValidRawDriftTimeonTrkS_x, ValidRawDriftTimeonTrkS_y);
739 }
740
741 if (m_doExpert && m_doChips) {
742 ValidRawDriftTimeonTrkC_x = chip[ibe] - 1;
743 ValidRawDriftTimeonTrkC_y = validRawDriftTime;
744 fill(
"TRTTrackHistograms"+std::to_string(ibe)+std::to_string(iphi_module), ValidRawDriftTimeonTrkC_x, ValidRawDriftTimeonTrkC_y);
745 }
746 }
747
748 if (m_doShift && m_doStraws) {
749 if (ibe == 0) {
750 if (isArgonStraw) {
751 DriftTimeonTrkDist_B_Ar = RawDriftCircle->
rawDriftTime();
752 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe), DriftTimeonTrkDist_B_Ar);
753 }
754 else {
756 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe), DriftTimeonTrkDist_B);
757 }
758 } else if (ibe == 1) {
759 if (isArgonStraw) {
760 DriftTimeonTrkDist_E_Ar = RawDriftCircle->
rawDriftTime();
761 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe)+std::to_string(iside), DriftTimeonTrkDist_E_Ar);
762 }
763 else {
765 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe)+std::to_string(iside), DriftTimeonTrkDist_E);
766 }
767 }
768 }
769
770 float locR_err = 0.0;
771 const AmgSymMatrix(5)* b_err = aTrackParam->covariance();
772
773 if (b_err) {
775 ATH_MSG_WARNING(
"Some diagonal element(s) of the covariance matrix is (are) infinite or smaller than / too close to zero or above the covariance cutoff");
776 }
777 else {
779 }
780 } else {
781 ATH_MSG_ERROR(
"Track parameters have no covariance attached.");
782 }
783
787
788 if (isTubeHit) {
789 bool isOK = false;
791
792 if ((loc * locR) < 0) loc = -loc;
793 }
794
795
796 if (m_doShift && m_doStraws) {
797 bool pull_b_fill;
798 double pull_b = -999.;
799 const double diff_loc_err = std::abs(loc_err-locR_err);
800 if ( diff_loc_err > 0 ) {
801 pull_b = (loc -
locR) /diff_loc_err ;
802 pull_b_fill = true;
803 }
804 else pull_b_fill = false;
806 const double trkdrifttime = (!rtr) ? 0 : rtr->drifttime(std::abs(
locR));
807 const double timeresidual = RawDriftCircle->
rawDriftTime() - thist0 - trkdrifttime;
808
809 if (ibe == 0) {
810 if (!isTubeHit) {
811 if (pull_b_fill) {
812 Pull_Biased_Barrel = pull_b;
813 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe), Pull_Biased_Barrel);
814 }
815 }
816
817 if (isArgonStraw) {
818 Residual_B_Ar = loc -
locR;
819 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe), Residual_B_Ar);
820 Residual_noTubeHits_B_Ar = loc -
locR;
821 if (!isTubeHit)
fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe), Residual_noTubeHits_B_Ar);
822
823 if (cnst_is_pT_over_20GeV) {
824 Residual_B_Ar_20GeV = loc -
locR;
825 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe), Residual_B_Ar_20GeV);
826 Residual_noTubeHits_B_Ar_20GeV = loc -
locR;
827 if (!isTubeHit)
fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe), Residual_noTubeHits_B_Ar_20GeV);
828 }
829 TimeResidual_B_Ar = timeresidual;
830 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe), TimeResidual_B_Ar);
831 TimeResidual_noTubeHits_B_Ar = timeresidual;
832 if (!isTubeHit)
fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe), TimeResidual_noTubeHits_B_Ar);
833 } else {
834 Residual_B = loc -
locR;
835 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe), Residual_B);
836 Residual_noTubeHits_B = loc -
locR;
837 if (!isTubeHit)
fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe), Residual_noTubeHits_B);
838 TimeResidual_B = timeresidual;
839 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe), TimeResidual_B);
840 TimeResidual_noTubeHits_B = timeresidual;
841 if (!isTubeHit)
fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe), TimeResidual_noTubeHits_B);
842
843 if (cnst_is_pT_over_20GeV) {
844 Residual_B_20GeV = loc -
locR;
845 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe), Residual_B_20GeV);
846 Residual_noTubeHits_B_20GeV = loc -
locR;
847 if (!isTubeHit)
fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe), Residual_noTubeHits_B_20GeV);
848 }
849 }
850 } else if (ibe == 1) {
851 if (!isTubeHit) {
852 if (pull_b_fill) {
853 Pull_Biased_EndCap = pull_b;
854 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe), Pull_Biased_EndCap);
855 }
856 }
857
858 if (isArgonStraw) {
859 Residual_E_Ar = loc -
locR;
860 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe)+std::to_string(iside), Residual_E_Ar);
861 Residual_noTubeHits_E_Ar = loc -
locR;
862 if (!isTubeHit)
fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe)+std::to_string(iside), Residual_noTubeHits_E_Ar);
863 TimeResidual_E_Ar = timeresidual;
864 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe)+std::to_string(iside), TimeResidual_E_Ar);
865 TimeResidual_noTubeHits_E_Ar = timeresidual;
866 if (!isTubeHit)
fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe)+std::to_string(iside), TimeResidual_noTubeHits_E_Ar);
867
868 if (cnst_is_pT_over_20GeV) {
869 Residual_E_Ar_20GeV = loc -
locR;
870 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe)+std::to_string(iside), Residual_E_Ar_20GeV);
871 Residual_noTubeHits_E_Ar_20GeV = loc -
locR;
872 if (!isTubeHit)
fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe)+std::to_string(iside), Residual_noTubeHits_E_Ar_20GeV);
873 }
874 } else {
875 Residual_E = loc -
locR;
876 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe)+std::to_string(iside), Residual_E);
877 Residual_noTubeHits_E = loc -
locR;
878 if (!isTubeHit)
fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe)+std::to_string(iside), Residual_noTubeHits_E);
879 TimeResidual_E = timeresidual;
880 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe)+std::to_string(iside), TimeResidual_E);
881 TimeResidual_noTubeHits_E = timeresidual;
882 if (!isTubeHit)
fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe)+std::to_string(iside), TimeResidual_noTubeHits_E);
883
884 if (cnst_is_pT_over_20GeV) {
885 Residual_E_20GeV = loc -
locR;
886 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe)+std::to_string(iside), Residual_E_20GeV);
887 Residual_noTubeHits_E_20GeV = loc -
locR;
888 if (!isTubeHit)
fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe)+std::to_string(iside), Residual_noTubeHits_E_20GeV);
889 }
890 }
891 }
892 }
893
894 if (m_doShift) {
895 if (ibe == 0) {
896 if (isArgonStraw) {
897 WireToTrkPosition_B_Ar =
locR;
898 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe), WireToTrkPosition_B_Ar);
899 } else {
900 WireToTrkPosition_B =
locR;
901 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe), WireToTrkPosition_B);
902 }
903 } else if (ibe == 1) {
904 if (isArgonStraw) {
905 WireToTrkPosition_E_Ar =
locR;
906 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe)+std::to_string(iside), WireToTrkPosition_E_Ar);
907 } else {
908 WireToTrkPosition_E =
locR;
909 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe)+std::to_string(iside), WireToTrkPosition_E);
910 }
911 }
912 }
913
915 const float EP = timeCor;
916
917 if (m_doShift && m_doStraws) {
918 if (ibe == 0) {
919 if (isArgonStraw) {
920 if (m_isCosmics) {
921 RtRelation_B_Ar_x =
LE - EP -
t0;
922 RtRelation_B_Ar_y = std::abs(locR);
923 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe), RtRelation_B_Ar_x, RtRelation_B_Ar_y);
924 } else {
925 RtRelation_B_Ar_x =
LE -
t0;
926 RtRelation_B_Ar_y = std::abs(locR);
927 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe), RtRelation_B_Ar_x, RtRelation_B_Ar_y);
928 }
929 } else {
930 if (m_isCosmics) {
931 RtRelation_B_x =
LE - EP -
t0;
932 RtRelation_B_y = std::abs(locR);
933 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe), RtRelation_B_x, RtRelation_B_y);
934 } else {
935 RtRelation_B_x =
LE -
t0;
936 RtRelation_B_y = std::abs(locR);
937 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe), RtRelation_B_x, RtRelation_B_y);
938 }
939 }
940 } else if (ibe == 1) {
941 if (isArgonStraw) {
942 if (m_isCosmics) {
943 RtRelation_E_Ar_x =
LE - EP -
t0;
944 RtRelation_E_Ar_y = std::abs(locR);
945 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe)+std::to_string(iside), RtRelation_E_Ar_x, RtRelation_E_Ar_y);
946 } else {
947 RtRelation_E_Ar_x =
LE -
t0;
948 RtRelation_E_Ar_y = std::abs(locR);
949 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe)+std::to_string(iside), RtRelation_E_Ar_x, RtRelation_E_Ar_y);
950 }
951 } else {
952 if (m_isCosmics) {
953 RtRelation_E_x =
LE - EP -
t0;
954 RtRelation_E_y = std::abs(locR);
955 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe)+std::to_string(iside), RtRelation_E_x, RtRelation_E_y);
956 } else {
957 RtRelation_E_x =
LE -
t0;
958 RtRelation_E_y = std::abs(locR);
959 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe)+std::to_string(iside), RtRelation_E_x, RtRelation_E_y);
960 }
961 }
962 }
963 }
964
970
972
976
977 if (m_doExpert && m_doChips) {
978 HitTronTMapC_x = chip[ibe] - 1;
979 HitTronTMapC_y = trailingEdgeScaled;
980 fill(
"TRTTrackHistograms"+std::to_string(ibe)+std::to_string(iphi_module), HitTronTMapC_x, HitTronTMapC_y);
981 }
982
983 if (m_doExpert && m_doStraws) {
984 HitTronTwEPCMapS_x = thisStrawNumber[ibe];
985 HitTronTwEPCMapS_y = trailingEdgeScaled - timeCor;
986 fill(
"TRTTrackHistograms"+std::to_string(ibe)+std::to_string(iphi_module), HitTronTwEPCMapS_x, HitTronTwEPCMapS_y);
987 }
988
989 if (m_doExpert && m_doChips) {
990 HitTronTwEPCMapC_x = chip[ibe] - 1;
991 HitTronTwEPCMapC_y = trailingEdgeScaled - timeCor;
992 fill(
"TRTTrackHistograms"+std::to_string(ibe)+std::to_string(iphi_module), HitTronTwEPCMapC_x, HitTronTwEPCMapC_y);
993 }
994
995 if (m_doShift && m_doStraws) {
997 if (ibe == 0) {
998 if (isArgonStraw) {
999 TronTDist_B_Ar = trailingEdgeScaled;
1000 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe), TronTDist_B_Ar);
1001 AvgTroTDetPhi_B_Ar_x = phi2D[ibe];
1002 AvgTroTDetPhi_B_Ar_y = trailingEdgeScaled;
1003 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe), AvgTroTDetPhi_B_Ar_x, AvgTroTDetPhi_B_Ar_y);
1004 } else {
1005 TronTDist_B = trailingEdgeScaled;
1006 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe), TronTDist_B);
1007 AvgTroTDetPhi_B_x = phi2D[ibe];
1008 AvgTroTDetPhi_B_y = trailingEdgeScaled;
1009 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe), AvgTroTDetPhi_B_x, AvgTroTDetPhi_B_y);
1010 }
1011 } else if (ibe == 1) {
1012 if (isArgonStraw) {
1013 TronTDist_E_Ar = trailingEdgeScaled;
1014 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe)+std::to_string(iside), TronTDist_E_Ar);
1015 AvgTroTDetPhi_E_Ar_x = phi2D[ibe];
1016 AvgTroTDetPhi_E_Ar_y = trailingEdgeScaled;
1017 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe)+std::to_string(iside), AvgTroTDetPhi_E_Ar_x, AvgTroTDetPhi_E_Ar_y);
1018 } else {
1019 TronTDist_E = trailingEdgeScaled;
1020 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe)+std::to_string(iside), TronTDist_E);
1021 AvgTroTDetPhi_E_x = phi2D[ibe];
1022 AvgTroTDetPhi_E_y = trailingEdgeScaled;
1023 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe)+std::to_string(iside), AvgTroTDetPhi_E_x, AvgTroTDetPhi_E_y);
1024 }
1025 }
1026 }
1027 }
1028 }
1029 }
1030 }
1031
1032
1033 for (int ibe = 0; ibe < 2; ibe++) {
1034 for (
int i = 0;
i < 64;
i++)
1035 if (trackfound[ibe][i])
1036 ntrackstack[ibe][
i]++;
1037
1038 if (m_doShift) {
1039 if (ibe == 0) {
1040 if (hitontrack[ibe] >= m_minTRThits) {
1041 NumHoTDetPhi_B_x = phi2D[ibe];
1042 NumHoTDetPhi_B_y = hitontrack[ibe];
1043 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe), NumHoTDetPhi_B_x, NumHoTDetPhi_B_y);
1044 }
1045 }
1046
1047 if (ibe == 1) {
1048 if (hitontrack_E_side[0] >= m_minTRThits) {
1049 NumHoTDetPhi_E_x = phi2D[ibe];
1050 NumHoTDetPhi_E_y = hitontrack_E_side[0];
1051 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe)+
"0", NumHoTDetPhi_E_x, NumHoTDetPhi_E_y);
1052 }
1053
1054 if (hitontrack_E_side[1] >= m_minTRThits) {
1055 NumHoTDetPhi_E_x = phi2D[ibe];
1056 NumHoTDetPhi_E_y = hitontrack_E_side[1];
1057 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe)+
"1", NumHoTDetPhi_E_x, NumHoTDetPhi_E_y);
1058 }
1059 }
1060 }
1061
1062 if (phi2D[ibe] < 0) continue;
1063
1064 if (m_doShift) {
1065 if (ibe == 0) {
1066 if (nTRTHitsW[ibe][0] + nTRTHitsW[ibe][1] > 0) {
1067 NumTrksDetPhi_B = phi2D[ibe];
1068 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe), NumTrksDetPhi_B);
1069 }
1070 } else if (ibe == 1) {
1071 if (nTRTHitsW[ibe][0] > 0) {
1072 NumTrksDetPhi_E = phi2D[ibe];
1073 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe)+
"0", NumTrksDetPhi_E);
1074 }
1075
1076 if (nTRTHitsW[ibe][1] > 0) {
1077 NumTrksDetPhi_E = phi2D[ibe];
1078 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe)+
"1", NumTrksDetPhi_E);
1079 }
1080 }
1081 }
1082
1083 if (ibe == 0) {
1084 if ((nTRTHitsW[ibe][0] + nTRTHitsW[ibe][1]) > 0) {
1085 nTrksperLB_B++;
1086 }
1087 if (comTimeObject) {
1088 if (m_doShift && (phi2D[ibe] > 0) && (std::abs(timeCor) > 1e-8)) {
1089 EvtPhaseDetPhi_B_x = phi2D[ibe];
1090 EvtPhaseDetPhi_B_y = timeCor;
1091 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe), EvtPhaseDetPhi_B_x, EvtPhaseDetPhi_B_y);
1092 }
1093 }
1094 } else if (ibe == 1) {
1095 for (int iside = 0; iside < 2; iside++) {
1096 if (nTRTHitsW[ibe][iside] > 0) nTrksperLB_E[iside]++;
1097 if (comTimeObject) {
1098 if (nTRTHits_side[ibe][iside] > 5 && (std::abs(timeCor)
1099 > 1e-8)) {
1100 if (m_doShift) {
1101 EvtPhaseDetPhi_E_x = phi2D[ibe];
1102 EvtPhaseDetPhi_E_y = timeCor;
1103 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe)+std::to_string(iside), EvtPhaseDetPhi_E_x, EvtPhaseDetPhi_E_y);
1104 }
1105 }
1106 }
1107 }
1108 }
1109 }
1110 }
1111
1112 if (comTimeObject) {
1113 if (std::abs(timeCor) > 1e-8) {
1114 if (m_doShift) {
1115 EvtPhase = timeCor;
1116 fill(
"ShiftTRTTrackHistograms0", EvtPhase);
1117 }
1118
1119 if (m_doShift && trigDecision) {
1120 std::vector<int> trigid;
1121 trigid.clear();
1122
1123 std::vector<unsigned int> level1TAV = trigDecision->
tav();
1124
1125 for (unsigned int j = 0; j < 8 && j < level1TAV.size(); ++j) {
1126 for (
unsigned int i = 0;
i < 32; ++
i) {
1127 if ((level1TAV[j] >> i) & 0x1) {
1128 trigid.push_back(i + (j % 8) * 32);
1129 }
1130 }
1131 }
1132
1133 for (unsigned int j = 0; j < trigid.size(); ++j) {
1134 EvtPhaseVsTrig_x = timeCor;
1135 EvtPhaseVsTrig_y = trigid[j];
1136 fill(
"ShiftTRTTrackHistograms0", EvtPhaseVsTrig_x, EvtPhaseVsTrig_y);
1137 }
1138 }
1139 }
1140 }
1141
1142 if (m_doShift) {
1144 SummaryWeight = 1.;
1145 fill(
"SmryHistograms", SummaryWeight, Summary);
1146
1147 if (m_doTracksMon) {
1149 SummaryWeight = nTotalTracks;
1150 fill(
"SmryHistograms", SummaryWeight, Summary);
1152 SummaryWeight = nTracksB[0];
1153 fill(
"SmryHistograms", SummaryWeight, Summary);
1155 SummaryWeight = nTracksB[1];
1156 fill(
"SmryHistograms", SummaryWeight, Summary);
1158 SummaryWeight = nTracksEC[0];
1159 fill(
"SmryHistograms", SummaryWeight, Summary);
1161 SummaryWeight = nTracksEC[1];
1162 fill(
"SmryHistograms", SummaryWeight, Summary);
1164 SummaryWeight = nTracksEC_B[0];
1165 fill(
"SmryHistograms", SummaryWeight, Summary);
1167 SummaryWeight = nTracksEC_B[1];
1168 fill(
"SmryHistograms", SummaryWeight, Summary);
1169 }
1170
1173 int lastLumiBlock = -99;
1174 if ((int)lumiBlock != lastLumiBlock) {
1176 }
1177 float evtLumiBlock = 1.;
1178 float lumiBlockScale = (evtLumiBlock > 0) ? (1. / evtLumiBlock) : 0;
1179
1180 if (m_doTracksMon && evtLumiBlock > 0) {
1181 NTrksperLB_x = lastLumiBlock;
1182 NTrksperLB_y = (
float)nTrksperLB_B * lumiBlockScale;
1183 fill(
"ShiftTRTTrackHistograms0", NTrksperLB_x, NTrksperLB_y);
1184
1185 for (int iside = 0; iside < 2; iside++) {
1186 NTrksperLB_x = lastLumiBlock;
1187 NTrksperLB_y = (
float)nTrksperLB_E[iside] * lumiBlockScale;
1188 fill(
"ShiftTRTTrackHistograms1"+std::to_string(iside), NTrksperLB_x, NTrksperLB_y);
1189 }
1190
1191 nTrksperLB_B = 0;
1192
1193 for (int iside = 0; iside < 2; iside++) {
1194 nTrksperLB_E[iside] = 0;
1195 }
1196 }
1197 }
1198
1200
1201
1202 return StatusCode::SUCCESS;
1203}
Scalar theta() const
theta method
#define AmgSymMatrix(dim)
bool is_trt(Identifier id) const
const Amg::Vector3D & strawCenter(int straw) const
Straw Surface: Local -> global transform of the straw via integer.
virtual const InDetDD::TRT_BaseElement * detectorElement() const override final
returns the detector element, assoicated with the PRD of this class
bool driftTimeValid() const
return true if the corrected drift time is OK
int driftTimeBin() const
returns the leading edge bin defined as in TRT_LoLumRawData to be the first 0-1 transition
bool lastBinHigh() const
returns true if the last bin is high
bool firstBinHigh() const
returns true if the first bin is high
double rawDriftTime() const
returns the raw driftTime
int trailingEdge() const
returns the trailing edge bin
float radToDegrees(float radValue) const
int strawNumberEndCap(int strawNumber, int strawLayerNumber, int LayerNumber, int phi_stack, int side) const
const AtlasDetectorID * m_idHelper
Gaudi::Property< int > m_min_trt_hits
Gaudi::Property< float > m_min_pT
std::vector< std::vector< unsigned char > > m_mat_chip_E
std::vector< std::vector< unsigned char > > m_mat_chip_B
ToolHandle< ITRT_CalDbTool > m_TRTCalDbTool
int strawNumber(int strawNumber, int strawlayerNumber, int LayerNumber) const
ToolHandle< ITRT_DriftFunctionTool > m_drifttool
GasType Straw_Gastype(int stat) const
ToolHandle< ITRT_StrawStatusSummaryTool > m_sumTool
int straw(const Identifier &id) const
const LocalParameters & localParameters() const
Interface method to get the LocalParameters.
const Amg::MatrixX & localCovariance() const
Interface method to get the localError.
double pT() const
Access method for transverse momentum.
@ Outlier
This TSoS contains an outlier, that is, it contains a MeasurementBase/RIO_OnTrack which was not used ...
@ Hole
A hole on the track - this is defined in the following way.
const std::vector< uint32_t > & tav() const
Get the Trigger After Veto bits.
int trailingEdge(unsigned int m_word)
int driftTimeBin(unsigned int m_word)
bool lastBinHigh(unsigned int m_word)
bool firstBinHigh(unsigned int m_word)
double error(const Amg::MatrixX &mat, int index)
return diagonal error of the matrix caller should ensure the matrix is symmetric and the index is in ...
bool hasPositiveDiagElems(const AmgSymMatrix(N) &mat)
Returns true if all diagonal elements of the covariance matrix are finite aka sane in the above defin...
float nTRTHits(const U &p)