diff --git a/include/aare/Interpolator.hpp b/include/aare/Interpolator.hpp index d0f5875..3a84ae1 100644 --- a/include/aare/Interpolator.hpp +++ b/include/aare/Interpolator.hpp @@ -88,8 +88,8 @@ Interpolator::interpolate(const ClusterVector &clusters) { dY = 1.0; break; } - photon.x -= m_ietax(ix, iy, ie) * 2 - dX; - photon.y -= m_ietay(ix, iy, ie) * 2 - dY; + photon.x -= m_ietax(ix, iy, ie) - dX; + photon.y -= m_ietay(ix, iy, ie) - dY; photons.push_back(photon); } } else if (clusters.cluster_size_x() == 2 || @@ -114,10 +114,10 @@ Interpolator::interpolate(const ClusterVector &clusters) { auto iy = last_smaller(m_etabinsy, eta.y); // TODO: why 2? - photon.x -= m_ietax(ix, iy, ie) * - 2; // eta goes between 0 and 1 but we could move the hit - // anywhere in the 2x2 - photon.y -= m_ietay(ix, iy, ie) * 2; + photon.x -= + m_ietax(ix, iy, ie); // eta goes between 0 and 1 but we could + // move the hit anywhere in the 2x2 + photon.y -= m_ietay(ix, iy, ie); photons.push_back(photon); } diff --git a/python/tests/test_Interpolation.py b/python/tests/test_Interpolation.py index 149da47..d3286ce 100644 --- a/python/tests/test_Interpolation.py +++ b/python/tests/test_Interpolation.py @@ -23,8 +23,8 @@ def create_photon_hit_with_gaussian_distribution(mean, covariance_matrix, data_p return (probability_values.reshape(X.shape)).round() #python bindings only support frame types of uint16_t def photon_hit_in_euclidean_space(cluster_center, pixels_per_superpixel, photon_hit): - scaled_photon_hit_x = cluster_center - (1 - photon_hit[0][0])*0.5*pixels_per_superpixel*pixel_width - scaled_photon_hit_y = cluster_center - (1 - photon_hit[0][1])*0.5*pixels_per_superpixel*pixel_width + scaled_photon_hit_x = cluster_center - (1 - photon_hit[0][0])*pixels_per_superpixel*pixel_width + scaled_photon_hit_y = cluster_center - (1 - photon_hit[0][1])*pixels_per_superpixel*pixel_width return (scaled_photon_hit_x, scaled_photon_hit_y) def create_2x2cluster_from_frame(frame, pixels_per_superpixel):