Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/Acts/Seeding/SeedFilter.hpp was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 // This file is part of the Acts project.
0002 //
0003 // Copyright (C) 2023 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/EventData/SpacePointData.hpp"
0012 #include "Acts/Seeding/CandidatesForMiddleSp.hpp"
0013 #include "Acts/Seeding/IExperimentCuts.hpp"
0014 #include "Acts/Seeding/InternalSeed.hpp"
0015 #include "Acts/Seeding/Seed.hpp"
0016 #include "Acts/Seeding/SeedFilterConfig.hpp"
0017 
0018 #include <memory>
0019 #include <mutex>
0020 #include <queue>
0021 #include <tuple>
0022 #include <vector>
0023 
0024 namespace Acts {
0025 struct SeedFilterState {
0026   // longitudinal impact parameter as defined by bottom and middle space point
0027   float zOrigin = 0;
0028   // number of minimum top SPs in seed confirmation
0029   std::size_t nTopSeedConf = 0;
0030   // radius of bottom component of seed that is used to define the number of
0031   // compatible top required
0032   float rMaxSeedConf =
0033       std::numeric_limits<float>::max();  // Acts::UnitConstants::mm
0034   // number of high quality seeds in seed confirmation
0035   std::size_t numQualitySeeds = 0;
0036   // number of seeds that did not pass the quality confirmation but were still
0037   // accepted, if quality confirmation is not used this is the total number of
0038   // seeds
0039   std::size_t numSeeds = 0;
0040 };
0041 
0042 /// Filter seeds at various stages with the currently
0043 /// available information.
0044 template <typename external_spacepoint_t>
0045 class SeedFilter {
0046  public:
0047   SeedFilter(SeedFilterConfig config,
0048              IExperimentCuts<external_spacepoint_t>* expCuts = nullptr);
0049 
0050   SeedFilter() = delete;
0051   virtual ~SeedFilter() = default;
0052 
0053   /// Create InternalSeeds for the all seeds with the same bottom and middle
0054   /// space point and discard all others.
0055   /// @param spacePointData Auxiliary variables used by the seeding
0056   /// @param bottomSP fixed bottom space point
0057   /// @param middleSP fixed middle space point
0058   /// @param topSpVec vector containing all space points that may be compatible
0059   ///                 with both bottom and middle space point
0060   /// @param invHelixDiameterVec vector containing 1/(2*r) values where r is the helix radius
0061   /// @param impactParametersVec vector containing the impact parameters
0062   /// @param seedFilterState holds quantities used in seed filter
0063   /// @param candidates_collector container for the seed candidates
0064   virtual void filterSeeds_2SpFixed(
0065       Acts::SpacePointData& spacePointData,
0066       const InternalSpacePoint<external_spacepoint_t>& bottomSP,
0067       const InternalSpacePoint<external_spacepoint_t>& middleSP,
0068       const std::vector<const InternalSpacePoint<external_spacepoint_t>*>&
0069           topSpVec,
0070       const std::vector<float>& invHelixDiameterVec,
0071       const std::vector<float>& impactParametersVec,
0072       SeedFilterState& seedFilterState,
0073       CandidatesForMiddleSp<const InternalSpacePoint<external_spacepoint_t>>&
0074           candidates_collector) const;
0075 
0076   /// Filter seeds once all seeds for one middle space point have been created
0077   /// @param spacePointData Auxiliary variables used by the seeding
0078   /// @param candidates_collector collection of seed candidates
0079   /// @param numQualitySeeds number of high quality seeds in seed confirmation
0080   /// @param outIt Output iterator for the seeds
0081   /// for all seeds with the same middle space point
0082   virtual void filterSeeds_1SpFixed(
0083       Acts::SpacePointData& spacePointData,
0084       CandidatesForMiddleSp<const InternalSpacePoint<external_spacepoint_t>>&
0085           candidates_collector,
0086       const std::size_t numQualitySeeds,
0087       std::back_insert_iterator<std::vector<Seed<external_spacepoint_t>>> outIt)
0088       const;
0089 
0090   /// Filter seeds once all seeds for one middle space point have been created
0091   /// @param spacePointData Auxiliary variables used by the seeding
0092   /// @param candidates collection of seed candidates
0093   /// @param numQualitySeeds number of high quality seeds in seed confirmation
0094   /// @param outIt Output iterator for the seeds
0095   /// for all seeds with the same middle space point
0096   virtual void filterSeeds_1SpFixed(
0097       Acts::SpacePointData& spacePointData,
0098       std::vector<typename CandidatesForMiddleSp<
0099           const InternalSpacePoint<external_spacepoint_t>>::value_type>&
0100           candidates,
0101       const std::size_t numQualitySeeds,
0102       std::back_insert_iterator<std::vector<Seed<external_spacepoint_t>>> outIt)
0103       const;
0104 
0105   const SeedFilterConfig getSeedFilterConfig() const { return m_cfg; }
0106   const IExperimentCuts<external_spacepoint_t>* getExperimentCuts() const {
0107     return m_experimentCuts;
0108   }
0109 
0110  private:
0111   const SeedFilterConfig m_cfg;
0112   const IExperimentCuts<external_spacepoint_t>* m_experimentCuts;
0113 };
0114 }  // namespace Acts
0115 #include "Acts/Seeding/SeedFilter.ipp"