@@ -151,7 +151,8 @@ class SegmentationMosaix
151151 }
152152
153153 // Same as localToDetector w.o. checks.
154- constexpr void localToDetectorUnchecked (float const xRow, float const zCol, int & iRow, int & iCol) const noexcept
154+ template <typename T = float >
155+ constexpr void localToDetectorUnchecked (T const xRow, T const zCol, int & iRow, int & iCol) const noexcept
155156 {
156157 iRow = static_cast <int >(std::floor ((WidthH - xRow) / PitchRow));
157158 iCol = static_cast <int >(std::floor ((zCol + LengthH) / PitchCol));
@@ -167,7 +168,8 @@ class SegmentationMosaix
167168 // / center of the sensitive volume.
168169 // / If iRow and or iCol is outside of the segmentation range a value of -0.5*Dx()
169170 // / or -0.5*Dz() is returned.
170- bool detectorToLocal (float const row, float const col, float & xRow, float & zCol) const noexcept
171+ template <typename T = float , typename L = float >
172+ bool detectorToLocal (T const row, T const col, L& xRow, L& zCol) const noexcept
171173 {
172174 if (!isValidDet (row, col)) {
173175 return false ;
@@ -178,25 +180,28 @@ class SegmentationMosaix
178180
179181 // Same as detectorToLocal w.o. checks.
180182 // We position ourself in the middle of the pixel.
181- void detectorToLocalUnchecked (float const row, float const col, float & xRow, float & zCol) const noexcept
183+ template <typename T = float , typename L = float >
184+ void detectorToLocalUnchecked (T const row, T const col, L& xRow, L& zCol) const noexcept
182185 {
183186 xRow = -(row + 0 .5f ) * PitchRow + WidthH;
184187 zCol = (col + 0 .5f ) * PitchCol - LengthH;
185188 }
186189
187- bool detectorToLocal (float const row, float const col, math_utils::Point3D<float >& loc) const noexcept
190+ template <typename T = float , typename L = float >
191+ bool detectorToLocal (T const row, T const col, math_utils::Point3D<L>& loc) const noexcept
188192 {
189- float xRow{0 .}, zCol{0 .};
193+ L xRow{0 .}, zCol{0 .};
190194 if (!detectorToLocal (row, col, xRow, zCol)) {
191195 return false ;
192196 }
193197 loc.SetCoordinates (xRow, 0 .0f , zCol);
194198 return true ;
195199 }
196200
197- void detectorToLocalUnchecked (float const row, float const col, math_utils::Point3D<float >& loc) const noexcept
201+ template <typename T = float , typename L = float >
202+ void detectorToLocalUnchecked (T const row, T const col, math_utils::Point3D<L>& loc) const noexcept
198203 {
199- float xRow{0 .}, zCol{0 .};
204+ L xRow{0 .}, zCol{0 .};
200205 detectorToLocalUnchecked (row, col, xRow, zCol);
201206 loc.SetCoordinates (xRow, 0 .0f , zCol);
202207 }
0 commit comments