fire v0.19.0
Framework for sImulation and Reconstruction of Events
fire::RunHeader Class Reference

Container for run parameters. More...

#include <RunHeader.h>

Collaboration diagram for fire::RunHeader:
[legend]

Public Member Functions

int getRunNumber () const
 
const std::stringgetDetectorName () const
 
void setDetectorName (const std::string &det)
 Set the name of the detector that was used in this run.
 
const std::stringgetSoftwareTag () const
 
const std::stringgetDescription () const
 
void setDescription (const std::string &des)
 Set the description of this run.
 
int getRunStart () const
 Get the start time of the run in seconds since epoch. More...
 
void runStart (const int run)
 Start the run. More...
 
int getRunEnd () const
 Get the end time of the run in seconds since epoch. More...
 
void runEnd ()
 Set the end time of the run in seconds since epoch.
 
template<typename ParameterType >
const ParameterType & get (const std::string &name) const
 Get a run parameter. More...
 
template<typename ParameterType >
void set (const std::string &name, const ParameterType &val)
 Set a run parameter. More...
 
void stream (std::ostream &s) const
 Stream this object into the input ostream. More...
 
void Print () const
 Print a string desciption of this object.
 
void clear ()
 clear the run header
 

Static Public Attributes

static const std::string NAME = fire::io::constants::RUN_HEADER_NAME
 the name of the data holding the run headers
 

Private Member Functions

template<typename DataSet >
void attach (DataSet &d)
 Attach to our fire::io::Data. More...
 

Private Attributes

int runNumber_ {0}
 Run number.
 
std::string detectorName_ {""}
 Detector name.
 
std::string description_ {""}
 Run description.
 
long int runStart_ {0}
 Run start in seconds since epoch.
 
long int runEnd_ {0}
 Run end in seconds since epoch.
 
std::string softwareTag_ {fire::version::GIT_SHA1}
 git SHA-1 hash associated with the software tag used to generate this file.
 
fire::io::ParameterStorage parameters_
 run parameteres
 

Friends

class fire::io::access
 friends with the h5::Data that can read/write us
 
std::ostreamoperator<< (std::ostream &s, const RunHeader &h)
 Stream this object to an output stream. More...
 

Detailed Description

Container for run parameters.

There are several parameters that we hold for all runs and then we also hold a more dynamic ParameterStorage object for holding parameters that users wish to add within Processor::beforeNewRun.

Member Function Documentation

◆ attach()

template<typename DataSet >
void fire::RunHeader::attach ( DataSet &  d)
inlineprivate

Attach to our fire::io::Data.

We attach all of our parameters.

Parameters
[in]dfire::io::Data to attach to

◆ get()

template<typename ParameterType >
const ParameterType & fire::RunHeader::get ( const std::string name) const
inline

Get a run parameter.

Template Parameters
ParameterTypetype of parameter to retrieve
Parameters
[in]namename of parameter to retrieve
Returns
value of parameter for this run

◆ getDescription()

const std::string & fire::RunHeader::getDescription ( ) const
inline
Returns
A short description of the run.

◆ getDetectorName()

const std::string & fire::RunHeader::getDetectorName ( ) const
inline
Returns
The name of the detector used to create the events.

◆ getRunEnd()

int fire::RunHeader::getRunEnd ( ) const
inline

Get the end time of the run in seconds since epoch.

Returns
The end time of the run.

◆ getRunNumber()

int fire::RunHeader::getRunNumber ( ) const
inline
Returns
The run number.

◆ getRunStart()

int fire::RunHeader::getRunStart ( ) const
inline

Get the start time of the run in seconds since epoch.

Returns
The start time of the run.

◆ getSoftwareTag()

const std::string & fire::RunHeader::getSoftwareTag ( ) const
inline
Returns
The git SHA-1 associated with the software tag used to generate this file.

◆ runStart()

void fire::RunHeader::runStart ( const int  run)
inline

Start the run.

Provide the run number and record the timestamp.

Parameters
[in]runthe run number

◆ set()

template<typename ParameterType >
void fire::RunHeader::set ( const std::string name,
const ParameterType &  val 
)
inline

Set a run parameter.

Template Parameters
ParameterTypetype of parameter to set
Parameters
[in]namename of parameter to set
[in]valvalue of parameter to set for this run

◆ stream()

void fire::RunHeader::stream ( std::ostream s) const

Stream this object into the input ostream.

Includes new-line characters to separate out the different parameter maps

Parameters
[in]sostream to write to

Friends And Related Function Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream s,
const RunHeader h 
)
friend

Stream this object to an output stream.

Needs to be here and labeled as friend for it to be compatible with Boost logging.

See also
RunHeader::stream
Parameters
[in]sostream to write to
[in]hRunHeader to write out
Returns
modified ostream

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