MarlinMT  0.1.0
marlinmt::RunHeader Class Reference

RunHeader class. More...

#include <RunHeader.h>

Public Member Functions

 RunHeader ()=default
 
 ~RunHeader ()=default
 
 RunHeader (const RunHeader &)=delete
 
RunHeaderoperator= (const RunHeader &)=delete
 
 RunHeader (RunHeader &&)=default
 
RunHeaderoperator= (RunHeader &&)=default
 
int runNumber () const
 Get the run number. More...
 
RunHeadersetRunNumber (int n)
 Set the run number. More...
 
const std::string & description () const
 Get the run description. More...
 
RunHeadersetDescription (const std::string &desc)
 Set the run description. More...
 
const std::string & detectorName () const
 Get the detector name. More...
 
RunHeadersetDetectorName (const std::string &det)
 Set the detector name. More...
 
const ParameterMapparameters () const
 Get the run parameters. More...
 
ParameterMapparameters ()
 Get the run parameters. More...
 
template<typename T >
std::optional< T > parameter (const std::string &name) const
 Get a parameter by name. More...
 
template<typename T >
RunHeadersetParameter (const std::string &name, const T &value)
 Set a run parameter. More...
 
Extensionsextensions ()
 Get the run extensions. More...
 
const Extensionsextensions () const
 Get the run extensions. More...
 

Private Types

using ParameterMap = std::map< std::string, std::string >
 

Private Attributes

int _runNumber {0}
 The run number. More...
 
std::string _detectorName {}
 The detector name. More...
 
std::string _description {}
 The run description. More...
 
ParameterMap _parameters {}
 The run parameters map. More...
 
Extensions _extensions {}
 The run extensions. More...
 

Detailed Description

RunHeader class.

Provide a simple interface describing a run. The basic metadata are run number, detector name and description and can be extended with more parameters. The parameters are real properties of a run whereas the extensions can also be attached to a run object but are only valid at runtime.

Definition at line 22 of file RunHeader.h.

Member Typedef Documentation

◆ ParameterMap

using marlinmt::RunHeader::ParameterMap = std::map<std::string, std::string>
private

Definition at line 23 of file RunHeader.h.

Constructor & Destructor Documentation

◆ RunHeader() [1/3]

marlinmt::RunHeader::RunHeader ( )
default

◆ ~RunHeader()

marlinmt::RunHeader::~RunHeader ( )
default

◆ RunHeader() [2/3]

marlinmt::RunHeader::RunHeader ( const RunHeader )
delete

◆ RunHeader() [3/3]

marlinmt::RunHeader::RunHeader ( RunHeader &&  )
default

Member Function Documentation

◆ description()

const std::string & marlinmt::RunHeader::description ( ) const
inline

Get the run description.

Definition at line 136 of file RunHeader.h.

References _description.

Referenced by marlinmt::LCIOOutputProcessor::processRunHeader().

◆ detectorName()

const std::string & marlinmt::RunHeader::detectorName ( ) const
inline

Get the detector name.

Definition at line 149 of file RunHeader.h.

References _detectorName.

Referenced by marlinmt::LCIOOutputProcessor::processRunHeader().

◆ extensions() [1/2]

Extensions & marlinmt::RunHeader::extensions ( )
inline

Get the run extensions.

Definition at line 193 of file RunHeader.h.

References _extensions.

◆ extensions() [2/2]

const Extensions & marlinmt::RunHeader::extensions ( ) const
inline

Get the run extensions.

Definition at line 199 of file RunHeader.h.

References _extensions.

◆ operator=() [1/2]

RunHeader& marlinmt::RunHeader::operator= ( const RunHeader )
delete

◆ operator=() [2/2]

RunHeader& marlinmt::RunHeader::operator= ( RunHeader &&  )
default

◆ parameter()

template<typename T >
std::optional< T > marlinmt::RunHeader::parameter ( const std::string &  name) const
inline

Get a parameter by name.

Parameters
namethe parameter name

Definition at line 175 of file RunHeader.h.

References _parameters, and marlinmt::details::convert< T >::from_string().

Referenced by marlinmt::LCIOOutputProcessor::processRunHeader().

◆ parameters() [1/2]

const RunHeader::ParameterMap & marlinmt::RunHeader::parameters ( ) const
inline

Get the run parameters.

Definition at line 162 of file RunHeader.h.

References _parameters.

Referenced by marlinmt::LCIOOutputProcessor::processRunHeader().

◆ parameters() [2/2]

RunHeader::ParameterMap & marlinmt::RunHeader::parameters ( )
inline

Get the run parameters.

Definition at line 168 of file RunHeader.h.

References _parameters.

◆ runNumber()

int marlinmt::RunHeader::runNumber ( ) const
inline

Get the run number.

Definition at line 123 of file RunHeader.h.

References _runNumber.

Referenced by marlinmt::TestProcessor::processRunHeader(), and marlinmt::LCIOOutputProcessor::processRunHeader().

◆ setDescription()

RunHeader & marlinmt::RunHeader::setDescription ( const std::string &  desc)
inline

Set the run description.

Parameters
descthe run description

Definition at line 142 of file RunHeader.h.

References _description.

◆ setDetectorName()

RunHeader & marlinmt::RunHeader::setDetectorName ( const std::string &  det)
inline

Set the detector name.

Parameters
detthe detector name

Definition at line 155 of file RunHeader.h.

References _detectorName.

◆ setParameter()

template<typename T >
RunHeader & marlinmt::RunHeader::setParameter ( const std::string &  name,
const T &  value 
)
inline

Set a run parameter.

Parameters
namethe parameter name
valuethe parameter value
Returns
*this

Definition at line 186 of file RunHeader.h.

References _parameters, and marlinmt::details::convert< T >::to_string().

◆ setRunNumber()

RunHeader & marlinmt::RunHeader::setRunNumber ( int  n)
inline

Set the run number.

Parameters
nthe run number

Definition at line 129 of file RunHeader.h.

References _runNumber.

Member Data Documentation

◆ _description

std::string marlinmt::RunHeader::_description {}
private

The run description.

Definition at line 113 of file RunHeader.h.

Referenced by description(), and setDescription().

◆ _detectorName

std::string marlinmt::RunHeader::_detectorName {}
private

The detector name.

Definition at line 111 of file RunHeader.h.

Referenced by detectorName(), and setDetectorName().

◆ _extensions

Extensions marlinmt::RunHeader::_extensions {}
private

The run extensions.

Definition at line 117 of file RunHeader.h.

Referenced by extensions().

◆ _parameters

ParameterMap marlinmt::RunHeader::_parameters {}
private

The run parameters map.

Definition at line 115 of file RunHeader.h.

Referenced by parameter(), parameters(), and setParameter().

◆ _runNumber

int marlinmt::RunHeader::_runNumber {0}
private

The run number.

Definition at line 109 of file RunHeader.h.

Referenced by runNumber(), and setRunNumber().


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