Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-10-13 08:15:57

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/Utilities/Result.hpp"
0014 
0015 namespace Acts {
0016 
0017 class GeometryContext;
0018 class Surface;
0019 
0020 namespace StripSpacePointBuilder {
0021 
0022 /// @brief Collection of cluster pairing options
0023 struct ClusterPairingOptions final {
0024   /// vertex position
0025   Vector3 vertex = Vector3::Zero();
0026   /// Accepted distance between two clusters
0027   double maxDistance = 100 * UnitConstants::mm;
0028   /// Accepted absolute difference in theta for two clusters
0029   double maxAngleTheta = 1 * UnitConstants::rad;
0030   /// Accepted absolute difference in phi for two clusters
0031   double maxAnglePhi = 1 * UnitConstants::rad;
0032 };
0033 
0034 /// @brief Collection of cosmic space point options
0035 struct CosmicOptions final {
0036   /// Numerical tolerance for the calculation
0037   double tolerance = 1e-6;
0038 };
0039 
0040 /// @brief Collection of constrained space point options
0041 struct ConstrainedOptions final {
0042   /// Position of the vertex
0043   Vector3 vertex = Vector3::Zero();
0044   /// Tolerance scaling factor on the strip detector element length
0045   double stripLengthTolerance = 0.01;
0046   /// Tolerance scaling factor of the gap between strip detector elements
0047   double stripLengthGapTolerance = 0.01;
0048 };
0049 
0050 /// @brief Strip cluster details
0051 struct StripEnds final {
0052   /// Top end of the strip cluster
0053   Vector3 top = Vector3::Zero();
0054   /// Bottom end of the strip cluster
0055   Vector3 bottom = Vector3::Zero();
0056 };
0057 
0058 /// @brief Calculates (Delta theta)^2 + (Delta phi)^2 between two measurements
0059 ///
0060 /// @param globalCluster1 Global position of the measurements on the first strip
0061 /// @param globalCluster2 Global position of the measurements on the second strip
0062 /// @param options Pairing options
0063 ///
0064 /// @return If available, squared sum within configuration parameters
0065 Result<double> computeClusterPairDistance(const Vector3& globalCluster1,
0066                                           const Vector3& globalCluster2,
0067                                           const ClusterPairingOptions& options);
0068 
0069 /// @param stripEnds1 The ends of first strip
0070 /// @param stripEnds2 The ends of second strip
0071 /// @param options The cosmic options
0072 ///
0073 /// @return If available, the calculated space point
0074 Result<Vector3> computeCosmicSpacePoint(const StripEnds& stripEnds1,
0075                                         const StripEnds& stripEnds2,
0076                                         const CosmicOptions& options);
0077 
0078 /// @param stripEnds1 The ends of first strip
0079 /// @param stripEnds2 The ends of second strip
0080 /// @param options The constrained options
0081 ///
0082 /// @return If available, the calculated space point
0083 Result<Vector3> computeConstrainedSpacePoint(const StripEnds& stripEnds1,
0084                                              const StripEnds& stripEnds2,
0085                                              const ConstrainedOptions& options);
0086 
0087 /// @brief Calculate the z and r covariance from the front and back SourceLink in the strip SP formation
0088 ///
0089 /// @param gctx The current geometry context object, e.g. alignment
0090 /// @param surface1 The surface of the first strip
0091 /// @param spacePoint The space point
0092 /// @param localCov1 Local covariance of the first strip
0093 /// @param localCov2 Local covariance of the second strip
0094 /// @param theta The angle between the two strips
0095 ///
0096 /// @return (z, r) components of the global covariance
0097 Vector2 computeVarianceZR(const GeometryContext& gctx, const Surface& surface1,
0098                           const Vector3& spacePoint, double localCov1,
0099                           double localCov2, double theta);
0100 
0101 }  // namespace StripSpacePointBuilder
0102 
0103 }  // namespace Acts