ATLAS Offline Software
ROBDataMonitor.h
Go to the documentation of this file.
1 //Dear emacs, this is -*- c++ -*-
2 
3 /*
4  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
5 */
6 
7 
8 #ifndef ROBDATAMONITOR_H
9 #define ROBDATAMONITOR_H
10 
11 #include "eformat/SourceIdentifier.h"
12 #include <iostream>
13 #include <string>
14 #include <map>
15 
17 #include "AthenaKernel/CLASS_DEF.h"
18 
19 namespace robmonitor {
20 
24  enum ROBHistory {
25  UNCLASSIFIED = 0, // ROB was requested but never arrived at processor. History unknown.
26  RETRIEVED = 1, // ROB was retrieved from ROS by DataCollector
27  HLT_CACHED = 2, // ROB was found already in the internal cache of the ROBDataProviderSvc
28  DCM_CACHED = 4, // ROB was found already in the internal cache of the DCM
29  IGNORED = 8, // ROB was on the "ignore" list and therefore not retrieved
30  UNDEFINED = 16, // ROB was not on the "enabled" list, should not happen
31  NUM_ROBHIST_CODES = 6 // number of different history codes
32  };
33 
37  class ROBDataStruct {
38  public:
39 
41  ROBDataStruct() = default;
42 
46  ROBDataStruct(const uint32_t);
47 
48  // data variables
49  uint32_t rob_id{0}; // rob source id
50  uint32_t rob_size{0}; // size of rob in words
52  uint32_t rob_status_word{0}; // last status word in the ROB header
53 
54 
55  // Accessor functions
57  bool isUnclassified() const;
59  bool isHLTCached() const;
61  bool isDCMCached() const;
63  bool isRetrieved() const;
65  bool isIgnored() const;
67  bool isUndefined() const;
69  bool isStatusOk() const;
70 
71  // Extraction operator
72  friend std::ostream& operator<<(std::ostream& os, const ROBDataStruct& rhs);
73  };
74 
80  public:
81 
83  ROBDataMonitorStruct() = default;
84 
89  ROBDataMonitorStruct(const uint32_t, const std::string&);
90 
96  ROBDataMonitorStruct(const uint32_t, const std::vector<uint32_t>&, const std::string&);
97 
99 
101 
103 
105 
106  // data variables
108  std::string requestor_name{"UNKNOWN"};
109  std::map<const uint32_t,robmonitor::ROBDataStruct> requested_ROBs;
110 
111  // Run3 TrigTimeStamp
114 
115  // Accessor functions to ROB history summaries
117  unsigned allROBs() const;
119  unsigned unclassifiedROBs() const;
121  unsigned HLTcachedROBs() const;
123  unsigned DCMcachedROBs() const;
125  unsigned retrievedROBs() const;
127  unsigned ignoredROBs() const;
129  unsigned undefinedROBs() const;
131  unsigned statusOkROBs() const;
132 
134  float elapsedTime() const;
135 
136  // Extraction operator
137  friend std::ostream& operator<<(std::ostream& os, const ROBDataMonitorStruct& rhs);
138  };
139 
140  // Extraction operators
141  std::ostream& operator<<(std::ostream& os, const ROBDataStruct& rhs);
142  std::ostream& operator<<(std::ostream& os, const ROBDataMonitorStruct& rhs);
143 
144 } // end namespace robmonitor
145 
147 
148 CLASS_DEF( ROBDataMonitorCollection , 1303465505 , 1 )
149 
150 
151 #endif /* ROBDATAMONITOR_H */
robmonitor::ROBDataMonitorStruct::retrievedROBs
unsigned retrievedROBs() const
number of retrieved ROBs in structure
Definition: ROBDataMonitor.cxx:120
robmonitor::UNDEFINED
@ UNDEFINED
Definition: ROBDataMonitor.h:30
robmonitor::ROBDataMonitorStruct::operator<<
friend std::ostream & operator<<(std::ostream &os, const ROBDataMonitorStruct &rhs)
robmonitor::ROBDataMonitorStruct
The structure which is used to monitor the ROB data request in L2 It is created for every addROBData ...
Definition: ROBDataMonitor.h:79
robmonitor::ROBDataMonitorStruct::ignoredROBs
unsigned ignoredROBs() const
number of ignored ROBs in structure
Definition: ROBDataMonitor.cxx:128
robmonitor::ROBDataStruct
A structure with data about ROB properties.
Definition: ROBDataMonitor.h:37
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
robmonitor::operator<<
std::ostream & operator<<(std::ostream &os, const ROBDataStruct &rhs)
Definition: ROBDataMonitor.cxx:46
robmonitor::ROBHistory
ROBHistory
A structure with data about ROB properties.
Definition: ROBDataMonitor.h:24
robmonitor::ROBDataMonitorStruct::ROBDataMonitorStruct
ROBDataMonitorStruct(const ROBDataMonitorStruct &)=default
robmonitor::DCM_CACHED
@ DCM_CACHED
Definition: ROBDataMonitor.h:28
robmonitor::ROBDataMonitorStruct::HLTcachedROBs
unsigned HLTcachedROBs() const
number of ROBDataProviderSvc cached ROBs in structure
Definition: ROBDataMonitor.cxx:104
robmonitor::ROBDataStruct::isIgnored
bool isIgnored() const
ROB was ignored.
Definition: ROBDataMonitor.cxx:33
robmonitor::ROBDataMonitorStruct::ROBDataMonitorStruct
ROBDataMonitorStruct(ROBDataMonitorStruct &&) noexcept=default
robmonitor::NUM_ROBHIST_CODES
@ NUM_ROBHIST_CODES
Definition: ROBDataMonitor.h:31
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:560
robmonitor::ROBDataStruct::rob_size
uint32_t rob_size
Definition: ROBDataMonitor.h:50
robmonitor::ROBDataStruct::isStatusOk
bool isStatusOk() const
ROB has no status words set.
Definition: ROBDataMonitor.cxx:41
ROBDataMonitorCollection
DataVector< robmonitor::ROBDataMonitorStruct > ROBDataMonitorCollection
Definition: ROBDataMonitor.h:146
robmonitor::ROBDataMonitorStruct::DCMcachedROBs
unsigned DCMcachedROBs() const
number of DCM cached ROBs in structure
Definition: ROBDataMonitor.cxx:112
robmonitor::ROBDataMonitorStruct::elapsedTime
float elapsedTime() const
elapsed time for ROB request in [ms]
Definition: ROBDataMonitor.cxx:152
robmonitor::ROBDataStruct::isDCMCached
bool isDCMCached() const
ROB was found in DCM cache.
Definition: ROBDataMonitor.cxx:25
robmonitor::ROBDataMonitorStruct::end_time
uint64_t end_time
start time of ROB request (microsec since epoch)
Definition: ROBDataMonitor.h:113
robmonitor::IGNORED
@ IGNORED
Definition: ROBDataMonitor.h:29
robmonitor::ROBDataStruct::isUndefined
bool isUndefined() const
ROB was not enabled.
Definition: ROBDataMonitor.cxx:37
robmonitor::ROBDataStruct::rob_id
uint32_t rob_id
Definition: ROBDataMonitor.h:49
robmonitor::ROBDataMonitorStruct::undefinedROBs
unsigned undefinedROBs() const
number of undefined ROBs in structure
Definition: ROBDataMonitor.cxx:136
robmonitor::ROBDataStruct::rob_status_word
uint32_t rob_status_word
Definition: ROBDataMonitor.h:52
robmonitor::ROBDataMonitorStruct::lvl1ID
uint32_t lvl1ID
Definition: ROBDataMonitor.h:107
xAOD::uint64_t
uint64_t
Definition: EventInfo_v1.cxx:123
robmonitor::ROBDataStruct::ROBDataStruct
ROBDataStruct()=default
default constructor
robmonitor::ROBDataStruct::rob_history
robmonitor::ROBHistory rob_history
Definition: ROBDataMonitor.h:51
robmonitor::ROBDataStruct::isHLTCached
bool isHLTCached() const
ROB was found in ROBDataProviderSvc cache.
Definition: ROBDataMonitor.cxx:21
DataVector
Derived DataVector<T>.
Definition: DataVector.h:794
robmonitor::ROBDataMonitorStruct::ROBDataMonitorStruct
ROBDataMonitorStruct()=default
default constructor
robmonitor::ROBDataStruct::operator<<
friend std::ostream & operator<<(std::ostream &os, const ROBDataStruct &rhs)
robmonitor::ROBDataMonitorStruct::statusOkROBs
unsigned statusOkROBs() const
number of ROBs with no status words set in structure
Definition: ROBDataMonitor.cxx:144
ReadFromCoolCompare.os
os
Definition: ReadFromCoolCompare.py:231
robmonitor::ROBDataMonitorStruct::start_time
uint64_t start_time
map of ROBs requested
Definition: ROBDataMonitor.h:112
robmonitor
Definition: ROBDataMonitor.h:19
robmonitor::ROBDataStruct::isUnclassified
bool isUnclassified() const
ROB is unclassified.
Definition: ROBDataMonitor.cxx:17
robmonitor::ROBDataMonitorStruct::requestor_name
std::string requestor_name
current L1 ID from L1 ROBs
Definition: ROBDataMonitor.h:108
robmonitor::RETRIEVED
@ RETRIEVED
Definition: ROBDataMonitor.h:26
DataVector.h
An STL vector of pointers that by default owns its pointed-to elements.
robmonitor::HLT_CACHED
@ HLT_CACHED
Definition: ROBDataMonitor.h:27
robmonitor::ROBDataMonitorStruct::requested_ROBs
std::map< const uint32_t, robmonitor::ROBDataStruct > requested_ROBs
name of requesting algorithm
Definition: ROBDataMonitor.h:109
robmonitor::ROBDataMonitorStruct::unclassifiedROBs
unsigned unclassifiedROBs() const
number of unclassified ROBs in structure
Definition: ROBDataMonitor.cxx:96
CLASS_DEF
#define CLASS_DEF(NAME, CID, VERSION)
associate a clid and a version to a type eg
Definition: Control/AthenaKernel/AthenaKernel/CLASS_DEF.h:64
python.CaloScaleNoiseConfig.default
default
Definition: CaloScaleNoiseConfig.py:79
CLASS_DEF.h
macros to associate a CLID to a type
robmonitor::UNCLASSIFIED
@ UNCLASSIFIED
Definition: ROBDataMonitor.h:25
robmonitor::ROBDataStruct::isRetrieved
bool isRetrieved() const
ROB was retrieved over network.
Definition: ROBDataMonitor.cxx:29
robmonitor::ROBDataMonitorStruct::allROBs
unsigned allROBs() const
stop time of ROB request (microsec since epoch)
Definition: ROBDataMonitor.cxx:92