Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-11-05 08:53:43

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/Definitions/Algebra.hpp"
0012 #include "Acts/Geometry/GeometryContext.hpp"
0013 #include "Acts/Geometry/ITrackingVolumeArrayCreator.hpp"
0014 #include "Acts/Utilities/AxisDefinitions.hpp"
0015 #include "Acts/Utilities/Logger.hpp"
0016 
0017 #include <memory>
0018 #include <utility>
0019 
0020 namespace Acts {
0021 
0022 /// A pair associating a tracking volume with its position vector.
0023 /// @note Used for ordering tracking volumes in a spatial array.
0024 using TrackingVolumeOrderPosition = std::pair<TrackingVolumePtr, Vector3>;
0025 
0026 ///@class TrackingVolumeArrayCreator
0027 ///
0028 /// The TrackingVolumeArrayCreator is a simple Tool that helps to construct
0029 /// binned arrays of TrackingVolumes for both, confinement in another volume
0030 /// and navigation issues.
0031 ///
0032 class TrackingVolumeArrayCreator : public ITrackingVolumeArrayCreator {
0033  public:
0034   /// @brief This struct stores the configuration of the tracking geometry
0035   struct Config {};
0036 
0037   /// Constructor
0038   ///
0039   /// @param logger logging instance
0040   explicit TrackingVolumeArrayCreator(const Config& /*cfg*/,
0041                                       std::unique_ptr<const Logger> logger =
0042                                           getDefaultLogger("LayerArrayCreator",
0043                                                            Logging::INFO))
0044       : m_logger(std::move(logger)) {}
0045 
0046   /// create a tracking volume array
0047   ///
0048   /// @param [in] gctx the geometry context for this building
0049   /// @param [in] tVolumes is the vector of TrackingVolumes to be
0050   /// @param [in] aDir is the axis direction
0051   ///
0052   /// @return new created volume array
0053   std::shared_ptr<const TrackingVolumeArray> trackingVolumeArray(
0054       const GeometryContext& gctx, const TrackingVolumeVector& tVolumes,
0055       AxisDirection aDir) const override;
0056 
0057   /// Set logging instance
0058   ///
0059   /// @param logger is the logging instance to be set
0060   void setLogger(std::unique_ptr<const Logger> logger) {
0061     m_logger = std::move(logger);
0062   }
0063 
0064  private:
0065   // Private access to the logger method
0066   const Logger& logger() const { return *m_logger; }
0067 
0068   /// logging instance
0069   std::unique_ptr<const Logger> m_logger;
0070 };
0071 }  // namespace Acts