 
 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.
 
                                                                                               
               ! ------------------------------------------------------------------------------
       530                                                                                     
                !CALL, FILENAME="LCLS2sc_beams.mad8" !alternate beams & configurations         
                !CALL, FILENAME="LCLS2sc_match.mad8"                                           
                !CALL, FILENAME="LCLS2sc_XLEAP.mad8"                                           
                !CALL, FILENAME="RDB/LCLS2sc_makeSymbols.mad8"                                 
       535      !CALL, FILENAME="elegant/LCLS2sc_makeElegant.mad8"                             
                                                                                               
                !STOP                                                                          
                                                                                               
               ! ------------------------------------------------------------------------------
       540     ! SURVEY in linac coordinates                                                   
               ! ------------------------------------------------------------------------------
                                                                                               
               ! SXR                                                                           
                                                                                               
       545      !COMMENT                                                                       
                   ASSIGN, PRINT="LCLS2scS.print"                                              
 
 FLASSI.  Closing PRINT file: LCLS2sc.print
 
 
 FLASSI.  PRINT stream rerouted to file: LCLS2scS.print
 
                   BEAM, ENERGY=E0                                                             
                   SET, SETSP, SETSPs ; SET, SETCUS, CUSOFF                                    
                   USE, SC_SXR                                                                 
 
 ENUSE.   New beam line expanded: SC_SXR
 
       550        !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
 
                   BEAM, ENERGY=Ei                                                             
                   USE, SC_SXRi                                                                
 
 ENUSE.   New beam line expanded: SC_SXRI
 
       555         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"                                                 
                   PLOT, TABLE=TWISS, HAXIS=S, VAXIS=X,Y, &                                    
                     STYLE=100, SPLINE, RANGE=BEGLTUS/DUMPFACEB, FILE="LCLS2scS", &            
       560           TITLE="SC-linac to SXR dump"                                              
                   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, &                              
       565           STYLE=100, SPLINE, RANGE=BEAM0/DUMPFACEB, FILE="LCLS2scS", &              
                     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"                                              
       570         PLOT, TABLE=TWISS, HAXIS=S, VAXIS=BETX,BETY, &                              
                     STYLE=100, SPLINE, RANGE=WS31B/DU7S[31], FILE="LCLS2scS", &               
                     TITLE="UNDS (SC beam, 4 GeV)"                                             
                !ENDCOMMENT                                                                    
                                                                                               
       575     ! ------------------------------------------------------------------------------
                                                                                               
               ! SXR safety dump                                                               
                                                                                               
                 COMMENT                                                                       
       580         ASSIGN, PRINT="LCLS2scSS.print"                                             
                   BEAM, ENERGY=E0                                                             
                   SET, SETSP, SETSPs ; SET, SETCUS, CUSOFF                                    
                   USE, SC_SFTS                                                                
                   PRINT, FULL                                                                 
       585         SURVEY, X0=Xgun, Y0=Ygun, Z0=Zgun, TAPE="LCLS2scSS_survey.tape"             
                 ENDCOMMENT                                                                    
                                                                                               
               ! ------------------------------------------------------------------------------
                                                                                               
       590     ! SXR "2.x"                                                                     
                                                                                               
                !COMMENT                                                                       
                   ASSIGN, PRINT="LCLS2scS2_X.print"                                           
 
 FLASSI.  Closing PRINT file: LCLS2scS.print
 
 
 FLASSI.  PRINT stream rerouted to file: LCLS2scS2_X.print
 
                   BEAM, ENERGY=E0                                                             
       595         SET, SETSP, SETSPs ; SET, SETCUS, CUSOFF                                    
                   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                                                                    
       600                                                                                     
               ! ------------------------------------------------------------------------------
                                                                                               
               ! SXR TXI                                                                       
                                                                                               
       605      !COMMENT                                                                       
                   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
 
       610         PRINT, FULL                                                                 
                   SURVEY, X0=Xgun, Y0=Ygun, Z0=Zgun, TAPE="LCLS2scSTXI_survey.tape"           
 
 SURVEY.  Output written on file: LCLS2scSTXI_survey.tape
 
                !ENDCOMMENT                                                                    
                                                                                               
               ! ------------------------------------------------------------------------------
       615                                                                                     
               ! SXR TMO                                                                       
                                                                                               
                !COMMENT                                                                       
                   ASSIGN, PRINT="LCLS2scSTMO.print"                                           
 
 FLASSI.  Closing PRINT file: LCLS2scSTXI.print
 
 
 FLASSI.  PRINT stream rerouted to file: LCLS2scSTMO.print
 
       620         BEAM, ENERGY=E0                                                             
                   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
 
       625      !ENDCOMMENT                                                                    
                                                                                               
               ! ------------------------------------------------------------------------------
                                                                                               
               ! HXR                                                                           
       630                                                                                     
                !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                                      
       635         USE, SC_HXR                                                                 
 
 ENUSE.   New beam line expanded: SC_HXR
 
                  !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                                                             
       640         USE, SC_HXRi                                                                
 
 ENUSE.   New beam line expanded: SC_HXRI
 
                   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, &                 
       645           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=BEAM0/DUMPFACE, FILE="LCLS2scH", &               
                     TITLE="SC-linac to HXR dump"                                              
       650         PLOT, TABLE=TWISS, HAXIS=S, VAXIS=DX,DY, &                                  
                     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", &                
       655           TITLE="UNDH (SC beam, 4 GeV)"                                             
                !ENDCOMMENT                                                                    
                                                                                               
               ! ------------------------------------------------------------------------------
                                                                                               
       660     ! BSY dump                                                                      
                                                                                               
                !COMMENT                                                                       
                   ASSIGN, PRINT="LCLS2scD.print"                                              
 
 FLASSI.  Closing PRINT file: LCLS2scH.print
 
                   BEAM, ENERGY=E0                                                             
       665         SET, SETSP, SETSPd ; SET, SETDA, DAOFF                                      
                   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
 
       670         BEAM, ENERGY=Ei                                                             
                   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"                                                
       675         PLOT, TABLE=TWISS, HAXIS=S, VAXIS=ENERGY, VMIN=0, VMAX=5, &                 
                     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", &                
       680           TITLE="SC-linac to BSY dump"                                              
                   PLOT, TABLE=TWISS, HAXIS=S, VAXIS=DX,DY, &                                  
                     STYLE=100, SPLINE, RANGE=BEAM0/DUMPBSY, FILE="LCLS2scD", &                
                     TITLE="SC-linac to BSY dump"                                              
                !ENDCOMMENT                                                                    
       685                                                                                     
               ! ------------------------------------------------------------------------------
                                                                                               
               ! DIAG0                                                                         
                                                                                               
       690      !COMMENT                                                                       
                   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"                        
       695         PRINT, FULL                                                                 
                   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                                                                 
       700         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
 
                  !  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"                                                 
       705         PLOT, TABLE=TWISS, HAXIS=S, VAXIS=DX,DY, &                                  
                     STYLE=100, SPLINE, RANGE=BEAM0/ENDDIAG0, FILE="DIAG0", &                  
                     TITLE="SC-linac to DIAG0"                                                 
                !ENDCOMMENT                                                                    
                                                                                               
       710     ! ------------------------------------------------------------------------------
                                                                                               
               ! S30XL (a.k.a. DASEL; funded off-project)                                      
                                                                                               
                !COMMENT                                                                       
       715         ASSIGN, PRINT="LCLS2scDA.print"                                             
 
 FLASSI.  Closing PRINT file: DIAG0.print
 
                   BEAM, ENERGY=E0                                                             
                   SET, SETSP, SETSPd ; SET, SETDA, DAON ; SET, ROLLRC, +1                     
                   SETK2scDA                                                                   
                   USE, SC_DASEL                                                               
 
 ENUSE.   New beam line expanded: SC_DASEL
 
       720        !SAVELINE, NAME="SC_DASEL", FILENAME="LCLS2scDA.saveline"                    
                   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                                                              
       725         USE, SC_DASELi                                                              
 
 ENUSE.   New beam line expanded: SC_DASELI
 
                   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, &                 
       730           STYLE=100, SPLINE, RANGE=BEAM0/ENDBSYA_2, FILE="LCLS2scDA", &             
                     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"                                                 
       735         PLOT, TABLE=TWISS, HAXIS=S, VAXIS=DX,DY, &                                  
                     STYLE=100, SPLINE, RANGE=BEAM0/ENDBSYA_2, FILE="LCLS2scDA", &             
                     TITLE="SC-linac to DASEL"                                                 
                   SET, ROLLRC, +1                                                             
                !ENDCOMMENT                                                                    
       740                                                                                     
               ! ------------------------------------------------------------------------------
               ! SURVEY in BSY coordinates (from start of spreader)                            
               ! ------------------------------------------------------------------------------
                                                                                               
       745     ! SXR                                                                           
                                                                                               
                !COMMENT                                                                       
                   ASSIGN, PRINT="BSY-LCLS2scS.print"                                          
 
 FLASSI.  Closing PRINT file: LCLS2scDA.print
 
                   BEAM, ENERGY=Ef                                                             
       750         SET, SETSP, SETSPs ; SET, SETCUS, CUSOFF                                    
                   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
 
       755      !ENDCOMMENT                                                                    
                                                                                               
               ! ------------------------------------------------------------------------------
                                                                                               
               ! SXR safety dump                                                               
       760                                                                                     
                !COMMENT                                                                       
                   ASSIGN, PRINT="BSY-LCLS2scSS.print"                                         
 
 FLASSI.  Closing PRINT file: BSY-LCLS2scS.print
 
                   BEAM, ENERGY=Ef                                                             
                   SET, SETSP, SETSPs ; SET, SETCUS, CUSOFF                                    
       765         USE, BSYLCLS2scSS                                                           
 
 ENUSE.   New beam line expanded: BSYLCLS2SCSS
 
                   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                                                                    
       770                                                                                     
               ! ------------------------------------------------------------------------------
                                                                                               
               ! SXR 2_X !"2.X"                                                                
                                                                                               
       775      !COMMENT                                                                       
                   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
 
       780         PRINT, FULL                                                                 
                   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                                                                    
                                                                                               
       785     ! ------------------------------------------------------------------------------
                                                                                               
               ! SXR TXI                                                                       
                                                                                               
                !COMMENT                                                                       
       790         ASSIGN, PRINT="BSY-LCLS2scSTXI.print"                                       
 
 FLASSI.  Closing PRINT file: BSY-LCLS2scS2_X.print
 
                   BEAM, ENERGY=Ef                                                             
                   SET, SETSP, SETSPs ; SET, SETCUS, CUSOFF                                    
                   USE, BSYLCLS2scSTXI                                                         
 
 ENUSE.   New beam line expanded: BSYLCLS2SCSTXI
 
                   PRINT, FULL                                                                 
       795         SURVEY, X0=Xf, Y0=Yf, Z0=Zf, THETA0=THETAf, PHI0=PHIf, PSI0=PSIf, &         
                     TAPE="BSY-LCLS2scSTXI_survey.tape"                                        
 
 SURVEY.  Output written on file: BSY-LCLS2scSTXI_survey.tape
 
                !ENDCOMMENT                                                                    
                                                                                               
               ! ------------------------------------------------------------------------------
       800                                                                                     
               ! SXR TMO                                                                       
                                                                                               
                !COMMENT                                                                       
                   ASSIGN, PRINT="BSY-LCLS2scSTMO.print"                                       
 
 FLASSI.  Closing PRINT file: BSY-LCLS2scSTXI.print
 
       805         BEAM, ENERGY=Ef                                                             
                   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, &         
       810           TAPE="BSY-LCLS2scSTMO_survey.tape"                                        
 
 SURVEY.  Output written on file: BSY-LCLS2scSTMO_survey.tape
 
                !ENDCOMMENT                                                                    
                                                                                               
               ! ------------------------------------------------------------------------------
                                                                                               
       815     ! HXR                                                                           
                                                                                               
                !COMMENT                                                                       
                   ASSIGN, PRINT="BSY-LCLS2scH.print"                                          
 
 FLASSI.  Closing PRINT file: BSY-LCLS2scSTMO.print
 
                   BEAM, ENERGY=Ef                                                             
       820         SET, SETSP, SETSPh ; SET, SETAL, ALOFF                                      
                   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
 
       825      !ENDCOMMENT                                                                    
                                                                                               
               ! ------------------------------------------------------------------------------
                                                                                               
               ! BSY dump                                                                      
       830                                                                                     
                !COMMENT                                                                       
                   ASSIGN, PRINT="BSY-LCLS2scD.print"                                          
 
 FLASSI.  Closing PRINT file: BSY-LCLS2scH.print
 
                   BEAM, ENERGY=Ef                                                             
                   SET, SETSP, SETSPd ; SET, SETDA, DAOFF                                      
       835         USE, BSYLCLS2scD                                                            
 
 ENUSE.   New beam line expanded: BSYLCLS2SCD
 
                   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                                                                    
       840                                                                                     
               ! ------------------------------------------------------------------------------
                                                                                               
               ! S30XL (a.k.a. DASEL)                                                          
                                                                                               
       845      !COMMENT                                                                       
                   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                                                                   
       850         USE, BSYLCLS2scDA                                                           
 
 ENUSE.   New beam line expanded: BSYLCLS2SCDA
 
                   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                                                                    
       855                                                                                     
               ! ==============================================================================
                                                                                               
               ! Twiss plots                                                                   
                                                                                               
       860      !COMMENT                                                                       
                   ASSIGN, PRINT="LCLS2sc.print"                                               
 
 FLASSI.  Closing PRINT file: BSY-LCLS2scDA.print
 
                                                                                               
                 ! Cathode to BEAM0                                                            
                                                                                               
       865         BEAM, ENERGY=E0                                                             
                   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, &              
       870           COLOUR=100, -SPLINE, RANGE=CATHODEB/ENDL0B, FILE="LCLS2sc_color", &       
                     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"                                                        
       875                                                                                     
                 ! BEAM0 to SXR Main Dump                                                      
                                                                                               
                   BEAM, ENERGY=Ei                                                             
                   SET, SETSP, SETSPs ; SET, SETCUS, CUSOFF                                    
       880         USE, SC_SXRi                                                                
 
 ENUSE.   Beam line re-expanded: SC_SXRI
 
                   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"                                        
       885         PLOT, TABLE=TWISS, HAXIS=S, VAXIS1=BETX,BETY, VAXIS2=DX,DY, &               
                     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", &        
       890           TITLE="BC1B + Coll1"                                                      
                   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, &                              
       895           COLOUR=100, SPLINE, RANGE=BEGL2B/ENDL2B, FILE="LCLS2sc_color", &          
                     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"                                                      
       900         PLOT, TABLE=TWISS, HAXIS=S, VAXIS=ENERGY, VMIN=0, VMAX=5, &                 
                     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", &          
       905           TITLE="L3B + Extension"                                                   
                   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, &                              
       910           COLOUR=100, SPLINE, RANGE=MQBP13/ENDSPD_1, FILE="LCLS2sc_color", &        
                     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"                                                   
       915         PLOT, TABLE=TWISS, HAXIS=S, VAXIS1=BETX,BETY, VAXIS2=DX,DY, &               
                     COLOUR=100, SPLINE, RANGE=BEGUNDS/DUMPFACEB, FILE="LCLS2sc_color", &      
                     TITLE="SXR Undulator to Dump"                                             
                                                                                               
                 ! SXR Safety Dump                                                             
       920                                                                                     
                   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
 
       925         PLOT, TABLE=TWISS, HAXIS=S, VAXIS1=BETX,BETY, VAXIS2=DX,DY, &               
                     COLOUR=100, SPLINE, RANGE=BEGSFTS_1/SFTDMPB, FILE="LCLS2sc_color", &      
                     TITLE="SXR Safety Dump"                                                   
                                                                                               
                 ! Spreader to HXR Main Dump                                                   
       930                                                                                     
                   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
 
       935         PLOT, TABLE=TWISS, HAXIS=S, VAXIS1=BETX,BETY, VAXIS2=DX,DY, &               
                     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", &       
       940           TITLE="HXR Undulator to Dump"                                             
                                                                                               
                 ! Spreader to BSY Dump                                                        
                                                                                               
                   BEAM, ENERGY=Ei                                                             
       945         SET, SETSP, SETSPd ; SET, SETDA, DAOFF                                      
                   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", &       
       950           TITLE="Spreader to BSY Dump"                                              
                                                                                               
                 ! DIAG0                                                                       
                                                                                               
                   BEAM, ENERGY=Ei                                                             
       955         USE, SC_DIAG0i                                                              
 
 ENUSE.   Beam line re-expanded: SC_DIAG0I
 
                   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"                                                             
       960                                                                                     
                 ! DASEL (deferred)                                                            
                                                                                               
                   BEAM, ENERGY=Ei                                                             
                   SET, SETSP, SETSPd ; SET, SETDA, DAON ; SET, ROLLRC, 0                      
       965         SETK2scDA                                                                   
                   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", &     
       970           TITLE="DASEL to A-line"                                                   
                   SET, ROLLRC, +1                                                             
                !ENDCOMMENT                                                                    
                                                                                               
               ! ------------------------------------------------------------------------------
       975                                                                                     
                !CALL "LCLS2sc_area_plots.mad8"                                                
                                                                                               
               ! ------------------------------------------------------------------------------
                                                                                               
       980       STOP                                                                          
 
 ZEND.       33 Warning messages,
              0 Error messages.
                MAD terminated on 23/03/23 at 14.57.06
 

 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    121540  56000006      37     0     0    70     0
    2 QDIV2    1 1  55999606   6722280  56000006       0     0     0     0     0
   20 system   1 8  56000006       111  56000006       0     0     0     0     0
