Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:27:49

0001 // This file is part of the Acts project.
0002 //
0003 // Copyright (C) 2020 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 http://mozilla.org/MPL/2.0/.
0008 
0009 #pragma once
0010 
0011 #include "Acts/Definitions/Units.hpp"
0012 #include "Acts/Seeding/SeedConfirmationRangeConfig.hpp"
0013 
0014 #include <cstddef>
0015 #include <cstdint>
0016 #include <stdexcept>
0017 
0018 namespace Acts {
0019 
0020 /// @brief Structure that holds configuration parameters for the seed filter algorithm
0021 struct SeedFilterConfig {
0022   /// Allowed difference in curvature (inverted seed radii) between two
0023   /// compatible seeds
0024   float deltaInvHelixDiameter = 0.00003 * 1. / Acts::UnitConstants::mm;
0025   /// Minimum distance between compatible outer space-points to be considered.
0026   /// This is used to avoid counting space-points from the same layer
0027   float deltaRMin = 5. * Acts::UnitConstants::mm;
0028   /// Seed weight/score is increased by this value if a compatible seed has been
0029   /// found. This is the c1 factor in the seed score calculation (w = c1 * Nt -
0030   /// c2 * d0 - c3 * z0)
0031   float compatSeedWeight = 200.;
0032   /// The transverse impact parameters (d0) is multiplied by this factor and
0033   /// subtracted from weight. This is the c2 factor in the seed score
0034   /// calculation (w = c1 * Nt - c2 * d0 - c3 * z0)
0035   float impactWeightFactor = 1.;
0036   /// The logitudinal impact parameters (z0) is multiplied by this factor and
0037   /// subtracted from weight. This is the c3 factor in the seed score
0038   /// calculation (w = c1 * Nt - c2 * d0 - c3 * z0)
0039   float zOriginWeightFactor = 1.;
0040   /// Maximum number (minus one) of accepted seeds per middle space-point
0041   /// In dense environments many seeds may be found per middle space-point
0042   /// Only seeds with the highest weight will be kept if this limit is reached
0043   unsigned int maxSeedsPerSpM = 10;
0044   /// Maximum limit to number of compatible space-point used in score
0045   /// calculation. We increase by c1 the weight calculation for each compatible
0046   /// space-point until we reach compatSeedLimit
0047   std::size_t compatSeedLimit = 2;
0048 
0049   /// Increment in seed weight if the number of compatible seeds is larger than
0050   /// numSeedIncrement, this is used in case of high occupancy scenarios if we
0051   /// want to increase the weight of the seed by seedWeightIncrement when the
0052   /// number of compatible seeds is higher than a certain value
0053   float seedWeightIncrement = 0;
0054   float numSeedIncrement = std::numeric_limits<float>::infinity();
0055 
0056   /// Seeding parameters used for quality seed confirmation
0057 
0058   /// Enable quality seed confirmation, this is different than default seeding
0059   /// confirmation because it can also be defined for different (r, z) regions
0060   /// of the detector (e.g. forward or central region) by SeedConfirmationRange.
0061   /// Seeds are classified as "high-quality" seeds and normal quality seeds.
0062   /// Normal quality seeds are only selected if no other "high-quality" seed
0063   /// has been found for that inner-middle doublet.
0064   bool seedConfirmation = false;
0065   /// Contains parameters for central seed confirmation
0066   SeedConfirmationRangeConfig centralSeedConfirmationRange;
0067   /// Contains parameters for forward seed confirmation
0068   SeedConfirmationRangeConfig forwardSeedConfirmationRange;
0069 
0070   /// If seedConfirmation is true we classify seeds as "high-quality" seeds.
0071   /// Seeds that are not confirmed as "high-quality" are only selected if no
0072   /// other "high-quality" seed has been found for that inner-middle doublet
0073   /// Maximum number of normal seeds (not classified as "high-quality" seeds)
0074   /// in seed confirmation
0075   std::size_t maxSeedsPerSpMConf = std::numeric_limits<std::size_t>::max();
0076   /// Maximum number of "high-quality" seeds for each inner-middle SP-dublet in
0077   /// seed confirmation. If the limit is reached we check if there is a normal
0078   /// quality seed to be replaced
0079   std::size_t maxQualitySeedsPerSpMConf =
0080       std::numeric_limits<std::size_t>::max();
0081 
0082   /// Other parameters
0083 
0084   /// Use deltaR between top and middle SP instead of top radius to search for
0085   /// compatible SPs
0086   bool useDeltaRorTopRadius = false;
0087 
0088   bool isInInternalUnits = false;
0089   SeedFilterConfig toInternalUnits() const {
0090     if (isInInternalUnits) {
0091       throw std::runtime_error(
0092           "Repeated conversion to internal units for SeedFilterConfig");
0093     }
0094     using namespace Acts::UnitLiterals;
0095     SeedFilterConfig config = *this;
0096     config.isInInternalUnits = true;
0097     config.deltaRMin /= 1_mm;
0098     config.deltaInvHelixDiameter /= 1. / 1_mm;
0099 
0100     return config;
0101   }
0102 };
0103 
0104 }  // namespace Acts