Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-14 09:20:37

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/Geometry/GeometryContext.hpp"
0013 #include "Acts/Geometry/IReferenceGenerator.hpp"
0014 #include "Acts/Geometry/Polyhedron.hpp"
0015 #include "Acts/Surfaces/Surface.hpp"
0016 #include "Acts/Utilities/AxisDefinitions.hpp"
0017 
0018 #include <ranges>
0019 #include <vector>
0020 
0021 namespace Acts {
0022 
0023 /// A struct to access the center position as a sole reference
0024 ///
0025 /// This generator will provide only one filling point and hence
0026 /// only a single bin in the indexed grid.
0027 struct CenterReferenceGenerator : public IReferenceGenerator {
0028   /// Helper to access the Center point of for filling the grid
0029   ///
0030   /// @param gctx the geometry context of this operation
0031   /// @param surface the surface for which the reference point is to be accessed
0032   ///
0033   /// @return a vector of reference points for filling
0034   const std::vector<Vector3> references(const GeometryContext& gctx,
0035                                         const Surface& surface) const override {
0036     return {surface.center(gctx)};
0037   }
0038 };
0039 
0040 /// A struct to access reference positions based on bin values
0041 ///
0042 /// @tparam bVAL the binning value to be used for the binning position call
0043 ///
0044 /// This generator will provide only one filling point and hence
0045 /// only a single bin in the indexed grid.
0046 template <AxisDirection bVAL>
0047 struct AxisDirectionReferenceGenerator : public IReferenceGenerator {
0048   /// Helper to access a reference position based on binning value
0049   ///
0050   /// @param gctx the geometry context of this operation
0051   /// @param surface the surface for which the reference point is to be accessed
0052   ///
0053   /// @return a vector of reference points for filling
0054   const std::vector<Vector3> references(const GeometryContext& gctx,
0055                                         const Surface& surface) const override {
0056     return {surface.referencePosition(gctx, bVAL)};
0057   }
0058 };
0059 
0060 /// A struct to access generated vertices from surface polyhedrons
0061 /// These vertices are then used to find the bin boundary box for the
0062 /// indexed grid.
0063 ///
0064 ///
0065 /// The grid filling then completes the empty bins in between and
0066 /// expands if necessary.
0067 struct PolyhedronReferenceGenerator : public IReferenceGenerator {
0068   /// This is for the barycenter addition
0069   bool addBarycenter = false;
0070 
0071   /// @brief  The number of segments for the polyhedron approximation
0072   int nSegements = 1;
0073 
0074   /// Absolute expansion value for the reference points
0075   double expansionValue = 0.0;
0076 
0077   /// Helper to access the Center point of for filling the grid
0078   ///
0079   /// @param gctx the geometry context of this operation
0080   /// @param surface the surface for which the reference point is to be accessed
0081   ///
0082   /// @return a vector of reference points for filling
0083   const std::vector<Vector3> references(const GeometryContext& gctx,
0084                                         const Surface& surface) const override;
0085 };
0086 
0087 /// A Projected reference generator which projects the polyhedron vertices onto
0088 /// a given reference surface.
0089 ///
0090 struct ProjectedReferenceGenerator : public IReferenceGenerator {
0091   /// The reference surface onto which to project
0092   std::shared_ptr<Surface> referenceSurface = nullptr;
0093 
0094   /// @brief  The number of segments for the polyhedron approximation
0095   int nSegements = 1;
0096 
0097   /// Absolute expansion value for the reference points
0098   double expansionValue = 0.0;
0099 
0100   /// Luminous region sampling points for the projection - beam spot
0101   std::vector<Vector3> luminousRegion = {Vector3(0., 0., -200.),
0102                                          Vector3(0., 0., 200.0)};
0103 
0104   /// Helper to access the Center point of for filling the grid
0105   ///
0106   /// @param gctx the geometry context of this operation
0107   /// @param surface the surface for which the reference point is to be accessed
0108   ///
0109   /// @return a vector of reference points for filling
0110   const std::vector<Vector3> references(const GeometryContext& gctx,
0111                                         const Surface& surface) const override;
0112 };
0113 
0114 }  // namespace Acts