@@ -168,25 +168,26 @@ class SegmentationMosaix
168168 // / center of the sensitive volume.
169169 // / If iRow and or iCol is outside of the segmentation range a value of -0.5*Dx()
170170 // / or -0.5*Dz() is returned.
171- constexpr bool detectorToLocal ( int const iRow, int const iCol, float & xRow, float & zCol) const noexcept
172- {
173- if (!isValid (iRow, iCol )) {
171+ template < typename T>
172+ constexpr bool detectorToLocal (T const row, T const col, float & xRow, float & zCol) const noexcept {
173+ if (!isValid (row, col )) {
174174 return false ;
175175 }
176- detectorToLocalUnchecked (iRow, iCol , xRow, zCol);
176+ detectorToLocalUnchecked (row, col , xRow, zCol);
177177 return isValid (xRow, zCol);
178178 }
179179
180180 // Same as detectorToLocal w.o. checks.
181181 // We position ourself in the middle of the pixel.
182- constexpr void detectorToLocalUnchecked ( int const iRow, int const iCol, float & xRow, float & zCol) const noexcept
183- {
184- xRow = -(static_cast <float >(iRow ) + 0 .5f ) * PitchRow + WidthH;
185- zCol = (static_cast <float >(iCol ) + 0 .5f ) * PitchCol - LengthH;
182+ template < typename T>
183+ constexpr void detectorToLocalUnchecked (T const row, T const col, float & xRow, float & zCol) const noexcept {
184+ xRow = -(static_cast <float >(row ) + 0 .5f ) * PitchRow + WidthH;
185+ zCol = (static_cast <float >(col ) + 0 .5f ) * PitchCol - LengthH;
186186 }
187187
188- constexpr bool detectorToLocal (int const row, int const col, math_utils::Point3D<float >& loc) const noexcept
189- {
188+
189+ template <typename T>
190+ constexpr bool detectorToLocal (T const row, T const col, math_utils::Point3D<float >& loc) const noexcept {
190191 float xRow{0 .}, zCol{0 .};
191192 if (!detectorToLocal (row, col, xRow, zCol)) {
192193 return false ;
@@ -195,8 +196,8 @@ class SegmentationMosaix
195196 return true ;
196197 }
197198
198- constexpr void detectorToLocalUnchecked ( int const row, int const col, math_utils::Point3D< float >& loc) const noexcept
199- {
199+ template < typename T>
200+ constexpr void detectorToLocalUnchecked (T const row, T const col, math_utils::Point3D< float >& loc) const noexcept {
200201 float xRow{0 .}, zCol{0 .};
201202 detectorToLocalUnchecked (row, col, xRow, zCol);
202203 loc.SetCoordinates (xRow, NominalYShift, zCol);
0 commit comments