Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-16 09:24:40

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/Definitions/Units.hpp"
0013 #include "Acts/Geometry/GeometryContext.hpp"
0014 #include "Acts/Geometry/LayerArrayCreator.hpp"
0015 #include "Acts/Geometry/LayerCreator.hpp"
0016 #include "Acts/Geometry/TrackingGeometry.hpp"
0017 #include "Acts/Geometry/TrackingVolume.hpp"
0018 #include "Acts/Utilities/Logger.hpp"
0019 #include "ActsTests/CommonHelpers/DetectorElementStub.hpp"
0020 
0021 #include <vector>
0022 
0023 namespace ActsTests {
0024 
0025 struct CylindricalTrackingGeometry {
0026   constexpr static double kBeamPipeRadius = 19. * Acts::UnitConstants::mm;
0027   constexpr static double kBeamPipeHalfLengthZ =
0028       1000. * Acts::UnitConstants::mm;
0029   constexpr static double kBeamPipeThickness = 0.8 * Acts::UnitConstants::mm;
0030 
0031   inline static const std::vector<double> kLayerRadii = {32., 72., 116., 172.};
0032   inline static const std::vector<std::pair<int, int>> kLayerBinning = {
0033       {16, 14}, {32, 14}, {52, 14}, {78, 14}};
0034   inline static const std::vector<double> kModuleTiltPhi = {0.145, 0.145, 0.145,
0035                                                             0.145};
0036   inline static const std::vector<double> kModuleHalfX = {8.4, 8.4, 8.4, 8.4};
0037   inline static const std::vector<double> kModuleHalfY = {36., 36., 36., 36.};
0038   inline static const std::vector<double> kModuleThickness = {0.15, 0.15, 0.15,
0039                                                               0.15};
0040 
0041   std::reference_wrapper<const Acts::GeometryContext> geoContext;
0042   bool gen3 = false;
0043 
0044   /// Only allowed constructor with reference wrapper
0045   explicit CylindricalTrackingGeometry(const Acts::GeometryContext& gctx,
0046                                        bool gen3_ = false)
0047       : geoContext(gctx), gen3(gen3_) {}
0048 
0049   using DetectorStore = std::vector<std::unique_ptr<const DetectorElementStub>>;
0050 
0051   /// The detector store for memory management
0052   DetectorStore detectorStore = {};
0053 
0054   /// Generator of surfaces for a ring
0055   ///
0056   /// @param detStore The DetectorStore for storing the modules
0057   /// @param moduleHalfXminY The half length in X (at Y min) of the module
0058   /// @param moduleHalfXmaxY The half length in X (at Y max) of the module
0059   /// @param moduleHalfY The half length in Y of the module
0060   /// @param moduleThickness The module thickness
0061   /// @param moduleTilt The tilt out of the plane for discs
0062   /// @param ringRadius The central radius of the ring
0063   /// @param ringZ The z position of the ring
0064   /// @param zStagger The z offset of phi modules
0065   /// @param nPhi The number of phi modules
0066   ///
0067   /// @return A vector of Surfaces
0068   std::vector<Acts::Surface*> surfacesRing(
0069       DetectorStore& detStore, double moduleHalfXminY, double moduleHalfXmaxY,
0070       double moduleHalfY, double moduleThickness, double moduleTilt,
0071       double ringRadius, double ringZ, double zStagger, int nPhi);
0072 
0073   /// Generator of surfaces for a cylindrical layer
0074   ///
0075   /// @param detStore The DetectorStore for storing the modules
0076   /// @param moduleHalfX The half length in X of the module
0077   /// @param moduleHalfY The half length in Y of the module
0078   /// @param moduleThickness The module thickness
0079   /// @param moduleTilePhi The tilt in phi direction of the module
0080   /// @param layerRadius The radius of the cylindrical layer
0081   /// @param radialStagger The radial delta of modules next in z
0082   /// @param longitudinalOverlap The z overlap of modules next in z
0083   /// @param binningSchema The number of bins in phi/z
0084   ///
0085   /// @return A vector of Surfaces
0086   std::vector<Acts::Surface*> surfacesCylinder(
0087       DetectorStore& detStore, double moduleHalfX, double moduleHalfY,
0088       double moduleThickness, double moduleTiltPhi, double layerRadius,
0089       double radialStagger, double longitudinalOverlap,
0090       const std::pair<int, int>& binningSchema);
0091 
0092   /// Helper method for cylinder layer
0093   /// create the positions for module surfaces on a cylinder
0094   std::vector<Acts::Vector3> modulePositionsCylinder(
0095       double radius, double zStagger, double moduleHalfLength, double lOverlap,
0096       const std::pair<int, int>& binningSchema);
0097 
0098   // @brief Call operator for the creation method of the tracking geometry
0099   std::shared_ptr<Acts::TrackingGeometry> operator()(
0100       const Acts::Logger& logger = Acts::getDummyLogger());
0101 
0102  private:
0103   std::shared_ptr<Acts::TrackingGeometry> buildGen1(const Acts::Logger& logger);
0104   std::shared_ptr<Acts::TrackingGeometry> buildGen3(const Acts::Logger& logger);
0105 };
0106 
0107 }  // namespace ActsTests