Python and ROOT scripts to convert binary output from Struck ADCs to ROOT TTree ntuples. A similar project, TOWARD, is developed for CAEN digitizers.
- cross-platform, tested in Windows, Mac & Linux
- scripts only, no compilation
- simple trees with only basic data types, no library is needed to define complicated data structures
- CERN ROOT, any version
- Python 3, tkinter is used to create a simple GUI. It should be included by default in most Python installations.
- idx.C: a ROOT script to create an index file for a Struck ADC binary output, where basic information of the ADC is saved
- b2r.C: a ROOT script to convert a Struck ADC binary output to ROOT TTree ntuples
- view.C: a ROOT script to run a ROOT TTreeViewer to examine the contents of ROOT trees
- rosa.py: a Python GUI to run all the scripts above
- idx.sh: a shell script that submit indexing jobs to Slurm
- b2r.sh: a shell script that submit b2r jobs to Slurm
- Download and unzip this project to your local machine (or use git clone if you know how).
- Get into the project folder and create a subdirectory there for your experiment.
- Create a
daq.cfg
file inside your newly created folder, and specify your Struck ADC setup therein. The syntax of such a configuration file is demonstrated in SNS/MARS/daq.cfg. Sometimes, the number of events saved in each channel is slightly different from each other. If the sync flag in thedaq.cfg
is 1, extra events in some channels will not be saved in the output file. If the flag is 0, everything will be saved. However, the total number of events in each channel may be different, i.e., they are not synced. - Run rosa.py (Double click the file if you are in a file browser, or
python3 rosa.py
if you are in a terminal) to launch a simple GUI. Your folder should appear in the top left list box called "Select experiment:". - Select your folder in the list, the content of
daq.cfg
in your folder should be shown in the GUI. Double check if everything is OK. - Click the button "Run idx.C", a window will pop up for you to select a Struck ADC binary output file to parse. After the parsing process, a CSV file will be created in your folder. It contains all the information that is needed to run b2r.C, for example, an index of positions and sizes of data blocks in the selected binary output file. Carefully examine the information about the DAQ saved in the index file. If it is different from the
daq.cfg
, please make sure thatdaq.cfg
or the DAQ software is set consistently. NOTE: If the output file is compressed, it will be unzipped first. The unzipped file will be placed in your folder and then be indexed. - Select the CSV file in the list box called "Select index file:". Its content will be displayed in the GUI. Double check if the binary output is correctly indexed.
- Click the button "Run b2r.C" to convert your binary file to a ROOT file, which will be shown in the list box "Select ROOT file:" in the GUI.
- Select the newly created ROOT file, click the button "Run view.C" to run a ROOT TTreeViewer to check your data.
- https://github.com/gcrich/binaryToROOT-NGM3316, original project
- https://github.com/schedges/binaryToROOT-NGM3316, a newer fork of the original one, which made the parsing of the 48-bit timestamp more robust across various compilers.
This project is for the decoding of existing Struck ADC's output. To run the DAQ and generate binary output, one needs a DAQ program, such as the ones listed below.
- https://github.com/jrellin/sis3316-jrellin, python based, seems newer
- https://github.com/sergey-inform/SIS3316, python based, first appears on Google
- https://code.ornl.gov/nmdcimaging/ngmdaq.git and its fork https://code.ornl.gov/CASA/ngmdaq, not publicly accessible.