 
 FLASSI.  ECHO stream rerouted to file: LCLS2sc.echo
 
 
 FLASSI.  PRINT stream rerouted to file: LCLS2sc.print
 
 
 FLCALL.  Now reading file: LCLS2sc_master.xsif
 
 
 FLCALL.  Now reading file: common.xsif
 
 
 FLCALL.  Now reading file: LCLS2sc_master.xsif
 
 
 FLCALL.  Now reading file: CM.xsif
 
 
 FLCALL.  Now reading file: LCLS2sc_master.xsif
 
 
 FLCALL.  Now reading file: DIAG0.xsif
 
 
 FLCALL.  Now reading file: LCLS2sc_master.xsif
 
 
 FLCALL.  Now reading file: INJ.xsif
 
 
 FLCALL.  Now reading file: LCLS2sc_master.xsif
 
 
 FLCALL.  Now reading file: BC1.xsif
 
 
 FLCALL.  Now reading file: LCLS2sc_master.xsif
 
 
 FLCALL.  Now reading file: BC2.xsif
 
 
 FLCALL.  Now reading file: LCLS2sc_master.xsif
 
 
 FLCALL.  Now reading file: EXT.xsif
 
 
 FLCALL.  Now reading file: LCLS2sc_master.xsif
 
 
 FLCALL.  Now reading file: DLBM.xsif
 
 
 FLCALL.  Now reading file: LCLS2sc_master.xsif
 
 
 FLCALL.  Now reading file: SPRD.xsif
 
 
 FLCALL.  Now reading file: LCLS2sc_master.xsif
 
 
 FLCALL.  Now reading file: CUSXR.xsif
 
 
 FLCALL.  Now reading file: LCLS2sc_master.xsif
 
 
 FLCALL.  Now reading file: ALINE.xsif
 
 
 FLCALL.  Now reading file: LCLS2sc_master.xsif
 
 
 FLCALL.  Now reading file: BYP.xsif
 
 
 FLCALL.  Now reading file: LCLS2sc_master.xsif
 
 
 FLCALL.  Now reading file: LTU.xsif
 
 
 FLCALL.  Now reading file: LCLS2sc_master.xsif
 
 
 FLCALL.  Now reading file: UND.xsif
 
 
 FLCALL.  Now reading file: LCLS2sc_master.xsif
 
 
 FLCALL.  Now reading file: SFT.xsif
 
 
 FLCALL.  Now reading file: LCLS2sc_master.xsif
 
 
 FLCALL.  Now reading file: SXTES.xsif
 
 
 FLCALL.  Now reading file: LCLS2sc_master.xsif
 
 
 FLCALL.  Now reading file: DASEL.xsif
 
 
 FLCALL.  Now reading file: LCLS2sc_master.xsif
 
 
 FLCALL.  Now reading file: BSYsc.xsif
 
 
 FLCALL.  Now reading file: LCLS2sc_master.xsif
 
 
 FLCALL.  Now reading file: standard input
 
 
 ENBEAM.  ## Warning ## Redundant data on BEAM --- SIGE will be ignored.
 
                                                                                               
               ! ------------------------------------------------------------------------------
                                                                                               
       510      !CALL, FILENAME="LCLS2sc_beams.mad8" !alternate beams & configurations         
                !CALL, FILENAME="LCLS2sc_match.mad8"                                           
                !CALL, FILENAME="LCLS2sc_XLEAP.mad8"                                           
                !CALL, FILENAME="RDB/LCLS2sc_makeSymbols.mad8"                                 
                !CALL, FILENAME="elegant/LCLS2sc_makeElegant.mad8"                             
       515                                                                                     
                !STOP                                                                          
                                                                                               
               ! ------------------------------------------------------------------------------
               ! SURVEY in linac coordinates                                                   
       520     ! ------------------------------------------------------------------------------
                                                                                               
               ! EIC (Early Injector Commissioning)                                            
                                                                                               
                 COMMENT                                                                       
       525         ASSIGN, PRINT="EIC.print"                                                   
                   BEAM, ENERGY=E0                                                             
                   USE, SC_EIC                                                                 
                   PRINT, FULL                                                                 
                   SURVEY, X0=Xgun, Y0=Ygun, Z0=Zgun                                           
       530         TWISS, COUPLE, BETA0=TWSS0, TAPE="EIC_twiss.tape", RTAPE="EIC_rmat.tape"    
                 ENDCOMMENT                                                                    
                                                                                               
               ! ------------------------------------------------------------------------------
                                                                                               
       535     ! SXR                                                                           
                                                                                               
                !COMMENT                                                                       
                   ASSIGN, PRINT="LCLS2scS.print"                                              
 
 FLASSI.  Closing PRINT file: LCLS2sc.print
 
 
 FLASSI.  PRINT stream rerouted to file: LCLS2scS.print
 
                   BEAM, ENERGY=E0                                                             
       540         SET, SETSP, SETSPs ; SET, SETCUS, CUSOFF                                    
                   USE, SC_SXR                                                                 
 
 ENUSE.   New beam line expanded: SC_SXR
 
                  !SAVELINE, NAME="SC_SXR", FILENAME="LCLS2scS.saveline"                       
                   PRINT, FULL                                                                 
                   SURVEY, X0=Xgun, Y0=Ygun, Z0=Zgun, TAPE="LCLS2scS_survey.tape"              
 
 SURVEY.  Output written on file: LCLS2scS_survey.tape
 
       545         BEAM, ENERGY=Ei                                                             
                   USE, SC_SXRi                                                                
 
 ENUSE.   New beam line expanded: SC_SXRI
 
                   PRINT, FULL                                                                 
                   TWISS, SAVE, BETA0=TWSSi, TAPE="LCLS2scS_twiss.tape" !, &                   
 
 TWBTGO.  ## Warning ## TWISS found transverse coupling for delta(p)/p =    0.000000
          Please use the COUPLE option.
 
 
 TWBTGO.  ## Warning ## TWISS uses the RF system and synchrotron radiation only to find the closed orbit.
          for optical calculations it ignores both.
 
 
 TWISS.   Lattice functions written on file: LCLS2scS_twiss.tape
 
 
 TWBTSV.  Lattice functions saved in table: TWISS
 
                  !  RTAPE="LCLS2scS_rmat.tape"                                                
       550         PLOT, TABLE=TWISS, HAXIS=S, VAXIS=ENERGY, VMIN=0, VMAX=5, &                 
                     STYLE=100, SPLINE, RANGE=BEAM0/DUMPFACEB, FILE="LCLS2scS", &              
                     TITLE="SC-linac to SXR dump"                                              
                   PLOT, TABLE=TWISS, HAXIS=S, VAXIS=BETX,BETY, &                              
                     STYLE=100, SPLINE, RANGE=BEAM0/DUMPFACEB, FILE="LCLS2scS", &              
       555           TITLE="SC-linac to SXR dump"                                              
                   PLOT, TABLE=TWISS, HAXIS=S, VAXIS=DX,DY, &                                  
                     STYLE=100, SPLINE, RANGE=BEAM0/DUMPFACEB, FILE="LCLS2scS", &              
                     TITLE="SC-linac to SXR dump"                                              
                   PLOT, TABLE=TWISS, HAXIS=S, VAXIS=BETX,BETY, &                              
       560           STYLE=100, SPLINE, RANGE=WS31B/DU7S[31], FILE="LCLS2scS", &               
                     TITLE="UNDS (SC beam, 4 GeV)"                                             
                !ENDCOMMENT                                                                    
                                                                                               
               ! ------------------------------------------------------------------------------
       565                                                                                     
               ! SXR safety dump                                                               
                                                                                               
                 COMMENT                                                                       
                   ASSIGN, PRINT="LCLS2scSS.print"                                             
       570         BEAM, ENERGY=E0                                                             
                   SET, SETSP, SETSPs ; SET, SETCUS, CUSOFF                                    
                   USE, SC_SFTS                                                                
                   PRINT, FULL                                                                 
                   SURVEY, X0=Xgun, Y0=Ygun, Z0=Zgun, TAPE="LCLS2scSS_survey.tape"             
       575       ENDCOMMENT                                                                    
                                                                                               
               ! ------------------------------------------------------------------------------
                                                                                               
               ! SXR "2.x"                                                                     
       580                                                                                     
                !COMMENT                                                                       
                   ASSIGN, PRINT="LCLS2scS2_X.print"                                           
 
 FLASSI.  Closing PRINT file: LCLS2scS.print
 
 
 FLASSI.  PRINT stream rerouted to file: LCLS2scS2_X.print
 
                   BEAM, ENERGY=E0                                                             
                   SET, SETSP, SETSPs ; SET, SETCUS, CUSOFF                                    
       585         USE, SC_S2_X                                                                
 
 ENUSE.   New beam line expanded: SC_S2_X
 
                   PRINT, FULL                                                                 
                   SURVEY, X0=Xgun, Y0=Ygun, Z0=Zgun, TAPE="LCLS2scS2_X_survey.tape"           
 
 SURVEY.  Output written on file: LCLS2scS2_X_survey.tape
 
                !ENDCOMMENT                                                                    
                                                                                               
       590     ! ------------------------------------------------------------------------------
                                                                                               
               ! SXR TXI                                                                       
                                                                                               
                !COMMENT                                                                       
       595         ASSIGN, PRINT="LCLS2scSTXI.print"                                           
 
 FLASSI.  Closing PRINT file: LCLS2scS2_X.print
 
 
 FLASSI.  PRINT stream rerouted to file: LCLS2scSTXI.print
 
                   BEAM, ENERGY=E0                                                             
                   SET, SETSP, SETSPs ; SET, SETCUS, CUSOFF                                    
                   USE, SC_STXI                                                                
 
 ENUSE.   New beam line expanded: SC_STXI
 
                   PRINT, FULL                                                                 
       600         SURVEY, X0=Xgun, Y0=Ygun, Z0=Zgun, TAPE="LCLS2scSTXI_survey.tape"           
 
 SURVEY.  Output written on file: LCLS2scSTXI_survey.tape
 
                !ENDCOMMENT                                                                    
                                                                                               
               ! ------------------------------------------------------------------------------
                                                                                               
       605     ! SXR TMO                                                                       
                                                                                               
                !COMMENT                                                                       
                   ASSIGN, PRINT="LCLS2scSTMO.print"                                           
 
 FLASSI.  Closing PRINT file: LCLS2scSTXI.print
 
 
 FLASSI.  PRINT stream rerouted to file: LCLS2scSTMO.print
 
                   BEAM, ENERGY=E0                                                             
       610         SET, SETSP, SETSPs ; SET, SETCUS, CUSOFF                                    
                   USE, SC_STMO                                                                
 
 ENUSE.   New beam line expanded: SC_STMO
 
                   PRINT, FULL                                                                 
                   SURVEY, X0=Xgun, Y0=Ygun, Z0=Zgun, TAPE="LCLS2scSTMO_survey.tape"           
 
 SURVEY.  Output written on file: LCLS2scSTMO_survey.tape
 
                !ENDCOMMENT                                                                    
       615                                                                                     
               ! ------------------------------------------------------------------------------
                                                                                               
               ! HXR                                                                           
                                                                                               
       620      !COMMENT                                                                       
                   ASSIGN, PRINT="LCLS2scH.print"                                              
 
 FLASSI.  Closing PRINT file: LCLS2scSTMO.print
 
 
 FLASSI.  PRINT stream rerouted to file: LCLS2scH.print
 
                   BEAM, ENERGY=E0                                                             
                   SET, SETSP, SETSPh ; SET, SETAL, ALOFF                                      
                   USE, SC_HXR                                                                 
 
 ENUSE.   New beam line expanded: SC_HXR
 
       625        !SAVELINE, NAME="SC_HXR", FILENAME="LCLS2scH.saveline"                       
                   PRINT, FULL                                                                 
                   SURVEY, X0=Xgun, Y0=Ygun, Z0=Zgun, TAPE="LCLS2scH_survey.tape"              
 
 SURVEY.  Output written on file: LCLS2scH_survey.tape
 
                   BEAM, ENERGY=Ei                                                             
                   USE, SC_HXRi                                                                
 
 ENUSE.   New beam line expanded: SC_HXRI
 
       630         PRINT, FULL                                                                 
                   TWISS, SAVE, BETA0=TWSSi, TAPE="LCLS2scH_twiss.tape" !, &                   
 
 TBCREA.  ## Warning ## Table buffer "TWISS" already exists --- previous version deleted.
 
 
 TWBTGO.  ## Warning ## TWISS found transverse coupling for delta(p)/p =    0.000000
          Please use the COUPLE option.
 
 
 TWBTGO.  ## Warning ## TWISS uses the RF system and synchrotron radiation only to find the closed orbit.
          for optical calculations it ignores both.
 
 
 TWISS.   Lattice functions written on file: LCLS2scH_twiss.tape
 
 
 TWBTSV.  Lattice functions saved in table: TWISS
 
                  !  RTAPE="LCLS2scH_rmat.tape"                                                
                   PLOT, TABLE=TWISS, HAXIS=S, VAXIS=ENERGY, VMIN=0, VMAX=5, &                 
                     STYLE=100, SPLINE, RANGE=BEAM0/DUMPFACE, FILE="LCLS2scH", &               
       635           TITLE="SC-linac to HXR dump"                                              
                   PLOT, TABLE=TWISS, HAXIS=S, VAXIS=BETX,BETY, &                              
                     STYLE=100, SPLINE, RANGE=BEAM0/DUMPFACE, FILE="LCLS2scH", &               
                     TITLE="SC-linac to HXR dump"                                              
                   PLOT, TABLE=TWISS, HAXIS=S, VAXIS=DX,DY, &                                  
       640           STYLE=100, SPLINE, RANGE=BEAM0/DUMPFACE, FILE="LCLS2scH", &               
                     TITLE="SC-linac to HXR dump"                                              
                   PLOT, TABLE=TWISS, HAXIS=S, VAXIS=BETX,BETY, &                              
                     STYLE=100, SPLINE, RANGE=WS31/DU7H[25], FILE="LCLS2scH", &                
                     TITLE="UNDH (SC beam, 4 GeV)"                                             
       645      !ENDCOMMENT                                                                    
                                                                                               
               ! ------------------------------------------------------------------------------
                                                                                               
               ! BSY dump                                                                      
       650                                                                                     
                !COMMENT                                                                       
                   ASSIGN, PRINT="LCLS2scD.print"                                              
 
 FLASSI.  Closing PRINT file: LCLS2scH.print
 
                   BEAM, ENERGY=E0                                                             
                   SET, SETSP, SETSPd ; SET, SETDA, DAOFF                                      
       655         USE, SC_BSYD                                                                
 
 ENUSE.   New beam line expanded: SC_BSYD
 
                  !SAVELINE, NAME="SC_BSYD", FILENAME="LCLS2scD.saveline"                      
                   PRINT, FULL                                                                 
                   SURVEY, X0=Xgun, Y0=Ygun, Z0=Zgun, TAPE="LCLS2scD_survey.tape"              
 
 SURVEY.  Output written on file: LCLS2scD_survey.tape
 
                   BEAM, ENERGY=Ei                                                             
       660         USE, SC_BSYDi                                                               
 
 ENUSE.   New beam line expanded: SC_BSYDI
 
                   PRINT, FULL                                                                 
                   TWISS, SAVE, BETA0=TWSSi, TAPE="LCLS2scD_twiss.tape" !, &                   
 
 TBCREA.  ## Warning ## Table buffer "TWISS" already exists --- previous version deleted.
 
 
 TWBTGO.  ## Warning ## TWISS found transverse coupling for delta(p)/p =    0.000000
          Please use the COUPLE option.
 
 
 TWBTGO.  ## Warning ## TWISS uses the RF system and synchrotron radiation only to find the closed orbit.
          for optical calculations it ignores both.
 
 
 TWISS.   Lattice functions written on file: LCLS2scD_twiss.tape
 
 
 TWBTSV.  Lattice functions saved in table: TWISS
 
                  !  RTAPE="LCLS2scD_rmat.tape"                                                
                   PLOT, TABLE=TWISS, HAXIS=S, VAXIS=ENERGY, VMIN=0, VMAX=5, &                 
       665           STYLE=100, SPLINE, RANGE=BEAM0/DUMPBSY, FILE="LCLS2scD", &                
                     TITLE="SC-linac to BSY dump"                                              
                   PLOT, TABLE=TWISS, HAXIS=S, VAXIS=BETX,BETY, &                              
                     STYLE=100, SPLINE, RANGE=BEAM0/DUMPBSY, FILE="LCLS2scD", &                
                     TITLE="SC-linac to BSY dump"                                              
       670         PLOT, TABLE=TWISS, HAXIS=S, VAXIS=DX,DY, &                                  
                     STYLE=100, SPLINE, RANGE=BEAM0/DUMPBSY, FILE="LCLS2scD", &                
                     TITLE="SC-linac to BSY dump"                                              
                !ENDCOMMENT                                                                    
                                                                                               
       675     ! ------------------------------------------------------------------------------
                                                                                               
               ! DIAG0                                                                         
                                                                                               
                !COMMENT                                                                       
       680         ASSIGN, PRINT="DIAG0.print"                                                 
 
 FLASSI.  Closing PRINT file: LCLS2scD.print
 
                   BEAM, ENERGY=E0                                                             
                   USE, SC_DIAG0                                                               
 
 ENUSE.   New beam line expanded: SC_DIAG0
 
                  !SAVELINE, NAME="SC_DIAG0", FILENAME="DIAG0.saveline"                        
                   PRINT, FULL                                                                 
       685         SURVEY, X0=Xgun, Y0=Ygun, Z0=Zgun, TAPE="DIAG0_survey.tape"                 
 
 SURVEY.  Output written on file: DIAG0_survey.tape
 
                   BEAM, ENERGY=Ei                                                             
                   USE, SC_DIAG0i                                                              
 
 ENUSE.   New beam line expanded: SC_DIAG0I
 
                   PRINT, FULL                                                                 
                   TWISS, SAVE, BETA0=TWSSi, TAPE="DIAG0_twiss.tape" !, &                      
 
 TBCREA.  ## Warning ## Table buffer "TWISS" already exists --- previous version deleted.
 
 
 TWBTGO.  ## Warning ## TWISS found transverse coupling for delta(p)/p =    0.000000
          Please use the COUPLE option.
 
 
 TWISS.   Lattice functions written on file: DIAG0_twiss.tape
 
 
 TWBTSV.  Lattice functions saved in table: TWISS
 
       690        !  RTAPE="DIAG0_rmat.tape"                                                   
                   PLOT, TABLE=TWISS, HAXIS=S, VAXIS=BETX,BETY, &                              
                     STYLE=100, SPLINE, RANGE=BEAM0/ENDDIAG0, FILE="DIAG0", &                  
                     TITLE="SC-linac to DIAG0"                                                 
                   PLOT, TABLE=TWISS, HAXIS=S, VAXIS=DX,DY, &                                  
       695           STYLE=100, SPLINE, RANGE=BEAM0/ENDDIAG0, FILE="DIAG0", &                  
                     TITLE="SC-linac to DIAG0"                                                 
                !ENDCOMMENT                                                                    
                                                                                               
               ! ------------------------------------------------------------------------------
       700                                                                                     
               ! DASEL (funded off-project)                                                    
                                                                                               
                !COMMENT                                                                       
                   ASSIGN, PRINT="LCLS2scDA.print"                                             
 
 FLASSI.  Closing PRINT file: DIAG0.print
 
       705         BEAM, ENERGY=E0                                                             
                   SET, SETSP, SETSPd ; SET, SETDA, DAON ; SET, ROLLRC, +1                     
                   SETK2scDA                                                                   
                   USE, SC_DASEL                                                               
 
 ENUSE.   New beam line expanded: SC_DASEL
 
                  !SAVELINE, NAME="SC_DASEL", FILENAME="LCLS2scDA.saveline"                    
       710         PRINT, FULL                                                                 
                   SURVEY, X0=Xgun, Y0=Ygun, Z0=Zgun, TAPE="LCLS2scDA_survey.tape"             
 
 SURVEY.  Output written on file: LCLS2scDA_survey.tape
 
                   BEAM, ENERGY=Ei                                                             
                   SET, ROLLRC, 0                                                              
                   USE, SC_DASELi                                                              
 
 ENUSE.   New beam line expanded: SC_DASELI
 
       715         PRINT, FULL                                                                 
                   TWISS, SAVE, BETA0=TWSSi, TAPE="LCLS2scDA_twiss.tape" !, &                  
 
 TBCREA.  ## Warning ## Table buffer "TWISS" already exists --- previous version deleted.
 
 
 TWBTGO.  ## Warning ## TWISS found transverse coupling for delta(p)/p =    0.000000
          Please use the COUPLE option.
 
 
 TWBTGO.  ## Warning ## TWISS uses the RF system and synchrotron radiation only to find the closed orbit.
          for optical calculations it ignores both.
 
 
 TWISS.   Lattice functions written on file: LCLS2scDA_twiss.tape
 
 
 TWBTSV.  Lattice functions saved in table: TWISS
 
                  !  RTAPE="LCLS2scDA_rmat.tape"                                               
                   PLOT, TABLE=TWISS, HAXIS=S, VAXIS=ENERGY, VMIN=0, VMAX=5, &                 
                     STYLE=100, SPLINE, RANGE=BEAM0/ENDBSYA_2, FILE="LCLS2scDA", &             
       720           TITLE="SC-linac to DASEL"                                                 
                   PLOT, TABLE=TWISS, HAXIS=S, VAXIS=rBETX,rBETY, &                            
                     STYLE=100, SPLINE, RANGE=BEAM0/ENDBSYA_2, FILE="LCLS2scDA", &             
                     TITLE="SC-linac to DASEL"                                                 
                   PLOT, TABLE=TWISS, HAXIS=S, VAXIS=DX,DY, &                                  
       725           STYLE=100, SPLINE, RANGE=BEAM0/ENDBSYA_2, FILE="LCLS2scDA", &             
                     TITLE="SC-linac to DASEL"                                                 
                   SET, ROLLRC, +1                                                             
                !ENDCOMMENT                                                                    
                                                                                               
       730     ! ------------------------------------------------------------------------------
               ! SURVEY in BSY coordinates (from start of spreader)                            
               ! ------------------------------------------------------------------------------
                                                                                               
               ! SXR                                                                           
       735                                                                                     
                !COMMENT                                                                       
                   ASSIGN, PRINT="BSY-LCLS2scS.print"                                          
 
 FLASSI.  Closing PRINT file: LCLS2scDA.print
 
                   BEAM, ENERGY=Ef                                                             
                   SET, SETSP, SETSPs ; SET, SETCUS, CUSOFF                                    
       740         USE, BSYLCLS2scS                                                            
 
 ENUSE.   New beam line expanded: BSYLCLS2SCS
 
                   PRINT, FULL                                                                 
                   SURVEY, X0=Xf, Y0=Yf, Z0=Zf, THETA0=THETAf, PHI0=PHIf, PSI0=PSIf, &         
                     TAPE="BSY-LCLS2scS_survey.tape"                                           
 
 SURVEY.  Output written on file: BSY-LCLS2scS_survey.tape
 
                !ENDCOMMENT                                                                    
       745                                                                                     
               ! ------------------------------------------------------------------------------
                                                                                               
               ! SXR safety dump                                                               
                                                                                               
       750      !COMMENT                                                                       
                   ASSIGN, PRINT="BSY-LCLS2scSS.print"                                         
 
 FLASSI.  Closing PRINT file: BSY-LCLS2scS.print
 
                   BEAM, ENERGY=Ef                                                             
                   SET, SETSP, SETSPs ; SET, SETCUS, CUSOFF                                    
                   USE, BSYLCLS2scSS                                                           
 
 ENUSE.   New beam line expanded: BSYLCLS2SCSS
 
       755         PRINT, FULL                                                                 
                   SURVEY, X0=Xf, Y0=Yf, Z0=Zf, THETA0=THETAf, PHI0=PHIf, PSI0=PSIf, &         
                     TAPE="BSY-LCLS2scSS_survey.tape"                                          
 
 SURVEY.  Output written on file: BSY-LCLS2scSS_survey.tape
 
                !ENDCOMMENT                                                                    
                                                                                               
       760     ! ------------------------------------------------------------------------------
                                                                                               
               ! SXR 2_X !"2.X"                                                                
                                                                                               
                !COMMENT                                                                       
       765         ASSIGN, PRINT="BSY-LCLS2scS2_X.print"                                       
 
 FLASSI.  Closing PRINT file: BSY-LCLS2scSS.print
 
                   BEAM, ENERGY=Ef                                                             
                   SET, SETSP, SETSPs ; SET, SETCUS, CUSOFF                                    
                   USE, BSYLCLS2scS2_X                                                         
 
 ENUSE.   New beam line expanded: BSYLCLS2SCS2_X
 
                   PRINT, FULL                                                                 
       770         SURVEY, X0=Xf, Y0=Yf, Z0=Zf, THETA0=THETAf, PHI0=PHIf, PSI0=PSIf, &         
                     TAPE="BSY-LCLS2scS2_X_survey.tape"                                        
 
 SURVEY.  Output written on file: BSY-LCLS2scS2_X_survey.tape
 
                !ENDCOMMENT                                                                    
                                                                                               
               ! ------------------------------------------------------------------------------
       775                                                                                     
               ! SXR TXI                                                                       
                                                                                               
                !COMMENT                                                                       
                   ASSIGN, PRINT="BSY-LCLS2scSTXI.print"                                       
 
 FLASSI.  Closing PRINT file: BSY-LCLS2scS2_X.print
 
       780         BEAM, ENERGY=Ef                                                             
                   SET, SETSP, SETSPs ; SET, SETCUS, CUSOFF                                    
                   USE, BSYLCLS2scSTXI                                                         
 
 ENUSE.   New beam line expanded: BSYLCLS2SCSTXI
 
                   PRINT, FULL                                                                 
                   SURVEY, X0=Xf, Y0=Yf, Z0=Zf, THETA0=THETAf, PHI0=PHIf, PSI0=PSIf, &         
       785           TAPE="BSY-LCLS2scSTXI_survey.tape"                                        
 
 SURVEY.  Output written on file: BSY-LCLS2scSTXI_survey.tape
 
                !ENDCOMMENT                                                                    
                                                                                               
               ! ------------------------------------------------------------------------------
                                                                                               
       790     ! SXR TMO                                                                       
                                                                                               
                !COMMENT                                                                       
                   ASSIGN, PRINT="BSY-LCLS2scSTMO.print"                                       
 
 FLASSI.  Closing PRINT file: BSY-LCLS2scSTXI.print
 
                   BEAM, ENERGY=Ef                                                             
       795         SET, SETSP, SETSPs ; SET, SETCUS, CUSOFF                                    
                   USE, BSYLCLS2scSTMO                                                         
 
 ENUSE.   New beam line expanded: BSYLCLS2SCSTMO
 
                   PRINT, FULL                                                                 
                   SURVEY, X0=Xf, Y0=Yf, Z0=Zf, THETA0=THETAf, PHI0=PHIf, PSI0=PSIf, &         
                     TAPE="BSY-LCLS2scSTMO_survey.tape"                                        
 
 SURVEY.  Output written on file: BSY-LCLS2scSTMO_survey.tape
 
       800      !ENDCOMMENT                                                                    
                                                                                               
               ! ------------------------------------------------------------------------------
                                                                                               
               ! HXR                                                                           
       805                                                                                     
                !COMMENT                                                                       
                   ASSIGN, PRINT="BSY-LCLS2scH.print"                                          
 
 FLASSI.  Closing PRINT file: BSY-LCLS2scSTMO.print
 
                   BEAM, ENERGY=Ef                                                             
                   SET, SETSP, SETSPh ; SET, SETAL, ALOFF                                      
       810         USE, BSYLCLS2scH                                                            
 
 ENUSE.   New beam line expanded: BSYLCLS2SCH
 
                   PRINT, FULL                                                                 
                   SURVEY, X0=Xf, Y0=Yf, Z0=Zf, THETA0=THETAf, PHI0=PHIf, PSI0=PSIf, &         
                     TAPE="BSY-LCLS2scH_survey.tape"                                           
 
 SURVEY.  Output written on file: BSY-LCLS2scH_survey.tape
 
                !ENDCOMMENT                                                                    
       815                                                                                     
               ! ------------------------------------------------------------------------------
                                                                                               
               ! BSY dump                                                                      
                                                                                               
       820      !COMMENT                                                                       
                   ASSIGN, PRINT="BSY-LCLS2scD.print"                                          
 
 FLASSI.  Closing PRINT file: BSY-LCLS2scH.print
 
                   BEAM, ENERGY=Ef                                                             
                   SET, SETSP, SETSPd ; SET, SETDA, DAOFF                                      
                   USE, BSYLCLS2scD                                                            
 
 ENUSE.   New beam line expanded: BSYLCLS2SCD
 
       825         PRINT, FULL                                                                 
                   SURVEY, X0=Xf, Y0=Yf, Z0=Zf, THETA0=THETAf, PHI0=PHIf, PSI0=PSIf, &         
                     TAPE="BSY-LCLS2scD_survey.tape"                                           
 
 SURVEY.  Output written on file: BSY-LCLS2scD_survey.tape
 
                !ENDCOMMENT                                                                    
                                                                                               
       830     ! ------------------------------------------------------------------------------
                                                                                               
               ! S30XL (a.k.a. DASEL)                                                          
                                                                                               
                !COMMENT                                                                       
       835         ASSIGN, PRINT="BSY-LCLS2scDA.print"                                         
 
 FLASSI.  Closing PRINT file: BSY-LCLS2scD.print
 
                   BEAM, ENERGY=Ef                                                             
                   SET, SETSP, SETSPd ; SET, SETDA, DAON ; SET, ROLLRC, +1                     
                   SETK2scDA                                                                   
                   USE, BSYLCLS2scDA                                                           
 
 ENUSE.   New beam line expanded: BSYLCLS2SCDA
 
       840         PRINT, FULL                                                                 
                   SURVEY, X0=Xf, Y0=Yf, Z0=Zf, THETA0=THETAf, PHI0=PHIf, PSI0=PSIf, &         
                     TAPE="BSY-LCLS2scDA_survey.tape"                                          
 
 SURVEY.  Output written on file: BSY-LCLS2scDA_survey.tape
 
                !ENDCOMMENT                                                                    
                                                                                               
       845     ! ==============================================================================
                                                                                               
               ! Twiss plots                                                                   
                                                                                               
                !COMMENT                                                                       
       850         ASSIGN, PRINT="LCLS2sc.print"                                               
 
 FLASSI.  Closing PRINT file: BSY-LCLS2scDA.print
 
                                                                                               
                 ! Cathode to BEAM0                                                            
                                                                                               
                   BEAM, ENERGY=E0                                                             
       855         USE, (GUN,L0)                                                               
 
 ENUSE.   New beam line expanded: *LIN.01*
 
                   PRINT, FULL                                                                 
                   TWISS, SAVE, COUPLE, BETA0=TWSS0                                            
 
 TBCREA.  ## Warning ## Table buffer "TWISS" already exists --- previous version deleted.
 
 
 TWCPGO.  ## Warning ## TWISS uses the RF system and synchrotron radiation only to find the closed orbit.
          for optical calculations it ignores both.
 
 
 TWBTSV.  Lattice functions saved in table: TWISS
 
                   PLOT, TABLE=TWISS, HAXIS=S, VAXIS=ENERGY, VMIN=0, VMAX=0.12, &              
                     COLOUR=100, -SPLINE, RANGE=CATHODEB/ENDL0B, FILE="LCLS2sc_color", &       
       860           TITLE="GUNB + L0B"                                                        
                   PLOT, TABLE=TWISS, HAXIS=S, VAXIS=BETX,BETY, VMIN=0, VMAX=20, &             
                     COLOUR=100, -SPLINE, RANGE=CATHODEB/ENDL0B, FILE="LCLS2sc_color", &       
                     TITLE="GUNB + L0B"                                                        
                                                                                               
       865       ! BEAM0 to SXR Main Dump                                                      
                                                                                               
                   BEAM, ENERGY=Ei                                                             
                   SET, SETSP, SETSPs ; SET, SETCUS, CUSOFF                                    
                   USE, SC_SXRi                                                                
 
 ENUSE.   Beam line re-expanded: SC_SXRI
 
       870         TWISS, SAVE, BETA0=TWSSi                                                    
 
 TBCREA.  ## Warning ## Table buffer "TWISS" already exists --- previous version deleted.
 
 
 TWBTGO.  ## Warning ## TWISS found transverse coupling for delta(p)/p =    0.000000
          Please use the COUPLE option.
 
 
 TWBTGO.  ## Warning ## TWISS uses the RF system and synchrotron radiation only to find the closed orbit.
          for optical calculations it ignores both.
 
 
 TWBTSV.  Lattice functions saved in table: TWISS
 
                   PLOT, TABLE=TWISS, HAXIS=S, VAXIS=ENERGY, VMIN=0, &                         
                     COLOUR=100, SPLINE, RANGE=BEAM0/ENDL1B, FILE="LCLS2sc_color", &           
                     TITLE="Laser Heater + Coll0 + L1B"                                        
                   PLOT, TABLE=TWISS, HAXIS=S, VAXIS1=BETX,BETY, VAXIS2=DX,DY, &               
       875           COLOUR=100, SPLINE, RANGE=BEAM0/ENDL1B, FILE="LCLS2sc_color", &           
                     TITLE="Laser Heater + Coll0 + L1B"                                        
                   PLOT, TABLE=TWISS, HAXIS=S, VAXIS1=BETX,BETY, VAXIS2=DX,DY, &               
                     COLOUR=100, SPLINE, RANGE=BEGBC1B/ENDCOL1, FILE="LCLS2sc_color", &        
                     TITLE="BC1B + Coll1"                                                      
       880         PLOT, TABLE=TWISS, HAXIS=S, VAXIS=ENERGY, VMIN=0, &                         
                     COLOUR=100, SPLINE, RANGE=BEGL2B/ENDL2B, FILE="LCLS2sc_color", &          
                     TITLE="L2B"                                                               
                   PLOT, TABLE=TWISS, HAXIS=S, VAXIS=BETX,BETY, &                              
                     COLOUR=100, SPLINE, RANGE=BEGL2B/ENDL2B, FILE="LCLS2sc_color", &          
       885           TITLE="L2B"                                                               
                   PLOT, TABLE=TWISS, HAXIS=S, VAXIS1=BETX,BETY, VAXIS2=DX,DY, &               
                     COLOUR=100, SPLINE, RANGE=BEGBC2B/ENDEMIT2, FILE="LCLS2sc_color", &       
                     TITLE="BC2B + Emit2"                                                      
                   PLOT, TABLE=TWISS, HAXIS=S, VAXIS=ENERGY, VMIN=0, VMAX=5, &                 
       890           COLOUR=100, SPLINE, RANGE=BEGL3B/ENDEXT, FILE="LCLS2sc_color", &          
                     TITLE="L3B + Extension"                                                   
                   PLOT, TABLE=TWISS, HAXIS=S, VAXIS=BETX,BETY, &                              
                     COLOUR=100, SPLINE, RANGE=BEGL3B/ENDEXT, FILE="LCLS2sc_color", &          
                     TITLE="L3B + Extension"                                                   
       895         PLOT, TABLE=TWISS, HAXIS=S, VAXIS1=BETX,BETY, VAXIS2=DX,DY, &               
                     COLOUR=100, SPLINE, RANGE=BEGDOG/MQBP13, FILE="LCLS2sc_color", &          
                     TITLE="Dogleg + Match to Bypass + NIT Extension"                          
                   PLOT, TABLE=TWISS, HAXIS=S, VAXIS=BETX,BETY, &                              
                     COLOUR=100, SPLINE, RANGE=MQBP13/ENDSPD_1, FILE="LCLS2sc_color", &        
       900           TITLE="Bypass Line to Spreader"                                           
                   PLOT, TABLE=TWISS, HAXIS=S, VAXIS1=BETX,BETY, VAXIS2=DX,DY, &               
                     COLOUR=100, SPLINE, RANGE=BEGSPS/ENDLTUS, FILE="LCLS2sc_color", &         
                     TITLE="Spreader + LTUS"                                                   
                   PLOT, TABLE=TWISS, HAXIS=S, VAXIS1=BETX,BETY, VAXIS2=DX,DY, &               
       905           COLOUR=100, SPLINE, RANGE=BEGUNDS/DUMPFACEB, FILE="LCLS2sc_color", &      
                     TITLE="SXR Undulator to Dump"                                             
                                                                                               
                 ! SXR Safety Dump                                                             
                                                                                               
       910         BEAM, ENERGY=Ei                                                             
                   SET, SETSP, SETSPs ; SET, SETCUS, CUSOFF                                    
                   USE, SC_SFTSi                                                               
 
 ENUSE.   New beam line expanded: SC_SFTSI
 
                   TWISS, SAVE, BETA0=TWSSi                                                    
 
 TBCREA.  ## Warning ## Table buffer "TWISS" already exists --- previous version deleted.
 
 
 TWBTGO.  ## Warning ## TWISS found transverse coupling for delta(p)/p =    0.000000
          Please use the COUPLE option.
 
 
 TWBTGO.  ## Warning ## TWISS uses the RF system and synchrotron radiation only to find the closed orbit.
          for optical calculations it ignores both.
 
 
 TWBTSV.  Lattice functions saved in table: TWISS
 
                   PLOT, TABLE=TWISS, HAXIS=S, VAXIS1=BETX,BETY, VAXIS2=DX,DY, &               
       915           COLOUR=100, SPLINE, RANGE=BEGSFTS_1/SFTDMPB, FILE="LCLS2sc_color", &      
                     TITLE="SXR Safety Dump"                                                   
                                                                                               
                 ! Spreader to HXR Main Dump                                                   
                                                                                               
       920         BEAM, ENERGY=Ei                                                             
                   SET, SETSP, SETSPh ; SET, SETAL, ALOFF                                      
                   USE, SC_HXRi                                                                
 
 ENUSE.   Beam line re-expanded: SC_HXRI
 
                   TWISS, SAVE, BETA0=TWSSi                                                    
 
 TBCREA.  ## Warning ## Table buffer "TWISS" already exists --- previous version deleted.
 
 
 TWBTGO.  ## Warning ## TWISS found transverse coupling for delta(p)/p =    0.000000
          Please use the COUPLE option.
 
 
 TWBTGO.  ## Warning ## TWISS uses the RF system and synchrotron radiation only to find the closed orbit.
          for optical calculations it ignores both.
 
 
 TWBTSV.  Lattice functions saved in table: TWISS
 
                   PLOT, TABLE=TWISS, HAXIS=S, VAXIS1=BETX,BETY, VAXIS2=DX,DY, &               
       925           COLOUR=100, SPLINE, RANGE=BEGSPH/ENDLTUH, FILE="LCLS2sc_color", &         
                     TITLE="Spreader + LTUH"                                                   
                   PLOT, TABLE=TWISS, HAXIS=S, VAXIS1=BETX,BETY, VAXIS2=DX,DY, &               
                     COLOUR=100, SPLINE, RANGE=BEGUNDH/DUMPFACE, FILE="LCLS2sc_color", &       
                     TITLE="HXR Undulator to Dump"                                             
       930                                                                                     
                 ! Spreader to BSY Dump                                                        
                                                                                               
                   BEAM, ENERGY=Ei                                                             
                   SET, SETSP, SETSPd ; SET, SETDA, DAOFF                                      
       935         USE, SC_BSYDi                                                               
 
 ENUSE.   Beam line re-expanded: SC_BSYDI
 
                   TWISS, SAVE, BETA0=TWSSi                                                    
 
 TBCREA.  ## Warning ## Table buffer "TWISS" already exists --- previous version deleted.
 
 
 TWBTGO.  ## Warning ## TWISS found transverse coupling for delta(p)/p =    0.000000
          Please use the COUPLE option.
 
 
 TWBTGO.  ## Warning ## TWISS uses the RF system and synchrotron radiation only to find the closed orbit.
          for optical calculations it ignores both.
 
 
 TWBTSV.  Lattice functions saved in table: TWISS
 
                   PLOT, TABLE=TWISS, HAXIS=S, VAXIS1=BETX,BETY, VAXIS2=DX,DY, &               
                     COLOUR=100, SPLINE, RANGE=BEGSPD_1/DUMPBSY, FILE="LCLS2sc_color", &       
                     TITLE="Spreader to BSY Dump"                                              
       940                                                                                     
                 ! DIAG0                                                                       
                                                                                               
                   BEAM, ENERGY=Ei                                                             
                   USE, SC_DIAG0i                                                              
 
 ENUSE.   Beam line re-expanded: SC_DIAG0I
 
       945         TWISS, SAVE, BETA0=TWSSi                                                    
 
 TBCREA.  ## Warning ## Table buffer "TWISS" already exists --- previous version deleted.
 
 
 TWBTGO.  ## Warning ## TWISS found transverse coupling for delta(p)/p =    0.000000
          Please use the COUPLE option.
 
 
 TWBTSV.  Lattice functions saved in table: TWISS
 
                   PLOT, TABLE=TWISS, HAXIS=S, VAXIS1=BETX,BETY, VAXIS2=DX,DY, &               
                     COLOUR=100, SPLINE, RANGE=BEGDIAG0/ENDDIAG0, FILE="LCLS2sc_color", &      
                     TITLE="DIAG0"                                                             
                                                                                               
       950       ! DASEL (deferred)                                                            
                                                                                               
                   BEAM, ENERGY=Ei                                                             
                   SET, SETSP, SETSPd ; SET, SETDA, DAON ; SET, ROLLRC, 0                      
                   SETK2scDA                                                                   
       955         USE, SC_DASELi                                                              
 
 ENUSE.   Beam line re-expanded: SC_DASELI
 
                   TWISS, SAVE, BETA0=TWSSi                                                    
 
 TBCREA.  ## Warning ## Table buffer "TWISS" already exists --- previous version deleted.
 
 
 TWBTGO.  ## Warning ## TWISS found transverse coupling for delta(p)/p =    0.000000
          Please use the COUPLE option.
 
 
 TWBTGO.  ## Warning ## TWISS uses the RF system and synchrotron radiation only to find the closed orbit.
          for optical calculations it ignores both.
 
 
 TWBTSV.  Lattice functions saved in table: TWISS
 
                   PLOT, TABLE=TWISS, HAXIS=S, VAXIS1=rBETX,rBETY, VAXIS2=DX,DY, &             
                     COLOUR=100, SPLINE, RANGE=BEGDASEL/ENDBSYA_2, FILE="LCLS2sc_color", &     
                     TITLE="DASEL to A-line"                                                   
       960         SET, ROLLRC, +1                                                             
                !ENDCOMMENT                                                                    
                                                                                               
               ! ------------------------------------------------------------------------------
                                                                                               
       965      !CALL "LCLS2sc_area_plots.mad8"                                                
                                                                                               
               ! ------------------------------------------------------------------------------
                                                                                               
                 STOP                                                                          
 
 ZEND.       33 Warning messages,
              0 Error messages.
                MAD terminated on 15/09/21 at 14.37.24
 

 MZEND.   Usage statistics for  1 dynamic stores.

   Map of store  0 / /     
   ------------------------

   Division                                        Number of times
              Kind                Max-size                Garb-coll.
            Mode    Position      used   allowed   Wiped  user  auto Pushd Redcd

    1 QDIV1    0 1         9     99831  56000006      36     0     0    68     0
    2 QDIV2    1 1  55999606   5596254  56000006       0     0     0     0     0
   20 system   1 8  56000006       111  56000006       0     0     0     0     0
