- type: setup command.
- function: set up for tracking and histogram analyzing of particle coordinates stored in an SDDS file.
- sequence: must follow run_control.
- Command syntax, including use of equations and subcommands, is discussed in 7.2.

&sdds_beam

STRING input = NULL;

STRING input_list = NULL;

STRING input_type = "elegant";

long n_particles_per_ring = 0;

STRING selection_parameter = NULL;

STRING selection_string = NULL;

long one_random_bunch = 0;

long reuse_bunch = 0;

long prebunched = -1;

long track_pages_separately = 0;

long use_bunched_mode = 0;

long fiducialization_bunch = 0;

long sample_interval = 1;

long n_tables_to_skip = 0;

long center_transversely = 0;

long center_arrival_time = 0;

double sample_fraction = 1;

double p_lower = 0.0;

double p_upper = 0.0;

long save_initial_coordinates = 1;

long reverse_t_sign = 0;

long n_duplicates = 0;

double duplicate_stagger[6] = {0, 0, 0, 0, 0, 0};

&end

STRING input = NULL;

STRING input_list = NULL;

STRING input_type = "elegant";

long n_particles_per_ring = 0;

STRING selection_parameter = NULL;

STRING selection_string = NULL;

long one_random_bunch = 0;

long reuse_bunch = 0;

long prebunched = -1;

long track_pages_separately = 0;

long use_bunched_mode = 0;

long fiducialization_bunch = 0;

long sample_interval = 1;

long n_tables_to_skip = 0;

long center_transversely = 0;

long center_arrival_time = 0;

double sample_fraction = 1;

double p_lower = 0.0;

double p_upper = 0.0;

long save_initial_coordinates = 1;

long reverse_t_sign = 0;

long n_duplicates = 0;

double duplicate_stagger[6] = {0, 0, 0, 0, 0, 0};

&end

- input — Name of an SDDS file containing coordinates of input particles.
- input_type — May be “elegant” or “spiffe”, indicating the name of the program that wrote the
input file. The expected data quantities for the different types are:
- elegant: (x,xp,y,yp,t,p), where x and y are in meters, xp = x
^{′}and xp = y^{′}are dimensionless, t is in seconds, and p = βγ is the dimensionless momentum. If this file is to be generated by the user, the expected units string in the column definitions should be “m”, “s”, and “m$be$nc” for meters, seconds and the dimensionless momentum, respectively. The particleID column may also be given; it should contain a positive integer that is unique for each particle. - spiffe: (r,z,pr,pz,pphi,t), where r and z are in meters, pr = β
_{r}γ, pz = β_{z}γ, p_{ϕ }= ωrγ∕c, and t is in seconds. If this file is to be generated by the user use the units strings described above.

- elegant: (x,xp,y,yp,t,p), where x and y are in meters, xp = x
- n_particles_per_ring — For spiffe data, gives the number of particles to generate for each ring of charge.
- selection_parameter — The name of a parameter in the SDDS file to be used for selection of pages of data.
- selection_string — The value of the selection_parameter selection parameter required for a page to be used. E.g., if one has a file from the shower program containing positrons, electrons, and photons, one might want to select only the positrons.
- one_random_bunch — A flag indicating whether, for spiffe data, a new random distribution should be calculated for each step of the simulation.
- reuse_bunch — A flag indicating whether to use the bunch again or not. If set, then the first bunch in the file is used repeatedly for as many tracking steps as requested. Otherwise, each bunch is used only once and the number of steps is limited to the number of bunches (e.g., the number of pages in the file when prebunched=0).
- prebunched — Deprecated. Use track_pages_separately instead.
- track_pages_separately — If non-zero, then separate pages of the input file are tracked separately. Otherwise, the entire file is tracked together.
- use_bunched_mode — If non-zero, then the IDSlotsPerBunch parameter is used to determine the bunch assignment of particles in the beam based on values in the particleID column. In particular, the bunch number is ⌊(I - 1)∕S⌋, where I is the particle ID and S=IDSlotsPerBunch.
- fiducialization_bunch — If non-negative, then rf cavities (e.g., RFCA, RFDF, RAMPRF) are phased to the indicated bunch (0 is the first bunch). Otherwise, rf cavities are phased to the entire beam (which is probably not what is wanted).
- sample_interval — If non-zero, only every sample_interval
^{th}particle is used. - n_tables_to_skip — Number of SDDS pages to skip at the beginning of the file.
- center_transversely — If non-zero, the transverse centroids of the distribution are made to be zero.
- center_arrival_time — If non-zero, the mean arrival time of particles at the start of the accelerator is set to zero.
- sample_fraction — If non-unity, the randomly selected fraction of the distribution to use.
- p_lower, p_upper — If different, the lower and upper limit on βγ of particles to use.
- save_initial_coordinates — A flag that, if set, results in saving initial coordinates of tracked particles in memory. This is the default behavior. If unset, the initial coordinates are not saved, but are reread from disk each time they are needed. This is more memory efficient and is useful for tracking very large numbers of particles.
- n_duplicates — This specifies duplicating the particles from the input file to allow
tracking more particles. n_duplicates specifies the number of duplications, where the
default value of 0 indicates no duplication. If n-fold duplication is invoked, the particle
ID of a new particle is equal to the particle ID of its parent particle plus iN
_{p}, where i = 1,...,n + 1 is the duplication index and N_{p}is the number of particles in the parent bunch. This should be kept in mind when using the particle ID to segregate the beam into bunches. - duplicate_stagger — Specifies offsetting of the coordinates x, x
^{′}, y, y^{′}, t, and δ for each duplication by the specified amounts. One assumes that some stochastic process such as synchrotron radiation will cause further differentiation of duplicate particles. One can also use SCATTER or DSCATTER elements in the beamline for this purpose.

semaphores