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

Manages output operations including ntuple registration and persistent storage. More...

#include <RMGOutputManager.hh>

Public Member Functions

 RMGOutputManager (RMGOutputManager const &)=delete
 
RMGOutputManageroperator= (RMGOutputManager const &)=delete
 
 RMGOutputManager (RMGOutputManager &&)=delete
 
RMGOutputManageroperator= (RMGOutputManager &&)=delete
 
bool IsPersistencyEnabled () const
 Checks if persistency is enabled.
 
const std::string & GetOutputFileName ()
 Retrieves the output file name.
 
bool HasOutputFileNameNone () const
 Checks if the output file name is set to "none".
 
bool HasOutputFileName () const
 Checks if a valid output file name is set.
 
bool GetOutputOverwriteFiles () const
 Indicates whether output files should be overwritten.
 
const std::string & GetOutputNtupleDirectory ()
 Gets the directory name for output ntuples.
 
bool GetOutputNtuplePerDetector () const
 Checks if output ntuples are generated per detector.
 
bool GetOutputNtupleUseVolumeName () const
 Checks if volume names are used for output ntuple naming.
 
const std::map< int, std::pair< int, std::string > > & GetNtupleIDs ()
 Retrieves the set of registered ntuple detector identifiers.
 
std::set< std::string > GetAuxNtupleNames ()
 Retrieves the set of registered auxiliary ntuple identifiers.
 
void EnablePersistency (bool flag=true)
 Enables or disables output persistency.
 
void SetOutputFileName (std::string filename)
 Sets the output file name.
 
void SetOutputOverwriteFiles (bool overwrite)
 Configures whether output files should be overwritten.
 
void SetOutputNtupleDirectory (std::string dir)
 Sets the directory for output ntuples.
 
int RegisterNtuple (int det_uid, int ntuple_id, std::string table_name)
 Registers an alreaday created ntuple for a given detector.
 
int CreateAndRegisterNtuple (int det_uid, std::string table_name, std::string oscheme, G4AnalysisManager *ana_man)
 Creates and registers a ntuple for a given detector.
 
int CreateAndRegisterAuxNtuple (std::string table_name, std::string oscheme, G4AnalysisManager *ana_man)
 Creates and registers an auxiliary ntuple.
 
int GetNtupleID (int det_uid)
 Gets the ntuple identifier for a given detector.
 
int GetAuxNtupleID (std::string det_uid)
 Gets the auxiliary ntuple identifier for a given key.
 
void ActivateOptionalOutputScheme (std::string name)
 Activates an optional output scheme.
 

Static Public Member Functions

static RMGOutputManagerInstance ()
 Gets the singleton instance of RMGOutputManager.
 

Detailed Description

Manages output operations including ntuple registration and persistent storage.

This singleton class provides methods for configuring output options, registering ntuples, and handling file persistency for analysis purposes.

Member Function Documentation

◆ ActivateOptionalOutputScheme()

void RMGOutputManager::ActivateOptionalOutputScheme ( std::string name)

Activates an optional output scheme.

Parameters
nameName of the output scheme to activate.

◆ CreateAndRegisterAuxNtuple()

int RMGOutputManager::CreateAndRegisterAuxNtuple ( std::string table_name,
std::string oscheme,
G4AnalysisManager * ana_man )

Creates and registers an auxiliary ntuple.

An auxiliary ntuple stores information not strictly related to stepping data. An IPC message keyed as "output_ntuple_aux" is automatically sent to communicate the output scheme name and the output table name.

Parameters
table_nameName of the output table.
oschemeType name of the output scheme registering this ntuple.
ana_manPointer to the analysis manager.
Returns
The created auxiliary ntuple identifier.

◆ CreateAndRegisterNtuple()

int RMGOutputManager::CreateAndRegisterNtuple ( int det_uid,
std::string table_name,
std::string oscheme,
G4AnalysisManager * ana_man )

Creates and registers a ntuple for a given detector.

An ordinary ntuple that stores information related to stepping data. An IPC message keyed as "output_ntuple" is automatically sent to communicate the output scheme name and the output table name.

Parameters
det_uidUnique identifier for the detector.
table_nameName of the table.
oschemeType name of the output scheme registering this ntuple.
ana_manPointer to the analysis manager.
Returns
The created ntuple identifier.

◆ EnablePersistency()

void RMGOutputManager::EnablePersistency ( bool flag = true)
inline

Enables or disables output persistency.

Parameters
flagSet to true to enable, false to disable.

◆ GetAuxNtupleID()

int RMGOutputManager::GetAuxNtupleID ( std::string det_uid)
inline

Gets the auxiliary ntuple identifier for a given key.

Parameters
det_uidKey for the auxiliary ntuple.
Returns
The auxiliary ntuple identifier.

◆ GetAuxNtupleNames()

std::set< std::string > RMGOutputManager::GetAuxNtupleNames ( )
inline

Retrieves the set of registered auxiliary ntuple identifiers.

Returns
Set of auxiliary ntuple names.

◆ GetNtupleID()

int RMGOutputManager::GetNtupleID ( int det_uid)
inline

Gets the ntuple identifier for a given detector.

Parameters
det_uidUnique identifier for the detector.
Returns
The ntuple identifier.

◆ GetNtupleIDs()

const std::map< int, std::pair< int, std::string > > & RMGOutputManager::GetNtupleIDs ( )
inline

Retrieves the set of registered ntuple detector identifiers.

Returns
Set of detector identifiers.

◆ GetOutputFileName()

const std::string & RMGOutputManager::GetOutputFileName ( )
inline

Retrieves the output file name.

Returns
Reference to the output file name string.

◆ GetOutputNtupleDirectory()

const std::string & RMGOutputManager::GetOutputNtupleDirectory ( )
inline

Gets the directory name for output ntuples.

Returns
Reference to the ntuple directory name.

◆ GetOutputNtuplePerDetector()

bool RMGOutputManager::GetOutputNtuplePerDetector ( ) const
inlinenodiscard

Checks if output ntuples are generated per detector.

Returns
true if ntuples are generated per detector.

◆ GetOutputNtupleUseVolumeName()

bool RMGOutputManager::GetOutputNtupleUseVolumeName ( ) const
inlinenodiscard

Checks if volume names are used for output ntuple naming.

Returns
true if volume names are used.

◆ GetOutputOverwriteFiles()

bool RMGOutputManager::GetOutputOverwriteFiles ( ) const
inlinenodiscard

Indicates whether output files should be overwritten.

Returns
true if overwriting is enabled.

◆ HasOutputFileName()

bool RMGOutputManager::HasOutputFileName ( ) const
inlinenodiscard

Checks if a valid output file name is set.

Returns
true if output file name is non-empty and not "none".

◆ HasOutputFileNameNone()

bool RMGOutputManager::HasOutputFileNameNone ( ) const
inlinenodiscard

Checks if the output file name is set to "none".

Returns
true if output file name equals "none".

◆ Instance()

static RMGOutputManager * RMGOutputManager::Instance ( )
inlinestatic

Gets the singleton instance of RMGOutputManager.

Creates a new instance if none exists.

Returns
Pointer to the RMGOutputManager instance.

◆ IsPersistencyEnabled()

bool RMGOutputManager::IsPersistencyEnabled ( ) const
inlinenodiscard

Checks if persistency is enabled.

Returns
true if output persistency is enabled.

◆ RegisterNtuple()

int RMGOutputManager::RegisterNtuple ( int det_uid,
int ntuple_id,
std::string table_name )

Registers an alreaday created ntuple for a given detector.

Parameters
det_uidUnique identifier for the detector.
ntuple_idIdentifier for the ntuple.
table_namename of the the ntuple on disk.
Returns
The registered ntuple identifier.

◆ SetOutputFileName()

void RMGOutputManager::SetOutputFileName ( std::string filename)
inline

Sets the output file name.

Parameters
filenameThe name of the output file.

◆ SetOutputNtupleDirectory()

void RMGOutputManager::SetOutputNtupleDirectory ( std::string dir)
inline

Sets the directory for output ntuples.

this might not be used by all output file formats.

Parameters
dirThe directory name for ntuple output.

◆ SetOutputOverwriteFiles()

void RMGOutputManager::SetOutputOverwriteFiles ( bool overwrite)
inline

Configures whether output files should be overwritten.

Parameters
overwriteTrue to enable overwriting, false otherwise.

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