How to use the Hall A Gen Library for Data Anlysis... Bodo Reitz Revision 0.0, September 2, 05 In the following you will find some hints of how to use the Hall A analyzer for analysis of data taken for the Hall A Gen experiment. I will concentrate on the example of the test data taken end of January 2005 (end of the E01015 SRC experiment). To learn more about the goals of this specific test, you can look into the beam time request for beam development time: http://hallaweb.jlab.org/experiment/E02-013/expdocs/proposal_for_n20.txt A description of the setup is included in http://hallaweb.jlab.org/experiment/E02-013/expdocs/N20_AdcCal_Usersguide.ps All analysis software for this project is based on Ole Hansens Hall A root analyzer, for which we added a library dedicated to non standard equipment used during E02013 (e.g. drift chambers for BigBite, Shower for BigBite, HAND ( = Hall A neutron detector ). It is still in a developement state, so dont be surprised about frequent changes. It is strongly recommended to use the CVS version of both the analyzer and the AgenLib package, and frequently update both. Instructions of how to obtain the software can be found at http://hallaweb.jlab.org/experiment/E02-013/expdocs/agen_install_howto.txt Besides the successfully compiled analysis software (consiting of root (preinstalled on most Jlab machines), the hall A root analyzer, and the AgenLib package) you will need some more files (here again for the N20 tests, ask the experts for similar tables for other tests): 1) list of runs, including run numbers and running conditions: /work/halla/e02013/disk1/runinfo/* 2) raw data files: the are on the mass storage system, together with the raw data from the SRC experiment: /mss/halla/e01015/raw/e01015_####.dat.X you can copy them onto a cache disk, using the jcache command jcache /mss/halla/e01015/raw/e01015_####.dat.X and you will find the file after some time and only for a limited period at /cache/ /mss/halla/e01015/raw/e01015_####.dat.X or you can copy them with jget onto a local disk. You might also be lucky and find a copy on the work disk in /work/halla/e02013/disk1/raw or /work/halla/e02013/disk1/raw (If you need them frequently, it is fine to copy a few files there, but please dont copy them additionally into your private subdirectory on the workdisk) 3) Database files The root analyzer and its subclasses need a lot of additional information, which is not contained in the raw data files, such as running conditions, detector setups, calibration data ..... All this information is located in a "database" a huge collection of - at present - ascii text files. These files have a tight naming scheme: db_APPARATUS.DETECTOR.dat For each detector which is used in the analysis such a file is needed, the software first looks in your local directory (from where you started the analyzer) if such a file exists. If not it searches in the directories defined by the environment variable DB_DIR and the time the raw data was taken. E.g. the N20 data was taken on February 2, if beyond DB_DIR the following three directories exist: > echo $DB_DIR /work/halla/e02013/disk1/db > ls $DB_DIR 20050123 20050710 20050823 Then the analyzer will use the files in 20050123, whereas if the data was taken on July 30, the files in 20050710 will be used. For all gen tests, a working set of database files should be in /work/halla/e02013/disk1/db If you want to optimize a database file, it is recommended to first put it into your local directory, and only after your optimization is finished, you should replace it in the public database directory. Changes there should be logged in the AgenDb_log file. Dont forget to remove experimental database files in your local directory, once they are not needed anymore. 4) Steering Scripts The programming language as well as the macro language for the root and our derived software is C/C++. Therefore all scripts are written in C. Usually the analysis is separated into (at least) two passes. The first pass, the so called replay, requires the analyzer, and reads in the raw data file, and produces a "rootfile", which can contain either histograms of variables, and/or variables can be put in a tree. An example for such a script can be found in /work/halla/e02013/disk1/replay/replay.C These scripts usually require two additional input files, one which defines variable to be put into the root file (output_N.def) and one which defines cuts (cutdef_N.dat). In the second pass various scripts can be used to actually look at the data in a rootfile (look e.g. Adc_Cal.C ) Further information about these scripts can be found in Hall A C++ Analyzer Documentation http://hallaweb.jlab.org/root/doc/index.html ROOT Documentation ftp://root.cern.ch/root/doc/Users_Guide_4_08.pdf To be continued ...