You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Detectors/Upgrades/ALICE3/TRK/base/include/TRKBase/GeometryTGeo.h
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -83,14 +83,14 @@ class GeometryTGeo : public o2::detectors::DetMatrixCache
83
83
84
84
intgetSubDetID(int index) const;
85
85
intgetPetalCase(int index) const;
86
+
intgetDisk(int index) const;
86
87
intgetLayer(int index) const;
87
88
intgetStave(int index) const;
88
89
intgetHalfStave(int index) const;
89
-
intgetDisk(int index) const;
90
90
intgetModule(int index) const;
91
91
intgetChip(int index) const;
92
92
93
-
/// This routine computes the chip index number from the subDetID, petal, disk, layer, stave /// TODO: retrieve also from chip when chips will be available
93
+
/// This routine computes the chip index number from the subDetID, petal, disk, layer, stave, half stave, module, chip
94
94
/// \param int subDetID The subdetector ID, 0 for VD, 1 for MLOT
95
95
/// \param int petalcase The petal case number for VD, from 0 to 3
96
96
/// \param int disk The disk number for VD, from 0 to 5
@@ -101,7 +101,7 @@ class GeometryTGeo : public o2::detectors::DetMatrixCache
101
101
/// \param int chip The chip number for MLOT, from 0 to 8
102
102
intgetChipIndex(int subDetID, int petalcase, int disk, int lay, int stave, int halfstave, int mod, int chip) const;
103
103
104
-
/// This routine computes the chip index number from the subDetID, volume, layer, stave /// TODO: retrieve also from chip when chips will be available
104
+
/// This routine computes the chip index number from the subDetID, volume, layer, stave, half stave, module, chip
105
105
/// \param int subDetID The subdetector ID, 0 for VD, 1 for MLOT
106
106
/// \param int volume is needed only with the current configuration for VD where each single element is a volume. // TODO: when the geometry naming scheme will be changed, change this method
107
107
/// \param int lay The layer number for the MLOT. In the current configuration for VD this is not needed. // TODO: when the geometry naming scheme will be changed, change this method
@@ -111,7 +111,7 @@ class GeometryTGeo : public o2::detectors::DetMatrixCache
111
111
/// \param int chip The chip number for MLOT, from 0 to 8
112
112
intgetChipIndex(int subDetID, int volume, int lay, int stave, int halfstave, int mod, int chip) const;
113
113
114
-
/// This routine computes subDetID, petal, disk, layer, stave given the chip index number /// TODO: copute also from chip when chips will be available
114
+
/// This routine computes subDetID, petal, disk, layer, stave, half stave, module, chip, given the chip index number
115
115
/// \param int index The chip index number, starting from 0
116
116
/// \param int subDetID The subdetector ID, 0 for VD, 1 for MLOT
117
117
/// \param int petalcase The petal case number for VD, from 0 to 3
@@ -191,48 +221,85 @@ int GeometryTGeo::getHalfStave(int index) const
191
221
int subDetID = getSubDetID(index);
192
222
int lay = getLayer(index);
193
223
int petalcase = getPetalCase(index);
194
-
int stave = getStave(index);
195
224
196
225
if (subDetID == 0) { /// VD
197
226
return -1;
198
227
} elseif (subDetID == 1) { /// MLOT
199
228
int lay = getLayer(index);
200
229
index -= getFirstChipIndex(lay, petalcase, subDetID); // get the index of the sensing element in the layer
201
-
return index % 2; /// 0 = half stave left, 1 = half stave right, as geometry is filled /// TODO: generalize once chips will be in place. Can it be working also with chips?
230
+
231
+
constint Nhs = mNumberOfHalfStaves[lay];
232
+
constint Nmod = mNumberOfModules[lay];
233
+
constint Nchip = mNumberOfChips[lay];
234
+
235
+
int chipsPerModule = Nchip;
236
+
int chipsPerHalfStave = Nmod * chipsPerModule;
237
+
int chipsPerStave = Nhs * chipsPerHalfStave;
238
+
239
+
int rem = index % chipsPerStave;
240
+
return rem / chipsPerHalfStave; // 0 = left, 1 = right
returngetFirstChipIndex(lay, petalcase, subDetID) + stave * mNumberOfModules[lay] + mod * mNumberOfChips[lay] + chip;
314
+
} elseif (subDetID == 1) { // MLOT
315
+
constint Nhs = mNumberOfHalfStaves[lay]; // 1 or 2
316
+
constint Nmod = mNumberOfModules[lay]; // module per half-stave (per stave if Nhs==1)
317
+
constint Nchip = mNumberOfChips[lay]; // chips per module
318
+
319
+
if (Nhs == 2) { // staggered geometry: layer -> stave -> halfstave -> mod -> chip
320
+
int chipsPerModule = Nchip;
321
+
int chipsPerHalfStave = Nmod * chipsPerModule;
322
+
int chipsPerStave = Nhs * chipsPerHalfStave;
323
+
returngetFirstChipIndex(lay, petalcase, subDetID) + stave * chipsPerStave + halfstave * chipsPerHalfStave + mod * chipsPerModule + chip;
324
+
} elseif (Nhs == 1) { // turbo geometry: layer -> stave -> mod -> chip (no halfstave)
325
+
int chipsPerModule = Nchip;
326
+
int chipsPerStave = Nmod * chipsPerModule;
327
+
returngetFirstChipIndex(lay, petalcase, subDetID) + stave * chipsPerStave + mod * chipsPerModule + chip;
252
328
}
253
329
}
254
330
return -1; // not found
@@ -260,11 +336,20 @@ int GeometryTGeo::getChipIndex(int subDetID, int volume, int lay, int stave, int
260
336
if (subDetID == 0) { // VD
261
337
return volume; /// In the current configuration for VD, each volume is the sensor element = chip. // TODO: when the geometry naming scheme will be changed, change this method
262
338
263
-
} elseif (subDetID == 1) { // MLOT
264
-
if (mNumberOfHalfStaves[lay] == 2) { // staggered geometry
265
-
returngetFirstChipIndex(lay, -1, subDetID) + stave * mNumberOfHalfStaves[lay] + halfstave * mNumberOfModules[lay] + mod * mNumberOfChips[lay] + chip;
0 commit comments