|
Analysis-Utilities 26.9.9
C++/ROOT utilities for nuclear measurement data analysis
|
Environment setup and binary-to-ROOT file conversion. More...
#include <InitUtils.hpp>
Static Public Member Functions | |
| static void | SetROOTPreferences (PlotSaveFormat save_format=PlotSaveFormat::kPNG, const TString &plots_dir="", const TString &root_files_dir="", Bool_t enable_mt=kTRUE) |
| Configure the ROOT environment and pin all output paths. | |
| static Bool_t | ConvertWavedumpBinToROOT (const TString input_filename, const TString output_name, Bool_t corrections_enabled=kTRUE) |
| Convert a WaveDump binary file (DT5742 family) to a ROOT tree. | |
| static UShort_t | ConvertCoMPASSBinToROOT (const TString input_filename, const TString output_name, UShort_t global_header_override, Bool_t skip_bad_events=kFALSE) |
| Convert a CoMPASS binary file to a ROOT tree. | |
| static std::pair< std::vector< RawHit >, UShort_t > | ConvertCoMPASSBinToHits (const TString input_filename, UShort_t global_header_override=0, Bool_t skip_bad_events=kFALSE) |
| Read a CoMPASS binary file into memory, with no ROOT file I/O. | |
| static Bool_t | ConvertSOLBinToROOT (const TString input_filename, const TString output_name) |
| Convert a SOLARIS DAQ (SOL) binary file to a ROOT tree. | |
| static std::pair< std::vector< SOLHit >, Long64_t > | ConvertSOLBinToHits (const TString input_filename) |
| Read a SOL binary file into memory as lightweight hits. | |
Environment setup and binary-to-ROOT file conversion.
All-static. SetROOTPreferences() is the recommended single entry point for configuring the ROOT environment at the top of an analysis; the remaining methods convert acquisition-software binary files into ROOT trees or in-memory hit vectors.
Definition at line 23 of file InitUtils.hpp.
|
static |
Read a CoMPASS binary file into memory, with no ROOT file I/O.
The in-memory counterpart of ConvertCoMPASSBinToROOT(), for callers that want the hits directly rather than a tree on disk.
| input_filename | Path to the CoMPASS binary file. |
| global_header_override | Header word to assume instead of reading one from the file; 0 (the default) reads it from the file. |
| skip_bad_events | When kTRUE, records that fail validation are skipped rather than aborting. |
Definition at line 641 of file InitUtils.cpp.
|
static |
Convert a CoMPASS binary file to a ROOT tree.
Which branches are written is dictated by the file's global header, whose low bits flag the fields present in each record: 0x0001 energy (channel units), 0x0002 calibrated energy, 0x0004 short-gate energy, 0x0008 waveform samples.
| input_filename | Path to the CoMPASS binary file. |
| output_name | Output basename, without extension. Written to <root_files_base>/<output_name>.root; the base directory is created if missing. |
| global_header_override | Header word to assume instead of reading one from the file. Pass 0 to read it from the file, which is the normal case. Use a non-zero value only for files whose two-byte header is absent or wrong — passing one also suppresses the two-byte header skip. |
| skip_bad_events | When kTRUE, records that fail validation are skipped instead of aborting the conversion. kFALSE by default. |
Definition at line 362 of file InitUtils.cpp.
|
static |
Read a SOL binary file into memory as lightweight hits.
Traces are skipped entirely — each block is reduced to its header fields — which makes this cheap enough to run over a whole run when only timing and energy are needed.
| input_filename | Path to the SOL binary file. |
Definition at line 1125 of file InitUtils.cpp.
|
static |
Convert a SOLARIS DAQ (SOL) binary file to a ROOT tree.
Writes a Data_R tree carrying every per-block header field, plus TArrayI / TArrayC trace branches for the block formats that include traces.
| input_filename | Path to the SOL binary file. |
| output_name | Output basename, without extension. Written to <root_files_base>/<output_name>.root. |
Definition at line 886 of file InitUtils.cpp.
|
static |
Convert a WaveDump binary file (DT5742 family) to a ROOT tree.
| input_filename | Path to the WaveDump binary file. |
| output_name | Output basename, without extension. The file is written to <root_files_base>/<output_name>.root. |
| corrections_enabled | When kTRUE (the default), applies the DT5742 timing corrections during conversion. |
Definition at line 798 of file InitUtils.cpp.
|
static |
Configure the ROOT environment and pin all output paths.
Applies the house plotting style, forces it over any style carried by objects read from file, and puts ROOT in batch mode so plots do not pop up. Sets the plot output base via PlottingUtils::SetPlotsBaseDir() and the ROOT file I/O base via IO::SetRootFilesBaseDir().
| save_format | Figure output format. PlotSaveFormat::kPNG by default. |
| plots_dir | Base directory for saved figures. Pass an absolute path so output is anchored to a project root regardless of the current working directory. If empty, a warning is printed and the CWD-relative "plots" is used. |
| root_files_dir | Base directory for ROOT file I/O. Same absolute-path advice; if empty, a warning is printed and the CWD-relative "root_files" is used. |
| enable_mt | When kTRUE (the default), enables ROOT thread safety via IO::SetThreadSafe() and detaches new histograms from gDirectory with TH1::AddDirectory(kFALSE), so concurrent TFile opens on other threads cannot race on a directory's child list. Required for the parallel file processing in WaveformProcessingUtils. |
enable_mt — histogram directory ownership. Call it once, early.enable_mt on, histograms are no longer owned by the current TFile. Anything you want written to disk must be Write()-ten explicitly, and every histogram you create becomes your responsibility to delete. Definition at line 318 of file InitUtils.cpp.