&run_setup
 lattice = v83_1_1_64_32_16_16.lte,
 use_beamline = iota,
 rootname = test,
 p_central_mev = 150.5101386,
&end

! Inserting here works fine
!&insert_elements
! element_def = "IBS0: IBSCATTER,verbose=0",
! name = IOTAIOR_P_,
! skip = 0,
! total_occurrences = 1,
! occurrence[0] = 1, !at very end, 2nd occurence
! verbose=1
!&end
!
!&insert_elements
! element_def = "WP: watch,filename="track.sdds"",
! name = CHRG,
! verbose=1
!&end

&run_control
 n_passes = 128,
 n_steps = 1,
&end

&twiss_output
 matched = 1,
 statistics = 1,
 radiation_integrals = 1,
 compute_driving_terms = 1
&end

!Inserting IBS here messes up moments computation downstream?
!&insert_elements
! element_def = "IBS0: IBSCATTER,verbose=0",
! name = IOTAIOR_P_,
! skip = 0,
! total_occurrences = 1,
! occurrence[0] = 1, !at very end, 2nd occurence
! verbose=1
!&end

&rf_setup
 harmonic = 4,
 total_voltage = 1000.0
&end

!Here, just inserting IBS works, but segfaults if you also add watchpoint
!&insert_elements
! element_def = "IBS0: IBSCATTER,verbose=0",
! name = IOTAIOR_P_,
! skip = 0,
! total_occurrences = 1,
! occurrence[0] = 1, !at very end, 2nd occurence
! verbose=1
!&end
!
!&insert_elements
! element_def = "WP: watch,filename="track.sdds"",
! name = CHRG,
! verbose=1
!&end

&moments_output
 final_values_only = 1,
 output_at_each_step = 1,
 verbosity = 3,
 matched = 1,
 equilibrium = 1,
 radiation = 1
&end

&bunched_beam
 n_particles_per_bunch = 1024,
 use_moments_output_values = 1,
&end

&track
&end

