vec/del * filecase keep run=46076 run=46137 run=46117 unscalib=.00025 bcm1calib=0.00008922 gbcm1_offset = 250855. bcm2calib=0.00029339 gbcm2_offset = 250235. if ( [run] .ge. 46100) then bcm1calib=0.00088281 bcm2calib=0.00029196 gbcm1_offset = 250093. gbcm2_offset = 249204. endif txt = Run [run] title_gl [txt] vec/read trig1,time,bcm1,bcm2,unser /group/BARYON/replay/[run].scal sigma rtime=sumv(time) len=$vlen(time) set plci 1. graph [len] rtime unser vlocate x y zunser = 0 low=x(1) hi=x(2) cnt=0 do i=1,[len] ttime=rtime([i]) if ( [ttime] .gt. [low] .and. [ttime] .lt. [hi] ) then zunser = [zunser] + unser([i]) cnt=[cnt]+1 endif enddo zunser=[zunser]/[cnt] message [low] [hi] [zunser] sigma unscur=(unser-[zunser])*[unscalib] sigma bcm1cur=(bcm1-[gbcm1_offset])*[bcm1calib] sigma bcm2cur=(bcm2-[gbcm2_offset])*[bcm2calib] sigma ratbcm1=bcm1cur/unscur sigma ratbcm2=bcm2cur/unscur set plci 2 graph [len] rtime bcm1cur set plci 1 graph [len] rtime unscur l set plci 3 graph [len] rtime bcm2cur l vec/write rtime,unscur,bcm1cur,bcm2cur,ratbcm1,ratbcm2 ' ' 6(f10.5,1x)