Skip to content

Commit

Permalink
feat: Angle accessors for track params and easy position for curvilin…
Browse files Browse the repository at this point in the history
…ear (#2396)

Pulled out of #2341
  • Loading branch information
andiwand committed Aug 25, 2023
1 parent c4c3c80 commit bcf2ff9
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Core/include/Acts/EventData/GenericBoundTrackParameters.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,13 @@ class GenericBoundTrackParameters {
/// Time coordinate.
Scalar time() const { return m_params[eBoundTime]; }

/// Phi direction.
Scalar phi() const { return m_params[eBoundPhi]; }
/// Theta direction.
Scalar theta() const { return m_params[eBoundTheta]; }
/// Charge over momentum.
Scalar qOverP() const { return m_params[eBoundQOverP]; }

/// Unit direction three-vector, i.e. the normalized momentum
/// three-vector.
Vector3 direction() const {
Expand Down
12 changes: 12 additions & 0 deletions Core/include/Acts/EventData/GenericCurvilinearTrackParameters.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,18 @@ class GenericCurvilinearTrackParameters
const GenericCurvilinearTrackParameters&) = default;
GenericCurvilinearTrackParameters& operator=(
GenericCurvilinearTrackParameters&&) = default;

using GenericBoundTrackParameters<charge_t>::fourPosition;
using GenericBoundTrackParameters<charge_t>::position;

/// Space-time position four-vector.
Vector4 fourPosition() const {
return GenericBoundTrackParameters<charge_t>::fourPosition({});
}
/// Spatial position three-vector.
Vector3 position() const {
return GenericBoundTrackParameters<charge_t>::position({});
}
};

} // namespace Acts
7 changes: 7 additions & 0 deletions Core/include/Acts/EventData/GenericFreeTrackParameters.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,13 @@ class GenericFreeTrackParameters {
/// Time coordinate.
Scalar time() const { return m_params[eFreeTime]; }

/// Phi direction.
Scalar phi() const { return phi(direction()); }
/// Theta direction.
Scalar theta() const { return theta(direction()); }
/// Charge over momentum.
Scalar qOverP() const { return m_params[eFreeQOverP]; }

/// Unit direction three-vector, i.e. the normalized momentum three-vector.
Vector3 direction() const {
return m_params.segment<3>(eFreeDir0).normalized();
Expand Down

0 comments on commit bcf2ff9

Please sign in to comment.