!Example file showing the usage of PTC_SETSWITCH command !that sets the internal state (i.e switches) of PTC ! !Piotr Skowronski (CERN) ! ! examples/ptc_madx_interface/intstate/intstate.ptc.madx ! option,-echo; option,-info; LQL := 0.220; ! length of QL LQS := 0.124; ! length of QS CAVLENGTH := 2.4; QL : QUADRUPOLE, L=LQL; ! QL quadrupole QS : QUADRUPOLE, L=LQS; ! QS quadrupole !****** define the regular linac cell (Daniel)... TCAV : TWCAVITY, L=CAVLENGTH, VOLT=14.0d0, LAG=-30.d0/360., FREQ=3000.; ds_ql : drift, l=0.25; ! short drift between quads in Daniels design ds_trip : drift, l=(3.34-CAVLENGTH)/2.; ! long drift between quads in Daniels design cell_mrk : marker; cell_q1 : marker; cell_q3 : marker; beforecav : marker; bc : marker; aftercav : marker; k_ls1 := -1.53125*.56/LQL; ! weaker foc. k_ls2 := 1.53125/LQL; ! weaker foc. quad_l1 : quadrupole, l=LQL, k1=k_ls1; quad_l2 : quadrupole, l=LQL/2, k1=k_ls2; LDLS :=(LQL-LQS)/2.; ! half L difference of QL and QS dls : DRIFT, L=LDLS; ! 0.048 m ctfcell : line=( quad_l2,ds_ql,quad_l1,cell_q1,ds_trip ,cell_mrk, beforecav, TCAV, aftercav, ds_trip,cell_q3,quad_l1,ds_ql,quad_l2); ctf : line=(1*ctfcell); ! calculate Twiss parameters for regular cell structure beam, PARTICLE=ELECTRON, ENERGY=0.02d0; USE, period=ctf; ptc_create_universe; ptc_create_layout, model=1, method=6, nst=100, exact=false, closed_layout=false; ptc_start, x=0.001, px=0.0003, y=-0.002, py=0, pt=0.0, t=0.0015; print, text="############################################"; print, text="############################################"; print, text="## Tracking with default settings ##"; print, text="############################################"; print, text="############################################"; ptc_setswitch, debuglevel = 0, maxacceleration=true, exact_mis=true, time=true, totalpath=true, fringe=true; ptc_trackline,everystep, ffile=1; !print, text="############################################"; !print, text="############################################"; !print, text="## Extensive Debug information printout ##"; !print, text="############################################"; !print, text="############################################"; ! !ptc_setswitch, debuglevel = 10, maxacceleration=true, exact_mis=true, time=true, totalpath=true; !ptc_trackline; !!____________________________________________________________________________________________________________ ! !print, text="############################################"; !print, text="############################################"; !print, text="## TOTALPATH==FALSE ##"; !print, text="## T is given with respect to ref. part. ##"; !print, text="############################################"; !print, text="############################################"; ! !ptc_setswitch, debuglevel = 3, maxacceleration=true, exact_mis=true, time=true, totalpath=false; !ptc_trackline; !!____________________________________________________________________________________________________________ ! ! !print, text="############################################"; !print, text="############################################"; !print, text="## TIME==FALSE ##"; !print, text="##It is assumed that particle moves with c##"; !print, text="############################################"; !print, text="############################################"; ! !ptc_setswitch, debuglevel = 3, maxacceleration=true, exact_mis=true, time=false, totalpath=true; !ptc_trackline; !!____________________________________________________________________________________________________________ ptc_track_end; ptc_end; stop; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! SSSSS TTTTT OOO PPP ! S T O O P P ! SSSSS T O O PPP ! S T O O P ! SSSSS T OOO P !