at.acceptance.touschek#
Module to compute the touschek lifetime of the ring
Functions
|
Haissinski equation solver |
|
Touschek lifetime calculation |
|
Touschek scattering rate calculation |
- get_bunch_length_espread(ring, zn=None, bunch_curr=None, espread=None)[source]#
Haissinski equation solver
Solves the Haissinski formula and returns the bunch length and energy spread for given bunch current and \(Z/n\). If both
zn
andbunch_curr
areNone
, zero current case, otherwise both are needed for the calculation- Parameters:
ring – ring use for tracking
- Keyword Arguments:
zn=None – \(Z/n\) for the full ring
bunch_curr=None – Bunch current
espread=None – Energy spread, if
None
use lattice parameter
- Returns:
Bunch length, energy spread
- get_lifetime(ring, emity, bunch_curr, emitx=None, sigs=None, sigp=None, zn=None, momap=None, refpts=None, offset=None, **kwargs)[source]#
Touschek lifetime calculation
Computes the touschek lifetime using the Piwinski formula
- Parameters:
ring – ring use for tracking
emity – verticla emittance
bunch_curr – bunch current
- Keyword Arguments:
emitx=None – horizontal emittance
sigs=None – rms bunch length
sigp=None – energy spread
zn=None – full ring \(Z/n\)
momap=None – momentum aperture, has to be consistent with
refpts
if provided the momentum aperture is not calculatedrefpts=None –
refpts
where the momentum aperture is calculated, the default is to compute it for all elements in the ring,len(refpts)>2
is requiredresolution – minimum distance between 2 grid points, default=1.0e-3
amplitude – max. amplitude for
RADIAL
andCARTESIAN
or initial step inRECURSIVE
default = 0.1nturns=1024 – Number of turns for the tracking
dp=None – static momentum offset
offset – initial orbit. Default: closed orbit
grid_mode –
at.GridMode.CARTESIAN/RADIAL
track full vector (default).at.GridMode.RECURSIVE
: recursive searchuse_mp=False – Use python multiprocessing (
patpass
, default uselattice_pass
). In case multi-processing is not enabledGridMode
is forced toRECURSIVE
(most efficient in single core)verbose=False – Print out some inform
epsrel (epsabs,) – integral absolute and relative tolerances
- Returns:
tl – touschek lifetime, double expressed in seconds
ma – momentum aperture (len(refpts), 2) array
refpts – refpts used for momentum aperture calculation (len(refpts), ) array
Note
When``use_mp=True`` all the available CPUs will be used. This behavior can be changed by setting
at.DConstant.patpass_poolsize
to the desired valueWhen multiple
refpts
are provided particles are first projected to the beginning of the ring with tracking. Then, all particles are tracked up tonturns
. This allows to do most of the work in a single function call and allows for full parallelization.
- get_scattering_rate(ring, emity, bunch_curr, emitx=None, sigs=None, sigp=None, zn=None, momap=None, refpts=None, offset=None, **kwargs)[source]#
Touschek scattering rate calculation
Computes the touschek scattering using the Piwinski formula
- Parameters:
ring – ring use for tracking
emity – verticla emittance
bunch_curr – bunch current
- Keyword Arguments:
emitx=None – horizontal emittance
sigs=None – rms bunch length
sigp=None – energy spread
zn=None – full ring \(Z/n\)
momap=None – momentum aperture, has to be consistent with
refpts
if provided the momentum aperture is not calculatedrefpts=None –
refpts
where the momentum aperture is calculated, the default is to compute it for all elements in the ring,len(refpts)>2
is requiredresolution – minimum distance between 2 grid points, default=1.0e-3
amplitude – max. amplitude for
RADIAL
andCARTESIAN
or initial step inRECURSIVE
default = 0.1nturns=1024 – Number of turns for the tracking
dp=None – static momentum offset
grid_mode –
at.GridMode.CARTESIAN/RADIAL
track full vector (default).at.GridMode.RECURSIVE
: recursive searchuse_mp=False – Use python multiprocessing (
patpass
, default uselattice_pass
). In case multi-processing is not enabledGridMode
is forced toRECURSIVE
(most efficient in single core)verbose=False – Print out some inform
epsrel (epsabs,) – integral absolute and relative tolerances
- Returns:
scattering_rate – scattering rate double array (len(refpts), ) expressed in event/seconds
ma – momentum aperture (len(refpts), 2) array
refpts – refpts used for momentum aperture calculation (len(refpts), ) array