@@ -35,18 +35,18 @@ class SegmentationChip
3535 // The "detector coordinate system" refers to the hit position in row,col inside the sensor
3636 // This class provides the transformations from the local and detector coordinate systems
3737 // The conversion between global and local coordinate systems is operated by the transformation matrices
38- // For the curved VD layers there exist three coordinate systems and one is transient .
38+ // For the curved VD layers there exist four coordinate systems.
3939 // 1. The global (curved) coordinate system. The chip's center of coordinate system is
4040 // defined at the the mid-point of the detector.
41- // 2. The local (flat ) coordinate system. This is the tube segment projected onto a flat
42- // surface. In the projection we implicitly assume that the inner and outer
43- // stretch does not depend on the radius .
44- // 3. The detector coordinate system. Defined by the row and column segmentation
45- // defined at the upper edge in the flat coord .
41+ // 2. The local (curved ) coordinate system, centered in 0,0,0.
42+ // 3. The local (flat) coordinate system. This is the tube segment projected onto a flat
43+ // surface, centered in the middle of the chip, with the y axis pointing towards the interaction point .
44+ // In the projection we implicitly assume that the inner and outer stretch does not depend on the radius.
45+ // 4. The detector coordinate system. Defined by the row and column segmentation .
4646 // For the flat ML and OT layers, there exist two coordinate systems:
4747 // 1. The global (flat) coordinate system. The chip's center of coordinate system is
4848 // defined at the the mid-point of the detector.
49- // 2. The detector coordinate system. Defined by the row and column segmentation
49+ // 2. The detector coordinate system. Defined by the row and column segmentation.
5050 // TODO: add segmentation for VD disks
5151
5252 public:
@@ -121,15 +121,20 @@ class SegmentationChip
121121 pitchCol = PitchColMLOT;
122122 maxWidth = constants::ML::width;
123123 maxLength = constants::ML::length;
124- } else if (subDetID == 1 && layer >= 4 ) { // OT
124+ } else if (subDetID == 1 && layer == 4 ) { // ML/OT (mixed layer, length = ML but staggered as OT)
125125 pitchRow = PitchRowMLOT;
126126 pitchCol = PitchColMLOT;
127- maxWidth = constants::OT::width;
128- maxLength = constants::OT::length;
127+ maxWidth = constants::OT::halfstave::width;
128+ maxLength = constants::ML::length;
129+ } else if (subDetID == 1 && layer > 4 ) { // OT
130+ pitchRow = PitchRowMLOT;
131+ pitchCol = PitchColMLOT;
132+ maxWidth = constants::OT::halfstave::width;
133+ maxLength = constants::OT::halfstave::length;
129134 }
130135 // convert to row/col
131- iRow = static_cast <int >(std::floor ((maxWidth / 2 - xRow) / pitchRow));
132- iCol = static_cast <int >(std::floor ((zCol + maxLength / 2 ) / pitchCol));
136+ iRow = static_cast <int >(((maxWidth / 2 - xRow) / pitchRow));
137+ iCol = static_cast <int >(((zCol + maxLength / 2 ) / pitchCol));
133138 };
134139
135140 // Check local coordinates (cm) validity.
@@ -143,9 +148,12 @@ class SegmentationChip
143148 } else if (subDetID == 1 && layer <= 3 ) { // ML
144149 maxWidth = constants::ML::width;
145150 maxLength = constants::ML::length;
146- } else if (subDetID == 1 && layer >= 4 ) { // OT
147- maxWidth = constants::OT::width;
148- maxLength = constants::OT::length;
151+ } else if (subDetID == 1 && layer == 4 ) { // ML/OT (mixed layer, length = ML but staggered as OT)
152+ maxWidth = constants::OT::halfstave::width;
153+ maxLength = constants::ML::length;
154+ } else if (subDetID == 1 && layer > 4 ) { // OT
155+ maxWidth = constants::OT::halfstave::width;
156+ maxLength = constants::OT::halfstave::length;
149157 }
150158 return (-maxWidth / 2 < x && x < maxWidth / 2 && -maxLength / 2 < z && z < maxLength / 2 );
151159 }
@@ -162,9 +170,12 @@ class SegmentationChip
162170 } else if (subDetID == 1 && layer <= 3 ) { // ML
163171 nRows = constants::ML::nRows;
164172 nCols = constants::ML::nCols;
165- } else if (subDetID == 1 && layer >= 4 ) { // OT
166- nRows = constants::OT::nRows;
167- nCols = constants::OT::nCols;
173+ } else if (subDetID == 1 && layer == 4 ) { // ML/OT (mixed layer, length = ML but staggered as OT)
174+ nRows = constants::OT::halfstave::nRows;
175+ nCols = constants::ML::nCols;
176+ } else if (subDetID == 1 && layer > 4 ) { // OT
177+ nRows = constants::OT::halfstave::nRows;
178+ nCols = constants::OT::halfstave::nCols;
168179 }
169180 return (row >= 0 && row < static_cast <float >(nRows) && col >= 0 && col < static_cast <float >(nCols));
170181 }
@@ -210,9 +221,12 @@ class SegmentationChip
210221 } else if (subDetID == 1 && layer <= 3 ) { // ML
211222 xRow = 0.5 * (constants::ML::width - PitchRowMLOT) - (row * PitchRowMLOT);
212223 zCol = col * PitchRowMLOT + 0.5 * (PitchRowMLOT - constants::ML::length);
213- } else if (subDetID == 1 && layer >= 4 ) { // OT
214- xRow = 0.5 * (constants::OT::width - PitchRowMLOT) - (row * PitchRowMLOT);
215- zCol = col * PitchColMLOT + 0.5 * (PitchColMLOT - constants::OT::length);
224+ } else if (subDetID == 1 && layer == 4 ) { // ML/OT (mixed layer, length = ML but staggered as OT)
225+ xRow = 0.5 * (constants::OT::halfstave::width - PitchRowMLOT) - (row * PitchRowMLOT);
226+ zCol = col * PitchRowMLOT + 0.5 * (PitchRowMLOT - constants::ML::length);
227+ } else if (subDetID == 1 && layer > 4 ) { // OT
228+ xRow = 0.5 * (constants::OT::halfstave::width - PitchRowMLOT) - (row * PitchRowMLOT);
229+ zCol = col * PitchColMLOT + 0.5 * (PitchColMLOT - constants::OT::halfstave::length);
216230 }
217231 }
218232
@@ -263,17 +277,25 @@ class SegmentationChip
263277 }
264278
265279 // / Print segmentation info
266- static const void Print () noexcept
280+ static void Print () noexcept
267281 {
268282 LOG (info) << " Number of rows:\n VD L0: " << constants::VD::petal::layer::nRows[0 ]
269283 << " \n VD L1: " << constants::VD::petal::layer::nRows[1 ]
270284 << " \n VD L2: " << constants::VD::petal::layer::nRows[2 ]
271285 << " \n ML stave: " << constants::ML::nRows
272- << " \n OT stave: " << constants::OT::nRows;
286+ << " \n OT half stave: " << constants::OT::halfstave ::nRows;
273287
274288 LOG (info) << " Number of cols:\n VD: " << constants::VD::petal::layer::nCols
275289 << " \n ML stave: " << constants::ML::nCols
276- << " \n OT stave: " << constants::OT::nCols;
290+ << " \n OT half stave: " << constants::OT::halfstave::nCols;
291+
292+ LOG (info) << " Pitch rows [cm]:\n VD: " << PitchRowVD
293+ << " \n ML stave: " << PitchRowMLOT
294+ << " \n OT stave: " << PitchRowMLOT;
295+
296+ LOG (info) << " Pitch cols [cm]:\n VD: " << PitchColVD
297+ << " \n ML stave: " << PitchColMLOT
298+ << " \n OT stave: " << PitchColMLOT;
277299 }
278300};
279301
0 commit comments