thepeg is hosted by Hepforge, IPPP Durham
ThePEG  2.2.1
ThePEG::UtilityBase Struct Reference

UtilityBase is a base class implementing a number of static utility functions. More...

#include <UtilityBase.h>

Inheritance diagram for ThePEG::UtilityBase:

Static Public Member Functions

template<typename Cont >
static LorentzMomentum sumMomentum (const Cont &c)
 Sums the four-momentum of given container. More...
 
template<typename Iterator >
static LorentzMomentum sumMomentum (Iterator first, Iterator last)
 Sums the four-momentum of the entries between first and last. More...
 
template<typename Iterator >
static void transform (Iterator first, Iterator last, const LorentzRotation &boost)
 Transform the entries between first and last. More...
 
template<typename Cont >
static void transform (Cont &cont, const LorentzRotation &boost)
 Transform the entries in a container cont. More...
 
template<typename PType >
static LorentzRotation boostToCM (const pair< PType, PType > &pp)
 Boost the two objects in the pair to their CM system. More...
 
template<typename PType >
static LorentzRotation boostToCM (const Triplet< PType, PType, PType > &pt)
 Boost the three objects in the Triplet to their CM system. More...
 
template<typename PType >
static LorentzRotation getBoostToCM (const pair< PType, PType > &pp)
 Obtain the LorentzRotation needed to boost the two objects in the pair to their CM system. More...
 
template<typename PType >
static LorentzRotation getBoostToCM (const Triplet< PType, PType, PType > &pt)
 Obtain the LorentzRotation needed to boost the three objects in the Triplet to their CM system. More...
 
template<typename PType >
static LorentzRotation getBoostFromCM (const pair< PType, PType > &pp)
 Get the inverse boost as compared to getBoostToCM.
 
template<typename PType >
static LorentzRotation getBoostFromCM (const Triplet< PType, PType, PType > &pt)
 Get the inverse boost as compared to getBoostToCM.
 
template<typename Iterator >
static LorentzRotation boostToCM (Iterator first, Iterator last)
 Boost the entries between fisrt and last into their CM system. More...
 
template<typename Iterator >
static LorentzRotation boostToCM (Iterator first, Iterator last, Iterator zAxis)
 Boost the entries between fisrt and last into their CM system. More...
 
template<typename Iterator >
static LorentzRotation boostToCM (Iterator first, Iterator last, Iterator zAxis, Iterator xzPlane)
 Boost the entries between fisrt and last into their CM system. More...
 
template<typename PType >
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 it ends up with momentum q. More...
 
template<typename PType >
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 momentum q. More...
 
template<typename Iter >
static void setMomentum (Iter first, Iter last, const Momentum3 &q)
 Rotate the range of particles so their sum is along z-axis and boost them to their CMS, then boost them along the z-axis and rotate them so that they end up with total momentum q. More...
 
template<typename Iter >
static void setMomentum (Iter first, Iter last, const Momentum3 &q, double eps)
 Rotate the range of particles so their sum is along z-axis then boost them along the z-axis and rotate them so that they end up with total momentum q. More...
 
template<typename Iter >
static void setMomentumFromCMS (Iter first, Iter last, Energy2 m2, const Momentum3 &q)
 Boost the range of particles along the z-axis and rotate them so that, if they were previously in their rest frame, they end up with total momentum q. More...
 
template<typename PType >
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. More...
 
template<typename PType >
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. More...
 
template<typename PType >
static LorentzRotation getTransformToMomentum (const PType &p, const LorentzMomentum &q, const LorentzMomentum &k)
 Return a transformation appropriate for transforming p to have the momentum q. More...
 
template<typename PType >
static LorentzRotation getTransformToMomentum (const PType &p, const Momentum3 &q, const LorentzMomentum &k)
 Return a transformation appropriate for transforming p to have the momentum q. More...
 
template<typename LV >
static LorentzRotation transformFromCMS (const LV &p)
 Create a rotation corresponding to transforming p to its current value from its CMS by first boosting along the z-axis and then rotating. More...
 
template<typename LV >
static LorentzRotation transformFromCMS (const LV &sum, LV zAxis)
 Create a rotation corresponding to transforming sum to its current value from its CMS, with zAxis along the z-axis in that CMS frame. More...
 
template<typename LV >
static LorentzRotation transformFromCMS (const LV &sum, const LV &zAxis, LV xyPlane)
 Create a rotation corresponding to transforming sum to its current value from its CMS, with zAxis along the z-axis and xyPlane in the x-y plane in that CMS frame. More...
 
template<typename LV >
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 frame. More...
 
template<typename LV >
static LorentzRotation transformToCMS (const LV &p)
 Create a rotation which would transform sum to its CMS frame first rotating it to the z-axis and then boost it along the z-axis. More...
 
template<typename LV >
static LorentzRotation transformToCMS (const LV &sum, const LV &zAxis, LV xyPlane)
 Create a rotation which would transform sum to its CMS frame with zAxis along the z-axis and xyPlane in the x-y plane in that frame. More...
 
template<typename Cont1 , typename Cont2 >
static void add (Cont1 &c1, const Cont2 &c2)
 Add the elements in Cont2 to Cont1, appending them to the end if possible.
 

Detailed Description

UtilityBase is a base class implementing a number of static utility functions.

It should be used as a base class to give acces to these functions to a class. A class can safely multiply inherit from this class as it only contains static functions.

Definition at line 24 of file UtilityBase.h.

Member Function Documentation

◆ boostToCM() [1/5]

template<typename PType >
static LorentzRotation ThePEG::UtilityBase::boostToCM ( const pair< PType, PType > &  pp)
static

Boost the two objects in the pair to their CM system.

Also rotate so that the first is along the z-axis. The class PType must have ParticleTraits<PType>::momentum(const PType&) and ParticleTraits<PType>::transform(PType&, const LorentzRotation&) implemented correctly.

Referenced by boostToCM(), and transform().

◆ boostToCM() [2/5]

template<typename PType >
static LorentzRotation ThePEG::UtilityBase::boostToCM ( const Triplet< PType, PType, PType > &  pt)
static

Boost the three objects in the Triplet to their CM system.

Also rotate so that the first is along the z-axis and the second is in the x-z plane with positive x. The class PType must have ParticleTraits<PType>::momentum(const PType&) and ParticleTraits<PType>::transform(PType&, const LorentzRotation&) implemented correctly.

◆ boostToCM() [3/5]

template<typename Iterator >
static LorentzRotation ThePEG::UtilityBase::boostToCM ( Iterator  first,
Iterator  last 
)
inlinestatic

Boost the entries between fisrt and last into their CM system.

The class Iterator::value_type must be of a type T for which ParticleTraits<T>::momentum(const T&) and ParticleTraits<T>::transform(T&, const LorentzRotation&) are implemented correctly.

Definition at line 142 of file UtilityBase.h.

References boostToCM().

◆ boostToCM() [4/5]

template<typename Iterator >
static LorentzRotation ThePEG::UtilityBase::boostToCM ( Iterator  first,
Iterator  last,
Iterator  zAxis 
)
inlinestatic

Boost the entries between fisrt and last into their CM system.

If zAxis != last, also rotate the entries so that zAxis becomes paralell to the z-axis. The class Iterator::value_type must be of a type T for which ParticleTraits<T>::momentum(const T&) and ParticleTraits<T>::transform(T&, const LorentzRotation&) are implemented correctly.

Definition at line 156 of file UtilityBase.h.

References boostToCM(), setMomentum(), and setMomentumFromCMS().

◆ boostToCM() [5/5]

template<typename Iterator >
static LorentzRotation ThePEG::UtilityBase::boostToCM ( Iterator  first,
Iterator  last,
Iterator  zAxis,
Iterator  xzPlane 
)
static

Boost the entries between fisrt and last into their CM system.

If zAxis != last, also rotate the entries so that zAxis becomes paralell to the z-axis. Also, if xzPlane != last, rotate the entries so that xzPlane is placed in the xz-plane. The class Iterator::value_type must be of a type T for which ParticleTraits<T>::momentum(const T&) and ParticleTraits<T>::transform(T&, const LorentzRotation&) are implemented correctly.

◆ getBoostToCM() [1/2]

template<typename PType >
static LorentzRotation ThePEG::UtilityBase::getBoostToCM ( const pair< PType, PType > &  pp)
static

Obtain the LorentzRotation needed to boost the two objects in the pair to their CM system.

Also rotate the LorentzRotation so that the first is along the z-axis. The class PType must have ParticleTraits<PType>::momentum(const PType&) implemented correctly.

Referenced by getTransformToMomentum(), and transform().

◆ getBoostToCM() [2/2]

template<typename PType >
static LorentzRotation ThePEG::UtilityBase::getBoostToCM ( const Triplet< PType, PType, PType > &  pt)
static

Obtain the LorentzRotation needed to boost the three objects in the Triplet to their CM system.

Also rotate the LorentzRotation so that the first is along the z-axis and the secons i in the x-z plane with positive x. The class PType must have ParticleTraits<PType>::momentum(const PType&) implemented correctly.

◆ getTransformToMomentum() [1/2]

template<typename PType >
static LorentzRotation ThePEG::UtilityBase::getTransformToMomentum ( const PType &  p,
const LorentzMomentum q,
const LorentzMomentum k 
)
inlinestatic

Return a transformation appropriate for transforming p to have the momentum q.

The transformation is done so that the auxiliary vector k is left unchanged.

Definition at line 281 of file UtilityBase.h.

References getBoostFromCM(), and getBoostToCM().

Referenced by getTransformToMomentum().

◆ getTransformToMomentum() [2/2]

template<typename PType >
static LorentzRotation ThePEG::UtilityBase::getTransformToMomentum ( const PType &  p,
const Momentum3 q,
const LorentzMomentum k 
)
inlinestatic

Return a transformation appropriate for transforming p to have the momentum q.

The transformation is done so that the auxiliary vector k is left unchanged.

Definition at line 296 of file UtilityBase.h.

References add(), getTransformToMomentum(), ThePEG::ThreeVector< Value >::mag2(), transformFromCMS(), and transformToCMS().

◆ setMomentum() [1/3]

template<typename PType >
static void ThePEG::UtilityBase::setMomentum ( PType &  p,
const Momentum3 q 
)
static

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.

If p is massless - simply set its momentum. The class PType must have ParticleTraits<PType>::momentum(const PType&) implemented correctly.

Referenced by boostToCM().

◆ setMomentum() [2/3]

template<typename Iter >
static void ThePEG::UtilityBase::setMomentum ( Iter  first,
Iter  last,
const Momentum3 q 
)
static

Rotate the range of particles so their sum is along z-axis and boost them to their CMS, then boost them along the z-axis and rotate them so that they end up with total momentum q.

The class Iter::value_type must be of a type T for which ParticleTraits<T>::momentum(const T&) and ParticleTraits<T>::transform(T&, const LorentzRotation&) are implemented correctly.

◆ setMomentum() [3/3]

template<typename Iter >
static void ThePEG::UtilityBase::setMomentum ( Iter  first,
Iter  last,
const Momentum3 q,
double  eps 
)
static

Rotate the range of particles so their sum is along z-axis then boost them along the z-axis and rotate them so that they end up with total momentum q.

If a single boost does not succeed to obtain the required precision within eps times the total energy, the boost is redone. The class Iter::value_type must be of a type T for which ParticleTraits<T>::momentum(const T&) and ParticleTraits<T>::transform(T&, const LorentzRotation&) are implemented correctly.

◆ setMomentumFromCMS() [1/2]

template<typename PType >
static void ThePEG::UtilityBase::setMomentumFromCMS ( PType &  p,
const Momentum3 q 
)
static

Boost p along the z-axis and rotate it so that, if it was previously at rest, it ends up with momentum q.

If p is massless

Referenced by boostToCM().

◆ setMomentumFromCMS() [2/2]

template<typename Iter >
static void ThePEG::UtilityBase::setMomentumFromCMS ( Iter  first,
Iter  last,
Energy2  m2,
const Momentum3 q 
)
static

Boost the range of particles along the z-axis and rotate them so that, if they were previously in their rest frame, they end up with total momentum q.

The class Iter::value_type must be of a type T for which ParticleTraits<T>::momentum(const T&) and ParticleTraits<T>::transform(T&, const LorentzRotation&) are implemented correctly.

Parameters
firstiterator pointing to the first particle in the range.
lastiterator indicating the end of the range.
m2the invariant mass squared of the particles.
qfinal summed momentum of the particles.

◆ sumMomentum() [1/2]

template<typename Cont >
static LorentzMomentum ThePEG::UtilityBase::sumMomentum ( const Cont &  c)
inlinestatic

Sums the four-momentum of given container.

The class Cont::value_type must be of a type T for which ParticleTraits<T>::momentum(const T&) is implemented correctly.

Definition at line 33 of file UtilityBase.h.

◆ sumMomentum() [2/2]

template<typename Iterator >
static LorentzMomentum ThePEG::UtilityBase::sumMomentum ( Iterator  first,
Iterator  last 
)
inlinestatic

Sums the four-momentum of the entries between first and last.

The class Iterator::value_type must be of a type T for which ParticleTraits<T>::momentum(const T&) is implemented correctly.

Definition at line 44 of file UtilityBase.h.

◆ transform() [1/2]

template<typename Iterator >
static void ThePEG::UtilityBase::transform ( Iterator  first,
Iterator  last,
const LorentzRotation boost 
)
inlinestatic

Transform the entries between first and last.

The class Iterator::value_type must be of a type T for which ParticleTraits<T>::momentum(const T&) is implemented correctly.

Definition at line 60 of file UtilityBase.h.

Referenced by transform().

◆ transform() [2/2]

template<typename Cont >
static void ThePEG::UtilityBase::transform ( Cont &  cont,
const LorentzRotation boost 
)
inlinestatic

Transform the entries in a container cont.

The class Cont::value_type must be of a type T for which ParticleTraits<T>::momentum(const T&) is implemented correctly.

Definition at line 75 of file UtilityBase.h.

References boostToCM(), getBoostFromCM(), getBoostToCM(), and transform().

◆ transformFromCMS() [1/3]

template<typename LV >
static LorentzRotation ThePEG::UtilityBase::transformFromCMS ( const LV &  p)
static

Create a rotation corresponding to transforming p to its current value from its CMS by first boosting along the z-axis and then rotating.

The class LV must have methods rho() and e().

Referenced by getTransformToMomentum(), and transformToMomentum().

◆ transformFromCMS() [2/3]

template<typename LV >
static LorentzRotation ThePEG::UtilityBase::transformFromCMS ( const LV &  sum,
LV  zAxis 
)
static

Create a rotation corresponding to transforming sum to its current value from its CMS, with zAxis along the z-axis in that CMS frame.

The class LV must have methods rho(), phi() theta() and e().

◆ transformFromCMS() [3/3]

template<typename LV >
static LorentzRotation ThePEG::UtilityBase::transformFromCMS ( const LV &  sum,
const LV &  zAxis,
LV  xyPlane 
)
static

Create a rotation corresponding to transforming sum to its current value from its CMS, with zAxis along the z-axis and xyPlane in the x-y plane in that CMS frame.

The class LV must have methods rho(), phi() theta() and e().

◆ transformToCMS() [1/3]

template<typename LV >
static LorentzRotation ThePEG::UtilityBase::transformToCMS ( const LV &  sum,
LV  zAxis 
)
static

Create a rotation which would transform sum to its CMS frame with zAxis along the z-axis in that frame.

The class LV must have methods rho(), phi() theta() and e().

Referenced by getTransformToMomentum(), and transformToMomentum().

◆ transformToCMS() [2/3]

template<typename LV >
static LorentzRotation ThePEG::UtilityBase::transformToCMS ( const LV &  p)
static

Create a rotation which would transform sum to its CMS frame first rotating it to the z-axis and then boost it along the z-axis.

The class LV must have methods rho(), phi() theta() and e().

◆ transformToCMS() [3/3]

template<typename LV >
static LorentzRotation ThePEG::UtilityBase::transformToCMS ( const LV &  sum,
const LV &  zAxis,
LV  xyPlane 
)
static

Create a rotation which would transform sum to its CMS frame with zAxis along the z-axis and xyPlane in the x-y plane in that frame.

The class LV must have methods rho(), phi() theta() and e().

◆ transformToMomentum() [1/2]

template<typename PType >
static LorentzRotation ThePEG::UtilityBase::transformToMomentum ( const PType &  p,
const Momentum3 q 
)
inlinestatic

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 class PType must have ParticleTraits<PType>::momentum(const PType&) implemented correctly. Warning This function only works properly if p has a well defined direction in both polar and azimuth angles.

Deprecated:
{Use getTransformToMomentum() instead.}

Definition at line 252 of file UtilityBase.h.

References ThePEG::ThreeVector< Value >::mag2().

◆ transformToMomentum() [2/2]

template<typename PType >
static LorentzRotation ThePEG::UtilityBase::transformToMomentum ( const PType &  p,
const LorentzMomentum q 
)
inlinestatic

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 class PType must have ParticleTraits<PType>::momentum(const PType&) implemented correctly. Warning This function only works properly if p has a well defined direction in both polar and azimuth angles.

Deprecated:
{Use getTransformToMomentum() instead.}

Definition at line 270 of file UtilityBase.h.

References transformFromCMS(), and transformToCMS().


The documentation for this struct was generated from the following file: