Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-19 09:23:23

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