Hall A C++ Analyzer Hands-On Tutorial
Ole Hansen (ole@jlab.org)
14 January 2015

This is a small replay setup for an optics calibration run of the
Hall A g2p experiment that ran in early 2012.

The replay assumes that you have ROOT set up. On JLab CUE machines, you
can do so easily with the following commands:

source /apps/root/PRO/setroot_CUE

You will need to build the included analyzer version 1.5.28 as follows:

tar xzf analyzer-1.5.28.tar.gz
cd analyzer-1.5.28
make -j
cd ..

To set up various required environment variables, run the included setup
script:

source setup.csh

(or setup.sh if you are using bash, e.g. on Linux or MacOSX)

Next, you need to obtain the raw data file to be replayed. On JLab
CUE systems, you can easily do so by making a symbolic link:

ln -s /work/halla/g2p/disk1/ole/g2p_3132.dat.0 data/

Alternatively, you can restore the file from tape:

cd data
jget /mss/halla/g2p/raw/g2p_3132.dat.0 .
cd ..

If you are offsite or on a non-CUE workstation/laptop, you'll need to copy
the file to your machine. The size is about 700 MB.

Next, go to the replay directory, run the analysis and plot some
results using the included example scripts:

cd replay
analyzer
analyzer [0] .x replay.C
(answer -1 to replay all events)
analyzer [1] .x plot.C
analyzer [2] .x plot2.C

You may find it interesting to inspect the scripts in detail, the input 
files replay.odef and replay.cdef in the replay directory, as well as
the database files in the DB directory.

The tutorial talk given at the analysis workshop can be found at

http://hallaweb.jlab.org/data_reduc/AnaWork2015/tutorial_jan15.pdf

Feel free to email me with any questions you have.
