Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-08-28 08:11:38

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::Experimental {
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     DoubletsForMiddleSp bottomDoublets;
0030     DoubletsForMiddleSp topDoublets;
0031 
0032     std::vector<DoubletsForMiddleSp::IndexAndCotTheta> sortedBottoms;
0033     std::vector<DoubletsForMiddleSp::IndexAndCotTheta> sortedTops;
0034 
0035     TripletTopCandidates tripletTopCandidates;
0036   };
0037 
0038   explicit TripletSeeder(std::unique_ptr<const Logger> logger =
0039                              getDefaultLogger("TripletSeeder",
0040                                               Logging::Level::INFO));
0041 
0042   /// Create all possible seeds from bottom, middle, and top space points.
0043   ///
0044   /// @param cache Cache object to store intermediate results
0045   /// @param bottomFinder Finder for bottom doublets
0046   /// @param topFinder Finder for top doublets
0047   /// @param tripletFinder Finder for triplet space points
0048   /// @param filter Triplet seed filter that defines the filtering criteria
0049   /// @param spacePoints Space point container
0050   /// @param bottomSps Subset of space points to be used as innermost SP in a seed
0051   /// @param middleSp Space point candidate to be used as middle SP in a seed
0052   /// @param topSps Subset of space points to be used as outermost SP in a seed
0053   /// @param outputSeeds Output container for the seeds
0054   void createSeedsFromGroup(Cache& cache, const DoubletSeedFinder& bottomFinder,
0055                             const DoubletSeedFinder& topFinder,
0056                             const TripletSeedFinder& tripletFinder,
0057                             const ITripletSeedFilter& filter,
0058                             const SpacePointContainer2& spacePoints,
0059                             SpacePointContainer2::ConstSubset& bottomSps,
0060                             const ConstSpacePointProxy2& middleSp,
0061                             SpacePointContainer2::ConstSubset& topSps,
0062                             SeedContainer2& outputSeeds) const;
0063 
0064   /// Create all possible seeds from bottom, middle, and top space points.
0065   ///
0066   /// @param cache Cache object to store intermediate results
0067   /// @param bottomFinder Finder for bottom doublets
0068   /// @param topFinder Finder for top doublets
0069   /// @param tripletFinder Finder for triplet space points
0070   /// @param filter Triplet seed filter that defines the filtering criteria
0071   /// @param spacePoints Space point container
0072   /// @param bottomSpGroups Groups of space points to be used as innermost SP in a seed
0073   /// @param middleSpGroup Group of space points to be used as middle SP in a seed
0074   /// @param topSpGroups Groups of space points to be used as outermost SP in a seed
0075   /// @param radiusRangeForMiddle Range of radii for the middle space points
0076   /// @param outputSeeds Output container for the seeds
0077   void createSeedsFromGroups(
0078       Cache& cache, const DoubletSeedFinder& bottomFinder,
0079       const DoubletSeedFinder& topFinder,
0080       const TripletSeedFinder& tripletFinder, const ITripletSeedFilter& filter,
0081       const SpacePointContainer2& spacePoints,
0082       const std::span<SpacePointContainer2::ConstRange>& bottomSpGroups,
0083       const SpacePointContainer2::ConstRange& middleSpGroup,
0084       const std::span<SpacePointContainer2::ConstRange>& topSpGroups,
0085       const std::pair<float, float>& radiusRangeForMiddle,
0086       SeedContainer2& outputSeeds) const;
0087 
0088  private:
0089   std::unique_ptr<const Logger> m_logger;
0090 
0091   const Logger& logger() const { return *m_logger; }
0092 };
0093 
0094 }  // namespace Acts::Experimental