wrapper around G4VAnalysisReader instances with special handling for LH5 files. More...
#include <RMGAnalysisReader.hh>
Classes | |
| class | Access |
| thread-safe access handle to the underlying reader. This handle can be used to set-up ntuple reading (in setup mode) or to read rows from the ntuple. More... | |
Public Member Functions | |
| RMGAnalysisReader (RMGAnalysisReader const &)=delete | |
| RMGAnalysisReader & | operator= (RMGAnalysisReader const &)=delete |
| RMGAnalysisReader (RMGAnalysisReader &&)=delete | |
| RMGAnalysisReader & | operator= (RMGAnalysisReader &&)=delete |
| Access | OpenFile (const std::string &file_name, std::string ntuple_dir_name, std::string ntuple_name, G4AutoLock lock, std::string force_ext="") |
| open an input file for reading of one specific ntuple. The return access handle can be used to connect to-be-read column to variables. | |
| Access | OpenFile (const std::string &file_name, std::string ntuple_dir_name, std::string ntuple_name, std::string force_ext="") |
| void | CloseFile () |
| if any file is open for reading, close the reader. Also clean-up temporary files. | |
| Access | GetLockedReader () const |
| get an access handle to the current underlying G4VAnalysisReader. | |
| G4AutoLock | GetLock () const |
| acquires a global lock to the analysis reader mutex. | |
| auto & | GetFileName () const |
| get the file name of the current open file, or an empty string. | |
wrapper around G4VAnalysisReader instances with special handling for LH5 files.
notes for threadsafe use:
| void RMGAnalysisReader::CloseFile | ( | ) |
if any file is open for reading, close the reader. Also clean-up temporary files.
This function can only be used on the master thread. This operation acquires a global across all readers. This function will not actually free resources allocated for the reader by Geant4.
|
nodiscard |
get an access handle to the current underlying G4VAnalysisReader.
The return access handle can be used to read row(s) from the ntuple. This function acquires a global across all readers that will be held until the access handle is discarded.
|
nodiscard |
open an input file for reading of one specific ntuple. The return access handle can be used to connect to-be-read column to variables.
This function can only be used on the master thread. This operation acquires a global lock across all readers that will be held until the access handle is discarded.
| file_name | the input file name. the file format is determined from the file extension. |
| ntuple_dir_name | the first part of the input table name. For the table addressed by "dir/table" this is "dir". |
| ntuple_name | the first part of the input table name. For the table addressed by "dir/table" this is "table". |
| lock | a lock instance obtained by RMGAnalysisReader::GetLock - optional. |
| force_ext | force a file extension/reader type. should be a lowercase file extension like lh5, hdf5, csv, root. |
|
nodiscard |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.