Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-10-13 08:18:30

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 "ActsTests/CommonHelpers/DetectorElementStub.hpp"
0019 
0020 #include <vector>
0021 
0022 namespace ActsTests {
0023 
0024 struct CylindricalTrackingGeometry {
0025   constexpr static double kBeamPipeRadius = 19. * Acts::UnitConstants::mm;
0026   constexpr static double kBeamPipeHalfLengthZ =
0027       1000. * Acts::UnitConstants::mm;
0028   constexpr static double kBeamPipeThickness = 0.8 * Acts::UnitConstants::mm;
0029 
0030   inline static const std::vector<double> kLayerRadii = {32., 72., 116., 172.};
0031   inline static const std::vector<std::pair<int, int>> kLayerBinning = {
0032       {16, 14}, {32, 14}, {52, 14}, {78, 14}};
0033   inline static const std::vector<double> kModuleTiltPhi = {0.145, 0.145, 0.145,
0034                                                             0.145};
0035   inline static const std::vector<double> kModuleHalfX = {8.4, 8.4, 8.4, 8.4};
0036   inline static const std::vector<double> kModuleHalfY = {36., 36., 36., 36.};
0037   inline static const std::vector<double> kModuleThickness = {0.15, 0.15, 0.15,
0038                                                               0.15};
0039 
0040   std::reference_wrapper<const Acts::GeometryContext> geoContext;
0041   bool gen3 = false;
0042 
0043   /// Only allowed constructor with reference wrapper
0044   explicit CylindricalTrackingGeometry(const Acts::GeometryContext& gctx,
0045                                        bool gen3_ = false)
0046       : geoContext(gctx), gen3(gen3_) {}
0047 
0048   using DetectorStore =
0049       std::vector<std::unique_ptr<const ActsTests::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 
0101  private:
0102   std::shared_ptr<Acts::TrackingGeometry> buildGen1();
0103   std::shared_ptr<Acts::TrackingGeometry> buildGen3();
0104 };
0105 
0106 }  // namespace ActsTests