1) Hovannes has written several utilites to accumulate F-cup and
live-time information form scaler events. Since this information is
usually not available during "physics" events he has also written a
interface for you to get at this information during physics events.
placing the following in your code should work:
call BM_GET_TRIG( Q_TOT_OUT, CURRENT_OUT, TL_TU_OUT, iBk )
Q_TOT_OUT, CURRENT_OUT, TL_TU_OUT are all real output parameters
iBk is an INTEGER input parameter which if 0 means you just get the
latest reading, if iBk = 99 means you will get the 99'th previous
reading.
Q_TOT_OUT is the integrated charge so far this run
current_out is the instantaneous current
TL_TU_OUT is the live time
2) Also the scaler events are now separated from the physics events, if
you need to work with scaler data work within: user_scaler.F
3) hbook_init.F has been moved from recutl to the user library, you now
have totally control of hbook/paw initialization...no one to blame but
yourself for requesting 1 gigabyte of memory for your n-tuples.
4) packages/include/clas_offsets.inc is an include file automatically
generated from clasbanks.ddl. It contains the parameters set to
the offsets for values within a bank. The naming convention is:
BankName_VariableName where the variable is as listed in the ddl file.
#include "clas_offsets.inc"
event_number = IW( head_ind + head_nevent )
5) packages/include/clas_index.inc and recutl/get_all_index.F
In addition to the offsets within a bank, there is an include file
clas_index.inc which gets filled with all the bank indices for that
event. Now this will waste some CPU time, but the utility is meant
more to ease the user coding pain and to quicken the development
cycle.
here's how it works:
#include "clas_index.inc"
#include "clas_offsets.inc"
call get_all_index
write(*,*)"event number=",iw( head_ind + head_nevent )
do 201 while (cc_ind16 .ne. 0)
do 199 ic = 1, IWROW(cc_ind)
write(*,*)"ic=", ic,
1 iw16( cc_ind16 + cc_adc + (ic-1)*IWCOL(cc_ind)),
1 iw16( cc_ind16 + cc_tdc + (ic-1)*IWCOL(cc_ind))
199 continue
cc_ind = IWNXT(cc_ind)
cc_ind16 = 2*cc_ind
201 continue
ALL banks indices can be found in variable names: BankName_ind
for 16 bit values the bank indices is: BankName_ind16
The previous example writes out the ADC and TDC information for ALL
CC hits.
There are many advantages to using these include files:
a) the code is readable
b) you don't have to remember if the TDC are in column 2 or 3
c) if the bank definition changes you don't need to rewrite any code
as long as TDC and ADC remain in the bank.
I hope people make use of this....this code is rather raw 48hrs but
it also is quite simple (4 lines of FORTRAN....).
As always feel free to send me any comments.
Arne
--
Arne Freyberger
JLAB (Mail Stop 12H) Phone: (757) 269-6268
12000 Jefferson Avenue Pager: (757) 680-8884 freyberg@cebaf.gov
Newport News, VA 23606 Phax: (757) 269-5800 http://www.cebaf.gov/~freyberg