Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-07-26 08:21:59

0001 /** TRACCC library, part of the ACTS project (R&D line)
0002  *
0003  * (c) 2023-2026 CERN for the benefit of the ACTS project
0004  *
0005  * Mozilla Public License Version 2.0
0006  */
0007 
0008 #pragma once
0009 
0010 // traccc include(s).
0011 #include "traccc/definitions/common.hpp"
0012 #include "traccc/definitions/primitives.hpp"
0013 #include "traccc/finding/measurement_selector.hpp"
0014 #include "traccc/fitting/fitting_config.hpp"
0015 #include "traccc/utils/particle.hpp"
0016 
0017 // detray include(s).
0018 #include <detray/propagator/propagation_config.hpp>
0019 
0020 // System include(s)
0021 #include <iostream>
0022 
0023 namespace traccc {
0024 
0025 /// Indicate the type of track state candidate collection
0026 enum class smoother_type : std::uint_least8_t {
0027   e_none,
0028   e_mbf,
0029   e_kalman,
0030   e_unknown,
0031 };
0032 
0033 TRACCC_HOST inline std::ostream &operator<<(std::ostream &os,
0034                                             smoother_type st) {
0035   using enum smoother_type;
0036   switch (st) {
0037     case e_none:
0038       os << "none";
0039       break;
0040     case e_mbf:
0041       os << "MBF";
0042       break;
0043     case e_kalman:
0044       os << "Kalman";
0045       break;
0046     default:
0047       os << "unknown";
0048   }
0049   return os;
0050 }
0051 
0052 TRACCC_HOST inline std::istream &operator>>(std::istream &is,
0053                                             smoother_type &st) {
0054   using enum smoother_type;
0055   std::string tmp_str;
0056   is >> tmp_str;
0057   if (tmp_str == "none") {
0058     st = e_none;
0059   } else if (tmp_str == "MBF") {
0060     st = e_mbf;
0061   } else if (tmp_str == "Kalman") {
0062     st = e_kalman;
0063   } else {
0064     st = e_unknown;
0065   }
0066   return is;
0067 }
0068 
0069 /// Configuration struct for track finding
0070 struct finding_config {
0071   /// Maxmimum number of branches per seed
0072   unsigned int max_num_branches_per_seed = 10;
0073 
0074   /// Maximum number of branches per surface
0075   unsigned int max_num_branches_per_surface = 1;
0076 
0077   /// Min/Max number of track candidates per track
0078   unsigned int min_track_candidates_per_track = 3;
0079   unsigned int max_track_candidates_per_track = 100;
0080 
0081   /// Maximum allowed number of skipped steps per candidate
0082   unsigned int max_num_skipping_per_cand = 3;
0083 
0084   /// Maximum number of consecutive holes
0085   unsigned int max_num_consecutive_skipped = 1;
0086 
0087   /// Maximum number of tracks per measurement; if zero, don't prune
0088   unsigned int max_num_tracks_per_measurement = 0;
0089 
0090   /// If `max_num_tracks_per_measurement` is enabled, i.e. if it is non-zero
0091   /// then this value determines the minimum fraction of measurements in
0092   /// each track that vote for it
0093   float min_measurement_voting_fraction = 0.5f;
0094 
0095   /// Run the progressive Kalman filter (PKF) for track finding if branching
0096   /// is turned off
0097   bool run_pkf = false;
0098   /// The type of smoother to be run in track finding
0099   smoother_type run_smoother = smoother_type::e_mbf;
0100 
0101   /// Minimum step length that track should make to reach the next surface. It
0102   /// should be set higher than the overstep tolerance not to make it stay on
0103   /// the same surface
0104   float min_step_length_for_next_surface = 1.2f * traccc::unit<float>::mm;
0105   /// Maximum step counts that track can make to reach the next surface
0106   unsigned int max_step_counts_for_next_surface = 100;
0107 
0108   /// Maximum Chi-square that is allowed for branching
0109   float chi2_max = 30.f;
0110 
0111   /// Propagation configuration
0112   detray::propagation::config propagation{};
0113   /// Measurement calibration configuration
0114   measurement_selector::config meas_calibration{};
0115   // Fitting config for the Kalman smoother
0116   traccc::fitting_config kalman_smoother;
0117 
0118   /// Minimum momentum for reconstructed tracks
0119   float min_p = 100.f * traccc::unit<float>::MeV;
0120   float min_pT = 600.f * traccc::unit<float>::MeV;
0121 
0122   /// Particle hypothesis
0123   traccc::pdg_particle<traccc::scalar> ptc_hypothesis =
0124       traccc::pion_plus<traccc::scalar>();
0125 
0126   /// Minimum track length in order for a track to be a candidate for
0127   /// duplicate removal.
0128   ///
0129   /// @warning This parameter should be greater than or equal to 3 under all
0130   /// circumstances!
0131   unsigned int duplicate_removal_minimum_length = 5u;
0132 
0133   /// @name Performance parameters
0134   /// These parameters impact only compute performance; any case in which a
0135   /// change in these parameters effects a change in _physics_ performance
0136   /// should be considered a bug.
0137   /// @{
0138   /// @brief The number of links to reserve space for, per seed.
0139   ///
0140   /// This parameter describes the number of links which we reserve per seed.
0141   /// If this number turns out to be too low, the track finding algorithm
0142   /// will automatically resize it, but this comes at the cost of
0143   /// performance.
0144   ///
0145   /// @note This parameter affects GPU-based track finding only.
0146   unsigned int initial_links_per_seed = 100;
0147   /// @}
0148 };
0149 
0150 }  // namespace traccc