10 double waferSize, int32_t nFine, int32_t nCoarse,
double guardRingOffset_,
double mouseBiteCut_) {
13 hgcalcell_ = std::make_unique<HGCalCell>(waferSize, nFine, nCoarse);
14 for (
int k = 0;
k < 2; ++
k) {
18 for (
int j = 0;
j < 6; ++
j) {
20 for (
int i = 0;
i < 6; ++
i) {
34 double cutArea3 = A1 + A2 + A3;
41 double y3_3 =
cellY_[
k] * 11.0 / 12.0;
44 double y1 = 5.0 *
cellY_[
k] / 12.0 - guardRingOffset_ / 4.0;
46 double y2 = -(0.5 *
cellY_[
k] - 0.5 * guardRingOffset_) * 0.5;
47 double x3 = (A1 * x3_1 + A2 * x3_2 + A3 * x3_3) / cutArea3;
48 double y3 = (A1 * y3_1 + A2 * y3_2 + A3 * y3_3) / cutArea3;
49 double cellArea = totalArea - cutArea1 - cutArea2 - cutArea3;
51 ((5.0 *
sqrt3_ *
cellY_[
k] / 132.0) * totalArea - (cutArea1 *
x1) - (cutArea2 *
x2) - (cutArea3 * x3)) /
54 ((19.0 *
cellY_[
k] / 132.0) * totalArea - (cutArea1 *
y1) - (cutArea2 *
y2) - (cutArea3 * y3)) /
57 double xMag = 0.5 * xMag1 +
sqrt3By2_ * yMag1;
58 double yMag =
sqrt3By2_ * xMag1 - 0.5 * yMag1;
60 std::array<double, 6> tempOffsetX = {{(
sqrt3By2_ * xMag - 0.5 * yMag),
66 std::array<double, 6> tempOffsetY = {{(0.5 * xMag +
sqrt3By2_ * yMag),
73 for (
int i = 0;
i < 6; ++
i) {
85 std::pow(guardRingOffset_, 2) / 18) /
89 double x3_1 = -(
cellY_[
k] - guardRingOffset_ - 2 * (mouseBiteCut_ - guardRingOffset_) / 3) *
sqrt3By2_;
90 double y3_1 = 0.5 * (
cellY_[
k] - guardRingOffset_ - 2 * (mouseBiteCut_ - guardRingOffset_) / 3);
92 double y3_2 = -(
cellY_[
k] / 4 + 4 *
h / 6);
93 double A1 =
sqrt3_ *
std::pow((mouseBiteCut_ - guardRingOffset_), 2);
97 double y1 = 0.5 *
cellY_[
k] - 0.5 * guardRingOffset_;
100 double x3 = (A1 * x3_1 - A2 * x3_2) / (A1 - A2);
101 double y3 = (A1 * y3_1 - A2 * y3_2) / (A1 - A2);
102 double cellArea = totalArea - cutArea1 - cutArea2 - cutArea3;
103 double xMag1 = ((0.0) * totalArea - (cutArea1 *
x1) - (cutArea2 *
x2) - (cutArea3 * x3)) / (
cellArea);
105 ((-5 *
cellY_[
k] / 42) * totalArea - (cutArea1 *
y1) - (cutArea2 *
y2) - (cutArea3 * y3)) / (
cellArea);
107 double xMag = -0.5 * xMag1 -
sqrt3By2_ * yMag1;
108 double yMag =
sqrt3By2_ * xMag1 - 0.5 * yMag1;
110 std::array<double, 6> tempOffsetX = {{(
sqrt3By2_ * xMag - 0.5 * yMag),
116 std::array<double, 6> tempOffsetY = {{(0.5 * xMag +
sqrt3By2_ * yMag),
122 for (
int i = 0;
i < 6; ++
i) {
132 double offMag = (((-2.0 / 15.0) * totalArea *
cellY_[
k]) - ((
cellY_[
k] - (0.5 * guardRingOffset_)) * cutArea)) /
137 std::array<double, 6> tempOffsetX = {
138 {-0.5 * offMag, -offMag, -0.5 * offMag, 0.5 * offMag, offMag, 0.5 * offMag}};
139 std::array<double, 6> tempOffsetY = {
141 for (
int i = 0;
i < 6; ++
i) {
151 (((5.0 / 42.0) * totalArea *
cellY_[
k]) - ((
cellY_[
k] - (0.5 * guardRingOffset_))) * (cutArea)) /
156 std::array<double, 6> tempOffsetX = {
157 {-0.5 * offMag, -offMag, -0.5 * offMag, 0.5 * offMag, offMag, 0.5 * offMag}};
158 std::array<double, 6> tempOffsetY = {
160 for (
int i = 0;
i < 6; ++
i) {
172 double y1 = -(0.5 *
cellY_[
k] - 0.5 * guardRingOffset_) * 0.5;
175 double cellArea = totalArea - cutArea1 - cutArea2;
177 double yMag1 = ((
cellY_[
k] / 15.0) * totalArea - (cutArea1 *
y1) - (cutArea2 *
y2)) / (
cellArea);
178 double xMag = -yMag1;
179 double yMag = -xMag1;
181 std::array<double, 6> tempOffsetX = {{(
sqrt3By2_ * xMag - 0.5 * yMag),
187 std::array<double, 6> tempOffsetY = {{(0.5 * xMag +
sqrt3By2_ * yMag),
193 for (
int i = 0;
i < 6; ++
i) {
210 for (
int i = 0;
i < 6; ++
i) {
223 double y1 = (0.5 *
cellY_[
k] - 0.25 * guardRingOffset_);
226 double cellArea = totalArea - cutArea1 - cutArea2;
229 double yMag1 = ((10.0 *
cellY_[
k] / 168.0) * totalArea - (cutArea1 *
y1) - (cutArea2 *
y2)) / (
cellArea);
232 double yMag = -xMag1;
234 std::array<double, 6> tempOffsetX = {{(
sqrt3By2_ * xMag - 0.5 * yMag),
240 std::array<double, 6> tempOffsetY = {{(0.5 * xMag +
sqrt3By2_ * yMag),
246 for (
int i = 0;
i < 6; ++
i) {
257 double cellArea = totalArea - cutArea;
263 double yMag = (0 * totalArea - (cutArea *
y1)) / (
cellArea);
265 std::array<double, 6> tempOffsetX = {{(-
sqrt3By2_ * xMag - 0.5 * yMag),
271 std::array<double, 6> tempOffsetY = {{(0.5 * xMag -
sqrt3By2_ * yMag),
278 for (
int i = 0;
i < 6; ++
i) {
285 double cutArea2 = (3 *
cellY_[
k] * guardRingOffset_) / 2 -
std::pow(guardRingOffset_, 2) / (2 *
sqrt3_);
288 double y1 = (0.5 *
cellY_[
k] - 0.5 * guardRingOffset_);
294 double cellArea = totalArea - cutArea1 - cutArea2;
296 double yMag = ((-2 *
cellY_[
k] / 15) * totalArea - (cutArea1 *
y1) - (cutArea2 *
y2)) / (
cellArea);
297 double xMag = -xMag1;
299 std::array<double, 6> tempOffsetX = {{(-
sqrt3By2_ * xMag - 0.5 * yMag),
305 std::array<double, 6> tempOffsetY = {{(0.5 * xMag -
sqrt3By2_ * yMag),
311 for (
int i = 0;
i < 6; ++
i) {
319 double cellArea = totalArea - cutArea1 - cutArea2;
322 double y1 = -(
cellY_[
k] - guardRingOffset_ / 2);
328 double yMag = ((-5 *
cellY_[
k] / 42.0) * totalArea - (cutArea1 *
y1) - (cutArea2 *
y2)) / (
cellArea);
330 std::array<double, 6> tempOffsetX = {{(-
sqrt3By2_ * xMag - 0.5 * yMag),
336 std::array<double, 6> tempOffsetY = {{(0.5 * xMag -
sqrt3By2_ * yMag),
343 for (
int i = 0;
i < 6; ++
i) {
355 (
std::pow(guardRingOffset_, 2) / 18)) /
362 double y2_0 = guardRingOffset_ / 2;
371 double y3 = -(
cellY_[
k] -
sqrt3_ * (mouseBiteCut_ - (guardRingOffset_ /
sqrt3By2_)) / 3 - guardRingOffset_);
373 double cellArea = totalArea - cutArea1 - cutArea2 - cutArea3;
377 ((-1 *
cellY_[
k] / 8) * totalArea - (cutArea1 *
y1) - (cutArea2 *
y2) - (cutArea3 * y3)) / (
cellArea);
379 std::array<double, 6> tempOffsetX = {{(-
sqrt3By2_ * xMag - 0.5 * yMag),
385 std::array<double, 6> tempOffsetY = {{(0.5 * xMag -
sqrt3By2_ * yMag),
392 for (
int i = 0;
i < 6; ++
i) {
397 for (
int i = 0;
i < 6; ++
i) {
407 double cutArea2 = (4 *
cellY_[
k] * guardRingOffset_);
411 (
std::pow(guardRingOffset_, 2) / 18)) /
422 double y3 = 3.5 *
cellY_[
k] - (5 * mouseBiteCut_) / 3 *
sqrt3_;
424 double cellArea = totalArea - cutArea1 - cutArea2 - cutArea3;
426 ((-9 *
cellY_[
k] / (
sqrt3_ * 92)) * totalArea - (cutArea1 *
x1) - (cutArea2 *
x2) - (cutArea3 * x3)) /
429 ((199 *
cellY_[
k] / (
sqrt3_ * 276)) * totalArea - (cutArea1 *
y1) - (cutArea2 *
y2) - (cutArea3 * y3)) /
432 std::array<double, 6> tempOffsetX = {{(-
sqrt3By2_ * xMag - 0.5 * yMag),
438 std::array<double, 6> tempOffsetY = {{(0.5 * xMag -
sqrt3By2_ * yMag),
444 for (
int i = 0;
i < 6; ++
i) {
449 for (
int i = 0;
i < 6; ++
i) {
457 double cutArea1 = (
cellY_[
k] * guardRingOffset_);
465 double y2 = 0.5 *
cellY_[
k] - guardRingOffset_ / 2;
467 double y3 = 0.5 *
cellY_[
k] - guardRingOffset_ -
h / 3;
469 double cellArea = totalArea - cutArea1 - cutArea2 - cutArea3;
470 double xMag = ((0.0) * totalArea - (cutArea1 *
x1) - (cutArea2 *
x2) - (cutArea3 * x3)) / (
cellArea);
472 ((-2 *
cellY_[
k] / 15) * totalArea - (cutArea1 *
y1) - (cutArea2 *
y2) - (cutArea3 * y3)) / (
cellArea);
474 std::array<double, 6> tempOffsetX = {{(-
sqrt3By2_ * xMag - 0.5 * yMag),
480 std::array<double, 6> tempOffsetY = {{(0.5 * xMag -
sqrt3By2_ * yMag),
486 for (
int i = 0;
i < 6; ++
i) {
491 for (
int i = 0;
i < 6; ++
i) {
504 std::pow(guardRingOffset_, 2) / 18) /
509 double y1 = 0.5 *
cellY_[
k] - guardRingOffset_ / 2;
515 double cellArea = totalArea - cutArea1 - cutArea2 - cutArea3;
516 double xMag = -((-
sqrt3_ *
cellY_[
k] / 9) * totalArea - (cutArea1 *
x1) - (cutArea2 *
x2) - (cutArea3 * x3)) /
519 ((-
cellY_[
k] / 15) * totalArea - (cutArea1 *
y1) - (cutArea2 *
y2) - (cutArea3 * y3)) / (
cellArea);
521 std::array<double, 6> tempOffsetX = {{(-
sqrt3By2_ * xMag - 0.5 * yMag),
527 std::array<double, 6> tempOffsetY = {{(0.5 * xMag -
sqrt3By2_ * yMag),
533 for (
int i = 0;
i < 6; ++
i) {
538 for (
int i = 0;
i < 6; ++
i) {
546 double cutArea1 = (3 *
cellY_[
k] * guardRingOffset_);
548 double cutArea3 =
std::pow((mouseBiteCut_ - guardRingOffset_), 2) /
sqrt3_;
558 double h = (mouseBiteCut_ - guardRingOffset_) /
sqrt3By2_;
560 double y3 = 5 *
h / 6 - 5 *
cellY_[
k] / 2;
562 double cellArea = totalArea - cutArea1 - cutArea2 - cutArea3;
564 ((-2 *
cellY_[
k] / (7 *
sqrt3_)) * totalArea - (cutArea1 *
x1) - (cutArea2 *
x2) - (cutArea3 * x3)) /
567 ((-
cellY_[
k] / 3) * totalArea - (cutArea1 *
y1) - (cutArea2 *
y2) - (cutArea3 * y3)) / (
cellArea);
569 std::array<double, 6> tempOffsetX = {{(-
sqrt3By2_ * xMag - 0.5 * yMag),
575 std::array<double, 6> tempOffsetY = {{(0.5 * xMag -
sqrt3By2_ * yMag),
581 for (
int i = 0;
i < 6; ++
i) {
586 for (
int i = 0;
i < 6; ++
i) {
594 double cutArea1 = (2 *
cellY_[
k] * guardRingOffset_);
598 double x1 = -guardRingOffset_ / 2;
601 double y2 = -(
cellY_[
k] - 0.5 * guardRingOffset_);
603 ((mouseBiteCut_ - guardRingOffset_) -
sqrt3_ *
cellY_[
k] / 8);
607 ((mouseBiteCut_ - guardRingOffset_) -
sqrt3_ *
cellY_[
k] / 8);
609 double cellArea = totalArea - cutArea1 - cutArea2 - cutArea3;
613 ((-5 *
cellY_[
k] / 42) * totalArea - (cutArea1 *
y1) - (cutArea2 *
y2) - (cutArea3 * y3)) / (
cellArea);
615 std::array<double, 6> tempOffsetX = {{(-
sqrt3By2_ * xMag - 0.5 * yMag),
621 std::array<double, 6> tempOffsetY = {{(0.5 * xMag -
sqrt3By2_ * yMag),
627 for (
int i = 0;
i < 6; ++
i) {
632 for (
int i = 0;
i < 6; ++
i) {
640 double cutArea1 = (4 *
cellY_[
k] * guardRingOffset_) /
sqrt3_;
645 double y1 = -(0.5 *
cellY_[
k] - 0.5 * guardRingOffset_);
647 (
std::pow(guardRingOffset_, 2) / 18)) /
655 double cellArea = totalArea - cutArea1 - cutArea2;
657 double yMag = ((73 *
cellY_[
k] / 444) * totalArea - (cutArea1 *
y1) - (cutArea2 *
y2)) / (
cellArea);
659 std::array<double, 6> tempOffsetX = {{(-
sqrt3By2_ * xMag - 0.5 * yMag),
665 std::array<double, 6> tempOffsetY = {{(0.5 * xMag -
sqrt3By2_ * yMag),
671 for (
int i = 0;
i < 6; ++
i) {
676 for (
int i = 0;
i < 6; ++
i) {
684 double cutArea1 = (5 *
cellY_[
k] * guardRingOffset_) / (2 *
sqrt3_);
689 double y1 =
cellY_[
k] - 0.5 * guardRingOffset_;
691 (
std::pow(guardRingOffset_, 2) / 18.0)) /
699 double cellArea = totalArea - cutArea1 - cutArea2;
702 double yMag = ((47.0 *
cellY_[
k] / 528.0) * totalArea - (cutArea1 *
y1) - (cutArea2 *
y2)) / (
cellArea);
704 std::array<double, 6> tempOffsetX = {{(-
sqrt3By2_ * xMag - 0.5 * yMag),
710 std::array<double, 6> tempOffsetY = {{(0.5 * xMag -
sqrt3By2_ * yMag),
716 for (
int i = 0;
i < 6; ++
i) {
721 for (
int i = 0;
i < 6; ++
i) {
731 edm::LogVerbatim(
"HGCalGeom") <<
"HGCalCellOffset initialized with waferSize " << waferSize <<
" number of cells " 732 << nFine <<
":" << nCoarse <<
" Guardring offset " << guardRingOffset_ <<
" Mousebite " 740 double x_off(0), y_off(0);
742 int cellPos = cell.first;
743 int cellType = cell.second;
762 return std::make_pair(x_off, y_off);
766 int32_t u, int32_t
v, int32_t placementIndex, int32_t
type, int32_t partialType) {
770 double x_off =
offset.first;
771 double y_off =
offset.second;
773 int cellPos = cell.first;
774 int cellType = cell.second;
796 std::cout << u <<
":" <<
v <<
" 2" << std::endl;
817 return std::make_pair(x_off, y_off);
825 int cellType = cell.second;
static constexpr int32_t LDPartial0007Cell
Log< level::Info, true > LogVerbatim
static constexpr int32_t fullCell
static constexpr int32_t partiaclCellsPosOffset
std::pair< double, double > cellOffsetUV2XY1(int32_t u, int32_t v, int32_t placementIndex, int32_t type)
std::array< std::array< std::array< double, 6 >, 11 >, 2 > offsetPartialX
static constexpr int32_t HDPartial1021Cell
static constexpr int32_t extendedMBCell
static constexpr int32_t HDPartial0920Cell
static constexpr int32_t partiaclWaferCellsOffset
static constexpr int32_t truncatedMBCell
static constexpr int32_t leftCell
static constexpr int32_t LDPartial0209Cell
static constexpr int32_t topCell
double cellAreaUV(int32_t u, int32_t v, int32_t placementIndex, int32_t type, bool reco)
static constexpr int32_t halfCell
static constexpr int32_t LDPartial0714Cell
static constexpr int32_t LDPartial1515Cell
static constexpr int32_t bottomLeftEdge
std::array< std::array< std::array< double, 6 >, 6 >, 2 > offsetY
static constexpr int32_t truncatedCell
static constexpr int32_t halfTrunCell
static constexpr int32_t extendedCell
static constexpr int32_t topRightEdge
std::unique_ptr< HGCalCell > hgcalcell_
static constexpr int32_t LDPartial0815Cell
static constexpr int32_t LDPartial1415Cell
HGCalCellOffset(double waferSize, int32_t nFine, int32_t nCoarse, double guardRingOffset_, double mouseBiteCut_)
static constexpr int32_t halfExtCell
static constexpr int32_t bottomCorner
static constexpr int32_t cornerCell
static constexpr int32_t rightCell
std::array< std::array< std::array< double, 6 >, 11 >, 2 > offsetPartialY
static constexpr double k_ScaleToDDD2
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
std::array< std::array< std::array< double, 6 >, 6 >, 2 > offsetX
Power< A, B >::type pow(const A &a, const B &b)
static constexpr int32_t bottomCell
static constexpr int32_t cellPlacementExtra