21 #ifndef yap_HelicityAngles_h
22 #define yap_HelicityAngles_h
24 #include "fwd/CachedValue.h"
25 #include "fwd/Model.h"
26 #include "fwd/ParticleCombination.h"
27 #include "fwd/StatusManager.h"
75 double phi(
const DataPoint& d,
const std::shared_ptr<ParticleCombination>& pc)
const;
78 std::shared_ptr<RealCachedValue>&
phi()
82 const std::shared_ptr<RealCachedValue>&
phi()
const
86 double theta(
const DataPoint& d,
const std::shared_ptr<ParticleCombination>& pc)
const;
89 std::shared_ptr<RealCachedValue>&
theta()
93 const std::shared_ptr<RealCachedValue>&
theta()
const
109 const CoordinateSystem<double, 3>& C,
const FourMatrix<double>& boosts,
118 std::shared_ptr<RealCachedValue>
Phi_;
129 template <
typename T>
130 CoordinateSystem<T, 3>
helicityFrame(
const ThreeVector<T>& V,
const CoordinateSystem<T, 3>& C)
132 constexpr T epsilon = T(5) * std::numeric_limits<T>::epsilon();
135 if (norm(V) <= epsilon)
138 CoordinateSystem<double, 3> vC;
144 auto theta = angle(vC[2], C[2]);
152 return rotation<T>(C[1],
rad(180.)) * C;
158 vC[0] =
cross(vC[1], vC[2]);
const CoordinateSystem< T, 3 > helicityFrame(const FourVector< T > &V, const CoordinateSystem< T, 3 > &C)
Definition: FourVector.h:131
std::shared_ptr< RealCachedValue > & phi()
access azimuthal angle
Definition: HelicityAngles.h:78
constexpr T theta(const ThreeVector< T > &V, const CoordinateSystem< T, 3 > &C)
Definition: CoordinateSystem.h:101
void calculateAngles(DataPoint &d, const std::shared_ptr< ParticleCombination > &pc, const CoordinateSystem< double, 3 > &C, const FourMatrix< double > &boosts, StatusManager &sm) const
recursive helicity-angle calculator that travels down decay trees for all channels ...
Definition: HelicityAngles.cxx:60
constexpr T abs(const Vector< T, N > &A)
Definition: Vector.h:371
Class for holding data and cached values per data point for fast calculation.
Definition: DataPoint.h:35
Base class for all data accessors that will only write to DataPoint once at initial data loading...
Definition: StaticDataAccessor.h:36
virtual void calculate(DataPoint &d, StatusManager &sm) const override
Definition: HelicityAngles.cxx:47
void addParticleCombination(std::shared_ptr< ParticleCombination > pc) override
override to throw on adding non-two-body PC
Definition: HelicityAngles.cxx:107
Definition: StatusManager.h:32
Class implementing a PWA model.
Definition: Model.h:56
const CoordinateSystem< T, N > unit(const CoordinateSystem< T, N > &C)
Definition: CoordinateSystem.h:52
virtual void addToStaticDataAccessors() override
add to model's StaticDataAccessors_
Definition: HelicityAngles.cxx:24
Calculates, stores and gives access to helicity angles.
Definition: HelicityAngles.h:61
const std::shared_ptr< RealCachedValue > & theta() const
access polar angle (const)
Definition: HelicityAngles.h:93
std::shared_ptr< RealCachedValue > Theta_
Polar angle.
Definition: HelicityAngles.h:121
Abstract base class for all objects accessing DataPoint's.
Definition: DataAccessor.h:38
std::shared_ptr< RealCachedValue > & theta()
access polar angle
Definition: HelicityAngles.h:89
constexpr T rad(const T &d)
convert degrees to radians
Definition: Constants.h:59
const std::shared_ptr< RealCachedValue > & phi() const
access azimuthal angle (const)
Definition: HelicityAngles.h:82
constexpr ThreeVector< T > cross(const ThreeVector< T > &A, const ThreeVector< T > &B) noexcept
Definition: ThreeVector.h:33
HelicityAngles(Model &m)
Definition: HelicityAngles.cxx:15
std::shared_ptr< RealCachedValue > Phi_
Azimuthal angle.
Definition: HelicityAngles.h:118