LDMX Software
Framework
include
Framework
EventHeader.h
Go to the documentation of this file.
1
8
#ifndef EVENT_EVENTHEADER_H_
9
#define EVENT_EVENTHEADER_H_
10
11
// ROOT
12
#include "TObject.h"
//For ClassDef
13
#include "TTimeStamp.h"
14
15
// STL
16
#include <iostream>
17
#include <map>
18
#include <string>
19
20
namespace
ldmx {
21
44
class
EventHeader
{
45
public
:
49
static
const
std::string
BRANCH
;
50
54
EventHeader
() =
default
;
55
59
virtual
~EventHeader
() =
default
;
60
66
void
Clear
(Option_t* o =
""
);
67
72
void
Print
(Option_t* o =
""
)
const
;
73
78
int
getEventNumber
()
const
{
return
eventNumber_
; }
79
84
int
getRun
()
const
{
return
run_
; }
85
92
const
TTimeStamp&
getTimestamp
()
const
{
return
timestamp_
; }
93
98
double
getWeight
()
const
{
return
weight_
; }
99
104
bool
isRealData
()
const
{
return
isRealData_
; }
105
110
void
setRealData
(
bool
yes =
true
) {
isRealData_
= yes; }
111
120
void
setEventNumber
(
int
eventNumber) { this->
eventNumber_
= eventNumber; }
121
129
void
setRun
(
int
run) { this->
run_
= run; }
130
138
void
setTimestamp
(
const
TTimeStamp& timestamp) {
139
this->
timestamp_
= timestamp;
140
}
141
152
void
setWeight
(
double
weight) { this->
weight_
= weight; }
153
160
int
getIntParameter
(
const
std::string& name)
const
;
161
168
void
setIntParameter
(
const
std::string& name,
int
value) {
169
intParameters_
[name] = value;
170
}
171
178
float
getFloatParameter
(
const
std::string& name)
const
;
179
185
void
setFloatParameter
(
const
std::string& name,
float
value) {
186
floatParameters_
[name] = value;
187
}
188
195
std::string
getStringParameter
(
const
std::string& name)
const
;
196
202
void
setStringParameter
(
const
std::string& name, std::string value) {
203
stringParameters_
[name] = value;
204
}
205
206
protected
:
210
int
eventNumber_
{-1};
211
215
int
run_
{-1};
216
220
TTimeStamp
timestamp_
{0, 0};
221
225
double
weight_
{1.0};
226
230
bool
isRealData_
{
false
};
231
235
std::map<std::string, int>
intParameters_
;
236
240
std::map<std::string, float>
floatParameters_
;
241
245
std::map<std::string, std::string>
stringParameters_
;
246
250
ClassDef
(
EventHeader
, 2);
251
};
252
253
}
// namespace ldmx
254
255
#endif
/* EVENT_EVENTHEADER_H_ */
ldmx::EventHeader
Provides header information an event such as event number and timestamp.
Definition
EventHeader.h:44
ldmx::EventHeader::intParameters_
std::map< std::string, int > intParameters_
The int parameters.
Definition
EventHeader.h:235
ldmx::EventHeader::weight_
double weight_
The event weight.
Definition
EventHeader.h:225
ldmx::EventHeader::timestamp_
TTimeStamp timestamp_
The event timestamp.
Definition
EventHeader.h:220
ldmx::EventHeader::getRun
int getRun() const
Return the run number.
Definition
EventHeader.h:84
ldmx::EventHeader::getIntParameter
int getIntParameter(const std::string &name) const
Get an int parameter value.
Definition
EventHeader.cxx:33
ldmx::EventHeader::run_
int run_
The run number.
Definition
EventHeader.h:215
ldmx::EventHeader::getTimestamp
const TTimeStamp & getTimestamp() const
Get the event's timestamp.
Definition
EventHeader.h:92
ldmx::EventHeader::isRealData_
bool isRealData_
Is this event real data?
Definition
EventHeader.h:230
ldmx::EventHeader::setEventNumber
void setEventNumber(int eventNumber)
Set the event number.
Definition
EventHeader.h:120
ldmx::EventHeader::floatParameters_
std::map< std::string, float > floatParameters_
The float parameters.
Definition
EventHeader.h:240
ldmx::EventHeader::getFloatParameter
float getFloatParameter(const std::string &name) const
Get a float parameter value.
Definition
EventHeader.cxx:41
ldmx::EventHeader::isRealData
bool isRealData() const
Is this a real data event?
Definition
EventHeader.h:104
ldmx::EventHeader::stringParameters_
std::map< std::string, std::string > stringParameters_
The string parameters.
Definition
EventHeader.h:245
ldmx::EventHeader::setRun
void setRun(int run)
Set the run number.
Definition
EventHeader.h:129
ldmx::EventHeader::setStringParameter
void setStringParameter(const std::string &name, std::string value)
Set a string parameter value.
Definition
EventHeader.h:202
ldmx::EventHeader::getWeight
double getWeight() const
Get the event weight (default of 1.0).
Definition
EventHeader.h:98
ldmx::EventHeader::getEventNumber
int getEventNumber() const
Return the event number.
Definition
EventHeader.h:78
ldmx::EventHeader::setRealData
void setRealData(bool yes=true)
set whether this event is real or MC data
Definition
EventHeader.h:110
ldmx::EventHeader::setIntParameter
void setIntParameter(const std::string &name, int value)
Set an int parameter value.
Definition
EventHeader.h:168
ldmx::EventHeader::ClassDef
ClassDef(EventHeader, 2)
ROOT class definition.
ldmx::EventHeader::setTimestamp
void setTimestamp(const TTimeStamp ×tamp)
Set the timestamp.
Definition
EventHeader.h:138
ldmx::EventHeader::Print
void Print(Option_t *o="") const
Print this object.
Definition
EventHeader.cxx:22
ldmx::EventHeader::EventHeader
EventHeader()=default
Class constructor.
ldmx::EventHeader::setWeight
void setWeight(double weight)
Set the event weight.
Definition
EventHeader.h:152
ldmx::EventHeader::setFloatParameter
void setFloatParameter(const std::string &name, float value)
Set a float parameter value.
Definition
EventHeader.h:185
ldmx::EventHeader::~EventHeader
virtual ~EventHeader()=default
Class destructor.
ldmx::EventHeader::BRANCH
static const std::string BRANCH
Name of EventHeader branch.
Definition
EventHeader.h:49
ldmx::EventHeader::getStringParameter
std::string getStringParameter(const std::string &name) const
Get a string parameter value.
Definition
EventHeader.cxx:49
ldmx::EventHeader::eventNumber_
int eventNumber_
The event number.
Definition
EventHeader.h:210
ldmx::EventHeader::Clear
void Clear(Option_t *o="")
Clear information from this object.
Definition
EventHeader.cxx:11
Generated by
1.9.8