remage
Simulation framework for HPGe-based experiments
 
Loading...
Searching...
No Matches
RMGConvertLH5 Class Reference

Converter class for converting between HDF5 and LH5 file formats. More...

#include <RMGConvertLH5.hh>

Static Public Member Functions

static bool ConvertToLH5 (std::string, std::string, std::set< std::string >, const std::map< int, std::pair< int, std::string > > &, bool, bool part_of_batch=false, int n_ev=-1)
 Convert a Geant4 HDF5 output file to LH5 format.
 
static bool ConvertFromLH5 (std::string, std::string, bool, bool part_of_batch, std::map< std::string, std::map< std::string, std::string > > &)
 Convert an LH5 input file to HDF5 format.
 

Static Public Attributes

static bool fIsStandalone = false
 

Detailed Description

Converter class for converting between HDF5 and LH5 file formats.

This class provides methods to convert Geant4 HDF5 output files into the LH5 format and also to convert LH5 input files back to HDF5. It supports conversion of ntuple data.

Member Function Documentation

◆ ConvertFromLH5()

bool RMGConvertLH5::ConvertFromLH5 ( std::string lh5_file_name,
std::string ntuple_group_name,
bool dry_run,
bool part_of_batch,
std::map< std::string, std::map< std::string, std::string > > & units_map )
static

Convert an LH5 input file to HDF5 format.

This function converts the specified LH5 file to HDF5 format suitable for reading by Geant4, reformatting ntuple tables into ntuple datasets.

Parameters
lh5_file_nameThe input LH5 file name.
ntuple_group_nameThe name of the ntuple group in the LH5 file.
dry_runIf true, the conversion is performed in-memory without writing to disk.
part_of_batchIndicates if this conversion is part of a batch operation.
units_mapOutput parameter: a mapping from ntuple names to their unit dictionaries.
Returns
True if the conversion is successful, false otherwise.

◆ ConvertToLH5()

bool RMGConvertLH5::ConvertToLH5 ( std::string hdf5_file_name,
std::string ntuple_group_name,
std::set< std::string > aux_ntuples,
const std::map< int, std::pair< int, std::string > > & ntuple_meta,
bool dry_run,
bool part_of_batch = false,
int n_ev = -1 )
static

Convert a Geant4 HDF5 output file to LH5 format.

This function converts the specified HDF5 file to the LH5 format, reformatting the ntuple data into table format.

Parameters
hdf5_file_nameThe input HDF5 file name.
ntuple_group_nameThe name of the ntuple group in the HDF5 file.
aux_ntuplesA set of auxiliary ntuple names.
ntuple_metaA mapping of detector uids to a pair of ntuple id and ntuple name.
dry_runIf true, the conversion is performed in-memory without writing to disk.
part_of_batchIndicates if this conversion is part of a batch operation.
n_evnumber of events to write as an additional attribute into the file.
Returns
True if the conversion is successful, false otherwise.

The documentation for this class was generated from the following files: