- Introduction
- Requirements
- Compiling the Processor
- Running the Processor
- Pulling New Changes
- Macros
- To-do
- Known Bugs
This program reads raw TORCH data and processes it into a ROOT file.
For an overview, see slides from the Testbeam Meeting on 1st June 18.
The Documentation
directory contains full deoxygen documentation. It can be viewed through open Documentation/html/index.html
.
Please report any issues to Thomas Hancock.
The Multiboard Data Processor (MDP) requires:
- A working installation of CMake
- A C++14 compliant compiler (e.g. gcc 4.9 or greater)
- A working installation of ROOT 6
Note: The program has been tested with root 6.08.04, but any version of ROOT 6 should work (if you have issues related to this, contact Thomas Hancock).
The Multiboard Data Processor (MDP) is built using CMake.
To build the MDP, do:
mkdir build
cd build
cmake .. -DCMAKE_INSTALL_PREFIX=$(install_path) -DCMAKE_BUILD_TYPE=Release
make
make install
The MDP will be built in the bin
directory of the set $(install_path)
.
If developing the processor, the program can be build in debug mode by changing the CMake Build Type:
-DCMAKE_BUILD_TYPE=Debug
The processor can be configured at compile time to run on data produced with the TDCs in Very High Resolution mode. To enable this, run CMake with the additional command -DVHR_MODE:BOOL=TRUE
.
To run the MDP, simply call the program:
./$(install_path)/bin/TORCH_Data_Processor
followed by the files you wish to process (e.g. data/*.txt
)
Data files must contain the string _Chain_$(ChainID)_Device_$(DeviceID)_$(FileNo)_$(Time)
in their name. This allows the MDP to properly synchronise data across multiple readouts. The string can be surrounded by words on either side, but any words which follow must be separated from the string by an underscore.
The program is configured via a xml config file. This file is specified with the -con
command line option. If not set, the program will search for Config.xml
. An example configuration file is provided for you to modify (Example_Config.xml
).
The output file name can be specified -out
command line argument. If not set, the output will be called Output.root
.
A script is provided which runs a quick test of the MDP in Serial
mode.
To run the test, do:
. run_test.sh
This runs the MDP on the data contained in ./data/Test_Data
using the config specified by Example_Config.xml
.
The test data is deliberately not perfect. The resulting output should show the following error summary:
=== Errors Summary ===
Error: Invalid Datatype 6
ChainID: 0, DeviceID: 0 (x 11)
Error: Invalid Datatype 7
ChainID: 0, DeviceID: 0 (x 11)
Error: Invalid Datatype 14
ChainID: 0, DeviceID: 0 (x 45)
ChainID: 1, DeviceID: 0 (x 177)
Attempting to run over large numbers of files (more than ~1000) may result in the following error:
-bash: ./Install/bin/DataProcessor: Argument list too long
In this case, an alternative method for passing data files to the MDP is provided. In the scripts
directory is a python script which, when passed one or more directories, will produce a newline separated list of files. E.g.
python scripts/MakeFileList.py data/Test_Data/TimeRef_01_Device_?
The output is stored in filelist.lst
:
data/Test_Data/TimeRef_01_Device_0/TimeRef_01_Device_0_000000_20180523110722.txt
data/Test_Data/TimeRef_01_Device_0/TimeRef_01_Device_0_000001_20180523110738.txt
data/Test_Data/TimeRef_01_Device_0/TimeRef_01_Device_0_000002_20180523110753.txt
data/Test_Data/TimeRef_01_Device_0/TimeRef_01_Device_0_000003_20180523110809.txt
data/Test_Data/TimeRef_01_Device_0/TimeRef_01_Device_0_000004_20180523110823.txt
...
File lists can be passed to the MDP using the -list
option. E.g.
./Install/bin/DataProcessor -con Config.xml -list filelist.lst
The MDP will run over all the files given in filelist.lst
as if they were passed on the command line.
New versions of the MDP can be acquired via git. When pulling or fetching a new version of the processor, please ensure you do
git fetch --tags
to make your local tags up to date with the GitLab tags. The version tag is stored in the output root file to ensure replicability of results, and having an incorrect local tag destroys this feature.
In order to properly record the new tag, the MDP must be rebuilt from scratch. Please ensure you do
make clean
in the build directory, then follow the steps in the "Compiling the Processor" section from the call to cmake
onwards.
ROOT macros for quickly processing the MDP output can be found in the macros
directory. Each take the file to run over as input, and can be run on the output of both LowLevel
and Serial
mode.
E.g.
root 'macros/MakeChannelHisto.cxx("Output.root")' -b -q
Currently two macros are provided:
- MakeChannelHisto
Makes a histogram of the hits on each channel, separation out time reference channels according to the Std8x64Mapping
Channel Mapping.
The output will be called ChannelIDHistogram.pdf
.
An additional argument can be provided to set the y axis scale to be logarithmic. In order to do this, add a 1 after the input file. E.g.
root 'macros/MakeChannelHisto.cxx("Output.root",1)' -b -q
- MakeHitmap
Makes a hitmap of detected hits, assuming the reference channels are laid out according to the Std8x64Mapping
Channel Mapping.
The output will be called Hitmap.pdf
.
Like MakeChannelHisto
, additional optional arguments can be passed. The first extra argument will set the z axis to a logarithmic scale if set to 1
, and the second will exclude the time reference channels. E.g.
root 'macros/MakeHitmap.cxx("Output.root",1,1)' -b -q
will create a hitmap with a logarithmic z axis and no time references included.
To manually specify the output file name, pass the desired name as the second argument (i.e. after the input file name). The remaining optional arguments follow as previosuly detailed. E.g.
root 'macros/MakeHitmap.cxx("Output.root","CustomOutputName.pdf",1,1)' -b -q
This section gives a list of changes/features which are yet to be implemented, but are requested. The requester's initials should be put in brackets after the item.
- Refactor Edge Sorting to be easily modifiable (THH)
- Parallel Mode (THH)
This section gives a list of known bugs which require attention. The reporter's initials should be put in brackets after the item.
- If block/file is dumped, current WordBundle should be cleared (THH)