LDMX Software
Framework
include
Framework
RunHeader.h
1
#ifndef FRAMEWORK_EVENT_RUNHEADER_H_
2
#define FRAMEWORK_EVENT_RUNHEADER_H_
3
4
/*~~~~~~~~~~*/
5
/* ROOT */
6
/*~~~~~~~~~~*/
7
#include "TObject.h"
8
9
/*~~~~~~~~~~~~~~~~*/
10
/* C++ StdLib */
11
/*~~~~~~~~~~~~~~~~*/
12
#include <map>
13
#include <string>
14
15
/*~~~~~~~~~~~~~~~*/
16
/* Framework */
17
/*~~~~~~~~~~~~~~~*/
18
#include "Framework/Version.h"
19
20
namespace
ldmx {
21
54
class
RunHeader
{
55
public
:
61
RunHeader
(
int
runNumber);
62
68
RunHeader
() =
default
;
69
71
virtual
~RunHeader
() {}
72
74
int
getRunNumber
()
const
{
return
runNumber_
; }
75
77
const
std::string &
getDetectorName
()
const
{
return
detectorName_
; }
78
80
void
setDetectorName
(
const
std::string &det) {
detectorName_
= det; }
81
86
const
std::string &
getSoftwareTag
()
const
{
return
softwareTag_
; }
87
89
const
std::string &
getDescription
()
const
{
return
description_
; }
90
92
void
setDescription
(
const
std::string &des) {
description_
= des; }
93
100
int
getRunStart
()
const
{
return
runStart_
; }
101
107
void
setRunStart
(
const
int
runStart) {
runStart_
= runStart; }
108
114
int
getRunEnd
()
const
{
return
runEnd_
; }
115
121
void
setRunEnd
(
const
int
runEnd) {
runEnd_
= runEnd; }
122
129
int
getNumTries
()
const
{
return
numTries_
; }
130
141
void
setNumTries
(
const
int
numTries) {
numTries_
= numTries; }
142
149
int
getIntParameter
(
const
std::string &name)
const
{
150
return
intParameters_
.at(name);
151
}
152
154
const
std::map<std::string, int> &
getIntParameters
()
const
{
155
return
intParameters_
;
156
}
157
164
void
setIntParameter
(
const
std::string &name,
int
value) {
165
intParameters_
[name] = value;
166
}
167
174
float
getFloatParameter
(
const
std::string &name)
const
{
175
return
floatParameters_
.at(name);
176
}
177
179
const
std::map<std::string, float> &
getFloatParameters
()
const
{
180
return
floatParameters_
;
181
}
182
189
void
setFloatParameter
(
const
std::string &name,
float
value) {
190
floatParameters_
[name] = value;
191
}
192
199
std::string
getStringParameter
(
const
std::string &name)
const
{
200
return
stringParameters_
.at(name);
201
}
202
204
const
std::map<std::string, std::string> &
getStringParameters
()
const
{
205
return
stringParameters_
;
206
}
207
214
void
setStringParameter
(
const
std::string &name, std::string value) {
215
stringParameters_
[name] = value;
216
}
217
225
void
stream
(std::ostream &s)
const
;
226
228
void
Print
()
const
;
229
241
friend
std::ostream &
operator<<
(std::ostream &s,
const
ldmx::RunHeader
&h) {
242
h.
stream
(s);
243
return
s;
244
}
245
246
private
:
248
int
runNumber_
{0};
249
251
std::string
detectorName_
{
""
};
252
254
std::string
description_
{
""
};
255
257
int
runStart_
{0};
258
260
int
runEnd_
{0};
261
276
int
numTries_
{0};
277
282
std::string
softwareTag_
{GIT_SHA1};
283
285
std::map<std::string, int>
intParameters_
;
286
288
std::map<std::string, float>
floatParameters_
;
289
291
std::map<std::string, std::string>
stringParameters_
;
292
293
ClassDef(
RunHeader
, 4);
294
295
};
// RunHeader
296
297
}
// namespace ldmx
298
299
#endif
// _FRAMEWORK_EVENT_RUN_HEADER_H_
ldmx::RunHeader
Run-specific configuration and data stored in its own output TTree alongside the event TTree in the o...
Definition
RunHeader.h:54
ldmx::RunHeader::getIntParameter
int getIntParameter(const std::string &name) const
Get an int parameter value.
Definition
RunHeader.h:149
ldmx::RunHeader::softwareTag_
std::string softwareTag_
git SHA-1 hash associated with the software tag used to generate this file.
Definition
RunHeader.h:282
ldmx::RunHeader::setFloatParameter
void setFloatParameter(const std::string &name, float value)
Set a float parameter value.
Definition
RunHeader.h:189
ldmx::RunHeader::getStringParameter
std::string getStringParameter(const std::string &name) const
Get a string parameter value.
Definition
RunHeader.h:199
ldmx::RunHeader::RunHeader
RunHeader()=default
Default constructor.
ldmx::RunHeader::stream
void stream(std::ostream &s) const
Stream this object into the input ostream.
Definition
RunHeader.cxx:15
ldmx::RunHeader::getFloatParameter
float getFloatParameter(const std::string &name) const
Get a float parameter value.
Definition
RunHeader.h:174
ldmx::RunHeader::setRunEnd
void setRunEnd(const int runEnd)
Set the end time of the run in seconds since epoch.
Definition
RunHeader.h:121
ldmx::RunHeader::getIntParameters
const std::map< std::string, int > & getIntParameters() const
Get a const reference to all int parameters.
Definition
RunHeader.h:154
ldmx::RunHeader::setDetectorName
void setDetectorName(const std::string &det)
Set the name of the detector that was used in this run.
Definition
RunHeader.h:80
ldmx::RunHeader::detectorName_
std::string detectorName_
Detector name.
Definition
RunHeader.h:251
ldmx::RunHeader::setStringParameter
void setStringParameter(const std::string &name, std::string value)
Set a string parameter value.
Definition
RunHeader.h:214
ldmx::RunHeader::~RunHeader
virtual ~RunHeader()
Destructor.
Definition
RunHeader.h:71
ldmx::RunHeader::description_
std::string description_
Run description.
Definition
RunHeader.h:254
ldmx::RunHeader::getSoftwareTag
const std::string & getSoftwareTag() const
Definition
RunHeader.h:86
ldmx::RunHeader::getNumTries
int getNumTries() const
Get the total number of tries that were done during the production of this run.
Definition
RunHeader.h:129
ldmx::RunHeader::numTries_
int numTries_
Total number of events that were begun during the production of this run.
Definition
RunHeader.h:276
ldmx::RunHeader::setRunStart
void setRunStart(const int runStart)
Set the run start time in seconds since epoch.
Definition
RunHeader.h:107
ldmx::RunHeader::getDescription
const std::string & getDescription() const
Definition
RunHeader.h:89
ldmx::RunHeader::floatParameters_
std::map< std::string, float > floatParameters_
Map of float parameters.
Definition
RunHeader.h:288
ldmx::RunHeader::getRunStart
int getRunStart() const
Get the start time of the run in seconds since epoch.
Definition
RunHeader.h:100
ldmx::RunHeader::stringParameters_
std::map< std::string, std::string > stringParameters_
Map of string parameters.
Definition
RunHeader.h:291
ldmx::RunHeader::Print
void Print() const
Print a string desciption of this object.
Definition
RunHeader.cxx:34
ldmx::RunHeader::getDetectorName
const std::string & getDetectorName() const
Definition
RunHeader.h:77
ldmx::RunHeader::getRunEnd
int getRunEnd() const
Get the end time of the run in seconds since epoch.
Definition
RunHeader.h:114
ldmx::RunHeader::operator<<
friend std::ostream & operator<<(std::ostream &s, const ldmx::RunHeader &h)
Stream this object to an output stream.
Definition
RunHeader.h:241
ldmx::RunHeader::setDescription
void setDescription(const std::string &des)
Set the description of this run.
Definition
RunHeader.h:92
ldmx::RunHeader::intParameters_
std::map< std::string, int > intParameters_
Map of int parameters.
Definition
RunHeader.h:285
ldmx::RunHeader::runStart_
int runStart_
Run start in seconds since epoch.
Definition
RunHeader.h:257
ldmx::RunHeader::getFloatParameters
const std::map< std::string, float > & getFloatParameters() const
Get a const reference to all float parameters.
Definition
RunHeader.h:179
ldmx::RunHeader::setNumTries
void setNumTries(const int numTries)
Set the total number of tries that were done during the production of this run.
Definition
RunHeader.h:141
ldmx::RunHeader::getStringParameters
const std::map< std::string, std::string > & getStringParameters() const
Get a const reference to all string parameters.
Definition
RunHeader.h:204
ldmx::RunHeader::runNumber_
int runNumber_
Run number.
Definition
RunHeader.h:248
ldmx::RunHeader::setIntParameter
void setIntParameter(const std::string &name, int value)
Set an int parameter value.
Definition
RunHeader.h:164
ldmx::RunHeader::getRunNumber
int getRunNumber() const
Definition
RunHeader.h:74
ldmx::RunHeader::runEnd_
int runEnd_
Run end in seconds since epoch.
Definition
RunHeader.h:260
Generated by
1.9.8