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