Back to home page

EIC code displayed by LXR

 
 

    


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

0001 /** TRACCC library, part of the ACTS project (R&D line)
0002  *
0003  * (c) 2021-2025 CERN for the benefit of the ACTS project
0004  *
0005  * Mozilla Public License Version 2.0
0006  */
0007 
0008 #pragma once
0009 
0010 // Local include(s).
0011 #include <traccc/edm/seed_collection.hpp>
0012 #include <traccc/edm/spacepoint_collection.hpp>
0013 
0014 namespace traccc {
0015 /**
0016  * @brief Seed of arbitrary size.
0017  *
0018  * This type represents a set of at least three and at most N spacepoints which
0019  * are presumed to belong to a single track.
0020  *
0021  * @tparam N The maximum capacity of the seed.
0022  */
0023 template <std::size_t N>
0024 struct nseed {
0025   /*
0026    * Enforce the minimum seed size of three.
0027    */
0028   static_assert(N >= 3, "Seeds must contain at least three spacepoints.");
0029 
0030   /*
0031    * Should be the same as the three-seed type.
0032    */
0033   using link_type = edm::spacepoint_collection::host::size_type;
0034 
0035   /**
0036    * @brief Construct a new n-seed object from a 3-seed object.
0037    *
0038    * @param s A 3-seed.
0039    */
0040   template <typename T>
0041   nseed(const edm::seed<T>& s)
0042       : _size(3), _sps({s.bottom_index(), s.middle_index(), s.top_index()}) {}
0043 
0044   /**
0045    * @brief Get the size of the seed.
0046    */
0047   std::size_t size() const { return _size; }
0048 
0049   /**
0050    * @brief Get the first space point identifier in the seed.
0051    */
0052   const link_type* cbegin() const { return &_sps[0]; }
0053 
0054   /**
0055    * @brief Get the one-after-last space point identifier in the seed.
0056    */
0057   const link_type* cend() const { return &_sps[_size]; }
0058 
0059  private:
0060   std::size_t _size;
0061   std::array<link_type, N> _sps;
0062 };
0063 }  // namespace traccc