SLIC  6.1.1
Simulation for the Linear Collider (SLIC) - Geant4 simulation application
Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | List of all members
LcioFileNamer Class Reference

Automatically name LCIO output files according to input settings. More...

#include <LcioFileNamer.hh>

Inheritance diagram for LcioFileNamer:
Module

Public Member Functions

 LcioFileNamer ()
 
virtual ~LcioFileNamer ()
 
std::string makeFileName (std::vector< std::string > fields)
 
- Public Member Functions inherited from Module
virtual ~Module ()
 
virtual void beginEvent (const G4Event *)
 
virtual void beginRun (const G4Run *)
 
virtual void cleanup ()
 
bool deleteOnExit ()
 
virtual void endEvent (const G4Event *)
 
virtual void endRun (const G4Run *)
 
const std::string & getName () const
 
ModuleStatus getStatus () const
 
virtual void initialize ()
 
LogStream & log ()
 
virtual void postTracking (const G4Track *)
 
virtual void preTracking (const G4Track *)
 
virtual void reset ()
 
virtual void stepping (const G4Step *)
 

Private Member Functions

std::string getFieldValue (std::string field)
 
std::string makeDefaultFileName ()
 

Static Private Member Functions

static std::string getGeant4VersionString ()
 
static std::string makeEventName ()
 
static std::string makeEventNumberString ()
 
static std::string makeFileBasedName ()
 
static std::string makeGPSName ()
 
static std::string makeGunName ()
 
static std::string makeRunNumberString ()
 

Private Attributes

std::vector< std::string > m_defaultFields
 

Static Private Attributes

static std::string m_sep = "_"
 

Additional Inherited Members

- Public Types inherited from Module
enum  ModuleStatus { eOkay = 0 , eNotInitialized = 1 , eBadState = 2 , eFatalError = 3 }
 
- Public Attributes inherited from Module
bool m_deleteOnExit
 
LogStream * m_log
 
std::string m_name
 
ModuleStatus m_status
 
- Protected Member Functions inherited from Module
 Module (const std::string &name, bool deleteOnExit=true, bool autoRegister=true)
 

Detailed Description

Automatically name LCIO output files according to input settings.

Definition at line 20 of file LcioFileNamer.hh.

Constructor & Destructor Documentation

◆ LcioFileNamer()

Class constructor.

Definition at line 29 of file LcioFileNamer.cc.

References LcioFileNamer::m_defaultFields.

◆ ~LcioFileNamer()

~LcioFileNamer ( )
virtual

Definition at line 37 of file LcioFileNamer.cc.

Member Function Documentation

◆ getFieldValue()

std::string getFieldValue ( std::string  field)
private

◆ getGeant4VersionString()

static std::string getGeant4VersionString ( )
staticprivate

Create a string with the Geant4 version information.

Returns
The Geant4 version string.

◆ makeDefaultFileName()

std::string makeDefaultFileName ( )
private

Create the file name using the default set of fields.

Returns
The file name.

Definition at line 88 of file LcioFileNamer.cc.

References LcioFileNamer::m_defaultFields, and LcioFileNamer::makeFileName().

Referenced by LcioFileNamer::makeFileName().

◆ makeEventName()

std::string makeEventName ( )
staticprivate

◆ makeEventNumberString()

std::string makeEventNumberString ( )
staticprivate

Create a string from the number of events that were run using 'beamon'.

Returns
The number of events that were run.

Definition at line 153 of file LcioFileNamer.cc.

References Singleton< SlicApplication >::instance().

Referenced by LcioFileNamer::getFieldValue().

◆ makeFileBasedName()

std::string makeFileBasedName ( )
staticprivate

Create the file name based on a generator with an input file.

Returns
The file name.

Definition at line 109 of file LcioFileNamer.cc.

References FileUtil::basename(), Singleton< EventSourceManager >::instance(), and FileUtil::removeExtension().

Referenced by LcioFileNamer::makeEventName().

◆ makeFileName()

std::string makeFileName ( std::vector< std::string >  fields)

Create a file name based on a list of fields to include.

Parameters
[in]fieldsThe list of fields.
Returns
The file name.

Definition at line 70 of file LcioFileNamer.cc.

References LcioFileNamer::getFieldValue(), LcioFileNamer::m_sep, and LcioFileNamer::makeDefaultFileName().

Referenced by LcioManager::makeAutoname(), and LcioFileNamer::makeDefaultFileName().

◆ makeGPSName()

std::string makeGPSName ( )
staticprivate

Create the file name based on settings of the Geant4 GPS.

Returns
The file name.

Definition at line 118 of file LcioFileNamer.cc.

References Singleton< EventSourceManager >::instance(), and LcioFileNamer::m_sep.

Referenced by LcioFileNamer::makeEventName().

◆ makeGunName()

std::string makeGunName ( )
staticprivate

Create the file name based on settings of the Geant4 particle gun.

Returns
The file name.

Definition at line 134 of file LcioFileNamer.cc.

References Singleton< EventSourceManager >::instance(), and LcioFileNamer::m_sep.

Referenced by LcioFileNamer::makeEventName().

◆ makeRunNumberString()

std::string makeRunNumberString ( )
staticprivate

Create a string from the current run number information in the RunManager.

Returns
The run number string.

Definition at line 149 of file LcioFileNamer.cc.

Referenced by LcioFileNamer::getFieldValue().

Member Data Documentation

◆ m_defaultFields

std::vector<std::string> m_defaultFields
private

◆ m_sep

std::string m_sep = "_"
staticprivate

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