Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2026-07-16 08:07:36

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/CompositeSpacePoint.hpp"
0012 #include "Acts/Seeding/detail/CompSpacePointAuxiliaries.hpp"
0013 #include "Acts/Utilities/CalibrationContext.hpp"
0014 #include "Acts/Utilities/Delegate.hpp"
0015 
0016 namespace Acts::Experimental {
0017 namespace detail {
0018 /// @brief Concept for a utility class to fill the space points from
0019 ///        one container to another. The filler is templated over the
0020 ///        SpacePoint type from the uncalibrated source container over
0021 ///        the target space point container type, which may differ
0022 ///        The filler is responsible for the conversion between the two
0023 ///        space point formats and to apply a re-calibation if needed
0024 template <typename SeedFiller_t, typename UnCalibSp_t, typename CalibCont_t>
0025 concept CompositeSpacePointSeedFiller =
0026     CompositeSpacePoint<UnCalibSp_t> &&
0027     CompositeSpacePointContainer<CalibCont_t> &&
0028     requires(const SeedFiller_t& filler, const CalibrationContext& cctx,
0029              const Vector3& pos, const Vector3& dir, const double t0,
0030              const UnCalibSp_t& testSp, CalibCont_t& seedContainer,
0031              const std::size_t lowerLayer, const std::size_t upperLayer) {
0032       /// @brief Utility function to choose the good straw space points
0033       ///        for seeding
0034       /// @param testSp: Reference to the straw-type measurement to test
0035       { filler.goodCandidate(testSp) } -> std::same_as<bool>;
0036       /// @brief Calculates the pull of the space point w.r.t. to the
0037       ///        candidate seed line. To improve the pull's precision
0038       ///        the function may call the calibrator in the backend
0039       /// @param cctx: Reference to the calibration context to pipe
0040       ///              the hook for conditions access to the caller
0041       /// @param pos: Position of the cancidate seed line
0042       /// @param dir: Direction of the candidate seed line
0043       /// @param t0: Offse in the time of arrival of the particle
0044       /// @param testSp: Reference to the straw space point to test
0045       {
0046         filler.candidateChi2(cctx, pos, dir, t0, testSp)
0047       } -> std::same_as<double>;
0048       /// @brief Returns the radius of the straw tube in which the space point
0049       ///        is recorded
0050       /// @param testSp: Reference to the straw space point
0051       { filler.strawRadius(testSp) } -> std::same_as<double>;
0052       /// @brief Creates a new empty container to construct a new segment seed
0053       /// @param cctx: Calibration context in case that the container shall be
0054       ///              part of a predefined memory block
0055       { filler.newContainer(cctx) } -> std::same_as<CalibCont_t>;
0056       /// @brief Appends the candidate candidate space point to the segment
0057       ///        seed container & optionally calibrates the parameters
0058       /// @param cctx: Reference to the calibration context to pipe
0059       ///              the hook for conditions access to the caller
0060       /// @param pos: Position of the cancidate seed line
0061       /// @param dir: Direction of the candidate seed line
0062       /// @param t0: Offse in the time of arrival of the particle
0063       /// @param testSp: Reference to the straw space point to test
0064       /// @param seedContainer: Reference to the target container to
0065       ///                       which the space point is appended to
0066       {
0067         filler.append(cctx, pos, dir, t0, testSp, seedContainer)
0068       } -> std::same_as<void>;
0069       /// @brief Helper method to send a stop signal to the line seeder, if for instance,
0070       ///        the two layers are too close to each other. The method is
0071       ///        called after every layer update. If true is returned no seeds
0072       ///        are produced further
0073       /// @param lowerLayer: Index of the current lower straw layer
0074       /// @param upperLayer: Index of the current upper straw layer
0075       { filler.stopSeeding(lowerLayer, upperLayer) } -> std::same_as<bool>;
0076     };
0077 /// @brief Define the concept of the space point measurement sorter. The sorter shall take a collection
0078 ///         of station space points and split them into straw && strip hits.
0079 ///         Hits
0080 /// from each category are then subdivided further into the particular detector
0081 /// layers.
0082 ///
0083 ///      A possible implementation of the CompositeSpacePointSorter needs to
0084 ///      have
0085 /// the following attributes
0086 ///
0087 ///      using SpVec_t =  Standard container satisfiyng the
0088 ///                       CompositeSpacePointContainer concept
0089 ///
0090 ///      const std::vector<SpVec_t>& strawHits();
0091 ///      const std::vector<SpVec_t>& stripHits();
0092 ///  Each SpVec_t contains all measurements from a particular detector layer
0093 template <typename Splitter_t, typename SpacePointCont_t>
0094 concept CompositeSpacePointSorter =
0095     CompositeSpacePointContainer<SpacePointCont_t> &&
0096     requires(const Splitter_t& sorter) {
0097       /// @brief Return the straw-hit space point sorted by straw layer
0098       {
0099         sorter.strawHits()
0100       } -> std::same_as<const std::vector<SpacePointCont_t>&>;
0101       /// @brief Return the strip-hit  space points sorted by detector layer
0102       {
0103         sorter.stripHits()
0104       } -> std::same_as<const std::vector<SpacePointCont_t>&>;
0105     };
0106 
0107 /// @brief Concept of the interface for the auxiliary class such that the
0108 ///        CompositeSpacePointLineSeeder can construct segment seeds
0109 template <typename SeedAuxiliary_t, typename UnCalibCont_t,
0110           typename CalibCont_t>
0111 concept CompSpacePointSeederDelegate =
0112     CompositeSpacePointSeedFiller<
0113         SeedAuxiliary_t, RemovePointer_t<typename UnCalibCont_t::value_type>,
0114         CalibCont_t> &&
0115     CompositeSpacePointSorter<SeedAuxiliary_t, UnCalibCont_t>;
0116 
0117 }  // namespace detail
0118 
0119 /// @brief Initial line parameters from a pattern recognition like
0120 ///        the Hough transform are often not suitable for a line fit
0121 ///        as the resolution of the hough bins usually exceeds the size
0122 ///        of the straws.
0123 ///        The CompositeSpacePointLineSeeder refines the parameters
0124 ///        and the selected measurements such that both become
0125 ///        candidates for a stright line fit. The user needs to
0126 ///        split the straw measurements per logical straw layer.
0127 ///        Further, the interface needs to provide some auxiliary
0128 ///        methods to interact with an empty space point container
0129 ///        & to calculate a calbrated candidate pull.
0130 ///        From these ingredients, the `CompositeSpacePointLineSeeder`
0131 ///        iterates from the outermost layers at both ends and tries
0132 ///        to construct new candidates. Tangent lines are constructed
0133 ///        to a pair of circles from each seeding layer and then straw
0134 ///        measurements from the other layers are tried to be added
0135 ///        onto the line. If the number of straws exceed the threshold,
0136 ///        compatible strip measurements from each strip layer are added.
0137 class CompositeSpacePointLineSeeder {
0138  public:
0139   /// @brief Use the assignment of the parameter indices from the CompSpacePointAuxiliaries
0140   using ParIdx = detail::CompSpacePointAuxiliaries::FitParIndex;
0141   /// @brief Use the assignment of the parameter indices from the CompSpacePointAuxiliaries
0142   using CovIdx = detail::CompSpacePointAuxiliaries::ResidualIdx;
0143   /// @brief Use the vector from the CompSpacePointAuxiliaires
0144   using Vector = detail::CompSpacePointAuxiliaries::Vector;
0145   /// @brief Vector containing the 5 straight segment line parameters
0146   using SeedParam_t = std::array<double, toUnderlying(ParIdx::nPars)>;
0147   /// @brief Abrivation of the straight line. The first element is the
0148   ///        reference position and the second element is the direction
0149   using Line_t = std::pair<Vector, Vector>;
0150 
0151   /// @brief Configuration of the cuts to sort out generated
0152   ///        seeds with poor quality.
0153   struct Config {
0154     /// @brief Cut on the theta angle
0155     std::array<double, 2> thetaRange{0., 0.};
0156     /// @brief Cut on the intercept range
0157     std::array<double, 2> interceptRange{0., 0.};
0158     /// @brief Upper cut on the hit chi2 w.r.t. seed in order to be associated to the seed
0159     double hitPullCut{5.};
0160     /// @brief How many drift circles may be on a layer to be used for seeding
0161     std::size_t busyLayerLimit{2};
0162     /// @brief Layers may contain measurements with bad hits and hence the
0163     bool busyLimitCountGood{true};
0164     /// @brief Try at the first time the external seed parameters as candidate
0165     bool startWithPattern{false};
0166     /// @brief Use explicitly the line distance and the driftRadius to calculate
0167     ///        the pull from the seed line to the space point.
0168     bool useSimpleStrawPull{true};
0169     /// @brief How many drift circle hits needs the seed to contain in order to be valid
0170     std::size_t nStrawHitCut{3};
0171     /// @brief Hit cut based on the fraction of collected tube layers.
0172     ///        The seed must pass the tighter of the two requirements.
0173     double nStrawLayHitCut{2. / 3.};
0174     /// @brief Once a seed with even more than initially required hits is found,
0175     ///        reject all following seeds with less hits
0176     bool tightenHitCut{true};
0177     /// @brief Check whether a new seed candidate shares the same left-right solution with already accepted ones
0178     ///          Reject the seed if it has the same amount of hits
0179     bool overlapCorridor{true};
0180   };
0181   /// @brief Class constructor
0182   /// @param cfg Reference to the seeder configuration object
0183   /// @param logger Logger object used for debug print out
0184   explicit CompositeSpacePointLineSeeder(
0185       const Config& cfg,
0186       std::unique_ptr<const Logger> logger = getDefaultLogger(
0187           "CompositeSpacePointLineSeeder", Logging::Level::INFO));
0188   /// @brief Return the configuration object of the seeder
0189   const Config& config() const { return m_cfg; }
0190 
0191   /// @brief Enumeration to pick one of the four tangent lines to
0192   ///       the straw circle pair.
0193   enum class TangentAmbi : std::uint8_t {
0194     RR = 0,  //< Both circles are on the right side
0195     RL = 1,  //< The top circle is on the right and the bottom circle on the
0196              // left < side
0197     LR = 2,  //< The top circle is  on the left and the bottom circle on the
0198              //< right side
0199     LL = 3,  //< Both circles are on the left side
0200   };
0201 
0202   /// @brief Helper struct describing the line parameters that are
0203   ///        tangential to a pair of straw measurements
0204   struct TwoCircleTangentPars {
0205     /// @brief Estimated angle
0206     double theta{0.};
0207     /// @brief Estimated intercept
0208     double y0{0.};
0209     /// @brief Uncertainty on the angle
0210     double dTheta{0.};
0211     /// @brief Uncertainty on the intercept
0212     double dY0{0.};
0213     /// @brief Flag indicating which solution is constructed
0214     TangentAmbi ambi{TangentAmbi::LL};
0215     /// @brief Default destructor
0216     virtual ~TwoCircleTangentPars() = default;
0217 
0218     /// @brief Definition of the print operator
0219     /// @param ostr: Mutable reference to the stream to print to
0220     /// @param pars: The parameters to be printed
0221     friend std::ostream& operator<<(std::ostream& ostr,
0222                                     const TwoCircleTangentPars& pars) {
0223       pars.print(ostr);
0224       return ostr;
0225     }
0226 
0227    protected:
0228     /// @brief Actual implementation of the printing
0229     /// @param ostr: Mutable reference to the stream to print to
0230     virtual void print(std::ostream& ostr) const;
0231   };
0232 
0233   /// @brief Converts the line tangent ambiguity into a string
0234   static std::string toString(const TangentAmbi ambi);
0235   /// @brief Translate the combination of two drift signs into the proper
0236   ///        tangent ambiguity enum value
0237   /// @param signTop: Left/right sign of the top straw tube
0238   /// @param signBottom: Left/right sign of the bottom straw tube
0239   static TangentAmbi encodeAmbiguity(const int signTop, const int signBottom);
0240   /// @brief Construct the line that is tangential to a pair of two straw circle measurements
0241   /// @param topHit: First straw hit
0242   /// @param bottomHit: Second straw hit
0243   /// @param ambi: Left right ambiguity of the bottom & top hit
0244   template <CompositeSpacePoint Sp_t>
0245   static TwoCircleTangentPars constructTangentLine(const Sp_t& topHit,
0246                                                    const Sp_t& bottomHit,
0247                                                    const TangentAmbi ambi);
0248   /// @brief Creates the direction vector from the reference hit used to
0249   ///        construct the tangent seed and the result on theta
0250   /// @param refHit: Reference hit to define the local axes (Bottom hit)
0251   /// @param tanAngle: Theta value from the TwoCircleTangentPars
0252   template <CompositeSpacePoint Spt_t>
0253   static Vector makeDirection(const Spt_t& refHit, const double tanAngle);
0254 
0255  private:
0256   /// @brief Cache object of a constructed & valid seed solution.
0257   ///        It basically consists out of the generated parameters.
0258   ///        the straw hits contributing to the seed & the left/right
0259   ///        ambiguities given the parameters of the solutions.
0260   ///        To avoid the copy of the memory, the hits are encoded as a
0261   ///        pair of indices representing the straw layer & hit number.
0262   template <CompositeSpacePointContainer UnCalibCont_t,
0263             detail::CompositeSpacePointSorter<UnCalibCont_t> Splitter_t>
0264   struct SeedSolution : public TwoCircleTangentPars {
0265     /// @brief Constructor taking the constructed tangential parameters &
0266     ///        the pointer to the splitter to associate the hits to the seed
0267     /// @param pars: Theta & intercept describing the tangential line
0268     /// @param layerSorter: Pointer to the sorter object carrying a sorted
0269     ///                     collection of hits that are split per logical layer
0270     explicit SeedSolution(const TwoCircleTangentPars& pars,
0271                           const Splitter_t& layerSorter)
0272         : TwoCircleTangentPars{pars}, m_splitter{layerSorter} {}
0273 
0274     /// @brief Abrivation of the underlying space point reference
0275     using SpacePoint_t = ConstDeRef_t<typename UnCalibCont_t::value_type>;
0276     /// @brief Helper function to calculate the straw signs of the seed hits
0277     ///        cached by this solution w.r.t. an external line
0278     /// @param seedPos: Reference point of the segment line
0279     /// @param seedDir: Direction of the segment line
0280     std::vector<int> leftRightAmbiguity(const Vector& seedPos,
0281                                         const Vector3& seedDir) const;
0282 
0283     /// @brief Returns the number of hits cached by the seed
0284     std::size_t size() const { return m_seedHits.size(); }
0285     /// @brief Returns the i-th seed hit
0286     /// @param idx: Index of the hit to to return
0287     SpacePoint_t getHit(const std::size_t idx) const;
0288     /// @brief Appends a new seed hit to the solution
0289     void append(const std::size_t layIdx, const std::size_t hitIdx);
0290     /// @brief Vector of the associate left-rignt ambiguities
0291     std::vector<int> solutionSigns{};
0292     ///@brief Number of good straw measurements
0293     std::size_t nStrawHits{0ul};
0294 
0295    private:
0296     /// @brief Pointer to the space point per layer splitter to gain access to the
0297     ///        input space point container
0298     const Splitter_t& m_splitter;
0299     /// @brief Set of hits collected onto the seed. For each element
0300     ///        the first index represents the layer &
0301     ///        the second one the particular hit in that layer
0302     std::vector<std::pair<std::size_t, std::size_t>> m_seedHits{};
0303     /// @brief Prints the seed solution to the screen
0304     /// @param ostr: Mutable reference to the stream to print to
0305     void print(std::ostream& ostr) const final;
0306   };
0307 
0308  public:
0309   /// @brief Helper struct to pack the parameters and the associated
0310   ///        measurements into a common object. Returned by the
0311   ///        central nextSeed method (cf. below)
0312   template <CompositeSpacePointContainer contType_t>
0313   struct SegmentSeed {
0314     /// @brief Constructor taking the seed parameters &&
0315     ///        a new hit container
0316     /// @param _pars: The seed line parameter
0317     /// @param _hits  A new empty container to be filled
0318     explicit SegmentSeed(SeedParam_t _pars, contType_t&& _hits) noexcept
0319         : parameters{_pars}, hits{std::move(_hits)} {}
0320     /// @brief Seed line parameters
0321     SeedParam_t parameters;
0322     /// @brief Collection of hits
0323     contType_t hits;
0324   };
0325 
0326   /// @brief Central auxiliary struct to steer the seeding process.
0327   ///        First, the user needs to implement the experiment specific
0328   ///        CompSpacePointSeederDelegate over which the template of the
0329   ///        SeedingState is then specified. The base class provides the
0330   ///        straw hits split per logical layer and the SeedingState holds
0331   ///        the indices to select iteratively a straw measurement each
0332   ///        from the first and last layer. Also it keeps track of the
0333   ///        previously constructed seeds.
0334   template <CompositeSpacePointContainer UncalibCont_t,
0335             CompositeSpacePointContainer CalibCont_t,
0336             detail::CompSpacePointSeederDelegate<UncalibCont_t, CalibCont_t>
0337                 Delegate_t>
0338   struct SeedingState : public Delegate_t {
0339     /// @brief Declare the public constructor by explicitly forwarding the
0340     ///        constructor arguments to the (protected) base class constructor
0341     /// @param initialPars: Initial parameters from an external pattern seed
0342     ///                     (Needed to combine the precision parameters with a
0343     ///                     non-precision estimate)
0344     /// @param args: Arguments to be forwarded to the base class constructor
0345     template <typename... args_t>
0346     explicit SeedingState(const SeedParam_t& initialPars, args_t&&... args)
0347         : Delegate_t{std::forward<args_t>(args)...},
0348           m_initialPars{initialPars} {}
0349     /// @brief Stringstream output operator
0350     friend std::ostream& operator<<(std::ostream& ostr,
0351                                     const SeedingState& opts) {
0352       opts.print(ostr);
0353       return ostr;
0354     }
0355     /// @brief Return the number of generated seeds
0356     std::size_t nGenSeeds() const { return m_seenSolutions.size(); }
0357     /// @brief Returns the pattern parameters
0358     const SeedParam_t& initialParameters() const { return m_initialPars; }
0359     /// @brief Grant the embedding class access to the private members
0360     friend CompositeSpacePointLineSeeder;
0361 
0362    private:
0363     /// @brief List of straw measurement already constructed straw measurement seeds
0364     std::vector<SeedSolution<UncalibCont_t, Delegate_t>> m_seenSolutions{};
0365     /// @brief  @brief Index of the upper layer under consideration for the seeding
0366     std::optional<std::size_t> m_upperLayer{std::nullopt};
0367     /// @brief Index of the lower layer under consideration for the seeding
0368     std::optional<std::size_t> m_lowerLayer{std::nullopt};
0369     /// @brief  Index of the hit in the lower layer under consideration for the seeding
0370     std::size_t m_lowerHitIndex{0ul};
0371     /// @brief  Index of the hit in the upper layer under consideration for the seeding
0372     std::size_t m_upperHitIndex{0ul};
0373     /// @brief  Index of the sign combination under consideration for the seeding
0374     std::size_t m_signComboIndex{0ul};
0375     /// @brief Number of minimum straw hits a seed must have
0376     std::size_t m_nStrawCut{0ul};
0377     /// @brief Flag toggling whether the upper of the lower layer shall be moved
0378     bool m_moveUpLayer{true};
0379     /// @brief Flag toggling whether the pattern parameters shall be returned as
0380     ///        first seed
0381     bool m_patternSeedProduced{false};
0382     /// @brief Prints the seed solution to the screen
0383     void print(std::ostream& ostr) const;
0384     /// @brief Estimated parameters from pattern
0385     SeedParam_t m_initialPars{};
0386   };
0387   /// @brief Main interface method provided by the SeederClass. The user instantiates
0388   ///        a SeedingState object containing all the straw hit candidates from
0389   ///        which the seed shall be constructed. Then, the nextSeed() returns
0390   ///        the next best seed candidate which can then be fitted. The user
0391   ///        continues to call the method until a nullopt is returned.
0392   /// @param cctx: Experiment specific calibration context to be piped back to the
0393   ///              caller such that the space points may be calibrated during
0394   ///              the seeding process.
0395   /// @param state: Mutable reference to the SeedingState object from which all the
0396   ///               segment seeds are constructed.
0397   template <CompositeSpacePointContainer UncalibCont_t,
0398             CompositeSpacePointContainer CalibCont_t,
0399             detail::CompSpacePointSeederDelegate<UncalibCont_t, CalibCont_t>
0400                 Delegate_t>
0401   std::optional<SegmentSeed<CalibCont_t>> nextSeed(
0402       const CalibrationContext& cctx,
0403       SeedingState<UncalibCont_t, CalibCont_t, Delegate_t>& state) const;
0404 
0405  private:
0406   /// @brief Reference to the logger object
0407   const Logger& logger() const { return *m_logger; }
0408   /// @brief Abrivation of the selector delegate to skip invalid straw hits in the seed
0409   template <CompositeSpacePointContainer Cont_t>
0410   using Selector_t = Delegate<bool(ConstDeRef_t<typename Cont_t::value_type>)>;
0411   /// @brief Abrivation of the split hit containers
0412   template <CompositeSpacePointContainer Cont_t>
0413   using StrawLayers_t = std::vector<Cont_t>;
0414   /// @brief Counts the number of hits inside the container. Depending on whether
0415   ///        the busyLimitCountGood flag is true, bad hits are not considered
0416   /// @param container: Reference to the container which size is to be evaluated
0417   /// @param selector: Delegate method to skip bad bad hits
0418   template <CompositeSpacePointContainer Cont_t>
0419   std::size_t countHits(const Cont_t& container,
0420                         const Selector_t<Cont_t>& selector) const;
0421   /// @brief Moves to the hit index to the next good hit inside the layer.
0422   ///        The index is incremented until the underlying hit is accepted
0423   ///        by the selector or all hits in the container were tried
0424   /// @param hitVec: Reference to  the straw hits inside the layer
0425   /// @param selector: Delegate method to skip bad bad hits
0426   /// @param hitIdx: Mutable reference to the index that incremented
0427   template <CompositeSpacePointContainer UnCalibCont_t>
0428   bool moveToNextHit(const UnCalibCont_t& hitVec,
0429                      const Selector_t<UnCalibCont_t>& selector,
0430                      std::size_t& hitIdx) const;
0431   /// @brief Sets the parsed index to the first good hit inside the straw layer.
0432   /// @param hitVec: Reference to  the straw hits inside the layer
0433   /// @param selector: Delegate method to skip bad bad hits
0434   /// @param hitIdx: Mutable reference to the index that incremented
0435   template <CompositeSpacePointContainer UnCalibCont_t>
0436   bool firstGoodHit(const UnCalibCont_t& hitVec,
0437                     const Selector_t<UnCalibCont_t>& selector,
0438                     std::size_t& hitIdx) const;
0439   /// @brief Move the layer index towards the possible value or,if the
0440   ///        layer index is not yet initializes the lyaer index to
0441   //         the next possible value.
0442   /// @param strawLayers: List of all straw hits split into the particular layers
0443   /// @param selector: Delegate method to skip bad hits
0444   /// @param boundary: Boundary value that the layer index must not cross
0445   /// @param layerIndex: Mutable reference to the layer index that needs to be moved
0446   /// @param hitIdx: Mutable reference to the associated hit index inside the layer
0447   /// @param moveForward: Flag toggling whether the layer index shall be incremented or
0448   ///                     decremented.
0449   template <CompositeSpacePointContainer UnCalibCont_t>
0450   bool nextLayer(const StrawLayers_t<UnCalibCont_t>& strawLayers,
0451                  const Selector_t<UnCalibCont_t>& selector,
0452                  const std::size_t boundary,
0453                  std::optional<std::size_t>& layerIndex, std::size_t& hitIdx,
0454                  bool moveForward) const;
0455   /// @brief Move the layer and hit indices inside the state towards the next candidate
0456   ///        pair. First, the L-R ambiguities are incremented, then it is
0457   ///        searched for the next pair inside the lower && upper layer pair.
0458   ///        Finally, the indices are moved towards the next layer
0459   /// @param selector: Delegate method to skip bad hits
0460   /// @param state: Mutable reference to the SeedingState object carring the state indices
0461   template <CompositeSpacePointContainer UncalibCont_t,
0462             CompositeSpacePointContainer CalibCont_t,
0463             detail::CompSpacePointSeederDelegate<UncalibCont_t, CalibCont_t>
0464                 Delegate_t>
0465   void moveToNextCandidate(
0466       const Selector_t<UncalibCont_t>& selector,
0467       SeedingState<UncalibCont_t, CalibCont_t, Delegate_t>& state) const;
0468   /// @brief Attempts to construct the next seed from the given configuration of
0469   ///        seed circles. The seed needs to contain a minimum number of other
0470   ///        straw hits and there must be no other previously constructed seed
0471   ///        with the same Left-Right solution
0472   /// @param cctx: Calibration context to be piped to the experiment's implementation
0473   ///              such that conditions data access becomes possible
0474   /// @param selector: Delegate method to skip bad hits
0475   /// @param state: Mutable reference to the SeedingState object carring the state indices
0476   template <CompositeSpacePointContainer UncalibCont_t,
0477             CompositeSpacePointContainer CalibCont_t,
0478             detail::CompSpacePointSeederDelegate<UncalibCont_t, CalibCont_t>
0479                 Delegate_t>
0480   std::optional<SegmentSeed<CalibCont_t>> buildSeed(
0481       const CalibrationContext& cctx, const Selector_t<UncalibCont_t>& selector,
0482       SeedingState<UncalibCont_t, CalibCont_t, Delegate_t>& state) const;
0483   /// @brief Checks whether the new seed candidate passes the quality cuts on
0484   ///        the number of good straw hits and whether it is not within the
0485   ///        same overlap corridor as previously produced seeds
0486   /// @param tangentSeed: Pair of reference position & direction constructed
0487   ///                     from the two line tangent seed
0488   /// @param newSolution: The new seed solution that's to be tested
0489   /// @param state: The cache carrying the already produced solutions
0490   template <CompositeSpacePointContainer UncalibCont_t,
0491             CompositeSpacePointContainer CalibCont_t,
0492             detail::CompSpacePointSeederDelegate<UncalibCont_t, CalibCont_t>
0493                 Delegate_t>
0494   bool passSeedCuts(
0495       const Line_t& tangentSeed,
0496       SeedSolution<UncalibCont_t, Delegate_t>& newSolution,
0497       SeedingState<UncalibCont_t, CalibCont_t, Delegate_t>& state) const;
0498   /// @brief Converts the accepted seed solution to the segment seed returned by
0499   ///        nextSeed and adds the strip measurements to the seed. The solution
0500   ///        is then appended to the state
0501   /// @param cctx: Calibration context to be piped to the experiment's implementation
0502   ///              such that conditions data access becomes possible
0503   /// @param tangentSeed: Position and direction constructed from the current tangent seed
0504   /// @param state: Mutable reference to the state from which the strip measurements are drawn
0505   ///               and to which the newSolution is then appended
0506   /// @param newSolution: Current tangent seed solution object holding the straw measurements
0507   ///                     to be put onto the seed.
0508   template <CompositeSpacePointContainer UncalibCont_t,
0509             CompositeSpacePointContainer CalibCont_t,
0510             detail::CompSpacePointSeederDelegate<UncalibCont_t, CalibCont_t>
0511                 Delegate_t>
0512   SegmentSeed<CalibCont_t> consructSegmentSeed(
0513       const CalibrationContext& cctx, const Line_t& tangentSeed,
0514       SeedingState<UncalibCont_t, CalibCont_t, Delegate_t>& state,
0515       SeedSolution<UncalibCont_t, Delegate_t>&& newSolution) const;
0516   /// @brief Construct the final seed parameters by combining the initial
0517   ///        pattern parameters with the parameter from two circle tangent
0518   /// @param tangentSeed: Pair of reference position & direction constructed
0519   ///                     from the two line tangent seed
0520   /// @param patternParams: Parameter estimate from the hit pattern
0521   SeedParam_t combineWithPattern(const Line_t& tangentSeed,
0522                                  const SeedParam_t& patternParams) const;
0523   /// @brief Constructs a line from the parsed seed parameters. The
0524   ///        first element is the reference point && the second one
0525   ///        is the direction
0526   /// @param pars: Reference to the line parameters from which the line is created
0527   Line_t makeLine(const SeedParam_t& pars) const;
0528   /// @brief Check whether the generated seed parameters are within the ranges defined by the used
0529   /// @param tangentPars: Reference to the seed parameters to check
0530   bool isValidLine(const TwoCircleTangentPars& tangentPars) const;
0531   /// @brief Configuration object
0532   Config m_cfg{};
0533   /// @brief Logger instance
0534   std::unique_ptr<const Logger> m_logger{};
0535   /// @brief Array encoding the four possible left right solutions.
0536   ///        The first (second) index encodes the ambiguity of the
0537   ///        bottom (top) straw measurement. The order of the index
0538   ///        pairs is coupled to the TangentAmbi index
0539   static constexpr std::array<std::array<int, 2>, 4> s_signCombo{
0540       std::array{1, 1}, std::array{1, -1}, std::array{-1, 1},
0541       std::array{-1, -1}};
0542 };
0543 }  // namespace Acts::Experimental
0544 #include "Acts/Seeding/CompositeSpacePointLineSeeder.ipp"