Skip to content

Commit 578bfbf

Browse files
authored
Merge pull request #45284 from bsunanda/Phase2-hgx357
Phase2-hgx357 Give correct names of some of the variables and correct their implementation in the HGCal Geometry
2 parents f1a5ed3 + c401627 commit 578bfbf

File tree

16 files changed

+179
-152
lines changed

16 files changed

+179
-152
lines changed

DataFormats/ForwardDetId/interface/HGCSiliconDetId.h

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@
1515
[19:19] sign of v (0:+v; 1:-v) (v=0 is at the center of beam line)
1616
[20:24] layer number
1717
[25:25] z-side (0 for +z; 1 for -z)
18-
[26:27] Type (0 fine divisions of wafer with 120 mum thick silicon
19-
1 coarse divisions of wafer with 200 mum thick silicon
20-
2 coarse divisions of wafer with 300 mum thick silicon
21-
3 fine divisions of wafer with 200 mum thick silicon)
18+
[26:27] Type (0 high density wafer with depltetion thickness of 120 mum
19+
1 low density wafer with depletion thickness of 200 mum
20+
2 low density wafer with depletion thickness of 300 mum
21+
3 high density wafer with depletion thickness of 200 mum)
2222
[28:31] Detector type (HGCalEE or HGCalHSi)
2323
*/
2424
class HGCSiliconDetId : public DetId {
2525
public:
26-
enum waferType { HGCalFine = 0, HGCalCoarseThin = 1, HGCalCoarseThick = 2, HGCalFineThick = 3 };
26+
enum waferType { HGCalHD120 = 0, HGCalLD200 = 1, HGCalLD300 = 2, HGCalHD200 = 3 };
2727
static constexpr int32_t HGCalHighDensityN = 12;
2828
static constexpr int32_t HGCalLowDensityN = 8;
2929
static constexpr int32_t HGCalFineTrigger = 3;
@@ -95,11 +95,10 @@ class HGCSiliconDetId : public DetId {
9595

9696
/// get the type
9797
constexpr int32_t type() const { return (id_ >> kHGCalTypeOffset) & kHGCalTypeMask; }
98-
constexpr bool lowDensity() const { return ((type() == HGCalCoarseThin) || (type() == HGCalCoarseThick)); }
99-
constexpr bool highDensity() const { return ((type() == HGCalFine) || (type() == HGCalFineThick)); }
98+
constexpr bool lowDensity() const { return ((type() == HGCalLD200) || (type() == HGCalLD300)); }
99+
constexpr bool highDensity() const { return ((type() == HGCalHD120) || (type() == HGCalHD200)); }
100100
constexpr int32_t depletion() const {
101-
return ((type() == HGCalFine) ? HGCal0Depletion
102-
: ((type() == HGCalCoarseThick) ? HGCal2Depletion : HGCal1Depletion));
101+
return ((type() == HGCalHD120) ? HGCal0Depletion : ((type() == HGCalLD300) ? HGCal2Depletion : HGCal1Depletion));
103102
}
104103

105104
/// get the z-side of the cell (1/-1)
@@ -113,11 +112,11 @@ class HGCSiliconDetId : public DetId {
113112
constexpr int32_t cellV() const { return (id_ >> kHGCalCellVOffset) & kHGCalCellVMask; }
114113
constexpr std::pair<int32_t, int32_t> cellUV() const { return std::pair<int32_t, int32_t>(cellU(), cellV()); }
115114
constexpr int32_t cellX() const {
116-
int32_t N = ((type() == HGCalFine) || (type() == HGCalFineThick)) ? HGCalHighDensityN : HGCalLowDensityN;
115+
int32_t N = ((type() == HGCalHD120) || (type() == HGCalHD200)) ? HGCalHighDensityN : HGCalLowDensityN;
117116
return (3 * (cellV() - N) + 2);
118117
}
119118
constexpr int32_t cellY() const {
120-
int32_t N = ((type() == HGCalFine) || (type() == HGCalFineThick)) ? HGCalHighDensityN : HGCalLowDensityN;
119+
int32_t N = ((type() == HGCalHD120) || (type() == HGCalHD200)) ? HGCalHighDensityN : HGCalLowDensityN;
121120
return (2 * cellU() - (N + cellV()));
122121
}
123122
constexpr std::pair<int32_t, int32_t> cellXY() const { return std::pair<int32_t, int32_t>(cellX(), cellY()); }
@@ -148,15 +147,15 @@ class HGCSiliconDetId : public DetId {
148147

149148
// get trigger cell u,v
150149
constexpr int32_t triggerCellU() const {
151-
int32_t N = ((type() == HGCalFine) || (type() == HGCalFineThick)) ? HGCalHighDensityN : HGCalLowDensityN;
152-
int32_t NT = ((type() == HGCalFine) || (type() == HGCalFineThick)) ? HGCalFineTrigger : HGCalCoarseTrigger;
150+
int32_t N = ((type() == HGCalHD120) || (type() == HGCalHD200)) ? HGCalHighDensityN : HGCalLowDensityN;
151+
int32_t NT = ((type() == HGCalHD120) || (type() == HGCalHD200)) ? HGCalFineTrigger : HGCalCoarseTrigger;
153152
return (cellU() >= N && cellV() >= N)
154153
? cellU() / NT
155154
: ((cellU() < N && cellU() <= cellV()) ? cellU() / NT : (1 + (cellU() - (cellV() % NT + 1)) / NT));
156155
}
157156
constexpr int32_t triggerCellV() const {
158-
int32_t N = ((type() == HGCalFine) || (type() == HGCalFineThick)) ? HGCalHighDensityN : HGCalLowDensityN;
159-
int32_t NT = ((type() == HGCalFine) || (type() == HGCalFineThick)) ? HGCalFineTrigger : HGCalCoarseTrigger;
157+
int32_t N = ((type() == HGCalHD120) || (type() == HGCalHD200)) ? HGCalHighDensityN : HGCalLowDensityN;
158+
int32_t NT = ((type() == HGCalHD120) || (type() == HGCalHD200)) ? HGCalFineTrigger : HGCalCoarseTrigger;
160159
return (cellU() >= N && cellV() >= N)
161160
? cellV() / NT
162161
: ((cellU() < N && cellU() <= cellV()) ? ((cellV() - cellU()) / NT + cellU() / NT) : cellV() / NT);

DataFormats/ForwardDetId/interface/HGCalTriggerDetId.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@
1515
[13:16] abs(v) of the wafer (v-axis points 60-degree wrt x-axis)
1616
[17:17] sign of v (0:+v; 1:-v) (v=0 is at the center of beam line)
1717
[18:22] layer number
18-
[23:24] Type (0 fine divisions of wafer with 120 mum thick silicon
19-
1 coarse divisions of wafer with 200 mum thick silicon
20-
2 coarse divisions of wafer with 300 mum thick silicon)
18+
[23:24] Type (0 high density wafer with depltetion thickness of 120 mum
19+
1 low density wafer with depletion thickness of 200 mum
20+
2 low density wafer with depletion thickness of 300 mum
21+
3 high density wafer with depletion thickness of 200 mum)
2122
[25:26] Subdetector Type (HGCalEETrigger/HGCalHSiTrigger)
2223
[27:27] z-side (0 for +z; 1 for -z)
2324
[28:31] Detector type (HGCalTrigger)

DataFormats/ForwardDetId/src/HGCalTriggerDetId.cc

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,9 @@ HGCalTriggerDetId& HGCalTriggerDetId::operator=(const DetId& gen) {
4747
}
4848

4949
int HGCalTriggerDetId::triggerCellX() const {
50-
int nT =
51-
(type() == HGCSiliconDetId::HGCalFine) ? HGCSiliconDetId::HGCalFineTrigger : HGCSiliconDetId::HGCalCoarseTrigger;
50+
int nT = ((type() == HGCSiliconDetId::HGCalHD120) || (type() == HGCSiliconDetId::HGCalHD200))
51+
? HGCSiliconDetId::HGCalFineTrigger
52+
: HGCSiliconDetId::HGCalCoarseTrigger;
5253
int N = nT * HGCalTriggerCell;
5354
std::vector<int> vc = cellV();
5455
int x(0);
@@ -59,8 +60,9 @@ int HGCalTriggerDetId::triggerCellX() const {
5960
}
6061

6162
int HGCalTriggerDetId::triggerCellY() const {
62-
int nT =
63-
(type() == HGCSiliconDetId::HGCalFine) ? HGCSiliconDetId::HGCalFineTrigger : HGCSiliconDetId::HGCalCoarseTrigger;
63+
int nT = ((type() == HGCSiliconDetId::HGCalHD120) || (type() == HGCSiliconDetId::HGCalHD200))
64+
? HGCSiliconDetId::HGCalFineTrigger
65+
: HGCSiliconDetId::HGCalCoarseTrigger;
6466
int N = nT * HGCalTriggerCell;
6567
std::vector<int> uc = cellU();
6668
std::vector<int> vc = cellV();
@@ -73,8 +75,9 @@ int HGCalTriggerDetId::triggerCellY() const {
7375

7476
std::vector<int> HGCalTriggerDetId::cellU() const {
7577
std::vector<int> uc;
76-
int nT =
77-
(type() == HGCSiliconDetId::HGCalFine) ? HGCSiliconDetId::HGCalFineTrigger : HGCSiliconDetId::HGCalCoarseTrigger;
78+
int nT = ((type() == HGCSiliconDetId::HGCalHD120) || (type() == HGCSiliconDetId::HGCalHD200))
79+
? HGCSiliconDetId::HGCalFineTrigger
80+
: HGCSiliconDetId::HGCalCoarseTrigger;
7881
if ((triggerCellU() >= HGCalTriggerCell) && (triggerCellV() >= HGCalTriggerCell)) {
7982
int u0 = nT * triggerCellU();
8083
for (int i = 0; i < nT; ++i) {
@@ -103,8 +106,9 @@ std::vector<int> HGCalTriggerDetId::cellU() const {
103106

104107
std::vector<int> HGCalTriggerDetId::cellV() const {
105108
std::vector<int> vc;
106-
int nT =
107-
(type() == HGCSiliconDetId::HGCalFine) ? HGCSiliconDetId::HGCalFineTrigger : HGCSiliconDetId::HGCalCoarseTrigger;
109+
int nT = ((type() == HGCSiliconDetId::HGCalHD120) || (type() == HGCSiliconDetId::HGCalHD200))
110+
? HGCSiliconDetId::HGCalFineTrigger
111+
: HGCSiliconDetId::HGCalCoarseTrigger;
108112
if ((triggerCellU() >= HGCalTriggerCell) && (triggerCellV() >= HGCalTriggerCell)) {
109113
int v0 = nT * triggerCellV();
110114
for (int i = 0; i < nT; ++i) {

Geometry/HGCalCommonData/interface/HGCalTypes.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ class HGCalTypes {
2727
static constexpr int32_t WaferCenterR = 6;
2828

2929
static constexpr int32_t WaferTypeUndefined = -1;
30-
static constexpr int32_t WaferFineThin = 0;
31-
static constexpr int32_t WaferCoarseThin = 1;
32-
static constexpr int32_t WaferCoarseThick = 2;
33-
static constexpr int32_t WaferFineThick = 3;
30+
static constexpr int32_t WaferHD120 = 0;
31+
static constexpr int32_t WaferLD200 = 1;
32+
static constexpr int32_t WaferLD300 = 2;
33+
static constexpr int32_t WaferHD200 = 3;
3434

3535
static constexpr int32_t WaferFull = 0;
3636
static constexpr int32_t WaferFive = 1;
@@ -137,7 +137,7 @@ class HGCalTypes {
137137
static constexpr int32_t layerFrontBack(int32_t layerOrient) { return ((layerOrient == WaferCenterB) ? 1 : -1); }
138138
static constexpr int32_t waferFrontBack(int32_t index) { return ((index == 0) ? -1 : 1); }
139139
// LD vs HD and Fullvs Partial wafer
140-
static constexpr bool waferHD(int32_t type) { return ((type == WaferFineThin) || (type == WaferFineThick)); }
140+
static constexpr bool waferHD(int32_t type) { return ((type == WaferHD120) || (type == WaferHD200)); }
141141
static constexpr bool waferFull(int32_t type) { return (type == WaferFull); }
142142

143143
private:

Geometry/HGCalCommonData/src/HGCalCalibrationCell.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ HGCalCalibrationCell::HGCalCalibrationCell(const HGCalDDDConstants* cons) : cons
3939
int HGCalCalibrationCell::findCell(
4040
int zside, int layer, int waferU, int waferV, int cellUV, const std::pair<double, double>& xy) const {
4141
const auto& info = cons_->waferInfo(layer, waferU, waferV);
42-
int ld = (info.type == HGCalTypes::WaferFineThin) ? 1 : 0;
42+
int ld = ((info.type == HGCalTypes::WaferHD120) || (info.type == HGCalTypes::WaferHD200)) ? 1 : 0;
4343
int part = (info.part == HGCalTypes::WaferFull) ? 1 : 0;
4444
int indx = 2 * ld + part;
4545
#ifdef EDM_ML_DEBUG

0 commit comments

Comments
 (0)