387 {
388
390
391
392
421
422
423
467
468
479
480
481 const float timeCor = comTimeObject ? comTimeObject->
getTime() : 0;
482
483 auto p_trk = trackCollection.
begin();
484
488
489 int ntrackstack[2][64];
490 int nTotalTracks = 0;
491 int nTracksB[2] = {0, 0};
492 int nTracksEC[2] = {0, 0};
493 int nTracksEC_B[2] = {0, 0};
494 int nTrksperLB_B = 0;
495 int nTrksperLB_E[2] = {0, 0};
496
497 for (int ibe = 0; ibe < 2; ibe++) {
498 std::fill(ntrackstack[ibe], ntrackstack[ibe] + 64, 0);
499 }
500
501for (; p_trk != trackCollection.
end(); ++p_trk) {
502
506
507
508 if (nTRTHits < m_minTRThits) continue;
509
510 AllTrkPar = ((*p_trk)->track())->trackParameters();
511
512
513
514
515
516 for (p_trkpariter = AllTrkPar->begin(); p_trkpariter != AllTrkPar->end(); ++p_trkpariter) {
517
518 if ((mPer =
dynamic_cast<const Trk::Perigee *
>(*p_trkpariter)))
break;
519 }
520
521 if (!mPer) continue;
522
527
528 if (p < m_minP) continue;
529
530 const Trk::TrackStates *trackStates = ((*p_trk)->track())->trackStateOnSurfaces();
531
532 if (trackStates == nullptr) continue;
533
538
540 int n_trt_hits =
unsigned(tempHitsVariable);
541
542 bool is_pT_over_20GeV = false;
543
544 if (mPer->
pT() > 20 * CLHEP::GeV) {
545 is_pT_over_20GeV = true;
546 } else {
547 is_pT_over_20GeV = false;
548 }
549
550 const bool cnst_is_pT_over_20GeV = is_pT_over_20GeV;
551
552 const bool passed_track_preselection = (
static_cast<bool>(
m_trackSelTool->accept(**p_trk)) || m_isCosmics) &&
555 if (!passed_track_preselection) continue;
556
557 nTotalTracks++;
558 int checkB[2] = {0, 0};
559 int checkEC[2] = {0, 0};
560 int checkEC_B[2] = {0, 0};
561 int nTRTHitsW[2][2];
562 int nTRTHits_side[2][2];
563 int nTRTHitsW_perwheel[2][18];
564 int hitontrack[2] = {0, 0};
565 int hitontrack_E_side[2] = {0, 0};
566
567 for (int ibe = 0; ibe < 2; ibe++) {
568 for (int iside = 0; iside < 2; iside++) {
569 nTRTHits_side[ibe][iside] = -1;
570 nTRTHitsW[ibe][iside] = 0;
571 }
572 std::fill(nTRTHitsW_perwheel[ibe], nTRTHitsW_perwheel[ibe] + 18, 0);
573 }
574
575 int barrel_ec = 0;
576 int layer_or_wheel = 0;
577 int phi_module = 0;
578 int straw_layer = 0;
580 int nearest_straw_layer[2] = {100, 100};
581 int nearest_straw[2] = {0, 0};
582 int testLayer[2] = {100, 100};
583 float phi2D[2] = {-100, -100};
584
585 for (TSOSItBeginTemp = TSOSItBegin0; TSOSItBeginTemp != TSOSItEnd; ++TSOSItBeginTemp) {
586 if ((*TSOSItBeginTemp) == nullptr) continue;
587
589 const InDet::TRT_DriftCircleOnTrack *trtCircle = dynamic_cast<const InDet::TRT_DriftCircleOnTrack *>((*TSOSItBeginTemp)->measurementOnTrack());
590
591 if (!trtCircle) continue;
593
594 if (!aTrackParam) continue;
595 Identifier DCoTId = trtCircle->
identify();
597 int ibe = std::abs(barrel_ec) - 1;
601
602
603 if (layer_or_wheel >= testLayer[ibe]) continue;
604 testLayer[ibe] = layer_or_wheel;
605
606 if (straw_layer < nearest_straw_layer[ibe]) {
607 nearest_straw_layer[ibe] = straw_layer;
608 nearest_straw[ibe] =
straw;
609 const InDetDD::TRT_BaseElement *circleElement = nullptr;
612 circleElement = nullptr;
613 }
614 }
615
616 if (phi2D[0] == -999) {
617 ATH_MSG_DEBUG(
"Track did not go through inner layer of Barrel.");
618 } else {
620 testLayer[0] << " m_straw_layer: " <<
621 nearest_straw_layer[0] << " (in the Barrel).");
622 }
623
624 if (phi2D[1] == -999) {
625 ATH_MSG_DEBUG(
"Track did not go through any inner layer of EndCap A or C.");
626 } else {
628 testLayer[1] << " m_straw_layer: " <<
629 nearest_straw_layer[1] << " (in the EndCaps).");
630 }
631
632 bool trackfound[2][64];
633
634 for (
int i = 0;
i < 2;
i++) {
635 std::fill(trackfound[i], trackfound[i] + 64, false);
636 }
637
638 for (TSOSItBegin = TSOSItBegin0; TSOSItBegin != TSOSItEnd; ++TSOSItBegin) {
639
640 if ((*TSOSItBegin) == nullptr) continue;
641
643
644 const InDet::TRT_DriftCircleOnTrack *trtCircle = dynamic_cast<const InDet::TRT_DriftCircleOnTrack *>((*TSOSItBegin)->measurementOnTrack());
645
646 if (!trtCircle) continue;
647
649
650 if (!aTrackParam) continue;
651
652 Identifier DCoTId = trtCircle->
identify();
658 int ibe = std::abs(barrel_ec) - 1;
659 int iside = barrel_ec > 0 ? 0 : 1;
660 int thisStrawNumber[2] = {-1, -1};
661 int chip[2] = {0, 0};
662
663 if (ibe == 0) {
664 thisStrawNumber[ibe] =
strawNumber(straw, straw_layer, layer_or_wheel);
665
666 if (thisStrawNumber[ibe] >= 0 && thisStrawNumber[ibe] < s_Straw_max[ibe]) {
667 chip[ibe] =
m_mat_chip_B.at(phi_module).at(thisStrawNumber[ibe]);
668 }
669 } else if (ibe == 1) {
670 thisStrawNumber[ibe] =
strawNumberEndCap(straw, straw_layer, layer_or_wheel, phi_module, barrel_ec);
671
672 if (thisStrawNumber[ibe] >= 0 && thisStrawNumber[ibe] < s_Straw_max[ibe]) {
673 chip[ibe] =
m_mat_chip_E.at(phi_module).at(thisStrawNumber[ibe]);
674 }
675 } else {
676 thisStrawNumber[ibe] = -1;
677 }
678
679 if (thisStrawNumber[ibe] < 0 || thisStrawNumber[ibe] >= s_Straw_max[ibe]) continue;
680
681 if (checkB[iside] == 0 && ibe == 0) {
682 nTracksB[iside]++;
683 checkB[iside] = 1;
684 }
685
686 if (checkEC[iside] == 0 && ibe == 1) {
687 nTracksEC[iside]++;
688 checkEC[iside] = 1;
689 }
690
691 if (checkEC_B[iside] == 0 && checkB[iside] == 1 && ibe == 1 ) {
692 nTracksEC_B[iside]++;
693 checkEC_B[iside] = 1;
694 }
695
696 Identifier surfaceID;
697 const Trk::MeasurementBase *mesb = (*TSOSItBegin)->measurementOnTrack();
700
702 TRTCond::RtRelation
const *rtr =
m_TRTCalDbTool->getRtRelation(surfaceID);
703 int iphi_module = -9999;
704
705 if (iside == 0) iphi_module = phi_module;
706 else if (iside == 1) iphi_module = phi_module + 32;
707
708 if (iphi_module >= 0 && iphi_module < 64) trackfound[ibe][iphi_module] = true;
710
711 if (((ibe == 0) && (temp_locr < m_DistToStraw)) ||
715 (temp_locr < m_DistToStraw))) {
717 if (ibe == 0) {
718 hitontrack[ibe]++;
719 } else if (ibe == 1) {
720 hitontrack[ibe]++;
721 hitontrack_E_side[iside]++;
722 }
723 }
724 }
725 const InDet::TRT_DriftCircle *RawDriftCircle =
dynamic_cast<const InDet::TRT_DriftCircle *
>(trtCircle->
prepRawData());
727 if (RawDriftCircle) {
728 nTRTHits_side[ibe][iside]++;
730
732
733 if (driftTimeValid) {
734 const float validRawDriftTime = RawDriftCircle->
rawDriftTime();
735
736 if (m_doExpert && m_doStraws) {
737 ValidRawDriftTimeonTrkS_x = thisStrawNumber[ibe];
738 ValidRawDriftTimeonTrkS_y = validRawDriftTime;
739 fill(
"TRTTrackHistograms"+std::to_string(ibe)+std::to_string(iphi_module), ValidRawDriftTimeonTrkS_x, ValidRawDriftTimeonTrkS_y);
740 }
741
742 if (m_doExpert && m_doChips) {
743 ValidRawDriftTimeonTrkC_x = chip[ibe] - 1;
744 ValidRawDriftTimeonTrkC_y = validRawDriftTime;
745 fill(
"TRTTrackHistograms"+std::to_string(ibe)+std::to_string(iphi_module), ValidRawDriftTimeonTrkC_x, ValidRawDriftTimeonTrkC_y);
746 }
747 }
748
749 if (m_doShift && m_doStraws) {
750 if (ibe == 0) {
751 if (isArgonStraw) {
752 DriftTimeonTrkDist_B_Ar = RawDriftCircle->
rawDriftTime();
753 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe), DriftTimeonTrkDist_B_Ar);
754 }
755 else {
757 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe), DriftTimeonTrkDist_B);
758 }
759 } else if (ibe == 1) {
760 if (isArgonStraw) {
761 DriftTimeonTrkDist_E_Ar = RawDriftCircle->
rawDriftTime();
762 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe)+std::to_string(iside), DriftTimeonTrkDist_E_Ar);
763 }
764 else {
766 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe)+std::to_string(iside), DriftTimeonTrkDist_E);
767 }
768 }
769 }
770
771 float locR_err = 0.0;
772 const AmgSymMatrix(5)* b_err = aTrackParam->covariance();
773
774 if (b_err) {
776 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");
777 }
778 else {
780 }
781 } else {
782 ATH_MSG_ERROR(
"Track parameters have no covariance attached.");
783 }
784
788
789 if (isTubeHit) {
790 bool isOK = false;
792
793 if ((loc * locR) < 0) loc = -loc;
794 }
795
796
797 if (m_doShift && m_doStraws) {
798 bool pull_b_fill;
799 double pull_b = -999.;
800 const double diff_loc_err = std::abs(loc_err-locR_err);
801 if ( diff_loc_err > 0 ) {
802 pull_b = (loc -
locR) /diff_loc_err ;
803 pull_b_fill = true;
804 }
805 else pull_b_fill = false;
807 const double trkdrifttime = (!rtr) ? 0 : rtr->drifttime(std::abs(
locR));
808 const double timeresidual = RawDriftCircle->
rawDriftTime() - thist0 - trkdrifttime;
809
810 if (ibe == 0) {
811 if (!isTubeHit) {
812 if (pull_b_fill) {
813 Pull_Biased_Barrel = pull_b;
814 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe), Pull_Biased_Barrel);
815 }
816 }
817
818 if (isArgonStraw) {
819 Residual_B_Ar = loc -
locR;
820 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe), Residual_B_Ar);
821 Residual_noTubeHits_B_Ar = loc -
locR;
822 if (!isTubeHit)
fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe), Residual_noTubeHits_B_Ar);
823
824 if (cnst_is_pT_over_20GeV) {
825 Residual_B_Ar_20GeV = loc -
locR;
826 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe), Residual_B_Ar_20GeV);
827 Residual_noTubeHits_B_Ar_20GeV = loc -
locR;
828 if (!isTubeHit)
fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe), Residual_noTubeHits_B_Ar_20GeV);
829 }
830 TimeResidual_B_Ar = timeresidual;
831 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe), TimeResidual_B_Ar);
832 TimeResidual_noTubeHits_B_Ar = timeresidual;
833 if (!isTubeHit)
fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe), TimeResidual_noTubeHits_B_Ar);
834 } else {
835 Residual_B = loc -
locR;
836 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe), Residual_B);
837 Residual_noTubeHits_B = loc -
locR;
838 if (!isTubeHit)
fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe), Residual_noTubeHits_B);
839 TimeResidual_B = timeresidual;
840 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe), TimeResidual_B);
841 TimeResidual_noTubeHits_B = timeresidual;
842 if (!isTubeHit)
fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe), TimeResidual_noTubeHits_B);
843
844 if (cnst_is_pT_over_20GeV) {
845 Residual_B_20GeV = loc -
locR;
846 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe), Residual_B_20GeV);
847 Residual_noTubeHits_B_20GeV = loc -
locR;
848 if (!isTubeHit)
fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe), Residual_noTubeHits_B_20GeV);
849 }
850 }
851 } else if (ibe == 1) {
852 if (!isTubeHit) {
853 if (pull_b_fill) {
854 Pull_Biased_EndCap = pull_b;
855 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe), Pull_Biased_EndCap);
856 }
857 }
858
859 if (isArgonStraw) {
860 Residual_E_Ar = loc -
locR;
861 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe)+std::to_string(iside), Residual_E_Ar);
862 Residual_noTubeHits_E_Ar = loc -
locR;
863 if (!isTubeHit)
fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe)+std::to_string(iside), Residual_noTubeHits_E_Ar);
864 TimeResidual_E_Ar = timeresidual;
865 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe)+std::to_string(iside), TimeResidual_E_Ar);
866 TimeResidual_noTubeHits_E_Ar = timeresidual;
867 if (!isTubeHit)
fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe)+std::to_string(iside), TimeResidual_noTubeHits_E_Ar);
868
869 if (cnst_is_pT_over_20GeV) {
870 Residual_E_Ar_20GeV = loc -
locR;
871 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe)+std::to_string(iside), Residual_E_Ar_20GeV);
872 Residual_noTubeHits_E_Ar_20GeV = loc -
locR;
873 if (!isTubeHit)
fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe)+std::to_string(iside), Residual_noTubeHits_E_Ar_20GeV);
874 }
875 } else {
876 Residual_E = loc -
locR;
877 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe)+std::to_string(iside), Residual_E);
878 Residual_noTubeHits_E = loc -
locR;
879 if (!isTubeHit)
fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe)+std::to_string(iside), Residual_noTubeHits_E);
880 TimeResidual_E = timeresidual;
881 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe)+std::to_string(iside), TimeResidual_E);
882 TimeResidual_noTubeHits_E = timeresidual;
883 if (!isTubeHit)
fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe)+std::to_string(iside), TimeResidual_noTubeHits_E);
884
885 if (cnst_is_pT_over_20GeV) {
886 Residual_E_20GeV = loc -
locR;
887 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe)+std::to_string(iside), Residual_E_20GeV);
888 Residual_noTubeHits_E_20GeV = loc -
locR;
889 if (!isTubeHit)
fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe)+std::to_string(iside), Residual_noTubeHits_E_20GeV);
890 }
891 }
892 }
893 }
894
895 if (m_doShift) {
896 if (ibe == 0) {
897 if (isArgonStraw) {
898 WireToTrkPosition_B_Ar =
locR;
899 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe), WireToTrkPosition_B_Ar);
900 } else {
901 WireToTrkPosition_B =
locR;
902 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe), WireToTrkPosition_B);
903 }
904 } else if (ibe == 1) {
905 if (isArgonStraw) {
906 WireToTrkPosition_E_Ar =
locR;
907 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe)+std::to_string(iside), WireToTrkPosition_E_Ar);
908 } else {
909 WireToTrkPosition_E =
locR;
910 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe)+std::to_string(iside), WireToTrkPosition_E);
911 }
912 }
913 }
914
916 const float EP = timeCor;
917
918 if (m_doShift && m_doStraws) {
919 if (ibe == 0) {
920 if (isArgonStraw) {
921 if (m_isCosmics) {
922 RtRelation_B_Ar_x =
LE - EP -
t0;
923 RtRelation_B_Ar_y = std::abs(locR);
924 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe), RtRelation_B_Ar_x, RtRelation_B_Ar_y);
925 } else {
926 RtRelation_B_Ar_x =
LE -
t0;
927 RtRelation_B_Ar_y = std::abs(locR);
928 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe), RtRelation_B_Ar_x, RtRelation_B_Ar_y);
929 }
930 } else {
931 if (m_isCosmics) {
932 RtRelation_B_x =
LE - EP -
t0;
933 RtRelation_B_y = std::abs(locR);
934 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe), RtRelation_B_x, RtRelation_B_y);
935 } else {
936 RtRelation_B_x =
LE -
t0;
937 RtRelation_B_y = std::abs(locR);
938 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe), RtRelation_B_x, RtRelation_B_y);
939 }
940 }
941 } else if (ibe == 1) {
942 if (isArgonStraw) {
943 if (m_isCosmics) {
944 RtRelation_E_Ar_x =
LE - EP -
t0;
945 RtRelation_E_Ar_y = std::abs(locR);
946 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe)+std::to_string(iside), RtRelation_E_Ar_x, RtRelation_E_Ar_y);
947 } else {
948 RtRelation_E_Ar_x =
LE -
t0;
949 RtRelation_E_Ar_y = std::abs(locR);
950 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe)+std::to_string(iside), RtRelation_E_Ar_x, RtRelation_E_Ar_y);
951 }
952 } else {
953 if (m_isCosmics) {
954 RtRelation_E_x =
LE - EP -
t0;
955 RtRelation_E_y = std::abs(locR);
956 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe)+std::to_string(iside), RtRelation_E_x, RtRelation_E_y);
957 } else {
958 RtRelation_E_x =
LE -
t0;
959 RtRelation_E_y = std::abs(locR);
960 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe)+std::to_string(iside), RtRelation_E_x, RtRelation_E_y);
961 }
962 }
963 }
964 }
965
971
973
977
978 if (m_doExpert && m_doChips) {
979 HitTronTMapC_x = chip[ibe] - 1;
980 HitTronTMapC_y = trailingEdgeScaled;
981 fill(
"TRTTrackHistograms"+std::to_string(ibe)+std::to_string(iphi_module), HitTronTMapC_x, HitTronTMapC_y);
982 }
983
984 if (m_doExpert && m_doStraws) {
985 HitTronTwEPCMapS_x = thisStrawNumber[ibe];
986 HitTronTwEPCMapS_y = trailingEdgeScaled - timeCor;
987 fill(
"TRTTrackHistograms"+std::to_string(ibe)+std::to_string(iphi_module), HitTronTwEPCMapS_x, HitTronTwEPCMapS_y);
988 }
989
990 if (m_doExpert && m_doChips) {
991 HitTronTwEPCMapC_x = chip[ibe] - 1;
992 HitTronTwEPCMapC_y = trailingEdgeScaled - timeCor;
993 fill(
"TRTTrackHistograms"+std::to_string(ibe)+std::to_string(iphi_module), HitTronTwEPCMapC_x, HitTronTwEPCMapC_y);
994 }
995
996 if (m_doShift && m_doStraws) {
998 if (ibe == 0) {
999 if (isArgonStraw) {
1000 TronTDist_B_Ar = trailingEdgeScaled;
1001 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe), TronTDist_B_Ar);
1002 AvgTroTDetPhi_B_Ar_x = phi2D[ibe];
1003 AvgTroTDetPhi_B_Ar_y = trailingEdgeScaled;
1004 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe), AvgTroTDetPhi_B_Ar_x, AvgTroTDetPhi_B_Ar_y);
1005 } else {
1006 TronTDist_B = trailingEdgeScaled;
1007 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe), TronTDist_B);
1008 AvgTroTDetPhi_B_x = phi2D[ibe];
1009 AvgTroTDetPhi_B_y = trailingEdgeScaled;
1010 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe), AvgTroTDetPhi_B_x, AvgTroTDetPhi_B_y);
1011 }
1012 } else if (ibe == 1) {
1013 if (isArgonStraw) {
1014 TronTDist_E_Ar = trailingEdgeScaled;
1015 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe)+std::to_string(iside), TronTDist_E_Ar);
1016 AvgTroTDetPhi_E_Ar_x = phi2D[ibe];
1017 AvgTroTDetPhi_E_Ar_y = trailingEdgeScaled;
1018 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe)+std::to_string(iside), AvgTroTDetPhi_E_Ar_x, AvgTroTDetPhi_E_Ar_y);
1019 } else {
1020 TronTDist_E = trailingEdgeScaled;
1021 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe)+std::to_string(iside), TronTDist_E);
1022 AvgTroTDetPhi_E_x = phi2D[ibe];
1023 AvgTroTDetPhi_E_y = trailingEdgeScaled;
1024 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe)+std::to_string(iside), AvgTroTDetPhi_E_x, AvgTroTDetPhi_E_y);
1025 }
1026 }
1027 }
1028 }
1029 }
1030 }
1031 }
1032
1033
1034 for (int ibe = 0; ibe < 2; ibe++) {
1035 for (
int i = 0;
i < 64;
i++)
1036 if (trackfound[ibe][i])
1037 ntrackstack[ibe][
i]++;
1038
1039 if (m_doShift) {
1040 if (ibe == 0) {
1041 if (hitontrack[ibe] >= m_minTRThits) {
1042 NumHoTDetPhi_B_x = phi2D[ibe];
1043 NumHoTDetPhi_B_y = hitontrack[ibe];
1044 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe), NumHoTDetPhi_B_x, NumHoTDetPhi_B_y);
1045 }
1046 }
1047
1048 if (ibe == 1) {
1049 if (hitontrack_E_side[0] >= m_minTRThits) {
1050 NumHoTDetPhi_E_x = phi2D[ibe];
1051 NumHoTDetPhi_E_y = hitontrack_E_side[0];
1052 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe)+
"0", NumHoTDetPhi_E_x, NumHoTDetPhi_E_y);
1053 }
1054
1055 if (hitontrack_E_side[1] >= m_minTRThits) {
1056 NumHoTDetPhi_E_x = phi2D[ibe];
1057 NumHoTDetPhi_E_y = hitontrack_E_side[1];
1058 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe)+
"1", NumHoTDetPhi_E_x, NumHoTDetPhi_E_y);
1059 }
1060 }
1061 }
1062
1063 if (phi2D[ibe] < 0) continue;
1064
1065 if (m_doShift) {
1066 if (ibe == 0) {
1067 if (nTRTHitsW[ibe][0] + nTRTHitsW[ibe][1] > 0) {
1068 NumTrksDetPhi_B = phi2D[ibe];
1069 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe), NumTrksDetPhi_B);
1070 }
1071 } else if (ibe == 1) {
1072 if (nTRTHitsW[ibe][0] > 0) {
1073 NumTrksDetPhi_E = phi2D[ibe];
1074 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe)+
"0", NumTrksDetPhi_E);
1075 }
1076
1077 if (nTRTHitsW[ibe][1] > 0) {
1078 NumTrksDetPhi_E = phi2D[ibe];
1079 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe)+
"1", NumTrksDetPhi_E);
1080 }
1081 }
1082 }
1083
1084 if (ibe == 0) {
1085 if ((nTRTHitsW[ibe][0] + nTRTHitsW[ibe][1]) > 0) {
1086 nTrksperLB_B++;
1087 }
1088 if (comTimeObject) {
1089 if (m_doShift && (phi2D[ibe] > 0) && (std::abs(timeCor) > 1e-8)) {
1090 EvtPhaseDetPhi_B_x = phi2D[ibe];
1091 EvtPhaseDetPhi_B_y = timeCor;
1092 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe), EvtPhaseDetPhi_B_x, EvtPhaseDetPhi_B_y);
1093 }
1094 }
1095 } else if (ibe == 1) {
1096 for (int iside = 0; iside < 2; iside++) {
1097 if (nTRTHitsW[ibe][iside] > 0) nTrksperLB_E[iside]++;
1098 if (comTimeObject) {
1099 if (nTRTHits_side[ibe][iside] > 5 && (std::abs(timeCor)
1100 > 1e-8)) {
1101 if (m_doShift) {
1102 EvtPhaseDetPhi_E_x = phi2D[ibe];
1103 EvtPhaseDetPhi_E_y = timeCor;
1104 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe)+std::to_string(iside), EvtPhaseDetPhi_E_x, EvtPhaseDetPhi_E_y);
1105 }
1106 }
1107 }
1108 }
1109 }
1110 }
1111 }
1112
1113 if (comTimeObject) {
1114 static const std::string histoName{"ShiftTRTTrackHistograms0"};
1115 if (std::abs(timeCor) > 1e-8) {
1116 if (m_doShift) {
1117 EvtPhase = timeCor;
1118 fill(histoName, EvtPhase);
1119 }
1120
1121 if (m_doShift && trigDecision) {
1122 std::vector<int> trigid;
1123 trigid.clear();
1124
1125 std::vector<unsigned int> level1TAV = trigDecision->
tav();
1126
1127 for (
unsigned int j = 0;
j < 8 &&
j < level1TAV.size(); ++
j) {
1128 for (
unsigned int i = 0;
i < 32; ++
i) {
1129 if ((level1TAV[j] >> i) & 0x1) {
1130 trigid.push_back(i + (j % 8) * 32);
1131 }
1132 }
1133 }
1134
1135 for (
unsigned int j = 0;
j < trigid.size(); ++
j) {
1136 EvtPhaseVsTrig_x = timeCor;
1137 EvtPhaseVsTrig_y = trigid[
j];
1138 fill(histoName, EvtPhaseVsTrig_x, EvtPhaseVsTrig_y);
1139 }
1140 }
1141 }
1142 }
1143
1144 if (m_doShift) {
1146 SummaryWeight = 1.;
1147 fill(
"SmryHistograms", SummaryWeight, Summary);
1148
1149 if (m_doTracksMon) {
1151 SummaryWeight = nTotalTracks;
1152 fill(
"SmryHistograms", SummaryWeight, Summary);
1154 SummaryWeight = nTracksB[0];
1155 fill(
"SmryHistograms", SummaryWeight, Summary);
1157 SummaryWeight = nTracksB[1];
1158 fill(
"SmryHistograms", SummaryWeight, Summary);
1160 SummaryWeight = nTracksEC[0];
1161 fill(
"SmryHistograms", SummaryWeight, Summary);
1163 SummaryWeight = nTracksEC[1];
1164 fill(
"SmryHistograms", SummaryWeight, Summary);
1166 SummaryWeight = nTracksEC_B[0];
1167 fill(
"SmryHistograms", SummaryWeight, Summary);
1169 SummaryWeight = nTracksEC_B[1];
1170 fill(
"SmryHistograms", SummaryWeight, Summary);
1171 }
1172
1175 int lastLumiBlock = -99;
1176 if ((int)lumiBlock != lastLumiBlock) {
1178 }
1179 float evtLumiBlock = 1.;
1180 float lumiBlockScale = (evtLumiBlock > 0) ? (1. / evtLumiBlock) : 0;
1181
1182 if (m_doTracksMon && evtLumiBlock > 0) {
1183 NTrksperLB_x = lastLumiBlock;
1184 NTrksperLB_y = (
float)nTrksperLB_B * lumiBlockScale;
1185 fill(
"ShiftTRTTrackHistograms0", NTrksperLB_x, NTrksperLB_y);
1186
1187 for (int iside = 0; iside < 2; iside++) {
1188 NTrksperLB_x = lastLumiBlock;
1189 NTrksperLB_y = (
float)nTrksperLB_E[iside] * lumiBlockScale;
1190 fill(
"ShiftTRTTrackHistograms1"+std::to_string(iside), NTrksperLB_x, NTrksperLB_y);
1191 }
1192
1193 nTrksperLB_B = 0;
1194
1195 for (int iside = 0; iside < 2; iside++) {
1196 nTrksperLB_E[iside] = 0;
1197 }
1198 }
1199 }
1200
1202
1203
1204 return StatusCode::SUCCESS;
1205}
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)
float j(const xAOD::IParticle &, const xAOD::TrackMeasurementValidation &hit, const Eigen::Matrix3d &jab_inv)