ATLAS Offline Software
ROBDataMonitor.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #include <functional>
6 #include <algorithm>
8 
9 using namespace robmonitor;
10 
11 //
12 //--- ROBDataStruct
13 // -------------
15  : rob_id(0),
16  rob_size(0),
17  rob_history(robmonitor::UNCLASSIFIED),
18  rob_status_word(0)
19 {}
20 
22  : rob_id(srcId),
23  rob_size(0),
24  rob_history(robmonitor::UNCLASSIFIED),
25  rob_status_word(0)
26 {}
27 
29  return ((rob_history == robmonitor::UNCLASSIFIED) ? true : false);
30 }
31 
33  return ((rob_history == robmonitor::HLT_CACHED) ? true : false);
34 }
35 
37  return ((rob_history == robmonitor::DCM_CACHED) ? true : false);
38 }
39 
41  return ((rob_history == robmonitor::RETRIEVED) ? true : false);
42 }
43 
45  return ((rob_history == robmonitor::IGNORED) ? true : false);
46 }
47 
49  return ((rob_history == robmonitor::UNDEFINED) ? true : false);
50 }
51 
53  return (rob_status_word == 0) ? true : false;
54 }
55 
56 
57 //
58 //--- ROBDataMonitorStruct
59 // --------------------
61  :lvl1ID(0),
62  requestor_name("UNKNOWN"),
63  requested_ROBs(),
64  start_time_of_ROB_request(),
65  end_time_of_ROB_request()
66 {}
67 
68 ROBDataMonitorStruct::ROBDataMonitorStruct(const uint32_t l1_id, const std::string& req_nam="UNKNOWN")
69  :lvl1ID(l1_id),
70  requestor_name(req_nam),
71  requested_ROBs(),
72  start_time_of_ROB_request(),
73  end_time_of_ROB_request()
74 {}
75 
77  const std::vector<uint32_t>& req_robs,
78  const std::string& req_nam="UNKNOWN")
79  :lvl1ID(l1_id),
80  requestor_name(req_nam),
81  start_time_of_ROB_request(),
82  end_time_of_ROB_request()
83 {
84  for (uint32_t rob : req_robs) {
86  }
87 }
88 
90  return requested_ROBs.size();
91 }
92 
94  ptrdiff_t ret=0;
95  for (const auto& p : requested_ROBs) {
96  if (p.second.isUnclassified()) ++ret;
97  }
98  return ret;
99 }
100 
102  ptrdiff_t ret=0;
103  for (const auto& p : requested_ROBs) {
104  if (p.second.isHLTCached()) ++ret;
105  }
106  return ret;
107 }
108 
110  ptrdiff_t ret=0;
111  for (const auto& p : requested_ROBs) {
112  if (p.second.isDCMCached()) ++ret;
113  }
114  return ret;
115 }
116 
118  ptrdiff_t ret=0;
119  for (const auto& p : requested_ROBs) {
120  if (p.second.isRetrieved()) ++ret;
121  }
122  return ret;
123 }
124 
126  ptrdiff_t ret=0;
127  for (const auto& p : requested_ROBs) {
128  if (p.second.isIgnored()) ++ret;
129  }
130  return ret;
131 }
132 
134  ptrdiff_t ret=0;
135  for (const auto& p : requested_ROBs) {
136  if (p.second.isUndefined()) ++ret;
137  }
138  return ret;
139 }
140 
142  ptrdiff_t ret=0;
143  for (const auto& p : requested_ROBs) {
144  if (p.second.isStatusOk()) ++ret;
145  }
146  return ret;
147 }
148 
150  int secs = 0 ;
152  secs = end_time_of_ROB_request.tv_sec - start_time_of_ROB_request.tv_sec;
153 
154  int usecs = end_time_of_ROB_request.tv_usec - start_time_of_ROB_request.tv_usec;
155  return static_cast<float>(secs)*1000 + static_cast<float>(usecs)/1000;
156 }
robmonitor::ROBDataMonitorStruct::retrievedROBs
unsigned retrievedROBs() const
number of retrieved ROBs in structure
Definition: ROBDataMonitor.cxx:117
robmonitor::UNDEFINED
@ UNDEFINED
Definition: ROBDataMonitor.h:32
robmonitor::ROBDataMonitorStruct::ROBDataMonitorStruct
ROBDataMonitorStruct()
default constructor
Definition: ROBDataMonitor.cxx:60
robmonitor::ROBDataMonitorStruct::start_time_of_ROB_request
struct timeval start_time_of_ROB_request
Definition: ROBDataMonitor.h:114
robmonitor::ROBDataMonitorStruct::ignoredROBs
unsigned ignoredROBs() const
number of ignored ROBs in structure
Definition: ROBDataMonitor.cxx:125
robmonitor::ROBDataStruct
A structure with data about ROB properties.
Definition: ROBDataMonitor.h:39
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
robmonitor::DCM_CACHED
@ DCM_CACHED
Definition: ROBDataMonitor.h:30
robmonitor::ROBDataMonitorStruct::HLTcachedROBs
unsigned HLTcachedROBs() const
number of ROBDataProviderSvc cached ROBs in structure
Definition: ROBDataMonitor.cxx:101
robmonitor::ROBDataStruct::isIgnored
bool isIgnored() const
ROB was ignored.
Definition: ROBDataMonitor.cxx:44
ROBDataMonitor.h
robmonitor::ROBDataStruct::isStatusOk
bool isStatusOk() const
ROB has no status words set.
Definition: ROBDataMonitor.cxx:52
robmonitor::ROBDataMonitorStruct::DCMcachedROBs
unsigned DCMcachedROBs() const
number of DCM cached ROBs in structure
Definition: ROBDataMonitor.cxx:109
robmonitor::ROBDataMonitorStruct::elapsedTime
float elapsedTime() const
elapsed time for ROB request in [ms]
Definition: ROBDataMonitor.cxx:149
robmonitor::ROBDataStruct::isDCMCached
bool isDCMCached() const
ROB was found in DCM cache.
Definition: ROBDataMonitor.cxx:36
robmonitor::IGNORED
@ IGNORED
Definition: ROBDataMonitor.h:31
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
robmonitor::ROBDataStruct::isUndefined
bool isUndefined() const
ROB was not enabled.
Definition: ROBDataMonitor.cxx:48
robmonitor::ROBDataMonitorStruct::undefinedROBs
unsigned undefinedROBs() const
number of undefined ROBs in structure
Definition: ROBDataMonitor.cxx:133
robmonitor::ROBDataStruct::ROBDataStruct
ROBDataStruct()
default constructor
Definition: ROBDataMonitor.cxx:14
robmonitor::ROBDataStruct::rob_status_word
uint32_t rob_status_word
Definition: ROBDataMonitor.h:54
robmonitor::ROBDataStruct::rob_history
robmonitor::ROBHistory rob_history
Definition: ROBDataMonitor.h:53
robmonitor::ROBDataStruct::isHLTCached
bool isHLTCached() const
ROB was found in ROBDataProviderSvc cache.
Definition: ROBDataMonitor.cxx:32
robmonitor::ROBDataMonitorStruct::statusOkROBs
unsigned statusOkROBs() const
number of ROBs with no status words set in structure
Definition: ROBDataMonitor.cxx:141
robmonitor
Definition: ROBDataMonitor.h:21
robmonitor::ROBDataStruct::isUnclassified
bool isUnclassified() const
ROB is unclassified.
Definition: ROBDataMonitor.cxx:28
robmonitor::RETRIEVED
@ RETRIEVED
Definition: ROBDataMonitor.h:28
robmonitor::HLT_CACHED
@ HLT_CACHED
Definition: ROBDataMonitor.h:29
robmonitor::ROBDataMonitorStruct::requested_ROBs
std::map< const uint32_t, robmonitor::ROBDataStruct > requested_ROBs
Definition: ROBDataMonitor.h:111
robmonitor::ROBDataMonitorStruct::unclassifiedROBs
unsigned unclassifiedROBs() const
number of unclassified ROBs in structure
Definition: ROBDataMonitor.cxx:93
robmonitor::ROBDataMonitorStruct::end_time_of_ROB_request
struct timeval end_time_of_ROB_request
Definition: ROBDataMonitor.h:115
robmonitor::UNCLASSIFIED
@ UNCLASSIFIED
Definition: ROBDataMonitor.h:27
robmonitor::ROBDataStruct::isRetrieved
bool isRetrieved() const
ROB was retrieved over network.
Definition: ROBDataMonitor.cxx:40
robmonitor::ROBDataMonitorStruct::allROBs
unsigned allROBs() const
number of ROBs in structure
Definition: ROBDataMonitor.cxx:89