5 #define FILLEVENTNORMALIZATION(NBINS, MIN, WIDTH, VALUE, VARPASSED, VAR, HISTGROUP) \
6 for (int i = 1; i <= NBINS; i++) \
7 if (MIN + WIDTH*(i-1) >= VALUE || MIN + WIDTH*(i+1) <= VALUE) \
11 fill(HISTGROUP, VARPASSED, VAR); \
121 for (
int ibe = 0; ibe < 2; ibe++) {
123 IdentifierHash idHash =
index;
135 idSide = idBarrelEndcap ? 1 : -1;
137 if (
isBarrel && (idBarrelEndcap == -1)) {
141 }
else if (ibe == 1) {
142 idSide = idBarrelEndcap ? 1 : 0;
144 if (!
isBarrel && ((idBarrelEndcap == -2) || (idBarrelEndcap == 2))) {
150 if (sectorflag == 1) {
151 if (!element)
continue;
153 for (
unsigned int istraw = 0; istraw < element->
nStraws(); istraw++) {
154 std::vector<Identifier> neighbourIDs;
161 if (idLayerWheel == 1) i_chip += 21;
163 if (idLayerWheel == 2) i_chip += 54;
165 int tempStrawNumber =
strawNumber(istraw, idStrawLayer, idLayerWheel);
167 if (tempStrawNumber < 0 || tempStrawNumber > (
s_Straw_max[ibe] - 1)) {
168 ATH_MSG_WARNING(
"Found tempStrawNumber = " << tempStrawNumber <<
" out of range.");
170 m_mat_chip_B.at(idPhiModule).at(tempStrawNumber) = i_chip;
171 m_mat_chip_B.at(idPhiModule + 32).at(tempStrawNumber) = i_chip;
173 }
else if (ibe == 1) {
175 int tempStrawNumber =
strawNumberEndCap(istraw, idStrawLayer, idLayerWheel, idPhiModule, idSide);
177 if (tempStrawNumber < 0 || tempStrawNumber > (
s_Straw_max[ibe] - 1)) {
178 ATH_MSG_WARNING(
"Found tempStrawNumber = " << tempStrawNumber <<
" out of range.");
180 m_mat_chip_E.at(idPhiModule).at(tempStrawNumber) = i_chip;
181 m_mat_chip_E.at(idPhiModule + 32).at(tempStrawNumber) = i_chip;
189 return StatusCode::SUCCESS;
196 std::vector<std::vector<std::vector<int>>> scale_hHitWMap;
197 std::vector<std::vector<int>> scale_hHitWMap_B, scale_hHitWMap_EA, scale_hHitWMap_EC;
198 std::vector<int> scale_B_Xe, scale_B_Ar, scale_EA_Xe, scale_EA_Ar, scale_EC_Xe, scale_EC_Ar;
200 scale_hHitWMap.clear();
201 scale_hHitWMap_B.clear();
202 scale_hHitWMap_EA.clear();
203 scale_hHitWMap_EC.clear();
218 for (
int j = 0; j < 32; j++ ) {
229 scale_B_Xe.push_back(countXe);
230 scale_B_Ar.push_back(countAr);
234 scale_EA_Xe.push_back(32);
235 scale_EA_Ar.push_back(32);
236 scale_EC_Xe.push_back(32);
237 scale_EC_Ar.push_back(32);
240 scale_hHitWMap_B.push_back(scale_B_Xe);
241 scale_hHitWMap_B.push_back(scale_B_Ar);
242 scale_hHitWMap_EA.push_back(scale_EA_Xe);
243 scale_hHitWMap_EA.push_back(scale_EA_Ar);
244 scale_hHitWMap_EC.push_back(scale_EC_Xe);
245 scale_hHitWMap_EC.push_back(scale_EC_Ar);
246 scale_hHitWMap.push_back(scale_hHitWMap_B);
247 scale_hHitWMap.push_back(scale_hHitWMap_EA);
248 scale_hHitWMap.push_back(scale_hHitWMap_EC);
251 return scale_hHitWMap;
271 bsErrCont=bsErrContHdl.cptr();
285 const std::set<std::pair<uint32_t, uint32_t> > &L1IDErrorSet = bsErrCont->
getL1ErrorSet();
286 const std::set<std::pair<uint32_t, uint32_t> > &BCIDErrorSet = bsErrCont->
getBCIDErrorSet();
288 const std::set<uint32_t> &SidErrorSet = bsErrCont->
getSidErrorSet();
289 const std::set<std::pair<uint32_t, uint32_t> > &RobStatusErrorSet = bsErrCont->
getRobErrorSet();
291 const unsigned int rod_id_base[2][2] = { { 0x310000, 0x320000 }, { 0x330000, 0x340000 } };
292 const unsigned int nChipsTotal[2][2] = { { 3328, 3328 }, { 7680, 7680 } };
293 const unsigned int nRobsTotal[2][2] = { { 32, 32 }, { 64, 64 } };
294 float nBSErrors[2][2] = { { 0, 0 }, { 0, 0 } };
295 float nRobErrors[2][2] = { { 0, 0 }, { 0, 0 } };
297 const std::set<std::pair<uint32_t, uint32_t> > *errorset1[2] = { &BCIDErrorSet, &L1IDErrorSet };
299 for (
int iset = 0; iset < 2; ++iset) {
300 for (
auto setIt = errorset1[iset]->
begin(); setIt != errorset1[iset]->end(); ++setIt) {
301 for (
int ibe = 0; ibe < 2; ++ibe) {
302 for (
int iside = 0; iside < 2; ++iside) {
303 if (((setIt->first >> 8) & 0xFF0000) == rod_id_base[ibe][iside]) {
304 nBSErrors[ibe][iside] += 1. / nChipsTotal[ibe][iside];
311 const std::set<uint32_t> *errorset2[2] = { &MissingErrorSet, &SidErrorSet };
313 for (
int iset = 0; iset < 2; ++iset) {
314 for (
auto setIt = errorset2[iset]->
begin(); setIt != errorset2[iset]->end(); ++setIt) {
315 for (
int ibe = 0; ibe < 2; ++ibe) {
316 for (
int iside = 0; iside < 2; ++iside) {
317 if (((*setIt >> 8) & 0xFF0000) == rod_id_base[ibe][iside]) {
318 nBSErrors[ibe][iside] += 1. / nChipsTotal[ibe][iside];
325 for (
int ibe = 0; ibe < 2; ++ibe) {
326 for (
int iside = 0; iside < 2; ++iside) {
328 ChipBSErrorsVsLB_y = nBSErrors[ibe][iside];
334 for (
auto setIt = RobStatusErrorSet.begin(); setIt != RobStatusErrorSet.end(); ++setIt) {
335 for (
int ibe = 0; ibe < 2; ++ibe) {
336 for (
int iside = 0; iside < 2; ++iside) {
337 if (setIt->first % rod_id_base[ibe][iside] < 0xffff) {
338 nRobErrors[ibe][iside] += 1. / nRobsTotal[ibe][iside];
344 for (
int ibe = 0; ibe < 2; ++ibe) {
345 for (
int iside = 0; iside < 2; ++iside) {
347 RobBSErrorsVsLB_y = nRobErrors[ibe][iside];
370 const int list[] = {10, 11, 15, 9, 9, 11, 12, 13, 14};
374 for (
int i = 0;
i < 9;
i++) {
377 if (chip <
count)
return i + 1;
378 else if (chip == 104)
return 9;
381 assert(
count == 104);
408 for (; RDO_CollectionBegin != RDO_CollectionEnd; ++RDO_CollectionBegin) {
411 if (!TRT_Collection)
continue;
415 for (; p_rdo != TRT_Collection->
end(); ++p_rdo) {
418 if (!p_lolum)
continue;
435 int addToStrawNumber = 0;
436 int addToStrawNumberNext = 0;
438 const int numberOfStraws[75] = {
465 addToStrawNumber += numberOfStraws[
i - 1];
466 addToStrawNumberNext = addToStrawNumber + numberOfStraws[
i];
471 if (strawNumber < 0 || strawNumber >
s_Straw_max[0] - 1) {
482 const int numberOfStraws[75] = {
509 for (
i = 1; inp_strawnumber >= 0;
i++) {
510 inp_strawnumber -= numberOfStraws[
i];
525 static const int TripletOrientation[2][32] = {
527 1, 1, 1, 1, 1, 1, 1, 1,
528 0, 0, 0, 0, 0, 0, 0, 0,
529 1, 1, 1, 1, 1, 1, 1, 1,
530 0, 0, 0, 0, 0, 0, 0, 0
533 1, 1, 1, 1, 1, 1, 1, 1,
534 0, 0, 0, 0, 0, 0, 0, 0,
535 1, 1, 1, 1, 1, 1, 1, 1,
536 0, 0, 0, 0, 0, 0, 0, 0
541 if (
side == 2) phi1 = phi_stack,
side = 1;
542 else if (
side == -2) phi1 = 31 - phi_stack,
side = 0;
545 if (TripletOrientation[
side][phi1]) {
571 int strawNumberNew = 0;
573 if (LayerNumber < 6 && strawLayerNumber > 7) {
574 strawNumberNew = strawNumberNew + (384 * LayerNumber);
577 strawNumberNew = strawNumberNew + (384 * LayerNumber);
580 strawNumberNew = strawNumberNew + 2304 + 192 * (LayerNumber - 6);
583 strawNumberNew = strawNumberNew + 2304 + 192 * (LayerNumber - 6);
589 if (strawNumber < 0 || strawNumber >
s_Straw_max[1] - 1) {
601 switch (LayerNumber) {
621 if (strawLayerNumInp < 19) {
624 }
else if (strawLayerNumInp < 43) {
638 float degreeValue = radValue /
M_PI * 180;
640 if (degreeValue < 0) degreeValue += 360;
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();
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();
916 if ( is_barrel && ibe == 0 ) {
919 if (thisStrawNumber >= 0 && thisStrawNumber <
s_Straw_max[ibe]) {
925 }
else if ( !is_barrel && ibe == 1 ) {
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;
1043 HtoLMapS = thisStrawNumber;
1044 HtoLMapS_passed = 0.0;
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;
1111 HtoLMapC = chip - 1;
1112 HtoLMapC_passed = 0.0;
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;});
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) {
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;});
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;});
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;});
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;});
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;
1563 AvgLLOccMod_side_x, AvgLLOccMod_side_y, AvgHLOccMod_side_x, AvgHLOccMod_side_y);
1575 int lastLumiBlock = -99;
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) {
1655 ChipBSErrorsVsLB_y = nBSErrors[ibe][iside];
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) {
1676 RobBSErrorsVsLB_y = nRobErrors[ibe][iside];
1685 return StatusCode::SUCCESS;
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.");
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;
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) {
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;
1872 EfficiencyC_passed = 1.0;
1874 }
else if (iside == 1) {
1875 EfficiencyS = thisStrawNumber;
1876 EfficiencyS_passed = 1.0;
1879 EfficiencyC_passed = 1.0;
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);
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;
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) {
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;
1986 EfficiencyC_passed = 0.0;
1988 }
else if (iside == 1) {
1989 EfficiencyS = thisStrawNumber;
1990 EfficiencyS_passed = 0.0;
1993 EfficiencyC_passed = 0.0;
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) {
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;
2126 float theta = mPer->parameters()[
Trk::theta];
2128 float pT = (
p *
sin(theta));
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;
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};
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) {
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;
2330 if (
m_doStraws) scale_hHitWonTMap_E[iside][thisStrawNumber[ibe]]++;
2335 EfficiencyS = thisStrawNumber[ibe];
2336 EfficiencyS_passed = 1.0;
2341 EfficiencyC = chip[ibe] - 1;
2342 EfficiencyC_passed = 1.0;
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;
2362 if (
m_doStraws) scale_hHitWonTMap_E[iside][thisStrawNumber[ibe]]++;
2367 EfficiencyS = thisStrawNumber[ibe];
2368 EfficiencyS_passed = 0.0;
2373 EfficiencyC = chip[ibe] - 1;
2374 EfficiencyC_passed = 0.0;
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];
2397 HitToTonTMapC_x = chip[ibe] - 1;
2403 if (is_middleHTbit_high) {
2404 HitHonTMapS = thisStrawNumber[ibe];
2406 HitHWonTMapS = thisStrawNumber[ibe];
2409 HtoLonTMapS = thisStrawNumber[ibe];
2410 HtoLonTMapS_passed = 1.0;
2412 HtoLWonTMapS = thisStrawNumber[ibe];
2413 HtoLWonTMapS_passed = 1.0;
2419 if (is_middleHTbit_high) {
2420 HitHWonTMapC = chip[ibe] - 1;
2422 HitHonTMapC = chip[ibe] - 1;
2424 HtoLonTMapC = chip[ibe] - 1;
2425 HtoLonTMapC_passed = 1.0;
2427 HtoLWonTMapC = chip[ibe] - 1;
2428 HtoLWonTMapC_passed = 1.0;
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];
2460 HitWonTMapC = chip[ibe] - 1;
2472 HitTronTMapS_x = thisStrawNumber[ibe];
2473 HitTronTMapS_y = trailingEdgeScaled;
2478 HitTronTMapC_x = chip[ibe] - 1;
2479 HitTronTMapC_y = trailingEdgeScaled;
2489 HitAonTMapS = thisStrawNumber[ibe];
2492 if (!is_middleHTbit_high) {
2493 HtoLonTMapS = thisStrawNumber[ibe];
2494 HtoLonTMapS_passed = 0.0;
2500 HitAonTMapC = chip[ibe] - 1;
2502 if (!is_middleHTbit_high) {
2503 HtoLonTMapC = chip[ibe] - 1;
2504 HtoLonTMapC_passed = 0.0;
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];
2528 if (!is_middleHTbit_high) {
2529 HtoLWonTMapS = thisStrawNumber[ibe];
2530 HtoLWonTMapS_passed = 0.0;
2536 HitAWonTMapC = chip[ibe] - 1;
2539 if (!is_middleHTbit_high) {
2540 HtoLWonTMapC = chip[ibe] - 1;
2541 HtoLWonTMapC_passed = 0.0;
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];
2567 NumSwLLWoT_B = nTRTHitsW[ibe][0];
2570 }
else if (nTRTHitsW[ibe][1] > 0) {
2571 NumSwLLWoT_B = nTRTHitsW[ibe][1];
2576 if (nTRTHLHitsW[ibe][0] > 0) {
2577 if (nTRTHLHitsW[ibe][1] > 0) {
2578 HLhitOnTrack_B = nTRTHLHitsW[ibe][0] + nTRTHLHitsW[ibe][1];
2581 HLhitOnTrack_B = nTRTHLHitsW[ibe][0];
2584 }
else if (nTRTHLHitsW[ibe][1] > 0) {
2585 HLhitOnTrack_B = nTRTHLHitsW[ibe][1];
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]);
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]);
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]);
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];
2611 if (ECChit && !ECAhit && !Bhit) {
2612 NumSwLLWoT_E = nTRTHitsW[ibe][1];
2617 if (ECAhit && !ECChit && !Bhit) {
2618 NumSwLLWoT_E = nTRTHitsW[ibe][0];
2621 }
else if (nTRTHitsW[ibe][1] > 0) {
2622 if (ECChit && !ECAhit && !Bhit) {
2623 NumSwLLWoT_E = nTRTHitsW[ibe][1];
2628 for (
int iside = 0; iside < 2; iside++) {
2629 if (nTRTHLHitsW[ibe][iside] > 0) {
2630 HLhitOnTrack_E = nTRTHLHitsW[ibe][iside];
2634 if ((nTRTHitsW[ibe][iside]) > 0) {
2635 HtoLRatioOnTrack_E = (
float)(nTRTHLHitsW[ibe][iside]) / nTRTHitsW[ibe][iside];
2638 if ((nTRTHitsW_Ar[ibe][iside]) > 0) {
2639 HtoLRatioOnTrack_E_Ar = (
float)(nTRTHLHitsW_Ar[ibe][iside]) / nTRTHitsW_Ar[ibe][iside];
2643 if ((nTRTHitsW_Xe[ibe][iside]) > 0) {
2644 HtoLRatioOnTrack_E_Xe = (
float)(nTRTHLHitsW_Xe[ibe][iside]) / nTRTHitsW_Xe[ibe][iside];
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) {
2709 return StatusCode::SUCCESS;
2715 bool passEventBurst;
2726 if (!rdoContainer.
isValid()) {
2729 return StatusCode::FAILURE;
2733 if (passEventBurst) {
2734 if (!trtBCIDCollection.
isValid()) {
2741 }
else passEventBurst =
true;
2744 if (!combTrackCollection.
isValid()) {
2747 return StatusCode::FAILURE;
2753 if (!trackCollection.
isValid()) {
2756 return StatusCode::FAILURE;
2758 if (passEventBurst) {
2763 return StatusCode::SUCCESS;