ptc_enforce6d, flag=true; dsel :=1.2;!length of starting and ending drift dmid1l:=1.5;!length of middle drift dmid2l:=0.6;!length of middle drift ! This example illustrates two features of MADXP ! - placemant of elements at arbitrary position ql :=0.2;!length of quads qfstr := 6.7;!strength of quads qdstr :=-6.71;!strength of quads lbend:=2.0; sedft: drift, L:=dsel; middft1: drift, L:=dmid1l; middft2: drift, L:=dmid2l; angb = pi/12.; !bend1: MULTIPOLE, L=lbend, bend1: RBEND, L=lbend, ANGLE:=-angb, e1=angb/2, ptcrbend=true, APERTYPE=CIRCLE, APERTURE={10}; ! Deflection to the left qf1: quadrupole, l=ql, k1:=qfstr, APERTYPE=CIRCLE, APERTURE={10.0}; qd: quadrupole, l=ql, k1:=qdstr, APERTYPE=CIRCLE, APERTURE={10.0}; qf2: quadrupole, l=ql, k1:=qfstr, APERTYPE=CIRCLE, APERTURE={10.0}; bend2: RBEND, L=lbend, ANGLE=angb, e1=angb/2, ptcrbend=true, APERTYPE=CIRCLE, APERTURE={10}; ! Deflection to the right theend: marker, APERTYPE=CIRCLE, APERTURE={10.0}; chicane: line=(sedft,bend1,middft1,qf1,middft2,qd,middft2,qf2,middft1,bend2,sedft,theend); beam, PARTICLE=ELECTRON, ENERGY=0.11d0; use, period=chicane; ptc_create_universe; ptc_create_layout, model=1, method=6, nst=100, exact=true, closed_layout=false; ptc_setswitch, debuglevel=0, exact_mis=true, time=true, totalpath=false; !ptc_align; ptc_printframes, file="frames.txt"; ptc_printframes, file="drawlayout.C", format=rootmacro;!this prints my visualisation with ROOT ptc_eplacement, range=qf1[1], theta=(-30/180)*pi, !theta=(30/180)*pi, onlyorientation, refframe=gcs, autoplacedownstream=false, surveyall=false; ptc_eplacement, range=bend2[1], onlyorientation, phi=(-45/180)*pi, refframe=previouselement, autoplacedownstream=true; ptc_printframes, file="drawlayout2.C", format=rootmacro;!this prints my visualisation with ROOT ptc_eplacement, range=bend2[1], onlyorientation, theta=(-45/180)*pi, refframe=current, autoplacedownstream=true; ptc_printframes, file="drawlayout3.C", format=rootmacro;!this prints my visualisation with ROOT 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 !