ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Event
ByteStreamData
src
ByteStreamMetadata.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3
*/
4
10
11
#include "
ByteStreamData/ByteStreamMetadata.h
"
12
13
#include "EventStorage/DataReader.h"
14
15
#include <bitset>
16
#include <ostream>
17
18
/******************************************************************************/
19
ByteStreamMetadata::ByteStreamMetadata
()
20
:
m_runNumber
(0U)
21
,
m_numEvents
(0U)
22
,
m_maxEvents
(0U)
23
,
m_recEnable
(0U)
24
,
m_triggerType
(0U)
25
,
m_detectorMask
(0L)
26
,
m_detectorMask2
(0L)
27
,
m_beamType
(0U)
28
,
m_beamEnergy
(0U)
29
,
m_guid
()
30
,
m_stream
()
31
,
m_project
()
32
,
m_lumiBlock
(0U)
33
,
m_freeMetaDataStrings
()
34
{}
35
36
37
/******************************************************************************/
38
ByteStreamMetadata::ByteStreamMetadata
(
unsigned
int
runNumber,
39
unsigned
int
numEvents,
40
unsigned
int
maxEvents,
41
unsigned
int
recEnable,
42
unsigned
int
triggerType,
43
uint64_t detectorMask,
44
unsigned
int
beamType,
45
unsigned
int
beamEnergy,
46
const
std::string& guid,
47
const
std::string& stream,
48
const
std::string&
project
,
49
unsigned
int
lumiBlock,
50
const
std::vector<std::string>& freeMetaDataStrings)
51
:
m_runNumber
(runNumber)
52
,
m_numEvents
(numEvents)
53
,
m_maxEvents
(maxEvents)
54
,
m_recEnable
(recEnable)
55
,
m_triggerType
(triggerType)
56
,
m_detectorMask
(detectorMask)
57
,
m_detectorMask2
(0)
58
,
m_beamType
(beamType)
59
,
m_beamEnergy
(beamEnergy)
60
,
m_guid
(guid)
61
,
m_stream
(stream)
62
,
m_project
(
project
)
63
,
m_lumiBlock
(lumiBlock)
64
,
m_freeMetaDataStrings
(freeMetaDataStrings)
65
{}
66
67
68
/******************************************************************************/
69
ByteStreamMetadata::ByteStreamMetadata
(
70
unsigned
int
runNumber,
71
unsigned
int
numEvents,
72
unsigned
int
maxEvents,
73
unsigned
int
recEnable,
74
unsigned
int
triggerType,
75
uint64_t detectorMask,
76
uint64_t detectorMask2,
77
unsigned
int
beamType,
78
unsigned
int
beamEnergy,
79
const
std::string& guid,
80
const
std::string& stream,
81
const
std::string&
project
,
82
unsigned
int
lumiBlock,
83
const
std::vector<std::string>& freeMetaDataStrings)
84
:
m_runNumber
(runNumber)
85
,
m_numEvents
(numEvents)
86
,
m_maxEvents
(maxEvents)
87
,
m_recEnable
(recEnable)
88
,
m_triggerType
(triggerType)
89
,
m_detectorMask
(detectorMask)
90
,
m_detectorMask2
(detectorMask2)
91
,
m_beamType
(beamType)
92
,
m_beamEnergy
(beamEnergy)
93
,
m_guid
(guid)
94
,
m_stream
(stream)
95
,
m_project
(
project
)
96
,
m_lumiBlock
(lumiBlock)
97
,
m_freeMetaDataStrings
(freeMetaDataStrings)
98
{}
99
100
101
/******************************************************************************/
102
ByteStreamMetadata::ByteStreamMetadata
(EventStorage::DataReader& reader)
103
:
m_runNumber
(reader.runNumber())
104
,
m_numEvents
(reader.eventsInFile())
105
,
m_maxEvents
(reader.maxEvents())
106
,
m_recEnable
(reader.recEnable())
107
,
m_triggerType
(reader.triggerType())
108
,
m_detectorMask
(0)
109
,
m_detectorMask2
(0)
110
,
m_beamType
(reader.beamType())
111
,
m_beamEnergy
(reader.beamEnergy())
112
,
m_guid
(reader.GUID())
113
,
m_stream
(reader.stream())
114
,
m_project
(reader.projectTag())
115
,
m_lumiBlock
(reader.lumiblockNumber())
116
,
m_freeMetaDataStrings
(reader.freeMetaDataStrings())
117
{
118
// default goes into ByteStreamMetadata
119
std::bitset<64> word1;
120
std::bitset<64> word2;
121
for
(
unsigned
int
i=0; i<64; ++i) {
122
word1[i] = reader.detectorMask()[i];
123
word2[i] = reader.detectorMask()[i+64];
124
}
125
m_detectorMask
= word1.to_ulong();
126
m_detectorMask2
= word2.to_ulong();
127
}
128
129
130
/******************************************************************************/
131
ByteStreamMetadata::~ByteStreamMetadata
() {}
132
133
134
/******************************************************************************/
135
// TODO: inline these getters
136
unsigned
int
137
ByteStreamMetadata::getRunNumber
()
const
138
{
return
(
m_runNumber
);}
139
140
unsigned
int
141
ByteStreamMetadata::getNumEvents
()
const
142
{
return
(
m_numEvents
);}
143
144
unsigned
int
145
ByteStreamMetadata::getMaxEvents
()
const
146
{
return
(
m_maxEvents
);}
147
148
unsigned
int
149
ByteStreamMetadata::getRecEnable
()
const
150
{
return
(
m_recEnable
);}
151
152
unsigned
int
153
ByteStreamMetadata::getTriggerType
()
const
154
{
return
(
m_triggerType
);}
155
156
uint64_t
157
ByteStreamMetadata::getDetectorMask
()
const
158
{
return
(
m_detectorMask
);}
159
160
uint64_t
161
ByteStreamMetadata::getDetectorMask2
()
const
162
{
return
(
m_detectorMask2
);}
163
164
unsigned
int
165
ByteStreamMetadata::getBeamType
()
const
166
{
return
(
m_beamType
);}
167
168
unsigned
int
169
ByteStreamMetadata::getBeamEnergy
()
const
170
{
return
(
m_beamEnergy
);}
171
172
const
std::string&
173
ByteStreamMetadata::getGuid
()
const
174
{
return
(
m_guid
);}
175
176
const
std::string&
177
ByteStreamMetadata::getStream
()
const
178
{
return
(
m_stream
);}
179
180
const
std::string&
181
ByteStreamMetadata::getProject
()
const
182
{
return
(
m_project
);}
183
184
unsigned
int
185
ByteStreamMetadata::getLumiBlock
()
const
186
{
return
(
m_lumiBlock
);}
187
188
const
std::vector<std::string>&
189
ByteStreamMetadata::getFreeMetaDataStrings
()
const
190
{
return
(
m_freeMetaDataStrings
);}
191
192
193
/******************************************************************************/
194
std::ostream&
operator<<
(std::ostream& os,
const
ByteStreamMetadata
& bsmd) {
195
std::bitset<64> word1(bsmd.
getDetectorMask
());
196
std::bitset<64> word2(bsmd.
getDetectorMask2
());
197
198
os <<
" runNumber: "
<< bsmd.
getRunNumber
() <<
'\n'
199
<<
" numEvents: "
<< bsmd.
getNumEvents
() <<
'\n'
200
<<
" m_maxEvents: "
<< bsmd.
getMaxEvents
() <<
'\n'
201
<<
" recEnable: "
<< bsmd.
getRecEnable
() <<
'\n'
202
<<
" triggerType: "
<< bsmd.
getTriggerType
() <<
'\n'
203
<<
" detectorMask: "
<< word1 <<
'\n'
204
<<
" detectorMask2: "
<< word2 <<
'\n'
205
<<
" beamType: "
<< bsmd.
getBeamType
() <<
'\n'
206
<<
" beamEnergy: "
<< bsmd.
getBeamEnergy
() <<
'\n'
207
<<
" guid: "
<< bsmd.
getGuid
() <<
'\n'
208
<<
" stream: "
<< bsmd.
getStream
() <<
'\n'
209
<<
" project: "
<< bsmd.
getProject
() <<
'\n'
210
<<
" lumiBlock: "
<< bsmd.
getLumiBlock
() <<
'\n'
;
211
212
os <<
" freeMetaDataStrings: "
;
213
for
(
const
std::string& key : bsmd.
getFreeMetaDataStrings
())
214
os << key <<
" "
;
215
216
return
os;
217
}
operator<<
std::ostream & operator<<(std::ostream &os, const ByteStreamMetadata &bsmd)
pretty print bytestream metadata content
Definition
ByteStreamMetadata.cxx:194
ByteStreamMetadata.h
This file contains the class definition for the ByteStreamMetadata class.
project
T_ResultType project(ParameterMapping::type< N > parameter_map, const T_Matrix &matrix)
Definition
MeasurementSelector.h:152
ByteStreamMetadata
This class is the StoreGate data object for bytestream metadata.
Definition
ByteStreamMetadata.h:25
ByteStreamMetadata::getDetectorMask
uint64_t getDetectorMask() const
Definition
ByteStreamMetadata.cxx:157
ByteStreamMetadata::getBeamType
unsigned int getBeamType() const
Definition
ByteStreamMetadata.cxx:165
ByteStreamMetadata::m_project
std::string m_project
Definition
ByteStreamMetadata.h:112
ByteStreamMetadata::m_beamType
unsigned int m_beamType
Definition
ByteStreamMetadata.h:108
ByteStreamMetadata::m_lumiBlock
unsigned int m_lumiBlock
Definition
ByteStreamMetadata.h:113
ByteStreamMetadata::getGuid
const std::string & getGuid() const
Definition
ByteStreamMetadata.cxx:173
ByteStreamMetadata::m_triggerType
unsigned int m_triggerType
Definition
ByteStreamMetadata.h:105
ByteStreamMetadata::getStream
const std::string & getStream() const
Definition
ByteStreamMetadata.cxx:177
ByteStreamMetadata::getMaxEvents
unsigned int getMaxEvents() const
Definition
ByteStreamMetadata.cxx:145
ByteStreamMetadata::m_guid
std::string m_guid
Definition
ByteStreamMetadata.h:110
ByteStreamMetadata::m_stream
std::string m_stream
Definition
ByteStreamMetadata.h:111
ByteStreamMetadata::m_recEnable
unsigned int m_recEnable
Definition
ByteStreamMetadata.h:104
ByteStreamMetadata::ByteStreamMetadata
ByteStreamMetadata()
Definition
ByteStreamMetadata.cxx:19
ByteStreamMetadata::~ByteStreamMetadata
virtual ~ByteStreamMetadata()
Definition
ByteStreamMetadata.cxx:131
ByteStreamMetadata::getRecEnable
unsigned int getRecEnable() const
Definition
ByteStreamMetadata.cxx:149
ByteStreamMetadata::getRunNumber
unsigned int getRunNumber() const
Definition
ByteStreamMetadata.cxx:137
ByteStreamMetadata::getTriggerType
unsigned int getTriggerType() const
Definition
ByteStreamMetadata.cxx:153
ByteStreamMetadata::m_beamEnergy
unsigned int m_beamEnergy
Definition
ByteStreamMetadata.h:109
ByteStreamMetadata::getNumEvents
unsigned int getNumEvents() const
Definition
ByteStreamMetadata.cxx:141
ByteStreamMetadata::getBeamEnergy
unsigned int getBeamEnergy() const
Definition
ByteStreamMetadata.cxx:169
ByteStreamMetadata::getLumiBlock
unsigned int getLumiBlock() const
Definition
ByteStreamMetadata.cxx:185
ByteStreamMetadata::getFreeMetaDataStrings
const std::vector< std::string > & getFreeMetaDataStrings() const
Definition
ByteStreamMetadata.cxx:189
ByteStreamMetadata::m_maxEvents
unsigned int m_maxEvents
Definition
ByteStreamMetadata.h:103
ByteStreamMetadata::m_runNumber
unsigned int m_runNumber
Definition
ByteStreamMetadata.h:101
ByteStreamMetadata::getProject
const std::string & getProject() const
Definition
ByteStreamMetadata.cxx:181
ByteStreamMetadata::m_numEvents
unsigned int m_numEvents
Definition
ByteStreamMetadata.h:102
ByteStreamMetadata::m_freeMetaDataStrings
std::vector< std::string > m_freeMetaDataStrings
Definition
ByteStreamMetadata.h:114
ByteStreamMetadata::m_detectorMask2
uint64_t m_detectorMask2
Definition
ByteStreamMetadata.h:107
ByteStreamMetadata::m_detectorMask
uint64_t m_detectorMask
Definition
ByteStreamMetadata.h:106
ByteStreamMetadata::getDetectorMask2
uint64_t getDetectorMask2() const
Definition
ByteStreamMetadata.cxx:161
Generated on
for ATLAS Offline Software by
1.17.0