This project reconstructs T5 detector hits from WCTE input ROOT files and writes a simplified per-event ROOT tree for downstream analysis.
The code is built against ROOT 6 (the Makefile uses root-config).
Typical setup:
- ROOT 6.x
- C++ compiler with C++17 support
- GNU Make
From the project root:
makeThis produces the executable analyze_T5.
The current executable accepts the following command-line options:
./analyze_T5 -r <run_number> -i <input_file.root> [-o <output_dir>] [-d]Options:
-r <run_number>: required run number used for the analysis metadata.-i <input_file.root>: input ROOT file to analyze. You can pass this option multiple times.-o <output_dir>: output directory prefix used to write one reconstructed file per input file.-d: enable debug mode (currently limits the event loop to the first 5000 entries).
Example:
./analyze_T5 -r 1361 -i /path/to/run_1361.root -o output/The program recognizes the following input trees:
ProcessedWaveformsWCTEReadoutWindows
If neither tree is found, the program stops with an error.
For each input file, the analysis:
- Opens the input ROOT file.
- Detects the appropriate TTree.
- Reconstructs T5 hits using the T5 SiPM timing information.
- Writes a new ROOT file containing a simplified event tree.
The output ROOT file contains one tree named T5_Events with the following branches:
| Branch name | Type | Description |
|---|---|---|
event_nr |
Int_t |
Event number from the input tree |
T5_hit_bitmask |
Int_t |
A bitmask |
T5_n_main_bunch_particles |
Int_t |
Number of reconstructed main-bunch hits written for this event |
T5_main_hit_time |
Double_t |
Time of the primary reconstructed hit |
T5_main_hit_charge |
Double_t |
Charge of the primary reconstructed hit |
T5_main_hit_pos_x |
Double_t |
Reconstructed x position of the primary hit [mm] |
T5_main_hit_pos_y |
Double_t |
Reconstructed y position of the primary hit [mm] |
T5_main_hit_pos_x_error |
Double_t |
Uncertainty of the reconstructed x position of the primary hit [mm] |
T5_main_hit_pos_y_error |
Double_t |
Uncertainty of the reconstructed y position of the primary hit [mm] |
T5_all_hits_pos_x |
vector<double> |
x positions of all reconstructed hits in an event |
T5_all_hits_pos_y |
vector<double> |
y positions of all reconstructed hits in an event |
T5_all_hits_pos_x_error |
vector<double> |
x positions of all reconstructed hits in an event |
T5_all_hits_pos_y_error |
vector<double> |
y positions of all reconstructed hits in an event |
T5_all_hits_time |
vector<double> |
Times of all reconstructed hits in an event |
T5_all_hits_charge |
vector<double> |
Charges of all reconstructed hits in an event (sum of individual SiPM charges) |
The output file has a T5 hit bitmask variable, that describes the error states that occured in the event. It can have the following values:
0-- The event is clean, has one main hit reconstructed in the T5 detector bounds (or is within uncertainty), there are no additional hits in the main bunch of particles1-- The event is empty -- there was no hit in the main bunch of particles2-- The event has multiple hits in the main time window -- a 'main' hit cannot be reliably chosen4-- The event had a single hit in the main time window, but it was not successfully reconstructed within T5 bounds -- could indicate an SiPM time measurement error, or just an invalid hit.
- The program currently writes one output file per input file, using the input file basename with
_T5.rootappended. - The output directory path passed to
-ois used as the base location for those generated files. - The reconstruction logic is implemented mainly in
return_TOF_position.cppand uses the detector geometry constants defined inreturn_TOF_position.h.