749 const unsigned int lumiBlock = eventInfo.
lumiBlock();
751 auto good_bcid = eventInfo.
bcid();
757 int numberOfStacks_b[2];
761 int numberOfStrawsMod[3];
762 numberOfStrawsMod[0] = 329;
763 numberOfStrawsMod[1] = 520;
764 numberOfStrawsMod[2] = 793;
765 int numberOfStrawsWheel[2];
766 numberOfStrawsWheel[0] = 2304;
767 numberOfStrawsWheel[1] = 1536;
768 int moduleHits_B[192];
769 int moduleHits_E[128];
770 int HLmoduleHits_B[192];
771 int HLmoduleHits_E[128];
772 int nHitsperLB_B = 0;
773 int nHLHitsperLB_B = 0;
774 int nHitsperLB_E[2] = {0, 0};
775 int nHLHitsperLB_E[2] = {0, 0};
777 for (
int i = 0; i < 192; i++) {
779 HLmoduleHits_B[i] = 0;
782 for (
int i = 0; i < 128; i++) {
784 HLmoduleHits_E[i] = 0;
787 auto scale_hHitWMap_B_passed = std::make_unique<short int[][s_Straw_max[0]]>(2);
788 auto scale_hHitWMap_E_passed = std::make_unique<short int[][2][s_Straw_max[1]]>(2);
812 int goodid_status = 0;
815 if (trtBCIDCollection) {
816 InDetTimeCollection::const_iterator itrt_bcid = trtBCIDCollection->begin();
818 while (goodid_status == 0 && itrt_bcid != trtBCIDCollection->end()) {
820 const unsigned int trt_bcid = (*itrt_bcid).second;
822 if (itrt_bcid > trtBCIDCollection->begin() && prev_bcid - trt_bcid == 0) {
824 }
else if (itrt_bcid > trtBCIDCollection->begin() && prev_bcid - trt_bcid != 0) {
826 std::hex << (*itrt_bcid).first <<
" trt bcid from ROD is " <<
827 std::hex << trt_bcid);
830 prev_bcid = trt_bcid;
843 for (
int ibe = 0; ibe < 2; ibe++) {
853 std::map<int,std::map<int, std::vector<straw_struct>>> straw_map;
854 std::map<int,std::map<int, std::vector<chip_struct>>> chip_map;
855 std::map<int,std::vector<straw_shifter_struct>> straw_shifter_map;
856 std::map<int,std::map<int, std::vector<straw_struct_prob>>> straw_map_prob;
857 std::map<int,std::map<int, std::vector<chip_struct_prob>>> chip_map_prob;
859 std::vector<std::vector<std::vector<int>>> scale_hHitWMap =
initScaleVectors(ctx);
861 for (; RDO_CollectionBegin != RDO_CollectionEnd; ++RDO_CollectionBegin) {
864 if (!TRT_Collection)
continue;
868 for (; p_rdo != TRT_Collection->
end(); ++p_rdo) {
869 int middleHTbit = (*p_rdo)->getWord() & 0x00020000;
871 int hitinvaliditygate = (*p_rdo)->getWord() & 0x000DFE80;
873 bool is_middleHTbit_high = (middleHTbit != 0);
874 bool is_anybininVgate_high = (hitinvaliditygate != 0);
875 TRT_Identifier = (*p_rdo)->identify();
879 int barrel_ec =
m_pTRTHelper->barrel_ec(TRT_Identifier);
883 if (!p_lolum)
continue;
886 int ibe = abs(barrel_ec) - 1;
887 int iside = barrel_ec > 0 ? 0 : 1;
890 if (ibe != 1 && ibe != 0) {
891 ATH_MSG_DEBUG(
"TRT part retrieved from TRT Identifier is not a barrel or an endcap");
895 int moduleNumber_barrel1[2];
896 int moduleNumber_barrel2[2];
897 int moduleNumber_barrel3[2];
898 int moduleNumber_endcapA[2];
899 int moduleNumber_endcapB[2];
903 TRT_Identifier = p_lolum->
identify();
906 int phi_module =
m_pTRTHelper->phi_module(TRT_Identifier);
907 int layer_or_wheel =
m_pTRTHelper->layer_or_wheel(TRT_Identifier);
908 int straw_layer =
m_pTRTHelper->straw_layer(TRT_Identifier);
914 bool is_barrel =
m_pTRTHelper->is_barrel(TRT_Identifier);
917 if ( is_barrel && ibe == 0 ) {
918 thisStrawNumber =
strawNumber(straw, straw_layer, layer_or_wheel);
920 if (thisStrawNumber >= 0 && thisStrawNumber <
s_Straw_max[ibe]) {
926 }
else if ( !is_barrel && ibe == 1 ) {
927 thisStrawNumber =
strawNumberEndCap(straw, straw_layer, layer_or_wheel, phi_module, barrel_ec);
929 if (thisStrawNumber >= 0 && thisStrawNumber <
s_Straw_max[ibe]) {
935 thisStrawNumber = -1;
938 if (thisStrawNumber < 0 || thisStrawNumber >=
s_Straw_max[ibe]) {
939 ATH_MSG_WARNING(
"Found m_strawNumber = " << thisStrawNumber <<
" out of range.");
944 const bool highlevel = is_middleHTbit_high;
948 moduleNumber_barrel1[0] = phi_module;
949 moduleNumber_barrel1[1] = phi_module + 96;
954 moduleNumber_endcapA[0] = phi_module;
955 moduleNumber_endcapA[1] = phi_module + 64;
958 int iphi_module = -999;
961 iphi_module = phi_module;
962 }
else if (iside == 1) {
963 iphi_module = phi_module + 32;
969 this_struct.
isAr = isArgonStraw;
972 if (abs(barrel_ec) == 1) scale_hHitWMap_B_passed[isArgonStraw ? 1 : 0][thisStrawNumber]++;
973 if (abs(barrel_ec) == 2) scale_hHitWMap_E_passed[barrel_ec < 0 ? 1 : 0][isArgonStraw ? 1 : 0][thisStrawNumber]++;
986 }
else if (ibe == 1) {
990 nHitsperLB_E[iside]++;
993 nHLHitsperLB_E[iside]++;
1000 straw_struct_prob& this_struct = straw_map_prob[ibe][iphi_module].emplace_back();
1002 this_struct.
HitHWMapS_cut = highlevel && is_middleHTbit_high;
1013 if (highlevel && is_middleHTbit_high) scale_hHitHWMapS_B_passed[iphi_module][thisStrawNumber]++;
1016 if (is_anybininVgate_high) scale_hHitAWMapS_B_passed[iphi_module][thisStrawNumber]++;
1017 if (highlevel) scale_hHitHMapS_B_passed[iphi_module][thisStrawNumber]++;
1020 if (highlevel && is_middleHTbit_high) scale_hHitHWMapS_E_passed[iphi_module][thisStrawNumber]++;
1023 if (is_anybininVgate_high) scale_hHitAWMapS_E_passed[iphi_module][thisStrawNumber]++;
1024 if (highlevel) scale_hHitHMapS_E_passed[iphi_module][thisStrawNumber]++;
1031 straw_struct& this_struct = straw_map[ibe][iphi_module].emplace_back();
1040 HtoLMapS = thisStrawNumber;
1041 HtoLMapS_passed = 1.0;
1042 fill(
"RDOStackHistograms"+std::to_string(ibe)+std::to_string(iphi_module), HtoLMapS_passed, HtoLMapS);
1044 HtoLMapS = thisStrawNumber;
1045 HtoLMapS_passed = 0.0;
1046 fill(
"RDOStackHistograms"+std::to_string(ibe)+std::to_string(iphi_module), HtoLMapS_passed, HtoLMapS);
1051 chip_struct_prob& this_struct = chip_map_prob[ibe][iphi_module].emplace_back();
1053 this_struct.
HitHWMapC_cut = highlevel && is_middleHTbit_high;
1064 if (highlevel && is_middleHTbit_high) scale_hHitHWMapC_B_passed[iphi_module][chip - 1]++;
1067 if (is_anybininVgate_high) scale_hHitAWMapC_B_passed[iphi_module][chip - 1]++;
1068 if (highlevel) scale_hHitHMapC_B_passed[iphi_module][chip - 1]++;
1071 if (highlevel && is_middleHTbit_high) scale_hHitHWMapC_E_passed[iphi_module][chip - 1]++;
1074 if (is_anybininVgate_high) scale_hHitAWMapC_E_passed[iphi_module][chip - 1]++;
1075 if (highlevel) scale_hHitHMapC_E_passed[iphi_module][chip - 1]++;
1080 chip_struct& this_struct = chip_map[ibe][iphi_module].emplace_back();
1108 HtoLMapC = chip - 1;
1109 HtoLMapC_passed = 1.0;
1110 fill(
"RDOStackHistograms"+std::to_string(ibe)+std::to_string(iphi_module), HtoLMapC_passed, HtoLMapC);
1112 HtoLMapC = chip - 1;
1113 HtoLMapC_passed = 0.0;
1114 fill(
"RDOStackHistograms"+std::to_string(ibe)+std::to_string(iphi_module), HtoLMapC_passed, HtoLMapC);
1120 int moduleNumber = -1;
1123 if (layer_or_wheel == 0) {
1124 moduleNumber = moduleNumber_barrel1[iside];
1125 moduleHits_B[moduleNumber]++;
1126 }
else if (layer_or_wheel == 1) {
1127 moduleNumber = moduleNumber_barrel2[iside];
1128 moduleHits_B[moduleNumber]++;
1129 }
else if (layer_or_wheel == 2) {
1130 moduleNumber = moduleNumber_barrel3[iside];
1131 moduleHits_B[moduleNumber]++;
1135 if (layer_or_wheel == 0) {
1136 moduleNumber = moduleNumber_barrel1[iside];
1137 HLmoduleHits_B[moduleNumber]++;
1138 }
else if (layer_or_wheel == 1) {
1139 moduleNumber = moduleNumber_barrel2[iside];
1140 HLmoduleHits_B[moduleNumber]++;
1141 }
else if (layer_or_wheel == 2) {
1142 moduleNumber = moduleNumber_barrel3[iside];
1143 HLmoduleHits_B[moduleNumber]++;
1146 }
else if (ibe == 1) {
1147 if (layer_or_wheel < 6) {
1148 moduleNumber = moduleNumber_endcapA[iside];
1149 moduleHits_E[moduleNumber]++;
1150 }
else if (layer_or_wheel > 5) {
1151 moduleNumber = moduleNumber_endcapB[iside];
1152 moduleHits_E[moduleNumber]++;
1156 if (layer_or_wheel < 6) {
1157 moduleNumber = moduleNumber_endcapA[iside];
1158 HLmoduleHits_E[moduleNumber]++;
1159 }
else if (layer_or_wheel > 5) {
1160 moduleNumber = moduleNumber_endcapB[iside];
1161 HLmoduleHits_E[moduleNumber]++;
1170 for (
int iGas = 0; iGas < 2; iGas++) {
1172 if (scale_hHitWMap[0][iGas].at(k) - scale_hHitWMap_B_passed[iGas][k] >= 0) {
1173 for (
int j = 0; j < scale_hHitWMap[0][iGas].at(k) - scale_hHitWMap_B_passed[iGas][k]; j++) {
1177 this_struct.
isAr = iGas > 0 ? true :
false;
1183 ATH_MSG_ERROR(
"Scale value " << scale_hHitWMap[0][iGas].at(k) - scale_hHitWMap_B_passed[iGas][k] <<
1184 " is less than zero in scaling for Barrel, iGas = " << iGas <<
", k = " << k);
1186 }
catch (out_of_range &e) {
1187 ATH_MSG_ERROR(
"Index " << k <<
" out of range in scaling for Barrel");
1194 for (
int iside = 0; iside < 2; iside++) {
1195 for (
int iGas = 0; iGas < 2; iGas++) {
1197 if (scale_hHitWMap[iside + 1][iGas].at(k) - scale_hHitWMap_E_passed[iside][iGas][k] >= 0) {
1198 for (
int j = 0; j < scale_hHitWMap[iside + 1][iGas].at(k) - scale_hHitWMap_E_passed[iside][iGas][k]; j++) {
1202 this_struct.
isAr = iGas > 0 ? true :
false;
1208 ATH_MSG_ERROR(
"Scale value " << scale_hHitWMap[iside + 1][iGas].at(k) - scale_hHitWMap_E_passed[iside][iGas][k] <<
1209 " is less than zero in scaling for Endcap, iside = " << iside <<
", iGas = " << iGas <<
", k = " << k);
1211 }
catch (out_of_range &e) {
1212 ATH_MSG_ERROR(
"Index " << k <<
" out of range in scaling for Endcap");
1221 for (
int iside = 0; iside < 2; iside++) {
1223 int iphi_module = -999;;
1224 if (iside == 0) iphi_module = phi_module;
else if (iside == 1) iphi_module = phi_module + 32;
1225 if (scale_hHitHWMapS_B_passed[iphi_module][k] < 2 || scale_hHitWMapS_B_passed[iphi_module][k] < 2 ||
1226 scale_hHitAMapS_B_passed[iphi_module][k] < 2 || scale_hHitAWMapS_B_passed[iphi_module][k] < 2 ||
1227 scale_hHitHMapS_B_passed[iphi_module][k] < 2) {
1228 for (
int l = 0; l < 1 - scale_hHitHWMapS_B_passed[iphi_module][k]; l++){
1234 for (
int l = 0; l < 1 - scale_hHitWMapS_B_passed[iphi_module][k]; l++){
1240 for (
int l = 0; l < 1 - scale_hHitAMapS_B_passed[iphi_module][k]; l++){
1246 for (
int l = 0; l < 1 - scale_hHitAWMapS_B_passed[iphi_module][k]; l++){
1252 for (
int l = 0; l < 1 - scale_hHitHMapS_B_passed[iphi_module][k]; l++){
1259 ATH_MSG_ERROR(
"Scale value is less than zero in normalization for Barrel straw!");
1267 for (
int iside = 0; iside < 2; iside++) {
1269 int iphi_module = -999;;
1270 if (iside == 0) iphi_module = phi_module;
else if (iside == 1) iphi_module = phi_module + 32;
1271 if (scale_hHitHWMapC_B_passed[iphi_module][k] < 17 || scale_hHitWMapC_B_passed[iphi_module][k] < 17 ||
1272 scale_hHitAMapC_B_passed[iphi_module][k] < 17 || scale_hHitAWMapC_B_passed[iphi_module][k] < 17 ||
1273 scale_hHitHMapC_B_passed[iphi_module][k] < 17) {
1274 for (
int l = 0; l < 16*1. - scale_hHitHWMapC_B_passed[iphi_module][k]; l++){
1275 chip_struct_prob& this_struct = chip_map_prob[0][iphi_module].emplace_back();
1280 for (
int l = 0; l < 16*1. - scale_hHitWMapC_B_passed[iphi_module][k]; l++){
1281 chip_struct_prob& this_struct = chip_map_prob[0][iphi_module].emplace_back();
1286 for (
int l = 0; l < 16*1. - scale_hHitAMapC_B_passed[iphi_module][k]; l++){
1287 chip_struct_prob& this_struct = chip_map_prob[0][iphi_module].emplace_back();
1292 for (
int l = 0; l < 16*1. - scale_hHitAWMapC_B_passed[iphi_module][k]; l++){
1293 chip_struct_prob& this_struct = chip_map_prob[0][iphi_module].emplace_back();
1298 for (
int l = 0; l < 16*1. - scale_hHitHMapC_B_passed[iphi_module][k]; l++){
1299 chip_struct_prob& this_struct = chip_map_prob[0][iphi_module].emplace_back();
1305 ATH_MSG_ERROR(
"Scale value is less than zero in normalization for Barrel chip!");
1313 for (
int iside = 0; iside < 2; iside++) {
1315 int iphi_module = -999;;
1316 if (iside == 0) iphi_module = phi_module;
else if (iside == 1) iphi_module = phi_module + 32;
1317 if (scale_hHitHWMapS_E_passed[iphi_module][k] < 2 || scale_hHitWMapS_E_passed[iphi_module][k] < 2 ||
1318 scale_hHitAMapS_E_passed[iphi_module][k] < 2 || scale_hHitAWMapS_E_passed[iphi_module][k] < 2 ||
1319 scale_hHitHMapS_E_passed[iphi_module][k] < 2) {
1320 for (
int l = 0; l < 1. - scale_hHitHWMapS_E_passed[iphi_module][k]; l++){
1326 for (
int l = 0; l < 1. - scale_hHitWMapS_E_passed[iphi_module][k]; l++){
1332 for (
int l = 0; l < 1. - scale_hHitAMapS_E_passed[iphi_module][k]; l++){
1338 for (
int l = 0; l < 1. - scale_hHitAWMapS_E_passed[iphi_module][k]; l++){
1344 for (
int l = 0; l < 1. - scale_hHitHMapS_E_passed[iphi_module][k]; l++){
1351 ATH_MSG_ERROR(
"Scale value is less than zero in normalization for Endcap straw!");
1359 for (
int iside = 0; iside < 2; iside++) {
1361 int iphi_module = -999;;
1362 if (iside == 0) iphi_module = phi_module;
else if (iside == 1) iphi_module = phi_module + 32;
1363 if (scale_hHitHWMapC_E_passed[iphi_module][k] < 17 || scale_hHitWMapC_E_passed[iphi_module][k] < 17 ||
1364 scale_hHitAMapC_E_passed[iphi_module][k] < 17 || scale_hHitAWMapC_E_passed[iphi_module][k] < 17 ||
1365 scale_hHitHMapC_E_passed[iphi_module][k] < 17) {
1366 for (
int l = 0; l < 16*1. - scale_hHitHWMapC_E_passed[iphi_module][k]; l++){
1367 chip_struct_prob& this_struct = chip_map_prob[1][iphi_module].emplace_back();
1372 for (
int l = 0; l < 16*1. - scale_hHitWMapC_E_passed[iphi_module][k]; l++){
1373 chip_struct_prob& this_struct = chip_map_prob[1][iphi_module].emplace_back();
1378 for (
int l = 0; l < 16*1. - scale_hHitAMapC_E_passed[iphi_module][k]; l++){
1379 chip_struct_prob& this_struct = chip_map_prob[1][iphi_module].emplace_back();
1384 for (
int l = 0; l < 16*1. - scale_hHitAWMapC_E_passed[iphi_module][k]; l++){
1385 chip_struct_prob& this_struct = chip_map_prob[1][iphi_module].emplace_back();
1390 for (
int l = 0; l < 16*1. - scale_hHitHMapC_E_passed[iphi_module][k]; l++){
1391 chip_struct_prob& this_struct = chip_map_prob[1][iphi_module].emplace_back();
1397 ATH_MSG_ERROR(
"Scale value is less than zero in normalization for Endcap chip!");
1404 for (
const auto& ibarrel_ecpair : straw_shifter_map) {
1405 int ibe = abs(ibarrel_ecpair.first) - 1;
1406 int iside = ibarrel_ecpair.first > 0 ? 0 : 1;
1408 auto HitWMap_passed =
Monitored::Collection(
"HitWMap_passed", ibarrel_ecpair.second, [](
const auto& s){return s.HitWMap_passed;});
1409 auto HitWMap_Ar_passed =
Monitored::Collection(
"HitWMap_Ar_passed", ibarrel_ecpair.second, [](
const auto& s){return s.HitWMap_Ar_passed;});
1410 auto isAr =
Monitored::Collection(
"isAr", ibarrel_ecpair.second, [](
const auto& s){return s.isAr;});
1411 auto isNotAr =
Monitored::Collection(
"isNotAr", ibarrel_ecpair.second, [](
const auto& s){return not s.isAr;});
1413 fill(
"RDOHistograms0",
strawNumber, HitWMap_passed, HitWMap_Ar_passed, isAr, isNotAr);
1414 }
else if (ibe == 1) {
1415 fill(
"RDOHistograms1"+std::to_string(iside),
strawNumber, HitWMap_passed, HitWMap_Ar_passed, isAr, isNotAr);
1420 for (
const auto& ibepair : straw_map_prob) {
1421 for (
const auto& iphi_modulepair : ibepair.second ) {
1423 auto HitHWMapS_passed =
Monitored::Collection(
"HitHWMapS_passed", iphi_modulepair.second, [](
const auto& s){return s.HitHWMapS_passed;});
1424 auto HitWMapS_passed =
Monitored::Collection(
"HitWMapS_passed", iphi_modulepair.second, [](
const auto& s){return s.HitWMapS_passed;});
1425 auto HitAMapS_passed =
Monitored::Collection(
"HitAMapS_passed", iphi_modulepair.second, [](
const auto& s){return s.HitAMapS_passed;});
1426 auto HitAWMapS_passed =
Monitored::Collection(
"HitAWMapS_passed", iphi_modulepair.second, [](
const auto& s){return s.HitAWMapS_passed;});
1427 auto HitHMapS_passed =
Monitored::Collection(
"HitHMapS_passed", iphi_modulepair.second, [](
const auto& s){return s.HitHMapS_passed;});
1428 auto HitHWMapS_cut =
Monitored::Collection(
"HitHWMapS_cut", iphi_modulepair.second, [](
const auto& s){return s.HitHWMapS_cut;});
1429 auto HitWMapS_cut =
Monitored::Collection(
"HitWMapS_cut", iphi_modulepair.second, [](
const auto& s){return s.HitWMapS_cut;});
1430 auto HitAMapS_cut =
Monitored::Collection(
"HitAMapS_cut", iphi_modulepair.second, [](
const auto& s){return s.HitAMapS_cut;});
1431 auto HitAWMapS_cut =
Monitored::Collection(
"HitAWMapS_cut", iphi_modulepair.second, [](
const auto& s){return s.HitAWMapS_cut;});
1432 auto HitHMapS_cut =
Monitored::Collection(
"HitHMapS_cut", iphi_modulepair.second, [](
const auto& s){return s.HitHMapS_cut;});
1434 fill(
"RDOStackHistograms"+std::to_string(ibepair.first)+std::to_string(iphi_modulepair.first),
strawNumber, HitHWMapS_passed, HitHWMapS_cut,
1435 HitWMapS_passed, HitWMapS_cut, HitAMapS_passed, HitAMapS_cut, HitAWMapS_passed, HitAWMapS_cut, HitHMapS_passed, HitHMapS_cut);
1439 for (
const auto& ibepair : chip_map_prob) {
1440 for (
const auto& iphi_modulepair : ibepair.second ) {
1441 auto chipNumber =
Monitored::Collection(
"chipNumber", iphi_modulepair.second, [](
const auto& s){return s.chipNumber;});
1442 auto HitHWMapC_passed =
Monitored::Collection(
"HitHWMapC_passed", iphi_modulepair.second, [](
const auto& s){return s.HitHWMapC_passed;});
1443 auto HitWMapC_passed =
Monitored::Collection(
"HitWMapC_passed", iphi_modulepair.second, [](
const auto& s){return s.HitWMapC_passed;});
1444 auto HitAMapC_passed =
Monitored::Collection(
"HitAMapC_passed", iphi_modulepair.second, [](
const auto& s){return s.HitAMapC_passed;});
1445 auto HitAWMapC_passed =
Monitored::Collection(
"HitAWMapC_passed", iphi_modulepair.second, [](
const auto& s){return s.HitAWMapC_passed;});
1446 auto HitHMapC_passed =
Monitored::Collection(
"HitHMapC_passed", iphi_modulepair.second, [](
const auto& s){return s.HitHMapC_passed;});
1447 auto HitHWMapC_cut =
Monitored::Collection(
"HitHWMapC_cut", iphi_modulepair.second, [](
const auto& s){return s.HitHWMapC_cut;});
1448 auto HitWMapC_cut =
Monitored::Collection(
"HitWMapC_cut", iphi_modulepair.second, [](
const auto& s){return s.HitWMapC_cut;});
1449 auto HitAMapC_cut =
Monitored::Collection(
"HitAMapC_cut", iphi_modulepair.second, [](
const auto& s){return s.HitAMapC_cut;});
1450 auto HitAWMapC_cut =
Monitored::Collection(
"HitAWMapC_cut", iphi_modulepair.second, [](
const auto& s){return s.HitAWMapC_cut;});
1451 auto HitHMapC_cut =
Monitored::Collection(
"HitHMapC_cut", iphi_modulepair.second, [](
const auto& s){return s.HitHMapC_cut;});
1453 fill(
"RDOStackHistograms"+std::to_string(ibepair.first)+std::to_string(iphi_modulepair.first), chipNumber, HitHWMapC_passed, HitHWMapC_cut,
1454 HitWMapC_passed, HitWMapC_cut, HitAMapC_passed, HitAMapC_cut, HitAWMapC_passed, HitAWMapC_cut, HitHMapC_passed, HitHMapC_cut);
1459 for (
const auto& ibepair : straw_map) {
1460 for (
const auto& iphi_modulepair : ibepair.second ) {
1462 auto HitTrMapS_y =
Monitored::Collection(
"HitTrMapS_y", iphi_modulepair.second, [](
const auto& s){return s.HitTrMapS_y;});
1463 auto HitToTMapS_y =
Monitored::Collection(
"HitToTMapS_y", iphi_modulepair.second, [](
const auto& s){return s.HitToTMapS_y;});
1464 auto HitToTLong_cut =
Monitored::Collection(
"HitToTLong_cut", iphi_modulepair.second, [](
const auto& s){return s.HitToTLong_cut;});
1465 auto HitTrWMapS_y =
Monitored::Collection(
"HitTrWMapS_y", iphi_modulepair.second, [](
const auto& s){return s.HitTrWMapS_y;});
1466 auto HitTrWMapS_cut =
Monitored::Collection(
"HitTrWMapS_cut", iphi_modulepair.second, [](
const auto& s){return s.HitTrWMapS_cut;});
1468 fill(
"RDOStackHistograms"+std::to_string(ibepair.first)+std::to_string(iphi_modulepair.first),
strawNumber,
1469 HitTrMapS_y, HitToTMapS_y, HitToTLong_cut, HitTrWMapS_y, HitTrWMapS_cut);
1473 for (
const auto& ibepair : chip_map) {
1474 for (
const auto& iphi_modulepair : ibepair.second ) {
1475 auto chipNumber =
Monitored::Collection(
"chipNumber", iphi_modulepair.second, [](
const auto& s){return s.chipNumber;});
1476 auto HitTrMapC_y =
Monitored::Collection(
"HitTrMapC_y", iphi_modulepair.second, [](
const auto& s){return s.HitTrMapC_y;});
1477 auto HitToTMapC_y =
Monitored::Collection(
"HitToTMapC_y", iphi_modulepair.second, [](
const auto& s){return s.HitToTMapC_y;});
1478 auto HtoBCMapC_x =
Monitored::Collection(
"HtoBCMapC_x", iphi_modulepair.second, [](
const auto& s){return s.HtoBCMapC_x;});
1479 auto HtoBCMapB_x =
Monitored::Collection(
"HtoBCMapB_x", iphi_modulepair.second, [](
const auto& s){return s.HtoBCMapB_x;});
1480 auto HtoBCMapB_y =
Monitored::Collection(
"HtoBCMapB_y", iphi_modulepair.second, [](
const auto& s){return s.HtoBCMapB_y;});
1481 auto HtoBCMap_cut =
Monitored::Collection(
"HtoBCMap_cut", iphi_modulepair.second, [](
const auto& s){return s.HtoBCMap_cut;});
1482 auto HitTrWMapC_cut =
Monitored::Collection(
"HitTrWMapC_cut", iphi_modulepair.second, [](
const auto& s){return s.HitTrWMapC_cut;});
1484 fill(
"RDOStackHistograms"+std::to_string(ibepair.first)+std::to_string(iphi_modulepair.first),
1485 chipNumber, HitTrMapC_y, HitToTMapC_y, HtoBCMapC_x, HtoBCMapB_x, HtoBCMapB_y, HtoBCMap_cut, HitTrWMapC_cut);
1489 OccAll = nhitsall/350848.;
1490 fill(
"RDOHistograms0", OccAll);
1493 for (
int ibe = 0; ibe < 2; ibe++) {
1496 BCIDvsOcc_x = good_bcid;
1497 BCIDvsOcc_y = nTRTHits[ibe]/105088.0;
1498 fill(
"RDOHistograms0", BCIDvsOcc_x, BCIDvsOcc_y);
1499 }
else if (ibe == 1) {
1500 BCIDvsOcc_x = good_bcid;
1501 BCIDvsOcc_y = nTRTHits[ibe]/245760.0;
1502 fill(
"RDOHistograms1", BCIDvsOcc_x, BCIDvsOcc_y);
1505 for (
int iside = 0; iside < 2; iside++) {
1506 for (
int i = 1; i <= numberOfStacks_b[ibe]; i++) {
1509 int modulenum_tmp = 0;
1513 modulenum_tmp = i - 1;
1514 }
else if (iside == 1) {
1517 if (ibe == 0) modulenum_tmp = (i - 1) + 96;
1518 else if (ibe == 1) modulenum_tmp = (i - 1) + 64;
1530 int LLocc_index = index_tmp - 32 * nclass;
1536 float occLL = float(moduleHits_B[modulenum_tmp]) / float(numberOfStrawsMod[nclass]);
1537 float occHL = float(HLmoduleHits_B[modulenum_tmp]) / float(numberOfStrawsMod[nclass]);
1538 AvgLLOcc_side_x = i - (32 * nclass);
1539 AvgLLOcc_side_y = occLL;
1540 AvgHLOcc_side_x = i - (32 * nclass);
1541 AvgHLOcc_side_y = occHL;
1542 AvgLLOccMod_side_x = i;
1543 AvgLLOccMod_side_y = occLL;
1544 AvgHLOccMod_side_x = i;
1545 AvgHLOccMod_side_y = occHL;
1546 }
else if (ibe == 1) {
1547 float occLL = float(moduleHits_E[modulenum_tmp]) / float(numberOfStrawsWheel[nclass]);
1548 float occHL = float(HLmoduleHits_E[modulenum_tmp]) / float(numberOfStrawsWheel[nclass]);
1550 if (LLocc_index < 64) {
1554 AvgLLOcc_side_x = i - (32 * nclass);
1555 AvgLLOcc_side_y = occLL;
1556 AvgHLOcc_side_x = i - (32 * nclass);
1557 AvgHLOcc_side_y = occHL;
1558 AvgLLOccMod_side_x = i;
1559 AvgLLOccMod_side_y = occLL;
1560 AvgHLOccMod_side_x = i;
1561 AvgHLOccMod_side_y = occHL;
1563 fill(
"RDOLLHLOccHistograms"+std::to_string(ibe)+std::to_string(iside), AvgLLOcc_side_x, AvgLLOcc_side_y, AvgHLOcc_side_x, AvgHLOcc_side_y,
1564 AvgLLOccMod_side_x, AvgLLOccMod_side_y, AvgHLOccMod_side_x, AvgHLOccMod_side_y);
1574 const unsigned int lumiBlock = eventInfo.
lumiBlock();
1576 int lastLumiBlock = -99;
1577 if ((
int)lumiBlock != lastLumiBlock) {
1578 lastLumiBlock = lumiBlock;
1580 float evtLumiBlock = 1.;
1581 float lumiBlockScale = (evtLumiBlock > 0) ? (1. / evtLumiBlock) : 0;
1582 const float barrelConst = 1. / 105088;
1583 const float endcapConst = 1. / 122880;
1586 NHitsperLB_x = lastLumiBlock;
1587 NHitsperLB_y = (float)nHitsperLB_B * lumiBlockScale * barrelConst;
1588 fill(
"RDOShiftRebinnedBarrelHistograms0", NHitsperLB_x, NHitsperLB_y);
1589 NHLHitsperLB_x = lastLumiBlock;
1590 NHLHitsperLB_y = (float)nHLHitsperLB_B * lumiBlockScale * barrelConst;
1591 fill(
"RDOShiftRebinnedBarrelHistograms0", NHLHitsperLB_x, NHLHitsperLB_y);
1593 for (
int iside = 0; iside < 2; iside++) {
1594 NHitsperLB_x = lastLumiBlock;
1595 NHitsperLB_y = (float)nHitsperLB_E[iside] * lumiBlockScale * endcapConst;
1596 fill(
"RDOShiftRebinnedEndcapHistograms1"+std::to_string(iside), NHitsperLB_x, NHitsperLB_y);
1597 NHLHitsperLB_x = lastLumiBlock;
1598 NHLHitsperLB_y = (float)nHLHitsperLB_E[iside] * lumiBlockScale * endcapConst;
1599 fill(
"RDOShiftRebinnedEndcapHistograms1"+std::to_string(iside), NHLHitsperLB_x, NHLHitsperLB_y);
1605 for (
int iside = 0; iside < 2; iside++) {
1606 nHitsperLB_E[iside] = 0;
1607 nHLHitsperLB_E[iside] = 0;
1620 const unsigned int rod_id_base[2][2] = { { 0x310000, 0x320000 }, { 0x330000, 0x340000 } };
1621 const unsigned int nChipsTotal[2][2] = { { 3328, 3328 }, { 7680, 7680 } };
1622 const unsigned int nRobsTotal[2][2] = { { 32, 32 }, { 64, 64 } };
1623 float nBSErrors[2][2] = { { 0, 0 }, { 0, 0 } };
1624 float nRobErrors[2][2] = { { 0, 0 }, { 0, 0 } };
1625 const std::set<std::pair<uint32_t, uint32_t> > *errorset1[2] = { BCIDErrorSet, L1IDErrorSet };
1627 for (
int iset = 0; iset < 2; ++iset) {
1628 for (
auto setIt = errorset1[iset]->begin(); setIt != errorset1[iset]->end(); ++setIt) {
1629 for (
int ibe = 0; ibe < 2; ++ibe) {
1630 for (
int iside = 0; iside < 2; ++iside) {
1631 if (((setIt->first >> 8) & 0xFF0000) == rod_id_base[ibe][iside]) {
1632 nBSErrors[ibe][iside] += 1. / nChipsTotal[ibe][iside];
1639 const std::set<uint32_t> *errorset2[2] = { MissingErrorSet, SidErrorSet };
1641 for (
int iset = 0; iset < 2; ++iset) {
1642 for (
auto setIt = errorset2[iset]->begin(); setIt != errorset2[iset]->end(); ++setIt) {
1643 for (
int ibe = 0; ibe < 2; ++ibe) {
1644 for (
int iside = 0; iside < 2; ++iside) {
1645 if (((*setIt >> 8) & 0xFF0000) == rod_id_base[ibe][iside]) {
1646 nBSErrors[ibe][iside] += 1. / nChipsTotal[ibe][iside];
1653 for (
int ibe = 0; ibe < 2; ++ibe) {
1654 for (
int iside = 0; iside < 2; ++iside) {
1655 ChipBSErrorsVsLB_x = lumiBlock;
1656 ChipBSErrorsVsLB_y = nBSErrors[ibe][iside];
1657 for (
unsigned int i = 0; i < lumiBlock; i++) {
1659 fill(
"RDOShiftSmryRebinnedHistograms"+std::to_string(ibe)+std::to_string(iside), ChipBSErrorsVsLB_x, ChipBSErrorsVsLB_y);
1664 for (
auto setIt = RobStatusErrorSet->begin(); setIt != RobStatusErrorSet->end(); ++setIt) {
1665 for (
int ibe = 0; ibe < 2; ++ibe) {
1666 for (
int iside = 0; iside < 2; ++iside) {
1667 if (setIt->first % rod_id_base[ibe][iside] < 0xffff) {
1668 nRobErrors[ibe][iside] += 1. / nRobsTotal[ibe][iside];
1674 for (
int ibe = 0; ibe < 2; ++ibe) {
1675 for (
int iside = 0; iside < 2; ++iside) {
1676 RobBSErrorsVsLB_x = lumiBlock;
1677 RobBSErrorsVsLB_y = nRobErrors[ibe][iside];
1678 for (
unsigned int i = 0; i < lumiBlock; i++) {
1680 fill(
"RDOShiftSmryRebinnedHistograms"+std::to_string(ibe)+std::to_string(iside), RobBSErrorsVsLB_x, RobBSErrorsVsLB_y);
1686 return StatusCode::SUCCESS;
1723 const float invGeV = 1. / CLHEP::GeV;
1724 const float invmm = 1. / CLHEP::mm;
1727 float track_eta = 0;
1728 float track_phi = 0;
1731 const std::string histoName{
"TRTEfficiencyHistograms"};
1732 for (
auto track = combTrackCollection.
begin(); track != combTrackCollection.
end(); ++track) {
1738 const Trk::Perigee *perigee = (*track)->perigeeParameters();
1741 track_pt = perigee->
pT();
1742 track_eta = perigee->
eta();
1743 track_phi = perigee->parameters()[
Trk::phi0];
1744 track_d0 = perigee->parameters()[
Trk::d0];
1745 track_z0 = perigee->parameters()[
Trk::z0];
1747 <<
" pT = " << track_pt *
invGeV <<
" GeV" <<
"\n"
1748 <<
" eta = " << track_eta <<
"\n"
1749 <<
" phi0 = " << track_phi <<
"\n"
1750 <<
" d0 = " << track_d0 * invmm <<
"\n"
1751 <<
" z0 = " << track_z0 * invmm <<
"\n"
1752 <<
" theta = " << perigee->parameters()[
Trk::theta] <<
"\n"
1753 <<
" qOverP = " << perigee->parameters()[
Trk::qOverP]);
1762 ATH_MSG_DEBUG(
"This track has " << track_states->
size() <<
" track states on surface.");
1764 ATH_MSG_DEBUG(
"This track has null track states on surface.");
1768 const std::unique_ptr<const Trk::TrackSummary> summary(
m_TrackSummaryTool->summary(ctx,*(*track)));
1775 p = (perigee->parameters()[
Trk::qOverP] != 0.) ? std::abs(1. / (perigee->parameters()[
Trk::qOverP])) : 1.0e+08;
1786 <<
" and nsct = " << n_sct_hits
1787 <<
" and npix = " << n_pixel_hits);
1789 if (!passed_track_preselection) {
1796 for (
auto it = track_states->
begin(); it != track_states->
end(); it++) {
1801 if (!track_parameters)
continue;
1815 int ibe = abs(barrel_ec) - 1;
1816 int iside = barrel_ec > 0 ? 0 : 1;
1820 EfficiencyBarrel_locR_Ar = locR;
1821 EfficiencyBarrel_locR_Ar_passed = 1.0;
1822 fill(
"TRTEfficiencyHistogramsBarrel", EfficiencyBarrel_locR_Ar_passed, EfficiencyBarrel_locR_Ar);
1824 EfficiencyBarrel_locR = locR;
1825 EfficiencyBarrel_locR_passed = 1.0;
1826 fill(
"TRTEfficiencyHistogramsBarrel", EfficiencyBarrel_locR_passed, EfficiencyBarrel_locR);
1828 }
else if (ibe == 1) {
1830 EfficiencyBarrel_locR_Ar = locR;
1831 EfficiencyBarrel_locR_Ar_passed = 1.0;
1832 fill(
"TRTEfficiencyHistogramsEndCap"+std::to_string(iside), EfficiencyBarrel_locR_Ar_passed, EfficiencyBarrel_locR_Ar);
1834 EfficiencyEndCap_locR = locR;
1835 EfficiencyEndCap_locR_passed = 1.0;
1836 fill(
"TRTEfficiencyHistogramsEndCap"+std::to_string(iside), EfficiencyEndCap_locR_passed, EfficiencyEndCap_locR);
1840 if (std::abs(locR) >= 1.3)
continue;
1842 int thisStrawNumber = 0;
1846 thisStrawNumber =
strawNumber(straw, straw_layer, layer_or_wheel);
1848 if (thisStrawNumber >= 0 && thisStrawNumber <
s_Straw_max[ibe])
1849 chip =
m_mat_chip_B.at(phi_module).at(thisStrawNumber);
1850 }
else if (ibe == 1) {
1851 thisStrawNumber =
strawNumberEndCap(straw, straw_layer, layer_or_wheel, phi_module, barrel_ec);
1853 if (thisStrawNumber >= 0 && thisStrawNumber <
s_Straw_max[ibe])
1854 chip =
m_mat_chip_E.at(phi_module).at(thisStrawNumber);
1858 EfficiencyBarrelMap = thisStrawNumber;
1859 EfficiencyBarrelMap_passed = 1.0;
1860 fill(
"TRTEfficiencyHistogramsBarrel", EfficiencyBarrelMap_passed, EfficiencyBarrelMap);
1861 }
else if (ibe == 1) {
1862 EfficiencyEndCapMap = thisStrawNumber;
1863 EfficiencyEndCapMap_passed = 1.0;
1864 fill(
"TRTEfficiencyHistogramsEndCap", EfficiencyEndCapMap_passed, EfficiencyEndCapMap);
1869 EfficiencyS = thisStrawNumber;
1870 EfficiencyS_passed = 1.0;
1871 fill(histoName+std::to_string(ibe)+std::to_string(phi_module), EfficiencyS_passed, EfficiencyS);
1873 EfficiencyC_passed = 1.0;
1874 fill(histoName+std::to_string(ibe)+std::to_string(phi_module), EfficiencyC_passed, EfficiencyC);
1875 }
else if (iside == 1) {
1876 EfficiencyS = thisStrawNumber;
1877 EfficiencyS_passed = 1.0;
1878 fill(histoName+std::to_string(ibe)+std::to_string(phi_module + 32), EfficiencyS_passed, EfficiencyS);
1880 EfficiencyC_passed = 1.0;
1881 fill(histoName+std::to_string(ibe)+std::to_string(phi_module + 32), EfficiencyC_passed, EfficiencyC);
1885 Efficiency_eta_passed = track_eta;
1886 Efficiency_eta = 1.0;
1887 fill(histoName, Efficiency_eta_passed, Efficiency_eta);
1888 Efficiency_phi_passed = track_phi;
1889 Efficiency_phi = 1.0;
1890 fill(histoName, Efficiency_phi_passed, Efficiency_phi);
1891 Efficiency_pt_passed = track_pt*
invGeV;
1892 Efficiency_pt = 1.0;
1893 fill(histoName, Efficiency_pt_passed, Efficiency_pt);
1894 Efficiency_z0_passed = track_z0;
1895 Efficiency_z0 = 1.0;
1896 fill(histoName, Efficiency_z0_passed, Efficiency_z0);
1902 std::unique_ptr<const Trk::TrackStates> holes (
m_trt_hole_finder->getHolesOnTrack(*(*track)));
1908 for (
auto it = holes->begin(); it != holes->end(); ++it) {
1913 if (!track_parameters)
continue;
1927 int ibe = abs(barrel_ec) - 1;
1928 int iside = barrel_ec > 0 ? 0 : 1;
1932 EfficiencyBarrel_locR_Ar = locR;
1933 EfficiencyBarrel_locR_Ar_passed = 0.0;
1934 fill(histoName, EfficiencyBarrel_locR_Ar_passed, EfficiencyBarrel_locR_Ar);
1936 EfficiencyBarrel_locR = locR;
1937 EfficiencyBarrel_locR_passed = 0.0;
1938 fill(histoName, EfficiencyBarrel_locR_passed, EfficiencyBarrel_locR);
1940 }
else if (ibe == 1) {
1942 EfficiencyEndCap_locR_Ar = locR;
1943 EfficiencyEndCap_locR_Ar_passed = 0.0;
1944 fill(
"TRTEfficiencyHistogramsEndCap"+std::to_string(iside), EfficiencyEndCap_locR_Ar_passed, EfficiencyEndCap_locR_Ar);
1946 EfficiencyEndCap_locR = locR;
1947 EfficiencyEndCap_locR_passed = 0.0;
1948 fill(
"TRTEfficiencyHistogramsEndCap"+std::to_string(iside), EfficiencyEndCap_locR_passed, EfficiencyEndCap_locR);
1952 if (std::abs(locR) >= 1.3)
continue;
1954 int thisStrawNumber = 0;
1958 thisStrawNumber =
strawNumber(straw, straw_layer, layer_or_wheel);
1960 if (thisStrawNumber >= 0 && thisStrawNumber <
s_Straw_max[ibe]) {
1961 chip =
m_mat_chip_B.at(phi_module).at(thisStrawNumber);
1963 }
else if (ibe == 1) {
1964 thisStrawNumber =
strawNumberEndCap(straw, straw_layer, layer_or_wheel, phi_module, barrel_ec);
1966 if (thisStrawNumber >= 0 && thisStrawNumber <
s_Straw_max[ibe]) {
1967 chip =
m_mat_chip_E.at(phi_module).at(thisStrawNumber);
1972 EfficiencyBarrelMap = thisStrawNumber;
1973 EfficiencyBarrelMap_passed = 0.0;
1974 fill(
"TRTEfficiencyHistogramsBarrel", EfficiencyBarrelMap_passed, EfficiencyBarrelMap);
1975 }
else if (ibe == 1) {
1976 EfficiencyEndCapMap = thisStrawNumber;
1977 EfficiencyEndCapMap_passed = 0.0;
1978 fill(
"TRTEfficiencyHistogramsEndCap", EfficiencyEndCapMap_passed, EfficiencyEndCapMap);
1983 EfficiencyS = thisStrawNumber;
1984 EfficiencyS_passed = 0.0;
1985 fill(histoName+std::to_string(ibe)+std::to_string(phi_module), EfficiencyS_passed, EfficiencyS);
1987 EfficiencyC_passed = 0.0;
1988 fill(histoName+std::to_string(ibe)+std::to_string(phi_module), EfficiencyC_passed, EfficiencyC);
1989 }
else if (iside == 1) {
1990 EfficiencyS = thisStrawNumber;
1991 EfficiencyS_passed = 0.0;
1992 fill(histoName+std::to_string(ibe)+std::to_string(phi_module + 32), EfficiencyS_passed, EfficiencyS);
1994 EfficiencyC_passed = 0.0;
1995 fill(histoName+std::to_string(ibe)+std::to_string(phi_module + 32), EfficiencyC_passed, EfficiencyC);
1998 Efficiency_eta_passed = track_eta;
1999 Efficiency_eta = 0.0;
2000 fill(histoName, Efficiency_eta_passed, Efficiency_eta);
2001 Efficiency_phi_passed = track_phi;
2002 Efficiency_phi = 0.0;
2003 fill(histoName, Efficiency_phi_passed, Efficiency_phi);
2004 Efficiency_pt_passed = track_pt*
invGeV;
2005 Efficiency_pt = 0.0;
2006 fill(histoName, Efficiency_pt_passed, Efficiency_pt);
2007 Efficiency_z0_passed = track_z0;
2008 Efficiency_z0 = 0.0;
2009 fill(histoName, Efficiency_z0_passed, Efficiency_z0);
2018 return StatusCode::SUCCESS;
2089 auto scale_hHitWonTMap_B = std::make_unique<short int[]>(
s_Straw_max[0]);
2090 auto scale_hHitWonTMap_E = std::make_unique<short int[][s_Straw_max[1]]>(2);
2091 auto scale_hHitWonTMap_B_passed = std::make_unique<short int[]>(
s_Straw_max[0]);
2092 auto scale_hHitWonTMap_E_passed = std::make_unique<short int[][s_Straw_max[1]]>(2);
2094 std::map<int,std::vector<straw_edge_struct>> straw_edge_map;
2096 auto p_trk = trackCollection.
begin();
2102 int ntrackstack[2][64];
2104 for (
int ibe = 0; ibe < 2; ibe++) {
2105 std::fill(ntrackstack[ibe], ntrackstack[ibe] + 64, 0);
2108 for (; p_trk != trackCollection.
end(); ++p_trk) {
2109 const std::unique_ptr<const Trk::TrackSummary> summary(
m_TrackSummaryTool->summary(ctx,*(*p_trk)));
2114 AllTrkPar = (*p_trk)->trackParameters();
2120 for (p_trkpariter = AllTrkPar->
begin(); p_trkpariter != AllTrkPar->
end(); ++p_trkpariter) {
2122 if ((mPer =
dynamic_cast<const Trk::Perigee *
>(*p_trkpariter)))
break;
2125 if (!mPer)
continue;
2128 float p = (mPer->parameters()[
Trk::qOverP] != 0.) ? std::abs(1. / (mPer->parameters()[
Trk::qOverP])) : 10e7;
2129 float pT = (p * sin(
theta));
2132 if (p <
m_minP)
continue;
2136 if (trackStates ==
nullptr)
continue;
2147 if (!passed_track_preselection)
continue;
2149 int nTRTHitsW[2][2];
2150 int nTRTHitsW_Ar[2][2];
2151 int nTRTHitsW_Xe[2][2];
2152 int nTRTHLHitsW[2][2];
2153 int nTRTHLHitsW_Ar[2][2];
2154 int nTRTHLHitsW_Xe[2][2];
2155 int nTRTHits_side[2][2];
2156 int nTRTHitsW_perwheel[2][18];
2157 int hitontrack[2] = {0, 0};
2158 int hitontrack_E_side[2] = {0, 0};
2160 for (
int ibe = 0; ibe < 2; ibe++) {
2161 for (
int iside = 0; iside < 2; iside++) {
2162 nTRTHits_side[ibe][iside] = -1;
2163 nTRTHitsW[ibe][iside] = 0;
2164 nTRTHitsW_Ar[ibe][iside] = 0;
2165 nTRTHitsW_Xe[ibe][iside] = 0;
2166 nTRTHLHitsW[ibe][iside] = 0;
2167 nTRTHLHitsW_Ar[ibe][iside] = 0;
2168 nTRTHLHitsW_Xe[ibe][iside] = 0;
2170 std::fill(nTRTHitsW_perwheel[ibe], nTRTHitsW_perwheel[ibe] + 18, 0);
2173 bool isBarrelOnly =
true;
2174 bool ECAhit =
false;
2175 bool ECChit =
false;
2178 int layer_or_wheel = 0;
2180 int straw_layer = 0;
2182 int nearest_straw_layer[2] = {100, 100};
2183 int nearest_straw[2] = {0, 0};
2184 int testLayer[2] = {100, 100};
2185 float phi2D[2] = {-100, -100};
2187 for (TSOSItBeginTemp = TSOSItBegin0; TSOSItBeginTemp != TSOSItEnd; ++TSOSItBeginTemp) {
2188 if ((*TSOSItBeginTemp) ==
nullptr)
continue;
2193 if (!trtCircle)
continue;
2196 if (!aTrackParam)
continue;
2199 int ibe = std::abs(barrel_ec) - 1;
2200 layer_or_wheel =
m_pTRTHelper->layer_or_wheel (DCoTId);
2205 if (layer_or_wheel >= testLayer[ibe])
continue;
2206 testLayer[ibe] = layer_or_wheel;
2208 if (straw_layer < nearest_straw_layer[ibe]) {
2209 nearest_straw_layer[ibe] = straw_layer;
2210 nearest_straw[ibe] = straw;
2214 circleElement =
nullptr;
2218 if (phi2D[0] == -999) {
2219 ATH_MSG_DEBUG(
"Track did not go through inner layer of Barrel.");
2222 testLayer[0] <<
" m_straw_layer: " <<
2223 nearest_straw_layer[0] <<
" (in the Barrel).");
2226 if (phi2D[1] == -999) {
2227 ATH_MSG_DEBUG(
"Track did not go through any inner layer of EndCap A or C.");
2230 testLayer[1] <<
" m_straw_layer: " <<
2231 nearest_straw_layer[1] <<
" (in the EndCaps).");
2234 bool trackfound[2][64];
2236 for (
int i = 0; i < 2; i++) {
2237 std::fill(trackfound[i], trackfound[i] + 64,
false);
2240 for (TSOSItBegin = TSOSItBegin0; TSOSItBegin != TSOSItEnd; ++TSOSItBegin) {
2242 if ((*TSOSItBegin) ==
nullptr)
continue;
2248 if (!trtCircle)
continue;
2252 if (!aTrackParam)
continue;
2260 int ibe = std::abs(barrel_ec) - 1;
2261 int iside = barrel_ec > 0 ? 0 : 1;
2262 int thisStrawNumber[2] = {-1, -1};
2263 int chip[2] = {0, 0};
2266 thisStrawNumber[ibe] =
strawNumber(straw, straw_layer, layer_or_wheel);
2268 if (thisStrawNumber[ibe] >= 0 && thisStrawNumber[ibe] <
s_Straw_max[ibe]) {
2269 chip[ibe] =
m_mat_chip_B.at(phi_module).at(thisStrawNumber[ibe]);
2271 }
else if (ibe == 1) {
2272 thisStrawNumber[ibe] =
strawNumberEndCap(straw, straw_layer, layer_or_wheel, phi_module, barrel_ec);
2274 if (thisStrawNumber[ibe] >= 0 && thisStrawNumber[ibe] <
s_Straw_max[ibe]) {
2275 chip[ibe] =
m_mat_chip_E.at(phi_module).at(thisStrawNumber[ibe]);
2278 thisStrawNumber[ibe] = -1;
2281 if (thisStrawNumber[ibe] < 0 || thisStrawNumber[ibe] >=
s_Straw_max[ibe])
continue;
2285 }
else if (barrel_ec == 2) {
2286 isBarrelOnly =
false;
2288 }
else if (barrel_ec == -2) {
2289 isBarrelOnly =
false;
2298 int iphi_module = -9999;
2300 if (iside == 0) iphi_module = phi_module;
2301 else if (iside == 1) iphi_module = phi_module + 32;
2303 trackfound[ibe][iphi_module] =
true;
2315 StrawEffDetPhi_B_passed = phi_module;
2316 StrawEffDetPhi_B = 1.0;
2317 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe), StrawEffDetPhi_B_passed, StrawEffDetPhi_B);
2319 if (
m_doStraws) scale_hHitWonTMap_B[thisStrawNumber[ibe]]++;
2322 }
else if (ibe == 1) {
2324 hitontrack_E_side[iside]++;
2327 StrawEffDetPhi_E_passed = phi_module;
2328 StrawEffDetPhi_E = 1.0;
2329 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe)+std::to_string(iside), StrawEffDetPhi_E_passed, StrawEffDetPhi_E);
2331 if (
m_doStraws) scale_hHitWonTMap_E[iside][thisStrawNumber[ibe]]++;
2336 EfficiencyS = thisStrawNumber[ibe];
2337 EfficiencyS_passed = 1.0;
2338 fill(
"TRTTrackHistograms"+std::to_string(ibe)+std::to_string(iphi_module), EfficiencyS_passed, EfficiencyS);
2342 EfficiencyC = chip[ibe] - 1;
2343 EfficiencyC_passed = 1.0;
2344 fill(
"TRTTrackHistograms"+std::to_string(ibe)+std::to_string(iphi_module), EfficiencyC_passed, EfficiencyC);
2351 StrawEffDetPhi_B_passed = phi_module;
2352 StrawEffDetPhi_B = 0.0;
2353 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe), StrawEffDetPhi_B_passed, StrawEffDetPhi_B);
2355 if (
m_doStraws) scale_hHitWonTMap_B[thisStrawNumber[ibe]]++;
2357 }
else if (ibe == 1) {
2359 StrawEffDetPhi_E_passed = phi_module;
2360 StrawEffDetPhi_E = 0.0;
2361 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe)+std::to_string(iside), StrawEffDetPhi_E_passed, StrawEffDetPhi_E);
2363 if (
m_doStraws) scale_hHitWonTMap_E[iside][thisStrawNumber[ibe]]++;
2368 EfficiencyS = thisStrawNumber[ibe];
2369 EfficiencyS_passed = 0.0;
2370 fill(
"TRTTrackHistograms"+std::to_string(ibe)+std::to_string(iphi_module), EfficiencyS_passed, EfficiencyS);
2374 EfficiencyC = chip[ibe] - 1;
2375 EfficiencyC_passed = 0.0;
2376 fill(
"TRTTrackHistograms"+std::to_string(ibe)+std::to_string(iphi_module), EfficiencyC_passed, EfficiencyC);
2381 if (RawDriftCircle) {
2382 nTRTHits_side[ibe][iside]++;
2384 int middleHTbit = RawDriftCircle->
getWord() & 0x00020000;
2386 int hitinvaliditygate = RawDriftCircle->
getWord() & 0x000DFE80;
2388 bool is_middleHTbit_high = (middleHTbit != 0);
2389 bool is_anybininVgate_high = (hitinvaliditygate != 0);
2392 HitToTonTMapS_x = thisStrawNumber[ibe];
2394 fill(
"TRTTrackHistograms"+std::to_string(ibe)+std::to_string(iphi_module), HitToTonTMapS_x, HitToTonTMapS_y);
2398 HitToTonTMapC_x = chip[ibe] - 1;
2400 fill(
"TRTTrackHistograms"+std::to_string(ibe)+std::to_string(iphi_module), HitToTonTMapC_x, HitToTonTMapC_y);
2404 if (is_middleHTbit_high) {
2405 HitHonTMapS = thisStrawNumber[ibe];
2406 fill(
"TRTTrackHistograms"+std::to_string(ibe)+std::to_string(iphi_module), HitHonTMapS);
2407 HitHWonTMapS = thisStrawNumber[ibe];
2408 fill(
"TRTTrackHistograms"+std::to_string(ibe)+std::to_string(iphi_module), HitHWonTMapS);
2410 HtoLonTMapS = thisStrawNumber[ibe];
2411 HtoLonTMapS_passed = 1.0;
2412 fill(
"TRTTrackHistograms"+std::to_string(ibe)+std::to_string(iphi_module), HtoLonTMapS_passed, HtoLonTMapS);
2413 HtoLWonTMapS = thisStrawNumber[ibe];
2414 HtoLWonTMapS_passed = 1.0;
2415 fill(
"TRTTrackHistograms"+std::to_string(ibe)+std::to_string(iphi_module), HtoLWonTMapS_passed, HtoLWonTMapS);
2420 if (is_middleHTbit_high) {
2421 HitHWonTMapC = chip[ibe] - 1;
2422 fill(
"TRTTrackHistograms"+std::to_string(ibe)+std::to_string(iphi_module), HitHWonTMapC);
2423 HitHonTMapC = chip[ibe] - 1;
2424 fill(
"TRTTrackHistograms"+std::to_string(ibe)+std::to_string(iphi_module), HitHonTMapC);
2425 HtoLonTMapC = chip[ibe] - 1;
2426 HtoLonTMapC_passed = 1.0;
2427 fill(
"TRTTrackHistograms"+std::to_string(ibe)+std::to_string(iphi_module), HtoLonTMapC_passed, HtoLonTMapC);
2428 HtoLWonTMapC = chip[ibe] - 1;
2429 HtoLWonTMapC_passed = 1.0;
2430 fill(
"TRTTrackHistograms"+std::to_string(ibe)+std::to_string(iphi_module), HtoLWonTMapC_passed, HtoLWonTMapC);
2444 scale_hHitWonTMap_B_passed[thisStrawNumber[ibe]]++;
2445 }
else if (ibe == 1) {
2446 straw_edge_struct& this_struct = straw_edge_map[iside == 0 ? 2 : -2].emplace_back();
2449 scale_hHitWonTMap_E_passed[iside][thisStrawNumber[ibe]]++;
2456 HitWonTMapS = thisStrawNumber[ibe];
2457 fill(
"TRTTrackHistograms"+std::to_string(ibe)+std::to_string(iphi_module), HitWonTMapS);
2461 HitWonTMapC = chip[ibe] - 1;
2462 fill(
"TRTTrackHistograms"+std::to_string(ibe)+std::to_string(iphi_module), HitWonTMapC);
2473 HitTronTMapS_x = thisStrawNumber[ibe];
2474 HitTronTMapS_y = trailingEdgeScaled;
2475 fill(
"TRTTrackHistograms"+std::to_string(ibe)+std::to_string(iphi_module), HitTronTMapS_x, HitTronTMapS_y);
2479 HitTronTMapC_x = chip[ibe] - 1;
2480 HitTronTMapC_y = trailingEdgeScaled;
2481 fill(
"TRTTrackHistograms"+std::to_string(ibe)+std::to_string(iphi_module), HitTronTMapC_x, HitTronTMapC_y);
2490 HitAonTMapS = thisStrawNumber[ibe];
2491 fill(
"TRTTrackHistograms"+std::to_string(ibe)+std::to_string(iphi_module), HitAonTMapS);
2493 if (!is_middleHTbit_high) {
2494 HtoLonTMapS = thisStrawNumber[ibe];
2495 HtoLonTMapS_passed = 0.0;
2496 fill(
"TRTTrackHistograms"+std::to_string(ibe)+std::to_string(iphi_module), HtoLonTMapS_passed, HtoLonTMapS);
2501 HitAonTMapC = chip[ibe] - 1;
2502 fill(
"TRTTrackHistograms"+std::to_string(ibe)+std::to_string(iphi_module), HitAonTMapC);
2503 if (!is_middleHTbit_high) {
2504 HtoLonTMapC = chip[ibe] - 1;
2505 HtoLonTMapC_passed = 0.0;
2506 fill(
"TRTTrackHistograms"+std::to_string(ibe)+std::to_string(iphi_module), HtoLonTMapC_passed, HtoLonTMapC);
2510 nTRTHitsW[ibe][iside]++;
2512 if (isArgonStraw) nTRTHitsW_Ar[ibe][iside]++;
2513 else nTRTHitsW_Xe[ibe][iside]++;
2515 nTRTHitsW_perwheel[iside][layer_or_wheel]++;
2517 if (is_middleHTbit_high) {
2518 nTRTHLHitsW[ibe][iside]++;
2519 if (isArgonStraw) nTRTHLHitsW_Ar[ibe][iside]++;
2520 else nTRTHLHitsW_Xe[ibe][iside]++;
2524 if (is_anybininVgate_high) {
2526 HitAWonTMapS = thisStrawNumber[ibe];
2527 fill(
"TRTTrackHistograms"+std::to_string(ibe)+std::to_string(iphi_module), HitAWonTMapS);
2529 if (!is_middleHTbit_high) {
2530 HtoLWonTMapS = thisStrawNumber[ibe];
2531 HtoLWonTMapS_passed = 0.0;
2532 fill(
"TRTTrackHistograms"+std::to_string(ibe)+std::to_string(iphi_module), HtoLWonTMapS_passed, HtoLWonTMapS);
2537 HitAWonTMapC = chip[ibe] - 1;
2538 fill(
"TRTTrackHistograms"+std::to_string(ibe)+std::to_string(iphi_module), HitAWonTMapC);
2540 if (!is_middleHTbit_high) {
2541 HtoLWonTMapC = chip[ibe] - 1;
2542 HtoLWonTMapC_passed = 0.0;
2543 fill(
"TRTTrackHistograms"+std::to_string(ibe)+std::to_string(iphi_module), HtoLWonTMapC_passed, HtoLWonTMapC);
2551 for (
int ibe = 0; ibe < 2; ibe++) {
2552 for (
int i = 0; i < 64; i++)
2553 if (trackfound[ibe][i])
2554 ntrackstack[ibe][i]++;
2556 if (phi2D[ibe] < 0)
continue;
2562 if (nTRTHitsW[ibe][0] > 0) {
2563 if (nTRTHitsW[ibe][1] > 0) {
2564 NumSwLLWoT_B = nTRTHitsW[ibe][0] + nTRTHitsW[ibe][1];
2565 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe), NumSwLLWoT_B);
2568 NumSwLLWoT_B = nTRTHitsW[ibe][0];
2569 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe), NumSwLLWoT_B);
2571 }
else if (nTRTHitsW[ibe][1] > 0) {
2572 NumSwLLWoT_B = nTRTHitsW[ibe][1];
2573 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe), NumSwLLWoT_B);
2577 if (nTRTHLHitsW[ibe][0] > 0) {
2578 if (nTRTHLHitsW[ibe][1] > 0) {
2579 HLhitOnTrack_B = nTRTHLHitsW[ibe][0] + nTRTHLHitsW[ibe][1];
2580 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe), HLhitOnTrack_B);
2582 HLhitOnTrack_B = nTRTHLHitsW[ibe][0];
2583 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe), HLhitOnTrack_B);
2585 }
else if (nTRTHLHitsW[ibe][1] > 0) {
2586 HLhitOnTrack_B = nTRTHLHitsW[ibe][1];
2587 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe), HLhitOnTrack_B);
2590 if (nTRTHitsW[ibe][0] + nTRTHitsW[ibe][1] > 0) {
2591 HtoLRatioOnTrack_B = (float)(nTRTHLHitsW[ibe][0] + nTRTHLHitsW[ibe][1]) / (nTRTHitsW[ibe][0] + nTRTHitsW[ibe][1]);
2592 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe), HtoLRatioOnTrack_B);
2595 if (nTRTHitsW_Ar[ibe][0] + nTRTHitsW_Ar[ibe][1] > 0) {
2596 HtoLRatioOnTrack_B_Ar = (float)(nTRTHLHitsW_Ar[ibe][0] + nTRTHLHitsW_Ar[ibe][1]) / (nTRTHitsW_Ar[ibe][0] + nTRTHitsW_Ar[ibe][1]);
2597 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe), HtoLRatioOnTrack_B_Ar);
2600 if (nTRTHitsW_Xe[ibe][0] + nTRTHitsW_Xe[ibe][1] > 0) {
2601 HtoLRatioOnTrack_B_Xe = (float)(nTRTHLHitsW_Xe[ibe][0] + nTRTHLHitsW_Xe[ibe][1]) / (nTRTHitsW_Xe[ibe][0] + nTRTHitsW_Xe[ibe][1]);
2602 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe), HtoLRatioOnTrack_B_Xe);
2604 }
else if (ibe == 1) {
2605 if (nTRTHitsW[ibe][0] > 0) {
2606 if (nTRTHitsW[ibe][1] > 0) {
2607 if (ECAhit && !ECChit && !Bhit) {
2608 NumSwLLWoT_E = nTRTHitsW[ibe][0];
2609 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe)+
"0", NumSwLLWoT_E);
2612 if (ECChit && !ECAhit && !Bhit) {
2613 NumSwLLWoT_E = nTRTHitsW[ibe][1];
2614 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe)+
"1", NumSwLLWoT_E);
2618 if (ECAhit && !ECChit && !Bhit) {
2619 NumSwLLWoT_E = nTRTHitsW[ibe][0];
2620 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe)+
"0", NumSwLLWoT_E);
2622 }
else if (nTRTHitsW[ibe][1] > 0) {
2623 if (ECChit && !ECAhit && !Bhit) {
2624 NumSwLLWoT_E = nTRTHitsW[ibe][1];
2625 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe)+
"1", NumSwLLWoT_E);
2629 for (
int iside = 0; iside < 2; iside++) {
2630 if (nTRTHLHitsW[ibe][iside] > 0) {
2631 HLhitOnTrack_E = nTRTHLHitsW[ibe][iside];
2632 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe)+std::to_string(iside), HLhitOnTrack_E);
2635 if ((nTRTHitsW[ibe][iside]) > 0) {
2636 HtoLRatioOnTrack_E = (float)(nTRTHLHitsW[ibe][iside]) / nTRTHitsW[ibe][iside];
2637 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe)+std::to_string(iside), HtoLRatioOnTrack_E);
2639 if ((nTRTHitsW_Ar[ibe][iside]) > 0) {
2640 HtoLRatioOnTrack_E_Ar = (float)(nTRTHLHitsW_Ar[ibe][iside]) / nTRTHitsW_Ar[ibe][iside];
2641 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe)+std::to_string(iside), HtoLRatioOnTrack_E_Ar);
2644 if ((nTRTHitsW_Xe[ibe][iside]) > 0) {
2645 HtoLRatioOnTrack_E_Xe = (float)(nTRTHLHitsW_Xe[ibe][iside]) / nTRTHitsW_Xe[ibe][iside];
2646 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe)+std::to_string(iside), HtoLRatioOnTrack_E_Xe);
2658 if (scale_hHitWonTMap_B[k] - scale_hHitWonTMap_B_passed[k] >= 0) {
2659 for (
int j = 0; j < scale_hHitWonTMap_B[k] - scale_hHitWonTMap_B_passed[k]; j++) {
2667 ATH_MSG_ERROR(
"Scale value " << scale_hHitWonTMap_B[k] - scale_hHitWonTMap_B_passed[k] <<
2668 " is less than zero in scaling for Barrel, k = " << k);
2670 }
catch (out_of_range &e) {
2671 ATH_MSG_ERROR(
"Index " << k <<
" out of range in scaling for Barrel");
2677 for (
int iside = 0; iside < 2; iside++) {
2679 if (scale_hHitWonTMap_E[iside][k] - scale_hHitWonTMap_E_passed[iside][k] >= 0) {
2680 for (
int j = 0; j < scale_hHitWonTMap_E[iside][k] - scale_hHitWonTMap_E_passed[iside][k]; j++) {
2682 straw_edge_struct& this_struct = straw_edge_map[iside == 0 ? 2 : -2].emplace_back();
2688 ATH_MSG_ERROR(
"Scale value " << scale_hHitWonTMap_E[iside][k] - scale_hHitWonTMap_E_passed[iside][k] <<
2689 " is less than zero in scaling for Endcap, iside = " << iside <<
", k = " << k);
2691 }
catch (out_of_range &e) {
2692 ATH_MSG_ERROR(
"Index " << k <<
" out of range in scaling for Endcap");
2697 for (
const auto& ibarrel_ecpair : straw_edge_map) {
2698 int ibe = abs(ibarrel_ecpair.first) - 1;
2699 int iside = ibarrel_ecpair.first > 0 ? 0 : 1;
2701 auto HitWonTMap_B_y =
Monitored::Collection(
"HitWonTMap_B_y", ibarrel_ecpair.second, [](
const auto& s){return s.HitWonTMap_B_y;});
2702 auto HitWonTMap_E_y =
Monitored::Collection(
"HitWonTMap_E_y", ibarrel_ecpair.second, [](
const auto& s){return s.HitWonTMap_E_y;});
2705 }
else if (ibe == 1) {
2706 fill(
"ShiftTRTTrackHistograms1"+std::to_string(iside),
strawNumber, HitWonTMap_E_y);
2710 return StatusCode::SUCCESS;