Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /acts/Core/include/Acts/Geometry/LinearVolumeLookup.hpp was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 // This file is part of the ACTS project.
0002 //
0003 // Copyright (C) 2016 CERN for the benefit of the ACTS project
0004 //
0005 // This Source Code Form is subject to the terms of the Mozilla Public
0006 // License, v. 2.0. If a copy of the MPL was not distributed with this
0007 // file, You can obtain one at https://mozilla.org/MPL/2.0/.
0008 
0009 #pragma once
0010 
0011 #include "Acts/Geometry/IVolumeLookup.hpp"
0012 #include "Acts/Utilities/Logger.hpp"
0013 
0014 #include <cstddef>
0015 #include <optional>
0016 
0017 namespace Acts {
0018 /// Linearly scans children and recursively descends into the selected child.
0019 class LinearVolumeLookup final : public IVolumeLookup {
0020  public:
0021   /// Construction settings.
0022   struct Config {
0023     /// Warn above this sibling count within the scanned subtree.
0024     /// std::nullopt disables warnings; zero warns for any children.
0025     std::optional<std::size_t> warningThreshold = 64;
0026   };
0027 
0028   /// Construct a lookup and diagnose a finalized subtree.
0029   /// @param world Root of the scanned subtree
0030   /// @param config Construction settings
0031   /// @param logger Construction diagnostics
0032   LinearVolumeLookup(const TrackingVolume& world, const Config& config,
0033                      const Logger& logger = getDummyLogger());
0034 
0035   /// Return construction settings, including the warning threshold.
0036   /// @return Construction settings
0037   const Config& config() const;
0038 
0039   /// @copydoc IVolumeLookup::findLowest
0040   const TrackingVolume* findLowest(const GeometryContext& gctx,
0041                                    const Vector3& position,
0042                                    double tolerance) const override;
0043 
0044  private:
0045   void warnIfNeeded(const Logger& logger) const;
0046 
0047   const TrackingVolume& m_root;
0048   Config m_config;
0049 };
0050 }  // namespace Acts