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,
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;
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;
1496 double delX = 0.5 * waferSize;
1623 double offsetx[60] = {0.0,
1745 int np[7] = {0, 1, 2, 3, 4, 5, 0};
1746 for (
int k = 0;
k < 7; ++
k) {
1747 xy.push_back(std::make_pair((xpos +
dx[
np[
k]] + offsetx[
np[
k]]), (ypos +
dy[
np[
k]] + offsety[
np[
k]])));
1754 int np[12][5] = {{0, 1, 4, 5, 0},
1766 for (
int k = 0;
k < 5; ++
k) {
1767 xy.push_back(std::make_pair((xpos +
dx[
np[place][
k]] + offsetx[
np[place][
k]]),
1768 (ypos +
dy[
np[place][
k]] + offsety[
np[place][
k]])));
1771 <<
dx[
np[place][
k]] + offsetx[
np[place][
k]] <<
" dy " 1772 <<
dy[
np[place][
k]] + offsety[
np[place][
k]];
1776 int np[12][5] = {{1, 2, 3, 4, 1},
1788 for (
int k = 0;
k < 5; ++
k) {
1789 xy.push_back(std::make_pair((xpos +
dx[
np[place][
k]] + offsetx[
np[place][
k]]),
1790 (ypos +
dy[
np[place][
k]] + offsety[
np[place][
k]])));
1793 <<
dx[
np[place][
k]] + offsetx[
np[place][
k]] <<
" dy " 1794 <<
dy[
np[place][
k]] + offsety[
np[place][
k]];
1798 int np[12][6] = {{0, 1, 2, 8, 11, 0},
1800 {2, 3, 4, 10, 7, 2},
1801 {3, 4, 5, 11, 8, 3},
1803 {5, 0, 1, 7, 10, 5},
1805 {5, 11, 8, 3, 4, 5},
1806 {4, 10, 7, 2, 3, 4},
1808 {2, 8, 11, 0, 1, 2},
1809 {1, 7, 10, 5, 0, 1}};
1810 for (
int k = 0;
k < 6; ++
k) {
1811 xy.push_back(std::make_pair((xpos +
dx[
np[place][
k]] + offsetx[
np[place][
k]]),
1812 (ypos +
dy[
np[place][
k]] + offsety[
np[place][
k]])));
1815 <<
dx[
np[place][
k]] + offsetx[
np[place][
k]] <<
" dy " 1816 <<
dy[
np[place][
k]] + offsety[
np[place][
k]];
1820 int np[12][6] = {{5, 11, 8, 3, 4, 5},
1822 {1, 7, 10, 5, 0, 1},
1823 {2, 8, 11, 0, 1, 2},
1825 {4, 10, 7, 2, 3, 4},
1827 {0, 1, 2, 8, 11, 0},
1828 {5, 0, 1, 7, 10, 5},
1830 {3, 4, 5, 11, 8, 3},
1831 {2, 3, 4, 10, 7, 2}};
1832 for (
int k = 0;
k < 6; ++
k) {
1833 xy.push_back(std::make_pair((xpos +
dx[
np[place][
k]] + offsetx[
np[place][
k]]),
1834 (ypos +
dy[
np[place][
k]] + offsety[
np[place][
k]])));
1837 <<
dx[
np[place][
k]] + offsetx[
np[place][
k]] <<
" dy " 1838 <<
dy[
np[place][
k]] + offsety[
np[place][
k]];
1842 int np[12][6] = {{0, 1, 2, 57, 53, 0},
1843 {1, 2, 3, 58, 48, 1},
1844 {2, 3, 4, 59, 49, 2},
1845 {3, 4, 5, 54, 50, 3},
1846 {4, 5, 0, 55, 51, 4},
1847 {5, 0, 1, 56, 52, 5},
1848 {0, 1, 3, 58, 53, 0},
1849 {5, 0, 2, 57, 52, 5},
1850 {4, 5, 1, 56, 51, 4},
1851 {3, 4, 0, 55, 50, 3},
1852 {2, 3, 5, 54, 49, 2},
1853 {1, 2, 4, 59, 48, 1}};
1854 for (
int k = 0;
k < 6; ++
k) {
1855 xy.push_back(std::make_pair((xpos +
dx[
np[place][
k]] + offsetx[
np[place][
k]]),
1856 (ypos +
dy[
np[place][
k]] + offsety[
np[place][
k]])));
1859 <<
dx[
np[place][
k]] + offsetx[
np[place][
k]] <<
" dy " 1860 <<
dy[
np[place][
k]] + offsety[
np[place][
k]];
1864 int np[12][4] = {{41, 45, 4, 41},
1876 for (
int k = 0;
k < 4; ++
k) {
1877 xy.push_back(std::make_pair((xpos +
dx[
np[place][
k]] + offsetx[
np[place][
k]]),
1878 (ypos +
dy[
np[place][
k]] + offsety[
np[place][
k]])));
1881 <<
dx[
np[place][
k]] + offsetx[
np[place][
k]] <<
" dy " 1882 <<
dy[
np[place][
k]] + offsety[
np[place][
k]];
1886 int np[12][5] = {{0, 34, 28, 5, 0},
1898 for (
int k = 0;
k < 5; ++
k) {
1899 xy.push_back(std::make_pair((xpos +
dx[
np[place][
k]] + offsetx[
np[place][
k]]),
1900 (ypos +
dy[
np[place][
k]] + offsety[
np[place][
k]])));
1903 <<
dx[
np[place][
k]] + offsetx[
np[place][
k]] <<
" dy " 1904 <<
dy[
np[place][
k]] + offsety[
np[place][
k]];
1908 int np[12][7] = {{1, 2, 3, 4, 28, 34, 1},
1909 {2, 3, 4, 5, 29, 35, 2},
1910 {3, 4, 5, 0, 24, 30, 3},
1911 {4, 5, 0, 1, 25, 31, 4},
1912 {5, 0, 1, 2, 26, 32, 5},
1913 {0, 1, 2, 3, 27, 33, 0},
1914 {5, 29, 35, 2, 3, 4, 5},
1915 {4, 28, 34, 1, 2, 3, 4},
1916 {3, 27, 33, 0, 1, 2, 3},
1917 {2, 26, 32, 5, 0, 1, 2},
1918 {1, 25, 31, 4, 5, 0, 1},
1919 {0, 24, 30, 3, 4, 5, 0}};
1920 for (
int k = 0;
k < 7; ++
k) {
1921 xy.push_back(std::make_pair((xpos +
dx[
np[place][
k]] + offsetx[
np[place][
k]]),
1922 (ypos +
dy[
np[place][
k]] + offsety[
np[place][
k]])));
1925 <<
dx[
np[place][
k]] + offsetx[
np[place][
k]] <<
" dy " 1926 <<
dy[
np[place][
k]] + offsety[
np[place][
k]];
1930 int np[12][6] = {{0, 1, 2, 14, 21, 0},
1931 {1, 2, 3, 15, 22, 1},
1932 {2, 3, 4, 16, 23, 2},
1933 {3, 4, 5, 17, 18, 3},
1934 {4, 5, 0, 12, 19, 4},
1935 {5, 0, 1, 13, 20, 5},
1936 {0, 12, 19, 4, 5, 0},
1937 {5, 17, 18, 3, 4, 5},
1938 {4, 16, 23, 2, 3, 4},
1939 {3, 15, 22, 1, 2, 3},
1940 {2, 14, 21, 0, 1, 2},
1941 {1, 13, 20, 5, 0, 1}};
1942 for (
int k = 0;
k < 6; ++
k) {
1943 xy.push_back(std::make_pair((xpos +
dx[
np[place][
k]] + offsetx[
np[place][
k]]),
1944 (ypos +
dy[
np[place][
k]] + offsety[
np[place][
k]])));
1947 <<
dx[
np[place][
k]] + offsetx[
np[place][
k]] <<
" dy " 1948 <<
dy[
np[place][
k]] + offsety[
np[place][
k]];
1952 int np[12][6] = {{5, 17, 18, 3, 4, 5},
1953 {0, 12, 19, 4, 5, 0},
1954 {1, 13, 20, 5, 0, 1},
1955 {2, 14, 21, 0, 1, 2},
1956 {3, 15, 22, 1, 2, 3},
1957 {4, 16, 23, 2, 3, 4},
1958 {1, 2, 3, 15, 22, 1},
1959 {0, 1, 2, 14, 21, 0},
1960 {5, 0, 1, 13, 20, 5},
1961 {4, 5, 0, 12, 19, 4},
1962 {3, 4, 5, 17, 18, 3},
1963 {2, 3, 4, 16, 23, 2}};
1964 for (
int k = 0;
k < 6; ++
k) {
1965 xy.push_back(std::make_pair((xpos +
dx[
np[place][
k]] + offsetx[
np[place][
k]]),
1966 (ypos +
dy[
np[place][
k]] + offsety[
np[place][
k]])));
1969 <<
dx[
np[place][
k]] + offsetx[
np[place][
k]] <<
" dy " 1970 <<
dy[
np[place][
k]] + offsety[
np[place][
k]];
1974 int np[12][6] = {{0, 1, 2, 18, 17, 0},
1975 {1, 2, 3, 19, 12, 1},
1976 {2, 3, 4, 20, 13, 2},
1977 {3, 4, 5, 21, 14, 3},
1978 {4, 5, 0, 22, 15, 4},
1979 {5, 0, 1, 23, 16, 5},
1980 {0, 22, 15, 4, 5, 0},
1981 {5, 21, 14, 3, 4, 5},
1982 {4, 20, 13, 2, 3, 4},
1983 {3, 19, 12, 1, 2, 3},
1984 {2, 18, 17, 0, 1, 2},
1985 {1, 23, 16, 5, 0, 1}};
1986 for (
int k = 0;
k < 6; ++
k) {
1987 xy.push_back(std::make_pair((xpos +
dx[
np[place][
k]] + offsetx[
np[place][
k]]),
1988 (ypos +
dy[
np[place][
k]] + offsety[
np[place][
k]])));
1991 <<
dx[
np[place][
k]] + offsetx[
np[place][
k]] <<
" dy " 1992 <<
dy[
np[place][
k]] + offsety[
np[place][
k]];
1997 edm::LogVerbatim(
"HGCalGeom") <<
"I/p: part " <<
part <<
" place " << place <<
" dX " << delX <<
" dY " << delY
1998 <<
" xpos " << xpos <<
" ypos " << ypos <<
" O/p having " <<
xy.size() <<
" points:";
1999 std::ostringstream st1;
2000 for (
unsigned int i = 0;
i <
xy.size(); ++
i)
2008 const int&
part,
const int& placement,
const double& waferSize,
const double&
offset,
const bool& v17OrLess) {
2014 double delX = 0.5 * waferSize;
2015 double delY = 2 * delX /
sqrt3_;
2017 std::array<double, 4> criterion;
2020 criterion[0] = -
tan_1[placement] *
sign_1[placement];
2021 criterion[1] = 1.0 *
sign_1[placement];
2023 criterion[3] = tresh;
2027 criterion[0] =
tan_1[placement] *
sign_1[placement];
2028 criterion[1] = -1.0 *
sign_1[placement];
2030 criterion[3] = tresh;
2034 criterion[0] = 1.0 *
sign_2[placement];
2035 criterion[1] =
tan_1[placement] *
sign_2[placement];
2037 criterion[3] = tresh;
2041 criterion[0] = -1.0 *
sign_2[placement];
2042 criterion[1] = -
tan_1[placement] *
sign_2[placement];
2044 criterion[3] = tresh;
2048 criterion[0] = 1 *
sign_2[placement];
2049 criterion[1] =
tan_1[placement] *
sign_2[placement];
2051 criterion[3] = tresh;
2055 criterion[0] = -1 *
sign_2[placement];
2056 criterion[1] = -
tan_1[placement] *
sign_2[placement];
2058 criterion[3] = tresh;
2062 criterion[0] = -
tan_1[placement] *
sign_1[placement];
2063 criterion[1] = 1 *
sign_1[placement];
2064 criterion[2] = ((c22 * delX) /
cos_1[placement]) *
sign_2[placement];
2065 criterion[3] = tresh;
2069 criterion[0] =
tan_1[placement] *
sign_1[placement];
2070 criterion[1] = -1 *
sign_1[placement];
2071 criterion[2] = -((c22 * delX) /
cos_1[placement]) *
sign_2[placement];
2072 criterion[3] = tresh;
2076 criterion[0] = 1.0 *
sign_2[placement];
2077 criterion[1] =
tan_1[placement] *
sign_2[placement];
2078 criterion[2] = ((c271 * delY) /
cos_1[placement]) *
sign_2[placement];
2079 criterion[3] = tresh;
2083 criterion[0] = -1.0 *
sign_2[placement];
2084 criterion[1] = -
tan_1[placement] *
sign_2[placement];
2085 criterion[2] = ((c271 * delY) /
cos_1[placement]) *
sign_2[placement];
2086 criterion[3] = tresh;
2090 criterion[0] = 1.0 *
sign_2[placement];
2091 criterion[1] =
tan_1[placement] *
sign_2[placement];
2092 criterion[2] = -((c271 * delY) /
cos_1[placement]) *
sign_2[placement];
2093 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 std::array< double, 12 > sign_2
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 std::array< double, 12 > sign_1
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 double c271
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 c611
static constexpr double c77
static constexpr double c61
static constexpr double cos_60_
static constexpr double c61O
static constexpr double c221
static constexpr double c881
static constexpr int32_t WaferLDTop
static constexpr double c75
static constexpr double c22
static constexpr double c771
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 bool maskCell(int u, int v, int N, int ncor, int fcor, int corners)