mirror of
https://github.com/slsdetectorgroup/aare.git
synced 2026-02-19 17:18:43 +01:00
Dev/automate tests using data (#267)
- automatically run python tests - automatically run test using data files on local runner from gitea - fixed some of the workflows --------- Co-authored-by: Erik Fröjdh <erik.frojdh@psi.ch>
This commit is contained in:
@@ -193,6 +193,7 @@ Interpolator::interpolate(const ClusterVector<ClusterType> &clusters) const {
|
||||
std::vector<Photon> photons;
|
||||
photons.reserve(clusters.size());
|
||||
|
||||
size_t cluster_index{};
|
||||
for (const ClusterType &cluster : clusters) {
|
||||
|
||||
auto eta = EtaFunction(cluster);
|
||||
@@ -202,6 +203,14 @@ Interpolator::interpolate(const ClusterVector<ClusterType> &clusters) const {
|
||||
photon.y = cluster.y;
|
||||
photon.energy = static_cast<decltype(photon.energy)>(eta.sum);
|
||||
|
||||
try {
|
||||
// check if eta values are within bounds
|
||||
transform_eta_values(eta);
|
||||
} catch (const std::runtime_error &e) {
|
||||
throw std::runtime_error(
|
||||
fmt::format("{} for cluster: {}", e.what(), cluster_index));
|
||||
}
|
||||
|
||||
auto uniform_coordinates = transform_eta_values(eta);
|
||||
|
||||
if (EtaFunction == &calculate_eta2<typename ClusterType::value_type,
|
||||
@@ -245,6 +254,8 @@ Interpolator::interpolate(const ClusterVector<ClusterType> &clusters) const {
|
||||
photon.y += uniform_coordinates.y;
|
||||
}
|
||||
|
||||
++cluster_index;
|
||||
|
||||
photons.push_back(photon);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user