ThePEG is hosted by Hepforge, IPPP Durham
ThePEG  2.1.4
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 &)
 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.


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