subroutine hec_scaler_epio c c read the scaler block c put the data in the event header common c implicit none c include'hec_epio.inc' !epio include'hec_evth.inc' !event header include'hec_runh.inc' !run header c integer i c c there are 12 scaler values, 24 bits each c i_scaler(i) info in ibankbuf(2*i+1) and ibankbuf(2*i+2) c from some dumps, and taking with Sepp, it looks like c ibankbuf(2*i+1) = most significan 2 bytes (bits 16-31) c ibankbuf(2*i+2) = lowest significant 2 bytes (bits 0-15) c no swaps. c Sepp warns that bit number 23 could be a status word. c So we should mask off ibankbuf(2*i+1) with 007F = 127 c do i = 1, 12 i_scaler(i) = iand(ibankbuf(2*i+1), 127)*65536 + + ibankbuf(2*i+2) enddo c c print *, ' ' c print *, ' i_scaler(1) ', i_scaler(1) c print *, ' i_scaler(2) ', i_scaler(2) c print *, ' i_scaler(3) ', i_scaler(3) c c print *,' *** scaler read' c end