Interpolation¶
Interpolation class for \(\eta\) Interpolation.
The Interpolator class provides methods to interpolate the positions of photons based on their \(\eta\) values.
Warning
The interpolation might lead to erroneous photon positions for clusters at the boarders of a frame. Make sure to filter out such cases.
\(\eta\)-Functions:¶
-
template<typename T>
struct Eta2¶ eta struct
Note
The corner value c is only relevant when one uses calculate_eta_2 or calculate_full_eta2. Otherwise its default value is cTopLeft.
Supported are the following \(\eta\)-functions:
-
template<typename ClusterType, typename = std::enable_if_t<is_cluster_v<ClusterType>>>
std::vector<Eta2<typename ClusterType::value_type>> aare::calculate_eta2(const ClusterVector<ClusterType> &clusters)¶ Calculate the eta2 values for all clusters in a ClusterVector.
-
template<typename T, uint8_t ClusterSizeX, uint8_t ClusterSizeY, typename CoordType = uint16_t>
Eta2<T> aare::calculate_eta2(const Cluster<T, ClusterSizeX, ClusterSizeY, CoordType> &cl)¶ Calculate the eta2 values for a generic sized cluster and return them in a Eta2 struct containing etay, etax and the index (as corner) of the respective 2x2 subcluster relative to the cluster center.
-
template<typename ClusterType, typename = std::enable_if_t<is_cluster_v<ClusterType>>>
std::vector<Eta2<typename ClusterType::value_type>> aare::calculate_full_eta2(const ClusterVector<ClusterType> &clusters)¶ Calculate the full eta2 values for all clusters in a ClusterVector.
-
template<typename T, uint8_t ClusterSizeX, uint8_t ClusterSizeY, typename CoordType>
Eta2<T> aare::calculate_full_eta2(const Cluster<T, ClusterSizeX, ClusterSizeY, CoordType> &cl)¶ Calculate the eta2 values for a generic sized cluster and return them in a Eta2 struct containing etay, etax and the index (as corner) of the respective 2x2 subcluster relative to the cluster center.
Warning
doxygenfunction: Unable to resolve function “aare::calculate_eta3” with arguments (const ClusterVector<Cluster<T, 3, 3, CoordType>>&) in doxygen xml output for project “aare” from directory: /home/runner/work/aare/aare/build/docs/xml. Potential matches:
- template<typename ClusterType, typename = std::enable_if_t<is_cluster_v<ClusterType>>> std::vector<Eta2<typename ClusterType::value_type>> calculate_eta3(const ClusterVector<ClusterType> &clusters)
- template<typename T, typename CoordType = uint16_t> Eta2<T> calculate_eta3(const Cluster<T, 3, 3, CoordType> &cl)
- template<typename T, uint8_t ClusterSizeX, uint8_t ClusterSizeY, typename CoordType = uint16_t> Eta2<T> calculate_eta3(const Cluster<T, ClusterSizeX, ClusterSizeY, CoordType> &cl)
-
template<typename T, typename CoordType = uint16_t>
Eta2<T> aare::calculate_eta3(const Cluster<T, 3, 3, CoordType> &cl)¶ calculates Eta3 for 3x3 cluster It calculates the eta by taking into account all pixels in the 3x3 cluster
Warning
doxygenfunction: Unable to resolve function “aare::calculate_cross_eta3” with arguments (const ClusterVector<Cluster<T, 3, 3, CoordType>>&) in doxygen xml output for project “aare” from directory: /home/runner/work/aare/aare/build/docs/xml. Potential matches:
- template<typename ClusterType, typename = std::enable_if_t<is_cluster_v<ClusterType>>> std::vector<Eta2<typename ClusterType::value_type>> calculate_cross_eta3(const ClusterVector<ClusterType> &clusters)
- template<typename T, typename CoordType = uint16_t> Eta2<T> calculate_cross_eta3(const Cluster<T, 3, 3, CoordType> &cl)
- template<typename T, uint8_t ClusterSizeX, uint8_t ClusterSizeY, typename CoordType = uint16_t> Eta2<T> calculate_cross_eta3(const Cluster<T, ClusterSizeX, ClusterSizeY, CoordType> &cl)
Interpolation class:¶
Warning
Make sure to use the same \(\eta\)-function during interpolation as given by the joint \(\eta\)-distribution passed to the constructor.
-
class Interpolator¶
Public Functions
-
Interpolator(NDView<double, 3> etacube, NDView<double, 1> xbins, NDView<double, 1> ybins, NDView<double, 1> ebins)¶
Constructor for the Interpolator class.
Note
note first dimension is etaX, second etaY, third photon energy
- Parameters:
etacube – joint distribution of etaX, etaY and photon energy
xbins – bin edges for etaX
ybins – bin edges for etaY
ebins – bin edges for photon energy
-
Interpolator(NDView<double, 1> xbins, NDView<double, 1> ybins, NDView<double, 1> ebins)¶
Constructor for the Interpolator class.
- Parameters:
xbins – bin edges for etaX
ybins – bin edges for etaY
ebins – bin edges for photon energy
-
void rosenblatttransform(NDView<double, 3> etacube)¶
transforms the joint eta distribution of etaX and etaY to the two independant uniform distributions based on the Roseblatt transform for each energy level
Note
note first dimension is etaX, second etaY, third photon energy
- Parameters:
etacube – joint distribution of etaX, etaY and photon energy
-
template<auto EtaFunction = calculate_eta2, typename ClusterType, typename Eanble = std::enable_if_t<is_cluster_v<ClusterType>>>
std::vector<Photon> interpolate(const ClusterVector<ClusterType> &clusters)¶ interpolates the cluster centers for all clusters to a better precision
- Template Parameters:
ClusterType – Type of Clusters to interpolate
Etafunction – Function object that calculates desired eta default: calculate_eta2
- Returns:
interpolated photons (photon positions are given as double but following row column format e.g. x=0, y=0 means top row and first column of frame)
Private Functions
-
template<auto EtaFunction, typename ClusterType>
void interpolation_logic(Photon &photon, const double u, const double v, const corner c = corner::cTopLeft)¶ implements underlying interpolation logic based on EtaFunction Type
- Template Parameters:
EtaFunction – Function object that calculates desired eta default:
- Parameters:
u – transformed photon position in x between [0,1]
v – transformed photon position in y between [0,1]
c – corner of eta
-
template<typename T>
std::pair<double, double> bilinear_interpolation(const size_t ix, const size_t iy, const size_t ie, const Eta2<T> &eta)¶ bilinear interpolation of the transformed eta values
- Parameters:
ix – index of etaX bin
iy – index of etaY bin
ie – index of energy bin
- Returns:
pair of interpolated transformed eta values (ietax, ietay)
-
Interpolator(NDView<double, 3> etacube, NDView<double, 1> xbins, NDView<double, 1> ybins, NDView<double, 1> ebins)¶