Commit 3fa55dac authored by Håkan Wennlöf's avatar Håkan Wennlöf
Browse files

Updated to use fancy structured bindings, and Units::display

parent d5199b7b
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -376,8 +376,8 @@ namespace allpix {
         * @return True if position within the pixel grid, false otherwise
         */
        bool isWithinMatrix(const ROOT::Math::XYZPoint& position) const {
            std::pair<int, int> pixelIndex = getPixelIndex(position);
            return isWithinMatrix(pixelIndex.first, pixelIndex.second);
            auto [index_x, index_y] = getPixelIndex(position);
            return isWithinMatrix(index_x, index_y);
        }

        /**
+3 −3
Original line number Diff line number Diff line
@@ -556,9 +556,9 @@ void DetectorHistogrammerModule::run(Event* event) {

        // Check whether the particle position is in the sensor excess, and exclude it from the efficiency calculation if so
        if(!model->isWithinMatrix(particlePos)) {
            LOG(DEBUG) << "Particle at local coordinates x = " << particlePos.x() << " mm"
                       << ", y = " << particlePos.y() << " mm, pixel index (" << model->getPixelIndex(particlePos).first
                       << "," << model->getPixelIndex(particlePos).second
            LOG(DEBUG) << "Particle at local coordinates x = " << Units::display(particlePos.x(), {"mm", "um"})
                       << ", y = " << Units::display(particlePos.y(), {"mm", "um"}) << ", pixel index ("
                       << model->getPixelIndex(particlePos).first << "," << model->getPixelIndex(particlePos).second
                       << "), hit in the sensor excess; removing from efficiency calculation.";
            continue;
        }