title,'LHC Cell APERTURE exemple, BJ Aug2009'; REAL CONST ANGLE.MB = TWOPI/8/(23*6+2*2*4); REAL CONST l.MB = 14.30; REAL CONST l.MQ = 3.10; REAL CONST drift1 = 3.67; REAL CONST drift2 = 1.02; REAL CONST drift3 = 1.74; len_half_cell = l.MQ+drift1+3*l.MB+2*drift2+drift3; value, len_half_cell; !!!! apertures a=0.022; b=0.018; h=0.022; v=0.022; !!!! tolerances th=0.001; tv=0.0005; tr=0.001; MB: SBEND, L := l.MB, angle = ANGLE.MB; MQ: QUADRUPOLE, L := l.MQ, apertype=rectellipse,aperture = {a,b,h,v}, aper_tol = {th,tv,tr}; kqf = 0.008703550815; kqd = -0.008705002933; LHCCELL: SEQUENCE, refer = ENTRY, L = 2*len_half_cell; MQ1: MQ, k1:= kqf, at= 0.; MB1: MB, at= l.MQ+drift1 , apertype=rectellipse, aperture = {a,b,h,v}, aper_tol = {th,tv,tr}; MB2: MB, at= l.MQ+drift1+l.mb+drift2, apertype=rectellipse, aperture = {a,b,h,v}, aper_tol = {th,tv,tr}; MB3: MB, at= l.MQ+drift1+2*(l.mb+drift2), apertype=rectellipse, aperture = {a,b,h,v}, aper_tol = {th,tv,tr}; MQ2: MQ, k1 := kqd, at= len_half_cell; MB4: MB, at= len_half_cell + l.MQ+drift1 , apertype=rectellipse, aperture = {a,b,h,v}, aper_tol = {th,tv,tr}; MB5: MB, at= len_half_cell + l.MQ+drift1+l.mb+drift2, apertype=rectellipse, aperture = {a,b,h,v}, aper_tol = {th,tv,tr}; MB6: MB, at= len_half_cell + l.MQ+drift1+2*(l.mb+drift2), apertype=rectellipse, aperture = {a,b,h,v}, aper_tol = {th,tv,tr}; endsequence; beam,particle=proton,energy=450.0; set, format="9.5f"; use,period=LHCCELL; select, flag=twiss, clear; select, flag=twiss, column=name,s,l,betx,bety,alfx,alfy,dx,dpx,mux,muy,n1; twiss, sequence=LHCCELL; !!! uses default beam and halo data (lhc at injection) select, flag=aperture, clear; select, flag=aperture, column=name,s,betx,bety,dx,x,y,n1,apertype,xtol,ytol,rtol; aperture,offsetelem="offset.tfs",file="ap.tfs";