TABLE OF CONTENTS
- 1. /particleDefinition
- 1.1. particleDefinition/particle
- 1.2. particleDefinition/sqrtS
- 1.3. particleDefinition/setNumber
- 1.4. particleDefinition/FreeEnergy
- 1.5. particleDefinition/kineticEnergy
- 1.6. particleDefinition/absMom
- 1.7. particleDefinition/absPos
- 1.8. particleDefinition/rapidity
- 1.9. particleDefinition/setToDefault
- 1.10. particleDefinition/setNumberGuess
- 1.11. particleDefinition/resetNumberGuess
- 1.12. particleDefinition/AcceptGuessedNumbers
- 1.13. particleDefinition/getNumber
- 1.14. particleDefinition/setNumbersToDefault
- 1.15. particleDefinition/IsSamePart
- 1.16. particleDefinition/IsElastic
- 1.17. particleDefinition/countParticles
/particleDefinition [ Modules ]
NAME
module particleDefinition
PURPOSE
Here type(particle) is defined. This module includes also functions for this type.
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 real, dimension (1:3) :: position=0. real, dimension (0:3) :: momentum=0. real, dimension (1:3) :: velocity=0. ! velocity=dr/dt in calculation 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 :: lastCollisionTime=0. ! time of last collision real :: productionTime=0. ! time of production real :: formationTime=0. ! time of formation real :: perWeight=0. ! perturbative weight real :: scaleCS=1. ! scaling factor for hadron cross section (during formation) real :: offshellParameter=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 :: antiparticle=.false. logical :: perturbative=.false. logical :: in_Formation=.false. 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/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()
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/IsElastic [ Functions ]
[ Top ] [ particleDefinition ] [ Functions ]
NAME
logical function IsElastic (in, out)
PURPOSE
Given two ingoing and two outgoing particles, check if this is an elastic collision.
INPUTS
- type(particle), dimension(2), intent(in) :: in,out
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
OUTPUT
- count