Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:27:43

0001 // This file is part of the Acts project.
0002 //
0003 // Copyright (C) 2021 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/Geometry/GeometryContext.hpp"
0012 #include "Acts/Plugins/TGeo/ITGeoDetectorElementSplitter.hpp"
0013 #include "Acts/Utilities/Logger.hpp"
0014 
0015 #include <memory>
0016 #include <vector>
0017 
0018 class TGeoNode;
0019 
0020 namespace Acts {
0021 
0022 class TGeoDetectorElement;
0023 
0024 /// @brief TGeoCylinderDiscSplitter
0025 ///
0026 /// Split Cylinder and disks into submodules
0027 class TGeoCylinderDiscSplitter : public ITGeoDetectorElementSplitter {
0028  public:
0029   /// Nested configuration struct
0030   struct Config {
0031     /// Number of segments in phi for a disc
0032     int cylinderPhiSegments = -1;
0033     /// Number of segments in r for a disk
0034     int cylinderLongitudinalSegments = -1;
0035 
0036     /// Number of segments in phi for a disc
0037     int discPhiSegments = -1;
0038     /// Number of segments in r for a disk
0039     int discRadialSegments = -1;
0040   };
0041 
0042   /// Constructor
0043   ///
0044   /// @param cfg the configuration struct
0045   /// @param logger the logging object
0046   TGeoCylinderDiscSplitter(
0047       const Config& cfg,
0048       std::unique_ptr<const Acts::Logger> logger = Acts::getDefaultLogger(
0049           "TGeoCylinderDiscSplitter", Acts::Logging::INFO));
0050 
0051   ~TGeoCylinderDiscSplitter() override = default;
0052 
0053   /// Take a geometry context and TGeoElement and split it into sub elements
0054   ///
0055   /// @param gctx is a geometry context object
0056   /// @param tgde is a TGeoDetectorElement that is eventually split
0057   ///
0058   /// @note If no split is performed the unsplit detector element is returned
0059   ///
0060   /// @return a vector of TGeoDetectorElement objects
0061   std::vector<std::shared_ptr<const Acts::TGeoDetectorElement>> split(
0062       const GeometryContext& gctx,
0063       std::shared_ptr<const Acts::TGeoDetectorElement> tgde) const override;
0064 
0065  private:
0066   Config m_cfg;
0067 
0068   /// Private access to the logger
0069   const Acts::Logger& logger() const { return *m_logger; }
0070 
0071   /// Logging instance
0072   std::unique_ptr<const Acts::Logger> m_logger;
0073 };
0074 
0075 }  // namespace Acts