12 #include "Identifier/Identifier.h"
57 m_lastTRTLumiBlock(-99),
63 p_toolSvc(
"IToolSvc",
name),
64 m_sumTool(
"TRT_StrawStatusSummaryTool", this),
65 m_DAQSvc(
"TRT_DAQ_ConditionsSvc",
name),
66 m_condSvc_BS(
"TRT_ByteStream_ConditionsSvc",
name),
67 m_TRTStrawNeighbourSvc(
"TRT_StrawNeighbourSvc",
name),
68 m_TRTCalDbTool(
"TRT_CalDbTool", this),
69 m_drifttool(
"TRT_DriftFunctionTool"),
70 m_pTRTHelper(nullptr),
80 m_EventPhaseScale(1.0),
83 m_DriftTimeonTrkDistScale_B(),
84 m_HLhitOnTrackScale_B(),
85 m_HtoLRatioOnTrackScale_B(),
86 m_HtoLRatioOnTrackScale_B_Ar(),
87 m_HtoLRatioOnTrackScale_B_Xe(),
88 m_NumSwLLWoTScale_B(),
89 m_WireToTrkPositionScale_B(),
90 m_WireToTrkPositionScale_B_Ar(),
93 m_ResidualScale_B_20GeV(),
94 m_TimeResidualScale_B(),
95 m_DriftTimeonTrkDistScale_B_Ar(),
96 m_TronTDistScale_B_Ar(),
97 m_ResidualScale_B_Ar(),
98 m_ResidualScale_B_Ar_20GeV(),
99 m_TimeResidualScale_B_Ar(),
100 m_DriftTimeonTrkDistScale_E(),
101 m_HLhitOnTrackScale_E(),
102 m_HtoLRatioOnTrackScale_E(),
103 m_HtoLRatioOnTrackScale_E_Ar(),
104 m_HtoLRatioOnTrackScale_E_Xe(),
105 m_NumSwLLWoTScale_E(),
106 m_WireToTrkPositionScale_E(),
107 m_WireToTrkPositionScale_E_Ar(),
108 m_TronTDistScale_E(),
110 m_ResidualScale_E_20GeV(),
111 m_TimeResidualScale_E(),
112 m_DriftTimeonTrkDistScale_E_Ar(),
113 m_ResidualScale_E_Ar(),
114 m_ResidualScale_E_Ar_20GeV(),
115 m_TimeResidualScale_E_Ar(),
118 m_EventBurstCut(200),
119 m_lumiBlocksToResetOcc(20),
128 m_min_tracks_straw(10)
208 for (
int iside = 0; iside < 2; iside++) {
214 for (
int ibe = 0; ibe < 2; ibe++) {
221 for (
int iside = 0; iside < 2; iside++) {
232 for (
int i = 0;
i < 64;
i++) {
329 for (
int iside = 0; iside < 2; iside++) {
469 for (
int ibe = 0; ibe < 2; ibe++) {
471 IdentifierHash idHash =
index;
483 idSide = idBarrelEndcap ? 1 : -1;
485 if (
isBarrel && (idBarrelEndcap == -1)) {
489 }
else if (ibe == 1) {
490 idSide = idBarrelEndcap ? 1 : 0;
492 if (!
isBarrel && ((idBarrelEndcap == -2) || (idBarrelEndcap == 2))) {
498 if (sectorflag == 1) {
499 if (!element)
continue;
501 for (
unsigned int istraw = 0; istraw < element->
nStraws(); istraw++) {
502 std::vector<Identifier> neighbourIDs;
509 if (idLayerWheel == 1) i_chip += 21;
511 if (idLayerWheel == 2) i_chip += 54;
513 int tempStrawNumber =
strawNumber(istraw, idStrawLayer, idLayerWheel);
515 if (tempStrawNumber < 0 || tempStrawNumber > (
s_Straw_max[ibe] - 1)) {
516 ATH_MSG_WARNING(
"Found tempStrawNumber = " << tempStrawNumber <<
" out of range.");
519 m_mat_chip_B[idPhiModule + 32][tempStrawNumber] = i_chip;
521 }
else if (ibe == 1) {
524 int tempStrawNumber =
strawNumberEndCap(istraw, idStrawLayer, idLayerWheel, idPhiModule, idSide);
526 if (tempStrawNumber < 0 || tempStrawNumber > (
s_Straw_max[ibe] - 1)) {
527 ATH_MSG_WARNING(
"Found tempStrawNumber = " << tempStrawNumber <<
" out of range.");
530 m_mat_chip_E[idPhiModule + 32][tempStrawNumber] = i_chip;
545 for (
int iStack = 0; iStack <
s_iStack_max[ibe]; iStack++) {
560 for (
int iStack = 0; iStack <
s_iStack_max[ibe]; iStack++) {
585 return StatusCode::SUCCESS;
611 if (!trackCollection.
isValid()) {
630 if (
sc == StatusCode::FAILURE) {
639 if (
sc == StatusCode::FAILURE) {
648 if (
sc == StatusCode::FAILURE) {
652 return StatusCode::SUCCESS;
666 std::string hName, hTitle;
667 const std::string barrel_or_endcap[2] = {
"Barrel",
"EndCap" };
668 const std::string be_id[2] = {
"B",
"E" };
669 const std::string side_id[2] = {
"A",
"C" };
673 for (
int ibe = 0; ibe < 2; ibe++) {
675 std::ostringstream oss;
679 oss <<
"TRT/Barrel/Stack" <<
i + 1 <<
"A";
681 oss <<
"TRT/Barrel/Stack" <<
i + 1 - 32 <<
"C";
683 }
else if (ibe == 1) {
685 oss <<
"TRT/EndcapA/Sector" <<
i + 1;
687 oss <<
"TRT/EndcapC/Sector" <<
i + 1 - 32;
691 const std::string hPath = oss.str();
692 MonGroup rdoStackWeighted(
this, hPath,
run, ManagedMonitorToolBase::MgmtAttr_t::ATTRIB_UNMANAGED,
"",
"weightedEff");
696 m_hHitTrWMapS[ibe][
i] =
bookTProfile_LW(rdoStackWeighted,
"hHitTrWMapS",
"Mean Trailing Edge in Time Window: Straws",
s_Straw_max[ibe], 0,
s_Straw_max[ibe], 0, 75,
"Straw Number in Stack",
"Time (ns)", scode);
697 m_hHitTrMapS[ibe][
i] =
bookTProfile_LW(rdoStackWeighted,
"hHitTrMapS",
"Mean Trailing Edge: Straws",
s_Straw_max[ibe], 0,
s_Straw_max[ibe], 0, 75,
"Straw Number in Stack",
"Time (ns)", scode);
700 m_hStrawOcc[ibe][
i] =
bookTH1F_LW(rdoStackWeighted,
"hOccupancyS",
"Straw Occupancy Distribution: Straws", 201, 0, 1.005,
"Occupancy",
"Number of Straws", scode);
701 m_hHitToTMapS[ibe][
i] =
bookTProfile_LW(rdoStackWeighted,
"hHitToTMapS",
"Mean ToT: Straws",
s_Straw_max[ibe], 0,
s_Straw_max[ibe], 0, 75,
"Straw Number in Stack",
"Time (ns)", scode);
702 m_hHitToTLongMapS[ibe][
i] =
bookTProfile_LW(rdoStackWeighted,
"hHitToTLongMapS",
"Mean ToT for Straws with ToT > LongToTCut: Straws",
s_Straw_max[ibe], 0,
s_Straw_max[ibe], 0, 75,
"Straw Number in Stack",
"Time (ns)", scode);
703 m_hHitToTLongTrMapS[ibe][
i] =
bookTProfile_LW(rdoStackWeighted,
"hHitToTLongTrMapS",
"Mean Trailing Edge for Straws with ToT > LongToTCut: Straws",
s_Straw_max[ibe], 0,
s_Straw_max[ibe], 0, 75,
"Straw Number in Stack",
"Time (ns)", scode);
711 m_hHitTrMapC[ibe][
i] =
bookTProfile_LW(rdoStackWeighted,
"hHitTrMapC",
"Mean Trailing Edge: Chips",
s_iChip_max[ibe], 0,
s_iChip_max[ibe], 0, 75,
"Chip Number in Stack",
"Time (ns)", scode);
712 m_hHitTrWMapC[ibe][
i] =
bookTProfile_LW(rdoStackWeighted,
"hHitTrWMapC",
"Mean Trailing Edge in Time Window: Chips",
s_iChip_max[ibe], 0,
s_iChip_max[ibe], 0, 75,
"Chip Number in Stack",
"Time (ns)", scode);
715 m_hChipOcc[ibe][
i] =
bookTH1F_LW(rdoStackWeighted,
"hOccupancyC",
"Chip Occupancy Distribution", 201, 0, 1.005,
"Occupancy",
"Number of Chips", scode);
716 m_hHitToTMapC[ibe][
i] =
bookTProfile_LW(rdoStackWeighted,
"hHitToTMapC",
"Mean ToT: Chips",
s_iChip_max[ibe], 0,
s_iChip_max[ibe], 0, 75,
"Chip Number in Stack",
"Time (ns)", scode);
720 m_hHtoBCMapC[ibe][
i] =
bookTH2F_LW(rdoStackWeighted,
"hHtoBCMapC",
"HL in BC: Chips", 3, 0, 3,
s_iChip_max[ibe], 0,
s_iChip_max[ibe],
"Bunch Crossing ID",
"Chip Number in Stack", scode);
723 m_hHtoBCMapB[ibe][
i] =
bookTH2F_LW(rdoStackWeighted,
"hHtoBCMapB",
"HL in BC: Boards", 3, 0, 3, 9, 0, 9,
"Bunch Crossing ID",
"Board Number in Stack", scode);
724 }
else if (ibe == 1) {
725 m_hHtoBCMapB[ibe][
i] =
bookTH2F_LW(rdoStackWeighted,
"hHtoBCMapB",
"HL in BC: Boards", 3, 0, 3, 20, -0.5, 19.5,
"Bunch Crossing ID",
"Board Number in Stack", scode);
733 MonGroup rdoShiftSmry (
this,
"TRT/Shift/Summary",
run, ManagedMonitorToolBase::MgmtAttr_t::ATTRIB_UNMANAGED);
734 MonGroup rdoShiftSmryRebinned (
this,
"TRT/Shift/Summary",
run, ManagedMonitorToolBase::MgmtAttr_t::ATTRIB_UNMANAGED,
"",
"mergeRebinned");
747 m_IntLum =
bookTH1F_LW(rdoShiftSmry,
"hIntLum",
"Luminosity", 1, 0., 1.,
" ",
"Luminosity [#mub^{1}]", scode);
748 m_LBvsLum =
bookTH1F_LW(rdoShiftSmry,
"hLBvsLum",
"Luminosity", 2000, 0., 2000.,
"Luminosity Bin",
"Luminosity [#mub^{1}]", scode);
749 m_LBvsTime =
bookTH1F_LW(rdoShiftSmry,
"hLBvsTime",
"Time", 2000, 0., 2000.,
" Luminosity Bin",
"Time [s]", scode);
750 const unsigned int maxLumiBlock = 200;
754 for (
int ibe = 0; ibe < 2; ibe++) {
755 for (
int iside = 0; iside < 2; iside++) {
756 const std::string regionTag =
" (" + be_id[ibe] + side_id[iside] +
")";
757 m_hChipBSErrorsVsLB[ibe][iside] =
bookTProfile(rdoShiftSmryRebinned,
"hChipBSErrorsVsLB_" + be_id[ibe] + side_id[iside],
"Chip Bytestream Errors vs LB" + regionTag, maxLumiBlock + 1, -0.5, maxLumiBlock + 0.5, 0, 150.0,
"Luminosity Block",
"Fraction of Chips with Errors", scode);
759 m_hRobBSErrorsVsLB[ibe][iside] =
bookTProfile(rdoShiftSmryRebinned,
"hRobBSErrorsVsLB_" + be_id[ibe] + side_id[iside],
"Rob Bytestream Errors vs LB" + regionTag, maxLumiBlock + 1, -0.5, maxLumiBlock + 0.5, 0, 150.0,
"Luminosity Block",
"Fraction of RODs with Errors", scode);
765 const std::string module_or_wheel[2] = {
"Module",
"Wheel" };
766 const std::string stack_or_sector[2] = {
"Barrel Stack",
"Endcap Sector" };
767 const std::string modulenum_assign2[2] = {
"Modules Type 1 (1-32), Type 2 (33-64), Type 3 (65-96)",
"Wheels A (1-32), B (33-64)" };
769 for (
int ibe = 0; ibe < 2; ibe++) {
770 const std::string regionTag =
" (" + barrel_or_endcap[ibe] +
")";
771 MonGroup rdo(
this,
"TRT/" + barrel_or_endcap[ibe] +
"/Expert",
run, ManagedMonitorToolBase::MgmtAttr_t::ATTRIB_UNMANAGED);
772 MonGroup rdoShift (
this,
"TRT/Shift/" + barrel_or_endcap[ibe],
run, ManagedMonitorToolBase::MgmtAttr_t::ATTRIB_UNMANAGED);
773 MonGroup rdoShiftTH1(
this,
"TRT/Shift/" + barrel_or_endcap[ibe],
run, ManagedMonitorToolBase::MgmtAttr_t::ATTRIB_UNMANAGED,
"",
"weightedEff");
782 m_hOccAll =
bookTH1F_LW(rdoShift,
"hOccAll",
"Occupancy per Event", 400, 0.0, 1.0,
"Occupancy",
"Events", scode);
783 }
else if (ibe == 1) {
793 m_hBCIDvsOcc[ibe] =
bookTProfile_LW(rdo,
"hBCIDvsOcc",
"Avg. Occupancy vs BCID" + regionTag, 3565, 0, 3564, 0, 1,
"Bunch Crossing ID",
"Occupancy", scode);
795 for (
int iside = 0; iside < 2; iside++) {
796 const std::string regionTag =
" (" + be_id[ibe] + side_id[iside] +
")";
798 m_hAvgHLOcc_side[ibe][iside] =
bookTProfile_LW(rdoShift,
"hAvgHLOcc_" + regionMarker,
"Avg. HL Occupancy" + regionTag, 32, 1, 33, 0, 1, stack_or_sector[ibe],
"Occupancy", scode);
799 m_hAvgLLOcc_side[ibe][iside] =
bookTProfile_LW(rdoShift,
"hAvgLLOcc_" + regionMarker,
"Avg. LL Occupancy" + regionTag, 32, 1, 33, 0, 1, stack_or_sector[ibe],
"Occupancy", scode);
800 m_hAvgLLOccMod_side[ibe][iside] =
bookTProfile_LW(rdo,
"hAvgLLOccMod_" + regionMarker,
"Avg. LL Occupancy: " + module_or_wheel[ibe] +
"s" + regionTag,
s_moduleNum[ibe], 0,
s_moduleNum[ibe], 0, 1, modulenum_assign2[ibe],
"Occupancy", scode);
801 m_hAvgHLOccMod_side[ibe][iside] =
bookTProfile_LW(rdo,
"hAvgHLOccMod_" + regionMarker,
"Avg. HL Occupancy: " + module_or_wheel[ibe] +
"s" + regionTag,
s_moduleNum[ibe], 0,
s_moduleNum[ibe], 0, 1, modulenum_assign2[ibe],
"Occupancy", scode);
822 std::string hName, hTitle;
823 const std::string barrel_or_endcap[2] = {
"Barrel",
"EndCap" };
825 for (
int ibe = 0; ibe < 2; ibe++) {
826 std::ostringstream oss_distance;
827 oss_distance << std::setprecision(3) << std::fixed <<
m_DistToStraw;
828 const std::string
distance = oss_distance.str();
829 const std::string hPathGen =
"TRT/" + barrel_or_endcap[ibe] +
"/Expert";
830 const std::string regionTag =
" (" + barrel_or_endcap[ibe] +
")";
833 std::ostringstream oss;
837 oss <<
"TRT/Barrel/Stack" <<
i + 1 <<
"A";
839 oss <<
"TRT/Barrel/Stack" <<
i + 1 - 32 <<
"C";
841 }
else if (ibe == 1) {
843 oss <<
"TRT/EndcapA/Sector" <<
i + 1;
845 oss <<
"TRT/EndcapC/Sector" <<
i + 1 - 32;
849 const std::string hPath = oss.str();
850 MonGroup trackStackWeighted(
this, hPath,
run, ManagedMonitorToolBase::MgmtAttr_t::ATTRIB_UNMANAGED,
"",
"weightedEff");
854 m_hHitTronTMapS[ibe][
i] =
bookTProfile_LW(trackStackWeighted,
"hHitTronTMapS",
"Mean Trailing Edge on Track: Straws",
s_Straw_max[ibe], 0,
s_Straw_max[ibe], 0, 75.0,
"Straw Number in Stack",
"Time (ns)", scode);
856 m_hStrawsEff[ibe][
i] =
bookTProfile_LW(trackStackWeighted,
"hEfficiencyS",
"Straw Efficiency with " +
distance +
" mm Cut",
s_Straw_max[ibe], 0,
s_Straw_max[ibe], 0.0, 1.0,
"Straw Number in Stack",
"Efficiency", scode);
861 m_hHitToTonTMapS[ibe][
i] =
bookTProfile_LW(trackStackWeighted,
"hHitToTonTMapS",
"Mean ToT on Track: Straws",
s_Straw_max[ibe], 0,
s_Straw_max[ibe], 0, 75,
"Straw Number in Stack",
"Time (ns)", scode);
862 m_hValidRawDriftTimeonTrk[ibe][
i] =
bookTProfile_LW(trackStackWeighted,
"hValidRawDriftTimeonTrkS",
"Valid Raw Drift Time on Track: Straws",
s_Straw_max[ibe], 0,
s_Straw_max[ibe], 0, 75,
"Straw Number in Stack",
"Time (ns)", scode);
865 m_hHitTronTwEPCMapS[ibe][
i] =
bookTProfile_LW(trackStackWeighted,
"hHitTronTwEPCMapS",
"Mean Trailing Edge on Track (with Event Phase Correction): Straws",
s_Straw_max[ibe], 0,
s_Straw_max[ibe], -50, 75,
"Straw Number in Stack",
"Time (ns)", scode);
871 m_hHitTronTMapC[ibe][
i] =
bookTProfile_LW(trackStackWeighted,
"hHitTronTMapC",
"Mean Trailing Edge on Track: Chips",
s_iChip_max[ibe], 0,
s_iChip_max[ibe], 0, 75,
"Chip Number in Stack",
"Time (ns)", scode);
873 m_hChipsEff[ibe][
i] =
bookTProfile_LW(trackStackWeighted,
"hEfficiencyC",
"Chip Efficiency with " +
distance +
" mm Cut",
s_iChip_max[ibe], 0,
s_iChip_max[ibe], 0.0, 1.0,
"Chip Number in Stack",
"Efficiency", scode);
877 m_hHitToTonTMapC[ibe][
i] =
bookTProfile_LW(trackStackWeighted,
"hHitToTonTMapC",
"Mean ToT on Track: Chips",
s_iChip_max[ibe], 0,
s_iChip_max[ibe], 0, 75,
"Chip Number in Stack",
"Time (ns)", scode);
878 m_hValidRawDriftTimeonTrkC[ibe][
i] =
bookTProfile_LW(trackStackWeighted,
"hValidRawDriftTimeonTrkC",
"Valid Raw Drift Time on Track: Chips",
s_iChip_max[ibe], 0,
s_iChip_max[ibe], 0, 75,
"Chip Number in Stack",
"Time (ns)", scode);
881 m_hHitTronTwEPCMapC[ibe][
i] =
bookTProfile_LW(trackStackWeighted,
"hHitTronTwEPCMapC",
"Mean Trailing Edge on Track (with Event Phase Correction): Chips",
s_iChip_max[ibe], 0,
s_iChip_max[ibe], -50, 75,
"Chip Number in Stack",
"Time (ns)", scode);
900 std::string hName, hTitle;
901 const std::string barrel_or_endcap[2] = {
"Barrel",
"EndCap" };
902 const std::string be_id[2] = {
"B",
"E" };
903 const std::string side_id[2] = {
"A",
"C" };
904 MonGroup trackShiftEff(
this,
"TRT/Efficiency",
run, ManagedMonitorToolBase::MgmtAttr_t::ATTRIB_UNMANAGED);
905 m_hefficiency_eta =
bookTProfile_LW(trackShiftEff,
"hEfficiency_eta",
"Efficiency vs #eta", 50, -2.8, 2.8, 0, 1,
"#eta",
"Efficiency", scode);
906 m_hefficiency_phi =
bookTProfile_LW(trackShiftEff,
"hEfficiency_phi",
"Efficiency vs #phi", 50, -3.2, 3.2, 0, 1,
"#phi (deg)",
"Efficiency", scode);
907 m_hefficiency_pt =
bookTProfile_LW(trackShiftEff,
"hEfficiency_pt",
"Efficiency vs pT", 50, 0, 10, 0, 1,
"pT (GeV)",
"Efficiency", scode);
908 m_hefficiency_z0 =
bookTProfile_LW(trackShiftEff,
"hEfficiency_z0",
"Efficiency vs z0", 50, -200, 200, 0, 1,
"z0",
"Efficiency", scode);
909 m_hefficiencyBarrel_locR =
bookTProfile_LW(trackShiftEff,
"hEfficiencyBarrel_locR",
"Efficiency vs Track-to-Wire Distance for Xenon Straws" " (Barrel)", 50, -2.5, 2.5, 0, 1,
"Track-to-Wire Distance (mm)",
"Efficiency", scode);
910 m_hefficiencyBarrel_locR_Ar =
bookTProfile_LW(trackShiftEff,
"hEfficiencyBarrel_locR_Ar",
"Efficiency vs Track-to-Wire Distance for Argon Straws" " (Barrel)", 50, -2.5, 2.5, 0, 1,
"Track-to-Wire Distance (mm)",
"Efficiency", scode);
911 m_hefficiencyMap[0] =
bookTProfile_LW(trackShiftEff,
"hEfficiencyBarrelMap",
"Straw Efficiency Map" " (Barrel)",
s_Straw_max[0], 0,
s_Straw_max[0], 0, 1,
"Straw Number",
"Efficiency", scode);
912 m_hefficiencyMap[1] =
bookTProfile_LW(trackShiftEff,
"hEfficiencyEndCapMap",
"Straw Efficiency Map" " (Endcap)",
s_Straw_max[1], 0,
s_Straw_max[1], 0, 1,
"Straw Number",
"Efficiency", scode);
914 for (
int iside = 0; iside < 2; iside++) {
915 const std::string regionTag =
" (" + be_id[1] + side_id[iside] +
")";
916 m_hefficiencyEndCap_locR[iside] =
bookTProfile_LW(trackShiftEff,
"hEfficiencyEndCap" + side_id[iside] +
"_locR",
"Efficiency vs Track-to-Wire Distance for Xenon Straws" + regionTag, 50, -2.5, 2.5, 0, 1,
"Track-to-Wire Distance (mm)",
"Efficiency", scode);
917 m_hefficiencyEndCap_locR_Ar[iside] =
bookTProfile_LW(trackShiftEff,
"hEfficiencyEndCap" + side_id[iside] +
"_locR_Ar",
"Efficiency vs Track-to-Wire Distance for Argon Straws" + regionTag, 50, -2.5, 2.5, 0, 1,
"Track-to-Wire Distance (mm)",
"Efficiency", scode);
920 for (
int ibe = 0; ibe < 2; ibe++) {
921 for (
int iside = 0; iside < 2; iside++) {
922 const std::string regionTag =
" (" + be_id[ibe] + side_id[iside] +
")";
923 MonGroup trackShiftEffWeighted(
this,
"TRT/Efficiency",
run, ManagedMonitorToolBase::MgmtAttr_t::ATTRIB_UNMANAGED,
"",
"weightedEff");
924 m_hefficiency[ibe][iside] =
bookTH1F_LW(trackShiftEffWeighted,
"hEfficiency" + barrel_or_endcap[ibe] + side_id[iside],
"Straw Efficiency" + regionTag, 500, -0.01, 1.01,
"Efficiency",
"Number of Straws", scode);
925 m_hefficiencyIntegral[ibe][iside] =
bookTH1F_LW(trackShiftEffWeighted,
"hEfficiencyIntegral" + barrel_or_endcap[ibe] + side_id[iside],
"Straw Efficiency Integral" + regionTag, 500, -0.01, 1.01,
"Efficiency",
"Fraction of Straws", scode);
931 for (
int i = imintmp;
i < imaxtmp;
i++) {
932 std::ostringstream oss;
935 oss <<
"TRT/Barrel/Stack" << (
i + 1 - 32 * iside) << side_id[iside];
936 }
else if (ibe == 1) {
937 oss <<
"TRT/Endcap" << side_id[iside] <<
"/Sector" << (
i + 1 - 32 * iside);
940 const std::string hPath = oss.str();
941 MonGroup trackStack(
this, hPath,
run, ManagedMonitorToolBase::MgmtAttr_t::ATTRIB_UNMANAGED);
942 m_hefficiencyS[ibe][
i] =
bookTProfile_LW(trackStack,
"hHitEfficiencyS",
"Straw Efficiency Map",
s_Straw_max[ibe], 0.5,
s_Straw_max[ibe] + 0.5, 0, 1,
"Straw Number",
"Efficiency", scode);
943 m_hefficiencyC[ibe][
i] =
bookTProfile_LW(trackStack,
"hHitEfficiencyC",
"Chip Efficiency Map",
s_iChip_max[ibe], 0.5,
s_iChip_max[ibe] + 0.5, 0, 1,
"Chip Number",
"Efficiency", scode);
962 std::string hName, hTitle;
963 std::ostringstream oss_distance;
964 oss_distance << std::setprecision(3) << std::fixed <<
m_DistToStraw;
965 const std::string
distance = oss_distance.str();
968 MonGroup trackBarrelShiftTProf(
this,
"TRT/Shift/Barrel",
run, ManagedMonitorToolBase::MgmtAttr_t::ATTRIB_UNMANAGED);
969 MonGroup trackBarrelDiag(
this,
"TRT/Barrel/Diagnostics",
run, ManagedMonitorToolBase::MgmtAttr_t::ATTRIB_UNMANAGED);
970 const std::string barrel_or_endcap[2] = {
"Barrel",
"EndCap" };
971 const std::string be_id[2] = {
"B",
"E" };
972 const std::string side_id[2] = {
"A",
"C" };
973 const int maxLumiblock = 720;
975 const std::string gas[4] = {
"in_A",
"in_B",
"out_A",
"out_B"};
976 const std::string Mod[5] = {
"1",
"2",
"3",
"shortP",
"shortN"};
978 for (
int ibe = 0; ibe < 2; ibe++) {
979 const std::string regionTag =
" (" + barrel_or_endcap[ibe] +
")";
980 MonGroup trackShift(
this,
"TRT/Shift/" + barrel_or_endcap[ibe],
run, ManagedMonitorToolBase::MgmtAttr_t::ATTRIB_UNMANAGED);
981 MonGroup trackShiftRebinned(
this,
"TRT/Shift/" + barrel_or_endcap[ibe],
run, ManagedMonitorToolBase::MgmtAttr_t::ATTRIB_UNMANAGED,
"",
"mergeRebinned");
982 MonGroup trackShiftTH1(
this,
"TRT/Shift/" + barrel_or_endcap[ibe],
run, ManagedMonitorToolBase::MgmtAttr_t::ATTRIB_UNMANAGED,
"",
"weightedEff");
983 MonGroup trackShiftTH1_lowStat(
this,
"TRT/Shift/" + barrel_or_endcap[ibe],
lowStat, ManagedMonitorToolBase::MgmtAttr_t::ATTRIB_UNMANAGED,
"",
"weightedEff");
984 MonGroup trackAging(
this,
"TRT/Aging/" + barrel_or_endcap[ibe],
lowStat, ManagedMonitorToolBase::MgmtAttr_t::ATTRIB_UNMANAGED);
988 m_hEvtPhase =
bookTH1F_LW(trackShift,
"hEvtPhase",
"Event Phase Correction Factor", 200, -50, 50,
"Event Phase (ns)",
"Entries", scode);
989 m_hEvtPhaseVsTrig =
bookTH2F_LW(trackShift,
"hEvtPhaseVsTrig",
"Event Phase vs L1 Trigger Item", 300, -200, 100, 256, -0.5, 255.5,
"Event Phase (ns)",
"L1 Trigger Item", scode);
990 m_hEvtPhaseDetPhi_B =
bookTProfile_LW(trackShift,
"hEvtPhaseDetPhi",
"Event Phase vs #phi (2D)" + regionTag,
m_nphi_bins, 0, 360, -50, 100.,
"#phi (deg)",
"Event Phase from Tracks per Event", scode);
991 m_hrtRelation_B =
bookTH2F_LW(trackShift,
"hrtRelation",
"R(t) Relation for Xenon Straws" + regionTag, 30, -12.5, 81.25, 50, 0, 2.5,
"Measured Leading Edge (ns)",
"Track-to-Wire Distance (mm)", scode);
992 m_hNumHoTDetPhi_B =
bookTProfile_LW(trackShift,
"hNumHoTDetPhi",
"Number of Hits per Track with " +
distance +
" mm Cut vs #phi" + regionTag,
m_nphi_bins, 0., 360, 0, 150,
"#phi (deg)", Form(
"Hits per Track, TRT Hits >= %d",
m_minTRThits), scode);
993 m_hTronTDist_B =
bookTH1F_LW(trackShiftTH1,
"hTronTDist",
"Trailing Edge Distribution on Track for Xenon Straws" + regionTag, 26, -0.5, 80.75,
"Trailing Edge (ns)",
"Norm. Entries", scode);
994 m_hDriftTimeonTrkDist_B =
bookTH1F_LW(trackShiftTH1,
"hDriftTimeonTrkDist",
"Drift Time Distribution on Track for Xenon Straws" + regionTag, 32, 0, 100.,
"Drift Time (ns)",
"Norm. Entries", scode);
995 m_hNumTrksDetPhi_B =
bookTH1F_LW(trackShift,
"hNumTrksDetPhi",
"Number of Reconstructed Tracks vs #phi (2D)" + regionTag, 60, 0, 360,
"#phi (deg)",
"Number of Tracks", scode);
998 m_hDriftTimeonTrkDist_B_Ar =
bookTH1F_LW(trackShiftTH1,
"hDriftTimeonTrkDist_Ar",
"Drift Time Distribution on Track for Argon Straws" + regionTag, 32, 0, 100.,
"Drift Time (ns)",
"Norm. Entries", scode);
999 m_hTronTDist_B_Ar =
bookTH1F_LW(trackShiftTH1,
"hTronTDist_Ar",
"Trailing Edge Distribution on Track for Argon Straws" + regionTag, 26, -0.5, 80.75,
"Trailing Edge (ns)",
"Norm. Entries", scode);
1000 m_hrtRelation_B_Ar =
bookTH2F_LW(trackShift,
"hrtRelation_Ar",
"R(t) Relation for Argon Straws" + regionTag, 30, -12.5, 81.25, 50, 0, 2.5,
"Measured Leading Edge (ns)",
"Track-to-Wire Distance (mm)", scode);
1001 m_Pull_Biased_Barrel =
bookTH1F_LW(trackShift,
"hPull_Biased_Barrel",
"Biased Track Pulls for Barrel Hits", 200, -2.5, 2.5,
"Pulls",
"Entries", scode);
1002 m_hResidual_B_Ar =
bookTH1F_LW(trackShiftTH1_lowStat,
"hResidual_Ar",
"Residuals for Argon Straws" + regionTag, 200, -2.5, 2.5,
"Hit-to-Track Distance (mm)",
"Norm. Entries", scode);
1003 m_hResidual_B_Ar_20GeV =
bookTH1F_LW(trackShiftTH1,
"hResidual_Ar_20GeV",
"Residuals for Argon Straws" + regionTag +
"(After 20GeV pT cut)", 200, -2.5, 2.5,
"Hit-to-Track Distance (mm)",
"Norm. Entries", scode);
1004 m_hAvgTroTDetPhi_B_Ar =
bookTProfile_LW(trackShift,
"hAvgTroTDetPhi_Ar",
"Avg. Trailing Edge on Track vs #phi (2D) for Argon" + regionTag,
m_nphi_bins, 0, 360, 0, 75.,
"#phi (deg)",
"Trailing Edge (ns)", scode);
1005 m_hTimeResidual_B_Ar =
bookTH1F_LW(trackShiftTH1,
"hTimeResidual_Ar",
"Time Residuals for Argon Straws" + regionTag, 200, -20, 20,
"Time Residual (ns)",
"Norm. Entries", scode);
1006 m_hWireToTrkPosition_B_Ar =
bookTH1F_LW(trackShiftTH1,
"hWireToTrkPosition_Ar",
"Track-to-Wire Distance for Argon" + regionTag, 100, -5., 5,
"Track-to-Wire Distance (mm)",
"Norm. Entries", scode);
1007 m_hHtoLRatioOnTrack_B_Ar =
bookTH1F_LW(trackShiftTH1,
"hHtoLRatioOnTrack_Ar",
"HL/LL Ratio per Reconstructed Track for Argon" + regionTag, 50, 0, 1,
"HL/LL Ratio",
"Norm. Entries", scode);
1010 m_hHtoLRatioOnTrack_B_Xe =
bookTH1F_LW(trackShiftTH1,
"hHtoLRatioOnTrack_Xe",
"HL/LL Ratio per Reconstructed Track for Xenon" + regionTag, 50, 0, 1,
"HL/LL Ratio",
"Norm. Entries", scode);
1011 m_hResidual_B =
bookTH1F_LW(trackShiftTH1_lowStat,
"hResidual",
"Residuals for Xenon Straws" + regionTag, 200, -2.5, 2.5,
"Hit-to-Track Distance (mm)",
"Norm. Entries", scode);
1012 m_hResidual_B_20GeV =
bookTH1F_LW(trackShiftTH1,
"hResidual_20GeV",
"Residuals for Xenon Straws" + regionTag +
"(After 20GeV pT cut)", 200, -2.5, 2.5,
"Hit-to-Track Distance (mm)",
"Norm. Entries", scode);
1013 m_hTimeResidual_B =
bookTH1F_LW(trackShiftTH1,
"hTimeResidual",
"Time Residuals for Xenon Straws" + regionTag, 200, -20, 20,
"Time Residual (ns)",
"Norm. Entries", scode);
1014 m_hWireToTrkPosition_B =
bookTH1F_LW(trackShiftTH1,
"hWireToTrkPosition",
"Track-to-Wire Distance for Xenon" + regionTag, 100, -5., 5,
"Track-to-Wire Distance (mm)",
"Norm. Entries", scode);
1015 m_hNumSwLLWoT_B =
bookTH1F_LW(trackShiftTH1,
"hNumSwLLWoT",
"Number of Straws with Hits on Track in Time Window" + regionTag, 150, 0, 150,
"Number of LL Hits per Track",
"Norm. Entries", scode);
1016 m_hAvgTroTDetPhi_B =
bookTProfile_LW(trackShift,
"hAvgTroTDetPhi",
"Avg. Trailing Edge on Track vs #phi (2D) for Xenon" + regionTag,
m_nphi_bins, 0, 360, 0, 75.,
"#phi (deg)",
"Trailing Edge (ns)", scode);
1017 m_hNTrksperLB_B =
bookTProfile(trackShiftRebinned,
"hNTrksperLB",
"Avg. Number of Reconstructed Tracks per Event" + regionTag, maxLumiblock, -0.5, maxLumiblock - 0.5, 0, 150.0,
"Luminosity Block",
"Number of Tracks", scode);
1019 m_hNHitsperLB_B =
bookTProfile(trackShiftRebinned,
"hNHitsperLB",
"Avg. Occupancy" + regionTag, maxLumiblock, -0.5, maxLumiblock - 0.5, 0, 150.0,
"Luminosity Block",
"Occupancy", scode);
1021 m_hNHLHitsperLB_B =
bookTProfile(trackShiftRebinned,
"hNHLHitsperLB",
"Avg. HL Occupancy" + regionTag, maxLumiblock, -0.5, maxLumiblock - 0.5, 0, 150.0,
"Luminosity Block",
"Occupancy", scode);
1023 m_hHLhitOnTrack_B =
bookTH1F_LW(trackShiftTH1,
"hHLhitOnTrack",
"Number of HL Hits per Reconstructed Track" + regionTag, 50, 0, 50,
"Number of HL Hits per Track",
"Norm. Entries", scode);
1024 m_hHtoLRatioOnTrack_B =
bookTH1F_LW(trackShiftTH1,
"hHtoLRatioOnTrack",
"HL/LL Ratio per Reconstructed Track for All" + regionTag, 50, 0, 1,
"HL/LL Ratio",
"Norm. Entries", scode);
1026 m_hStrawEffDetPhi_B =
bookTProfile_LW(trackShift,
"hStrawEffDetPhi",
"Straw Efficiency on Track with " +
distance +
" mm Cut vs #phi(2D)" + regionTag, 32, 0, 32, 0, 1.2,
"Stack",
"Avg. Straw Efficiency", scode);
1027 }
else if (ibe == 1) {
1028 m_Pull_Biased_EndCap =
bookTH1F_LW(trackShift,
"hPull_Biased_EndCap",
"Biased Track Pulls for EndCap Hits", 200, -2.5, 2.5,
"Pulls",
"Entries", scode);
1030 for (
int iside = 0; iside < 2; iside++) {
1031 const std::string regionTag =
" (" + be_id[ibe] + side_id[iside] +
")";
1032 m_hEvtPhaseDetPhi_E[iside] =
bookTProfile_LW(trackShift,
"hEvtPhaseDetPhi_" + side_id[iside],
"Event Phase vs #phi (2D)" + regionTag,
m_nphi_bins, 0, 360, -50, 100,
"#phi (deg)",
"Event Phase from Tracks per Event", scode);
1033 m_hrtRelation_E[iside] =
bookTH2F_LW(trackShift,
"hrtRelation_" + side_id[iside],
"R(t) Relation for Xenon Straws" + regionTag, 30, -12.5, 81.25, 50, 0, 2.5,
"Measured Leading Edge (ns)",
"Track-to-Wire Distance (mm)", scode);
1034 m_hNumHoTDetPhi_E[iside] =
bookTProfile_LW(trackShift,
"hNumHoTDetPhi_" + side_id[iside],
"Number of Hits per Track with " +
distance +
" mm Cut vs #phi" + regionTag,
m_nphi_bins, 0., 360, 0, 150,
"#phi (deg)", Form(
"Hits per Track, TRT Hits> = %d",
m_minTRThits), scode);
1035 m_hTronTDist_E[iside] =
bookTH1F_LW(trackShiftTH1,
"hTronTDist_" + side_id[iside],
"Trailing Edge Distribution on Track for Xenon Straws" + regionTag, 26, -0.5, 80.75,
"Trailing Edge (ns)",
"Norm. Entries", scode);
1036 m_hDriftTimeonTrkDist_E[iside] =
bookTH1F_LW(trackShiftTH1,
"hDriftTimeonTrkDist_" + side_id[iside],
"Drift Time Distribution on Track for Xenon Straws" + regionTag, 32, 0, 100,
"Drift Time (ns)",
"Norm. Entries", scode);
1037 m_hNumTrksDetPhi_E[iside] =
bookTH1F_LW(trackShift,
"hNumTrksDetPhi_" + side_id[iside],
"Number of Reconstructed Tracks vs #phi (2D)" + regionTag, 60, 0, 360,
"#phi (deg)",
"Number of Tracks", scode);
1038 m_hResidual_E[iside] =
bookTH1F_LW(trackShiftTH1_lowStat,
"hResidual_" + side_id[iside],
"Residuals for Xenon Straws" + regionTag, 200, -2.5, 2.5,
"Hit-to-Track Distance (mm)",
"Norm. Entries", scode);
1039 m_hResidual_E_20GeV[iside] =
bookTH1F_LW(trackShiftTH1,
"hResidual_" + side_id[iside] +
"_20GeV",
"Residuals for Xenon Straws" + regionTag +
"(After 20GeV pT cut)", 200, -2.5, 2.5,
"Hit-to-Track Distance (mm)",
"Norm. Entries", scode);
1040 m_hTimeResidual_E[iside] =
bookTH1F_LW(trackShiftTH1,
"hTimeResidual_" + side_id[iside],
"Time Residuals for Xenon Straws" + regionTag, 200, -20, 20,
"Time Residual (ns)",
"Norm. Entries", scode);
1043 m_hTronTDist_E_Ar[iside] =
bookTH1F_LW(trackShiftTH1,
"hTronTDist_Ar_" + side_id[iside],
"Trailing Edge Distribution on Track for Argon Straws" + regionTag, 26, -0.5, 80.75,
"Trailing Edge (ns)",
"Norm. Entries", scode);
1044 m_hAvgTroTDetPhi_E_Ar[iside] =
bookTProfile_LW(trackShift,
"hAvgTroTDetPhi_Ar_" + side_id[iside],
"Avg. Trailing Edge on Track vs #phi (2D) for Argon" + regionTag,
m_nphi_bins, 0, 360, 0, 75.,
"#phi (deg)",
"Trailing Edge (ns)", scode);
1045 m_hrtRelation_E_Ar[iside] =
bookTH2F_LW(trackShift,
"hrtRelation_Ar_" + side_id[iside],
"R(t) Relation for Argon Straws" + regionTag, 30, -12.5, 81.25, 50, 0, 2.5,
"Measured Leading Edge (ns)",
"Track-to-Wire Distance (mm)", scode);
1046 m_hDriftTimeonTrkDist_E_Ar[iside] =
bookTH1F_LW(trackShiftTH1,
"hDriftTimeonTrkDist_Ar_" + side_id[iside],
"Drift Time Distribution on Track for Argon Straws" + regionTag, 32, 0, 100,
"Drift Time (ns)",
"Norm. Entries", scode);
1047 m_hResidual_E_Ar[iside] =
bookTH1F_LW(trackShiftTH1_lowStat,
"hResidual_Ar_" + side_id[iside],
"Residuals for Argon Straws" + regionTag, 200, -2.5, 2.5,
"Hit-to-Track Distance (mm)",
"Norm. Entries", scode);
1048 m_hResidual_E_Ar_20GeV[iside] =
bookTH1F_LW(trackShiftTH1,
"hResidual_Ar_" + side_id[iside] +
"_20GeV",
"Residuals for Argon Straws" + regionTag +
"(After 20GeV pT cut)", 200, -2.5, 2.5,
"Hit-to-Track Distance (mm)",
"Norm. Entries", scode);
1049 m_hTimeResidual_E_Ar[iside] =
bookTH1F_LW(trackShiftTH1,
"hTimeResidual_Ar_" + side_id[iside],
"Time Residuals for Argon Straws" + regionTag, 200, -20, 20,
"Time Residual (ns)",
"Norm. Entries", scode);
1050 m_hWireToTrkPosition_E_Ar[iside] =
bookTH1F_LW(trackShiftTH1,
"hWireToTrkPosition_Ar_" + side_id[iside],
"Track-to-Wire Distance for Argon" + regionTag, 100, -5., 5,
"Track-to-Wire Distance (mm)",
"Norm. Entries", scode);
1051 m_hHtoLRatioOnTrack_E_Ar[iside] =
bookTH1F_LW(trackShiftTH1,
"hHtoLRatioOnTrack_Ar_" + side_id[iside],
"HL/LL Ratio per Reconstructed Track for Argon" + regionTag, 50, 0, 1.0,
"HL/LL Ratio",
"Norm. Entries", scode);
1054 m_hHtoLRatioOnTrack_E_Xe[iside] =
bookTH1F_LW(trackShiftTH1,
"hHtoLRatioOnTrack_Xe_" + side_id[iside],
"HL/LL Ratio per Reconstructed Track for Xenon" + regionTag, 50, 0, 1.0,
"HL/LL Ratio",
"Norm. Entries", scode);
1055 m_hWireToTrkPosition_E[iside] =
bookTH1F_LW(trackShiftTH1,
"hWireToTrkPosition_" + side_id[iside],
"Track-to-Wire Distance for Xenon" + regionTag, 100, -5., 5,
"Track-to-Wire Distance (mm)",
"Norm. Entries", scode);
1056 m_hNumSwLLWoT_E[iside] =
bookTH1F_LW(trackShiftTH1,
"hNumSwLLWoT_" + side_id[iside],
"Number of Straws with Hits on Track in Time Window" + regionTag, 150, 0, 150,
"Number of LL Hits per Track",
"Norm. Entries", scode);
1057 m_hAvgTroTDetPhi_E[iside] =
bookTProfile_LW(trackShift,
"hAvgTroTDetPhi_" + side_id[iside],
"Avg. Trailing Edge on Track vs #phi (2D) for Xenon" + regionTag,
m_nphi_bins, 0, 360, 0, 75.,
"#phi (deg)",
"Trailing Edge (ns)", scode);
1058 m_hNTrksperLB_E[iside] =
bookTProfile(trackShiftRebinned,
"hNTrksperLB_" + side_id[iside],
"Avg. Number of Reconstructed Tracks per Event" + regionTag, maxLumiblock, -0.5, maxLumiblock - 0.5, 0, 150.0,
"Luminosity Block",
"Number of Tracks", scode);
1060 m_hNHitsperLB_E[iside] =
bookTProfile(trackShiftRebinned,
"hNHitsperLB_" + side_id[iside],
"Avg. Occupancy" + regionTag, maxLumiblock, -0.5, maxLumiblock - 0.5, 0, 150.0,
"Luminosity Block",
"Occupancy", scode);
1062 m_hNHLHitsperLB_E[iside] =
bookTProfile(trackShiftRebinned,
"hNHLHitsperLB_" + side_id[iside],
"Avg. HL Occupancy" + regionTag, maxLumiblock, -0.5, maxLumiblock - 0.5, 0, 150.0,
"Luminosity Block",
"Occupancy", scode);
1064 m_hHLhitOnTrack_E[iside] =
bookTH1F_LW(trackShiftTH1,
"hHLhitOnTrack_" + side_id[iside],
"Number of HL Hits per Reconstructed Track" + regionTag, 50, 0, 50,
"Number of HL Hits per Track",
"Norm. Entries", scode);
1065 m_hHtoLRatioOnTrack_E[iside] =
bookTH1F_LW(trackShiftTH1,
"hHtoLRatioOnTrack_" + side_id[iside],
"HL/LL Ratio per Reconstructed Track for All" + regionTag, 50, 0, 1.0,
"HL/LL Ratio",
"Norm. Entries", scode);
1067 m_hStrawEffDetPhi_E[iside] =
bookTProfile_LW(trackShift,
"hStrawEffDetPhi_" + side_id[iside],
"Straw Efficiency on Track with " +
distance +
" mm Cut vs #phi(2D)" + regionTag, 32, 0, 32, 0, 1.2,
"Stack",
"Avg. Straw Efficiency", scode);
1071 m_hHitsOnTrack_Scatter[ibe] =
bookTH2F_LW(trackShift,
"m_hHitsOnTrack_Scatter",
"Hits per Track in Time Window in Stacks" + regionTag, 1440, -0.5, 1440 - 0.5, 80, 0, 80,
"Luminosity Block (mod 1440)",
"Number of Hits per Track in Stacks", scode);
1072 m_hLLOcc_Scatter[ibe] =
bookTH2F_LW(trackShift,
"m_hLLOcc_Scatter",
"LL Occupancy in Stacks" + regionTag, 1440, -0.5, 1440 - 0.5, 400, 0.0, 1.0,
"Luminosity Block (mod 1440)",
"LL Occupancy in Stacks", scode);
1073 m_hHightoLowRatioOnTrack_Scatter[ibe] =
bookTH2F_LW(trackShift,
"m_hHightoLowRatioOnTrack_Scatter",
"HL/LL Ratio on Track in Stacks" + regionTag, 1440, -0.5, 1440 - 0.5, 40, 0.0, 0.5,
"Luminosity Block (mod 1440)",
"HL/LL Ratio in Stacks", scode);
1078 for (
int iL = 0; iL < 5; iL++) {
1079 for (
int iSide = 0; iSide < 2; iSide++) {
1082 m_trackz_All[iL][iSide] =
bookTH1F_LW(trackAging,
"trackz_m" + Mod[iL] +
"_" + side_id[iSide] +
"_All",
"Number All Hits side " + side_id[iSide] +
" Layer " + Mod[iL], 30, -750., 750.,
"z [mm]",
"Number of Hits", scode);
1083 m_trackz_HT[iL][iSide] =
bookTH1F_LW(trackAging,
"trackz_m" + Mod[iL] +
"_" + side_id[iSide] +
"_HT",
"Number HT Hits side " + side_id[iSide] +
" Layer " + Mod[iL], 30, -750., 750.,
"z [mm]",
"Number of HT Hits", scode);
1087 m_trackz_All[iL][iSide] =
bookTH1F_LW(trackAging,
"trackz_m1_" + side_id[iSide] +
"_All_" + Mod[iL],
"Number All Hits side " + side_id[iSide] +
" Layer 1 " + Mod[iL], 30, 0., 725.,
"z [mm]",
"Number of Hits", scode);
1088 m_trackz_HT[iL][iSide] =
bookTH1F_LW(trackAging,
"trackz_m1_" + side_id[iSide] +
"_HT_" + Mod[iL],
"Number HT Hits side " + side_id[iSide] +
" Layer 1 " + Mod[iL], 30, 0., 725.,
"z [mm]",
"Number of HT Hits", scode);
1092 m_trackz_All[iL][iSide] =
bookTH1F_LW(trackAging,
"trackz_m1_" + side_id[iSide] +
"_All_" + Mod[iL],
"Number All Hits side " + side_id[iSide] +
" Layer 1 " + Mod[iL], 30, -725., 0.,
"z [mm]",
"Number of Hits", scode);
1093 m_trackz_HT[iL][iSide] =
bookTH1F_LW(trackAging,
"trackz_m1_" + side_id[iSide] +
"_HT_" + Mod[iL],
"Number HT Hits side " + side_id[iSide] +
" Layer 1 " + Mod[iL], 30, -725., 0.,
"z [mm]",
"Number of HT Hits", scode);
1095 }
else if (ibe == 1) {
1098 m_trackr_All[iL][iSide] =
bookTH1F_LW(trackAging,
"trackr_E" + side_id[iSide] +
"_" + gas[iL] +
"_All",
"Number All Hits E" + side_id[iSide] +
" " + gas[iL], 30, 644., 1004.,
"r [mm]",
"Number of Hits", scode);
1099 m_trackr_HT[iL][iSide] =
bookTH1F_LW(trackAging,
"trackr_E" + side_id[iSide] +
"_" + gas[iL] +
"_HT",
"Number HT Hits E" + side_id[iSide] +
" " + gas[iL], 30, 644., 1004.,
"r [mm]",
"Number of HT Hits", scode);
1126 if (htrigDecision.isValid()) {
1127 trigDecision = htrigDecision.get();
1131 if (!xAODEventInfo.
isValid()) {
1134 return StatusCode::FAILURE;
1138 if (!rdoContainer.
isValid()) {
1141 return StatusCode::FAILURE;
1149 if (!trtBCIDCollection.
isValid()) {
1163 if (!trackCollection.
isValid()) {
1166 return StatusCode::FAILURE;
1173 if (!comTimeObject.
isValid()) {
1183 if (!combTrackCollection.
isValid()) {
1186 return StatusCode::FAILURE;
1193 if (!trackCollection.
isValid()) {
1196 return StatusCode::FAILURE;
1204 return StatusCode::SUCCESS;
1211 double n_BorE[2][2], total_BorE[2][2];
1212 double nfill[2] = {3.0, 2.0};
1235 for (
int ibe = 0; ibe < 2; ibe++) {
1238 for (
int i = 0;
i < 64;
i++) {
1295 vector<float> scalevector;
1296 vector<float> scalevector_Ar;
1301 scalevector.push_back(0.);
1307 scalevector_Ar.push_back(0.);
1311 }
catch (out_of_range &
e) {
1312 ATH_MSG_ERROR(
"Index " <<
k <<
" out of range in scaling for hHitWMap");
1321 }
else if (ibe == 1) {
1333 for (
int i = 0;
i < 64;
i++) {
1360 }
else if (ibe == 1) {
1511 }
else if (ibe == 1) {
1512 for (
int iside = 0; iside < 2; iside++) {
1622 for (
int iside = 0; iside < 2; iside++) {
1623 for (
int i = 0;
i < 32;
i++) {
1624 for (
int ibin = 0; ibin <=
s_Straw_max[ibe]; ibin++) {
1634 total_BorE[ibe][iside] = 0.0;
1649 const float barrelConst = 1. / 105088;
1650 const float endcapConst = 1. / 122880;
1657 for (
int iside = 0; iside < 2; iside++) {
1667 for (
int iside = 0; iside < 2; iside++) {
1674 for (
int ibe = 0; ibe < 2; ibe++) {
1678 float occ = (
m_LLOcc[ibe][
i] * lumiBlockScale) / nfill[ibe];
1680 occ = (
m_LLOcc[ibe][
i + 32] * lumiBlockScale) / nfill[ibe];
1696 }
else if (ibe == 1) {
1698 float occ = (
m_LLOcc[ibe][
i] * lumiBlockScale) / nfill[ibe];
1722 for (
int ibe = 0; ibe < 2; ibe++) {
1723 for (
int iside = 0; iside < 2; iside++) {
1741 return StatusCode::SUCCESS;
1756 for (; RDO_CollectionBegin != RDO_CollectionEnd; ++RDO_CollectionBegin) {
1759 if (!TRT_Collection)
continue;
1763 for (; p_rdo != TRT_Collection->
end(); ++p_rdo) {
1766 if (!p_lolum)
continue;
1775 return StatusCode::SUCCESS;
1789 int numberOfStacks_b[2];
1792 Identifier TRT_Identifier;
1793 int numberOfStrawsMod[3];
1794 numberOfStrawsMod[0] = 329;
1795 numberOfStrawsMod[1] = 520;
1796 numberOfStrawsMod[2] = 793;
1797 int numberOfStrawsWheel[2];
1798 numberOfStrawsWheel[0] = 2304;
1799 numberOfStrawsWheel[1] = 1536;
1800 int moduleHits_B[192];
1801 int moduleHits_E[128];
1802 int HLmoduleHits_B[192];
1803 int HLmoduleHits_E[128];
1805 for (
int i = 0;
i < 192;
i++) {
1806 moduleHits_B[
i] = 0;
1807 HLmoduleHits_B[
i] = 0;
1810 for (
int i = 0;
i < 128;
i++) {
1811 moduleHits_E[
i] = 0;
1812 HLmoduleHits_E[
i] = 0;
1815 int goodid_status = 0;
1818 if (trtBCIDCollection) {
1819 InDetTimeCollection::const_iterator itrt_bcid = trtBCIDCollection->begin();
1821 while (goodid_status == 0 && itrt_bcid != trtBCIDCollection->end()) {
1822 const unsigned int trt_bcid = (*itrt_bcid).second;
1824 if (itrt_bcid > trtBCIDCollection->begin() && prev_bcid - trt_bcid == 0) {
1826 }
else if (itrt_bcid > trtBCIDCollection->begin() && prev_bcid - trt_bcid != 0) {
1828 std::hex << (*itrt_bcid).first <<
" trt bcid from ROD is " <<
1829 std::hex << trt_bcid);
1832 prev_bcid = trt_bcid;
1844 for (
int ibe = 0; ibe < 2; ibe++) {
1854 for (
int i = 0;
i < 64;
i++) {
1867 vector<float> scalevector;
1868 vector<float> scalevector_Ar;
1873 scalevector.push_back(0.);
1878 scalevector_Ar.push_back(0.);
1882 }
catch (out_of_range &
e) {
1883 ATH_MSG_ERROR(
"Index " <<
k <<
" out of range in scaling for hHitWMap");
1892 }
else if (ibe == 1) {
1904 for (
int i = 0;
i < 64;
i++) {
1919 for (; RDO_CollectionBegin != RDO_CollectionEnd; ++RDO_CollectionBegin) {
1922 if (!TRT_Collection)
continue;
1926 for (; p_rdo != TRT_Collection->
end(); ++p_rdo) {
1927 int middleHTbit = (*p_rdo)->getWord() & 0x00020000;
1929 int hitinvaliditygate = (*p_rdo)->getWord() & 0x000DFE80;
1931 bool is_middleHTbit_high = (middleHTbit != 0);
1932 bool is_anybininVgate_high = (hitinvaliditygate != 0);
1933 TRT_Identifier = (*p_rdo)->identify();
1941 if (!p_lolum)
continue;
1944 int ibe = abs(barrel_ec) - 1;
1945 int iside = barrel_ec > 0 ? 0 : 1;
1948 if (ibe != 1 && ibe != 0) {
1949 ATH_MSG_DEBUG(
"TRT part retrieved from TRT Identifier is not a barrel or an endcap");
1953 int moduleNumber_barrel1[2];
1954 int moduleNumber_barrel2[2];
1955 int moduleNumber_barrel3[2];
1956 int moduleNumber_endcapA[2];
1957 int moduleNumber_endcapB[2];
1961 TRT_Identifier = p_lolum->
identify();
1968 int thisStrawNumber;
1975 if ( is_barrel && ibe == 0 ) {
1978 if (thisStrawNumber >= 0 && thisStrawNumber <
s_Straw_max[ibe]) {
1983 }
else if ( !is_barrel && ibe == 1 ) {
1986 if (thisStrawNumber >= 0 && thisStrawNumber <
s_Straw_max[ibe]) {
1992 thisStrawNumber = -1;
1995 if (thisStrawNumber < 0 || thisStrawNumber >=
s_Straw_max[ibe]) {
1996 ATH_MSG_WARNING(
"Found m_strawNumber = " << thisStrawNumber <<
" out of range.");
2002 const bool highlevel = is_middleHTbit_high;
2006 moduleNumber_barrel1[0] = phi_module;
2007 moduleNumber_barrel1[1] = phi_module + 96;
2012 moduleNumber_endcapA[0] = phi_module;
2013 moduleNumber_endcapA[1] = phi_module + 64;
2016 int iphi_module = -999;
2019 iphi_module = phi_module;
2020 }
else if (iside == 1) {
2021 iphi_module = phi_module + 32;
2042 }
else if (ibe == 1) {
2099 if ( is_anybininVgate_high) {
2135 int moduleNumber = -1;
2138 if (layer_or_wheel == 0) {
2139 moduleNumber = moduleNumber_barrel1[iside];
2140 moduleHits_B[moduleNumber]++;
2141 }
else if (layer_or_wheel == 1) {
2142 moduleNumber = moduleNumber_barrel2[iside];
2143 moduleHits_B[moduleNumber]++;
2144 }
else if (layer_or_wheel == 2) {
2145 moduleNumber = moduleNumber_barrel3[iside];
2146 moduleHits_B[moduleNumber]++;
2150 if (layer_or_wheel == 0) {
2151 moduleNumber = moduleNumber_barrel1[iside];
2152 HLmoduleHits_B[moduleNumber]++;
2153 }
else if (layer_or_wheel == 1) {
2154 moduleNumber = moduleNumber_barrel2[iside];
2155 HLmoduleHits_B[moduleNumber]++;
2156 }
else if (layer_or_wheel == 2) {
2157 moduleNumber = moduleNumber_barrel3[iside];
2158 HLmoduleHits_B[moduleNumber]++;
2161 }
else if (ibe == 1) {
2162 if (layer_or_wheel < 6) {
2163 moduleNumber = moduleNumber_endcapA[iside];
2164 moduleHits_E[moduleNumber]++;
2165 }
else if (layer_or_wheel > 5) {
2166 moduleNumber = moduleNumber_endcapB[iside];
2167 moduleHits_E[moduleNumber]++;
2171 if (layer_or_wheel < 6) {
2172 moduleNumber = moduleNumber_endcapA[iside];
2173 HLmoduleHits_E[moduleNumber]++;
2174 }
else if (layer_or_wheel > 5) {
2175 moduleNumber = moduleNumber_endcapB[iside];
2176 HLmoduleHits_E[moduleNumber]++;
2186 for (
int ibe = 0; ibe < 2; ibe++) {
2190 }
else if (ibe == 1) {
2194 for (
int iside = 0; iside < 2; iside++) {
2195 for (
int i = 1;
i <= numberOfStacks_b[ibe];
i++) {
2196 int index_tmp, modulenum_tmp;
2200 modulenum_tmp =
i - 1;
2204 if (ibe == 0) modulenum_tmp = (
i - 1) + 96;
2205 else if (ibe == 1) modulenum_tmp = (
i - 1) + 64;
2218 int LLocc_index = index_tmp - 32 * nclass;
2222 float occLL =
float(moduleHits_B[modulenum_tmp]) /
float(numberOfStrawsMod[nclass]);
2223 float occHL =
float(HLmoduleHits_B[modulenum_tmp]) /
float(numberOfStrawsMod[nclass]);
2224 m_LLOcc[ibe][LLocc_index] += occLL;
2229 }
else if (ibe == 1) {
2230 float occLL =
float(moduleHits_E[modulenum_tmp]) /
float(numberOfStrawsWheel[nclass]);
2231 float occHL =
float(HLmoduleHits_E[modulenum_tmp]) /
float(numberOfStrawsWheel[nclass]);
2233 if (LLocc_index < 64) {
2234 m_LLOcc[ibe][LLocc_index] += occLL;
2253 for (
int i = 0;
i < 64;
i++) {
2272 vector<float> scalevector;
2273 vector<float> scalevector_Ar;
2278 scalevector.push_back(0.);
2284 scalevector_Ar.push_back(0.);
2288 }
catch (out_of_range &
e) {
2289 ATH_MSG_ERROR(
"Index " <<
k <<
" out of range in scaling for hHitWMap");
2298 }
else if (ibe == 1) {
2311 for (
int i = 0;
i < 64;
i++) {
2336 return StatusCode::SUCCESS;
2343 const ComTime* comTimeObject) {
2347 const float timeCor = comTimeObject ? comTimeObject->
getTime() : 0;
2348 auto p_trk = trackCollection.begin();
2359 for (
int ibe = 0; ibe < 2; ibe++) {
2361 for (
int i = 0;
i < 64;
i++) {
2375 for (
int i = 0;
i < 64;
i++) {
2381 }
else if (ibe == 1) {
2382 for (
int iside = 0; iside < 2; iside++) {
2423 for (
int iside = 0; iside < 2; iside++) {
2446 int ntrackstack[2][64];
2448 for (
int ibe = 0; ibe < 2; ibe++) {
2449 std::fill(ntrackstack[ibe], ntrackstack[ibe] + 64, 0);
2452 for (; p_trk != trackCollection.end(); ++p_trk) {
2458 AllTrkPar = (*p_trk)->trackParameters();
2464 for (p_trkpariter = AllTrkPar->
begin(); p_trkpariter != AllTrkPar->
end(); ++p_trkpariter) {
2466 if ((mPer =
dynamic_cast<const Trk::Perigee *
>(*p_trkpariter)))
break;
2469 if (!mPer)
continue;
2480 if (trackStates ==
nullptr)
continue;
2489 const int n_si_hits = n_pixel_hits + n_sct_hits;
2490 bool is_pT_over_20GeV =
false;
2492 is_pT_over_20GeV = mPer->pT() > 20 *
CLHEP::GeV;
2494 const bool cnst_is_pT_over_20GeV = is_pT_over_20GeV;
2502 const bool passed_track_preselection =
2503 (mPer->pT() > min_pt_new) &&
2510 if (!passed_track_preselection)
continue;
2513 int checkB[2] = {0, 0};
2514 int checkEC[2] = {0, 0};
2515 int checkEC_B[2] = {0, 0};
2516 int nTRTHitsW[2][2];
2517 int nTRTHitsW_Ar[2][2];
2518 int nTRTHitsW_Xe[2][2];
2519 int nTRTHLHitsW[2][2];
2520 int nTRTHLHitsW_Ar[2][2];
2521 int nTRTHLHitsW_Xe[2][2];
2522 int nTRTHits_side[2][2];
2523 int nTRTHitsW_perwheel[2][18];
2524 int hitontrack[2] = {0, 0};
2525 int hitontrack_E_side[2] = {0, 0};
2527 for (
int ibe = 0; ibe < 2; ibe++) {
2528 for (
int iside = 0; iside < 2; iside++) {
2529 nTRTHits_side[ibe][iside] = -1;
2530 nTRTHitsW[ibe][iside] = 0;
2531 nTRTHitsW_Ar[ibe][iside] = 0;
2532 nTRTHitsW_Xe[ibe][iside] = 0;
2533 nTRTHLHitsW[ibe][iside] = 0;
2534 nTRTHLHitsW_Ar[ibe][iside] = 0;
2535 nTRTHLHitsW_Xe[ibe][iside] = 0;
2538 std::fill(nTRTHitsW_perwheel[ibe], nTRTHitsW_perwheel[ibe] + 18, 0);
2541 bool isBarrelOnly =
true;
2542 bool ECAhit =
false;
2543 bool ECChit =
false;
2546 int layer_or_wheel = 0;
2548 int straw_layer = 0;
2550 int nearest_straw_layer[2] = {100, 100};
2551 int nearest_straw[2] = {0, 0};
2552 int testLayer[2] = {100, 100};
2553 int innerstack[2] = {-999, -999};
2554 float phi2D[2] = {-100, -100};
2556 for (TSOSItBeginTemp = TSOSItBegin0; TSOSItBeginTemp != TSOSItEnd; ++TSOSItBeginTemp) {
2557 if ((*TSOSItBeginTemp) ==
nullptr)
continue;
2563 if (!trtCircle)
continue;
2567 if (!aTrackParam)
continue;
2569 Identifier DCoTId = trtCircle->
identify();
2571 int ibe = abs(barrel_ec) - 1;
2577 if (layer_or_wheel >= testLayer[ibe])
continue;
2579 testLayer[ibe] = layer_or_wheel;
2581 if (straw_layer < nearest_straw_layer[ibe]) {
2582 nearest_straw_layer[ibe] = straw_layer;
2583 nearest_straw[ibe] =
straw;
2587 circleElement =
nullptr;
2592 if (phi2D[0] == -999) {
2593 ATH_MSG_DEBUG(
"Track did not go through inner layer of Barrel.");
2596 testLayer[0] <<
" m_straw_layer: " <<
2597 nearest_straw_layer[0] <<
" (in the Barrel).");
2600 if (phi2D[1] == -999) {
2601 ATH_MSG_DEBUG(
"Track did not go through any inner layer of EndCap A or C.");
2604 testLayer[1] <<
" m_straw_layer: " <<
2605 nearest_straw_layer[1] <<
" (in the EndCaps).");
2608 bool trackfound[2][64];
2610 for (
int i = 0;
i < 2;
i++) {
2611 std::fill(trackfound[
i], trackfound[
i] + 64,
false);
2614 for (TSOSItBegin = TSOSItBegin0; TSOSItBegin != TSOSItEnd; ++TSOSItBegin) {
2616 if ((*TSOSItBegin) ==
nullptr)
continue;
2622 if (!trtCircle)
continue;
2626 if (!aTrackParam)
continue;
2628 Identifier DCoTId = trtCircle->
identify();
2635 int ibe = abs(barrel_ec) - 1;
2637 int iside = barrel_ec > 0 ? 0 : 1;
2638 int thisStrawNumber[2] = {-1, -1};
2639 int chip[2] = {0, 0};
2644 if (thisStrawNumber[ibe] >= 0 && thisStrawNumber[ibe] <
s_Straw_max[ibe]) {
2645 chip[ibe] =
m_mat_chip_B[phi_module][thisStrawNumber[ibe]];
2647 }
else if (ibe == 1) {
2650 if (thisStrawNumber[ibe] >= 0 && thisStrawNumber[ibe] <
s_Straw_max[ibe]) {
2651 chip[ibe] =
m_mat_chip_E[phi_module][thisStrawNumber[ibe]];
2654 thisStrawNumber[ibe] = -1;
2657 if (thisStrawNumber[ibe] < 0 || thisStrawNumber[ibe] >=
s_Straw_max[ibe])
continue;
2659 if (checkB[iside] == 0 && ibe == 0) {
2664 if (checkEC[iside] == 0 && ibe == 1) {
2669 if (checkEC_B[iside] == 0 && checkB[iside] == 1 && ibe == 1 ) {
2671 checkEC_B[iside] = 1;
2676 }
else if (barrel_ec == 2) {
2677 isBarrelOnly =
false;
2679 }
else if (barrel_ec == -2) {
2680 isBarrelOnly =
false;
2684 Identifier surfaceID;
2691 int iphi_module = -9999;
2693 if (iside == 0) iphi_module = phi_module;
2694 else if (iside == 1) iphi_module = phi_module + 32;
2696 trackfound[ibe][iphi_module] =
true;
2714 }
else if (ibe == 1) {
2716 hitontrack_E_side[iside]++;
2745 }
else if (ibe == 1) {
2768 if (RawDriftCircle) {
2769 nTRTHits_side[ibe][iside]++;
2770 int middleHTbit = RawDriftCircle->
getWord() & 0x00020000;
2772 int hitinvaliditygate = RawDriftCircle->
getWord() & 0x000DFE80;
2774 bool is_middleHTbit_high = (middleHTbit != 0);
2775 bool is_anybininVgate_high = (hitinvaliditygate != 0);
2785 if (is_middleHTbit_high) {
2794 if (is_middleHTbit_high) {
2802 if (driftTimeValid) {
2803 const float validRawDriftTime = RawDriftCircle->
rawDriftTime();
2818 }
else if (ibe == 1) {
2826 float locR_err = 0.0;
2827 const AmgSymMatrix(5)* b_err = aTrackParam->covariance();
2832 ATH_MSG_ERROR(
"Track parameters have no covariance attached.");
2843 if ((loc *
locR) < 0) loc = -loc;
2848 const double pull_b =
2850 sqrt((loc_err * loc_err * loc_err * loc_err) -
2851 (locR_err * locR_err * locR_err * locR_err)));
2853 const double trkdrifttime = (!rtr) ? 0 : rtr->
drifttime(fabs(
locR));
2854 const double timeresidual = RawDriftCircle->
rawDriftTime() - thist0 - trkdrifttime;
2864 if (cnst_is_pT_over_20GeV) {
2873 if (cnst_is_pT_over_20GeV) {
2877 }
else if (ibe == 1) {
2886 if (cnst_is_pT_over_20GeV) {
2893 if (cnst_is_pT_over_20GeV) {
2907 }
else if (ibe == 1) {
2917 const float EP = timeCor;
2934 }
else if (ibe == 1) {
2959 }
else if (ibe == 1) {
3001 }
else if (ibe == 1) {
3024 nTRTHitsW[ibe][iside]++;
3027 nTRTHitsW_Ar[ibe][iside]++;
3029 nTRTHitsW_Xe[ibe][iside]++;
3032 nTRTHitsW_perwheel[iside][layer_or_wheel]++;
3034 if (is_middleHTbit_high) {
3035 nTRTHLHitsW[ibe][iside]++;
3038 nTRTHLHitsW_Ar[ibe][iside]++;
3040 nTRTHLHitsW_Xe[ibe][iside]++;
3045 if (is_anybininVgate_high) {
3056 for (
int ibe = 0; ibe < 2; ibe++) {
3057 for (
int i = 0;
i < 64;
i++)
3058 if (trackfound[ibe][
i])
3059 ntrackstack[ibe][
i]++;
3076 if (phi2D[ibe] < 0)
continue;
3080 if (nTRTHitsW[ibe][0] + nTRTHitsW[ibe][1] > 0)
3082 }
else if (ibe == 1) {
3083 if (nTRTHitsW[ibe][0] > 0)
3086 if (nTRTHitsW[ibe][1] > 0)
3092 if (innerstack[ibe] >= 0 && innerstack[ibe] <
s_iStack_max[ibe]) {
3094 m_LonTrack_B[innerstack[ibe]] += nTRTHitsW[ibe][0] + nTRTHitsW[ibe][1];
3096 if (nTRTHitsW[ibe][0] + nTRTHitsW[ibe][1] > 0) {
3097 m_HTfraconTrack_B[innerstack[ibe]] += (
float)(nTRTHLHitsW[ibe][0] + nTRTHLHitsW[ibe][1]) / (nTRTHitsW[ibe][0] + nTRTHitsW[ibe][1]);
3100 }
else if (ibe == 1) {
3101 m_LonTrack_E[innerstack[ibe]] += nTRTHitsW[ibe][0] + nTRTHitsW[ibe][1];
3103 if ((nTRTHitsW[ibe][0] + nTRTHitsW[ibe][1]) > 0) {
3104 m_HTfraconTrack_E[innerstack[ibe]] += (
float)(nTRTHLHitsW[ibe][0] + nTRTHLHitsW[ibe][1]) / (nTRTHitsW[ibe][0] + nTRTHitsW[ibe][1]);
3114 if (nTRTHitsW[ibe][0] > 0) {
3117 }
else if (nTRTHitsW[ibe][1] > 0) {
3122 if (nTRTHLHitsW[ibe][0] > 0) {
3123 if (nTRTHLHitsW[ibe][1] > 0) {
3128 }
else if (nTRTHLHitsW[ibe][1] > 0) {
3132 if (nTRTHitsW[ibe][0] + nTRTHitsW[ibe][1] > 0) {
3133 m_hHtoLRatioOnTrack_B->
Fill((
float)(nTRTHLHitsW[ibe][0] + nTRTHLHitsW[ibe][1]) / (nTRTHitsW[ibe][0] + nTRTHitsW[ibe][1]));
3136 if (nTRTHitsW_Ar[ibe][0] + nTRTHitsW_Ar[ibe][1] > 0) {
3137 m_hHtoLRatioOnTrack_B_Ar->
Fill((
float)(nTRTHLHitsW_Ar[ibe][0] + nTRTHLHitsW_Ar[ibe][1]) / (nTRTHitsW_Ar[ibe][0] + nTRTHitsW_Ar[ibe][1]));
3140 if (nTRTHitsW_Xe[ibe][0] + nTRTHitsW_Xe[ibe][1] > 0) {
3141 m_hHtoLRatioOnTrack_B_Xe->
Fill((
float)(nTRTHLHitsW_Xe[ibe][0] + nTRTHLHitsW_Xe[ibe][1]) / (nTRTHitsW_Xe[ibe][0] + nTRTHitsW_Xe[ibe][1]));
3143 }
else if (ibe == 1) {
3144 if (nTRTHitsW[ibe][0] > 0) {
3145 if (nTRTHitsW[ibe][1] > 0) {
3146 if (ECAhit && !ECChit && !Bhit) {
3150 if (ECChit && !ECAhit && !Bhit) {
3155 if (ECAhit && !ECChit && !Bhit) {
3158 }
else if (nTRTHitsW[ibe][1] > 0) {
3159 if (ECChit && !ECAhit && !Bhit) {
3164 for (
int iside = 0; iside < 2; iside++) {
3165 if (nTRTHLHitsW[ibe][iside] > 0) {
3169 if ((nTRTHitsW[ibe][iside]) > 0) {
3172 if ((nTRTHitsW_Ar[ibe][iside]) > 0) {
3176 if ((nTRTHitsW_Xe[ibe][iside]) > 0) {
3185 if ((nTRTHitsW[ibe][0] + nTRTHitsW[ibe][1]) > 0) {
3188 if (comTimeObject) {
3189 if (
m_doShift && (phi2D[ibe] > 0) && (std::fabs(timeCor) > 1
e-8)) {
3193 }
else if (ibe == 1) {
3194 for (
int iside = 0; iside < 2; iside++) {
3196 if (comTimeObject) {
3197 if (nTRTHits_side[ibe][iside] > 5 && (std::fabs(timeCor)
3207 if (comTimeObject) {
3208 if (std::fabs(timeCor) > 1
e-8) {
3214 std::vector<int> trigid;
3217 std::vector<unsigned int> level1TAV = trigDecision->
tav();
3219 for (
unsigned int j = 0; j < 8 && j < level1TAV.size(); ++j) {
3220 for (
unsigned int i = 0;
i < 32; ++
i) {
3221 if ((level1TAV[j] >>
i) & 0x1) {
3222 trigid.push_back(
i + (j % 8) * 32);
3227 for (
unsigned int j = 0; j < trigid.size(); ++j) {
3234 for (
int ibe = 0; ibe < 2; ibe++) {
3238 for (
int i = 0;
i < 64;
i++) {
3270 for (
int i = 0;
i < 64;
i++) {
3281 }
else if (ibe == 1) {
3429 }
else if (ibe == 1) {
3430 for (
int iside = 0; iside < 2; iside++) {
3528 return StatusCode::SUCCESS;
3541 for (
auto track = combTrackCollection.begin();
track != combTrackCollection.end(); ++
track) {
3547 const Trk::Perigee *perigee = (*track)->perigeeParameters();
3561 <<
" theta = " << perigee->parameters()[
Trk::theta] <<
"\n"
3562 <<
" qOverP = " << perigee->parameters()[
Trk::qOverP]);
3571 ATH_MSG_DEBUG(
"This track has " << track_states->
size() <<
" track states on surface.");
3573 ATH_MSG_DEBUG(
"This track has null track states on surface.");
3594 const bool passed_track_preselection =
3597 (perigee->pT() > min_pt_new) &&
3604 <<
" and nsct = " << n_sct_hits
3605 <<
" and npix = " << n_pixel_hits);
3607 if (!passed_track_preselection) {
3614 for (
auto it = track_states->
begin();
it != track_states->
end();
it++) {
3619 if (!track_parameters)
continue;
3634 int ibe = abs(barrel_ec) - 1;
3636 int iside = barrel_ec > 0 ? 0 : 1;
3644 }
else if (ibe == 1) {
3652 if (fabs(
locR) >= 1.3)
continue;
3654 int thisStrawNumber = 0;
3660 if (thisStrawNumber >= 0 && thisStrawNumber <
s_Straw_max[ibe])
3662 }
else if (ibe == 1) {
3665 if (thisStrawNumber >= 0 && thisStrawNumber <
s_Straw_max[ibe])
3675 }
else if (iside == 1) {
3701 if (!track_parameters)
continue;
3716 int ibe = abs(barrel_ec) - 1;
3718 int iside = barrel_ec > 0 ? 0 : 1;
3726 }
else if (ibe == 1) {
3734 if (fabs(
locR) >= 1.3)
continue;
3736 int thisStrawNumber = 0;
3742 if (thisStrawNumber >= 0 && thisStrawNumber <
s_Straw_max[ibe]) {
3745 }
else if (ibe == 1) {
3748 if (thisStrawNumber >= 0 && thisStrawNumber <
s_Straw_max[ibe]) {
3759 }
else if (iside == 1) {
3775 double n_BorE[2][2];
3776 double total_BorE[2][2];
3778 for (
int ibe = 0; ibe < 2; ibe++) {
3779 for (
int iside = 0; iside < 2; iside++) {
3783 for (
int i = 0;
i < 32;
i++) {
3784 for (
int ibin = 0; ibin <=
s_Straw_max[ibe]; ibin++) {
3793 total_BorE[ibe][iside] = 0.0;
3802 return StatusCode::SUCCESS;
3815 int lumiBlockNumber;
3817 lumiBlockNumber = eventInfo.
lumiBlock();
3833 for (p_trk = trackCollection.
begin(); p_trk != trackCollection.
end(); ++p_trk) {
3834 AllTrkPar = (*p_trk)->trackParameters();
3836 for (p_trkpariter = AllTrkPar->
begin(); p_trkpariter != AllTrkPar->
end(); ++p_trkpariter) {
3837 if ((perigee =
dynamic_cast<const Trk::Perigee *
>(*p_trkpariter)))
break;
3843 if (!perigee)
continue;
3845 float track_eta = perigee->eta();
3846 float track_p = (perigee->parameters()[
Trk::qOverP] != 0.) ? fabs(1. / (perigee->parameters()[
Trk::qOverP])) : 10e7;
3849 if (trackStates ==
nullptr)
continue;
3858 if (fabs(track_eta) > 2.5)
continue;
3859 if (fabs(track_p) < 5000.)
continue;
3860 if (pixel_hits < 1.)
continue;
3861 if (sct_hits < 6.)
continue;
3862 if (trt_hits < 6.)
continue;
3868 ATH_MSG_DEBUG(
"This track has " << track_states->
size() <<
" track states on surface.");
3870 ATH_MSG_DEBUG(
"This track has null track states on surface.");
3874 int barrel_ec_side = 0;
3875 int layer_or_wheel = 0;
3877 int straw_layer = 0;
3879 for (; TSOSItBegin != TSOSItEnd; ++TSOSItBegin) {
3880 if ((*TSOSItBegin) ==
nullptr)
continue;
3886 if (!trtCircle)
continue;
3887 if (!aTrackParam)
continue;
3889 Identifier DCoTId = trtCircle->
identify();
3896 int Ba_Ec = abs(barrel_ec_side) - 1;
3897 int Side = barrel_ec_side > 0 ? 0 : 1;
3901 double RPos = sqrt(xPos * xPos + yPos * yPos);
3902 Identifier surfaceID;
3907 if (!RawDriftCircle) {
3913 int middleHTbit = RawDriftCircle->
getWord() & 0x00020000;
3915 bool is_middleHTbit_high = (middleHTbit != 0);
3917 bool isHighLevel = is_middleHTbit_high;
3918 bool shortStraw =
false;
3921 if (fabs(track_eta) < 2. && Ba_Ec == 0.) {
3922 if ((layer_or_wheel == 0) && (phi_module < 4 || (phi_module > 7 && phi_module < 12) || (phi_module > 15 && phi_module < 20) || (phi_module > 23 && phi_module < 28))) InputBar = 1;
3923 else if ((
runNumber >= 296939) && (layer_or_wheel == 0) && (phi_module > 27)) InputBar = 1;
3924 else if (layer_or_wheel == 0)
3926 else if ((layer_or_wheel == 1) && ((phi_module > 1 && phi_module < 6) || (phi_module > 9 && phi_module < 14) || (phi_module > 17 && phi_module < 22) || (phi_module > 25 && phi_module < 30)))
3928 else if (layer_or_wheel == 1)
3930 else if (layer_or_wheel == 2 && phi_module % 2 != 0)
3932 else if (layer_or_wheel == 2)
3939 if ((layer_or_wheel == 0) && straw_layer < 9.)
3944 if ((!shortStraw) && (Ba_Ec == 0)) {
3965 if ((Ba_Ec == 1) && (layer_or_wheel < 6) &&
3966 ((straw_layer > 3 && straw_layer < 8) ||
3967 (straw_layer > 11))) {
3970 if ((Ba_Ec == 1) && (layer_or_wheel >= 6) &&
3971 (straw_layer > 3)) {
3974 if ((Ba_Ec == 1) && (layer_or_wheel < 6) &&
3975 ((straw_layer > -1 && straw_layer < 4) ||
3976 (straw_layer > 7 && straw_layer < 12))) {
3979 if ((Ba_Ec == 1) && (layer_or_wheel >= 6) &&
3980 ((straw_layer > -1 && straw_layer < 4))) {
3984 if (WType < 0 && Ba_Ec == 1) {
3996 return StatusCode::SUCCESS;
4011 bsErrCont=bsErrContHdl.cptr();
4026 const std::set<std::pair<uint32_t, uint32_t> > &L1IDErrorSet = bsErrCont->
getL1ErrorSet();
4027 const std::set<std::pair<uint32_t, uint32_t> > &BCIDErrorSet = bsErrCont->
getBCIDErrorSet();
4029 const std::set<uint32_t> &SidErrorSet = bsErrCont->
getSidErrorSet();
4030 const std::set<std::pair<uint32_t, uint32_t> > &RobStatusErrorSet = bsErrCont->
getRobErrorSet();
4032 const unsigned int rod_id_base[2][2] = { { 0x310000, 0x320000 }, { 0x330000, 0x340000 } };
4033 const unsigned int nChipsTotal[2][2] = { { 3328, 3328 }, { 7680, 7680 } };
4034 const unsigned int nRobsTotal[2][2] = { { 32, 32 }, { 64, 64 } };
4035 float nBSErrors[2][2] = { { 0, 0 }, { 0, 0 } };
4036 float nRobErrors[2][2] = { { 0, 0 }, { 0, 0 } };
4037 const std::set<std::pair<uint32_t, uint32_t> > *errorset1[2] = { &BCIDErrorSet, &L1IDErrorSet };
4039 for (
int iset = 0; iset < 2; ++iset) {
4040 for (
auto setIt = errorset1[iset]->
begin(); setIt != errorset1[iset]->end(); ++setIt) {
4041 for (
int ibe = 0; ibe < 2; ++ibe) {
4042 for (
int iside = 0; iside < 2; ++iside) {
4043 if (((setIt->first >> 8) & 0xFF0000) == rod_id_base[ibe][iside]) {
4044 nBSErrors[ibe][iside] += 1. / nChipsTotal[ibe][iside];
4051 const std::set<uint32_t> *errorset2[2] = { &MissingErrorSet, &SidErrorSet };
4053 for (
int iset = 0; iset < 2; ++iset) {
4054 for (
auto setIt = errorset2[iset]->
begin(); setIt != errorset2[iset]->end(); ++setIt) {
4055 for (
int ibe = 0; ibe < 2; ++ibe) {
4056 for (
int iside = 0; iside < 2; ++iside) {
4057 if (((*setIt >> 8) & 0xFF0000) == rod_id_base[ibe][iside]) {
4058 nBSErrors[ibe][iside] += 1. / nChipsTotal[ibe][iside];
4065 for (
int ibe = 0; ibe < 2; ++ibe) {
4066 for (
int iside = 0; iside < 2; ++iside) {
4072 for (
auto setIt = RobStatusErrorSet.begin(); setIt != RobStatusErrorSet.end(); ++setIt) {
4073 for (
int ibe = 0; ibe < 2; ++ibe) {
4074 for (
int iside = 0; iside < 2; ++iside) {
4075 if (setIt->first % rod_id_base[ibe][iside] < 0xffff) {
4076 nRobErrors[ibe][iside] += 1. / nRobsTotal[ibe][iside];
4082 for (
int ibe = 0; ibe < 2; ++ibe) {
4083 for (
int iside = 0; iside < 2; ++iside) {
4095 int addToStrawNumber = 0;
4096 int addToStrawNumberNext = 0;
4098 const int numberOfStraws[75] = {
4125 addToStrawNumber += numberOfStraws[
i - 1];
4126 addToStrawNumberNext = addToStrawNumber + numberOfStraws[
i];
4131 if (strawNumber < 0 || strawNumber >
s_Straw_max[0] - 1) {
4142 const int numberOfStraws[75] = {
4169 for (
i = 1; inp_strawnumber >= 0;
i++) {
4170 inp_strawnumber -= numberOfStraws[
i];
4185 static const int TripletOrientation[2][32] = {
4187 1, 1, 1, 1, 1, 1, 1, 1,
4188 0, 0, 0, 0, 0, 0, 0, 0,
4189 1, 1, 1, 1, 1, 1, 1, 1,
4190 0, 0, 0, 0, 0, 0, 0, 0
4193 1, 1, 1, 1, 1, 1, 1, 1,
4194 0, 0, 0, 0, 0, 0, 0, 0,
4195 1, 1, 1, 1, 1, 1, 1, 1,
4196 0, 0, 0, 0, 0, 0, 0, 0
4201 if (
side == 2) phi1 = phi_stack,
side = 1;
4202 else if (
side == -2) phi1 = 31 - phi_stack,
side = 0;
4205 if (TripletOrientation[
side][phi1]) {
4231 int strawNumberNew = 0;
4233 if (LayerNumber < 6 && strawLayerNumber > 7) {
4234 strawNumberNew = strawNumberNew + (384 * LayerNumber);
4237 strawNumberNew = strawNumberNew + (384 * LayerNumber);
4240 strawNumberNew = strawNumberNew + 2304 + 192 * (LayerNumber - 6);
4243 strawNumberNew = strawNumberNew + 2304 + 192 * (LayerNumber - 6);
4249 if (strawNumber < 0 || strawNumber >
s_Straw_max[1] - 1) {
4260 switch (LayerNumber) {
4280 if (strawLayerNumInp < 19) {
4283 }
else if (strawLayerNumInp < 43) {
4297 float degreeValue = radValue /
M_PI * 180;
4299 if (degreeValue < 0) degreeValue += 360;
4317 const int list[] = {10, 11, 15, 9, 9, 11, 12, 13, 14};
4321 for (
int i = 0;
i < 9;
i++) {
4324 if (chip <
count)
return i + 1;
4325 else if (chip == 104)
return 9;
4328 assert(
count == 104);
4351 hist->resetActiveBinLoop();
4367 if (
hist->GetNbinsX() !=
scale.size())
return;
4372 hist->resetActiveBinLoop();
4378 }
catch (out_of_range &
e) {
4396 if (
result->GetXaxis()->GetNbins() !=
a->GetXaxis()->GetNbins() ||
b->GetXaxis()->GetNbins() !=
a->GetXaxis()->GetNbins())
return;
4400 double contentA, errorA;
4401 double contentB, errorB;
4402 a->resetActiveBinLoop();
4404 while (
a->getNextActiveBin(
index, contentA, errorA)) {
4405 b->GetBinContentAndError(
index, contentB, errorB);
4410 result->SetBinContentAndError(
index, contentA / contentB, 0);
4413 result->SetEntries(
a->GetEntries());
4420 scode = trtRegHist<TH1F_LW>(
hist, mongroup, hName.c_str());
4421 hist->GetXaxis()->SetLabelSize(0.03);
4422 hist->GetYaxis()->SetLabelSize(0.03);
4423 hist->SetXTitle(xTitle.c_str());
4424 hist->SetYTitle(yTitle.c_str());
4433 scode = trtRegHist<TH1D_LW>(
hist, mongroup, hName.c_str());
4434 hist->GetXaxis()->SetLabelSize(0.03);
4435 hist->GetYaxis()->SetLabelSize(0.03);
4436 hist->SetXTitle(xTitle.c_str());
4437 hist->SetYTitle(yTitle.c_str());
4443 TProfile *
TRT_Monitoring_Tool::bookTProfile(
MonGroup &mongroup,
const std::string &hName,
const std::string &hTitle,
int nbins,
double firstbin,
double lastbin,
double ymin,
double ymax,
const std::string &xTitle,
const std::string &yTitle,
StatusCode &scode) {
4446 scode = trtRegHist<TProfile>(
hist, mongroup, hName.c_str());
4447 hist->SetMarkerSize(0.5);
4448 hist->SetMarkerStyle(2);
4449 hist->SetMarkerColor(2);
4450 hist->GetXaxis()->SetLabelSize(0.03);
4451 hist->GetYaxis()->SetLabelSize(0.03);
4452 hist->GetXaxis()->SetTitle(xTitle.c_str());
4453 hist->GetYaxis()->SetTitle(yTitle.c_str());
4458 TProfile_LW *
TRT_Monitoring_Tool::bookTProfile_LW(
MonGroup &mongroup,
const std::string &hName,
const std::string &hTitle,
int nbins,
double firstbin,
double lastbin,
double ymin,
double ymax,
const std::string &xTitle,
const std::string &yTitle,
StatusCode &scode) {
4461 scode = trtRegHist<TProfile_LW>(
hist, mongroup, hName.c_str());
4462 hist->SetMarkerSize(0.5);
4463 hist->SetMarkerStyle(2);
4464 hist->SetMarkerColor(2);
4465 hist->GetXaxis()->SetLabelSize(0.03);
4466 hist->GetYaxis()->SetLabelSize(0.03);
4467 hist->GetXaxis()->SetTitle(xTitle.c_str());
4468 hist->GetYaxis()->SetTitle(yTitle.c_str());
4473 TH2F_LW *
TRT_Monitoring_Tool::bookTH2F_LW(
MonGroup &mongroup,
const std::string &hName,
const std::string &hTitle,
int xnbins,
double xfirstbin,
double xlastbin,
int ynbins,
double yfirstbin,
double ylastbin,
const std::string &xTitle,
const std::string &yTitle,
StatusCode &scode) {
4476 scode = trtRegHist<TH2F_LW>(
hist, mongroup, hName.c_str());
4477 hist->GetXaxis()->SetLabelSize(0.03);
4478 hist->GetYaxis()->SetLabelSize(0.03);
4479 hist->SetXTitle(xTitle.c_str());
4480 hist->SetYTitle(yTitle.c_str());
4500 for (
int j = 0; j < 32; j++ ) {
4501 Identifier Dummy_Identifier;