LDMX Software
|
Run-specific configuration and data stored in its own output TTree alongside the event TTree in the output file. More...
#include <RunHeader.h>
Public Member Functions | |
RunHeader (int runNumber) | |
Constructor. | |
RunHeader ()=default | |
Default constructor. | |
virtual | ~RunHeader () |
Destructor. | |
int | getRunNumber () const |
const std::string & | getDetectorName () const |
void | setDetectorName (const std::string &det) |
Set the name of the detector that was used in this run. | |
const std::string & | getSoftwareTag () const |
const std::string & | getDescription () 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. | |
void | setRunStart (const int runStart) |
Set the run start time in seconds since epoch. | |
int | getRunEnd () const |
Get the end time of the run in seconds since epoch. | |
void | setRunEnd (const int runEnd) |
Set the end time of the run in seconds since epoch. | |
int | getNumTries () const |
Get the total number of tries that were done during the production of this run. | |
void | setNumTries (const int numTries) |
Set the total number of tries that were done during the production of this run. | |
int | getIntParameter (const std::string &name) const |
Get an int parameter value. | |
const std::map< std::string, int > & | getIntParameters () const |
Get a const reference to all int parameters. | |
void | setIntParameter (const std::string &name, int value) |
Set an int parameter value. | |
float | getFloatParameter (const std::string &name) const |
Get a float parameter value. | |
const std::map< std::string, float > & | getFloatParameters () const |
Get a const reference to all float parameters. | |
void | setFloatParameter (const std::string &name, float value) |
Set a float parameter value. | |
std::string | getStringParameter (const std::string &name) const |
Get a string parameter value. | |
const std::map< std::string, std::string > & | getStringParameters () const |
Get a const reference to all string parameters. | |
void | setStringParameter (const std::string &name, std::string value) |
Set a string parameter value. | |
void | stream (std::ostream &s) const |
Stream this object into the input ostream. | |
void | Print () const |
Print a string desciption of this object. | |
Private Member Functions | |
ClassDef (RunHeader, 4) | |
Private Attributes | |
int | runNumber_ {0} |
Run number. | |
std::string | detectorName_ {""} |
Detector name. | |
std::string | description_ {""} |
Run description. | |
int | runStart_ {0} |
Run start in seconds since epoch. | |
int | runEnd_ {0} |
Run end in seconds since epoch. | |
int | numTries_ {0} |
Total number of events that were begun during the production of this run. | |
std::string | softwareTag_ {GIT_SHA1} |
git SHA-1 hash associated with the software tag used to generate this file. | |
std::map< std::string, int > | intParameters_ |
Map of int parameters. | |
std::map< std::string, float > | floatParameters_ |
Map of float parameters. | |
std::map< std::string, std::string > | stringParameters_ |
Map of string parameters. | |
Friends | |
std::ostream & | operator<< (std::ostream &s, const ldmx::RunHeader &h) |
Stream this object to an output stream. | |
Run-specific configuration and data stored in its own output TTree alongside the event TTree in the output file.
Similar to the EventHeader, the evolution of this object has been pretty slow since the *Parameter*
members have been used to hold most of the additional information (for example, a lot of the simulation configuration information). The versions of the RunHeader as defined by ROOT's serialization infrastructure are documented here.
An initial beta version now lost to the sands of time.
There are no material (serialized data) changes that are different between v2 and v3, but this version was increased because we moved the Framework repo (and thus the RunHeader source) from being within ldmx-sw to its own stand-alone repo. With an abundance of caution (and lack of understanding of what ROOT's dictionary cares about), we increased the version number.
Add the numTries_ member variable in order to store exactly how many events were started during the production of the run.
When reading a file written with v3 RunHeader using software with v4 RunHeader, the numTries_ member will keep its default value of 0. This is a nice signal value since it conveys to the user the lack of information. If the user somehow gets into the situation of reading a v4 RunHeader with v3 software, the numTries_ member is quietly ignored, maintaining the format of the v3 RunHeader in the resulting output file.
Definition at line 54 of file RunHeader.h.
ldmx::RunHeader::RunHeader | ( | int | runNumber | ) |
Constructor.
runNumber | The run number uniquely identifying this run |
Definition at line 13 of file RunHeader.cxx.
|
default |
Default constructor.
|
inlinevirtual |
|
inline |
Definition at line 89 of file RunHeader.h.
References description_.
Referenced by stream().
|
inline |
Definition at line 77 of file RunHeader.h.
References detectorName_.
Referenced by ecal::EcalGeometryProvider::onNewRun(), hcal::HcalGeometryProvider::onNewRun(), and stream().
|
inline |
Get a float parameter value.
name | The name of the parameter. |
Definition at line 174 of file RunHeader.h.
References floatParameters_.
|
inline |
Get a const reference to all float parameters.
Definition at line 179 of file RunHeader.h.
References floatParameters_.
|
inline |
Get an int parameter value.
name | The name of the parameter. |
Definition at line 149 of file RunHeader.h.
References intParameters_.
|
inline |
Get a const reference to all int parameters.
Definition at line 154 of file RunHeader.h.
References intParameters_.
|
inline |
Get the total number of tries that were done during the production of this run.
Definition at line 129 of file RunHeader.h.
References numTries_.
Referenced by stream().
|
inline |
Get the end time of the run in seconds since epoch.
Definition at line 114 of file RunHeader.h.
References runEnd_.
|
inline |
Definition at line 74 of file RunHeader.h.
References runNumber_.
Referenced by simcore::Simulator::onNewRun(), framework::RandomNumberSeedService::onNewRun(), stream(), packing::rawdatafile::File::writeRunHeader(), and framework::EventFile::writeRunHeader().
|
inline |
Get the start time of the run in seconds since epoch.
Definition at line 100 of file RunHeader.h.
References runStart_.
|
inline |
Definition at line 86 of file RunHeader.h.
References softwareTag_.
|
inline |
Get a string parameter value.
name | The name of the parameter. |
Definition at line 199 of file RunHeader.h.
References stringParameters_.
|
inline |
Get a const reference to all string parameters.
Definition at line 204 of file RunHeader.h.
References stringParameters_.
void ldmx::RunHeader::Print | ( | ) | const |
Print a string desciption of this object.
Definition at line 34 of file RunHeader.cxx.
References stream().
|
inline |
Set the description of this run.
Definition at line 92 of file RunHeader.h.
References description_.
Referenced by simcore::Simulator::beforeNewRun().
|
inline |
Set the name of the detector that was used in this run.
Definition at line 80 of file RunHeader.h.
References detectorName_.
Referenced by simcore::Simulator::beforeNewRun(), hcal::HcalRawDecoder::beforeNewRun(), and packing::SingleSubsystemUnpacker::beforeNewRun().
|
inline |
Set a float parameter value.
name | The name of the parameter. |
value | The parameter value. |
Definition at line 189 of file RunHeader.h.
References floatParameters_.
Referenced by simcore::Simulator::beforeNewRun(), simcore::generators::MultiParticleGunPrimaryGenerator::RecordConfig(), simcore::generators::ParticleGun::RecordConfig(), simcore::biasoperators::PhotoNuclear::RecordConfig(), simcore::biasoperators::DarkBrem::RecordConfig(), simcore::biasoperators::ElectroNuclear::RecordConfig(), simcore::biasoperators::GammaToMuPair::RecordConfig(), simcore::biasoperators::K0LongInelastic::RecordConfig(), and simcore::biasoperators::NeutronInelastic::RecordConfig().
|
inline |
Set an int parameter value.
name | The name of the parameter. |
value | The value of the parameter. |
Definition at line 164 of file RunHeader.h.
References intParameters_.
Referenced by simcore::Simulator::beforeNewRun(), framework::RandomNumberSeedService::onNewRun(), simcore::generators::MultiParticleGunPrimaryGenerator::RecordConfig(), simcore::biasoperators::PhotoNuclear::RecordConfig(), simcore::biasoperators::DarkBrem::RecordConfig(), and packing::rawdatafile::File::writeRunHeader().
|
inline |
Set the total number of tries that were done during the production of this run.
[in] | numTries | the number of tries in this run |
Definition at line 141 of file RunHeader.h.
References numTries_.
Referenced by framework::Process::run().
|
inline |
Set the end time of the run in seconds since epoch.
[in] | runEnd | the end time of the run. |
Definition at line 121 of file RunHeader.h.
References runEnd_.
Referenced by framework::Process::run().
|
inline |
Set the run start time in seconds since epoch.
[in] | runStart | the start time of the run. |
Definition at line 107 of file RunHeader.h.
References runStart_.
Referenced by framework::Process::run().
|
inline |
Set a string parameter value.
name | The name of the parameter. |
value | The parameter value. |
Definition at line 214 of file RunHeader.h.
References stringParameters_.
Referenced by simcore::Simulator::beforeNewRun(), simcore::generators::GeneralParticleSource::RecordConfig(), simcore::generators::LHEPrimaryGenerator::RecordConfig(), simcore::generators::MultiParticleGunPrimaryGenerator::RecordConfig(), simcore::generators::ParticleGun::RecordConfig(), simcore::biasoperators::PhotoNuclear::RecordConfig(), simcore::biasoperators::DarkBrem::RecordConfig(), simcore::biasoperators::ElectroNuclear::RecordConfig(), simcore::biasoperators::GammaToMuPair::RecordConfig(), simcore::biasoperators::K0LongInelastic::RecordConfig(), and simcore::biasoperators::NeutronInelastic::RecordConfig().
void ldmx::RunHeader::stream | ( | std::ostream & | s | ) | const |
Stream this object into the input ostream.
Includes new-line characters to separate out the different parameter maps
[in] | s | ostream to write to |
Definition at line 15 of file RunHeader.cxx.
References floatParameters_, getDescription(), getDetectorName(), getNumTries(), getRunNumber(), intParameters_, and stringParameters_.
Referenced by Print().
|
friend |
Stream this object to an output stream.
Needs to be here and labeled as friend for it to be compatible with Boost logging.
[in] | s | ostream to write to |
[in] | h | RunHeader to write out |
Definition at line 241 of file RunHeader.h.
|
private |
Run description.
Definition at line 254 of file RunHeader.h.
Referenced by getDescription(), and setDescription().
|
private |
Detector name.
Definition at line 251 of file RunHeader.h.
Referenced by getDetectorName(), and setDetectorName().
|
private |
Map of float parameters.
Definition at line 288 of file RunHeader.h.
Referenced by getFloatParameter(), getFloatParameters(), setFloatParameter(), and stream().
|
private |
Map of int parameters.
Definition at line 285 of file RunHeader.h.
Referenced by getIntParameter(), getIntParameters(), setIntParameter(), and stream().
|
private |
Total number of events that were begun during the production of this run.
This value is only set at the end of processing so we can faithfully store the total number of events that were started. In the case where maxTriesPerEvent is set to 1, this will be the same as the configured maxEvents during Production Mode. If more than one try per event is allowed, this will not necessarily be maxEvents since processors could abort an event causing more than maxEvents to be started. This can be summarized by the following inequality
maxEvents <= numTries <= maxEvents*maxTriesPerEvent
Definition at line 276 of file RunHeader.h.
Referenced by getNumTries(), and setNumTries().
|
private |
Run end in seconds since epoch.
Definition at line 260 of file RunHeader.h.
Referenced by getRunEnd(), and setRunEnd().
|
private |
|
private |
Run start in seconds since epoch.
Definition at line 257 of file RunHeader.h.
Referenced by getRunStart(), and setRunStart().
|
private |
git SHA-1 hash associated with the software tag used to generate this file.
Definition at line 282 of file RunHeader.h.
Referenced by getSoftwareTag().
|
private |
Map of string parameters.
Definition at line 291 of file RunHeader.h.
Referenced by getStringParameter(), getStringParameters(), setStringParameter(), and stream().