### TABLE OF CONTENTS

- 1. /energyCalc

## /energyCalc [ Modules ]

NAME

module **energyCalc**

PURPOSE

Incorporates routines to evaluate the one-particle energy of a given particle and a routine for making a so called energy correction to a given final state.

## energyCalc/accuracy [ Global module-variables ]

[ Top ] [ energyCalc ] [ Global module-variables ]

PURPOSE

Determines **accuracy** of energy determination in the determination of
the one particle energy. Units : GeV.

SOURCE

real, parameter ::accuracy=0.0005

## energyCalc/updateEnergies [ Subroutines ]

[ Top ] [ energyCalc ] [ Subroutines ]

NAME

subroutine **updateEnergies**(teilchen,check_in)

PURPOSE

Routine updates energies of the particles

INPUTS

- type(particle), dimension(:) :: teilchen -- particle array
- logical, OPTIONAL :: check_in -- flag for 'energyDetermination'

OUTPUT

## energyCalc/energyDetermination [ Subroutines ]

[ Top ] [ energyCalc ] [ Subroutines ]

NAME

subroutine **energyDetermination**(teilchen,betaToCF,countMax_in,error_out,check,warn,ForbidCoulomb)

PURPOSE

This subroutine determines the one-particle energy E with a momentum-dependent scalar potential that is defined in the local rest frame.

NOTES

- We keep p(1:3) and m constant.
- To solve: p**2=E**2-p(1:3)**2=(m+s(E))**2
- The scalar potential s is only defined in the LRF.
- First we try to find the solution f(E)=0 via a the newton method, f(E)=m_eff**2-p**2=m_eff**2+p(1:3)**2-E**2 with m_eff=m+s(E) by the iteration E(i+2)=E(i+1)-f(i+1)*(E(i+1)-E(i))/(f(i+1)-f(i)).
- If the newton method fails, we try it again via a bisection method
- At the end, the Coulomb potential is added.

INPUTS

- type(particle) :: teilchen -- Particle to be considered.
- real,dimension (1:3), OPTIONAL :: betaToCF -- Velocity of "Calculation Frame" in the frame where the particle's momentum is defined.
- integer, OPTIONAL :: countMax_in -- maximal number of cycles to find a solution (default=10000)
- logical, OPTIONAL :: check -- check for energy conservation (Default: .false.)
- logical, OPTIONAL :: warn -- if true, a warning message is issued, if the incomming momentum is too large (otherwise, this is skipped silently). (Default: .true.)
- logical, OPTIONAL :: ForbidCoulomb -- if true, the Coulomb potential is NOT added to p0 (needed by 'propagate', where the coulomb force is treated seperately) (Default: .false.)

OUTPUT

## energyDetermination/m_eff_sqr [ Functions ]

[ Top ] [ energyDetermination ] [ Functions ]

NAME

real function **m_eff_sqr**(teilchenIN,density,enerOut)

PURPOSE

Evaluate m_eff**2=(m+S)**2 of a given particle by boosting to the LRF-Frame, where S is the scalar potential.

## energyCalc/energyCorrection [ Subroutines ]

[ Top ] [ energyCalc ] [ Subroutines ]

NAME

subroutine **energyCorrection** (srqts, betaToLRF, betaToCM, mediumAtCollision,
finalState, successFlag, potentialFailure, verbose)

PURPOSE

Gets the finalState particles with vacuum kinematics in the CM Frame. Also the real srts of the final state is handed over to the routine. Then this routine tries to solve energy and momentum conservation by the ansatz described in the cross section documentation. . Therefore it evaluates the scaling factor "x" which is used to scale the CM-momenta of the final states. This is done by a Regula-Falsi-Method. We search of a zero of the function "deltaSrts" which depends on this scaling factor x.

IMPORTANT : Output are the final state particles in the calculation frame!

INPUTS

- real, intent(in) :: srtS
- real, intent(in), dimension(1:3) :: betaToLRF -- velocity of LRF - NOT USED right now!!!
- real, intent(in), dimension(1:3) :: betaToCM -- velocity of CM frame in calculation frame
- type(medium), intent(in) :: mediumAtCollision
- type(particle), dimension(:) , intent (INOUT) :: finalState -- In CM frame
- logical, OPTIONAL :: verbose -- flag print messages on/off (default: on)

OUTPUT

- type(particle), dimension(:) , intent (INOUT) :: finalState -- In calculation frame
- logical, intent(out) :: successFlag
- logical, optional :: potentialFailure -- is returned .true. if it fails due to neglecting perturbative potentials

NOTES

If the iteration fails successFlag is set to .false. as output. Now is used also in the RMF mode (only function deltaSrts is modified).

## energyCorrection/deltaSrts [ Functions ]

[ Top ] [ energyCorrection ] [ Functions ]

NAME

real function **deltaSrts**(x)

PURPOSE

Evaluates sqrt(s)-Sum(Energies in CM frame). This value is the size of the energy non-conservation. The sum is depend on the scaling factor for the three momenta