description: Increases the number of particles in a particle input file by sampling a simplified
distribution based the input file. Intended to be used to increase the number of particles
produced by a photoinjector simulation to improve stability of CSR and LSC simulations.
Can also add energy and density modulations for performing gain studies.
The algorithm is as follows:
Fit a 12th-order polynomial to p as a function of t. Evaluate the polynomial at 10,000
equispaced points to generate a lookup table for the momentum variation with time.
Compute the standard deviation of the momentum psd for blocks of 2,000 successive
particles. Fit this data with a 12th-order polynomial and evaluate it a 10,000 equispaced
points to generate a lookup table for psd as a function of t.
Create a histogram of t and smooth it with a low-pass filter having a cutoff at 0.1
THz. This may resulting in ringing at the ends of the histogram, which is clipped off by
masking with the original histogram.
Optionally modulate the histogram H(t) with a sinusoid, by multiplying the histogram
by (1 + dm)cos2πct∕λm, where dm is the modulation depth and λm is the modulation
wavelength. For non-zero dm, this will result in a longitudinal-density-modulated
distribution when the histogram is used as a probability distribution and sampled to
create time coordinates.
Sample the time histogram N times using a “quiet start” Halton sequence with
radix 2, where N is the number of desired particles. The sampling operation is
performed by first numerically computing the cumulative distribution function C(t) =
∫-∞tH(t′)dt′∕∫-∞∞H(t′)dt′. Inverting this to obtain t(C), we generate each sample
from H(t) by evaluating t(U), where U is a quantity on the interval [0, 1] generated from
the Halton sequence.
Create samples for other coordinates by quiet-sampling of gaussian distributions:
Scaled transverse coordinates , , ŷ, and using Halton radices 3, 5, 7, and 11,
respectively. For convenience in scaling (step 9), these are defined such that the
standard deviation of each coordinate is 10-4 and all coordinates are uncorrelated.
Scaled fractional momentum deviation δ1 using Halton radix 13, with unit standard
Interpolate the look-up tables to determine the mean pmean and standard deviation psd of the
momentum at each particle’s time coordinate. Use these to compute the individual particle
momenta using p = pmean + δ1psd.
Compute the projected transverse rms emittances and Twiss parameters for the original
Transform the scaled transverse phase-space coordinates to give the desired projected
Twiss parameters in the x and y planes. The x and y planes are assumed to be
smoothDist6 -input name -output name -factor number -rippleAmplitude %-rippleWavelength microns -smoothPasses num(500) -energyMod % -betaSlices n
input — A particle distribution file, such as might be used with sdds_beam.
output — A particle distribution file, such as might be used with sdds_beam.
-factor number — Factor by which to multiply the number of particles.
-rippleAmplitude value — Density ripple amplitude, in percent.
-energyMod value — Energy modulation amplitude, in percent. The wavelength is fixed
at 1 μm.
-rippleWavelength value — Density ripple and energy modulation wavelength, in
-betaSlices n — Number of longitudinal slices to use for analysis of twiss parameters.
The twiss parameters of the beam will vary step-wise from slice to slice. This
discontinuous variation may cause problems (e.g., unstable behavior).