real function tally(id) integer id include 'talign.inc' logical hexist external hexist character*80 title if (.not.hexist(id)) then do i=0,18 write(title,1000) i 1000 format('counter',i3,', left tube') call hbook2(100+i,title,5,-50.,50.,1400,7400.,8800.,0) write(title,1010) i 1010 format('counter',i3,', right tube') call hbook2(119+i,title,5,-50.,50.,1400,7400.,8800.,0) write(title,1020) i 1020 format('counter',i3,', coincidence') call hbook2(138+i,title,5,-50.,50.,1400,7400.,8800.,0) enddo endif do i=1,ntal call hfill(100+chtal(i),tal(i)-taref,float(runno),1.) enddo do i=1,ncoin call hfill(138+cochan(i),cotime(i)-taref,float(runno),1.) enddo tally=0 end