Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-10-30 07:53:48

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/Units.hpp"
0012 #include "Acts/Material/Interactions.hpp"
0013 #include "Acts/Seeding/SeedConfirmationRangeConfig.hpp"
0014 #include "Acts/Utilities/Delegate.hpp"
0015 
0016 #include <cmath>
0017 #include <memory>
0018 #include <numbers>
0019 
0020 namespace Acts {
0021 
0022 // forward declaration to avoid cyclic dependence
0023 template <typename T>
0024 class SeedFilter;
0025 
0026 /// @brief Structure that holds configuration parameters for the orthogonal seed finder algorithm
0027 template <typename SpacePoint>
0028 struct SeedFinderOrthogonalConfig {
0029   /// Shared pointer to the seed filter for quality assessment
0030   std::shared_ptr<Acts::SeedFilter<SpacePoint>> seedFilter;
0031 
0032   /// Seeding parameters for geometry settings and detector ROI
0033 
0034   // Limiting location of all measurements
0035   float phiMin = -std::numbers::pi_v<float>;
0036   /// Maximum phi angle for space-point selection
0037   float phiMax = std::numbers::pi_v<float>;
0038   /// limiting location of measurements
0039   float zMin = -2800 * Acts::UnitConstants::mm;
0040   /// Maximum z coordinate for space-point selection
0041   float zMax = 2800 * Acts::UnitConstants::mm;
0042   /// Maximum radius for space-point selection
0043   float rMax = 600 * Acts::UnitConstants::mm;
0044   /// @warning If rMin is smaller than impactMax, the bin size will be 2*pi,
0045   /// which will make seeding very slow!
0046   float rMin = 33 * Acts::UnitConstants::mm;
0047 
0048   /// Seeding parameters used to define the region of interest for middle
0049   /// space-point
0050 
0051   /// Radial range for middle space-point
0052   /// The range can be defined manually with (rMinMiddle, rMaxMiddle). If
0053   /// useVariableMiddleSPRange is set to false and the vector rRangeMiddleSP is
0054   /// empty, we use (rMinMiddle, rMaxMiddle) to cut the middle space-points
0055   float rMinMiddle = 60.f * Acts::UnitConstants::mm;
0056   /// Maximum radius for middle space-point selection
0057   float rMaxMiddle = 120.f * Acts::UnitConstants::mm;
0058   /// If useVariableMiddleSPRange is set to false, the vector rRangeMiddleSP can
0059   /// be used to define a fixed r range for each z bin: {{rMin, rMax}, ...}
0060   bool useVariableMiddleSPRange = true;
0061   /// Range defined in vector for each z bin
0062   std::vector<std::vector<float>> rRangeMiddleSP;
0063   /// If useVariableMiddleSPRange is true, the radial range will be calculated
0064   /// based on the maximum and minimum r values of the space-points in the event
0065   /// and a deltaR (deltaRMiddleMinSPRange, deltaRMiddleMaxSPRange)
0066   float deltaRMiddleMinSPRange = 10. * Acts::UnitConstants::mm;
0067   /// Maximum delta R for variable middle SP range calculation
0068   float deltaRMiddleMaxSPRange = 10. * Acts::UnitConstants::mm;
0069 
0070   /// Vector containing minimum and maximum z boundaries for cutting middle
0071   /// space-points
0072   std::pair<float, float> zOutermostLayers{-2700 * Acts::UnitConstants::mm,
0073                                            2700 * Acts::UnitConstants::mm};
0074 
0075   /// Seeding parameters used to define the cuts on space-point doublets
0076 
0077   /// Minimum radial distance between middle-outer doublet components
0078   float deltaRMinTopSP = std::numeric_limits<float>::quiet_NaN();
0079   /// Maximum radial distance between middle-outer doublet components
0080   float deltaRMaxTopSP = std::numeric_limits<float>::quiet_NaN();
0081   /// Minimum radial distance between inner-middle doublet components
0082   float deltaRMinBottomSP = std::numeric_limits<float>::quiet_NaN();
0083   /// Maximum radial distance between inner-middle doublet components
0084   float deltaRMaxBottomSP = std::numeric_limits<float>::quiet_NaN();
0085 
0086   /// Shrink the phi range of middle space-point (analogous to phi bin size in
0087   /// grid from default seeding + number of phi bins used in search)
0088   float deltaPhiMax = 0.085;
0089 
0090   /// Maximum value of z-distance between space-points in doublet
0091   float deltaZMax =
0092       std::numeric_limits<float>::infinity() * Acts::UnitConstants::mm;
0093 
0094   /// Maximum allowed cotTheta between two space-points in doublet, used to
0095   /// check if forward angle is within bounds
0096   float cotThetaMax = 10.01788;  // equivalent to eta = 3 (pseudorapidity)
0097 
0098   /// Limiting location of collision region in z-axis used to check if doublet
0099   /// origin is within reasonable bounds
0100   float collisionRegionMin = -150 * Acts::UnitConstants::mm;
0101   /// Maximum z extent of collision region for doublet validation
0102   float collisionRegionMax = +150 * Acts::UnitConstants::mm;
0103 
0104   /// Enable cut on the compatibility between interaction point and doublet,
0105   /// this is an useful approximation to speed up the seeding
0106   bool interactionPointCut = false;
0107 
0108   /// Seeding parameters used to define the cuts on space-point triplets
0109 
0110   /// Minimum transverse momentum (pT) used to check the r-z slope compatibility
0111   /// of triplets with maximum multiple scattering effect (produced by the
0112   /// minimum allowed pT particle) + a certain uncertainty term. Check the
0113   /// documentation for more information
0114   /// https://acts.readthedocs.io/en/latest/core/reconstruction/pattern_recognition/seeding.html
0115   float minPt = 400. * Acts::UnitConstants::MeV;
0116   /// Number of sigmas of scattering angle to be considered in the minimum pT
0117   /// scattering term
0118   float sigmaScattering = 5;
0119   /// Term that accounts for the thickness of scattering medium in radiation
0120   /// lengths in the Lynch & Dahl correction to the Highland equation default is
0121   /// 5%
0122   /// TODO: necessary to make amount of material dependent on detector region?
0123   float radLengthPerSeed = 0.05;
0124   /// Maximum transverse momentum for scattering calculation
0125   float maxPtScattering = 10 * Acts::UnitConstants::GeV;
0126   /// Maximum value of impact parameter estimation of the seed candidates
0127   float impactMax = 20. * Acts::UnitConstants::mm;
0128   /// Parameter which can loosen the tolerance of the track seed to form a
0129   /// helix. This is useful for e.g. misaligned seeding.
0130   float helixCutTolerance = 1.;
0131 
0132   /// Seeding parameters used for quality seed confirmation
0133 
0134   /// Enable quality seed confirmation, this is different than default seeding
0135   /// confirmation because it can also be defined for different (r, z) regions
0136   /// of the detector (e.g. forward or central region) by SeedConfirmationRange.
0137   /// Seeds are classified as "high-quality" seeds and normal quality seeds.
0138   /// Normal quality seeds are only selected if no other "high-quality" seeds
0139   /// has been found for that inner-middle doublet.
0140   bool seedConfirmation = false;
0141   /// Contains parameters for central seed confirmation
0142   SeedConfirmationRangeConfig centralSeedConfirmationRange;
0143   /// Contains parameters for forward seed confirmation
0144   SeedConfirmationRangeConfig forwardSeedConfirmationRange;
0145   /// Maximum number (minus one) of accepted seeds per middle space-point
0146   unsigned int maxSeedsPerSpM = 5;
0147 
0148   /// Other parameters
0149 
0150   /// derived values, set on SeedFinder construction
0151   float highland = 0;
0152   /// Squared maximum scattering angle for track validation
0153   float maxScatteringAngle2 = 0;
0154 
0155   /// Delegate to apply experiment specific cuts during seeding
0156   Delegate<bool(float /*bottomRadius*/, float /*cotTheta*/)> experimentCuts{
0157       DelegateFuncTag<&noopExperimentCuts>{}};
0158 
0159   /// defaults experimental cuts to no operation in both seeding algorithms
0160   /// @return Always returns true (no cuts applied)
0161   static bool noopExperimentCuts(float /*bottomRadius*/, float /*cotTheta*/) {
0162     return true;
0163   }
0164 
0165   /// Flag indicating whether configuration uses ACTS internal units
0166   bool isInInternalUnits = true;
0167 
0168   /// Convert to internal units (deprecated, already in internal units)
0169   /// @return Copy of this configuration (already in internal units)
0170   //[[deprecated("SeedFinderOrthogonalConfig uses internal units")]]
0171   SeedFinderOrthogonalConfig toInternalUnits() const { return *this; }
0172 
0173   /// Calculate derived quantities from the basic configuration parameters
0174   /// @return New configuration with derived quantities calculated
0175   SeedFinderOrthogonalConfig calculateDerivedQuantities() const {
0176     SeedFinderOrthogonalConfig config = *this;
0177     config.highland = approximateHighlandScattering(config.radLengthPerSeed);
0178     config.maxScatteringAngle2 = std::pow(config.highland / config.minPt, 2);
0179     return config;
0180   }
0181 };
0182 
0183 }  // namespace Acts