EUROPEAN ORGANIZATION FOR NUCLEAR RESEARCH

BEAM: Set Beam Parameters

Many commands in MAD-X require the setting of various quantities related to the beam in the machine. Therefore, MAD-X will stop with a fatal error if an attempt is made to expand (USE) a sequence for which no BEAM command has been issued before.

The quantities are entered by a BEAM command:

BEAM, PARTICLE=name, MASS=real, CHARGE=real,
      ENERGY=real, PC=real, GAMMA=real, BETA=real, BRHO=real,
      EX=real, EXN=real, EY=real, EYN=real,
      ET=real, SIGT=real, SIGE=real,
      FREQ0=real, CIRC=real,
      KBUNCH=integer, NPART=real, BCURRENT=real,
      BUNCHED=logical, RADIATE=logical, BV=integer, SEQUENCE=name;
The attributes of the BEAM command are: The order of precedence for arguments is: particle->(mass+charge)
If the particle name given is recognized in the list above, the restmass and charge are set by MAD-X, and the MASS and CHARGE arguments are simply ignored. For other particles, and in particular for ions, any combination of name, mass and charge can be entered independently. The order of precedence for arguments is: energy->pc->gamma->beta->brho
Note that if the restmass is changed after the energy has been set, ie in separate BEAM commands, the energy is left unchanged and the momentum PC and relativistic factor GAMMA are recalculated. The order of precedence for arguments is: ex->exn, ey->eyn and et->sigt->sige.

Certain commands compute the synchrotron tune Qs taking into account the settings of RF cavities.
If Qs is non-zero, the relative energy spread and the bunch length are calculated with
sigma(E) / p0 c = (2 pi Qs Et / ETA C)1/2,

c sigma(t) = (ETA C Et / 2 pi Qs)1/2.

where C is the machine circumference, and ETA = GAMMA-2 - GAMMA(transition)-2.

Order and Precedence: Internally the BEAM command processes the parameters in the following order and with the following precedence (left to right):

    particle -> (mass+charge)
    energy -> pc -> gamma -> beta -> brho
    ex -> exn
    ey -> eyn
    current -> npart
    et -> sigt -> sige

Warning: BEAM updates, i.e. it replaces attributes explicitely mentioned, may calculate other attributes according to the precedence rules given, but does NOT return attributes not specified to default values! In order to reset to reset BEAM attributes to their default values, use the RESBEAM command.

Additional variables Some MAD-X modules may also compute and store data into a beam data block. These attributes may NOT be set directly through the BEAM command. The corresponding variables are:

Referring to BEAM data attributes
Expressions may refer to data in this beam data block using the notation

BEAM->attribute-name
or
BEAM%sequence->attribute-name.
This notation refers to the value of attribute-name found in the default BEAM, respectively the beam belonging to the sequence given. This can be used for receiving or using values, e.g.
value,beam%lhcb2->bv;
but also for storing values in the beam baknk:
beam->charge=-1;
Note however that this does NOT trigger an update of dependent variables and you are strongly advised against setting BEAM parameters with this method.

The current values in the BEAM bank can be obtained by the command

show,beam;
or to obtain the data for a beam linked to a named sequence: resp.
show,beam%sequence;

Examples:

! select electrons, set energy and emittances
BEAM, PARTICLE = ELECTRON, ENERGY = 50, EX = 1.E-6, EY = 1.E-8, SIGE = 1.E-3;
 ...

! turn on synchrotron radiation
BEAM, RADIATE;
 ...

! reset all values to their defaults, 
! ie positrons, energy = 1GeV, default emittances, no radiation...
RESBEAM;
 ...

! select new emittances
BEAM, EX = 2.E-5, EY = 3.E-7, SIGE = 4.E-3;

hansg 11.9.2000
Ghislain Roy - 09 May 2014