!----------------------------------------------------------------------------
! VUV-FEL beamline between BC2 and BC3
!----------------------------------------------------------------------------

 &NEWRUN
  Head='VUV-FEL beamline between BC2 and BC3'
  RUN = 001 
  Loop = .F.
  Distribution = 'bc2_out.ini'
  PHASE_SCAN = .F.
  AUTO_PHASE = .T.
  TRACK_ALL=.T.
  ZSTART = 24.8,  ZSTOP  = 67.2,   Zemit  = 1000,   Zphase = 1
  H_max = 0.005,   H_min = 0.001
  EmitS=.T.
  PhaseS=.T.
  TrackS=.F.
  RefS=.T.
  TcheckS=.F.
  check_ref_part=.T.
  High_res=.T.
  Lmagnetized=.F.
  MAX_STEP = 5000000
  LSUB_COR = .F
  Lprompt = .F
!  Screen(1)=0.770
!  Screen(2)=1.264
 /

 &SCAN
 /

 &CHARGE
  LSPCH = .T.
  Lmirror=.F,   
! Nrad=20,  Nlong_in=100
  Nrad=30,  Nlong_in=300
  Cell_var=2.0,  min_grid=0.0D-6,  Max_scale=0.02, N_min=100
 /
 
 &APERTURE
 /

 &FEM
 /

 &CAVITY
 ! design voltage: 235 MV
 ! estimated gradient for that: volt per cavity = 235 MV /16 = 14.6875 MV
 !                              average field ~ volt per cavity / 1.04 = 14.122 MV/m
 !                              peak field ~ 2*average field ~ 28.25 MV/m
 ! 2ter Versuch: 28.25 MV/m * 1.0867 = 30.70 MV/m
  Loop=.F
  LEField=.T
  !ACC2
  FILE_EField(1)='TESLA_8_9cellsnew.efld'
  Nue(1)=1.3, MaxE(1)=30.70, Phi(1)=-15.0, C_Smooth(1)=10, C_pos(1)=43.3

  !ACC3
  FILE_EField(2)='TESLA_8_9cellsnew.efld'
  Nue(2)=1.3, MaxE(2)=30.70, Phi(2)=-15.0, C_Smooth(2)=10, C_pos(2)=55.95
 /

 &SOLENOID
 /

 &QUADRUPOLE
  Loop=.F
  LQUAD=.T
! QMs at ACC1
! Q09ACC1, Q10ACC1

  ! Quadrupole Q1DBC2
  Q_length(1)=0.27
  Q_K(1)=-1.7201
  Q_pos(1)=25.44

  ! Quadrupole Q1.1DBC2
  Q_length(2)=0.27
  Q_K(2)=5.4385
  Q_pos(2)=26.04

  ! Quadrupole Q2DBC2
  Q_length(3)=0.27
  Q_K(3)=-4.8582
  Q_pos(3)=26.64

  ! Quadrupole Q2.2DBC2
  Q_length(4)=0.27
  Q_K(4)=1.2803
  Q_pos(4)=27.24

  ! Quadrupole Q3DBC2
  Q_length(5)=0.27
  Q_K(5)=2.3673
  Q_pos(5)=27.84

  ! Quadrupole Q4DBC2
  Q_length(6)=0.27
  Q_K(6)=-3.2434
  Q_pos(6)=28.44

  ! Quadrupole Q5DBC2
  Q_length(7)=0.27
  Q_K(7)=3.2434
  Q_pos(7)=29.39

  ! Quadrupole Q6DBC2
  Q_length(8)=0.27
  Q_K(8)=-3.2434
  Q_pos(8)=30.34

  ! Quadrupole Q7DBC2
  Q_length(9)=0.27
  Q_K(9)=3.2434
  Q_pos(9)=31.29

  ! Quadrupole Q8DBC2
  Q_length(10)=0.27
  Q_K(10)=-3.2434
  Q_pos(10)=32.24

  ! Quadrupole Q9DBC2
  Q_length(11)=0.27
  Q_K(11)=3.2434
  Q_pos(11)=33.19

  ! Quadrupole Q10DBC2
  Q_length(12)=0.27
  Q_K(12)=-3.2434
  Q_pos(12)=34.14

  ! Quadrupole Q10.3DBC2
  Q_length(13)=0.304
  Q_K(13)=1.0916
  Q_pos(13)=35.317

  ! Quadrupole Q11DBC2
  Q_length(14)=0.304
  Q_K(14)=2.0471
  Q_pos(14)=35.917

  ! Quadrupole Q12DBC2
  Q_length(15)=0.304
  Q_K(15)=-2.1263
  Q_pos(15)=36.517

  ! Quadrupole Q9ACC2
  Q_length(16)=0.15
  Q_K(16)=3.9884
  Q_pos(16)=49.6052

  ! Quadrupole Q10ACC2
  Q_length(17)=0.15
  Q_K(17)=-4.0099
  Q_pos(17)=49.8552

  ! Quadrupole Q9ACC3
  Q_length(18)=0.15
  Q_K(18)=0.97737
  Q_pos(18)=61.8066

  ! Quadrupole Q10ACC3
  Q_length(19)=0.15
  Q_K(19)=-0.4342
  Q_pos(19)=62.0566

  ! Quadrupole Q1UBC3
  Q_length(20)=0.3046
  Q_K(20)=-1.1865
  Q_pos(20)=65.091

  ! Quadrupole Q2UBC3
  Q_length(21)=0.3046
  Q_K(21)=0.98266
  Q_pos(21)=65.591
  /

 &DIPOLE
  LDipole=F
 /

 &CSR
  LCSR=.F
 /

 &ERROR
 /
