&input                                                                                                                  
!<rf_quad(1:4)> freq_h,freq_v,amp_h,amp_v,phi_h,phi_v , t_max                                                           
rf_quad(2) = 0.985   1.  0.2 0.0 4.71 0. 20.e-6         !  good for dp=+-0.002 muons                                    
! <initial_offsets> :real - x, y, z, x-angle, y-angle, deltaE/E                                                         
    initial_offsets = 0.0  0.0 0.0 0.0 0. -0.002                                                                        
!   - offset of beam at entrance into the hole in the ring iron, with respect to the tangent through the center of the i
!    initial_offsets = -4.7671E-02  0. 0. 2.2134E-02 0. 0.                                                              
!    initial_offsets = -4.3477E-02  0. 0. 2.0681E-02 0. 0.                                                              
! <lat_file_name> :character string -  BMAD format lattice file                                                         
  lat_file_name = 'bmad_all_configs_fringe_inf_grid_fh.'                                                                
! <nturns> :integer - Number of turns to track                                                                          
  nturns   = 2000                                                                                                       
! The next several lines refer to the intial muon phase space distribution                                              
! <nmuons> :integer - Number of muons to track                                                                          
  nmuons = 1                                                                                                            
! <create_new_distribution> :logical - Create a new distribution                                                        
  create_new_distribution = T                                                                                           
! <seed>: integer - ! Random number seed. If seed =0 then random number set to system clock. If seed > 0 then it will be
  seed =0                                                                                                               
! <new_file> :character string - If you choose to create a new distribution it will be saved in new_file. If the name is
  new_file  = 'empty'                                                                                                   
! <muon_file> : If you choose to read an existing distribution, here is where the name is written.                      
!  muon_file = 'VDstop_DS_436_12000.dat'       ! read the phase space distribution off the target from this file. If bla
!  muon_file = 'particles_endm4m5_100.txt'                                                                              
! <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   = 2.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.03                                                                                                      
! <pzsigma> : sigma for pzdistr="gaus"                                                                                  
  pzsigma   = 0.02                                                                                                      
! <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      = 22.7e-9                                                                                                   
! <epsy> : vertical emittance at inflector assuming no losses in injection channel (m-rad)                              
  epsy      = 16.6e-9                                                                                                   
                                                                                                                        
! <twiss> :12-real - betax, betay, alphax, alphay, etax, etapx, etay, etapy, phix, phiy, gammax, gammay at inflector   ,
  twiss     = 2.0, 10.0, 0., 0.0, 0.0, 0., 0., 0., 0.7, 0.7, 0., 0.                                                     
! <twiss_ref> : Reference point within inflector for twiss parameters specified in previous line. 'end' = at inflector e
  twiss_ref = 'end'                                                                                                     
!<start_tracking_at_inflector_exit>: logical - if true then start tracking the distribution at the inflector exit, if fa
  start_tracking_at_inflector_exit = T                                                                                  
!<twiss_file>: logical - if true, write twiss parameters every cm to "twiss_file.dat", and write transfer matrices for a
  twiss_file = F                                        ! true => write twiss parameters every cm to "twiss_file.dat"   
!<ring_twiss>: character - if <ring_twiss> = 'open' then use input twiss parameters as starting point for propagation ar
!                          if <ring_twiss> = 'closed' then use closed ring twiss parameters as starting point for propag
 ring_twiss = 'closed'                                                                                                  
! <inf_aperture> :character string - inflector aperture: "none", "rect" (rectangular), "e821"('D' shaped aperture of 821
  inf_aperture = "e821"                                                                                                 
! <inflector_width> :real - defines offset of axis of inflector from magic radius. If inflector_width = 0.009, central a
  inflector_width = 0.009                                                                                               
! <inf_end_us> :logical - if true include scattering at  upstream  end of inflector (E821 coils)                        
  inf_end_us   = F                                                                                                      
! <inf_end_ds> :logical - if true include scattering at  downstream  end of inflector (E821 coils)                      
  inf_end_ds   = F                                                                                                      
! <enerloss> :logical - if true include energy loss with scattering in inflector(E821 coils)!                           
  enerloss = F                                                                                                          
! <inflector_angle> :real - angle of inflector axis with respect to tangent line. The rotation axis is the downstream en
!       If angle < 0 the inflector is rotated clockwise about its downstream end                                        
  inflector_angle = 0.0                                                                                                 
! <inflector_field> :6 reals - multiplier of Bmagic. If inflector_field = 1. then the inflector field = -Bmagic. Note th
  inflector_field = 1.0                                ! multiplier of Bmagic. 1.012747 * Bmagic = B_wuzeng             
                                                                                                                        
! <opt_incident> :logical - if true, the initial_offsets so that the trajectory emerges from the inflector on its axis a
  opt_incident = F                                                                                                      
!<inj_matrix_tracking> :logical - true: use matrices to propagate through injeciton channel, false: track using field ma
  inj_matrix_tracking = F                               ! if true, propagate trajectories through injection channel usei
                                                                                                                        
!<ring_theta> :real - Rotation of ring elements with respect to inflector exit                                          
  ring_theta      = 0.                                                                                                  
                                                                                                                        
!<kickerPlates> :integer - 989-curved plates, 821-flat plates, 1-uniform vertical field                                 
  kickerPlates    = 989                                      ! Controls shape of B-field: 1=uniform, 821, 989           
!<kickerCurcuit> :integer - Controls shape of pulse: 1=square kick, 821=RLC, 989=Blumlein                               
  kickerCircuit   = 20150328                                        ! Controls shape of pulse: 1=square kick, 821=RLC, 9
!<kickerFieldType> :integer -  Controls B-field calculation: 1=analytic, 2=mapped                                       
  kickerFieldType = 2                                       ! Controls B-field calculation: 1=analytic, 2=mapped        
!<kicker_params%kicker_field> : 3 reals - Bfield (T) for the three kicker mangets                                       
    kicker_params%kicker_field      =   235.7e-4   220.e-4   173.3e-4 ! Kick strength (Tesla) for 989 kick 1.76m kickers
    kicker_params%kicker_field      =   290.e-4   290.0e-4  290.0e-4 ! Kick strength (Tesla) for 989 kick 1.27m kickers 
    kicker_params%kicker_field      =   303.e-4   303.0e-4  303.0e-4 ! Kick strength (Tesla) for 989 kick 1.27m kickers 
    kicker_params%kicker_field      =   326.6e-4   304.8e-4  240.2e-4 ! Kick strength (Tesla) for 989 kick 1.27m kickers
!    kicker_params%kicker_field      =   172.e-4   267.e-4  183.e-4 ! Kick strength (Tesla) for 989 kick 1.27m kickers (
    kicker_params%kicker_field      =   0.   0.  0. ! Kick strength (Tesla) for 989 kick 1.27m kickers                  
!    kicker_params%kicker_field      =   290.e-4   290.0e-4  290.0e-4 ! Kick strength (Tesla) for 989 kick 1.27m kickers
!<kicker_params%dtRise> : 3 reals - Rise time (seconds) of the flat top of the 3 kicker pulses                          
  kicker_params%dtRise   = 20.e-9 20.e-9 20.e-9 ! Kick  rise  (s)                                                       
!<kicker_params%dtFall> : 3 reals - Fall time (seconds) of the flat top of the 3 kicker pulses                          
  kicker_params%dtFall   = 20.e-9 20.e-9 20.e-9 ! Kick fall (s)                                                         
!<kicker_params%kick_width> : 3 reals - width of flat top of  3 kicker pulses                                           
  kicker_params%kick_width =   50.e-9   50.e-9   50.e-9   ! Kick width (seconds) -- doesn't apply to kickerCircuit=821  
!<kicker_tStart> : 3 reals - kicker start times, if kicker_tStart = -1 then automatically calculate kicker start time   
  kicker_tStart            =   2.0e-9   2.0e-9   2.0e-9   ! good choice for 127 cm kicker                               
!  kicker_tStart            =   10.0e-9   10.0e-9   10.0e-9   ! good choice for 60 cm kicker                            
                                                                                                                        
!<quad_plate> : logical - if true then include scattering in Q1 quad plates                                             
  quad_plate    = F                                    ! include scatter in Q1 quad plates                              
!<quadPlates> : integer -  821 or 989 (displaced Q1 outer plate)  -- controls shape of E-field for Q1_Long, 1           
  quadPlates    = 1                                        ! 821, 989 -- controls shape of E-field for Q1_Long          
  quadCircuit   = 1                                          ! 0=off at injection, ramped up with tauRC=5us; 1=storage p
!<quadFieldType>: integer,  1=analytic, 2=mapped                                                                        
  quadFieldType = 1                                                                                                     
!<quad_params>: 4 reals - sets voltage on quads corresponding approximately to 'field_index'                            
!  quad_params   = 0.175 0.175 0.175 0.175                    ! field_index(4)  (For the time being quads 2,3 and 4 all 
!  quad_params   = 0.1 0.1 0.1 0.1                    ! field_index(4)  (For the time being quads 2,3 and 4 all h       
  quad_params =  0.145  0.145  0.145  0.145  0.145  0.145  0.145  0.145  !19kV                                          
!<vparam_id>: integer - Determines parameter to be varied.                                                              
!                         0-nothing,  1-betax, 2-betay, 3-eta, 4-kick, 5-kick_width, 6-initial position offset, 7-initia
!                         8-kicker rise time, 9-kicker fall time, 10-inflector field (1.0=-B_magic), 11-initial energy o
!                         14-kicker_tStart                                                                              
  vparam_id = 0      ! 0-nothing,  1-betax, 2-betay, 3-eta, 4-kick, 5-kick_width, 6-initial position offset, 7-initial  
!<vparam_min> : real - minimum value of parameter to be varied                                                          
  vparam_min  = 0.02                                                                                                    
!<vparam_max> : real - maximum value of parameter to be varied                                                          
  vparam_max  = 0.026					     ! maximum of parameter to vary                                                           
!<delta_vparam>: real - change in value of parameter in each step                                                       
  delta_vparam = 0.001				     ! parameter step                                                                         
!<loop>: logical - if true vary parameter (vparam_id) accoring to - vparam_min,vparam_max,delta_vparam.  If false then d
  loop = F                                                                                                              
                                                                                                                        
                                                                                                                        
!<fringe_file>: field_file_struct                                                                                       
!               character_string - name of file with magnetic field map of fringe field in injection channel.           
!               real - grid_spacing                                                                                     
!               integer - type, type of read format = 1,2 (3 D map), 3 (extend 2D map to 3 dimensions) or 4 (uniform fie
!               integer - flag (miscellaneous)                                                                          
! possibilities include -  'injec_fld.dat'  0.5 0. 1 0,  or 'ring_inject_bfield3d_wuzheng_extended.dat'  0.5 0. 2  0    
  fringe_file = 'ring_inject_bfield3d_wuzheng_extended.dat'  0.5 0. 2  0                    !field map for fringe field,
!<inflector_file>: field_file_struct                                                                                    
!               character_string - name of file with magnetic field map of inflector field.                             
!               real - grid_spacing                                                                                     
!               integer - type, type of read format = 1,2 (3 D map), 3 (extend 2D map to 3 dimensions) or 4 (uniform fie
!               integer - flag (miscellaneous)                                                                          
! possibilities include -  'inf_field_alone.dat'  0.5 0.  1 0, 'uniform' 0.5 0. 4 0                                     
  inflector_file = 'inf_field_alone.dat' 0.5 0. 2 0             !field map for inflector field, grid spacing, gradient, 
                                                                                                                        
!<spin_tracking_on>: logical - if true then include spin tracking of muons. Default = true                              
 spin_tracking_on = F                                                                                                   
!<muon_decay>: logical - if true then include muon decay. Default = true                                                
 muon_decay_on = F                                                                                                      
!<make_movie>: logical - if true save trajectory and spin every 5cm and layout of quads and kicker. Create png files for
make_movie = F                                                                                                          
!<gnu_input_only>: logical - if true then write gnu_input.dat and stop. Default = false                                 
!<use_lattice_twiss>: logical - if true use twiss parameters defined in lattice file to propagate through injection line
use_lattice_twiss = F                                                                                                   
!<write_phase_space>: logical - if true write phase space coordinates of each muon to a file at each element on first tu
write_phase_space_file = F                                                                                              
!<save_element_by_element_info> - if true allocate array muon_ele(:,:) to save distribution at each element. To reduce m
save_element_by_element_info = F                                                                                        
!<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 = 20.e-9                                                                                                 
scraping_on = F                                                                                                         
!init_quad_focus = -0.145315  ! if = -0.145315 and if init_quad_steer = -0.145315 then same as  32kV, 22.7 kV config    
!init_quad_steer =  -0.145315                                                                                           
!init_quad_focus = -0.18421  ! if = -0.18421 and if init_quad_steer = -0.18421 then same as  19kV, 12 kV config if index
!init_quad_steer =  -0.18421                                                                                            
init_quad_focus = -0.14  ! if = -0.14 and if init_quad_steer = -0.14 then same as  25kV, 18 kV config if index=         
init_quad_steer =  -0.14                                                                                                
quad_ramp_start_time = 15.e-6                                                                                           
quad_ramp_end_time = 35.e-6                                                                                             
b_radial = 0                                                                                                            
error_fields = F                                                                                                        
azimuthal_exp_z ='BzFourier20170721.dat'  !'BzFourier20170628_LogID983.dat'                                             
azimuthal_exp_r= 'BrFourier2016.dat'                                                                                    
FiberScatter0 = F                                                                                                       
/                                                                                                                       
