Skip to content

Commit 8429f10

Browse files
authored
Merge pull request #47077 from Pruthvi-ch/v19_CellArea
Update to Cell areas and valid cells for v18/v19 version of HGCAL
2 parents 214970d + 5a35263 commit 8429f10

File tree

5 files changed

+684
-127
lines changed

5 files changed

+684
-127
lines changed

Geometry/HGCalCommonData/interface/HGCalCell.h

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,19 +34,33 @@ class HGCalCell {
3434
static constexpr int32_t fullWaferCellsCount = 6;
3535

3636
static constexpr int32_t halfCell = 11;
37-
static constexpr int32_t halfTrunCell = 12;
38-
static constexpr int32_t halfExtCell = 13;
37+
static constexpr int32_t extHalfTrunCell = 12;
38+
static constexpr int32_t extHalfExtCell = 13;
39+
static constexpr int32_t extTrunCellCenCut = 14;
40+
static constexpr int32_t extExtCellCenCut = 15;
41+
static constexpr int32_t extTrunCellEdgeCut = 16;
42+
static constexpr int32_t extExtCellEdgeCut = 17;
43+
static constexpr int32_t fullCellEdgeCut = 18;
44+
static constexpr int32_t fullCellCenCut = 19;
45+
static constexpr int32_t intExtCell = 20;
46+
static constexpr int32_t intTrunCell = 21;
47+
static constexpr int32_t intHalfExtCell = 22;
48+
static constexpr int32_t intHalfTrunCell = 23;
49+
static constexpr int32_t intExtCellCenCut = 24;
50+
static constexpr int32_t intTrunCellCenCut = 25;
51+
static constexpr int32_t intExtCellEdgeCut = 26;
52+
static constexpr int32_t intTrunCellEdgeCut = 27;
3953
static constexpr int32_t partiaclWaferCellsOffset = 11;
4054

41-
static constexpr int32_t LDPartial0714Cell = 14;
42-
static constexpr int32_t LDPartial0209Cell = 15;
43-
static constexpr int32_t LDPartial0007Cell = 16;
44-
static constexpr int32_t LDPartial0815Cell = 17;
45-
static constexpr int32_t LDPartial1415Cell = 18;
46-
static constexpr int32_t LDPartial1515Cell = 19;
55+
static constexpr int32_t LDPartial0714Cell = 28;
56+
static constexpr int32_t LDPartial0209Cell = 29;
57+
static constexpr int32_t LDPartial0007Cell = 30;
58+
static constexpr int32_t LDPartial0815Cell = 31;
59+
static constexpr int32_t LDPartial1415Cell = 32;
60+
static constexpr int32_t LDPartial1515Cell = 33;
4761

48-
static constexpr int32_t HDPartial0920Cell = 20;
49-
static constexpr int32_t HDPartial1021Cell = 21;
62+
static constexpr int32_t HDPartial0920Cell = 34;
63+
static constexpr int32_t HDPartial1021Cell = 35;
5064

5165
static constexpr int32_t undefinedCell = -1;
5266
static constexpr int32_t centralCell = 0;

Geometry/HGCalCommonData/interface/HGCalCellOffset.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ class HGCalCellOffset {
2626
const double sqrt3_ = std::sqrt(3.0);
2727
const double sqrt3By2_ = (0.5 * sqrt3_);
2828
std::array<std::array<std::array<double, 6>, 6>, 2> offsetX, offsetY;
29-
std::array<std::array<std::array<double, 6>, 11>, 2> offsetPartialX, offsetPartialY;
29+
std::array<std::array<std::array<double, 6>, 25>, 2> offsetPartialX, offsetPartialY;
3030
int32_t ncell_[2];
31-
double cellX_[2], cellY_[2], fullArea[2], cellArea[2][6], cellAreaPartial[2][11];
31+
double cellX_[2], cellY_[2], fullArea[2], cellArea[2][6], cellAreaPartial[2][25];
3232
std::unique_ptr<HGCalCell> hgcalcell_;
3333
};
3434

Geometry/HGCalCommonData/interface/HGCalTypes.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,13 +80,13 @@ class HGCalTypes {
8080
// Condition for cells in partial wafer: arr[0]*u + arr[1]*v <= arr[2]
8181
static constexpr std::array<int, 3> edgeWaferLDTop = {{1, 0, 7}};
8282
static constexpr std::array<int, 3> edgeWaferLDBottom = {{-1, 0, -8}};
83-
static constexpr std::array<int, 3> edgeWaferLDLeft = {{-1, 2, 8}};
83+
static constexpr std::array<int, 3> edgeWaferLDLeft = {{-1, 2, 7}};
8484
static constexpr std::array<int, 3> edgeWaferLDRight = {{1, -2, -7}};
8585
static constexpr std::array<int, 3> edgeWaferLDFive = {{-1, 2, 15}};
86-
static constexpr std::array<int, 3> edgeWaferLDThree = {{1, -2, -14}};
86+
static constexpr std::array<int, 3> edgeWaferLDThree = {{1, -2, -15}};
8787
static constexpr std::array<int, 3> edgeWaferHDTop = {{1, 0, 9}};
8888
static constexpr std::array<int, 3> edgeWaferHDBottom = {{-1, 0, -10}};
89-
static constexpr std::array<int, 3> edgeWaferHDLeft = {{-1, 2, 5}};
89+
static constexpr std::array<int, 3> edgeWaferHDLeft = {{-1, 2, 4}};
9090
static constexpr std::array<int, 3> edgeWaferHDRight = {{1, -2, -18}};
9191
static constexpr std::array<int, 3> edgeWaferHDFive = {{-1, 2, 18}};
9292

Geometry/HGCalCommonData/src/HGCalCell.cc

Lines changed: 160 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -639,46 +639,95 @@ std::pair<int32_t, int32_t> HGCalCell::cellType(
639639
cellt = HGCalCell::LDPartial1415Cell;
640640
} else if (u == 15 && v == 15) {
641641
cellt = HGCalCell::LDPartial1515Cell;
642+
} else if (u == 1 && v == 8) {
643+
cellt = HGCalCell::halfCell;
644+
cellx = HGCalCell::leftCell;
645+
} else if (u == 15 && v == 11) {
646+
if (partialType == HGCalTypes::WaferLDLeft) {
647+
cellt = HGCalCell::extHalfExtCell;
648+
cellx = HGCalCell::leftCell;
649+
} else if (partialType == HGCalTypes::WaferLDRight) {
650+
cellt = HGCalCell::extHalfExtCell;
651+
cellx = HGCalCell::rightCell;
652+
} else {
653+
cellt = HGCalCell::extExtCellCenCut;
654+
}
655+
} else if ((u == 0) && (v == 3 || v == 4)) {
656+
if (v == 3) {
657+
cellt = HGCalCell::extTrunCellEdgeCut;
658+
cellx = HGCalCell::leftCell;
659+
} else if (v == 4) {
660+
cellt = HGCalCell::extTrunCellEdgeCut;
661+
cellx = HGCalCell::rightCell;
662+
}
642663
} else if (u == 7) {
643-
cellt = HGCalCell::extendedCell;
644-
cellx = HGCalCell::topCell;
645-
} else if (u == 8) {
646-
cellt = HGCalCell::truncatedCell;
647-
cellx = HGCalCell::bottomCell;
648-
} else if ((partialType == HGCalTypes::WaferLDLeft) || (partialType == HGCalTypes::WaferLDRight) ||
649-
(partialType == HGCalTypes::WaferLDFive) || (partialType == HGCalTypes::WaferLDThree)) {
650-
if (((u == 15 && v == 11) || (u == 7 && v == 7)) &&
651-
((partialType == HGCalTypes::WaferLDLeft) || (partialType == HGCalTypes::WaferLDRight))) {
652-
cellt = HGCalCell::halfExtCell;
653-
if (partialType == HGCalTypes::WaferLDLeft) {
654-
cellx = HGCalCell::leftCell;
655-
} else {
656-
cellx = HGCalCell::rightCell;
657-
}
658-
} else if ((u == 7 && v == 11) &&
659-
((partialType == HGCalTypes::WaferLDFive) || (partialType == HGCalTypes::WaferLDThree))) {
660-
cellt = HGCalCell::halfExtCell;
661-
if (partialType == HGCalTypes::WaferLDFive) {
662-
cellx = HGCalCell::leftCell;
663-
} else {
664-
cellx = HGCalCell::rightCell;
665-
}
666-
} else if (2 * v - u == 7) {
667-
cellt = HGCalCell::halfCell;
664+
if (v == 7) {
668665
if (partialType == HGCalTypes::WaferLDLeft) {
666+
cellt = HGCalCell::intHalfExtCell;
669667
cellx = HGCalCell::leftCell;
670668
} else if (partialType == HGCalTypes::WaferLDRight) {
669+
cellt = HGCalCell::intHalfExtCell;
671670
cellx = HGCalCell::rightCell;
671+
} else {
672+
cellt = HGCalCell::intExtCellCenCut;
672673
}
673-
} else if (2 * v - u == 15) {
674+
} else if (v == 11) {
674675
if (partialType == HGCalTypes::WaferLDFive) {
676+
cellt = HGCalCell::intHalfExtCell;
675677
cellx = HGCalCell::leftCell;
676678
} else if (partialType == HGCalTypes::WaferLDThree) {
679+
cellt = HGCalCell::intHalfExtCell;
677680
cellx = HGCalCell::rightCell;
681+
} else {
682+
cellt = HGCalCell::intExtCellCenCut;
678683
}
684+
} else {
685+
cellt = HGCalCell::intExtCell;
686+
}
687+
} else if (u == 8) {
688+
if (v == 7 || v == 11) {
689+
cellt = HGCalCell::intTrunCellEdgeCut;
690+
cellx = HGCalCell::leftCell;
691+
} else if (v == 8 || v == 12) {
692+
cellt = HGCalCell::intTrunCellEdgeCut;
693+
cellx = HGCalCell::rightCell;
694+
} else {
695+
cellt = HGCalCell::intTrunCell;
696+
}
697+
} else if (2 * v - u == 7) {
698+
if (partialType == HGCalTypes::WaferLDLeft) {
699+
cellt = HGCalCell::halfCell;
700+
cellx = HGCalCell::leftCell;
701+
} else if (partialType == HGCalTypes::WaferLDRight) {
702+
cellt = HGCalCell::halfCell;
703+
cellx = HGCalCell::rightCell;
704+
} else {
705+
cellt = HGCalCell::fullCellCenCut;
706+
cellx = HGCalCell::centralCell;
707+
}
708+
} else if (2 * v - u == 15) {
709+
if (partialType == HGCalTypes::WaferLDFive) {
679710
cellt = HGCalCell::halfCell;
680-
std::cout << u << ":" << v << " 1" << std::endl;
711+
cellx = HGCalCell::leftCell;
712+
} else if (partialType == HGCalTypes::WaferLDThree) {
713+
cellt = HGCalCell::halfCell;
714+
cellx = HGCalCell::rightCell;
715+
} else {
716+
cellt = HGCalCell::fullCellCenCut;
717+
cellx = HGCalCell::centralCell;
681718
}
719+
} else if (2 * v - u == 6) {
720+
cellt = HGCalCell::fullCellEdgeCut;
721+
cellx = HGCalCell::leftCell;
722+
} else if (2 * v - u == 8) {
723+
cellt = HGCalCell::fullCellEdgeCut;
724+
cellx = HGCalCell::rightCell;
725+
} else if (2 * v - u == 14) {
726+
cellt = HGCalCell::fullCellEdgeCut;
727+
cellx = HGCalCell::leftCell;
728+
} else if (2 * v - u == 16) {
729+
cellt = HGCalCell::fullCellEdgeCut;
730+
cellx = HGCalCell::rightCell;
682731
}
683732
} else if ((partialType >= HGCalTypes::WaferPartHDOffset) &&
684733
(partialType < (HGCalTypes::WaferPartHDOffset + HGCalTypes::WaferPartHDCount))) {
@@ -696,41 +745,101 @@ std::pair<int32_t, int32_t> HGCalCell::cellType(
696745
} else {
697746
cellx = HGCalCell::rightCell;
698747
}
748+
} else if (u == 0 && v == 2) {
749+
if (partialType == HGCalTypes::WaferHDLeft) {
750+
cellt = HGCalCell::extHalfTrunCell;
751+
cellx = HGCalCell::leftCell;
752+
} else {
753+
cellt = HGCalCell::extTrunCellCenCut;
754+
}
755+
} else if (u == 0 && v == 9) {
756+
if (partialType == HGCalTypes::WaferHDFive) {
757+
cellt = HGCalCell::extHalfTrunCell;
758+
cellx = HGCalCell::leftCell;
759+
} else if (partialType == HGCalTypes::WaferHDRight) {
760+
cellt = HGCalCell::extHalfExtCell;
761+
cellx = HGCalCell::rightCell;
762+
} else {
763+
cellt = HGCalCell::extExtCellCenCut;
764+
}
765+
} else if ((u == 23) && (v == 13 || v == 14)) {
766+
if (v == 13) {
767+
cellt = HGCalCell::extExtCellEdgeCut;
768+
cellx = HGCalCell::leftCell;
769+
} else if (v == 14) {
770+
cellt = HGCalCell::extExtCellEdgeCut;
771+
cellx = HGCalCell::rightCell;
772+
}
773+
} else if ((u == 23) && (v == 20 || v == 21)) {
774+
if (v == 20) {
775+
cellt = HGCalCell::extExtCellEdgeCut;
776+
cellx = HGCalCell::leftCell;
777+
} else if (v == 21) {
778+
cellt = HGCalCell::extExtCellEdgeCut;
779+
cellx = HGCalCell::rightCell;
780+
}
699781
} else if (u == 9) {
700-
cellt = HGCalCell::truncatedCell;
701-
cellx = HGCalCell::topCell;
782+
if (v == 6 || v == 13) {
783+
cellt = HGCalCell::intTrunCellEdgeCut;
784+
cellx = HGCalCell::leftCell;
785+
} else if (v == 7 || v == 14) {
786+
cellt = HGCalCell::intTrunCellEdgeCut;
787+
cellx = HGCalCell::rightCell;
788+
} else {
789+
cellt = HGCalCell::intTrunCell;
790+
}
702791
} else if (u == 10) {
703-
cellt = HGCalCell::extendedCell;
704-
cellx = HGCalCell::bottomCell;
705-
} else if ((partialType == HGCalTypes::WaferHDLeft) || (partialType == HGCalTypes::WaferHDRight) ||
706-
(partialType == HGCalTypes::WaferHDFive)) {
707-
if ((u == 10 && v == 7) || (u == 10 && v == 14)) {
708-
cellt = HGCalCell::halfExtCell;
709-
if ((partialType == HGCalTypes::WaferHDLeft) || (partialType == HGCalTypes::WaferHDFive)) {
710-
cellx = HGCalCell::leftCell;
711-
} else {
712-
cellx = HGCalCell::rightCell;
713-
}
714-
} else if ((u == 0 && v == 2) || (u == 0 && v == 9)) {
715-
cellt = HGCalCell::halfTrunCell;
716-
if ((partialType == HGCalTypes::WaferHDLeft) || (partialType == HGCalTypes::WaferHDFive)) {
717-
cellx = HGCalCell::leftCell;
718-
} else {
719-
cellx = HGCalCell::rightCell;
720-
}
721-
} else if (2 * v - u == 4) {
722-
cellt = HGCalCell::halfCell;
792+
if (v == 7) {
723793
if (partialType == HGCalTypes::WaferHDLeft) {
794+
cellt = HGCalCell::intHalfExtCell;
724795
cellx = HGCalCell::leftCell;
796+
} else {
797+
cellt = HGCalCell::intExtCellCenCut;
725798
}
726-
} else if (2 * v - u == 18) {
727-
cellt = HGCalCell::halfCell;
799+
} else if (v == 14) {
728800
if (partialType == HGCalTypes::WaferHDFive) {
801+
cellt = HGCalCell::intHalfExtCell;
729802
cellx = HGCalCell::leftCell;
730803
} else if (partialType == HGCalTypes::WaferHDRight) {
804+
cellt = HGCalCell::intHalfExtCell;
731805
cellx = HGCalCell::rightCell;
806+
} else {
807+
cellt = HGCalCell::intExtCellCenCut;
732808
}
809+
} else {
810+
cellt = HGCalCell::intExtCell;
811+
}
812+
} else if (2 * v - u == 4) {
813+
if (partialType == HGCalTypes::WaferHDLeft) {
814+
cellt = HGCalCell::halfCell;
815+
cellx = HGCalCell::leftCell;
816+
} else {
817+
cellt = HGCalCell::fullCellCenCut;
818+
cellx = HGCalCell::centralCell;
819+
}
820+
} else if (2 * v - u == 18) {
821+
if (partialType == HGCalTypes::WaferHDFive) {
822+
cellt = HGCalCell::halfCell;
823+
cellx = HGCalCell::leftCell;
824+
} else if (partialType == HGCalTypes::WaferHDRight) {
825+
cellt = HGCalCell::halfCell;
826+
cellx = HGCalCell::rightCell;
827+
} else {
828+
cellt = HGCalCell::fullCellCenCut;
829+
cellx = HGCalCell::centralCell;
733830
}
831+
} else if (2 * v - u == 3) {
832+
cellt = HGCalCell::fullCellEdgeCut;
833+
cellx = HGCalCell::leftCell;
834+
} else if (2 * v - u == 5) {
835+
cellt = HGCalCell::fullCellEdgeCut;
836+
cellx = HGCalCell::rightCell;
837+
} else if (2 * v - u == 17) {
838+
cellt = HGCalCell::fullCellEdgeCut;
839+
cellx = HGCalCell::leftCell;
840+
} else if (2 * v - u == 19) {
841+
cellt = HGCalCell::fullCellEdgeCut;
842+
cellx = HGCalCell::rightCell;
734843
}
735844
}
736845
return std::make_pair(cellx, cellt);

0 commit comments

Comments
 (0)