748 const unsigned int lumiBlock = eventInfo.
lumiBlock();
750 auto good_bcid = eventInfo.
bcid();
756 int numberOfStacks_b[2];
760 int numberOfStrawsMod[3];
761 numberOfStrawsMod[0] = 329;
762 numberOfStrawsMod[1] = 520;
763 numberOfStrawsMod[2] = 793;
764 int numberOfStrawsWheel[2];
765 numberOfStrawsWheel[0] = 2304;
766 numberOfStrawsWheel[1] = 1536;
767 int moduleHits_B[192];
768 int moduleHits_E[128];
769 int HLmoduleHits_B[192];
770 int HLmoduleHits_E[128];
771 int nHitsperLB_B = 0;
772 int nHLHitsperLB_B = 0;
773 int nHitsperLB_E[2] = {0, 0};
774 int nHLHitsperLB_E[2] = {0, 0};
776 for (
int i = 0; i < 192; i++) {
778 HLmoduleHits_B[i] = 0;
781 for (
int i = 0; i < 128; i++) {
783 HLmoduleHits_E[i] = 0;
786 auto scale_hHitWMap_B_passed = std::make_unique<short int[][s_Straw_max[0]]>(2);
787 auto scale_hHitWMap_E_passed = std::make_unique<short int[][2][s_Straw_max[1]]>(2);
811 int goodid_status = 0;
814 if (trtBCIDCollection) {
815 InDetTimeCollection::const_iterator itrt_bcid = trtBCIDCollection->begin();
817 while (goodid_status == 0 && itrt_bcid != trtBCIDCollection->end()) {
819 const unsigned int trt_bcid = (*itrt_bcid).second;
821 if (itrt_bcid > trtBCIDCollection->begin() && prev_bcid - trt_bcid == 0) {
823 }
else if (itrt_bcid > trtBCIDCollection->begin() && prev_bcid - trt_bcid != 0) {
825 std::hex << (*itrt_bcid).first <<
" trt bcid from ROD is " <<
826 std::hex << trt_bcid);
829 prev_bcid = trt_bcid;
842 for (
int ibe = 0; ibe < 2; ibe++) {
852 std::map<int,std::map<int, std::vector<straw_struct>>> straw_map;
853 std::map<int,std::map<int, std::vector<chip_struct>>> chip_map;
854 std::map<int,std::vector<straw_shifter_struct>> straw_shifter_map;
855 std::map<int,std::map<int, std::vector<straw_struct_prob>>> straw_map_prob;
856 std::map<int,std::map<int, std::vector<chip_struct_prob>>> chip_map_prob;
858 std::vector<std::vector<std::vector<int>>> scale_hHitWMap =
initScaleVectors(ctx);
860 for (; RDO_CollectionBegin != RDO_CollectionEnd; ++RDO_CollectionBegin) {
863 if (!TRT_Collection)
continue;
867 for (; p_rdo != TRT_Collection->
end(); ++p_rdo) {
868 int middleHTbit = (*p_rdo)->getWord() & 0x00020000;
870 int hitinvaliditygate = (*p_rdo)->getWord() & 0x000DFE80;
872 bool is_middleHTbit_high = (middleHTbit != 0);
873 bool is_anybininVgate_high = (hitinvaliditygate != 0);
874 TRT_Identifier = (*p_rdo)->identify();
878 int barrel_ec =
m_pTRTHelper->barrel_ec(TRT_Identifier);
882 if (!p_lolum)
continue;
885 int ibe = abs(barrel_ec) - 1;
886 int iside = barrel_ec > 0 ? 0 : 1;
889 if (ibe != 1 && ibe != 0) {
890 ATH_MSG_DEBUG(
"TRT part retrieved from TRT Identifier is not a barrel or an endcap");
894 int moduleNumber_barrel1[2];
895 int moduleNumber_barrel2[2];
896 int moduleNumber_barrel3[2];
897 int moduleNumber_endcapA[2];
898 int moduleNumber_endcapB[2];
902 TRT_Identifier = p_lolum->
identify();
905 int phi_module =
m_pTRTHelper->phi_module(TRT_Identifier);
906 int layer_or_wheel =
m_pTRTHelper->layer_or_wheel(TRT_Identifier);
907 int straw_layer =
m_pTRTHelper->straw_layer(TRT_Identifier);
913 bool is_barrel =
m_pTRTHelper->is_barrel(TRT_Identifier);
916 if ( is_barrel && ibe == 0 ) {
917 thisStrawNumber =
strawNumber(straw, straw_layer, layer_or_wheel);
919 if (thisStrawNumber >= 0 && thisStrawNumber <
s_Straw_max[ibe]) {
925 }
else if ( !is_barrel && ibe == 1 ) {
926 thisStrawNumber =
strawNumberEndCap(straw, straw_layer, layer_or_wheel, phi_module, barrel_ec);
928 if (thisStrawNumber >= 0 && thisStrawNumber <
s_Straw_max[ibe]) {
934 thisStrawNumber = -1;
937 if (thisStrawNumber < 0 || thisStrawNumber >=
s_Straw_max[ibe]) {
938 ATH_MSG_WARNING(
"Found m_strawNumber = " << thisStrawNumber <<
" out of range.");
943 const bool highlevel = is_middleHTbit_high;
947 moduleNumber_barrel1[0] = phi_module;
948 moduleNumber_barrel1[1] = phi_module + 96;
953 moduleNumber_endcapA[0] = phi_module;
954 moduleNumber_endcapA[1] = phi_module + 64;
957 int iphi_module = -999;
960 iphi_module = phi_module;
961 }
else if (iside == 1) {
962 iphi_module = phi_module + 32;
968 this_struct.
isAr = isArgonStraw;
971 if (abs(barrel_ec) == 1) scale_hHitWMap_B_passed[isArgonStraw ? 1 : 0][thisStrawNumber]++;
972 if (abs(barrel_ec) == 2) scale_hHitWMap_E_passed[barrel_ec < 0 ? 1 : 0][isArgonStraw ? 1 : 0][thisStrawNumber]++;
985 }
else if (ibe == 1) {
989 nHitsperLB_E[iside]++;
992 nHLHitsperLB_E[iside]++;
999 straw_struct_prob& this_struct = straw_map_prob[ibe][iphi_module].emplace_back();
1001 this_struct.
HitHWMapS_cut = highlevel && is_middleHTbit_high;
1012 if (highlevel && is_middleHTbit_high) scale_hHitHWMapS_B_passed[iphi_module][thisStrawNumber]++;
1015 if (is_anybininVgate_high) scale_hHitAWMapS_B_passed[iphi_module][thisStrawNumber]++;
1016 if (highlevel) scale_hHitHMapS_B_passed[iphi_module][thisStrawNumber]++;
1019 if (highlevel && is_middleHTbit_high) scale_hHitHWMapS_E_passed[iphi_module][thisStrawNumber]++;
1022 if (is_anybininVgate_high) scale_hHitAWMapS_E_passed[iphi_module][thisStrawNumber]++;
1023 if (highlevel) scale_hHitHMapS_E_passed[iphi_module][thisStrawNumber]++;
1030 straw_struct& this_struct = straw_map[ibe][iphi_module].emplace_back();
1039 HtoLMapS = thisStrawNumber;
1040 HtoLMapS_passed = 1.0;
1041 fill(
"RDOStackHistograms"+std::to_string(ibe)+std::to_string(iphi_module), HtoLMapS_passed, HtoLMapS);
1043 HtoLMapS = thisStrawNumber;
1044 HtoLMapS_passed = 0.0;
1045 fill(
"RDOStackHistograms"+std::to_string(ibe)+std::to_string(iphi_module), HtoLMapS_passed, HtoLMapS);
1050 chip_struct_prob& this_struct = chip_map_prob[ibe][iphi_module].emplace_back();
1052 this_struct.
HitHWMapC_cut = highlevel && is_middleHTbit_high;
1063 if (highlevel && is_middleHTbit_high) scale_hHitHWMapC_B_passed[iphi_module][chip - 1]++;
1066 if (is_anybininVgate_high) scale_hHitAWMapC_B_passed[iphi_module][chip - 1]++;
1067 if (highlevel) scale_hHitHMapC_B_passed[iphi_module][chip - 1]++;
1070 if (highlevel && is_middleHTbit_high) scale_hHitHWMapC_E_passed[iphi_module][chip - 1]++;
1073 if (is_anybininVgate_high) scale_hHitAWMapC_E_passed[iphi_module][chip - 1]++;
1074 if (highlevel) scale_hHitHMapC_E_passed[iphi_module][chip - 1]++;
1079 chip_struct& this_struct = chip_map[ibe][iphi_module].emplace_back();
1107 HtoLMapC = chip - 1;
1108 HtoLMapC_passed = 1.0;
1109 fill(
"RDOStackHistograms"+std::to_string(ibe)+std::to_string(iphi_module), HtoLMapC_passed, HtoLMapC);
1111 HtoLMapC = chip - 1;
1112 HtoLMapC_passed = 0.0;
1113 fill(
"RDOStackHistograms"+std::to_string(ibe)+std::to_string(iphi_module), HtoLMapC_passed, HtoLMapC);
1119 int moduleNumber = -1;
1122 if (layer_or_wheel == 0) {
1123 moduleNumber = moduleNumber_barrel1[iside];
1124 moduleHits_B[moduleNumber]++;
1125 }
else if (layer_or_wheel == 1) {
1126 moduleNumber = moduleNumber_barrel2[iside];
1127 moduleHits_B[moduleNumber]++;
1128 }
else if (layer_or_wheel == 2) {
1129 moduleNumber = moduleNumber_barrel3[iside];
1130 moduleHits_B[moduleNumber]++;
1134 if (layer_or_wheel == 0) {
1135 moduleNumber = moduleNumber_barrel1[iside];
1136 HLmoduleHits_B[moduleNumber]++;
1137 }
else if (layer_or_wheel == 1) {
1138 moduleNumber = moduleNumber_barrel2[iside];
1139 HLmoduleHits_B[moduleNumber]++;
1140 }
else if (layer_or_wheel == 2) {
1141 moduleNumber = moduleNumber_barrel3[iside];
1142 HLmoduleHits_B[moduleNumber]++;
1145 }
else if (ibe == 1) {
1146 if (layer_or_wheel < 6) {
1147 moduleNumber = moduleNumber_endcapA[iside];
1148 moduleHits_E[moduleNumber]++;
1149 }
else if (layer_or_wheel > 5) {
1150 moduleNumber = moduleNumber_endcapB[iside];
1151 moduleHits_E[moduleNumber]++;
1155 if (layer_or_wheel < 6) {
1156 moduleNumber = moduleNumber_endcapA[iside];
1157 HLmoduleHits_E[moduleNumber]++;
1158 }
else if (layer_or_wheel > 5) {
1159 moduleNumber = moduleNumber_endcapB[iside];
1160 HLmoduleHits_E[moduleNumber]++;
1169 for (
int iGas = 0; iGas < 2; iGas++) {
1171 if (scale_hHitWMap[0][iGas].at(k) - scale_hHitWMap_B_passed[iGas][k] >= 0) {
1172 for (
int j = 0; j < scale_hHitWMap[0][iGas].at(k) - scale_hHitWMap_B_passed[iGas][k]; j++) {
1176 this_struct.
isAr = iGas > 0 ? true :
false;
1182 ATH_MSG_ERROR(
"Scale value " << scale_hHitWMap[0][iGas].at(k) - scale_hHitWMap_B_passed[iGas][k] <<
1183 " is less than zero in scaling for Barrel, iGas = " << iGas <<
", k = " << k);
1185 }
catch (out_of_range &e) {
1186 ATH_MSG_ERROR(
"Index " << k <<
" out of range in scaling for Barrel");
1193 for (
int iside = 0; iside < 2; iside++) {
1194 for (
int iGas = 0; iGas < 2; iGas++) {
1196 if (scale_hHitWMap[iside + 1][iGas].at(k) - scale_hHitWMap_E_passed[iside][iGas][k] >= 0) {
1197 for (
int j = 0; j < scale_hHitWMap[iside + 1][iGas].at(k) - scale_hHitWMap_E_passed[iside][iGas][k]; j++) {
1201 this_struct.
isAr = iGas > 0 ? true :
false;
1207 ATH_MSG_ERROR(
"Scale value " << scale_hHitWMap[iside + 1][iGas].at(k) - scale_hHitWMap_E_passed[iside][iGas][k] <<
1208 " is less than zero in scaling for Endcap, iside = " << iside <<
", iGas = " << iGas <<
", k = " << k);
1210 }
catch (out_of_range &e) {
1211 ATH_MSG_ERROR(
"Index " << k <<
" out of range in scaling for Endcap");
1220 for (
int iside = 0; iside < 2; iside++) {
1222 int iphi_module = -999;;
1223 if (iside == 0) iphi_module = phi_module;
else if (iside == 1) iphi_module = phi_module + 32;
1224 if (scale_hHitHWMapS_B_passed[iphi_module][k] < 2 || scale_hHitWMapS_B_passed[iphi_module][k] < 2 ||
1225 scale_hHitAMapS_B_passed[iphi_module][k] < 2 || scale_hHitAWMapS_B_passed[iphi_module][k] < 2 ||
1226 scale_hHitHMapS_B_passed[iphi_module][k] < 2) {
1227 for (
int l = 0; l < 1 - scale_hHitHWMapS_B_passed[iphi_module][k]; l++){
1233 for (
int l = 0; l < 1 - scale_hHitWMapS_B_passed[iphi_module][k]; l++){
1239 for (
int l = 0; l < 1 - scale_hHitAMapS_B_passed[iphi_module][k]; l++){
1245 for (
int l = 0; l < 1 - scale_hHitAWMapS_B_passed[iphi_module][k]; l++){
1251 for (
int l = 0; l < 1 - scale_hHitHMapS_B_passed[iphi_module][k]; l++){
1258 ATH_MSG_ERROR(
"Scale value is less than zero in normalization for Barrel straw!");
1266 for (
int iside = 0; iside < 2; iside++) {
1268 int iphi_module = -999;;
1269 if (iside == 0) iphi_module = phi_module;
else if (iside == 1) iphi_module = phi_module + 32;
1270 if (scale_hHitHWMapC_B_passed[iphi_module][k] < 17 || scale_hHitWMapC_B_passed[iphi_module][k] < 17 ||
1271 scale_hHitAMapC_B_passed[iphi_module][k] < 17 || scale_hHitAWMapC_B_passed[iphi_module][k] < 17 ||
1272 scale_hHitHMapC_B_passed[iphi_module][k] < 17) {
1273 for (
int l = 0; l < 16*1. - scale_hHitHWMapC_B_passed[iphi_module][k]; l++){
1274 chip_struct_prob& this_struct = chip_map_prob[0][iphi_module].emplace_back();
1279 for (
int l = 0; l < 16*1. - scale_hHitWMapC_B_passed[iphi_module][k]; l++){
1280 chip_struct_prob& this_struct = chip_map_prob[0][iphi_module].emplace_back();
1285 for (
int l = 0; l < 16*1. - scale_hHitAMapC_B_passed[iphi_module][k]; l++){
1286 chip_struct_prob& this_struct = chip_map_prob[0][iphi_module].emplace_back();
1291 for (
int l = 0; l < 16*1. - scale_hHitAWMapC_B_passed[iphi_module][k]; l++){
1292 chip_struct_prob& this_struct = chip_map_prob[0][iphi_module].emplace_back();
1297 for (
int l = 0; l < 16*1. - scale_hHitHMapC_B_passed[iphi_module][k]; l++){
1298 chip_struct_prob& this_struct = chip_map_prob[0][iphi_module].emplace_back();
1304 ATH_MSG_ERROR(
"Scale value is less than zero in normalization for Barrel chip!");
1312 for (
int iside = 0; iside < 2; iside++) {
1314 int iphi_module = -999;;
1315 if (iside == 0) iphi_module = phi_module;
else if (iside == 1) iphi_module = phi_module + 32;
1316 if (scale_hHitHWMapS_E_passed[iphi_module][k] < 2 || scale_hHitWMapS_E_passed[iphi_module][k] < 2 ||
1317 scale_hHitAMapS_E_passed[iphi_module][k] < 2 || scale_hHitAWMapS_E_passed[iphi_module][k] < 2 ||
1318 scale_hHitHMapS_E_passed[iphi_module][k] < 2) {
1319 for (
int l = 0; l < 1. - scale_hHitHWMapS_E_passed[iphi_module][k]; l++){
1325 for (
int l = 0; l < 1. - scale_hHitWMapS_E_passed[iphi_module][k]; l++){
1331 for (
int l = 0; l < 1. - scale_hHitAMapS_E_passed[iphi_module][k]; l++){
1337 for (
int l = 0; l < 1. - scale_hHitAWMapS_E_passed[iphi_module][k]; l++){
1343 for (
int l = 0; l < 1. - scale_hHitHMapS_E_passed[iphi_module][k]; l++){
1350 ATH_MSG_ERROR(
"Scale value is less than zero in normalization for Endcap straw!");
1358 for (
int iside = 0; iside < 2; iside++) {
1360 int iphi_module = -999;;
1361 if (iside == 0) iphi_module = phi_module;
else if (iside == 1) iphi_module = phi_module + 32;
1362 if (scale_hHitHWMapC_E_passed[iphi_module][k] < 17 || scale_hHitWMapC_E_passed[iphi_module][k] < 17 ||
1363 scale_hHitAMapC_E_passed[iphi_module][k] < 17 || scale_hHitAWMapC_E_passed[iphi_module][k] < 17 ||
1364 scale_hHitHMapC_E_passed[iphi_module][k] < 17) {
1365 for (
int l = 0; l < 16*1. - scale_hHitHWMapC_E_passed[iphi_module][k]; l++){
1366 chip_struct_prob& this_struct = chip_map_prob[1][iphi_module].emplace_back();
1371 for (
int l = 0; l < 16*1. - scale_hHitWMapC_E_passed[iphi_module][k]; l++){
1372 chip_struct_prob& this_struct = chip_map_prob[1][iphi_module].emplace_back();
1377 for (
int l = 0; l < 16*1. - scale_hHitAMapC_E_passed[iphi_module][k]; l++){
1378 chip_struct_prob& this_struct = chip_map_prob[1][iphi_module].emplace_back();
1383 for (
int l = 0; l < 16*1. - scale_hHitAWMapC_E_passed[iphi_module][k]; l++){
1384 chip_struct_prob& this_struct = chip_map_prob[1][iphi_module].emplace_back();
1389 for (
int l = 0; l < 16*1. - scale_hHitHMapC_E_passed[iphi_module][k]; l++){
1390 chip_struct_prob& this_struct = chip_map_prob[1][iphi_module].emplace_back();
1396 ATH_MSG_ERROR(
"Scale value is less than zero in normalization for Endcap chip!");
1403 for (
const auto& ibarrel_ecpair : straw_shifter_map) {
1404 int ibe = abs(ibarrel_ecpair.first) - 1;
1405 int iside = ibarrel_ecpair.first > 0 ? 0 : 1;
1407 auto HitWMap_passed =
Monitored::Collection(
"HitWMap_passed", ibarrel_ecpair.second, [](
const auto& s){return s.HitWMap_passed;});
1408 auto HitWMap_Ar_passed =
Monitored::Collection(
"HitWMap_Ar_passed", ibarrel_ecpair.second, [](
const auto& s){return s.HitWMap_Ar_passed;});
1409 auto isAr =
Monitored::Collection(
"isAr", ibarrel_ecpair.second, [](
const auto& s){return s.isAr;});
1410 auto isNotAr =
Monitored::Collection(
"isNotAr", ibarrel_ecpair.second, [](
const auto& s){return not s.isAr;});
1412 fill(
"RDOHistograms0",
strawNumber, HitWMap_passed, HitWMap_Ar_passed, isAr, isNotAr);
1413 }
else if (ibe == 1) {
1414 fill(
"RDOHistograms1"+std::to_string(iside),
strawNumber, HitWMap_passed, HitWMap_Ar_passed, isAr, isNotAr);
1419 for (
const auto& ibepair : straw_map_prob) {
1420 for (
const auto& iphi_modulepair : ibepair.second ) {
1422 auto HitHWMapS_passed =
Monitored::Collection(
"HitHWMapS_passed", iphi_modulepair.second, [](
const auto& s){return s.HitHWMapS_passed;});
1423 auto HitWMapS_passed =
Monitored::Collection(
"HitWMapS_passed", iphi_modulepair.second, [](
const auto& s){return s.HitWMapS_passed;});
1424 auto HitAMapS_passed =
Monitored::Collection(
"HitAMapS_passed", iphi_modulepair.second, [](
const auto& s){return s.HitAMapS_passed;});
1425 auto HitAWMapS_passed =
Monitored::Collection(
"HitAWMapS_passed", iphi_modulepair.second, [](
const auto& s){return s.HitAWMapS_passed;});
1426 auto HitHMapS_passed =
Monitored::Collection(
"HitHMapS_passed", iphi_modulepair.second, [](
const auto& s){return s.HitHMapS_passed;});
1427 auto HitHWMapS_cut =
Monitored::Collection(
"HitHWMapS_cut", iphi_modulepair.second, [](
const auto& s){return s.HitHWMapS_cut;});
1428 auto HitWMapS_cut =
Monitored::Collection(
"HitWMapS_cut", iphi_modulepair.second, [](
const auto& s){return s.HitWMapS_cut;});
1429 auto HitAMapS_cut =
Monitored::Collection(
"HitAMapS_cut", iphi_modulepair.second, [](
const auto& s){return s.HitAMapS_cut;});
1430 auto HitAWMapS_cut =
Monitored::Collection(
"HitAWMapS_cut", iphi_modulepair.second, [](
const auto& s){return s.HitAWMapS_cut;});
1431 auto HitHMapS_cut =
Monitored::Collection(
"HitHMapS_cut", iphi_modulepair.second, [](
const auto& s){return s.HitHMapS_cut;});
1433 fill(
"RDOStackHistograms"+std::to_string(ibepair.first)+std::to_string(iphi_modulepair.first),
strawNumber, HitHWMapS_passed, HitHWMapS_cut,
1434 HitWMapS_passed, HitWMapS_cut, HitAMapS_passed, HitAMapS_cut, HitAWMapS_passed, HitAWMapS_cut, HitHMapS_passed, HitHMapS_cut);
1438 for (
const auto& ibepair : chip_map_prob) {
1439 for (
const auto& iphi_modulepair : ibepair.second ) {
1440 auto chipNumber =
Monitored::Collection(
"chipNumber", iphi_modulepair.second, [](
const auto& s){return s.chipNumber;});
1441 auto HitHWMapC_passed =
Monitored::Collection(
"HitHWMapC_passed", iphi_modulepair.second, [](
const auto& s){return s.HitHWMapC_passed;});
1442 auto HitWMapC_passed =
Monitored::Collection(
"HitWMapC_passed", iphi_modulepair.second, [](
const auto& s){return s.HitWMapC_passed;});
1443 auto HitAMapC_passed =
Monitored::Collection(
"HitAMapC_passed", iphi_modulepair.second, [](
const auto& s){return s.HitAMapC_passed;});
1444 auto HitAWMapC_passed =
Monitored::Collection(
"HitAWMapC_passed", iphi_modulepair.second, [](
const auto& s){return s.HitAWMapC_passed;});
1445 auto HitHMapC_passed =
Monitored::Collection(
"HitHMapC_passed", iphi_modulepair.second, [](
const auto& s){return s.HitHMapC_passed;});
1446 auto HitHWMapC_cut =
Monitored::Collection(
"HitHWMapC_cut", iphi_modulepair.second, [](
const auto& s){return s.HitHWMapC_cut;});
1447 auto HitWMapC_cut =
Monitored::Collection(
"HitWMapC_cut", iphi_modulepair.second, [](
const auto& s){return s.HitWMapC_cut;});
1448 auto HitAMapC_cut =
Monitored::Collection(
"HitAMapC_cut", iphi_modulepair.second, [](
const auto& s){return s.HitAMapC_cut;});
1449 auto HitAWMapC_cut =
Monitored::Collection(
"HitAWMapC_cut", iphi_modulepair.second, [](
const auto& s){return s.HitAWMapC_cut;});
1450 auto HitHMapC_cut =
Monitored::Collection(
"HitHMapC_cut", iphi_modulepair.second, [](
const auto& s){return s.HitHMapC_cut;});
1452 fill(
"RDOStackHistograms"+std::to_string(ibepair.first)+std::to_string(iphi_modulepair.first), chipNumber, HitHWMapC_passed, HitHWMapC_cut,
1453 HitWMapC_passed, HitWMapC_cut, HitAMapC_passed, HitAMapC_cut, HitAWMapC_passed, HitAWMapC_cut, HitHMapC_passed, HitHMapC_cut);
1458 for (
const auto& ibepair : straw_map) {
1459 for (
const auto& iphi_modulepair : ibepair.second ) {
1461 auto HitTrMapS_y =
Monitored::Collection(
"HitTrMapS_y", iphi_modulepair.second, [](
const auto& s){return s.HitTrMapS_y;});
1462 auto HitToTMapS_y =
Monitored::Collection(
"HitToTMapS_y", iphi_modulepair.second, [](
const auto& s){return s.HitToTMapS_y;});
1463 auto HitToTLong_cut =
Monitored::Collection(
"HitToTLong_cut", iphi_modulepair.second, [](
const auto& s){return s.HitToTLong_cut;});
1464 auto HitTrWMapS_y =
Monitored::Collection(
"HitTrWMapS_y", iphi_modulepair.second, [](
const auto& s){return s.HitTrWMapS_y;});
1465 auto HitTrWMapS_cut =
Monitored::Collection(
"HitTrWMapS_cut", iphi_modulepair.second, [](
const auto& s){return s.HitTrWMapS_cut;});
1467 fill(
"RDOStackHistograms"+std::to_string(ibepair.first)+std::to_string(iphi_modulepair.first),
strawNumber,
1468 HitTrMapS_y, HitToTMapS_y, HitToTLong_cut, HitTrWMapS_y, HitTrWMapS_cut);
1472 for (
const auto& ibepair : chip_map) {
1473 for (
const auto& iphi_modulepair : ibepair.second ) {
1474 auto chipNumber =
Monitored::Collection(
"chipNumber", iphi_modulepair.second, [](
const auto& s){return s.chipNumber;});
1475 auto HitTrMapC_y =
Monitored::Collection(
"HitTrMapC_y", iphi_modulepair.second, [](
const auto& s){return s.HitTrMapC_y;});
1476 auto HitToTMapC_y =
Monitored::Collection(
"HitToTMapC_y", iphi_modulepair.second, [](
const auto& s){return s.HitToTMapC_y;});
1477 auto HtoBCMapC_x =
Monitored::Collection(
"HtoBCMapC_x", iphi_modulepair.second, [](
const auto& s){return s.HtoBCMapC_x;});
1478 auto HtoBCMapB_x =
Monitored::Collection(
"HtoBCMapB_x", iphi_modulepair.second, [](
const auto& s){return s.HtoBCMapB_x;});
1479 auto HtoBCMapB_y =
Monitored::Collection(
"HtoBCMapB_y", iphi_modulepair.second, [](
const auto& s){return s.HtoBCMapB_y;});
1480 auto HtoBCMap_cut =
Monitored::Collection(
"HtoBCMap_cut", iphi_modulepair.second, [](
const auto& s){return s.HtoBCMap_cut;});
1481 auto HitTrWMapC_cut =
Monitored::Collection(
"HitTrWMapC_cut", iphi_modulepair.second, [](
const auto& s){return s.HitTrWMapC_cut;});
1483 fill(
"RDOStackHistograms"+std::to_string(ibepair.first)+std::to_string(iphi_modulepair.first),
1484 chipNumber, HitTrMapC_y, HitToTMapC_y, HtoBCMapC_x, HtoBCMapB_x, HtoBCMapB_y, HtoBCMap_cut, HitTrWMapC_cut);
1488 OccAll = nhitsall/350848.;
1489 fill(
"RDOHistograms0", OccAll);
1492 for (
int ibe = 0; ibe < 2; ibe++) {
1495 BCIDvsOcc_x = good_bcid;
1496 BCIDvsOcc_y = nTRTHits[ibe]/105088.0;
1497 fill(
"RDOHistograms0", BCIDvsOcc_x, BCIDvsOcc_y);
1498 }
else if (ibe == 1) {
1499 BCIDvsOcc_x = good_bcid;
1500 BCIDvsOcc_y = nTRTHits[ibe]/245760.0;
1501 fill(
"RDOHistograms1", BCIDvsOcc_x, BCIDvsOcc_y);
1504 for (
int iside = 0; iside < 2; iside++) {
1505 for (
int i = 1; i <= numberOfStacks_b[ibe]; i++) {
1508 int modulenum_tmp = 0;
1512 modulenum_tmp = i - 1;
1513 }
else if (iside == 1) {
1516 if (ibe == 0) modulenum_tmp = (i - 1) + 96;
1517 else if (ibe == 1) modulenum_tmp = (i - 1) + 64;
1529 int LLocc_index = index_tmp - 32 * nclass;
1535 float occLL = float(moduleHits_B[modulenum_tmp]) / float(numberOfStrawsMod[nclass]);
1536 float occHL = float(HLmoduleHits_B[modulenum_tmp]) / float(numberOfStrawsMod[nclass]);
1537 AvgLLOcc_side_x = i - (32 * nclass);
1538 AvgLLOcc_side_y = occLL;
1539 AvgHLOcc_side_x = i - (32 * nclass);
1540 AvgHLOcc_side_y = occHL;
1541 AvgLLOccMod_side_x = i;
1542 AvgLLOccMod_side_y = occLL;
1543 AvgHLOccMod_side_x = i;
1544 AvgHLOccMod_side_y = occHL;
1545 }
else if (ibe == 1) {
1546 float occLL = float(moduleHits_E[modulenum_tmp]) / float(numberOfStrawsWheel[nclass]);
1547 float occHL = float(HLmoduleHits_E[modulenum_tmp]) / float(numberOfStrawsWheel[nclass]);
1549 if (LLocc_index < 64) {
1553 AvgLLOcc_side_x = i - (32 * nclass);
1554 AvgLLOcc_side_y = occLL;
1555 AvgHLOcc_side_x = i - (32 * nclass);
1556 AvgHLOcc_side_y = occHL;
1557 AvgLLOccMod_side_x = i;
1558 AvgLLOccMod_side_y = occLL;
1559 AvgHLOccMod_side_x = i;
1560 AvgHLOccMod_side_y = occHL;
1562 fill(
"RDOLLHLOccHistograms"+std::to_string(ibe)+std::to_string(iside), AvgLLOcc_side_x, AvgLLOcc_side_y, AvgHLOcc_side_x, AvgHLOcc_side_y,
1563 AvgLLOccMod_side_x, AvgLLOccMod_side_y, AvgHLOccMod_side_x, AvgHLOccMod_side_y);
1573 const unsigned int lumiBlock = eventInfo.
lumiBlock();
1575 int lastLumiBlock = -99;
1576 if ((
int)lumiBlock != lastLumiBlock) {
1577 lastLumiBlock = lumiBlock;
1579 float evtLumiBlock = 1.;
1580 float lumiBlockScale = (evtLumiBlock > 0) ? (1. / evtLumiBlock) : 0;
1581 const float barrelConst = 1. / 105088;
1582 const float endcapConst = 1. / 122880;
1585 NHitsperLB_x = lastLumiBlock;
1586 NHitsperLB_y = (float)nHitsperLB_B * lumiBlockScale * barrelConst;
1587 fill(
"RDOShiftRebinnedBarrelHistograms0", NHitsperLB_x, NHitsperLB_y);
1588 NHLHitsperLB_x = lastLumiBlock;
1589 NHLHitsperLB_y = (float)nHLHitsperLB_B * lumiBlockScale * barrelConst;
1590 fill(
"RDOShiftRebinnedBarrelHistograms0", NHLHitsperLB_x, NHLHitsperLB_y);
1592 for (
int iside = 0; iside < 2; iside++) {
1593 NHitsperLB_x = lastLumiBlock;
1594 NHitsperLB_y = (float)nHitsperLB_E[iside] * lumiBlockScale * endcapConst;
1595 fill(
"RDOShiftRebinnedEndcapHistograms1"+std::to_string(iside), NHitsperLB_x, NHitsperLB_y);
1596 NHLHitsperLB_x = lastLumiBlock;
1597 NHLHitsperLB_y = (float)nHLHitsperLB_E[iside] * lumiBlockScale * endcapConst;
1598 fill(
"RDOShiftRebinnedEndcapHistograms1"+std::to_string(iside), NHLHitsperLB_x, NHLHitsperLB_y);
1604 for (
int iside = 0; iside < 2; iside++) {
1605 nHitsperLB_E[iside] = 0;
1606 nHLHitsperLB_E[iside] = 0;
1619 const unsigned int rod_id_base[2][2] = { { 0x310000, 0x320000 }, { 0x330000, 0x340000 } };
1620 const unsigned int nChipsTotal[2][2] = { { 3328, 3328 }, { 7680, 7680 } };
1621 const unsigned int nRobsTotal[2][2] = { { 32, 32 }, { 64, 64 } };
1622 float nBSErrors[2][2] = { { 0, 0 }, { 0, 0 } };
1623 float nRobErrors[2][2] = { { 0, 0 }, { 0, 0 } };
1624 const std::set<std::pair<uint32_t, uint32_t> > *errorset1[2] = { BCIDErrorSet, L1IDErrorSet };
1626 for (
int iset = 0; iset < 2; ++iset) {
1627 for (
auto setIt = errorset1[iset]->begin(); setIt != errorset1[iset]->end(); ++setIt) {
1628 for (
int ibe = 0; ibe < 2; ++ibe) {
1629 for (
int iside = 0; iside < 2; ++iside) {
1630 if (((setIt->first >> 8) & 0xFF0000) == rod_id_base[ibe][iside]) {
1631 nBSErrors[ibe][iside] += 1. / nChipsTotal[ibe][iside];
1638 const std::set<uint32_t> *errorset2[2] = { MissingErrorSet, SidErrorSet };
1640 for (
int iset = 0; iset < 2; ++iset) {
1641 for (
auto setIt = errorset2[iset]->begin(); setIt != errorset2[iset]->end(); ++setIt) {
1642 for (
int ibe = 0; ibe < 2; ++ibe) {
1643 for (
int iside = 0; iside < 2; ++iside) {
1644 if (((*setIt >> 8) & 0xFF0000) == rod_id_base[ibe][iside]) {
1645 nBSErrors[ibe][iside] += 1. / nChipsTotal[ibe][iside];
1652 for (
int ibe = 0; ibe < 2; ++ibe) {
1653 for (
int iside = 0; iside < 2; ++iside) {
1654 ChipBSErrorsVsLB_x = lumiBlock;
1655 ChipBSErrorsVsLB_y = nBSErrors[ibe][iside];
1656 for (
unsigned int i = 0; i < lumiBlock; i++) {
1658 fill(
"RDOShiftSmryRebinnedHistograms"+std::to_string(ibe)+std::to_string(iside), ChipBSErrorsVsLB_x, ChipBSErrorsVsLB_y);
1663 for (
auto setIt = RobStatusErrorSet->begin(); setIt != RobStatusErrorSet->end(); ++setIt) {
1664 for (
int ibe = 0; ibe < 2; ++ibe) {
1665 for (
int iside = 0; iside < 2; ++iside) {
1666 if (setIt->first % rod_id_base[ibe][iside] < 0xffff) {
1667 nRobErrors[ibe][iside] += 1. / nRobsTotal[ibe][iside];
1673 for (
int ibe = 0; ibe < 2; ++ibe) {
1674 for (
int iside = 0; iside < 2; ++iside) {
1675 RobBSErrorsVsLB_x = lumiBlock;
1676 RobBSErrorsVsLB_y = nRobErrors[ibe][iside];
1677 for (
unsigned int i = 0; i < lumiBlock; i++) {
1679 fill(
"RDOShiftSmryRebinnedHistograms"+std::to_string(ibe)+std::to_string(iside), RobBSErrorsVsLB_x, RobBSErrorsVsLB_y);
1685 return StatusCode::SUCCESS;
1722 const float invGeV = 1. / CLHEP::GeV;
1723 const float invmm = 1. / CLHEP::mm;
1726 float track_eta = 0;
1727 float track_phi = 0;
1731 for (
auto track = combTrackCollection.
begin(); track != combTrackCollection.
end(); ++track) {
1737 const Trk::Perigee *perigee = (*track)->perigeeParameters();
1740 track_pt = perigee->
pT();
1741 track_eta = perigee->
eta();
1742 track_phi = perigee->parameters()[
Trk::phi0];
1743 track_d0 = perigee->parameters()[
Trk::d0];
1744 track_z0 = perigee->parameters()[
Trk::z0];
1746 <<
" pT = " << track_pt *
invGeV <<
" GeV" <<
"\n"
1747 <<
" eta = " << track_eta <<
"\n"
1748 <<
" phi0 = " << track_phi <<
"\n"
1749 <<
" d0 = " << track_d0 * invmm <<
"\n"
1750 <<
" z0 = " << track_z0 * invmm <<
"\n"
1751 <<
" theta = " << perigee->parameters()[
Trk::theta] <<
"\n"
1752 <<
" qOverP = " << perigee->parameters()[
Trk::qOverP]);
1761 ATH_MSG_DEBUG(
"This track has " << track_states->
size() <<
" track states on surface.");
1763 ATH_MSG_DEBUG(
"This track has null track states on surface.");
1767 const std::unique_ptr<const Trk::TrackSummary> summary(
m_TrackSummaryTool->summary(ctx,*(*track)));
1774 p = (perigee->parameters()[
Trk::qOverP] != 0.) ? std::abs(1. / (perigee->parameters()[
Trk::qOverP])) : 1.0e+08;
1785 <<
" and nsct = " << n_sct_hits
1786 <<
" and npix = " << n_pixel_hits);
1788 if (!passed_track_preselection) {
1795 for (
auto it = track_states->
begin(); it != track_states->
end(); it++) {
1800 if (!track_parameters)
continue;
1814 int ibe = abs(barrel_ec) - 1;
1815 int iside = barrel_ec > 0 ? 0 : 1;
1819 EfficiencyBarrel_locR_Ar = locR;
1820 EfficiencyBarrel_locR_Ar_passed = 1.0;
1821 fill(
"TRTEfficiencyHistogramsBarrel", EfficiencyBarrel_locR_Ar_passed, EfficiencyBarrel_locR_Ar);
1823 EfficiencyBarrel_locR = locR;
1824 EfficiencyBarrel_locR_passed = 1.0;
1825 fill(
"TRTEfficiencyHistogramsBarrel", EfficiencyBarrel_locR_passed, EfficiencyBarrel_locR);
1827 }
else if (ibe == 1) {
1829 EfficiencyBarrel_locR_Ar = locR;
1830 EfficiencyBarrel_locR_Ar_passed = 1.0;
1831 fill(
"TRTEfficiencyHistogramsEndCap"+std::to_string(iside), EfficiencyBarrel_locR_Ar_passed, EfficiencyBarrel_locR_Ar);
1833 EfficiencyEndCap_locR = locR;
1834 EfficiencyEndCap_locR_passed = 1.0;
1835 fill(
"TRTEfficiencyHistogramsEndCap"+std::to_string(iside), EfficiencyEndCap_locR_passed, EfficiencyEndCap_locR);
1839 if (std::abs(locR) >= 1.3)
continue;
1841 int thisStrawNumber = 0;
1845 thisStrawNumber =
strawNumber(straw, straw_layer, layer_or_wheel);
1847 if (thisStrawNumber >= 0 && thisStrawNumber <
s_Straw_max[ibe])
1848 chip =
m_mat_chip_B.at(phi_module).at(thisStrawNumber);
1849 }
else if (ibe == 1) {
1850 thisStrawNumber =
strawNumberEndCap(straw, straw_layer, layer_or_wheel, phi_module, barrel_ec);
1852 if (thisStrawNumber >= 0 && thisStrawNumber <
s_Straw_max[ibe])
1853 chip =
m_mat_chip_E.at(phi_module).at(thisStrawNumber);
1857 EfficiencyBarrelMap = thisStrawNumber;
1858 EfficiencyBarrelMap_passed = 1.0;
1859 fill(
"TRTEfficiencyHistogramsBarrel", EfficiencyBarrelMap_passed, EfficiencyBarrelMap);
1860 }
else if (ibe == 1) {
1861 EfficiencyEndCapMap = thisStrawNumber;
1862 EfficiencyEndCapMap_passed = 1.0;
1863 fill(
"TRTEfficiencyHistogramsEndCap", EfficiencyEndCapMap_passed, EfficiencyEndCapMap);
1868 EfficiencyS = thisStrawNumber;
1869 EfficiencyS_passed = 1.0;
1870 fill(
"TRTEfficiencyHistograms"+std::to_string(ibe)+std::to_string(phi_module), EfficiencyS_passed, EfficiencyS);
1872 EfficiencyC_passed = 1.0;
1873 fill(
"TRTEfficiencyHistograms"+std::to_string(ibe)+std::to_string(phi_module), EfficiencyC_passed, EfficiencyC);
1874 }
else if (iside == 1) {
1875 EfficiencyS = thisStrawNumber;
1876 EfficiencyS_passed = 1.0;
1877 fill(
"TRTEfficiencyHistograms"+std::to_string(ibe)+std::to_string(phi_module + 32), EfficiencyS_passed, EfficiencyS);
1879 EfficiencyC_passed = 1.0;
1880 fill(
"TRTEfficiencyHistograms"+std::to_string(ibe)+std::to_string(phi_module + 32), EfficiencyC_passed, EfficiencyC);
1884 Efficiency_eta_passed = track_eta;
1885 Efficiency_eta = 1.0;
1886 fill(
"TRTEfficiencyHistograms", Efficiency_eta_passed, Efficiency_eta);
1887 Efficiency_phi_passed = track_phi;
1888 Efficiency_phi = 1.0;
1889 fill(
"TRTEfficiencyHistograms", Efficiency_phi_passed, Efficiency_phi);
1890 Efficiency_pt_passed = track_pt*
invGeV;
1891 Efficiency_pt = 1.0;
1892 fill(
"TRTEfficiencyHistograms", Efficiency_pt_passed, Efficiency_pt);
1893 Efficiency_z0_passed = track_z0;
1894 Efficiency_z0 = 1.0;
1895 fill(
"TRTEfficiencyHistograms", Efficiency_z0_passed, Efficiency_z0);
1901 std::unique_ptr<const Trk::TrackStates> holes (
m_trt_hole_finder->getHolesOnTrack(*(*track)));
1907 for (
auto it = holes->begin(); it != holes->end(); ++it) {
1912 if (!track_parameters)
continue;
1926 int ibe = abs(barrel_ec) - 1;
1927 int iside = barrel_ec > 0 ? 0 : 1;
1931 EfficiencyBarrel_locR_Ar = locR;
1932 EfficiencyBarrel_locR_Ar_passed = 0.0;
1933 fill(
"TRTEfficiencyHistograms", EfficiencyBarrel_locR_Ar_passed, EfficiencyBarrel_locR_Ar);
1935 EfficiencyBarrel_locR = locR;
1936 EfficiencyBarrel_locR_passed = 0.0;
1937 fill(
"TRTEfficiencyHistograms", EfficiencyBarrel_locR_passed, EfficiencyBarrel_locR);
1939 }
else if (ibe == 1) {
1941 EfficiencyEndCap_locR_Ar = locR;
1942 EfficiencyEndCap_locR_Ar_passed = 0.0;
1943 fill(
"TRTEfficiencyHistogramsEndCap"+std::to_string(iside), EfficiencyEndCap_locR_Ar_passed, EfficiencyEndCap_locR_Ar);
1945 EfficiencyEndCap_locR = locR;
1946 EfficiencyEndCap_locR_passed = 0.0;
1947 fill(
"TRTEfficiencyHistogramsEndCap"+std::to_string(iside), EfficiencyEndCap_locR_passed, EfficiencyEndCap_locR);
1951 if (std::abs(locR) >= 1.3)
continue;
1953 int thisStrawNumber = 0;
1957 thisStrawNumber =
strawNumber(straw, straw_layer, layer_or_wheel);
1959 if (thisStrawNumber >= 0 && thisStrawNumber <
s_Straw_max[ibe]) {
1960 chip =
m_mat_chip_B.at(phi_module).at(thisStrawNumber);
1962 }
else if (ibe == 1) {
1963 thisStrawNumber =
strawNumberEndCap(straw, straw_layer, layer_or_wheel, phi_module, barrel_ec);
1965 if (thisStrawNumber >= 0 && thisStrawNumber <
s_Straw_max[ibe]) {
1966 chip =
m_mat_chip_E.at(phi_module).at(thisStrawNumber);
1971 EfficiencyBarrelMap = thisStrawNumber;
1972 EfficiencyBarrelMap_passed = 0.0;
1973 fill(
"TRTEfficiencyHistogramsBarrel", EfficiencyBarrelMap_passed, EfficiencyBarrelMap);
1974 }
else if (ibe == 1) {
1975 EfficiencyEndCapMap = thisStrawNumber;
1976 EfficiencyEndCapMap_passed = 0.0;
1977 fill(
"TRTEfficiencyHistogramsEndCap", EfficiencyEndCapMap_passed, EfficiencyEndCapMap);
1982 EfficiencyS = thisStrawNumber;
1983 EfficiencyS_passed = 0.0;
1984 fill(
"TRTEfficiencyHistograms"+std::to_string(ibe)+std::to_string(phi_module), EfficiencyS_passed, EfficiencyS);
1986 EfficiencyC_passed = 0.0;
1987 fill(
"TRTEfficiencyHistograms"+std::to_string(ibe)+std::to_string(phi_module), EfficiencyC_passed, EfficiencyC);
1988 }
else if (iside == 1) {
1989 EfficiencyS = thisStrawNumber;
1990 EfficiencyS_passed = 0.0;
1991 fill(
"TRTEfficiencyHistograms"+std::to_string(ibe)+std::to_string(phi_module + 32), EfficiencyS_passed, EfficiencyS);
1993 EfficiencyC_passed = 0.0;
1994 fill(
"TRTEfficiencyHistograms"+std::to_string(ibe)+std::to_string(phi_module + 32), EfficiencyC_passed, EfficiencyC);
1997 Efficiency_eta_passed = track_eta;
1998 Efficiency_eta = 0.0;
1999 fill(
"TRTEfficiencyHistograms", Efficiency_eta_passed, Efficiency_eta);
2000 Efficiency_phi_passed = track_phi;
2001 Efficiency_phi = 0.0;
2002 fill(
"TRTEfficiencyHistograms", Efficiency_phi_passed, Efficiency_phi);
2003 Efficiency_pt_passed = track_pt*
invGeV;
2004 Efficiency_pt = 0.0;
2005 fill(
"TRTEfficiencyHistograms", Efficiency_pt_passed, Efficiency_pt);
2006 Efficiency_z0_passed = track_z0;
2007 Efficiency_z0 = 0.0;
2008 fill(
"TRTEfficiencyHistograms", Efficiency_z0_passed, Efficiency_z0);
2017 return StatusCode::SUCCESS;
2088 auto scale_hHitWonTMap_B = std::make_unique<short int[]>(
s_Straw_max[0]);
2089 auto scale_hHitWonTMap_E = std::make_unique<short int[][s_Straw_max[1]]>(2);
2090 auto scale_hHitWonTMap_B_passed = std::make_unique<short int[]>(
s_Straw_max[0]);
2091 auto scale_hHitWonTMap_E_passed = std::make_unique<short int[][s_Straw_max[1]]>(2);
2093 std::map<int,std::vector<straw_edge_struct>> straw_edge_map;
2095 auto p_trk = trackCollection.
begin();
2101 int ntrackstack[2][64];
2103 for (
int ibe = 0; ibe < 2; ibe++) {
2104 std::fill(ntrackstack[ibe], ntrackstack[ibe] + 64, 0);
2107 for (; p_trk != trackCollection.
end(); ++p_trk) {
2108 const std::unique_ptr<const Trk::TrackSummary> summary(
m_TrackSummaryTool->summary(ctx,*(*p_trk)));
2113 AllTrkPar = (*p_trk)->trackParameters();
2119 for (p_trkpariter = AllTrkPar->
begin(); p_trkpariter != AllTrkPar->
end(); ++p_trkpariter) {
2121 if ((mPer =
dynamic_cast<const Trk::Perigee *
>(*p_trkpariter)))
break;
2124 if (!mPer)
continue;
2127 float p = (mPer->parameters()[
Trk::qOverP] != 0.) ? std::abs(1. / (mPer->parameters()[
Trk::qOverP])) : 10e7;
2128 float pT = (p * sin(
theta));
2131 if (p <
m_minP)
continue;
2135 if (trackStates ==
nullptr)
continue;
2146 if (!passed_track_preselection)
continue;
2148 int nTRTHitsW[2][2];
2149 int nTRTHitsW_Ar[2][2];
2150 int nTRTHitsW_Xe[2][2];
2151 int nTRTHLHitsW[2][2];
2152 int nTRTHLHitsW_Ar[2][2];
2153 int nTRTHLHitsW_Xe[2][2];
2154 int nTRTHits_side[2][2];
2155 int nTRTHitsW_perwheel[2][18];
2156 int hitontrack[2] = {0, 0};
2157 int hitontrack_E_side[2] = {0, 0};
2159 for (
int ibe = 0; ibe < 2; ibe++) {
2160 for (
int iside = 0; iside < 2; iside++) {
2161 nTRTHits_side[ibe][iside] = -1;
2162 nTRTHitsW[ibe][iside] = 0;
2163 nTRTHitsW_Ar[ibe][iside] = 0;
2164 nTRTHitsW_Xe[ibe][iside] = 0;
2165 nTRTHLHitsW[ibe][iside] = 0;
2166 nTRTHLHitsW_Ar[ibe][iside] = 0;
2167 nTRTHLHitsW_Xe[ibe][iside] = 0;
2169 std::fill(nTRTHitsW_perwheel[ibe], nTRTHitsW_perwheel[ibe] + 18, 0);
2172 bool isBarrelOnly =
true;
2173 bool ECAhit =
false;
2174 bool ECChit =
false;
2177 int layer_or_wheel = 0;
2179 int straw_layer = 0;
2181 int nearest_straw_layer[2] = {100, 100};
2182 int nearest_straw[2] = {0, 0};
2183 int testLayer[2] = {100, 100};
2184 float phi2D[2] = {-100, -100};
2186 for (TSOSItBeginTemp = TSOSItBegin0; TSOSItBeginTemp != TSOSItEnd; ++TSOSItBeginTemp) {
2187 if ((*TSOSItBeginTemp) ==
nullptr)
continue;
2192 if (!trtCircle)
continue;
2195 if (!aTrackParam)
continue;
2198 int ibe = std::abs(barrel_ec) - 1;
2199 layer_or_wheel =
m_pTRTHelper->layer_or_wheel (DCoTId);
2204 if (layer_or_wheel >= testLayer[ibe])
continue;
2205 testLayer[ibe] = layer_or_wheel;
2207 if (straw_layer < nearest_straw_layer[ibe]) {
2208 nearest_straw_layer[ibe] = straw_layer;
2209 nearest_straw[ibe] = straw;
2213 circleElement =
nullptr;
2217 if (phi2D[0] == -999) {
2218 ATH_MSG_DEBUG(
"Track did not go through inner layer of Barrel.");
2221 testLayer[0] <<
" m_straw_layer: " <<
2222 nearest_straw_layer[0] <<
" (in the Barrel).");
2225 if (phi2D[1] == -999) {
2226 ATH_MSG_DEBUG(
"Track did not go through any inner layer of EndCap A or C.");
2229 testLayer[1] <<
" m_straw_layer: " <<
2230 nearest_straw_layer[1] <<
" (in the EndCaps).");
2233 bool trackfound[2][64];
2235 for (
int i = 0; i < 2; i++) {
2236 std::fill(trackfound[i], trackfound[i] + 64,
false);
2239 for (TSOSItBegin = TSOSItBegin0; TSOSItBegin != TSOSItEnd; ++TSOSItBegin) {
2241 if ((*TSOSItBegin) ==
nullptr)
continue;
2247 if (!trtCircle)
continue;
2251 if (!aTrackParam)
continue;
2259 int ibe = std::abs(barrel_ec) - 1;
2260 int iside = barrel_ec > 0 ? 0 : 1;
2261 int thisStrawNumber[2] = {-1, -1};
2262 int chip[2] = {0, 0};
2265 thisStrawNumber[ibe] =
strawNumber(straw, straw_layer, layer_or_wheel);
2267 if (thisStrawNumber[ibe] >= 0 && thisStrawNumber[ibe] <
s_Straw_max[ibe]) {
2268 chip[ibe] =
m_mat_chip_B.at(phi_module).at(thisStrawNumber[ibe]);
2270 }
else if (ibe == 1) {
2271 thisStrawNumber[ibe] =
strawNumberEndCap(straw, straw_layer, layer_or_wheel, phi_module, barrel_ec);
2273 if (thisStrawNumber[ibe] >= 0 && thisStrawNumber[ibe] <
s_Straw_max[ibe]) {
2274 chip[ibe] =
m_mat_chip_E.at(phi_module).at(thisStrawNumber[ibe]);
2277 thisStrawNumber[ibe] = -1;
2280 if (thisStrawNumber[ibe] < 0 || thisStrawNumber[ibe] >=
s_Straw_max[ibe])
continue;
2284 }
else if (barrel_ec == 2) {
2285 isBarrelOnly =
false;
2287 }
else if (barrel_ec == -2) {
2288 isBarrelOnly =
false;
2297 int iphi_module = -9999;
2299 if (iside == 0) iphi_module = phi_module;
2300 else if (iside == 1) iphi_module = phi_module + 32;
2302 trackfound[ibe][iphi_module] =
true;
2314 StrawEffDetPhi_B_passed = phi_module;
2315 StrawEffDetPhi_B = 1.0;
2316 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe), StrawEffDetPhi_B_passed, StrawEffDetPhi_B);
2318 if (
m_doStraws) scale_hHitWonTMap_B[thisStrawNumber[ibe]]++;
2321 }
else if (ibe == 1) {
2323 hitontrack_E_side[iside]++;
2326 StrawEffDetPhi_E_passed = phi_module;
2327 StrawEffDetPhi_E = 1.0;
2328 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe)+std::to_string(iside), StrawEffDetPhi_E_passed, StrawEffDetPhi_E);
2330 if (
m_doStraws) scale_hHitWonTMap_E[iside][thisStrawNumber[ibe]]++;
2335 EfficiencyS = thisStrawNumber[ibe];
2336 EfficiencyS_passed = 1.0;
2337 fill(
"TRTTrackHistograms"+std::to_string(ibe)+std::to_string(iphi_module), EfficiencyS_passed, EfficiencyS);
2341 EfficiencyC = chip[ibe] - 1;
2342 EfficiencyC_passed = 1.0;
2343 fill(
"TRTTrackHistograms"+std::to_string(ibe)+std::to_string(iphi_module), EfficiencyC_passed, EfficiencyC);
2350 StrawEffDetPhi_B_passed = phi_module;
2351 StrawEffDetPhi_B = 0.0;
2352 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe), StrawEffDetPhi_B_passed, StrawEffDetPhi_B);
2354 if (
m_doStraws) scale_hHitWonTMap_B[thisStrawNumber[ibe]]++;
2356 }
else if (ibe == 1) {
2358 StrawEffDetPhi_E_passed = phi_module;
2359 StrawEffDetPhi_E = 0.0;
2360 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe)+std::to_string(iside), StrawEffDetPhi_E_passed, StrawEffDetPhi_E);
2362 if (
m_doStraws) scale_hHitWonTMap_E[iside][thisStrawNumber[ibe]]++;
2367 EfficiencyS = thisStrawNumber[ibe];
2368 EfficiencyS_passed = 0.0;
2369 fill(
"TRTTrackHistograms"+std::to_string(ibe)+std::to_string(iphi_module), EfficiencyS_passed, EfficiencyS);
2373 EfficiencyC = chip[ibe] - 1;
2374 EfficiencyC_passed = 0.0;
2375 fill(
"TRTTrackHistograms"+std::to_string(ibe)+std::to_string(iphi_module), EfficiencyC_passed, EfficiencyC);
2380 if (RawDriftCircle) {
2381 nTRTHits_side[ibe][iside]++;
2383 int middleHTbit = RawDriftCircle->
getWord() & 0x00020000;
2385 int hitinvaliditygate = RawDriftCircle->
getWord() & 0x000DFE80;
2387 bool is_middleHTbit_high = (middleHTbit != 0);
2388 bool is_anybininVgate_high = (hitinvaliditygate != 0);
2391 HitToTonTMapS_x = thisStrawNumber[ibe];
2393 fill(
"TRTTrackHistograms"+std::to_string(ibe)+std::to_string(iphi_module), HitToTonTMapS_x, HitToTonTMapS_y);
2397 HitToTonTMapC_x = chip[ibe] - 1;
2399 fill(
"TRTTrackHistograms"+std::to_string(ibe)+std::to_string(iphi_module), HitToTonTMapC_x, HitToTonTMapC_y);
2403 if (is_middleHTbit_high) {
2404 HitHonTMapS = thisStrawNumber[ibe];
2405 fill(
"TRTTrackHistograms"+std::to_string(ibe)+std::to_string(iphi_module), HitHonTMapS);
2406 HitHWonTMapS = thisStrawNumber[ibe];
2407 fill(
"TRTTrackHistograms"+std::to_string(ibe)+std::to_string(iphi_module), HitHWonTMapS);
2409 HtoLonTMapS = thisStrawNumber[ibe];
2410 HtoLonTMapS_passed = 1.0;
2411 fill(
"TRTTrackHistograms"+std::to_string(ibe)+std::to_string(iphi_module), HtoLonTMapS_passed, HtoLonTMapS);
2412 HtoLWonTMapS = thisStrawNumber[ibe];
2413 HtoLWonTMapS_passed = 1.0;
2414 fill(
"TRTTrackHistograms"+std::to_string(ibe)+std::to_string(iphi_module), HtoLWonTMapS_passed, HtoLWonTMapS);
2419 if (is_middleHTbit_high) {
2420 HitHWonTMapC = chip[ibe] - 1;
2421 fill(
"TRTTrackHistograms"+std::to_string(ibe)+std::to_string(iphi_module), HitHWonTMapC);
2422 HitHonTMapC = chip[ibe] - 1;
2423 fill(
"TRTTrackHistograms"+std::to_string(ibe)+std::to_string(iphi_module), HitHonTMapC);
2424 HtoLonTMapC = chip[ibe] - 1;
2425 HtoLonTMapC_passed = 1.0;
2426 fill(
"TRTTrackHistograms"+std::to_string(ibe)+std::to_string(iphi_module), HtoLonTMapC_passed, HtoLonTMapC);
2427 HtoLWonTMapC = chip[ibe] - 1;
2428 HtoLWonTMapC_passed = 1.0;
2429 fill(
"TRTTrackHistograms"+std::to_string(ibe)+std::to_string(iphi_module), HtoLWonTMapC_passed, HtoLWonTMapC);
2443 scale_hHitWonTMap_B_passed[thisStrawNumber[ibe]]++;
2444 }
else if (ibe == 1) {
2445 straw_edge_struct& this_struct = straw_edge_map[iside == 0 ? 2 : -2].emplace_back();
2448 scale_hHitWonTMap_E_passed[iside][thisStrawNumber[ibe]]++;
2455 HitWonTMapS = thisStrawNumber[ibe];
2456 fill(
"TRTTrackHistograms"+std::to_string(ibe)+std::to_string(iphi_module), HitWonTMapS);
2460 HitWonTMapC = chip[ibe] - 1;
2461 fill(
"TRTTrackHistograms"+std::to_string(ibe)+std::to_string(iphi_module), HitWonTMapC);
2472 HitTronTMapS_x = thisStrawNumber[ibe];
2473 HitTronTMapS_y = trailingEdgeScaled;
2474 fill(
"TRTTrackHistograms"+std::to_string(ibe)+std::to_string(iphi_module), HitTronTMapS_x, HitTronTMapS_y);
2478 HitTronTMapC_x = chip[ibe] - 1;
2479 HitTronTMapC_y = trailingEdgeScaled;
2480 fill(
"TRTTrackHistograms"+std::to_string(ibe)+std::to_string(iphi_module), HitTronTMapC_x, HitTronTMapC_y);
2489 HitAonTMapS = thisStrawNumber[ibe];
2490 fill(
"TRTTrackHistograms"+std::to_string(ibe)+std::to_string(iphi_module), HitAonTMapS);
2492 if (!is_middleHTbit_high) {
2493 HtoLonTMapS = thisStrawNumber[ibe];
2494 HtoLonTMapS_passed = 0.0;
2495 fill(
"TRTTrackHistograms"+std::to_string(ibe)+std::to_string(iphi_module), HtoLonTMapS_passed, HtoLonTMapS);
2500 HitAonTMapC = chip[ibe] - 1;
2501 fill(
"TRTTrackHistograms"+std::to_string(ibe)+std::to_string(iphi_module), HitAonTMapC);
2502 if (!is_middleHTbit_high) {
2503 HtoLonTMapC = chip[ibe] - 1;
2504 HtoLonTMapC_passed = 0.0;
2505 fill(
"TRTTrackHistograms"+std::to_string(ibe)+std::to_string(iphi_module), HtoLonTMapC_passed, HtoLonTMapC);
2509 nTRTHitsW[ibe][iside]++;
2511 if (isArgonStraw) nTRTHitsW_Ar[ibe][iside]++;
2512 else nTRTHitsW_Xe[ibe][iside]++;
2514 nTRTHitsW_perwheel[iside][layer_or_wheel]++;
2516 if (is_middleHTbit_high) {
2517 nTRTHLHitsW[ibe][iside]++;
2518 if (isArgonStraw) nTRTHLHitsW_Ar[ibe][iside]++;
2519 else nTRTHLHitsW_Xe[ibe][iside]++;
2523 if (is_anybininVgate_high) {
2525 HitAWonTMapS = thisStrawNumber[ibe];
2526 fill(
"TRTTrackHistograms"+std::to_string(ibe)+std::to_string(iphi_module), HitAWonTMapS);
2528 if (!is_middleHTbit_high) {
2529 HtoLWonTMapS = thisStrawNumber[ibe];
2530 HtoLWonTMapS_passed = 0.0;
2531 fill(
"TRTTrackHistograms"+std::to_string(ibe)+std::to_string(iphi_module), HtoLWonTMapS_passed, HtoLWonTMapS);
2536 HitAWonTMapC = chip[ibe] - 1;
2537 fill(
"TRTTrackHistograms"+std::to_string(ibe)+std::to_string(iphi_module), HitAWonTMapC);
2539 if (!is_middleHTbit_high) {
2540 HtoLWonTMapC = chip[ibe] - 1;
2541 HtoLWonTMapC_passed = 0.0;
2542 fill(
"TRTTrackHistograms"+std::to_string(ibe)+std::to_string(iphi_module), HtoLWonTMapC_passed, HtoLWonTMapC);
2550 for (
int ibe = 0; ibe < 2; ibe++) {
2551 for (
int i = 0; i < 64; i++)
2552 if (trackfound[ibe][i])
2553 ntrackstack[ibe][i]++;
2555 if (phi2D[ibe] < 0)
continue;
2561 if (nTRTHitsW[ibe][0] > 0) {
2562 if (nTRTHitsW[ibe][1] > 0) {
2563 NumSwLLWoT_B = nTRTHitsW[ibe][0] + nTRTHitsW[ibe][1];
2564 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe), NumSwLLWoT_B);
2567 NumSwLLWoT_B = nTRTHitsW[ibe][0];
2568 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe), NumSwLLWoT_B);
2570 }
else if (nTRTHitsW[ibe][1] > 0) {
2571 NumSwLLWoT_B = nTRTHitsW[ibe][1];
2572 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe), NumSwLLWoT_B);
2576 if (nTRTHLHitsW[ibe][0] > 0) {
2577 if (nTRTHLHitsW[ibe][1] > 0) {
2578 HLhitOnTrack_B = nTRTHLHitsW[ibe][0] + nTRTHLHitsW[ibe][1];
2579 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe), HLhitOnTrack_B);
2581 HLhitOnTrack_B = nTRTHLHitsW[ibe][0];
2582 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe), HLhitOnTrack_B);
2584 }
else if (nTRTHLHitsW[ibe][1] > 0) {
2585 HLhitOnTrack_B = nTRTHLHitsW[ibe][1];
2586 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe), HLhitOnTrack_B);
2589 if (nTRTHitsW[ibe][0] + nTRTHitsW[ibe][1] > 0) {
2590 HtoLRatioOnTrack_B = (float)(nTRTHLHitsW[ibe][0] + nTRTHLHitsW[ibe][1]) / (nTRTHitsW[ibe][0] + nTRTHitsW[ibe][1]);
2591 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe), HtoLRatioOnTrack_B);
2594 if (nTRTHitsW_Ar[ibe][0] + nTRTHitsW_Ar[ibe][1] > 0) {
2595 HtoLRatioOnTrack_B_Ar = (float)(nTRTHLHitsW_Ar[ibe][0] + nTRTHLHitsW_Ar[ibe][1]) / (nTRTHitsW_Ar[ibe][0] + nTRTHitsW_Ar[ibe][1]);
2596 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe), HtoLRatioOnTrack_B_Ar);
2599 if (nTRTHitsW_Xe[ibe][0] + nTRTHitsW_Xe[ibe][1] > 0) {
2600 HtoLRatioOnTrack_B_Xe = (float)(nTRTHLHitsW_Xe[ibe][0] + nTRTHLHitsW_Xe[ibe][1]) / (nTRTHitsW_Xe[ibe][0] + nTRTHitsW_Xe[ibe][1]);
2601 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe), HtoLRatioOnTrack_B_Xe);
2603 }
else if (ibe == 1) {
2604 if (nTRTHitsW[ibe][0] > 0) {
2605 if (nTRTHitsW[ibe][1] > 0) {
2606 if (ECAhit && !ECChit && !Bhit) {
2607 NumSwLLWoT_E = nTRTHitsW[ibe][0];
2608 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe)+
"0", NumSwLLWoT_E);
2611 if (ECChit && !ECAhit && !Bhit) {
2612 NumSwLLWoT_E = nTRTHitsW[ibe][1];
2613 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe)+
"1", NumSwLLWoT_E);
2617 if (ECAhit && !ECChit && !Bhit) {
2618 NumSwLLWoT_E = nTRTHitsW[ibe][0];
2619 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe)+
"0", NumSwLLWoT_E);
2621 }
else if (nTRTHitsW[ibe][1] > 0) {
2622 if (ECChit && !ECAhit && !Bhit) {
2623 NumSwLLWoT_E = nTRTHitsW[ibe][1];
2624 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe)+
"1", NumSwLLWoT_E);
2628 for (
int iside = 0; iside < 2; iside++) {
2629 if (nTRTHLHitsW[ibe][iside] > 0) {
2630 HLhitOnTrack_E = nTRTHLHitsW[ibe][iside];
2631 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe)+std::to_string(iside), HLhitOnTrack_E);
2634 if ((nTRTHitsW[ibe][iside]) > 0) {
2635 HtoLRatioOnTrack_E = (float)(nTRTHLHitsW[ibe][iside]) / nTRTHitsW[ibe][iside];
2636 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe)+std::to_string(iside), HtoLRatioOnTrack_E);
2638 if ((nTRTHitsW_Ar[ibe][iside]) > 0) {
2639 HtoLRatioOnTrack_E_Ar = (float)(nTRTHLHitsW_Ar[ibe][iside]) / nTRTHitsW_Ar[ibe][iside];
2640 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe)+std::to_string(iside), HtoLRatioOnTrack_E_Ar);
2643 if ((nTRTHitsW_Xe[ibe][iside]) > 0) {
2644 HtoLRatioOnTrack_E_Xe = (float)(nTRTHLHitsW_Xe[ibe][iside]) / nTRTHitsW_Xe[ibe][iside];
2645 fill(
"ShiftTRTTrackHistograms"+std::to_string(ibe)+std::to_string(iside), HtoLRatioOnTrack_E_Xe);
2657 if (scale_hHitWonTMap_B[k] - scale_hHitWonTMap_B_passed[k] >= 0) {
2658 for (
int j = 0; j < scale_hHitWonTMap_B[k] - scale_hHitWonTMap_B_passed[k]; j++) {
2666 ATH_MSG_ERROR(
"Scale value " << scale_hHitWonTMap_B[k] - scale_hHitWonTMap_B_passed[k] <<
2667 " is less than zero in scaling for Barrel, k = " << k);
2669 }
catch (out_of_range &e) {
2670 ATH_MSG_ERROR(
"Index " << k <<
" out of range in scaling for Barrel");
2676 for (
int iside = 0; iside < 2; iside++) {
2678 if (scale_hHitWonTMap_E[iside][k] - scale_hHitWonTMap_E_passed[iside][k] >= 0) {
2679 for (
int j = 0; j < scale_hHitWonTMap_E[iside][k] - scale_hHitWonTMap_E_passed[iside][k]; j++) {
2681 straw_edge_struct& this_struct = straw_edge_map[iside == 0 ? 2 : -2].emplace_back();
2687 ATH_MSG_ERROR(
"Scale value " << scale_hHitWonTMap_E[iside][k] - scale_hHitWonTMap_E_passed[iside][k] <<
2688 " is less than zero in scaling for Endcap, iside = " << iside <<
", k = " << k);
2690 }
catch (out_of_range &e) {
2691 ATH_MSG_ERROR(
"Index " << k <<
" out of range in scaling for Endcap");
2696 for (
const auto& ibarrel_ecpair : straw_edge_map) {
2697 int ibe = abs(ibarrel_ecpair.first) - 1;
2698 int iside = ibarrel_ecpair.first > 0 ? 0 : 1;
2700 auto HitWonTMap_B_y =
Monitored::Collection(
"HitWonTMap_B_y", ibarrel_ecpair.second, [](
const auto& s){return s.HitWonTMap_B_y;});
2701 auto HitWonTMap_E_y =
Monitored::Collection(
"HitWonTMap_E_y", ibarrel_ecpair.second, [](
const auto& s){return s.HitWonTMap_E_y;});
2704 }
else if (ibe == 1) {
2705 fill(
"ShiftTRTTrackHistograms1"+std::to_string(iside),
strawNumber, HitWonTMap_E_y);
2709 return StatusCode::SUCCESS;