54 mask = !((u > 2 *
v) && (
v <
n));
56 mask = ((u >=
n) && (
v >=
n) && ((u +
v) > (3 *
n - 2)));
64 mask = ((u >=
n) && (u >
v) && ((2 * u -
v) > 2 *
n));
70 mask = !((u < n) && (v > u) && (
v > (2 * u - 1)));
72 mask = ((u > 2 *
v) && (
v <
n));
78 mask = !((
v >= u) && ((2 *
v - u) > (2 *
n - 2)));
86 mask = !((u >=
n) && (
v >=
n) && ((u +
v) > (3 *
n - 2)));
88 mask = ((u < n) && (v > u) && (
v > (2 * u - 1)));
94 mask = !((u >=
n) && (u >
v) && ((2 * u -
v) > 2 *
n));
96 mask = ((
v >= u) && ((2 *
v - u) > (2 *
n - 2)));
104 edm::LogVerbatim(
"HGCalGeom") <<
"Corners: " << ncor <<
":" << fcor <<
" N " <<
n <<
" u " << u <<
" v " <<
v 115 int n3 = (
n + 1) / 3;
129 good = ((
v + u) < (3 *
n));
133 int v2 = (
v + 1) / 2;
134 good = ((u - v2) <=
n);
138 int u2 = (u - 1) / 2;
143 good = ((
v + u) >=
n - 1);
157 good = (
v < (3 * n2));
161 good = (u < (3 * n2));
165 good = ((u -
v) <= n2);
173 good = (u >= n2 - 1);
177 good = ((
v - u) < n2);
186 good = (
v < (5 * n4));
190 good = (u <= (5 * n4));
194 good = ((u -
v) <= n4);
198 good = (
v >= (3 * n4 - 1));
202 good = (u >= (3 * n4));
206 good = ((
v - u) <= n4);
244 good = ((u +
v) <= (2 *
n));
248 good = ((2 * u -
v) <= (
n + 1));
252 good = ((2 *
v - u) >= (
n - 2));
256 good = ((u +
v) >= (2 *
n - 2));
260 good = ((2 * u -
v) >= (
n - 1));
264 good = ((2 *
v - u) <=
n);
277 good = ((2 * u -
v) <= 1);
281 int u2 = ((u > 0) ? (u / 2) : 0);
283 good = (uv >= (
n - 1));
287 good = ((
v + u) >= (3 *
n - 2));
292 good = (uv >= (2 *
n - 1));
306 good = ((u +
v) <= (4 * n3 + 1));
310 good = ((2 * u -
v) <= n2);
314 int u2 = ((u + 1) / 2);
315 good = ((
v -
u2) >= (3 * n4 - 1));
319 good = ((u +
v) >= (5 * n2 - 1));
323 good = ((2 * u -
v) >= (3 * n2));
327 int u2 = (u + 1) / 2;
337 good = ((2 *
v - u) <= (3 * n2));
341 good = ((u +
v) < (5 * n2));
345 good = ((2 * u -
v) >= (3 * n2));
349 good = ((2 *
v - u) >= n3);
353 good = ((u +
v) > (4 * n3));
357 good = ((2 * u -
v) >= n2);
366 good = (
v <= (3 * n4));
370 good = (u <= (3 * n4));
374 good = ((
v - u) >= n4 - 1);
378 good = (
v >= (5 * n4 - 1));
382 good = (u >= (5 * n4 - 1));
386 good = ((u -
v) >= n4);
394 edm::LogVerbatim(
"HGCalGeom") <<
"u|v " << u <<
":" <<
v <<
" N " <<
n <<
" type " <<
type <<
" rot " << rotn
463 edm::LogVerbatim(
"HGCalGeom") <<
"u|v " << u <<
":" <<
v <<
" WaferType " << waferType <<
" good " <<
good;
481 newrotn = rot1[rotn];
490 newrotn = rot2[rotn];
498 newrotn = rot3[rotn];
515 const bool& v17OrLess,
530 static constexpr
int corners = 6;
531 static constexpr
int base = 10;
532 double rin2 = rin * rin;
533 double rout2 = rout * rout;
546 double xc[corners], yc[corners];
547 for (
int k = 0;
k < corners; ++
k) {
548 xc[
k] = xpos + dx0[
k];
549 yc[
k] = ypos + dy0[
k];
550 double rpos2 = (xc[
k] * xc[
k] + yc[
k] * yc[
k]);
551 if (rpos2 <= rout2 && rpos2 >= rin2) {
553 iok = iok *
base + 1;
559 edm::LogVerbatim(
"HGCalGeom") <<
"I/p: xp " << xpos <<
" yp " << ypos <<
" dX " << delX <<
" dY " << delY <<
" rin " 560 << rin <<
" rout " << rout <<
" wtype " << wType <<
" mode " <<
mode <<
" Corners " 561 << ncor <<
" iok " << iok;
563 static constexpr
int ipat5[corners] = {101111, 110111, 111011, 111101, 111110, 11111};
564 static constexpr
int ipat4[corners] = {100111, 110011, 111001, 111100, 11110, 1111};
565 static constexpr
int ipat3[corners] = {100011, 110001, 111000, 11100, 1110, 111};
566 static constexpr
int ipat2[corners] = {11, 100001, 110000, 11000, 1100, 110};
591 double dx3[corners] = {
593 double dy3[corners] = {-c88 * delY, -c27 * delY, c61 * delY, c88 * delY, c27 * delY, -c61 * delY};
594 double dx4[corners] = {
596 double dy4[corners] = {c88 * delY, c61 * delY, -c27 * delY, -c88 * delY, -c61 * delY, c27 * delY};
609 double dx6[corners] = {
611 double dy6[corners] = {c61 * delY, -c27 * delY, -c88 * delY, -c61 * delY, c27 * delY, c88 * delY};
612 double dx7[corners] = {
614 double dy7[corners] = {c88 * delY, c27 * delY, -c61 * delY, -c88 * delY, -c27 * delY, c61 * delY};
615 double dx8[corners] = {
617 double dy8[corners] = {-c61 * delY, c27 * delY, c88 * delY, c61 * delY, -c27 * delY, -c88 * delY};
618 double dx9[corners] = {
620 double dy9[corners] = {-c88 * delY, -c61 * delY, c27 * delY, c88 * delY, c61 * delY, -c27 * delY};
624 rotn =
static_cast<int>(
std::find(ipat5, ipat5 + 6, iok) - ipat5);
627 rotn =
static_cast<int>(
std::find(ipat4, ipat4 + 6, iok) - ipat4);
629 double rpos12 = ((xpos + dx1[rotn]) * (xpos + dx1[rotn]) + (ypos + dy1[rotn]) * (ypos + dy1[rotn]));
631 if (rpos12 <= rout2 && rpos12 >= rin2) {
632 rpos22 = ((xpos + dx2[rotn]) * (xpos + dx2[rotn]) + (ypos + dy2[rotn]) * (ypos + dy2[rotn]));
633 if (rpos22 <= rout2 && rpos22 >= rin2)
640 rpos12 = ((xpos + dx3[rotn]) * (xpos + dx3[rotn]) + (ypos + dy3[rotn]) * (ypos + dy3[rotn]));
641 if (rpos12 <= rout2 && rpos12 >= rin2) {
642 rpos22 = ((xpos + dx4[rotn]) * (xpos + dx4[rotn]) + (ypos + dy4[rotn]) * (ypos + dy4[rotn]));
643 if (rpos22 <= rout2 && rpos22 >= rin2)
651 rotn =
static_cast<int>(
std::find(ipat3, ipat3 + 6, iok) - ipat3);
653 double rpos12 = ((xpos + dx7[rotn]) * (xpos + dx7[rotn]) + (ypos + dy7[rotn]) * (ypos + dy7[rotn]));
655 if (rpos12 <= rout2 && rpos12 >= rin2) {
656 rpos22 = ((xpos + dx8[rotn]) * (xpos + dx8[rotn]) + (ypos + dy8[rotn]) * (ypos + dy8[rotn]));
657 if (rpos22 <= rout2 && rpos22 >= rin2)
664 rpos12 = ((xpos + dx1[rotn]) * (xpos + dx1[rotn]) + (ypos + dy1[rotn]) * (ypos + dy1[rotn]));
665 if (rpos12 <= rout2 && rpos12 >= rin2) {
666 rpos22 = ((xpos + dx5[rotn]) * (xpos + dx5[rotn]) + (ypos + dy5[rotn]) * (ypos + dy5[rotn]));
667 if (rpos22 <= rout2 && rpos22 >= rin2)
675 rpos12 = ((xpos + dx3[rotn]) * (xpos + dx3[rotn]) + (ypos + dy3[rotn]) * (ypos + dy3[rotn]));
676 if (rpos12 <= rout2 && rpos12 >= rin2) {
677 rpos22 = ((xpos + dx6[rotn]) * (xpos + dx6[rotn]) + (ypos + dy6[rotn]) * (ypos + dy6[rotn]));
678 if (rpos22 <= rout2 && rpos22 >= rin2)
686 rotn =
static_cast<int>(
std::find(ipat2, ipat2 + 6, iok) - ipat2);
688 double rpos12 = ((xpos + dx7[rotn]) * (xpos + dx7[rotn]) + (ypos + dy7[rotn]) * (ypos + dy7[rotn]));
690 if (rpos12 <= rout2 && rpos12 >= rin2) {
691 rpos22 = ((xpos + dx9[rotn]) * (xpos + dx9[rotn]) + (ypos + dy9[rotn]) * (ypos + dy9[rotn]));
692 if (rpos22 <= rout2 && rpos22 >= rin2)
705 edm::LogVerbatim(
"HGCalGeom") <<
"I/p: xpos " << xpos <<
" ypos " << ypos <<
" dX " << delX <<
" dY " << delY
706 <<
" rin " << rin <<
" rout " << rout <<
" wType " << wType <<
" mode " <<
mode 707 <<
" O/p: ok " << iok <<
" ncor " << ncor <<
" type " <<
type <<
" rotn " << rotn;
719 const bool& v17OrLess,
736 double rin2 = rin * rin;
737 double rout2 = rout * rout;
741 static constexpr
int base = 10;
742 static constexpr
int base2 = 100;
767 double dx2[corner2] = {c22 * delX,
779 double dy2[corner2] = {-c88 * delY,
795 static constexpr
int nc0[corners] = {450, 150, 201, 312, 423, 534};
797 for (
int k1 = 0; k1 < 3; ++k1) {
799 double xc1 = xpos + dx0[
k];
800 double yc1 = ypos + dy0[
k];
801 rpos2 = (xc1 * xc1 + yc1 * yc1);
802 if ((rpos2 > rout2) || (rpos2 < rin2)) {
812 static constexpr
int nc10[corners] = {450, 150, 201, 312, 423, 534};
813 static constexpr
int nc11[corners] = {700, 902, 1104, 106, 308, 510};
815 for (
int k1 = 0; k1 < 3; ++k1) {
817 double xc1 = xpos + dx0[
k];
818 double yc1 = ypos + dy0[
k];
819 rpos2 = (xc1 * xc1 + yc1 * yc1);
820 if ((rpos2 > rout2) || (rpos2 < rin2)) {
828 for (
int k1 = 0; k1 < 2; ++k1) {
830 double xc1 = xpos + dx2[
k];
831 double yc1 = ypos + dy2[
k];
832 rpos2 = (xc1 * xc1 + yc1 * yc1);
833 if ((rpos2 > rout2) || (rpos2 < rin2)) {
843 static constexpr
int nc20[corners] = {450, 150, 201, 312, 423, 534};
844 static constexpr
int nc21[corners] = {30, 14, 25, 30, 41, 52};
846 for (
int k1 = 0; k1 < 3; ++k1) {
848 double xc1 = xpos + dx0[
k];
849 double yc1 = ypos + dy0[
k];
850 rpos2 = (xc1 * xc1 + yc1 * yc1);
851 if ((rpos2 > rout2) || (rpos2 < rin2)) {
859 for (
int k1 = 0; k1 < 2; ++k1) {
861 double xc1 = xpos + dx1[
k];
862 double yc1 = ypos + dy1[
k];
863 rpos2 = (xc1 * xc1 + yc1 * yc1);
864 if ((rpos2 > rout2) || (rpos2 < rin2)) {
874 static constexpr
int nc3[corners] = {3450, 1450, 2501, 3012, 4123, 5234};
876 for (
int k1 = 0; k1 < 4; ++k1) {
878 double xc1 = xpos + dx0[
k];
879 double yc1 = ypos + dy0[
k];
880 rpos2 = (xc1 * xc1 + yc1 * yc1);
881 if ((rpos2 > rout2) || (rpos2 < rin2)) {
891 static constexpr
int nc40[corners] = {3450, 1450, 2501, 3012, 4123, 5234};
892 static constexpr
int nc41[corners] = {500, 702, 904, 1106, 108, 310};
894 for (
int k1 = 0; k1 < 4; ++k1) {
896 double xc1 = xpos + dx0[
k];
897 double yc1 = ypos + dy0[
k];
898 rpos2 = (xc1 * xc1 + yc1 * yc1);
899 if ((rpos2 > rout2) || (rpos2 < rin2)) {
907 for (
int k1 = 0; k1 < 2; ++k1) {
909 double xc1 = xpos + dx2[
k];
910 double yc1 = ypos + dy2[
k];
911 rpos2 = (xc1 * xc1 + yc1 * yc1);
912 if ((rpos2 > rout2) || (rpos2 < rin2)) {
922 static constexpr
int nc50[corners] = {3450, 1450, 2501, 3012, 4123, 5234};
923 static constexpr
int nc51[corners] = {20, 13, 24, 35, 40, 51};
925 for (
int k1 = 0; k1 < 4; ++k1) {
927 double xc1 = xpos + dx0[
k];
928 double yc1 = ypos + dy0[
k];
929 rpos2 = (xc1 * xc1 + yc1 * yc1);
930 if ((rpos2 > rout2) || (rpos2 < rin2)) {
938 for (
int k1 = 0; k1 < 2; ++k1) {
940 double xc1 = xpos + dx1[
k];
941 double yc1 = ypos + dy1[
k];
942 rpos2 = (xc1 * xc1 + yc1 * yc1);
943 if ((rpos2 > rout2) || (rpos2 < rin2)) {
953 static constexpr
int nc6[corners] = {23450, 13450, 24501, 35012, 40123, 51234};
955 for (
int k1 = 0; k1 < 5; ++k1) {
957 double xc1 = xpos + dx0[
k];
958 double yc1 = ypos + dy0[
k];
959 rpos2 = (xc1 * xc1 + yc1 * yc1);
960 if ((rpos2 > rout2) || (rpos2 < rin2)) {
969 static constexpr
int nc60[corners] = {450, 150, 201, 312, 423, 534};
970 static constexpr
int nc61[corners] = {601, 803, 1005, 7, 209, 411};
972 for (
int k1 = 0; k1 < 3; ++k1) {
974 double xc1 = xpos + dx0[
k];
975 double yc1 = ypos + dy0[
k];
976 rpos2 = (xc1 * xc1 + yc1 * yc1);
977 if ((rpos2 > rout2) || (rpos2 < rin2)) {
985 for (
int k1 = 0; k1 < 2; ++k1) {
987 double xc1 = xpos + dx2[
k];
988 double yc1 = ypos + dy2[
k];
989 rpos2 = (xc1 * xc1 + yc1 * yc1);
990 if ((rpos2 > rout2) || (rpos2 < rin2)) {
1000 static constexpr
int nc70[corners] = {45, 50, 1, 12, 23, 34};
1001 static constexpr
int nc71[corners] = {611, 801, 1003, 5, 207, 409};
1002 int nc = nc70[rotn];
1003 for (
int k1 = 0; k1 < 2; ++k1) {
1005 double xc1 = xpos + dx0[
k];
1006 double yc1 = ypos + dy0[
k];
1007 rpos2 = (xc1 * xc1 + yc1 * yc1);
1008 if ((rpos2 > rout2) || (rpos2 < rin2)) {
1016 for (
int k1 = 0; k1 < 2; ++k1) {
1018 double xc1 = xpos + dx2[
k];
1019 double yc1 = ypos + dy2[
k];
1020 rpos2 = (xc1 * xc1 + yc1 * yc1);
1021 if ((rpos2 > rout2) || (rpos2 < rin2)) {
1031 for (
int k = 0;
k < corners; ++
k) {
1032 double xc1 = xpos + dx0[
k];
1033 double yc1 = ypos + dy0[
k];
1034 rpos2 = (xc1 * xc1 + yc1 * yc1);
1035 if ((rpos2 > rout2) || (rpos2 < rin2)) {
1045 edm::LogVerbatim(
"HGCalGeom") <<
"I/p: xpos " << xpos <<
" ypos " << ypos <<
" dX " << delX <<
" dY " << delY
1046 <<
" rin " << rin <<
" rout " << rout <<
" part " <<
part <<
" rotn " << rotn
1047 <<
" Results: ok " <<
ok <<
" ncf " << ncf <<
" rin " << rin2 <<
" rout " << rout2
1048 <<
" rpos " << rpos2;
1055 const double& waferSize,
1059 const bool& v17OrLess) {
1061 std::vector<std::pair<double, double> >
xy;
1098 double delX = 0.5 * waferSize;
1197 double offsetx[48] = {0.0,
1295 int np[7] = {0, 1, 2, 3, 4, 5, 0};
1296 for (
int k = 0;
k < 7; ++
k)
1297 xy.push_back(std::make_pair((xpos +
dx[
np[
k]] + offsetx[
np[
k]]), (ypos +
dy[
np[
k]] + offsety[
np[
k]])));
1299 int np[6][6] = {{0, 2, 3, 4, 5, 0},
1304 {5, 1, 2, 3, 4, 5}};
1305 for (
int k = 0;
k < 6; ++
k) {
1316 {0, 3, 4, 5, 0}, {1, 4, 5, 0, 1}, {2, 5, 0, 1, 2}, {3, 0, 1, 2, 3}, {4, 1, 2, 3, 4}, {5, 2, 3, 4, 5}};
1317 for (
int k = 0;
k < 5; ++
k) {
1327 int np[6][4] = {{0, 4, 5, 0}, {1, 5, 0, 1}, {2, 0, 1, 2}, {3, 1, 2, 3}, {4, 2, 3, 4}, {5, 3, 4, 5}};
1328 for (
int k = 0;
k < 4; ++
k) {
1338 int np[6][7] = {{24, 32, 3, 4, 5, 0, 24},
1339 {25, 33, 4, 5, 0, 1, 25},
1340 {26, 34, 5, 0, 1, 2, 26},
1341 {27, 35, 0, 1, 2, 3, 27},
1342 {28, 30, 1, 2, 3, 4, 28},
1343 {29, 31, 2, 3, 4, 5, 29}};
1344 for (
int k = 0;
k < 7; ++
k) {
1354 int np[6][6] = {{6, 9, 4, 5, 0, 6},
1355 {7, 10, 5, 0, 1, 7},
1356 {8, 11, 0, 1, 2, 8},
1358 {10, 7, 2, 3, 4, 10},
1359 {11, 8, 3, 4, 5, 11}};
1360 for (
int k = 0;
k < 6; ++
k) {
1370 int np[6][7] = {{36, 42, 3, 4, 5, 0, 36},
1371 {37, 43, 4, 5, 0, 1, 37},
1372 {38, 44, 5, 0, 1, 2, 38},
1373 {39, 45, 0, 1, 2, 3, 39},
1374 {40, 46, 1, 2, 3, 4, 40},
1375 {41, 47, 2, 3, 4, 5, 41}};
1376 for (
int k = 0;
k < 7; ++
k) {
1386 int np[6][6] = {{12, 19, 4, 5, 0, 12},
1387 {13, 20, 5, 0, 1, 13},
1388 {14, 21, 0, 1, 2, 14},
1389 {15, 22, 1, 2, 3, 15},
1390 {16, 23, 2, 3, 4, 16},
1391 {17, 18, 3, 4, 5, 17}};
1392 for (
int k = 0;
k < 6; ++
k) {
1402 int np[6][6] = {{22, 15, 4, 5, 0, 22},
1403 {23, 16, 5, 0, 1, 23},
1404 {18, 17, 0, 1, 2, 18},
1405 {19, 12, 1, 2, 3, 19},
1406 {20, 13, 2, 3, 4, 20},
1407 {21, 14, 3, 4, 5, 21}};
1408 for (
int k = 0;
k < 6; ++
k) {
1418 int np[6][5] = {{45, 39, 4, 5, 45},
1423 {44, 38, 3, 4, 44}};
1424 for (
int k = 0;
k < 5; ++
k) {
1436 <<
" dY " << delY <<
" xpos " << xpos <<
" ypos " << ypos <<
" O/p having " <<
xy.size()
1438 std::ostringstream st1;
1439 for (
unsigned int i = 0;
i <
xy.size(); ++
i)
1448 const double& waferSize,
1452 const bool& v17OrLess) {
1453 std::vector<std::pair<double, double> >
xy;
1489 double delX = 0.5 * waferSize;
1616 double offsetx[60] = {0.0,
1738 int np[7] = {0, 1, 2, 3, 4, 5, 0};
1739 for (
int k = 0;
k < 7; ++
k) {
1740 xy.push_back(std::make_pair((xpos +
dx[
np[
k]] + offsetx[
np[
k]]), (ypos +
dy[
np[
k]] + offsety[
np[
k]])));
1747 int np[12][5] = {{0, 1, 4, 5, 0},
1759 for (
int k = 0;
k < 5; ++
k) {
1760 xy.push_back(std::make_pair((xpos +
dx[
np[place][
k]] + offsetx[
np[place][
k]]),
1761 (ypos +
dy[
np[place][
k]] + offsety[
np[place][
k]])));
1764 <<
dx[
np[place][
k]] + offsetx[
np[place][
k]] <<
" dy " 1765 <<
dy[
np[place][
k]] + offsety[
np[place][
k]];
1769 int np[12][5] = {{1, 2, 3, 4, 1},
1781 for (
int k = 0;
k < 5; ++
k) {
1782 xy.push_back(std::make_pair((xpos +
dx[
np[place][
k]] + offsetx[
np[place][
k]]),
1783 (ypos +
dy[
np[place][
k]] + offsety[
np[place][
k]])));
1786 <<
dx[
np[place][
k]] + offsetx[
np[place][
k]] <<
" dy " 1787 <<
dy[
np[place][
k]] + offsety[
np[place][
k]];
1791 int np[12][6] = {{0, 1, 2, 8, 11, 0},
1793 {2, 3, 4, 10, 7, 2},
1794 {3, 4, 5, 11, 8, 3},
1796 {5, 0, 1, 7, 10, 5},
1798 {5, 11, 8, 3, 4, 5},
1799 {4, 10, 7, 2, 3, 4},
1801 {2, 8, 11, 0, 1, 2},
1802 {1, 7, 10, 5, 0, 1}};
1803 for (
int k = 0;
k < 6; ++
k) {
1804 xy.push_back(std::make_pair((xpos +
dx[
np[place][
k]] + offsetx[
np[place][
k]]),
1805 (ypos +
dy[
np[place][
k]] + offsety[
np[place][
k]])));
1808 <<
dx[
np[place][
k]] + offsetx[
np[place][
k]] <<
" dy " 1809 <<
dy[
np[place][
k]] + offsety[
np[place][
k]];
1813 int np[12][6] = {{5, 11, 8, 3, 4, 5},
1815 {1, 7, 10, 5, 0, 1},
1816 {2, 8, 11, 0, 1, 2},
1818 {4, 10, 7, 2, 3, 4},
1820 {0, 1, 2, 8, 11, 0},
1821 {5, 0, 1, 7, 10, 5},
1823 {3, 4, 5, 11, 8, 3},
1824 {2, 3, 4, 10, 7, 2}};
1825 for (
int k = 0;
k < 6; ++
k) {
1826 xy.push_back(std::make_pair((xpos +
dx[
np[place][
k]] + offsetx[
np[place][
k]]),
1827 (ypos +
dy[
np[place][
k]] + offsety[
np[place][
k]])));
1830 <<
dx[
np[place][
k]] + offsetx[
np[place][
k]] <<
" dy " 1831 <<
dy[
np[place][
k]] + offsety[
np[place][
k]];
1835 int np[12][6] = {{0, 1, 2, 57, 53, 0},
1836 {1, 2, 3, 58, 48, 1},
1837 {2, 3, 4, 59, 49, 2},
1838 {3, 4, 5, 54, 50, 3},
1839 {4, 5, 0, 55, 51, 4},
1840 {5, 0, 1, 56, 52, 5},
1841 {0, 1, 3, 58, 53, 0},
1842 {5, 0, 2, 57, 52, 5},
1843 {4, 5, 1, 56, 51, 4},
1844 {3, 4, 0, 55, 50, 3},
1845 {2, 3, 5, 54, 49, 2},
1846 {1, 2, 4, 59, 48, 1}};
1847 for (
int k = 0;
k < 6; ++
k) {
1848 xy.push_back(std::make_pair((xpos +
dx[
np[place][
k]] + offsetx[
np[place][
k]]),
1849 (ypos +
dy[
np[place][
k]] + offsety[
np[place][
k]])));
1852 <<
dx[
np[place][
k]] + offsetx[
np[place][
k]] <<
" dy " 1853 <<
dy[
np[place][
k]] + offsety[
np[place][
k]];
1857 int np[12][4] = {{41, 45, 4, 41},
1869 for (
int k = 0;
k < 4; ++
k) {
1870 xy.push_back(std::make_pair((xpos +
dx[
np[place][
k]] + offsetx[
np[place][
k]]),
1871 (ypos +
dy[
np[place][
k]] + offsety[
np[place][
k]])));
1874 <<
dx[
np[place][
k]] + offsetx[
np[place][
k]] <<
" dy " 1875 <<
dy[
np[place][
k]] + offsety[
np[place][
k]];
1879 int np[12][5] = {{0, 34, 28, 5, 0},
1891 for (
int k = 0;
k < 5; ++
k) {
1892 xy.push_back(std::make_pair((xpos +
dx[
np[place][
k]] + offsetx[
np[place][
k]]),
1893 (ypos +
dy[
np[place][
k]] + offsety[
np[place][
k]])));
1896 <<
dx[
np[place][
k]] + offsetx[
np[place][
k]] <<
" dy " 1897 <<
dy[
np[place][
k]] + offsety[
np[place][
k]];
1901 int np[12][7] = {{1, 2, 3, 4, 28, 34, 1},
1902 {2, 3, 4, 5, 29, 35, 2},
1903 {3, 4, 5, 0, 24, 30, 3},
1904 {4, 5, 0, 1, 25, 31, 4},
1905 {5, 0, 1, 2, 26, 32, 5},
1906 {0, 1, 2, 3, 27, 33, 0},
1907 {5, 29, 35, 2, 3, 4, 5},
1908 {4, 28, 34, 1, 2, 3, 4},
1909 {3, 27, 33, 0, 1, 2, 3},
1910 {2, 26, 32, 5, 0, 1, 2},
1911 {1, 25, 31, 4, 5, 0, 1},
1912 {0, 24, 30, 3, 4, 5, 0}};
1913 for (
int k = 0;
k < 7; ++
k) {
1914 xy.push_back(std::make_pair((xpos +
dx[
np[place][
k]] + offsetx[
np[place][
k]]),
1915 (ypos +
dy[
np[place][
k]] + offsety[
np[place][
k]])));
1918 <<
dx[
np[place][
k]] + offsetx[
np[place][
k]] <<
" dy " 1919 <<
dy[
np[place][
k]] + offsety[
np[place][
k]];
1923 int np[12][6] = {{0, 1, 2, 14, 21, 0},
1924 {1, 2, 3, 15, 22, 1},
1925 {2, 3, 4, 16, 23, 2},
1926 {3, 4, 5, 17, 18, 3},
1927 {4, 5, 0, 12, 19, 4},
1928 {5, 0, 1, 13, 20, 5},
1929 {0, 12, 19, 4, 5, 0},
1930 {5, 17, 18, 3, 4, 5},
1931 {4, 16, 23, 2, 3, 4},
1932 {3, 15, 22, 1, 2, 3},
1933 {2, 14, 21, 0, 1, 2},
1934 {1, 13, 20, 5, 0, 1}};
1935 for (
int k = 0;
k < 6; ++
k) {
1936 xy.push_back(std::make_pair((xpos +
dx[
np[place][
k]] + offsetx[
np[place][
k]]),
1937 (ypos +
dy[
np[place][
k]] + offsety[
np[place][
k]])));
1940 <<
dx[
np[place][
k]] + offsetx[
np[place][
k]] <<
" dy " 1941 <<
dy[
np[place][
k]] + offsety[
np[place][
k]];
1945 int np[12][6] = {{5, 17, 18, 3, 4, 5},
1946 {0, 12, 19, 4, 5, 0},
1947 {1, 13, 20, 5, 0, 1},
1948 {2, 14, 21, 0, 1, 2},
1949 {3, 15, 22, 1, 2, 3},
1950 {4, 16, 23, 2, 3, 4},
1951 {1, 2, 3, 15, 22, 1},
1952 {0, 1, 2, 14, 21, 0},
1953 {5, 0, 1, 13, 20, 5},
1954 {4, 5, 0, 12, 19, 4},
1955 {3, 4, 5, 17, 18, 3},
1956 {2, 3, 4, 16, 23, 2}};
1957 for (
int k = 0;
k < 6; ++
k) {
1958 xy.push_back(std::make_pair((xpos +
dx[
np[place][
k]] + offsetx[
np[place][
k]]),
1959 (ypos +
dy[
np[place][
k]] + offsety[
np[place][
k]])));
1962 <<
dx[
np[place][
k]] + offsetx[
np[place][
k]] <<
" dy " 1963 <<
dy[
np[place][
k]] + offsety[
np[place][
k]];
1967 int np[12][6] = {{0, 1, 2, 18, 17, 0},
1968 {1, 2, 3, 19, 12, 1},
1969 {2, 3, 4, 20, 13, 2},
1970 {3, 4, 5, 21, 14, 3},
1971 {4, 5, 0, 22, 15, 4},
1972 {5, 0, 1, 23, 16, 5},
1973 {0, 22, 15, 4, 5, 0},
1974 {5, 21, 14, 3, 4, 5},
1975 {4, 20, 13, 2, 3, 4},
1976 {3, 19, 12, 1, 2, 3},
1977 {2, 18, 17, 0, 1, 2},
1978 {1, 23, 16, 5, 0, 1}};
1979 for (
int k = 0;
k < 6; ++
k) {
1980 xy.push_back(std::make_pair((xpos +
dx[
np[place][
k]] + offsetx[
np[place][
k]]),
1981 (ypos +
dy[
np[place][
k]] + offsety[
np[place][
k]])));
1984 <<
dx[
np[place][
k]] + offsetx[
np[place][
k]] <<
" dy " 1985 <<
dy[
np[place][
k]] + offsety[
np[place][
k]];
1990 edm::LogVerbatim(
"HGCalGeom") <<
"I/p: part " <<
part <<
" place " << place <<
" dX " << delX <<
" dY " << delY
1991 <<
" xpos " << xpos <<
" ypos " << ypos <<
" O/p having " <<
xy.size() <<
" points:";
1992 std::ostringstream st1;
1993 for (
unsigned int i = 0;
i <
xy.size(); ++
i)
2001 const int&
part,
const int& placement,
const double& waferSize,
const double&
offset,
const bool& v17OrLess) {
2007 double delX = 0.5 * waferSize;
2008 double delY = 2 * delX /
sqrt3_;
2010 std::array<double, 4> criterion;
2013 criterion[0] =
tan_1[placement];
2016 criterion[3] = tresh;
2020 criterion[0] = -
tan_1[placement];
2021 criterion[1] = -1.0;
2023 criterion[3] = tresh;
2028 criterion[1] = -
tan_1[placement];
2030 criterion[3] = tresh;
2034 criterion[0] = -1.0;
2035 criterion[1] =
tan_1[placement];
2037 criterion[3] = tresh;
2042 criterion[1] = -
tan_1[placement];
2044 criterion[3] = tresh;
2049 criterion[1] =
tan_1[placement];
2051 criterion[3] = tresh;
2055 criterion[0] =
tan_1[placement];
2057 criterion[2] = ((c22 * delX) /
cos_1[placement]);
2058 criterion[3] = tresh;
2062 criterion[0] = -
tan_1[placement];
2064 criterion[2] = -((c22 * delX) /
cos_1[placement]);
2065 criterion[3] = tresh;
2070 criterion[1] = -
tan_1[placement];
2071 criterion[2] = ((c27 * delY) /
cos_1[placement]);
2072 criterion[3] = tresh;
2076 criterion[0] = -1.0;
2077 criterion[1] =
tan_1[placement];
2078 criterion[2] = -((c27 * delY) /
cos_1[placement]);
2079 criterion[3] = tresh;
2083 criterion[0] = -1.0;
2084 criterion[1] =
tan_1[placement];
2085 criterion[2] = ((c27 * delY) /
cos_1[placement]);
2086 criterion[3] = tresh;
static constexpr std::array< int, 3 > edgeWaferHDBottom
static constexpr std::array< int, 3 > edgeWaferLDFive
Log< level::Info, true > LogVerbatim
static constexpr double c27O
static constexpr int32_t WaferHalf2
static constexpr std::array< int, 3 > edgeWaferLDLeft
static constexpr int32_t WaferFive2
static constexpr std::array< int, 3 > edgeWaferLDTop
auto const good
min quality of good
static constexpr std::array< int, 3 > edgeWaferHDLeft
static constexpr double c77O
static constexpr int k_OffsetRotation
static constexpr int32_t WaferSizeMax
static constexpr int32_t WaferLDThree
static constexpr std::array< int, 3 > edgeWaferLDThree
static constexpr std::array< double, 12 > cos_1
static bool goodCell(int u, int v, int N, int type, int rotn)
static constexpr int32_t WaferOut
static constexpr int32_t WaferThree
static constexpr double sqrt3_
static constexpr double c50
static constexpr int32_t WaferHDFive
static constexpr double c88
static int getRotation(int zside, int type, int rotn)
static constexpr double c27
static constexpr double c10
static constexpr double sin_60_
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
static constexpr int32_t WaferSemi2
static std::vector< std::pair< double, double > > waferXY(const int &part, const int &orient, const int &zside, const double &waferSize, const double &offset, const double &xpos, const double &ypos, const bool &v17)
static constexpr int32_t WaferHDLeft
U second(std::pair< T, U > const &p)
static constexpr int32_t WaferFull
static constexpr int32_t WaferHalf
static constexpr int32_t WaferLDBottom
static constexpr double tan_60_
static constexpr int32_t WaferCorner1
static std::pair< int, int > getTypeMode(const double &xpos, const double &ypos, const double &delX, const double &delY, const double &rin, const double &rout, const int &waferType, const int &mode, const bool &v17, const bool &debug=false)
static std::array< double, 4 > maskCut(const int &part, const int &place, const double &waferSize, const double &offset, const bool &v17OrLess)
static constexpr double c22O
static constexpr int32_t WaferCorner5
static constexpr int32_t WaferLDRight
Abs< T >::type abs(const T &t)
static constexpr int32_t WaferCorner4
static constexpr int32_t WaferCornerMax
static constexpr int32_t WaferCorner2
static constexpr int32_t WaferLDFive
static constexpr int32_t WaferCorner0
static constexpr int32_t WaferLDLeft
static constexpr double c00
static constexpr int32_t WaferHDBottom
static constexpr int32_t WaferCorner3
static constexpr std::array< int, 3 > edgeWaferHDTop
static constexpr double c88O
static bool goodTypeMode(const double &xpos, const double &ypos, const double &delX, const double &delY, const double &rin, const double &rout, const int &part, const int &rotn, const bool &v17, const bool &debug=false)
static constexpr int32_t WaferHDRight
static constexpr int32_t WaferChopTwoM
static constexpr std::array< int, 3 > edgeWaferLDRight
static constexpr double c77
static constexpr double c61
static constexpr double cos_60_
static constexpr double c61O
static constexpr int32_t WaferLDTop
static constexpr double c75
static constexpr double c22
static constexpr std::array< int, 3 > edgeWaferHDFive
static constexpr int32_t WaferHDTop
static constexpr int32_t WaferFive
static constexpr int32_t WaferSemi
static constexpr std::array< int, 3 > edgeWaferHDRight
static constexpr std::array< int, 3 > edgeWaferLDBottom
static constexpr std::array< double, 12 > tan_1
static constexpr int32_t WaferChopTwo
static constexpr int32_t cellPlacementExtra
static bool maskCell(int u, int v, int N, int ncor, int fcor, int corners)