diff --git a/src/core/detector/Detector.hpp b/src/core/detector/Detector.hpp index 072fa6bdc76c611084d6f5a51c0708c0d6f41b81..ce8b894ddf26681351f703306e2f406e46f8c4b8 100644 --- a/src/core/detector/Detector.hpp +++ b/src/core/detector/Detector.hpp @@ -224,10 +224,12 @@ namespace corryvreckan { /** * @brief Get intrinsic spatial resolution of the detector + * @param column (X-) Column index of the pixel to calculate the spatial resolution from + * @param row (Y-) Row index of the pixel to calculate the spatial resolution from * @return Intrinsic spatial resolution in X and Y * @todo: this is designed for PixelDetector, find a proper interface for other Detector type */ - virtual XYVector getSpatialResolution() const = 0; + virtual XYVector getSpatialResolution(double column = 0, double row = 0) const = 0; /** * @brief Get intrinsic spatial resolution in global coordinates of the detector diff --git a/src/core/detector/PixelDetector.hpp b/src/core/detector/PixelDetector.hpp index 71c0a69b106ccfc31ca6aed6b7acffd12635d314..f4fb8d9a68d5a019ed9026c542b653826a53bcf9 100644 --- a/src/core/detector/PixelDetector.hpp +++ b/src/core/detector/PixelDetector.hpp @@ -147,8 +147,11 @@ namespace corryvreckan { /** * @brief Get intrinsic spatial resolution of the detector * @return Intrinsic spatial resolution in X and Y + * + * @note For a detector with variable pixel sizes this declaration could be changed to take column and row pixel + * indices to calculate the resolution for a specific pixel */ - XYVector getSpatialResolution() const override { return m_spatial_resolution; } + XYVector getSpatialResolution(double, double) const override { return m_spatial_resolution; } /** * @brief Get intrinsic spatial resolution in global coordinates of the detector diff --git a/src/modules/Clustering4D/Clustering4D.cpp b/src/modules/Clustering4D/Clustering4D.cpp index 54ecb85dbfee2832cbfb659bfac93de96d63037c..36292c05d90140de70bb38fb323dfde6cac3c88a 100644 --- a/src/modules/Clustering4D/Clustering4D.cpp +++ b/src/modules/Clustering4D/Clustering4D.cpp @@ -334,7 +334,7 @@ void Clustering4D::calculateClusterCentre(Cluster* cluster) { cluster->setCharge(charge); // Set uncertainty on position from intrinstic detector spatial resolution: - cluster->setError(m_detector->getSpatialResolution()); + cluster->setError(m_detector->getSpatialResolution(column, row)); cluster->setErrorMatrixGlobal(m_detector->getSpatialResolutionMatrixGlobal()); cluster->setTimestamp(timestamp); diff --git a/src/modules/ClusteringSpatial/ClusteringSpatial.cpp b/src/modules/ClusteringSpatial/ClusteringSpatial.cpp index b42896db8d90b51fe3ae4f0592cb6784d69111a5..163305bd0212e25a7a8ac62884da704cae33cf3a 100644 --- a/src/modules/ClusteringSpatial/ClusteringSpatial.cpp +++ b/src/modules/ClusteringSpatial/ClusteringSpatial.cpp @@ -259,7 +259,7 @@ void ClusteringSpatial::calculateClusterCentre(Cluster* cluster) { cluster->setCharge(charge); // Set uncertainty on position from intrinstic detector spatial resolution: - cluster->setError(m_detector->getSpatialResolution()); + cluster->setError(m_detector->getSpatialResolution(column, row)); cluster->setErrorMatrixGlobal(m_detector->getSpatialResolutionMatrixGlobal()); cluster->setDetectorID(detectorID);