Commit 7b5a7b19 authored by Daniil Rastorguev's avatar Daniil Rastorguev Committed by Paul Schütze
Browse files

Cosmics: fixed an error in area calculation

parent ee9af807
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -127,9 +127,9 @@ DepositionCosmicsModule::DepositionCosmicsModule(Configuration& config, Messenge
        LOG(DEBUG) << "Calculating subbox length from setup size";
        auto min = geo_manager_->getMinimumCoordinate();
        auto max = geo_manager_->getMaximumCoordinate();
        std::vector<double> max_candidates = {max.x(), max.y(), min.x(), min.y()};
        auto max_abs_coord = *std::max_element(
            begin(max_candidates), end(max_candidates), [](double a, double b) { return std::fabs(a) < std::fabs(b); });
        std::vector<double> max_candidates = {
            std::fabs(max.x()), std::fabs(max.y()), std::fabs(min.x()), std::fabs(min.y())};
        auto max_abs_coord = *std::max_element(begin(max_candidates), end(max_candidates));

        // Round margins up to 10 cm
        auto size_meters = static_cast<double>(std::ceil(Units::convert(2 * max_abs_coord, "m") * 10.0)) / 10.0;