macro bending * * Read data points from Mathcad print output for * bending of electrons in permanent magnet (0.23 T) * 2/13/06 ES * * set options * option ndate option nbox *set stat 1111111 set stat 111 option nstat set fit 111 * next *zone * * plotting options * set xmgl 4. *set xmgl 2. set ymgl 4. *set ymgl 3. set asiz 0.4 set xlab 2. set ylab 1. set xsiz 20. set ysiz 20. * * set font definitions to bold roman * set CFON -21 set GFON -21 set LFON -21 set TFON -21 set VFON -21 set txfp -21 set SMGU 0.02 set SMGR 0.02 set CSIZ 0.5 set VSIZ 0.4 set TSIZ 0.5 set asiz 0.5 set YHTI 0.9 set HWID 3.0 set BWID 3.0 * * npts = 201 * * z is along the photon beamline * x assumes horizontal bend * vector/create z([npts]) R [npts]*0. vector/create x([npts]) R [npts]*0. vector/create z6([npts]) R [npts]*0. vector/create x6([npts]) R [npts]*0. * * open metafile * for/file 66 bending.eps meta 66 -113 *for/file 66 bending.ps *meta 66 -111 *hplot/key 0.2 2.8 22 'R1 occupancy 0.8"Y# ' * * read data file * vector/read z,x 'bending12.dat' vector/read z6,x6 'bending6.dat' *vector/print z6 *wait *vector/print x6 *wait * * change offset * sigma x = x -0.032 sigma x6 = x6 -0.032 csize = 0.1 xmin = 0 xmax = 13 ymin = -0.0495 ymax = 0.3 set txci 1 set pmci 2 igset chhe 0.5 hplot/null [xmin] [xmax] [ymin] [ymax] hplot/symbol z x [npts] 20 [csize] hplot/atitle 'Distance along beamline (m)' 'Deflection (m)' set pmci 4 hplot/symbol z6 x6 [npts] 20 [csize] set txci 4 itx 2.8 0.1 '6 GeV' set txci 2 itx 7 0.05 '12 GeV' set txci 1 igset chhe 0.4 itx 0.3 0.03 'magnet' itx 0.3 0.01 'aperture' itx 6 -0.025 'beamline' * * draw aperture. Note that 3.683 is the physical size of * the magnet. The magnetic length is 3.556 cm. * set pmci 1 line [xmin] 0.0495 3.683 0.0495 line 3.683 -0.0495 3.683 0.0495 * line 12 [ymin] 12 [ymax] line [xmin] 0.198 [xmax] 0.198 line [xmin] -0.032 [xmax] -0.032 *hplot/key 80 425 20 'D2, R= 1 cm' wait * * * close file * *close 1 close 66 * * exitm return