![]() |
GamR
0.0.0
GammaROOT
|
The program root2gamr is used to create a TTree containing events as described in About the Event Tree.
The first step to creating a GamR tree is defining the tree type. For this see Tree Definitions to check if the type required exists already, and, if necessary edit treetypes.md and recompile to add your own. Once this has been completed, a configuration file will need to be created to handle the configuration for your specific conversion.
The input for a GamR tree is known as a "Raw tree". This is a very simple structure that contains a TTree called "RawTree". The raw tree should contain a branch for each measurement that could be made in a particular event. For example, the energy recorded by a particular detector, the time at which a detection occurred, or any other flag or piece of information associated with the event. root2gamr is a program that takes this raw tree and converts it into the GamR event tree.
The configuration file handles all the information needed to create the GamR tree. This file is an [.INI file] (http://en.wikipedia.org/wiki/INI_file), and is processed by the library inih.
The first section necessary is the [array] section, which contains the name [groups], which is a list of an arbitrary name for each of the detector groups for the desired tree type. After this, a list of detector names for each detector group should be given. For example:
This defines two groups (HPGE and LABR), corresponding to Germanium and Lanthanum Bromide detectors. There are four Germanium detectors (HPGE1 - HPGE4) and two Lanthanum Bromide detectors (LABR1 and LABR2).
After this section follows a section for each individual detector. The section names should be the detector names previously listed, and in each section a number of detector properties can be set.
The properties and a brief description of their function is given in the following table
| Property | Description |
|---|---|
| id | Unique (integer) identifier of the detector, stored in TDetector::ID |
| efficiency | Detector efficiency, stored in TDetector::Eff |
| branches | List of strings giving the branches in the input tree to assign to each measurement |
| calibration | List of calibration strings |
| pollgate | |
| pollfreq |
Each raw datum (from the source tree) will be written to the event tree, as well as a calibrated value. The calibration is defined by a string which is changed into a TFormula. The values of the each of the n branches are assigned to the first n parameters of the TFormula. The values x, y, z, and t, have special values as defined below. Additionally, the event number can be accessed by the n+1 parameter.
| Value | Description |
|---|---|
| x | Random sample from the uniform [0,1) distribution |
| y | Random sample from a Gaussian distribution |
| z | Standard deviation from the poll histogram |
| t | Mean of the poll histogram |
For example, a line in the configuration file for a detector with two measurements might be
Note that:
Other branch values can also be used in each string, so for example this is a valid statement
Where the calibration string for each branch references the data from the other branches. Note however, that the data used are raw if the calibration for that branch has not been processed yet, or calibrated if it has. So in the previous example, the first [1] is the raw data from the second branch, whilst the second [0] (in the [1] calibration string) is the calibrated value, just previously calculated.
In this case, the detector HPGE1 is assigned the ID 1, branches corresponding to a branch for the energy (m1.1_HPGe_OBI_1) and time (m1.6_GeTAC). Both energy and time are required for the detector to have fired (require = 2), and appropriate calibration strings are assigned to each measurement.
After the [.INI file] has been created, the program root2gamr can be run. Running root2gamr with no arguments will print a help message that gives the options for correct usage. Basic options are given below.
| Flag | Description |
|---|---|
| -h | Display help menu |
| -i | Input file name |
| -c | Configuration file name |
| -o | Output file containing the event tree |
Additionally, a flag specifying the type of event is necessary. This corresponds to the type added in treetypes.md. For example
will take the raw file input_file.root and process it using the configuration specified in my_conf.ini, writing the output to output.gamr.root (which will be created). This is using the event type D321, which contains three groups of detectors: the first with three UInt_t measurements, the second with two UInt_t measurements, and the third with a single UInt_t.