9 #ifndef ThePEG_UtilityBase_H
10 #define ThePEG_UtilityBase_H
12 #include "ThePEG/Config/ThePEG.h"
13 #include "ThePEG/EventRecord/ParticleTraits.h"
14 #include "ThePEG/Utilities/Triplet.h"
32 template <
typename Cont>
43 template <
typename Iterator>
46 typedef typename std::iterator_traits<Iterator>::value_type PType;
49 while ( first != last ) sum += Traits::momentum(*first++);
59 template <
typename Iterator>
60 static void transform(Iterator first, Iterator last,
62 typedef typename std::iterator_traits<Iterator>::value_type PType;
65 while ( first != last ) Traits::transform(*first++, boost);
74 template <
typename Cont>
76 transform(cont.begin(), cont.end(), boost);
87 template <
typename PType>
98 template <
typename PType>
108 template <
typename PType>
119 template <
typename PType>
125 template <
typename PType>
131 template <
typename PType>
141 template <
typename Iterator>
143 return boostToCM(first, last, last, last);
155 template <
typename Iterator>
157 return boostToCM(first, last, zAxis, last);
170 template <
typename Iterator>
172 Iterator zAxis, Iterator xzPlane);
182 template <
typename PType>
193 template <
typename PType>
205 template <
typename Iter>
219 template <
typename Iter>
236 template <
typename Iter>
251 template <
typename PType>
269 template <
typename PType>
280 template <
typename PType>
295 template <
typename PType>
310 template <
typename LV>
320 template <
typename LV>
330 template <
typename LV>
332 const LV & zAxis, LV xyPlane);
340 template <
typename LV>
350 template <
typename LV>
360 template <
typename LV>
362 const LV & zAxis, LV xyPlane);
368 template <
typename Cont1,
typename Cont2>
369 static void add(Cont1 & c1,
const Cont2 & c2);
378 #ifndef ThePEG_TEMPLATES_IN_CC_FILE
379 #include "UtilityBase.tcc"
static LorentzRotation getTransformToMomentum(const PType &p, const Momentum3 &q, const LorentzMomentum &k)
Return a transformation appropriate for transforming p to have the momentum q.
static LorentzRotation getTransformToMomentum(const PType &p, const LorentzMomentum &q, const LorentzMomentum &k)
Return a transformation appropriate for transforming p to have the momentum q.
static LorentzRotation boostToCM(Iterator first, Iterator last)
Boost the entries between fisrt and last into their CM system.
static void transform(Iterator first, Iterator last, const LorentzRotation &boost)
Transform the entries between first and last.
static LorentzRotation transformToCMS(const LV &sum, LV zAxis)
Create a rotation which would transform sum to its CMS frame with zAxis along the z-axis in that fram...
static LorentzRotation transformToMomentum(const PType &p, const Momentum3 &q)
Return the transformation needed to rotate p to the z-axis and boost it to its CMS, then boost it along the z-axis and rotate it so that it ends up with momentum q.
The LorentzRotation class combine a SpinOneLorentzRotation and a spin SpinHalfLorentzRotation to prov...
This is the main namespace within which all identifiers in ThePEG are declared.
Concrete class with UtilityBase as base class.
static LorentzRotation boostToCM(Iterator first, Iterator last, Iterator zAxis)
Boost the entries between fisrt and last into their CM system.
static LorentzMomentum sumMomentum(const Cont &c)
Sums the four-momentum of given container.
UtilityBase is a base class implementing a number of static utility functions.
static void add(Cont1 &c1, const Cont2 &c2)
Add the elements in Cont2 to Cont1, appending them to the end if possible.
static LorentzRotation transformToMomentum(const PType &p, const LorentzMomentum &q)
Return the transformation needed to rotate p to the z-axis and boost it to its CMS, then boost it along the z-axis and rotate it so that it ends up with momentum q.
Value2 mag2() const
Squared magnitude .
static void setMomentumFromCMS(PType &p, const Momentum3 &q)
Boost p along the z-axis and rotate it so that, if it was previously at rest, it ends up with momentu...
The Triplet class represents a general triplet of objects completely analogous to std::pair...
ParticleTraits is a templated class defining a general interface to any particle class.
static LorentzRotation getBoostToCM(const pair< PType, PType > &pp)
Obtain the LorentzRotation needed to boost the two objects in the pair to their CM system...
static LorentzRotation boostToCM(const pair< PType, PType > &pp)
Boost the two objects in the pair to their CM system.
static void transform(Cont &cont, const LorentzRotation &boost)
Transform the entries in a container cont.
static LorentzRotation getBoostFromCM(const pair< PType, PType > &pp)
Get the inverse boost as compared to getBoostToCM.
static LorentzMomentum sumMomentum(Iterator first, Iterator last)
Sums the four-momentum of the entries between first and last.
static LorentzRotation transformFromCMS(const LV &p)
Create a rotation corresponding to transforming p to its current value from its CMS by first boosting...
static void setMomentum(PType &p, const Momentum3 &q)
Rotate p to the z-axis and boost it to its CMS, then boost it along the z-axis and rotate it so that ...