TABLE OF CONTENTS
- 1. /particleDefinition
- 1.1. particleDefinition/particle
- 1.2. particleDefinition/sqrtS
- 1.3. particleDefinition/setNumber
- 1.4. particleDefinition/setProductionPos
- 1.5. particleDefinition/useProductionPos
- 1.6. particleDefinition/FreeEnergy
- 1.7. particleDefinition/kineticEnergy
- 1.8. particleDefinition/absMom
- 1.9. particleDefinition/absPos
- 1.10. particleDefinition/rapidity
- 1.11. particleDefinition/setToDefault
- 1.12. particleDefinition/setNumberGuess
- 1.13. particleDefinition/resetNumberGuess
- 1.14. particleDefinition/AcceptGuessedNumbers
- 1.15. particleDefinition/getNumber
- 1.16. particleDefinition/setNumbersToDefault
- 1.17. particleDefinition/IsSamePart
- 1.18. particleDefinition/countParticles
- 1.19. particleDefinition/getProductionPos
/particleDefinition [ Modules ]
NAME
module particleDefinition
PURPOSE
Here type(particle) is defined. This module includes also functions for this type.
NOTES
The type is enhanced by the additional field 'productionPos', which is only implemented, if the code is compiled with the flags -DWITHPRODUCTIONPOS=1. You never should access this field directly, only by the setter and getter routines provided here.
particleDefinition/particle [ Types ]
[ Top ] [ particleDefinition ] [ Types ]
NAME
type particle
PURPOSE
This is the major type definition.
NOTES
In order to calculate the size used in memory:
- real : 8 byte
- integer: 4 byte
- logical: 4 byte
This type definition has to be as small as possible.
If you want to store additional informations, you have to use "PIL" modules.
SOURCE
Type particle sequence real, dimension (1:3) :: pos=0. real, dimension (0:3) :: mom=0. real, dimension (1:3) :: vel=0. ! velocity=dr/dt in calc frame real :: mass=0. ! Note : ! This is not the invariant mass p^mu p_mu, but the bare mass of the particle without the self-energy shift: ! => p(0) = sqrt[mass+scalarPot)**2+p(1:3)**2] ! => p^mu p_mu = (mass+scalarPot)**2 real :: lastCollTime=0. ! time of last collision real :: prodTime=0. ! time of production real :: formTime=0. ! time of formation real :: perWeight=0. ! perturbative weight real :: scaleCS=1. ! scaling factor for hadron cross section (during formation) real :: offshellPar=0. integer :: ID=0 integer :: number=0 ! unique number for every particle integer :: charge=0 integer,dimension(1:2):: event=0 ! Number of event in which the particle was generated, ! changes during the run. ! cf. "collisionNumbering.f90" for details. integer :: firstEvent=0 ! Number of first event, important for perturbative particles ! to track particle back to its production event. ! should stay constant during the run if the value is >0! ! is inherited to reaction products of the particle. integer :: history=0 ! Variable to store the collision history of a particle logical :: anti=.false. logical :: pert=.false. logical :: inF =.false. ! ='in formation' #ifdef WITHPRODUCTIONPOS real, dimension (1:3) :: prodPos=0. ! position where particle was produced #endif End Type particle
particleDefinition/sqrtS [ Functions ]
[ Top ] [ particleDefinition ] [ Functions ]
NAME
real function sqrtS(...)
PURPOSE
Evaluates Sqrt(s) for 1,2,3 or more particles, i.e.
sqrt(mom(0)**2 - dot_product(mom(1:3),mom(1,3)))
where "mom" is the sum of momenta of all given particles.
USAGE
- (real)=sqrtS(x)
- (real)=sqrtS(x,y)
- (real)=sqrtS(x,y,z) with x,y,z of type particle
- (real)=sqrtS(V) with V = vector of type particle
NOTES
This function is overloaded.
You can also give an additional text as last argument: Then, before taking the sqrt, a test on negative argument is done. If the argument is smaller than -1e-3 an error message including the given text is thrown. (The threshold is given by the internal parameter "sqrtsCut".)
particleDefinition/setNumber [ Subroutines ]
[ Top ] [ particleDefinition ] [ Subroutines ]
NAME
subroutine setNumber(teilchen)
PURPOSE
Set number of a particle, a vector of particles or an array of particles, which is unique.
INPUTS
- type(particle),intent(INout) :: teilchen
or:
- type(particle),intent(INout),dimension(:) :: teilchen
or:
- type(particle),intent(INout),dimension(:,:) :: teilchen
particleDefinition/setProductionPos [ Subroutines ]
[ Top ] [ particleDefinition ] [ Subroutines ]
NAME
subroutine setProductionPos(p)
INPUTS
or:
PURPOSE
Set the additional entries ProductionPos to the value of position
Only has a function if compiled with -DWITHPRODUCTIONPOS=1
USAGE
if (useProductionPos) call setProductionPos(pPart)
particleDefinition/useProductionPos [ Global module-variables ]
[ Top ] [ particleDefinition ] [ Global module-variables ]
PURPOSE
Parameter flag to indicate whether the code is compiled with the additional fields ProductionPos.
The compiler should avoid creating 'if'-blocks checking this flag, because it is stored as 'parameter', so there should be no size or time overhead.
particleDefinition/FreeEnergy [ Functions ]
[ Top ] [ particleDefinition ] [ Functions ]
NAME
real function FreeEnergy(x)
PURPOSE
Evaluates vacuum energy of particle (i.e. sqrt(mass^2+p^2) )
INPUTS
type(particle), intent(in) :: x
USAGE
(real)=FreeEnergy(x) with x of type(particle)
particleDefinition/kineticEnergy [ Functions ]
[ Top ] [ particleDefinition ] [ Functions ]
NAME
real function kineticEnergy(x)
PURPOSE
Evaluates kinetic Energy= sqrt(p^2+m^2)-m for a particle
INPUTS
type(particle), intent(in) :: x
USAGE
(real)=kineticEnergy(x) with x of type particle
RETURN VALUE
real
particleDefinition/absMom [ Functions ]
[ Top ] [ particleDefinition ] [ Functions ]
NAME
real function absMom(x)
PURPOSE
Evaluates absolute momentum= SQRT(p,p) for a particle
INPUTS
type(particle), intent(in) :: x
USAGE
(real)=absMom(x) with x of type particle
RETURN VALUE
real
particleDefinition/absPos [ Functions ]
[ Top ] [ particleDefinition ] [ Functions ]
NAME
real function absPos(x)
PURPOSE
Evaluates absolute position= SQRT(x,x) for a particle
INPUTS
type(particle), intent(in) :: x
USAGE
(real)=absPos(x) with x of type particle
RETURN VALUE
real
particleDefinition/rapidity [ Functions ]
[ Top ] [ particleDefinition ] [ Functions ]
NAME
real function rapidity(x)
PURPOSE
Evaluates rapidity y for a particle
INPUTS
type(particle), intent(in) :: x
USAGE
(real)=rapidity(x) with x of type particle
RETURN VALUE
real
particleDefinition/setToDefault [ Subroutines ]
[ Top ] [ particleDefinition ] [ Subroutines ]
NAME
subroutine setToDefault(teilchen)
PURPOSE
Reset the particle to default values.
INPUTS
- type(particle) :: teilchen
OUTPUT
Returns "teilchen" with all structure elements set to the default values. NOTE This routine is elemental, i.e. it can be applied to scalars as well as arrays.
particleDefinition/setNumberGuess [ Subroutines ]
[ Top ] [ particleDefinition ] [ Subroutines ]
NAME
subroutine setNumberGuess(teilchen)
PURPOSE
As the subroutine "setNumber", set the (unique) number of a particle. But here: Do this on a preliminary way.
INPUTS
- type(particle),intent(INout) :: teilchen
RESULT
teilchen%number is set
NOTES
During generation of high energetic events, the ("unique") number of a particle has already to be known before they are really inserted into the particle vector and the numbers are assigned. But some events are skipped an redone resulting in a new particle list. Therefore the former "SetNumberGuess" calls can be forgotten by a call to "resetNumberGuess" or can be kept via "AcceptGuessedNumbers" [A "Hurra" for the nomenclature ;)]
The Calls "SetNumberGuess(...); ...;AcepptGuessedNumbers" is equivalent to "SetNumber"
particleDefinition/resetNumberGuess [ Subroutines ]
[ Top ] [ particleDefinition ] [ Subroutines ]
NAME
subroutine resetNumberGuess(wasGuessed)
PURPOSE
forget all preliminary set "unique" numbers of particles
cf. "setNumberGuess"
INPUTS
- logical, OPTIONAL :: wasGuessed -- possible value for the Flag lastNumberWasGuessed
particleDefinition/AcceptGuessedNumbers [ Subroutines ]
[ Top ] [ particleDefinition ] [ Subroutines ]
NAME
subroutine AcceptGuessedNumbers()
PURPOSE
accept all preliminary set "unique" numbers of particles
cf. "setNumberGuess"
INPUTS
none
particleDefinition/getNumber [ Functions ]
[ Top ] [ particleDefinition ] [ Functions ]
NAME
integer function getNumber
PURPOSE
return the number, which would be given as the (unique) number of a particle in a next call of setNumber
INPUTS
module variable "number"
particleDefinition/setNumbersToDefault [ Subroutines ]
[ Top ] [ particleDefinition ] [ Subroutines ]
NAME
subroutine setNumbersToDefault
PURPOSE
Set particle number counters to default values. Needed to avoid overflows for large number of parallel ensembles and/or particles. Is called from initconfig at the beginning of every subsequent run.
INPUTS
particleDefinition/IsSamePart [ Functions ]
[ Top ] [ particleDefinition ] [ Functions ]
NAME
logical function IsSamePart(x,y)
PURPOSE
Compare two particles and return .TRUE., if:
- ID,
- Charge and
- antiparticle flag
are equal.
INPUTS
- type(particle), intent(in) :: x,y
particleDefinition/countParticles [ Functions ]
[ Top ] [ particleDefinition ] [ Functions ]
NAME
integer function countParticles(p,id)
PURPOSE
Counts how many particles with ID "id" are in a given particle vector "p".
INPUTS
- type(particle), dimension(:,:), intent(in) :: p -- particle vector
- integer, intent(in) :: id -- ID to check for
OUTPUT
- count
particleDefinition/getProductionPos [ Functions ]
[ Top ] [ particleDefinition ] [ Functions ]
NAME
function getProductionPos(p)
INPUTS
RESULT
real, dimension(1:3) -- the positions stored in p
PURPOSE
return the value stored in the filed ProductionPos, or a dummy value (-99.9,-99.9,-99.9) if unused