Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-13 09:39:04

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/EventData/SeedContainer2.hpp"
0012 #include "Acts/EventData/SpacePointContainer2.hpp"
0013 #include "Acts/Seeding2/DoubletSeedFinder.hpp"
0014 #include "Acts/Seeding2/ITripletSeedFilter.hpp"
0015 #include "Acts/Seeding2/TripletSeedFinder.hpp"
0016 #include "Acts/Utilities/Logger.hpp"
0017 
0018 #include <vector>
0019 
0020 namespace Acts {
0021 
0022 /// Full triplet seeder which depends on a doublet and triplet seed finder, and
0023 /// a triplet seed filter.
0024 class TripletSeeder {
0025  public:
0026   /// Cache for storing intermediate results during triplet seeding to avoid
0027   /// reallocation.
0028   struct Cache {
0029     /// Cache for bottom doublets associated with middle space points
0030     DoubletsForMiddleSp bottomDoublets;
0031     /// Cache for top doublets associated with middle space points
0032     DoubletsForMiddleSp topDoublets;
0033 
0034     /// Sorted container of bottom doublet indices with cotangent theta values
0035     std::vector<DoubletsForMiddleSp::IndexAndCotTheta> sortedBottoms;
0036     /// Sorted container of top doublet indices with cotangent theta values
0037     std::vector<DoubletsForMiddleSp::IndexAndCotTheta> sortedTops;
0038 
0039     /// Cache for triplet top candidates during seed formation
0040     TripletTopCandidates tripletTopCandidates;
0041   };
0042 
0043   /// Construct a TripletSeeder with optional logger.
0044   /// @param logger Logger instance for debug output (defaults to INFO level)
0045   explicit TripletSeeder(std::unique_ptr<const Logger> logger =
0046                              getDefaultLogger("TripletSeeder",
0047                                               Logging::Level::INFO));
0048 
0049   /// Create all possible seeds from bottom, middle, and top space points.
0050   ///
0051   /// @param cache Cache object to store intermediate results
0052   /// @param bottomFinder Finder for bottom doublets
0053   /// @param topFinder Finder for top doublets
0054   /// @param tripletFinder Finder for triplet space points
0055   /// @param filter Triplet seed filter that defines the filtering criteria
0056   /// @param spacePoints Space point container
0057   /// @param bottomSps Subset of space points to be used as innermost SP in a seed
0058   /// @param middleSp Space point candidate to be used as middle SP in a seed
0059   /// @param topSps Subset of space points to be used as outermost SP in a seed
0060   /// @param outputSeeds Output container for the seeds
0061   void createSeedsFromGroup(Cache& cache, const DoubletSeedFinder& bottomFinder,
0062                             const DoubletSeedFinder& topFinder,
0063                             const TripletSeedFinder& tripletFinder,
0064                             const ITripletSeedFilter& filter,
0065                             const SpacePointContainer2& spacePoints,
0066                             SpacePointContainer2::ConstSubset& bottomSps,
0067                             const ConstSpacePointProxy2& middleSp,
0068                             SpacePointContainer2::ConstSubset& topSps,
0069                             SeedContainer2& outputSeeds) const;
0070 
0071   /// Create all possible seeds from bottom, middle, and top space points.
0072   ///
0073   /// @param cache Cache object to store intermediate results
0074   /// @param bottomFinder Finder for bottom doublets
0075   /// @param topFinder Finder for top doublets
0076   /// @param tripletFinder Finder for triplet space points
0077   /// @param filter Triplet seed filter that defines the filtering criteria
0078   /// @param spacePoints Space point container
0079   /// @param bottomSpGroups Groups of space points to be used as innermost SP in a seed
0080   /// @param middleSpGroup Group of space points to be used as middle SP in a seed
0081   /// @param topSpGroups Groups of space points to be used as outermost SP in a seed
0082   /// @param radiusRangeForMiddle Range of radii for the middle space points
0083   /// @param outputSeeds Output container for the seeds
0084   void createSeedsFromGroups(
0085       Cache& cache, const DoubletSeedFinder& bottomFinder,
0086       const DoubletSeedFinder& topFinder,
0087       const TripletSeedFinder& tripletFinder, const ITripletSeedFilter& filter,
0088       const SpacePointContainer2& spacePoints,
0089       const std::span<SpacePointContainer2::ConstRange>& bottomSpGroups,
0090       const SpacePointContainer2::ConstRange& middleSpGroup,
0091       const std::span<SpacePointContainer2::ConstRange>& topSpGroups,
0092       const std::pair<float, float>& radiusRangeForMiddle,
0093       SeedContainer2& outputSeeds) const;
0094 
0095  private:
0096   std::unique_ptr<const Logger> m_logger;
0097 
0098   const Logger& logger() const { return *m_logger; }
0099 };
0100 
0101 }  // namespace Acts