macro nitro_bg field=para opt zfl close 20 read field mcdir=/group/e01006/jones/pol_hms_single/outfiles/hbook mcname=[field]hi_nh3_pf55_latest2 mcfile=[mcdir]/[mcname].1.hbook message Opening [mcfile] Histogram/File 20 [mcfile] 0 -X txt = [mcname] Entire target ( black) compared to 15N (red) title_gl [txt] cut $1 numer_wt.and.a=15.and.abs(hsdelta)<8. cut $11 a=15.and.abs(hsdelta)<8. cut $2 numer_wt.and.(a<15.or.a>15).and.abs(hsdelta)<8. cut $3 numer_wt.and.abs(hsdelta)<8. cut $13 abs(hsdelta)<8. zone 1 2 vec/create Ncts(40) r vec/create Nrcnt(40) r vec/create Acts(40) r vec/create Arcnt(40) r vec/create vw(40) r vec/create vwerr(40) r 40*0.0001 1dhisto 1000 ' W ( all) ' 40 .7 1.1 ntu/proj 1000 1.w $3 hist/plot 1000 hist/get_vect/contents 1000 acts 1dhisto 1000 ' W ( all) ' 40 .7 1.1 ntu/proj 1000 1.w $13 hrin 1000 hist/get_vect/contents 1000 arcnt 1dhisto 1000 ' W ( 15N) ' 40 .7 1.1 ntu/proj 1000 1.w $1 set hcol 2. hist/plot 1000 s set hcol 1. hist/get_vect/contents 1000 ncts hist/get_vect/abscissa 1000 vw 1dhisto 1000 ' W ( 15N) ' 40 .7 1.1 ntu/proj 1000 1.w $11 hrin 1000 hist/get_vect/contents 1000 nrcnt sigma drcnt=arcnt-nrcnt * sigma nerr=sqrt(nrcnt) sigma derr=sqrt(drcnt) sigma ratn=ncts/nrcnt sigma rata=acts/arcnt sigma rat=ratn/rata sigma df=ncts/acts sigma dferr=rat*sqrt(drcnt*drcnt*nerr*nerr+nrcnt*nrcnt*derr*derr)/arcnt/arcnt hplot/errors vw df vwerr dferr 40 24 .1 W *graph 40 vw df alw ytxt = 15N DF xtxt = W (GeV) atitle [xtxt] [ytxt] ! ! ! 220 vec/write vw,df,dferr [field]_15N_df.dat 3(f15.6,1x) pict/print [field]_15N_df.ps