at.acceptance.touschek#

Module to compute the touschek lifetime of the ring

Functions

get_bunch_length_espread(ring[, zn, ...])

Haissinski equation solver

get_lifetime(ring, emity, bunch_curr[, ...])

Touschek lifetime calculation

get_scattering_rate(ring, emity, bunch_curr)

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 and bunch_curr are None, 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 calculated

  • refpts=Nonerefpts where the momentum aperture is calculated, the default is to compute it for all elements in the ring, len(refpts)>2 is required

  • resolution – minimum distance between 2 grid points, default=1.0e-3

  • amplitude – max. amplitude for RADIAL and CARTESIAN or initial step in RECURSIVE default = 0.1

  • nturns=1024 – Number of turns for the tracking

  • dp=None – static momentum offset

  • offset – initial orbit. Default: closed orbit

  • grid_modeat.GridMode.CARTESIAN/RADIAL track full vector (default). at.GridMode.RECURSIVE: recursive search

  • use_mp=False – Use python multiprocessing (patpass, default use lattice_pass). In case multi-processing is not enabled GridMode is forced to RECURSIVE (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 value

  • When multiple refpts are provided particles are first projected to the beginning of the ring with tracking. Then, all particles are tracked up to nturns. 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 calculated

  • refpts=Nonerefpts where the momentum aperture is calculated, the default is to compute it for all elements in the ring, len(refpts)>2 is required

  • resolution – minimum distance between 2 grid points, default=1.0e-3

  • amplitude – max. amplitude for RADIAL and CARTESIAN or initial step in RECURSIVE default = 0.1

  • nturns=1024 – Number of turns for the tracking

  • dp=None – static momentum offset

  • grid_modeat.GridMode.CARTESIAN/RADIAL track full vector (default). at.GridMode.RECURSIVE: recursive search

  • use_mp=False – Use python multiprocessing (patpass, default use lattice_pass). In case multi-processing is not enabled GridMode is forced to RECURSIVE (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