8 #include <ext/alloc_traits.h>
17 bool y_in_range = (
pos.y() <= top_H1 and
pos.y() >= bot_H2);
18 bool x_in_range = std::abs(
pos.x()) <= max_x + 0.01;
19 return y_in_range and x_in_range;
46 std::pair<int, int>
result(-1, -1);
61 bool below_half_length = (
y1 < 0);
62 bool outside_phi_range = (std::abs(
locPhi) > maxlocPhi) || (std::abs(fuzziedlocPhi) > maxlocPhi);
68 padEta = padEtadouble;
75 if (outside_phi_range)
79 int padPhi = padPhidouble + 2;
82 if (padEta ==
nPadH + 1) { padEta -= 1; }
83 if (padPhi == 0) { padPhi = 1; }
87 bool ieta_out_of_range = (padEta >
nPadH + 1);
88 bool iphi_out_of_range = (padPhi < 0 || padPhi >
nPadColumns + 1);
89 bool index_out_of_range = ieta_out_of_range or iphi_out_of_range;
90 if (index_out_of_range) {
91 std::stringstream sstr{};
92 if (ieta_out_of_range){
93 sstr<<__FILE__<<
":"<<__LINE__<<
" "<<__func__<<
"() eta out of range "
96 sstr<<__FILE__<<
":"<<__LINE__<<
" "<<__func__<<
"() phi out of range "
99 throw std::runtime_error(sstr.str());
102 result = std::make_pair(padEta, padPhi);
123 const double lenLeft = std::hypot(leftEdge.x(), leftEdge.y());
125 const double leftIsect = Amg::intersect<2>(
pos, Amg::Vector2D::UnitX(),
126 corners[
botLeft], leftEdge).value_or(1.e9);
130 const double deltaX =
pos.x() - leftPad.x();
131 const double lenX = rightPad.x() - leftPad.x();
134 if (leftIsect >= 0. && leftIsect <= lenLeft) {
139 return deltaX * Amg::Vector2D::UnitX();
141 return (
deltaX - lenX) * Amg::Vector2D::UnitX();
145 :
pos.y() - corners[
topRight].y())* Amg::Vector2D::UnitY();
148 :
pos.y() - corners[
topRight].y())* Amg::Vector2D::UnitY() +
159 int iEta = pad.first;
160 int iPhi = pad.second;
167 double yBot = 0., yTop = 0.;
171 }
else if (
iEta > 1) {
184 if (yBot < minY) yBot = minY;
185 if (yTop > maxY) yTop = maxY;
224 xTopRight = cutoutXpos;
225 if (yBot > 0) xBotRight = cutoutXpos;
227 xTopLeft = -1.0 * cutoutXpos;
228 if (yBot > 0) xBotLeft = -1.0 * cutoutXpos;
232 ATH_MSG_VERBOSE(
"Swap top and bottom side "<<pad.first<<
"/"<<pad.second);
235 if (xBotLeft > xBotRight) {
236 ATH_MSG_VERBOSE(
"Swap bottom left and right points "<<pad.first<<
"/"<<pad.second);
239 if (xTopLeft > xTopRight) {
240 ATH_MSG_VERBOSE(
"Swap top left and right points "<<pad.first<<
"/"<<pad.second);