acts-project / acts

Experiment-independent toolkit for (charged) particle track reconstruction in (high energy) physics experiments implemented in modern C++
https://acts.readthedocs.io
Mozilla Public License 2.0
106 stars 171 forks source link

Proposal: surface and portal navigation (including target surfaces) for Gen3 #3526

Open asalzburger opened 3 months ago

asalzburger commented 3 months ago

The current Gen1/Gen2 navigators have to deal with different (implicit) navigation streams:

The proposal is to make those streams for Gen3 explicit and base them onto the same implementation:

The proposal would be the following 2-3 streams (and associated kernels):

Test, development sequence:

If/when proof of concept is achieved:

Watchpoints:

asalzburger commented 3 months ago

Super-rough NavigationKernel API:


class NavigationKernel {
 public:
  /// This is a candidate type for the tracing kernel
  /// a Surface : always set
  /// a Portal : set if the surface represents a portal
  /// a size_t : the index of the intersection solution
  /// an ActsScalar : the path length to the intersection
  /// a BoundaryTolerance : the boundary tolerance used for the intersection
  using TracedCandidate = std::tuple<const Surface*, const Portal*, std::size_t,
                                     ActsScalar, BoundaryTolerance>;

  /// Current navigation state:
  /// - the surface for the current surface to be set
  /// - the candidate for the next candidate to be set, nullptr if kernel is
  /// exhausted
  using State = std::tuple<const Surface*, const TracedCandidate*>;

  /// @brief Initialize the tracing kernel
  ///
  /// @param gctx The geometry context
  /// @param position the currevnt position
  /// @param direction the current direction
  /// @param stepSize the estimated step size of the stepper
  /// @param intial if this is the initial call
  ///
  State update(const GeometryContext& gctx, const Vector3& position,
               const Vector3& direction, ActsScalar stepSize, bool initial = false);

 private:
  /// The traced candidates belonging to this kernel
  std::vector<TracedCandidate> m_candidates = {};
  /// The candidate index of the next candidate
  std::array<std::index_t> m_candidateRange = {};

  /// The distance at which the surface is considered to be close enough
  /// for a full intersection check
  ActsScalar m_surfaceProximity = std::numeric_limits<ActsScalar>::max();
};

}  // namespace Acts
paulgessinger commented 3 months ago

@asalzburger

  1. That's a very complex type and should be a struct with field names.
    using TracedCandidate = std::tuple<const Surface*, const Portal*, std::size_t,
                                     ActsScalar, BoundaryTolerance>;
  2. State contains a surface pointer, and TracedCandidate, which contains another surfacer pointer.
  3. update returns by value
  4. What is a kernel?
asalzburger commented 3 months ago

Notes:

andiwand commented 3 months ago

Just for reference I tried to decouple and move some logic from the navigator to the propagator here https://github.com/acts-project/acts/pull/3449. This also reduces the number of intersections while approaching a surface with multiple steps.

A few learnings from that procedure

github-actions[bot] commented 2 months ago

This issue/PR has been automatically marked as stale because it has not had recent activity. The stale label will be removed if any interaction occurs.