A Direction
object can be used to specify that some following operations should be assumed to be performed with the z-direction of the momenta reversed.
More...
#include <Direction.h>
Public Types | |
enum | Dir { Neg = -1 , Negative = -1 , Undefined = 0 , Pos = 1 , Positive = 1 } |
The enum defining the directions. More... | |
Public Member Functions | |
Direction (Dir newDirection) | |
Create an object with a given direction. | |
Direction (double rnd) | |
Create an object with a positive direction if rnd > 0.5, otherwise set the negative direction. | |
Direction (bool p) | |
Create an object with a positive direction if p is true, otherwise set the negative direction. | |
~Direction () | |
Destructure makeing the static variable undefined. | |
Static Public Member Functions | |
static void | set (Dir newDirection) |
Set the direction. | |
static void | reverse () |
Reverse the direction. | |
static bool | pos () |
Return true if the direction is positive. | |
static bool | neg () |
Return true if the direction is negative (reversed). | |
static Dir | dir () |
Return the direction. | |
Private Member Functions | |
Direction () | |
Default ctors and assignment is private and not implemented. | |
Direction (const Direction &) | |
Default ctors and assignment is private and not implemented. | |
Direction & | operator= (const Direction &)=delete |
Default ctors and assignment is private and not implemented. | |
Static Private Attributes | |
static Dir | theDirection = Direction<I>::Undefined |
The direction. | |
A Direction
object can be used to specify that some following operations should be assumed to be performed with the z-direction of the momenta reversed.
As an example, if Direction<0>::pos()
is true, the method Lorentz5Momentum::dirPlus()
will return the positive, light-cone component, and Lorentz5Momentum::dirMinus()
the negative, while if Direction<0>::pos()
is false the behavior of the methods are reversed.
Direction
is templated with an integer template argument (default = 0), and only one object per class can be instatiated at the time. Attempts to instatiate a second object of a Direction
class will result in an exception being thrown. To have several different directions classes with different template arguments must be instantiated. Direction<0>
is reserved for Lorentz5Momentum
. Attempts to use the static methods of a Direction
class when no object has been instatiated will result in an exception being thrown.
Definition at line 41 of file Direction.h.
enum ThePEG::Direction::Dir |
The enum defining the directions.
Enumerator | |
---|---|
Neg | Reversed direction. |
Negative | Reversed direction. |
Undefined | No direction has been defined. |
Pos | Standard (positive) direction. |
Positive | Standard (positive) direction. |
Definition at line 46 of file Direction.h.
|
inline |
Create an object with a given direction.
Definition at line 58 of file Direction.h.
References ThePEG::Direction< I >::Negative, ThePEG::Direction< I >::Positive, ThePEG::Direction< I >::theDirection, and ThePEG::Direction< I >::Undefined.
|
inline |
Create an object with a positive direction if rnd > 0.5, otherwise set the negative direction.
Definition at line 71 of file Direction.h.
References ThePEG::Direction< I >::Negative, ThePEG::Direction< I >::Positive, ThePEG::Direction< I >::theDirection, and ThePEG::Direction< I >::Undefined.
|
inline |
Create an object with a positive direction if p is true, otherwise set the negative direction.
Definition at line 81 of file Direction.h.
References ThePEG::Direction< I >::Negative, ThePEG::Direction< I >::Positive, ThePEG::Direction< I >::theDirection, and ThePEG::Direction< I >::Undefined.
|
inline |
Destructure makeing the static variable undefined.
Definition at line 90 of file Direction.h.
References ThePEG::Direction< I >::theDirection, and ThePEG::Direction< I >::Undefined.
|
inlinestatic |
Return the direction.
Definition at line 127 of file Direction.h.
References ThePEG::Direction< I >::theDirection, and ThePEG::Direction< I >::Undefined.
Referenced by ThePEG::dirZ(), ThePEG::Direction< I >::neg(), and ThePEG::Direction< I >::pos().
|
inlinestatic |
Return true if the direction is negative (reversed).
Definition at line 120 of file Direction.h.
References ThePEG::Direction< I >::dir(), and ThePEG::Direction< I >::Negative.
Referenced by ThePEG::Lorentz5Vector< Value >::dirMinus(), and ThePEG::dirMinus().
|
inlinestatic |
Return true if the direction is positive.
Definition at line 113 of file Direction.h.
References ThePEG::Direction< I >::dir(), and ThePEG::Direction< I >::Positive.
Referenced by ThePEG::dirCosTheta(), ThePEG::Lorentz5Vector< Value >::dirPlus(), ThePEG::dirPlus(), ThePEG::dirTheta(), and ThePEG::Direction< I >::reverse().
|
inlinestatic |
Reverse the direction.
Definition at line 106 of file Direction.h.
References ThePEG::Direction< I >::Negative, ThePEG::Direction< I >::pos(), ThePEG::Direction< I >::Positive, and ThePEG::Direction< I >::theDirection.
|
inlinestatic |
Set the direction.
Definition at line 97 of file Direction.h.
References ThePEG::Direction< I >::Negative, ThePEG::Direction< I >::Positive, and ThePEG::Direction< I >::theDirection.
|
staticprivate |
The direction.
Definition at line 137 of file Direction.h.
Referenced by ThePEG::Direction< I >::dir(), ThePEG::Direction< I >::Direction(), ThePEG::Direction< I >::reverse(), ThePEG::Direction< I >::set(), and ThePEG::Direction< I >::~Direction().