thepeg is hosted by Hepforge, IPPP Durham
ThePEG 2.3.0
ThePEG::Direction< I > Class Template Reference

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.
 
Directionoperator= (const Direction &)=delete
 Default ctors and assignment is private and not implemented.
 

Static Private Attributes

static Dir theDirection = Direction<I>::Undefined
 The direction.
 

Detailed Description

template<int I>
class ThePEG::Direction< I >

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.

See also
Lorentz5Momentum

Definition at line 41 of file Direction.h.

Member Enumeration Documentation

◆ Dir

template<int I>
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.

Constructor & Destructor Documentation

◆ Direction() [1/3]

template<int I>
ThePEG::Direction< I >::Direction ( Dir  newDirection)
inline

◆ Direction() [2/3]

template<int I>
ThePEG::Direction< I >::Direction ( double  rnd)
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.

◆ Direction() [3/3]

template<int I>
ThePEG::Direction< I >::Direction ( bool  p)
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.

◆ ~Direction()

template<int I>
ThePEG::Direction< I >::~Direction ( )
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.

Member Function Documentation

◆ dir()

template<int I>
static Dir ThePEG::Direction< I >::dir ( )
inlinestatic

◆ neg()

template<int I>
static bool ThePEG::Direction< I >::neg ( )
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().

◆ pos()

template<int I>
static bool ThePEG::Direction< I >::pos ( )
inlinestatic

◆ reverse()

template<int I>
static void ThePEG::Direction< I >::reverse ( )
inlinestatic

◆ set()

template<int I>
static void ThePEG::Direction< I >::set ( Dir  newDirection)
inlinestatic

Member Data Documentation

◆ theDirection


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