LDMX Software
RunHeader.cxx
1
2#include "Framework/RunHeader.h"
3
4/*~~~~~~~~~~~~~~~~*/
5/* C++ StdLib */
6/*~~~~~~~~~~~~~~~~*/
7#include <iostream>
8
9ClassImp(ldmx::RunHeader);
10
11namespace ldmx {
12
13RunHeader::RunHeader(int run_number) : run_number_(run_number) {}
14
15void RunHeader::stream(std::ostream& s) const {
16 s << "RunHeader { run: " << getRunNumber() << ", numTries: " << getNumTries()
17 << ", completed: " << (isCompleted() ? "true" : "false")
18 << ", detectorName: " << getDetectorName()
19 << ", description: " << getDescription() << "\n";
20 s << " intParameters: " << "\n";
21 for (const auto& [key, val] : int_parameters_)
22 s << " " << key << " = " << val << "\n";
23 s << " floatParameters: " << "\n";
24 for (const auto& [key, val] : float_parameters_)
25 s << " " << key << " = " << val << "\n";
26 s << " stringParameters: " << "\n";
27 for (const auto& [key, val] : string_parameters_)
28 s << " " << key << " = " << val << "\n";
29 s << "}";
30}
31
32void RunHeader::print() const { stream(std::cout); }
33
34} // namespace ldmx
Run-specific configuration and data stored in its own output TTree alongside the event TTree in the o...
Definition RunHeader.h:67
RunHeader()=default
Default constructor.
void stream(std::ostream &s) const
Stream this object into the input ostream.
Definition RunHeader.cxx:15
std::map< std::string, int > int_parameters_
Map of int parameters.
Definition RunHeader.h:339
std::map< std::string, std::string > string_parameters_
Map of string parameters.
Definition RunHeader.h:345
std::map< std::string, float > float_parameters_
Map of float parameters.
Definition RunHeader.h:342
int getNumTries() const
Get the total number of tries that were done during the production of this run.
Definition RunHeader.h:155
const std::string & getDescription() const
Definition RunHeader.h:115
const std::string & getDetectorName() const
Definition RunHeader.h:98
bool isCompleted() const
Check whether the file holding this run was closed cleanly.
Definition RunHeader.h:177
void print() const
Print a string desciption of this object.
Definition RunHeader.cxx:32
int getRunNumber() const
Definition RunHeader.h:95