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

 &NEWRUN
  Head='VUV-FEL beamline between BC3 and COLL'
  RUN = 1
  Loop = .F
  Nloop = 1
  Distribution = 'bc3_out.ini'
  Lmagnetized=.F
  EmitS=.T
  PhaseS=.T
  TrackS=.F
  RefS=.T
  TcheckS=.F
  check_ref_part=.T
  High_res=.T
  TRACK_ALL=.T
  PHASE_SCAN = .F
  AUTO_PHASE = .T
  ZSTART = 80
!
! Q9TCOL_end: z=138.529  (Nina's list)
!               151.9334  = 151.795+0.5*0.2768
! distance Q9TCOL to D1ECOL_start = 138.884-138.529 = 0.355
! D1ECOL_start = 152.2884
! ---> 0.1m before 1st mag. of dogleg = 152.1884
!
  ZSTOP  = 152.1884
  Zemit  = 100
  Zphase = 2
  H_max = 0.005
  H_min = 0.001
  MAX_STEP = 5000000
  LSUB_COR = .F
!  Screen(1)=0.770
!  Screen(2)=1.264
 /

 &SCAN
 /

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

 &FEM
 /

 &CAVITY
 !
 ! 380MV + 8*(MaxE(1)+MaxE(2))/2.0902 = 450.8MV
 ! 394MV + 8*(MaxE(1)+MaxE(2)+MaxE(3))/2.0902= 700MeV
 !
 !
  Loop=.F
  LEField=.T
  !ACC4
  FILE_EField(1)='TESLA_8_9cellsnew.efld'
  Nue(1)=1.3
!  MaxE(1)=14.0
  MaxE(1)=26.65
  Phi(1)=0
  C_Smooth(1)=10
  C_pos(1)=92.7

  !ACC5
  FILE_EField(2)='TESLA_8_9cellsnew.efld'
  Nue(2)=1.3
!  MaxE(2)=4.5
  MaxE(1)=26.65
  Phi(2)=0
  C_Smooth(2)=10
  C_pos(2)=105.2

  !ACC6 // NEW //
  FILE_EField(3)='TESLA_8_9cellsnew.efld'
  Nue(3)=1.3
!  MaxE(3)=4.5
  MaxE(1)=26.65
  Phi(3)=0
  C_Smooth(3)=10
  C_pos(3)=117.7
 /
 
 &SOLENOID
 /

&QUADRUPOLE
Loop=.F
Lquad=.T

! Quadrupole Q1DBC3
Q_length(1)=0.2768
!Q_K(1)=0   !Calculated Value
Q_K(1)=0.09951   !Design Value
Q_pos(1)=82.598

! Quadrupole Q2DBC3
Q_length(2)=0.3728
!Q_K(2)=0.030015   !Calculated Value
Q_K(2)=1.5095   !Design Value
Q_pos(2)=83.148

! Quadrupole Q3DBC3
Q_length(3)=0.3728
!Q_K(3)=0.030015   !Calculated Value
Q_K(3)=-1.57577   !Design Value
Q_pos(3)=83.698

! Quadrupole Q9ACC4
Q_length(4)=0.15
!Q_K(4)=-0.028481   !Calculated Value
Q_K(4)=1.56096  !Design Value
Q_pos(4)=98.4062

! Quadrupole Q10ACC4
Q_length(5)=0.15
!Q_K(5)=-0.028481   !Calculated Value
Q_K(5)=-1.248813   !Design Value
Q_pos(5)=98.6562

! Quadrupole Q9ACC5
Q_length(6)=0.15
!Q_K(6)=-0.025665   !Calculated Value
Q_K(6)=2.60035   !Design Value
Q_pos(6)=110.6076

! Quadrupole Q10ACC5
Q_length(7)=0.15
!Q_K(7)=-0.025665   !Calculated Value
Q_K(7)=-2.739172   !Design Value
Q_pos(7)=110.8576

! Quadrupole Q9ACC6
Q_length(8)=0.335
!Q_K(8)=0.046771   !Calculated Value
Q_K(8)=0.7171935   !Design Value
!Q_pos(8)=122.809
Q_pos(8)=122.651

! Quadrupole Q10ACC6	
Q_length(9)=0.335
!Q_K(9)=0.060056   !Calculated Value
Q_K(9)=-0.7353353   !Design Value
!Q_pos(9)=123.059
Q_pos(9)=123.201

! Quadrupole Q9ACC7
Q_length(10)=0.335
!Q_K(10)=0   !Calculated Value
Q_K(10)=0.1215829   !Design Value
Q_pos(10)=134.158


! Quadrupole Q2TCOL
Q_length(11)=0.2768
!Q_K(11)=0   !Calculated Value
Q_K(11)=-0.25952   !Design Value
Q_pos(11)=144.503

! Quadrupole Q8TCOL
Q_length(12)=0.2768
!Q_K(12)=0   !Calculated Value
Q_K(12)=2.7672   !Design Value
Q_pos(12)=150.995

! Quadrupole Q9TCOL
Q_length(13)=0.2768
!Q_K(13)=0   !Calculated Value
Q_K(13)=-3.05415   !Design Value
Q_pos(13)=151.795
/


 &DIPOLE
  LDipole=F
 /

 &CSR
  LCSR=.F
 /

 &ERROR
 /
