duartej / postproc-alibava

Utilities for post-processing data obtained with the ALIBAVA DAQ system.
0 stars 0 forks source link
alibava-daq postproc-alibava

Postproc-Alibava

Build Status DOI

Citing Postproc-Alibava: If you have use postproc-alibava package, we would appreciate citations. Please use the DOI badge above

Some utilities for the post-processing of data acquired with the alibava systems alibava DAQ

Compilation

Create a build directory. Configure and compile the code using cmake inside the build directory:

$ mkdir build
$ cd build
$ cmake ..
$ make install

Per default it will create the executable fortythieves and genfa in the $HOME/.local/bin/ directory, so you should have the environment variable PATH pointing to that folder:

$ export PATH=$PATH:$HOME/.local/bin

As well, it will create some shared libraries under the $HOME/.local/lib, so you need to update also the environment variable LD_LIBRARY-PATH and PYTHONOPATH for the python packages:

$ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/.local/lib
% export PYTHONPATH=$PYTHONPATH:$HOME/.local/lib

You can change the install directory by using the cmake variable CMAKE_INSTALL_PREFIX

$ cmake -DCMAKE_INSTALL_PREFIX=your_favorite_path ..

and then don't forget to export the PATH and the LD_LIBRARY_PATH to include both folders.

Note

The alibavaSkifftools sub-package is installed always with the --user option. This option is used when you don't have root privilegies (or you don't want to install the package in the global site-packages directories). The package will be installed inside of the user directory '$HOME/.local'. If you don't want to use the --user option, you must change it in the alibavaSkifftools/CMakeLists.txt file

Dependencies

Usage

After succesful compilation and the exportation of the environment variables, you are ready to use the executables of this package. Please take a look to the help option to use them:

$ genfa -h
usage: genfaol [OPTIONS] alibava_data.raw

Extract the number of events from ALIBAVA raw binary data

[OPTIONS]
 -h show this help
$ fortythieves -h
usage: fortythieves [OPTIONS] alibava_data.raw

Convert a raw binary data from the ALIBAVA DAQ into a ROOT file

[OPTIONS]
 -o name of the ROOT output file [fortythieves.root]
 -p alibava raw-binary containing the pedestal run
 -c alibava raw-binary containing the calibration run
 -r run number [-1]
 -h show this help

To obtain a root file with signal subtracted by pedestal and common noise, you need to provide the -p option with the pedestal file obtained using a pedestal run with the ALIBAVA-gui. You can provide a raw file obtained using a calibration run with the -c option as well. In that case, a new branch will contain the signal in number of electrons (pedestal and noise subtracted).

$ fortythieves -r <runNumber> -p <raw_pedestal_file> -c <calibration_file> -o outputfile.root <raw_beam_file> 

After the previous command is launched, the outputfile.root file will contain four TTrees:

Note that in cases of -p and/or -c option present, an extra root file will be created with the result of the ROOT conversion performed at the pedestal and/or calibration raw files.

Use the AddFriend mechanism to relate and connect the original and the postproc versions of the Trees in order to share and use information between them.

# Add the Events tree as friend to postproc_Events (you can do it as they have the same
# number of events)
postproc_Events->AddFriend("Events");
# Now you can use the branches of Events (as eventTime) as if they belong to postproc_Events
postproc_Events->Draw("postproc_data_beetle1[13]","eventTime < 30 && eventTime > 3");
# An exemple to draw a map of the calibrated signal versus the channel on the beetle 1
postproc_Events->Draw("postproc_cal_data_beetle1[][]:Iteration$","eventTime < 30 && eventTime > 3","COLZ");

See also the alibavaSkifftools README.