macro beam_comp nrun=1 fit=0 filecase keep exec utilGenColormap.kumac close 1 zone 1 1 gsry_adc_off = 4100 gsrx_adc_off = 3700 txt = run = [nrun] title_gl [txt] hist/file 1 /work/hallc/e93026/rss/firstpass/ntup_dpara/hms[nrun].1.hbook if ( [fit] .eq. 1 ) then ntu/gcut $1 9010.ntbpmx%calsrx opt stat zone 1 1 2dhist 1000 ' ' 100 -4000 4000 100 -20 20 ntu/proj 1000 9010.ntbpmx%gsry_adc-[gsry_adc_off] $1 hist/plot 1000 colz message CLick at lower y and upper y limit vlocate x y +ls bpmstart=y(1) bpmend=y(2) bpmnum=20. vec/create bpmc([bpmnum]) r vec/create adcc([bpmnum]) r bpmstep=([bpmend]-[bpmstart])/[bpmnum] do i=1,[bpmnum] bpmlo = [bpmstart] + ([i]-1)*[bpmstep] bpmhi = [bpmlo] + [bpmstep] message [bpmlo] [bpmhi] [bpmstep] 1dhist 100 ' ' 100 -20 20 ntu/proj 100 9010.ntbpmx $1.and.[bpmlo]