Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-04-30 07:26:10

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