Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:10:55

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/Surfaces/BoundaryTolerance.hpp"
0014 #include "Acts/Utilities/Intersection.hpp"
0015 
0016 #include <any>
0017 #include <cstddef>
0018 #include <vector>
0019 
0020 namespace Acts {
0021 
0022 class Surface;
0023 
0024 namespace Experimental {
0025 
0026 class Portal;
0027 class Detector;
0028 class DetectorVolume;
0029 
0030 /// @brief A navigation state struct that is holding the current navigation information
0031 ///
0032 /// It relies on Surfaces and Portals, all navigation entities have to be
0033 /// described in these terms.
0034 struct NavigationState {
0035   /// @brief  A surface candidate and its intersection
0036   ///
0037   /// A candidates can either be a surface or a portal (which contain a surface)
0038   struct SurfaceCandidate {
0039     /// A candidate intersection, in Surface view
0040     ObjectIntersection<Surface> objectIntersection;
0041     /// A candidate is either a detector Surface
0042     const Surface* surface = nullptr;
0043     /// Or a portal
0044     const Portal* portal = nullptr;
0045     /// The boundary check used for the candidate, boundary checks
0046     /// can differ for sensitive surfaces and portals
0047     BoundaryTolerance boundaryTolerance = BoundaryTolerance::None();
0048   };
0049 
0050   /// Surface candidate vector alias, this allows to use e.g. boost_small vector
0051   /// or other stl like containers
0052   using SurfaceCandidates = std::vector<SurfaceCandidate>;
0053 
0054   /// The current position
0055   Vector3 position = Vector3(0., 0., 0.);
0056 
0057   /// The current direction
0058   Vector3 direction = Vector3(0., 0., 0.);
0059 
0060   /// The current detector in processing
0061   const Detector* currentDetector = nullptr;
0062 
0063   /// The current volume in processing, i.e. the position is inside
0064   const DetectorVolume* currentVolume = nullptr;
0065 
0066   /// The current surface, i.e the position is on surface
0067   const Surface* currentSurface = nullptr;
0068 
0069   /// The current portal, i.e the position is on portal
0070   const Portal* currentPortal = nullptr;
0071 
0072   /// That are the candidate surfaces to process
0073   SurfaceCandidates surfaceCandidates = {};
0074   std::size_t surfaceCandidateIndex = 0;
0075 
0076   /// Boundary directives for surfaces
0077   BoundaryTolerance surfaceBoundaryTolerance = BoundaryTolerance::None();
0078 
0079   /// An overstep tolerance
0080   double overstepTolerance = -100 * UnitConstants::um;
0081 
0082   /// Auxiliary attached information
0083   std::any auxiliary;
0084 
0085   const SurfaceCandidate& surfaceCandidate() const {
0086     return surfaceCandidates.at(surfaceCandidateIndex);
0087   }
0088 };
0089 
0090 }  // namespace Experimental
0091 }  // namespace Acts