Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // This file is part of the Acts project.
0002 //
0003 // Copyright (C) 2023 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/Detector/PortalGenerators.hpp"
0013 #include "Acts/Navigation/InternalNavigation.hpp"
0014 #include "Acts/Navigation/PortalNavigation.hpp"
0015 
0016 #include <map>
0017 #include <memory>
0018 #include <vector>
0019 
0020 namespace Acts {
0021 
0022 class VolumeBounds;
0023 class Surface;
0024 
0025 namespace Experimental {
0026 
0027 class DetectorVolume;
0028 class Portal;
0029 
0030 /// @brief Container to collect root volumes for the
0031 /// construction of a Detector
0032 ///
0033 /// @note each root volume is expected to contain a full
0034 /// search tree for eventually contained sub volumes
0035 ///
0036 /// This struct collects all root volumes that will then
0037 /// be provided to the Detector object
0038 struct RootDetectorVolumes {
0039   /// The list of root volumes
0040   std::vector<std::shared_ptr<DetectorVolume>> volumes = {};
0041   /// The Root volumes finder
0042   ExternalNavigationDelegate volumeFinder;
0043 };
0044 
0045 /// @brief The currently built detector components
0046 /// including the constructed volumes and the current
0047 /// shell/coating, i.e. portals ordered in a map
0048 ///
0049 /// @note the map indices of the shell coating represent
0050 /// their respective index in the portal vector of the
0051 /// VolumeBounds derivative that is described by the given
0052 /// component.
0053 struct DetectorComponent {
0054   /// Define a portal container
0055   using PortalContainer = std::map<unsigned int, std::shared_ptr<Portal>>;
0056   /// The vector of constructed volume(s)
0057   std::vector<std::shared_ptr<DetectorVolume>> volumes = {};
0058   /// The current map of outside portals
0059   PortalContainer portals = {};
0060   /// The root volumes finder
0061   RootDetectorVolumes rootVolumes = {};
0062 };
0063 
0064 /// @brief Holder struct for the external structure components
0065 /// required to construct a detectorVolume
0066 struct ExternalStructure {
0067   /// A 3D transform where the volume should be positioned
0068   Transform3 transform = Transform3::Identity();
0069   /// A shape definition
0070   std::unique_ptr<VolumeBounds> bounds = nullptr;
0071   /// And a portal generator
0072   PortalGenerator portalGenerator;
0073 };
0074 
0075 /// @brief Holder struct for the internal structure components of a DetectorVolume
0076 ///
0077 /// @note the surface surfacesUpdater needs to handle also portal providing
0078 /// of contained volumes.
0079 struct InternalStructure {
0080   /// Contained surfaces of this volume, handled by the surfacesUpdater
0081   std::vector<std::shared_ptr<Surface>> surfaces = {};
0082   /// Contained volumes of this volume, handled by the volumeUpdater
0083   std::vector<std::shared_ptr<DetectorVolume>> volumes = {};
0084   /// Navigation delegate for surfaces
0085   InternalNavigationDelegate surfacesUpdater;
0086   // Navigation delegate for volumes
0087   ExternalNavigationDelegate volumeUpdater;
0088 };
0089 
0090 }  // namespace Experimental
0091 }  // namespace Acts