Full API
Documentation for Beamlines.
Beamlines.AlignmentParams — Type
AlignmentParamsDescribe the alignment of the element with respect to the nominal position. Rotations are applied in order: tilt, x_rot, y_rot.
Properties
x_offset: Offset along x-axis [m]y_offset: Offset along y-axis [m]z_offset: Offset along z-axis [m]x_rot: Rotation around the x-axis [rad]y_rot: Rotation around the y-axis [rad]tilt: Rotation around the z-axis [rad]
Beamlines.ApertureParams — Type
ApertureParamsDescribe a mechanical aperture.
Properties
x1_limit: Left x-axis aperture edge [m]x2_limit: Right x-axis aperture edge [m]y1_limit: Lower y-axis aperture edge [m]y2_limit: Upper y-axis aperture edge [m]aperture_shape: Shape of the aperture, seeApertureShapeaperture_at: Longitudinal aperture location(s), seeApertureAtaperture_shifts_with_body:trueif the aperture position moves with element alignment,falseotherwise. Default istrue
Beamlines.BMultipoleParams — Type
BMultipoleParamsDefines magnetic (B) multipoles for an element.
A given multipole can be set using any of the following:
KnX: Order X normal strength in [1/m^(X+1)] (normalized, nonintegrated)KsX: Order X skew strength in [1/m^(X+1)] (normalized, nonintegrated)BnX: Order X normal strength in [T/m^X] (unnormalized, nonintegrated)BsX: Order X skew strength in [T/m^X] (unnormalized, nonintegrated)KnXL: Order X normal strength in [1/m^X] (normalized, integrated)KsXL: Order X skew strength in [1/m^X] (normalized, integrated)BnXL: Order X normal strength in [T/m^(X-1)] (unnormalized, integrated)BsXL: Order X skew strength in [T/m^(X-1)] (unnormalized, integrated)tiltX: Tilt to only order X multipole
The solenoidal multipole can be set using any of the above with X = sol and omitting the n/s, e.g. Ksol, Bsol, KsolL, BsolL.
The last set for a given multipole defines if both the normal and skew strengths for a given multipole order are normalized and integrated. E.g.
ele = LatElement(Kn1=0.1, Ks1=0.2, L=0.4) # Order 1 is normalized, nonintegrated
ele.Kn1L = 0.3 # Order 1 independent variables are now normalized, integrated
ele.Ks1L == 0.2*0.4 # true
ele.Bn1 = 0.5 # Order 1 independent variables are now unnormalized, nonintegrated
ele.Bs1 == 0.2*0.5/0.3 # true, set so that (Bs1/Bn1)_new = (Ks1L/Kn1L)_oldBeamlines.Beamline — Type
BeamlineStructure containing a vector of LatElements in an ordered sequence, and optionally a Context struct containing conrol variables associated with the beamline for convenience. The reference species (specified as species_ref and reference energy (specified as one of E_ref, pc_ref, p_over_q_ref, dE_ref, dpc_ref, or dp_over_q_ref) is uniform over the entire beamline. The most-recently specified of these reference energy quantites will be stored as the independent variable, in the first LatElement of the Beamline.
Properties
line: A read-only array ofLatElementsin the beamline, in ordercontext:Contextstruct containing control variables associated with the beamline. If in aBranch, this is shared by the wholeBranch(andLattice, if any), and setting it sets it for all of thembranch:Branchthat the beamline is placed in, if anybranch_index: Index of the beamline in theBranch, if in aBranch
Beamlines.Beamline — Method
Beamline(line; kwargs...)Constructs a Beamline out of the LatElements in the vector line. The LatElements in the Beamline will be automatically constructed as children of those LatElements in line, inheriting all of their properties.
The reference energy of the beamline may be optionally specified using one of the keyword arguments: E_ref, pc_ref, p_over_q_ref, dE_ref, dpc_ref, or dp_over_q_ref. Whichever of these is specified will be the independent variable. The species of the beamline may be optionally specified using the species_ref keyword argument. Specifying either of these keyword arguments will permanently override both the reference species and energy defined in the first LatElement – see the warning below.
Examples
qf = Quadrupole(Kn1=0.36, L=0.5)
d = Drift(L=1)
qd = Quadrupole(Kn1=-0.36, L=0.5)
fodo = Beamline([qf, d, qd, d], species_ref=Species("electron"), E_ref=18e9)Alternatively, one can specify the reference species/energy in the first element:
qf = Quadrupole(Kn1=0.36, L=0.5, species_ref=Species("electron"), E_ref=18e9)
d = Drift(L=1)
qd = Quadrupole(Kn1=-0.36, L=0.5)
fodo = Beamline([qf, d, qd, d])Keyword arguments
context: AContextstruct containing variables that can be stored in the beamline for convenience. If theBeamlineis put in aBranch, this is merged into theContextshared by the wholeBranch– seeBranch.species_ref: Reference species of the beamline.E_ref: Total reference energy [eV]pc_ref: Reference momentum [eV/c]p_over_q_ref: A signed reference magnetic rigidity [T * m]dE_ref: Change in total reference energy w.r.t. the directly-upstream beamline in units [eV]dpc_ref: Change in reference momentum w.r.t. the directly-upstream beamline in units [eV/c]dp_over_q_ref: Change in signed reference magnetic rigidty w.r.t. the directly upstream beamline [T * m]
Keyword arguments specified to the Beamline constructor will permanently override any corresponding properties specified in the first LatElement of the beamline. E.g.,
beg = Marker(species_ref=Species("electron"), E_ref=18e9)
a = Beamline([beg])
b = Beamline([beg], species_ref=Species("proton"), E_ref=1e9)
a.E_ref == beg.E_ref == 18e9 # true
b.E_ref == 1e9 # true
b.E_ref != beg.E_ref # true
# If `beg` is reset:
beg.species_ref = Species("positron")
# `a` will still inherit it, but `b` will not:
a.species_ref == beg.species_ref # true
b.species_ref == Species("proton") # true
b.species_ref != beg.species_ref # trueBeamlines.BeamlineParams — Type
BeamlineParamsDefines information for LatElements that are in a Beamline.
Properties
beamline:Beamlinethat thisLatElementis inbeamline_index: Index of thelinearray of theBeamlinethat this element is ats: Longitudinal position from the start of theBeamlineat the entrance of the element [m]s_downstream: Longitudinal position from the start of theBeamlineat the exit of the element [m]line: A read-only array ofLatElementsin the beamline, in ordercontext:Contextstruct containing control variables associated with the beamline. If in aBranch, this is shared by the wholeBranch(andLattice, if any), and setting it sets it for all of thembranch:Branchthat the beamline is placed in, if anybranch_index: Index of the beamline in theBranch, if in aBranch
Beamlines.BendKick — Type
BendKick(; order=4, opt_scheme=true)Symplectic integrator using a bend-kick Hamiltonian split.
Properties
order: Order of the integrator, supported are orders 2, 4, 6, 8, and 10. Default is 4opt_scheme: Iftrue, uses an optimized integration scheme, else uses the standard Yoshida scheme. Default istrue
Beamlines.BendParams — Type
BendParamsDefines a curvature in the reference coordinate system throught the element, as well as the edge angles of the element at the entrance and exit of the element. Does not specify any magnetic field.
Properties
g_ref: Coordinate system curvature [1 / m]tilt_ref: Tilt angle applied before the curvature, and undone after [rad]e1: Edge angle of the entrance of the element w.r.t. the entering coordinate system [rad]e2: Edge angle of the exit of the element w.r.t. the exit coordinate system [rad]edge1_int: Pole face field integral at the entrance [m]edge2_int: Pole face field integral at the exit [m]
Beamlines.Branch — Type
BranchStructure containing a vector of Beamlines, where currently each follows in-order, one after the other.
Properties
name: Name of theBranch. Default is""if not in a lattice and if in a lattice, the default is"bN"whereNis the index of the branch inlattice.branchesbeamlines: Vector of the beamlines in theBranchlattice:Latticethat the branch is placed in, if anylattice_index: Index of the branch in theLattice, if in aLatticecontext:Contextshared by theBranchand all of itsBeamlines, and by the wholeLatticeif theBranchis in one. Setting thecontextof any of them sets it for all of them.
Branch(beamlines; name = "", context = Context())Constructs a Branch given the vector of beamlines beamlines. The Branch holds copies (see copy(::Beamline)) of the Beamlines, whose LatElements are children of those of the corresponding Beamline in beamlines. The Beamlines in beamlines are not modified, so a Beamline may appear more than once and may also be used in other Branches. The contexts of the Beamlines and context are merged into a single Context shared by the Branch and all of its Beamlines. Variables in context take precedence over those in the Beamlines.
Example
ele = LatElement()
bl1 = Beamline([ele], E_ref=2e9, species_ref=Species("electron"))
bl2 = Beamline([ele], dE_ref=1e9)
branch = Branch([bl1, bl2])Branch(elements; species_ref0 = Species(), E_ref0 = nothing, pc_ref0 = nothing,
p_over_q_ref0 = nothing, name = "", context = Context())Constructs a Branch given the vector elements, which may contain LatElements, Beamlines, and Branches, in any combination:
- Consecutive
LatElements are made intoBeamlines. A newBeamlineis started at eachLatElementthat sets a reference species or energy (has anInitialBeamlineParams), so eachBeamlinehas a uniform reference species and energy. - A
Beamlineis included as a copy (seeBranch(beamlines)) whoseLatElements are children of those of theBeamline. The sameBeamlinemay appear more than once. - For a
Branch, each of itsBeamlines is included as a copy whoseLatElements are children of those in theBranch(as withcopy(::Branch)). The sameBranchmay appear more than once.
The reference species and energy of the first Beamline can be set with species_ref0 and one of E_ref0, pc_ref0, or p_over_q_ref0. These are only allowed if elements starts with a LatElement.
Example
beginning = Marker(E_ref=10e9, species_ref=Species("electron"))
rf0 = RFCavity(dE_ref=1e9)
next = LatElement()
branch = Branch([beginning, rf0, next]) # Partitioned into 2 `Beamline`s
arc = Beamline([Drift(L=1.0), SBend(L=2.0)])
cell = Branch([Quadrupole(L=0.5), Drift(L=1.0)])
branch2 = Branch([beginning, arc, cell, cell, Marker()]) # 5 `Beamline`sBeamlines.Context — Type
Context{T}A "scope" of variables that can be used when evaluating DefExprs. Contexts serve as a single structure that stores all (control) variables associated with beamline parameters. Contexts essentially act as structures with arbitrary field names. The type parameter T can be specified as the variables' return type, or Union of return types, to improve performance.
If a "get" is made of a variable not included in a given Context, then the "get" will fall-back to the global stack of contexts GLOBAL_CONTEXTS. The first instance from the top of the GLOBAL_CONTEXTS stack of the variable will be used as the variable value. This makes it easy to "push" and "pop" parameter settings one may be testing in an interactive environment.
Examples
julia> c1 = Context(a = 1, b = 2, c = 3);
julia> push!(GLOBAL_CONTEXTS, c1);
julia> c2 = Context(a = 4);
julia> d = DefExpr(c -> c.a + c.b);
julia> d() # Uses c1.a and c1.b from the GLOBAL_CONTEXTS
3
julia> d(c2) # Uses c2.a, but falls-back to c1.b from GLOBAL_CONTEXTS
6
julia> push!(GLOBAL_CONTEXTS, c2);
julia> d() # Now uses c2.a and c1.b both from GLOBAL_CONTEXTS
6
julia> pop!(GLOBAL_CONTEXTS);
julia> d()
3Beamlines also store a context, which is passed to all DefExprs when getting parameters from LatElements that are in a beamline:
julia> c3 = Context(Kn1=0.36);
julia> qf = Quadrupole(Kn1=DefExpr(c -> c.Kn1), L=0.5);
julia> bl = Beamline([qf], context=c3);
julia> bl[qf][1].Kn1
0.36Notice that trying to access the value of Kn1 directly from qf does not work since c3 is not stored where it can be found:
julia> qf.Kn1
ERROR: Variable Kn1 is not defined in the local Context nor in GLOBAL_CONTEXTS
julia> push!(GLOBAL_CONTEXTS, c3) # Make c3 available globally
julia> qf.Kn1 # Now this works
0.36Beamlines.Controller — Type
ControllerAn eagerly-evaluated controller of LatElement properties or other Controller properties. Similar to classical Bmad's "Overlay" or "Group".
Also see set!.
In SciBmad, it is generally preferred to use the lazily-evaluated DefExpr for deferred expressions.
Examples
qf = Quadrupole(Kn1=0.36, L=0.5)
qd = Quadrupole(Kn1=-0.36, L=0.5)
c1 = Controller(
(qf, :Kn1) => (ele; x) -> x,
(qd, :Kn1) => (ele; x) -> -x;
vars = (; x = 0.0,)
)
# Now we can vary both simultaneously:
c1.x = 60.
qf.Kn1 == -qd.Kn1 == 60 # true
# Controllers also include the element itself. This can
# be useful if the current elements' values should be
# used in the function:
c2 = Controller(
(qf, :Kn1) => (ele; dKn1) -> ele.Kn1 + dKn1,
(qd, :Kn1) => (ele; dKn1) -> ele.Kn1 - dKn1;
vars = (; dKn1 = 0.0,)
)
c2.dKn1 = 20
qf.Kn1 == -qd.Kn1 == 80 # true
# Controllers can also be used to control other controllers:
c3 = Controller(
(c1, :x) => (ctrl; dx) -> ctrl.x + dx;
vars = (; dx = 0.0,)
)Beamlines.DefExpr — Type
DefExpr{T}A lazily-evaluated deferred expression returning type T. Deferred expressions are lambda functions that "close" over a variable in the current scope. They can be used to specify inter-dependent parameters in an accelerator and guarantee that no parameter ever becomes "stale".
Also see Context.
Examples
julia> a = 0.36;
julia> qf = Quadrupole(Kn1L=DefExpr(()->a)); # captures variable a
julia> qf.Kn1L
0.36
julia> a = 0.7
0.7
julia> qf.Kn1L
0.7Slightly better performance may be achieved by explicitly typing the captured variable:
julia> b::Float64 = 0.2;
julia> qf = Quadrupole(Kn1L=DefExpr(()->b)); # captures variable b with known type
julia> qf.Kn1L
0.2
julia> b = 0.4
0.4
julia> qf.Kn1L
0.4Deferred expressions can be treated and operated with as regular numbers, even outside the context of Beamlines, and can be evaluated by calling it like a function with no arguments (with ()):
julia> c = 64;
julia> cd = DefExpr(()->sin(c));
julia> c = pi;
julia> cd = DefExpr(()->sin(c));
julia> cd()
0.0
julia> c = pi/2;
julia> cd()
1.0
julia> dd = cd + 5;
julia> dd()
6.0An optional Context argument can be provided:
julia> d = DefExpr(c -> c.a + c.b);
julia> c1 = Context(a = 1, b = 2);
julia> d(c1)
3Beamlines.DriftKick — Type
DriftKick(; order=4, opt_scheme=true)Symplectic integrator using a drift-kick Hamiltonian split.
Properties
order: Order of the integrator, supported are orders 2, 4, 6, 8, and 10. Default is 4opt_scheme: Iftrue, uses an optimized integration scheme, else uses the standard Yoshida scheme. Default istrue
Beamlines.EMFieldParams — Type
EMFieldParamsDefines the electromagnetic field of an element as a function em_field(x, y, s, t, p=nothing) where p is a tuple of parameters that may be used inside the function.
Properties
em_field: Function with arguments (x, y, s, t, p) the returns a tuple of the EM field values (Ex, Ey, Ez, Bx, By, Bz) at the given point.em_field_params: Tuple of parameters passed to theem_fieldfunction. Default isnothingem_field_normalized: Iftrue, then EM field values returned are normalized byp_over_q_ref; default isfalse.
Beamlines.EMultipoleParams — Type
EMultipoleParamsDefines electric (E) multipoles for an element.
A given multipole can be set using any of the following:
EnX: Order X normal strength in [V/m^(X+1)] (nonintegrated)EsX: Order X skew strength in [V/m^(X+1)] (nonintegrated)EnXL: Order X normal strength in [V/m^X] (integrated)EsXL: Order X skew strength in [V/m^X] (integrated)etiltX: Tilt to only order X multipole
Beamlines.Exact — Type
Exact()Tracking method specifying "exact" transformations, e.g. patches, custom maps, thin multipoles, etc.
Beamlines.FourPotentialParams — Type
FourPotentialParamsDefines the electromagnetic four-potential of an element as a function four_potential(x, y, s, t, p=nothing) where p is a tuple of parameters that may be used inside the function.
Properties:
four_potential: Function with arguments(x, y, s, t, p=nothing)that returns a two component
tuple (C, D) with both C and D being themselves tuples:⠀ C = (ϕ, Ax, Ay, As)⠀ D = (∂ϕ/∂x, ∂ϕ/∂y, ∂ϕ/∂s, ∂ϕ/∂t, ⠀ ∂Ax/∂x, ∂Ax/∂y, ∂Ax/∂s, ∂Ax/∂t, ⠀ ∂Ay/∂x, ∂Ay/∂y, ∂Ay/∂s, ∂Ay/∂t, ⠀ ∂As/∂x, ∂As/∂y, ∂As/∂s, ∂As/∂t)
- four_potential_params: Tuple of parameters passed to the four_potential function. Default is nothing
four_potential_normalized: Iftrue, then potential/derivatives returned are normalized byp_over_q_ref; default isfalse.
Beamlines.IBSParams — Type
IBSParamsDefines intra-beam scattering modelling.
Properties
ibs_model: AIBSModelthat specifies which intra-beam scattering model is used
Beamlines.IgnoreParams — Type
IgnoreParamsHolds a list of parameter groups of a LatElement to be ignored, which allows parameter groups to be switched off without removing them from the element. Beamlines itself only stores the list: what ignoring a parameter group means is up to downstream code, such as tracking.
ele = Quadrupole(L=0.5, Kn1=0.3, x_offset=1e-3)
ele.ignore_params = [AlignmentParams] # Ignore the AlignmentParams
ele.ignore_params = [AlignmentParams, BMultipoleParams] # Also ignore the BMultipoleParams
ele.ignore_params = [] # Ignore nothingignore_params can also be set as a keyword argument, e.g. Quadrupole(L=0.5, Kn1=0.3, ignore_params=[BMultipoleParams]). The value must be a vector, even for a single parameter group, e.g. ele.ignore_params = [AlignmentParams].
Properties
ignore_params: List of parameter groups of the element to be ignored, e.g.[BMultipoleParams]
Beamlines.Implicit — Type
Implicit(; order=4, opt_scheme=true, use_newton=false)Implicit symplectic integrator for arbitrary electromagnetic potentials.
Properties
order: Order of the integrator, supported are orders 2, 4, 6, 8, and 10. Default is 4opt_scheme: Iftrue, uses an optimized integration scheme, else uses the standard Yoshida scheme. Default istrueuse_newton: Iftrue, Newton's method is used to solve the implicit step, else fixed point iteration is used. Default isfalse
Beamlines.InheritParams — Type
InheritParamsStores a parent LatElement through which any parameter groups NOT present in the "child" element containing the InheritParams would inherit. E.g., if the child element has its own BeamlineParams, then any property from the BeamlineParams parameter group would be read/ write to the child's BeamlineParams.
Properties:
parent: ParentLatElementto inherit parameter groups from for both reading and writing.
Beamlines.InitialBeamlineParams — Type
InitialBeamlineParamsDefines the reference species and energy of the beamline. These parameters may be "set" in the first element of the beamline or at the Beamline level, and retrieved at any element in the beamline. If the reference species or energy is not set, then it will inherit that quantity from an upstream beamline if in a Branch.
Properties
species_ref: Reference species of the beamlineE_ref: Total reference energy [eV]pc_ref: Reference momentum [eV/c]p_over_q_ref: A signed reference magnetic rigidity [T * m]dE_ref: Change in total reference energy w.r.t. the directly-upstream beamline [eV]dpc_ref: Change in reference momentum w.r.t. the directly-upstream beamline [eV/c]dp_over_q_ref: Change in signed reference magnetic rigidty w.r.t. the directly-upstream beamline [T * m]
Beamlines.LatElement — Type
LatElementThe basic building block which makes up a Beamline. May be something physical like a quadrupole magnet, or something non-physical like a point in the accelerator you want to mark. A LatElement may define a region in space distinguished by the presence of (possibly time-varying) electromagnetic fields, materials, apertures and other possible properties.
LatElement properties are split into "parameter groups" for convenient organization:
AlignmentParams ApertureParams BMultipoleParams
x_offset x1_limit KnX
y_offset x2_limit KsX
z_offset y1_limit BnX
x_rot y2_limit BsX
y_rot aperture_shape KnXL
tilt aperture_at KsXL
aperture_shifts_with_body BnXL
BsXL
tiltX
BeamlineParams BendParams EMFieldParams
beamline g_ref em_field
beamline_index tilt_ref em_field_params
s e1 em_field_normalized
s_downstream e2
line edge1_int
context edge2_int
branch
branch_index
EMultipoleParams FourPotentialParams IBSParams
EnX four_potential ibs_model
EsX four_potential_params
EnXL four_potential_normalized
EsXL
etiltX
IgnoreParams InitialBeamlineParams MapParams
ignore_params species_ref transport_map
E_ref transport_map_params
pc_ref
p_over_q_ref
dE_ref
dpc_ref
dp_over_q_ref
MetaParams PatchParams RFParams
alias dt rf_frequency
label dx harmon
description dy phi0
dz zero_phase
dx_rot traveling_wave
dy_rot is_crabcavity
dz_rot
UniversalParams
kind
name
L
fringe_at
n_steps
ds_step
n_slices
tracking_method
rad_damping
rad_fluctuations
To set a property, use the natural syntax:
ele = LatElement()
ele.L = 1 # Length
ele.Kn1 = 2 # Normal quadrupole strength
ele.rf_frequency = 1e6 For detailed descriptions of properties in a given parameter group, see the documentation for that parameter group.
Beamlines.Lattice — Type
LatticeStructure containing a vector of Branches.
Properties
name: Name of theLattice. Defaults to blank"".branches: Vector of the branches in theLattice. These are copies of theBranches theLatticewas constructed with, which are left unmodifiedcontext:Contextshared by theLattice, all of itsBranches, and all of theirBeamlines. Setting thecontextof any of them sets it for all of them.
Beamlines.Lattice — Method
Lattice(branches::Vector{Branch}; name = "", context = Context())Constructs a Lattice given the vector of branches branches. The Lattice holds copies (see copy(::Branch)) of the Branches, whose LatElements are children of those of the corresponding Branch in branches. The Branches in branches are not modified, so a Branch may appear more than once and may also be used in other Lattices. Branches without a name are named "b<i>", where <i> is the index of the branch. The contexts of the Branches and context are merged into a single Context shared by the Lattice, all of its Branches, and all of their Beamlines. Variables in context take precedence over those in the Branches.
Example
bl1 = Beamline([Marker(E_ref=10e9, species_ref=Species("electron")), Drift(L=1)])
bl2 = Beamline([Drift(L=2)])
lattice = Lattice([Branch([bl1]), Branch([bl2])])Lattice(beamlines::Vector{Beamline}; name = "", context = Context())Constructs a Lattice containing a single Branch made up of the vector of Beamlines beamlines. As with Branch(beamlines), the Branch holds copies of the Beamlines and beamlines is not modified.
Example
bl1 = Beamline([Marker(E_ref=10e9, species_ref=Species("electron")), Drift(L=1)])
bl2 = Beamline([Drift(L=2)])
lattice = Lattice([bl1, bl2]) # Equivalent to Lattice([Branch([bl1, bl2])])Beamlines.MapParams — Type
MapParamsDefines any arbitrary function to transport particle coordinates' and optionally spin quaternions. This could be a matrix, a neural network, a phase trombone, etc.
The input for the transport_map must be (v, q, p=nothing), where v is a tuple of the input phase space coordinates (x, px, y, py, z, pz) and q is nothing is there is no spin tracking, else q is a tuple of the input quaternion (q0, q1, q2, q3). p may be a tuple of parameters that can be used inside of the transport_map. This might be neural network weights, for example, or perhaps phase evolutions for a phase trombone.
For GPU compatibility, it is necessary that your function transport_map is GPU compatible: there should be no type instabilities. You should also try to make your transport_map be branchless, so both the CPU and GPU can vectorize it.
transport_map_params should contain the tuple that is passed into p at the time of tracking.
Properties:
transport_map: Arbitrary function that transports particles' coordinatesv, and optionally spin quaternionsq. Must have the signature<your map name>(v, q, p=nothing)and returns the output as a tuple(v, q)transport_map_params: Parameters of the transport map that will be inputted as thepvariable intransport_map
Example
using StaticArrays
random_matrix = @SMatrix rand(6,6) # use StaticArrays for GPU compatibility
function matrix(v, q::Nothing, p) # `q::Nothing` -> no spin tracking
# Vectorizable matrix multiplication by `p`:
vx = sum(p[1,:] .* v)
vpx = sum(p[2,:] .* v)
vy = sum(p[3,:] .* v)
vpy = sum(p[4,:] .* v)
vz = sum(p[5,:] .* v)
vpz = sum(p[6,:] .* v)
return ((vx, vpx, vy, vpy, vz, vpz), q)
end
m = LatElement(transport_map=matrix, transport_map_params=random_matrix)Beamlines.MatrixKick — Type
MatrixKick(; order=4, opt_scheme=true)Symplectic integrator using a matrix-kick Hamiltonian split.
Properties
order: Order of the integrator, supported are orders 2, 4, 6, 8, and 10. Default is 4opt_scheme: Iftrue, uses an optimized integration scheme, else uses the standard Yoshida scheme. Default istrue
Beamlines.MetaParams — Type
MetaParamsDefines extra String properties that may be useful for pattern matching or storing extra information about a given element.
Properties
alias: Alternate name for the element as a stringlabel: A label stringdescription: A descriptive string
Beamlines.PatchParams — Type
PatchParamsDefines properties for patches, which change the reference coordinate system. Rotations are applied in order: dz_rot, dx_rot, dy_rot.
Properties
dt: Reference time shift [s]dx: New coordinate system offset in the x-direction [m]dy: New coordinate system offset in the y-direction [m]dz: New coordinate system offset in the z-direction [m]dx_rot: Rotation of coordinate system around the initial x-axis [rad]dy_rot: Rotation of coordinate system around the initial y-axis [rad]dz_rot: Rotation of coordinate system around the initial z-axis [rad]
Beamlines.RFParams — Type
RFParamsDefines parameters generally associated with radiofrequency (RF) cavities. The frequency of the oscillating electromagnetic field may be optionally specified using the property rf_frequency or harmon; whichever of these is set last will be the independent variable.
Properties
rf_frequency: Frequency of the oscillating electromagnetic field [Hz]harmon: Harmonic number of the oscillating electromagnetic field w.r.t. the length of the entire containingBeamline[1]phi0: Phase offset of the oscillating field w.r.t.zero_phase[rad]zero_phase: APhaseRefthat specifies whatphi0should mean, seePhaseReftraveling_wave:trueif traveling wave,falseif standing waveis_crabcavity:trueif this is a crab cavity,falseotherwise
Beamlines.RK4 — Type
RK4()Fourth order Runge Kutta integrator, not symplectic.
Beamlines.SaganCavity — Type
SaganCavity(; n_cells = -1, L_active = -1.0)Integrator for RF cavities using the Sagan Cavity model.
Properties
n_cells: Number cells in the cavity. If negative, then the approximate half wavelength between cells is used, and if zero then a single kick is applied. Default is-1L_active: Active length of the cavity. If negative, then the element length is used. Default is-1
Beamlines.SolenoidKick — Type
SolenoidKick(; order=4, opt_scheme=true)Symplectic integrator using a solenoid-kick Hamiltonian split.
Properties
order: Order of the integrator, supported are orders 2, 4, 6, 8, and 10. Default is 4opt_scheme: Iftrue, uses an optimized integration scheme, else uses the standard Yoshida scheme. Default istrue
Beamlines.UniversalParams — Type
UniversalParamsDescribes the kind, name, length, and tracking method for a LatElement.
Properties
kind: String specifing the "kind", of an element, e.g. "Quadrupole"name: The name of an element as a stringL: Length of the element [m]fringe_at: AFringethat specifies which, if any, element ends should include fringe field modelling. Default isFringe.BothEndsn_steps: Number of integrator steps to take per element slice, default is 1ds_step: Length of each integrator step to take per element slice, such thatn_steps = ceil(L / n_slices / ds_step)n_slices: Number of slices to split the element into in tracking, typically so that collective effects can be applied multiple times in an element. If no collective effects are included, then prefer to varyn_steps/ds_stepinstead for performance.tracking_method: Tracking method for the elementrad_damping:trueif the deterministic effect of synchrotron radiation is included,falseotherwise. Defaults tofalserad_fluctuations:trueif the stochastic radiation kicks are included,falseotherwise. Defaults tofalse
Beamlines._Branch — Type
mutable struct _Branch{T<:_AbstractBeamline} <: _AbstractBranch_Branch exists to break a mutual type recursion since Beamline has a reference to a Branch, and Branch needs a vector of Beamlines. Julia < v1.14 has no forward declarations, so to get around this, _Branch is used.
Why not just use Branch{T} and skip defining _Branch? This could be done but in this case Branch would become a UnionAll rather than a concrete type leading to type instability.
Beamlines._EleAtom — Type
struct _EleAtomA parsed {branch>>}{kind::}name{#N} element match. index is nonzero if name is an element index, and instance is nonzero if there is a #N suffix.
Beamlines._NameMatcher — Type
struct _NameMatcherHolds the information needed to turn the name parts of a match string into Regexes. is_regex is true if the match string was a Regex, in which case compile_options and match_options are the options of that Regex.
Beamlines._SearchLine — Type
struct _SearchLineA line of elements searched by findelements: the elements of a Branch, or of a Beamline when a Beamline is searched, along with the name of the Branch the elements are in. The name is nothing if the elements are not in a Branch.
Base.copy — Method
Base.copy(bl::Beamline)Copy of bl that is not in any Branch and has a copy of the Context of bl. Each LatElement of the copy is a new element that inherits (via InheritParams) from the corresponding element of bl and has its own BeamlineParams. Parameters are therefore shared with bl through inheritance, while the position of each element (s, beamline, etc.) is that in the copy. bl is not modified.
Base.empty! — Method
empty!(::Beamline)Removes BeamlineParams from all elements in the Beamline and empties the array of LatElements.
WARNING: this is irreversible.
Base.getindex — Method
Base.getindex(bl::Beamline, pattern::Union{AbstractString,Regex}) -> Vector{LatElement}Same as findelements(bl, pattern). Example: bl["Quadrupole::q*"] or bl[r"q\d+"].
Base.getindex — Method
Base.getindex(branch::Branch, pattern::Union{AbstractString,Regex}) -> Vector{LatElement}Same as findelements(branch, pattern). Example: branch["Quadrupole::q*"] or branch[r"q\d+"].
Base.getindex — Method
Base.getindex(lat::Lattice, pattern::Union{AbstractString,Regex}) -> Vector{Branch}
Base.getindex(lat::Lattice, branches, pattern::Union{AbstractString,Regex}) -> Vector{LatElement}With one index, returns the branches of lat that match pattern, the same as findbranches(lat, pattern).
With two indexes, returns the elements that match pattern in the branches selected by branches, which is : (all branches), a branch index, or a branch pattern as used with findbranches. The elements are in the order of the branches and then their order in the branch. lat[:, pattern] is the same as findelements(lat, pattern).
The one index form always returns branches and the two index form always returns elements, so the type of the result does not depend on what is matched.
Examples
lat["ring"] # The branches named "ring".
lat["2"] # The second branch.
lat[r"x.*"] # Branches whose name starts with "x".
lat[:, "q*"] # Elements whose name starts with "q" in all branches.
lat["ring", "q*"] # Elements whose name starts with "q" in the branches named "ring".
lat[2, "Quadrupole::*"] # Quadrupoles in the second branch.
lat[:, "ring>>7"] # 7th element of the branch named "ring".Base.merge — Method
merge(c::Context, cs::Context...)Construct a new Context containing the variables of all of the given Contexts. If a variable is defined in more than one of the Contexts, the value from the last one is used. The type parameter of the returned Context is the promote_type of the type parameters of the inputs, and each value is converted to it using coerce. For example, merging a Context{Float32} with a Context{Float64} gives a Context{Float64}. Only the variables stored in the given Contexts are included; variables from GLOBAL_CONTEXTS are not.
Examples
julia> c1 = Context(a = 1, b = 2);
julia> c2 = Context(c = 3, d = 4);
julia> c3 = merge(c1, c2);
julia> c3.a + c3.d
5
julia> c4 = merge(Context{Int}(a = 1), Context{Float64}(b = 2.0));
julia> typeof(c4)
Context{Float64}
julia> c4.a
1.0Beamlines.BPM — Method
BPM(; L=0f0, kwargs...)Constructs a LatElement with kind = "BPM". The default tracking_method is Exact() for any L. Any tracking_method in kwargs overrides the default.
See the documentation for LatElement.
Beamlines.BeamBeam — Method
BeamBeam(; L=0f0, kwargs...)Constructs a LatElement with kind = "BeamBeam". The default tracking_method is Implicit() for any L. Any tracking_method in kwargs overrides the default.
See the documentation for LatElement.
Beamlines.CrabCavity — Method
CrabCavity(; L=0f0, kwargs...)Constructs a LatElement with kind = "CrabCavity" and is_crabcavity = true. If L != 0, the default tracking_method is SolenoidKick(), else Exact(). Any tracking_method in kwargs overrides the default.
See the documentation for LatElement.
Beamlines.Drift — Method
Drift(; L=0f0, kwargs...)Constructs a LatElement with kind = "Drift". If L != 0, the default tracking_method is DriftKick(), else Exact(). Any tracking_method in kwargs overrides the default.
See the documentation for LatElement.
Beamlines.HKicker — Method
HKicker(; L=0f0, kwargs...)Constructs a LatElement with kind = "HKicker". If L != 0, the default tracking_method is DriftKick(), else Exact(). Any tracking_method in kwargs overrides the default.
See the documentation for LatElement.
Beamlines.Kicker — Method
Kicker(; L=0f0, kwargs...)Constructs a LatElement with kind = "Kicker". If L != 0, the default tracking_method is DriftKick(), else Exact(). Any tracking_method in kwargs overrides the default.
See the documentation for LatElement.
Beamlines.Map — Method
Map(; L=0f0, kwargs...)Constructs a LatElement with kind = "Map". The default tracking_method is Exact() for any L. Any tracking_method in kwargs overrides the default.
See the documentation for LatElement.
Beamlines.Marker — Method
Marker(; L=0f0, kwargs...)Constructs a LatElement with kind = "Marker". The default tracking_method is Exact() for any L. Any tracking_method in kwargs overrides the default.
See the documentation for LatElement.
Beamlines.Multipole — Method
Multipole(; L=0f0, kwargs...)Constructs a LatElement with kind = "Multipole". If L != 0, the default tracking_method is DriftKick(), else Exact(). Any tracking_method in kwargs overrides the default.
See the documentation for LatElement.
Beamlines.Octupole — Method
Octupole(; L=0f0, kwargs...)Constructs a LatElement with kind = "Octupole". If L != 0, the default tracking_method is DriftKick(), else Exact(). Any tracking_method in kwargs overrides the default.
See the documentation for LatElement.
Beamlines.Patch — Method
Patch(; L=0f0, kwargs...)Constructs a LatElement with kind = "Patch". The default tracking_method is Exact() for any L. Any tracking_method in kwargs overrides the default.
See the documentation for LatElement.
Beamlines.Quadrupole — Method
Quadrupole(; L=0f0, kwargs...)Constructs a LatElement with kind = "Quadrupole". If L != 0, the default tracking_method is MatrixKick(), else Exact(). Any tracking_method in kwargs overrides the default.
See the documentation for LatElement.
Beamlines.RFCavity — Method
RFCavity(; L=0f0, kwargs...)Constructs a LatElement with kind = "RFCavity". If L != 0, the default tracking_method is SolenoidKick(), else Exact(). Any tracking_method in kwargs overrides the default.
See the documentation for LatElement.
Beamlines.SBend — Method
SBend(; L=0f0, kwargs...)Constructs a LatElement with kind = "SBend". If L != 0, the default tracking_method is BendKick(), else Exact(). Any tracking_method in kwargs overrides the default.
See the documentation for LatElement.
Beamlines.Sextupole — Method
Sextupole(; L=0f0, kwargs...)Constructs a LatElement with kind = "Sextupole". If L != 0, the default tracking_method is DriftKick(), else Exact(). Any tracking_method in kwargs overrides the default.
See the documentation for LatElement.
Beamlines.Solenoid — Method
Solenoid(; L=0f0, kwargs...)Constructs a LatElement with kind = "Solenoid". If L != 0, the default tracking_method is SolenoidKick(), else Exact(). Any tracking_method in kwargs overrides the default.
See the documentation for LatElement.
Beamlines.VKicker — Method
VKicker(; L=0f0, kwargs...)Constructs a LatElement with kind = "VKicker". If L != 0, the default tracking_method is DriftKick(), else Exact(). Any tracking_method in kwargs overrides the default.
See the documentation for LatElement.
Beamlines._context — Method
_context(bl::Beamline)Return the Context of bl: the Context stored in the Lattice or Branch that bl is in, if any, else the Context stored in bl itself. See _context(::Branch).
Beamlines._context — Method
_context(branch::Branch)Return the Context of branch: the Context stored in the Lattice that branch is in, if any, else the Context stored in branch itself.
The Context of a Lattice, or of a Branch not in a Lattice, is stored only at that highest level. The Branches and Beamlines below it store NULL_CONTEXT, which is set when they are put in the Branch or Lattice. Setting the context property at any level sets the field of the highest level only.
Beamlines._eval_ele_atom — Method
_eval_ele_atom(lines::Vector{_SearchLine}, a::_EleAtom) -> Vector{_EleID}IDs of the elements in lines that match the atom a. For each line that passes the branch qualifier, the elements are selected by name (or index), then by kind, and then the #N instance is picked.
Beamlines._eval_ele_range — Method
_eval_ele_range(lines, a1::_EleAtom, a2::_EleAtom, nm::_NameMatcher) -> Vector{_EleID}IDs of the elements in the range a1:a2: all elements from the element matched by a1 to the element matched by a2, inclusive. The range is evaluated separately in each line where both a1 and a2 match, and wraps around the end of the line if a2 comes before a1.
Beamlines._eval_match_str — Method
_eval_match_str(atom_ids::Function, nm::_NameMatcher, texts, ops) -> Vector{_EleID}Evaluates the lexed match string texts/ops with the union (,) and intersection (&) operators, & having the lower precedence. Each piece between the ,s is evaluated by atom_ids(texts, ops) -> Vector{_EleID}, which findelements and findbranches supply and which handles a single atom or a range (:). Returned are the unique IDs, sorted so they are in lattice order. findbranches uses (1, branch index) as the ID of a branch.
Beamlines._lex_match_str — Method
_lex_match_str(str::AbstractString, is_regex::Bool) -> (texts, ops)Splits the match string str at the operators in _MATCH_OPS. Returned are the vector ops of operators and the vector texts of the (whitespace stripped) strings between them, with length(texts) == length(ops) + 1. If is_regex is true, characters that are escaped or are within a group (...), character class [...], or {n,m} quantifier of the regex are never treated as operators.
Beamlines._name_regex — Method
_name_regex(nm::_NameMatcher, text::AbstractString) -> RegexRegex that matches a whole name to the name part text of a match string. If the match string is a Regex, text is compiled with the flags of the match string, anchored at both ends. Otherwise text is a Bmad wild card pattern converted by _wildcard_regex.
Beamlines._parse_ele_atom — Method
_parse_ele_atom(nm::_NameMatcher, texts::Vector{String}, ops::Vector{String}) -> _EleAtomParses the texts/ops sequence of a single atom {branch>>}{kind::}name{#N}, where ops contains only >>, ::, and #, each at most once and in that order.
Beamlines._search_lines — Method
_search_lines(where::Union{Lattice,Branch,Beamline}) -> Vector{_SearchLine}The lines searched by findelements: one per branch of a Lattice, the Branch itself, or the Beamline itself. Element indexes, #N instances, and ranges are all relative to a line.
Beamlines._split_at_op — Method
_split_at_op(texts, ops, op::String) -> Vector{Tuple{Vector{String},Vector{String}}}Splits the texts/ops sequence returned by _lex_match_str at each occurrence of the operator op. Each returned piece is itself a (texts, ops) sequence with length(texts) == length(ops) + 1. For example, splitting a, b::c at "," gives the pieces (["a"], []) and (["b", "c"], ["::"]).
Beamlines._wildcard_regex — Method
_wildcard_regex(pattern::AbstractString) -> RegexConverts pattern, which may contain the Bmad wild card characters * (matches any number of characters including zero) and % or ? (each matches any single character), to a Regex that matches whole strings. All other characters match only themselves.
Beamlines.deval — Function
deval(d, c::Context=NULL_CONTEXT)Evaluates d in the Context c if it is a DefExpr, else returns d. E.g. deval(rawget(ele, :Kn1), c) for an element in a Beamline with Context c is ele.Kn1.
For a parameter group, returns a new parameter group with every DefExpr evaluated, or the parameter group itself if it contains no DefExpr.
Beamlines.elements — Method
elements(eles_dict)For more Pythonic-workflows, elements receives a dictionary with key as the element name and value as the element, and sets the name attribute for each element equal to its key.
Julia users should generally use the @elements macro instead.
Beamlines.findbranches — Method
findbranches(lat::Lattice, pattern::Union{AbstractString,Regex}) -> Vector{Branch}Returns all the Branches in lat that match pattern, in the order of the branches in lat. Each branch appears at most once.
pattern is built from atoms that are either a branch name or an integer index of the branch in lat. Atoms may be combined with , (union) and & (intersection). Names are matched as with findelements: a String pattern may use the Bmad wild card characters *, %, and ? while with a Regex pattern the names are Julia regular expressions that must match the whole name.
Examples
findbranches(lat, "ring") # The branch named "ring".
findbranches(lat, "x*, 1") # Branches whose name starts with "x" and the first branch.
findbranches(lat, r"b[0-9]+") # Branches named "b" followed by digits.See also findelements.
Beamlines.findchildren — Method
findchildren(ele::LatElement, bl::Beamline)Finds all LatElements in the Beamline bl that inherit from ele, either directly (ele is the parent) or through a chain of parents. For example, the elements of a Beamline in a Branch are children of the elements of the Beamline used to create the Branch, which are in turn children of the elements used to create that Beamline.
Beamlines.findelements — Method
findelements(where::Union{Lattice,Branch,Beamline}, pattern::Union{AbstractString,Regex}) -> Vector{LatElement}Returns all the LatElements in where that match pattern. where may be a Lattice, a Branch, or a Beamline. The returned elements are ordered by the order of the branches followed by their order in the branch, and each element appears at most once. No match is not an error, and an empty vector is returned.
Syntax
The syntax is based on Bmad's. An "atom" is of the form
{branch>>}{kind::}name{#N}where {...} marks an optional part and
branchMatch only elements in aBranchwhose name matches.kindMatch only elements whosekindiskind, e.g.Quadrupole. This must be an exact match.nameElement name to match, or an integer element index where the first element of aBranch(or of theBeamlinewhenwhereis aBeamline) has index 1. With an index and nobranch, the element with that index in each branch searched is matched.#NMatch only theNth element in each branch that matches the rest of the atom.
Atoms may be combined:
atom1:atom2 # Range: All elements from atom1 through atom2 inclusive.
set1, set2 # Union.
set1 & set2 # Intersection.& has the lowest precedence, so A, B & C is the intersection of A, B with C. A range is evaluated in each branch where both atom1 and atom2 match, and it is an error if either matches more than one element in that branch. If atom2 comes before atom1, the range wraps around the end of the branch.
Name matching
If pattern is a String, the branch and element names may use the Bmad wild card characters *, which matches any number of characters (including zero), and % or ?, either of which matches any single character. There are no other wildcard characters here.
If pattern is a Regex, e.g. r"q[0-9]+", the branch and element names are Julia regular expressions. Each must match the whole name, so r"Q" does not match an element named Q1. The flags of pattern (e.g. i for case insensitive) are applied to each. Operator characters in a regex group (...), character class [...], or quantifier {n,m}, or that are escaped with a backslash, are part of the regular expression.
Matching is case sensitive unless the i flag is used with a Regex.
Examples
findelements(lat, "q*") # Elements whose name begins with "q".
findelements(lat, r"q.*") # Same as above using a regex.
findelements(lat, r"q.*"i) # Same as above but case insensitive, so "Q1" also matches.
findelements(lat, "Quadrupole::q%") # Quadrupoles with a two character name starting with "q".
findelements(lat, "Quadrupole::q?") # Same as above. "?" and "%" are equivalent.
findelements(lat, "ring>>7") # 7th element of the branch named "ring".
findelements(lat, "b*>>bpm#2") # 2nd element named "bpm" in each branch with a name
# starting with "b".
findelements(lat, "m1:m2") # Elements from "m1" through "m2" in a line.
findelements(lat, "Marker::* & m1:m2") # Markers from "m1" through "m2".
findelements(lat, "q1, q2") # Elements named "q1" or "q2".
findelements(lat, r"(q|s)[0-9]{1,2}") # Regex with operator characters in a group and quantifier.See also findbranches.
Beamlines.isactive — Method
isactive(p) -> BoolReturns true if the parameter group p should be used in tracking. isactive(nothing) is always false. By default a parameter group is active, however some parameter groups define their own criteria, e.g. RFParams is only active if voltage != 0.
The isactive function does not check the ignore_params list.
Beamlines.isapprox_ignoring — Method
isapprox_ignoring(a::LatElement, b::LatElement, ignore::Type{<:AbstractParams}...)Same as isapprox(a, b) except that the parameter groups ignore are also not compared. BeamlineParams and MetaParams are never compared, and an IgnoreParams with an empty list is treated as no IgnoreParams.
This only affects the comparison: it is unrelated to the ignore_params list of IgnoreParams.
Beamlines.rawget — Method
rawget(p::AbstractParams, key::Symbol)
rawget(ele::LatElement, key::Symbol)Gets the independent variable key of the parameter group p or of the element ele exactly as it is stored, without evaluating deferred expressions: e.g. a DefExpr set for Kn1 is returned as that DefExpr. Evaluating it with deval in the Context of the element's Beamline gives getproperty(ele, key).
Properties which are not independent variables but computed from them (e.g. Kn1L or Bn1 when Kn1 was set last, E_ref when p_over_q_ref was set, s) cannot be gotten raw, and give an error.
Examples
julia> a = 0.36;
julia> qf = Quadrupole(Kn1=DefExpr(()->a), L=0.5);
julia> d = rawget(qf, :Kn1);
julia> qf.Kn1 = 2*d; # Twice the stored expression, still dependent on a
julia> a = 0.4;
julia> qf.Kn1
0.8Beamlines.scalarize! — Method
scalarize!(bl::Beamline)Modifies the Beamline and its LatElements so all parameters are regular number types. This may be needed after optimizing the element's parameters using e.g. ForwardDiff, ReverseDiff, or GTPSA, which will set the parameter equal to a special number type that propagates the gradients.
Beamlines.scalarize! — Method
scalarize!(branch::Branch)Modifies all Beamlines and their LatElements in the Branch so all parameters are regular number types. This may be needed after optimizing the element's parameters using e.g. ForwardDiff, ReverseDiff, or GTPSA, which will set the parameter equal to a special number type that propagates the gradients.
Beamlines.scalarize! — Method
scalarize!(ele::LatElement)Modifies the LatElement so all element-level parameters are regular number types. This may be needed after optimizing the element's parameters using e.g. ForwardDiff, ReverseDiff, or GTPSA, which will set the parameter equal to a special number type that propagates the gradients.
Beamlines.scalarize — Method
scalarize(t)Value of t with derivative parts removed: ForwardDiff Duals and ReverseDiff tracked values are unwrapped at every nesting level, and a TPS gives its scalar part. Arrays are processed elementwise and parameter groups fieldwise; any other value is returned unchanged.
Beamlines.set! — Method
set!(controller)Resets all controlled LatElements and Controllers in controller to the most recently set values of that controller.
Beamlines.writebl — Method
writebl is internal, still being developed, and may change at any time. General users should NOT use it yet.
Beamlines.@elements — Macro
@elements ...;
@elements begin
...
endCan be applied before the definition of any LatElement(s) in order to make set the element name equal to the variable symbol automatically.
Examples
julia> @elements qf = Quadrupole();
julia> qf.name
"qf"
julia> @elements begin
my_drift = Drift(L=0.5);
my_sextupole = Sextupole(Kn2L=3.2);
end;
julia> my_drift.name
"my_drift"
julia> my_sextupole.name
"my_sextupole"Beamlines.ApertureAt — Module
@enumx ApertureAt::UInt8 Entrance Exit BothEndsDefines at which ends of the element the aperture should be applied
Beamlines.ApertureShape — Module
@enumx ApertureShape::UInt8 Elliptical RectangularDefines the shape of the aperture
Beamlines.PhaseRef — Module
@enumx PhaseRef::UInt8 Accelerating BelowTransition AboveTransitionSets what zero phi0 RF phase means
Accelerating: Zero phase is the maximum accelerating phase.BelowTransition: Zero phase is at the stable zero crossing for particles below transition.AboveTransition: Zero phase is at the stable zero crossing for particles above transition.
Beamlines.RateMeaning — Module
@enumx RateMeaning::Int8 RFFrequency=false Harmon=true Indeterminate=-1Specifies which independent variable is stored in the RFParams.
Beamlines.Fringe — Module
@enumx Fringe::Int8 NoEnd BothEnds EntranceEnd ExitEndDefines which ends fringe field modelling should be included
Beamlines.IBSModel — Module
@enumx IBSModel::Int8 None Gaussian GaussianDampingOnly GaussianFluctuationsOnlyWhich intra-beam scattering model should be used.