README bcal_ascii

Oct. 3, 2006
David Lawrence


This directory contains the source for the bcal_ascii program.
This program will generate an ASCII formatted file from the
raw data files acquired during the 2006 BCAL beam test. 

This program was copied from the bcal_dst program which places
the same information into a ROOT tree.

The format of the ASCII files is as follows:


File starts off with a header, all lines of which start with a
"#" character. The header contains info about the run number
and the time the file was generated.

Each event starts with the line "EVENT: XXX"
where "XXX" is the event number. Nothing else is contained on 
this line.

After the EVENT marker, the next 36 lines contain the ADC and
TDC values for the 36 BCAL tubes in order with North 1-18
and then South 1-18. The ADC value comes first, then a single
space, and then the TDC followed by a newline.

The next line contains a single number indicating the number of
reconstructed photons to follow. For example, if this line is "4"
then the next 4 lines contain photon tagger hits.
A reconstructed photon is represented by 2 values, the photon
time in nanoseconds and the photon energy in MeV. The photon
time is first, followed by a single space, then the photon
energy followed by a newline. Note that the photon times 
for valid events tend to be around 600ns. It is left to the
analyzer to determine the offset used when comparing this to
to the BCAL times since this may change for different configurations
of the BCAL.

The next line contains the number of TDC values from the trigger.
The N lines following will then be the trigger hits. The 
format of the trigger TDC hits will be with the time (in nanoseconds)
first, followed by a space, then the trigger id (1-12) followed
by a newline. One useful piece of info here is that tdc values with 
id=10 are from the veto counter. Also note that one of the
trigger times is used as the reference signal and subtracted from all
trigger TDC values. This means one of the times is necessarily 
zero.

The last line of the event contains the trigger latch word.
This has one bit set for each trigger active for the event.
Generally, this was a single bit. Trigger bit assignments
can be found on the Wiki at:
http://www.jlab.org/Hall-D/software/wiki/index.php/HOWTO_documentation
in the "HOWTO configure the trigger" section. Note that most 
production runs had the cosmic and pulser triggers active, but
prescaled. By filtering out all but these events, one can obtain
pedestals from the production data runs.

Questions and comments should be sent to:
david@jlab.org
x5567