The program first_turn is used to track a single particle, compute closed orbit and twiss parameters, tunes, chromaticity, etc. Parameters are initialized in the lattice file bmad_ring.lat and on the command line.
g2_tracking is used to propagate a single particle or a distribution of particles. Tracking is initiated at the end of the M5 line or in the ring. Input parameters are set in an initialization file named input.dat as well as the lattice file bmad_g2_tracking.lat
Output: Twiss parameters and closed orbit are written to the file beta_eta_x_y.dat
-bash-4.2$ ./first_turn
Lattice file name ? (default= bmad.)bmad_ring.lat
lat_file = bmad_ring.lat
lat_file = bmad_ring.lat
[INFO] bmad_parser:
Parsing lattice file(s). This might take a minute or so...
[INFO] bmad_parser:
Created new digested file
Fractional momentum offset ? 0.001
Fractional momentum offset = 1.0000E-03
[WARNING] twiss_from_mat6:
1-TURN MATRIX MARGINALLY SYMPLECTIC WITH SYMPLECTIC ERROR OF: 0.0286
Q_x Q_y beta_x beta_y alpha_x alpha_y eta_x
Closed ring: 0.9505 0.3157 7.6251 22.1736 0.0382 -0.0156 7.9358
Initialize twiss ,(or use closed ring values ) (y/n) ? n
Closed orbit: 9.8786E-03 -2.9061E-04 -2.4785E-03 -9.5512E-07 0.0000E+00 1.0000E-03
Initialize orbit, (or use closed orbit values) (y/n) ? n
[WARNING] twiss_from_mat6:
1-TURN MATRIX MARGINALLY SYMPLECTIC WITH SYMPLECTIC ERROR OF: 0.0338
[WARNING] twiss_from_mat6:
1-TURN MATRIX MARGINALLY SYMPLECTIC WITH SYMPLECTIC ERROR OF: 0.0323
The length is 44.6790
-bash-4.2$
-bash-4.2$ ./first_turn
Lattice file name ? (default= bmad.)bmad_ring.lat
lat_file = bmad_ring.lat
lat_file = bmad_ring.lat
Fractional momentum offset ? 0.001
Fractional momentum offset = 1.0000E-03
[WARNING] twiss_from_mat6:
1-TURN MATRIX MARGINALLY SYMPLECTIC WITH SYMPLECTIC ERROR OF: 0.0286
Q_x Q_y beta_x beta_y alpha_x alpha_y eta_x
Closed ring: 0.9505 0.3157 7.6251 22.1736 0.0382 -0.0156 7.9358
Initialize twiss ,(or use closed ring values ) (y/n) ? y
Type betax, betay, alphax, alphay, etax (separate values with comma)
2. 10. 0. 0. 0.
Closed orbit: 9.8786E-03 -2.9061E-04 -2.4785E-03 -9.5512E-07 0.0000E+00 1.0000E-03
Initialize orbit, (or use closed orbit values) (y/n) ? y
x, px, y,py (separate values with comma)
0. 0. 0. 0.
Initial coordinates = 0.0000E+00 0.0000E+00 0.0000E+00 0.0000E+00 0.0000E+00 1.0000E-03
The length is 44.6790
Initialization file input.dat notes
! <nturns> :integer - Number of turns to track
nturns =1000
! <nmuons> :integer - Number of muons to track
nmuons = 100
!initial_offsets = <x>,<y>,<z>,<px><py><dp> (x,y,z are in meters, px, and py in rad, dp as fractional momentum offset)
initial_offsets = 0. 0. 0. 0. 0. 0. !magic momentum muon on the magic radius
initial_offsets = 0.001 0. 0. 0. 0. 0. !magic momentum muon displaced radially outward by 1mm
initial_offsets = 0.0 0. 0. 0.0 0.001 0. !magic momentum muon with initial vertical angle of 1mrad
initial_offsets = 0.0 0. 0. 0.0 0.0 0.001 !muon with 0.1% momentum offset
! <tdistr> : Time distribution of the muons, choices are "flat", "gaus", "e821", "e989" tdistr = "gauss" ! <tlength> : Width in time of distribution : (doesn't apply to tdistr="e821") tlength = 120.e-9 ! <tsigma> : standard deviation (width) of time distribution if it is gaussian, (sigma for tdistr="gaus", doesn't apply tsigma = 70.e-9 ! <pzdistr> : momentum distribution: "flat", "gaus" pzdistr = "gaus" ! <pz> : cutoff of longitudinal momentum distribution, (fractional energy offset with respect to reference) pz = 0.0 ! <pzsigma> : sigma for pzdistr="gaus" pzsigma = 0.0 ! <epsdistr> : emittance distribution at production target: "delta", "flat", "gaus" epsdistr = "gaus" ! <epsx> : horizontal emittance at inflector assuming no losses in injection channel (m-rad) epsx = 16.6e-6 ! <epsy> : vertical emittance at inflector assuming no losses in injection channel (m-rad) epsy = 16.6e-6
!<time_bin_width>: real - if non-zero, save moments vs time at end of each turn in bins of width = time_bin
time_bin_width = 10.e-9
Output:
# voltage h_tune v_tune 20.5 0.901 0.38 19.5 0.910 0.37 . . . . . .To plot tunes.dat type