macro make_rate_table type=DPERP read type filecase keep set ltyp 1 set hcol 1. set dmod 1 vec/del * title_gl ' ' do ntar=1,4 if ( [ntar] .eq. 1) then combo=top_hi endif if ( [ntar] .eq. 2) then combo=bot_hi endif if ( [ntar] .eq. 3) then combo=top_lo endif if ( [ntar] .eq. 4) then combo=bot_lo endif fname=charge_files/[type]_[combo].out vec/del * vec/read vrun,vtar,vtpol,vbpol,charge,cf,fideff,dt [fname] nrtot=$vlen(vrun,1) sigma fideff=fideff/100. * message Looping for [nrtot] runs in file [fname] * vec/create vsum([nrtot]) r do nr=1,[nrtot] *do nr=1,1 nrun=vrun([nr]) message At run [nrun] nseg=1 chain -[type] dir=/work/hallc/e93026/rss/pass3 fname=[dir]/ntup/hms[nrun].[nseg].hbook if ($FEXIST([fname])) then while ($FEXIST([fname])) do message add [fname] to chain chain [type] [fname] nseg=[nseg]+1 fname=[dir]/ntup/hms[nrun].[nseg].hbook endwhile zone 1 1 1dhisto 1011 ' W ' 100 .8 2.0 ntu/proj 1011 //[type]/9010.w abs(hsdelta)<8.and.hsp>0.and.hsshtrk>3. hrin 1011 sum=$hinfo(1011,'sum') vec/input vsum([nr]) [sum] else vec/input vsum([nr]) 1000. endif * enddo sigma ny=vsum/charge/fideff sigma err=sqrt(vsum)/charge*fideff vec/write vrun,vsum,ny,err,charge,fideff rate_files/[type]_[combo]_norm_yield.dat f7.1,5(g12.5,1x) * * enddo * return