Data Analysis with Go4
Go4 is the GSI Analysis Framework that stands for GSI Object Orientated On-line Off-line system. It is based on the ROOT framework (CERN) an therefore provides full ROOT functionality.
The data stream or the list-mode data (LMD) files written by MBS can be analysed using those packages.
Go4 is installed and working on the zirkonia and the fwk108 at the moment. The working directories are:
|1.||login on zirkonia||ssh -X ntofdaq@zirkonia password: ***********|
|2.||set environment variables||go4log|
|1.||login on fwk108||ssh -X ntofdaq@fwk108 password: ***********|
|2.||start bash (.bashrc is not loaded automatically)||bash|
Environment variables as user ntofdaq@fwk108 are set automatically when calling bash as specified in ~/.bashrc
There is an example on the fwk108 that will make you familiar with basic functions of the Go4 packages, e.g. data unpacking, filling histograms, using parameters and conditions and creating tree-files. The example folder is the following:
Copy this folder and have a look at the files inside:
ntofdaq@fwk108:~/go4/example > ls
AnalysisStart.sh file.C MainUserAnalysis.cxx rename.sh* TXXXEvent.h TXXXProc.cxx
data.lmd Go4UserAnalysisLinkDef.h Makefile setup.C TXXXParam.cxx TXXXProc.h
DefineObjects.C LoadObjects.C Module.mk TXXXEvent.cxx TXXXParam.h
With the different files one can handle different tasks that should be executed while the analysis is running. A short description is given in the following table:
|Filename||Function||Step by step|
|MainUserAnalysis.cxx||main file that calls the analysis scripts and methods|
|TXXXProc||class for unpacking and creating and filling histograms and conditions||Unpacking and Filling histograms|
|TXXXParam||class for the definition and handling of parameters for the analysis||Including parameter and conditions|
|TXXXEvent||class for the definition of ROOT tree files||Creating ROOT tree files|
|DefineObjects.C, LoadObjects.C||code that has been outsourced from the TXXXProc.cxx to get the source code more clearly arranged|
|setup.C, file.C||predefined configuration scripts called by MainUserAnalysis.cxx|
|AnalysisStart.sh||user analysis startup script use by GUI analysis|
|Makefile, Module.mk, Go4UserAnalysisLinkDef.h||information needed for compiling|
|rename.sh||rename script - use to change text patterns in all filenames and files in this directory|
|data.lmd||sample lmd data file used as example|
Building the code
Once finished with the changing of your source code one need to compile it. This is done with the Makefile:
- make - compiles and links as defined in the Makefile (Makefile, Module.mk, Go4UserAnalysisLinkDef.h)
- make clean - removes links, deletes object files and libraries
When the compilation finished without errors one is ready for the analysis.
Analysis via batch mode
The analysis via batch mode can be used to analyse the lmd-files written by the data acquisition. Just type
- ./MainUserAnalysis -f data.lmd [opt]
The argument -f is required when using a file input followed by the path of the file to analyse. With [opt] one can define a maximum number of events to be processed (integer number).
After the analysis finishes two *.root files should have been added to the directory:
- data_AS.root - autosave file where all of the histograms, conditions and parameters are stored
- tree.root - file that contains the ROOT trees
These files can be opened using the Go4 GUI or the ROOT TBrowser.
Analysis via GUI
Start the Go4 graphical user interface typing go4 in the command line. The offline anlysis of the lmd files is done in the following way:
- Analysis -> Launch analysis
In the "Start Client" window one has to check whether the Executable and the Directory is chosen correctly. In our case it is "MainUserAnalysis" and "/home/ntofdaq/go4/example/". Click "Start" and wait for the Analysis Terminal to pop up. I f it does not show up click
- Analysis -> Analysis Window
Watch the status messages and when the scripts are executed a second window should show up. Here one can disable the "Store" option and has to configure the Event Source. The Event Source has to be set to MBS file and in "Name" one has to specify the path where the lmd file is stored. In our case it is "/home/ntofdaq/go4/example/data.lmd". The other options need no change. Click "Submit" to initialise the event classes.
On the left side (browser) one can double click on Analysis and can see inside the directories the histograms that are not filled yet.
The analysis is started with
- Analysis -> Start
The status line at the bottom shows you the events processed. When the analysis is finished (after less then a second, only 40 events) one can look at the filled histograms.
The analysis is correctly closed with
- Analysis -> shutdown analysis server
After the Terminal window outputs "done", go4 can be closed.
The online analysis is similar to the analysis via GUI, except that the Event Source is a different one: MBS Stream Server or Remote Event Server. The name is for example rio4 or rio7.