ATLAS Offline Software
TrigMonROBData.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef TRIGMON_ROBDATA_H
6 #define TRIGMON_ROBDATA_H
7 
8 /*
9  @author Rustem Ospanov
10  @date July 2009
11 
12  @brief Summary of ROB data unit.
13  This is class can have two versions:
14  a) summary of multiple ROBDataStruct structures,
15  where rob ids with same status and history are added together;
16  b) rob ids are erased to reduce memory footprint.
17 */
18 
19 // Framework
20 #include "AthenaKernel/CLASS_DEF.h"
21 
22 // C/C++
23 #include <stdint.h>
24 #include <iostream>
25 
27 {
28  public:
29 
30  enum History {
31  kUNCLASSIFIED = 0, // ROB was requested but never arrived at processor. History unknown.
32  kRETRIEVED = 1, // ROB was retrieved from ROS by DataCollector
33  kCACHED = 2, // ROB was found already in the internal cache of the ROBDataProviderSvc
34  kIGNORED = 4, // ROB was on the "ignore" list and therefore not retrieved
35  kDISABLED = 8 // ROB was disabled in OKS and therefore not retrieved
36  };
37  enum Status {
38  kUNKNOWN = 0x0, // ROB status was unknown (default)
39  kPREFETCH = 0x40, // ROB was prefetched
40  kOK = 0x80 // ROB is StatusOk
41  };
42 
44  TrigMonROBData(uint32_t rob_id, uint32_t rob_size);
46 
47  void setHistory(History hist);
48  void setStatusOK();
49  void setStatusPREFETCH();
50 
51  bool isUnclassified() const { return getHistory() == kUNCLASSIFIED; }
52  bool isCached() const { return getHistory() == kCACHED; }
53  bool isRetrieved() const { return getHistory() == kRETRIEVED; }
54  bool isIgnored() const { return getHistory() == kIGNORED; }
55  bool isDisabled() const { return getHistory() == kDISABLED; }
56  bool isStatusOk() const;
57  bool isStatusPrefetched() const;
58 
59  uint32_t getROBId() const { return m_rob_id; }
60  uint32_t getROBSize() const;
61  uint32_t getEncodedState() const;
62  History getHistory() const;
63  Status getStatus() const;
64 
65  void print(std::ostream &os = std::cout) const;
66 
67  private:
68  friend class TrigMonROBDataCnv_p1;
69  friend class TrigMonROBDataCnv_p2;
70 
71  uint32_t m_rob_id; // ROB source id
72  uint32_t m_word; // Size, history enum and status enum
73 };
74 
75 std::string str(const TrigMonROBData &);
76 
77 //
78 // m_word stores history and state enums
79 //
80 // 8 low bits: sssshhhh
81 // history [h] 4 low bits
82 // state [s] 4 top bits
83 // 24 top bits: rob data size
84 //
85 
86 namespace Trig
87 {
90 
93 }
94 
95 CLASS_DEF( TrigMonROBData , 174340367 , 1 )
96 
97 #endif
TrigMonROBDataCnv_p1
Definition: TrigMonROBDataCnv_p1.h:16
Trig::getROBStatus
TrigMonROBData::Status getROBStatus(unsigned int val)
Definition: TrigMonROBData.cxx:155
Trig
The common trigger namespace for trigger analysis tools.
Definition: CaloTowerVecMon.h:44
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
Trig::AsStringROBStatus
std::string AsStringROBStatus(TrigMonROBData::Status stat)
plotmaker.hist
hist
Definition: plotmaker.py:148
TrigMonROBData::setHistory
void setHistory(History hist)
Definition: TrigMonROBData.cxx:44
TrigMonROBData::getEncodedState
uint32_t getEncodedState() const
Definition: TrigMonROBData.cxx:99
TrigMonROBData::getROBId
uint32_t getROBId() const
Definition: TrigMonROBData.h:59
TrigMonROBData::getROBSize
uint32_t getROBSize() const
Definition: TrigMonROBData.cxx:90
TrigMonROBData::isRetrieved
bool isRetrieved() const
Definition: TrigMonROBData.h:53
TrigMonROBData::Status
Status
Definition: TrigMonROBData.h:37
TrigMonROBData::kCACHED
@ kCACHED
Definition: TrigMonROBData.h:33
TrigMonROBData::History
History
Definition: TrigMonROBData.h:30
TrigMonROBData::isCached
bool isCached() const
Definition: TrigMonROBData.h:52
TrigMonROBData::TrigMonROBData
TrigMonROBData()
Definition: TrigMonROBData.cxx:23
TrigMonROBData::isUnclassified
bool isUnclassified() const
Definition: TrigMonROBData.h:51
TrigMonROBData::print
void print(std::ostream &os=std::cout) const
Definition: TrigMonROBData.cxx:126
TrigMonROBData::setStatusPREFETCH
void setStatusPREFETCH()
Definition: TrigMonROBData.cxx:63
Trig::AsStringROBHistory
std::string AsStringROBHistory(TrigMonROBData::History hist)
Definition: TrigMonROBData.cxx:166
TrigMonROBData::kDISABLED
@ kDISABLED
Definition: TrigMonROBData.h:35
TrigMonROBData::m_rob_id
uint32_t m_rob_id
Definition: TrigMonROBData.h:71
TrigMonROBData::setStatusOK
void setStatusOK()
Definition: TrigMonROBData.cxx:54
TrigMonROBData
Definition: TrigMonROBData.h:27
TrigMonROBData::isStatusOk
bool isStatusOk() const
Definition: TrigMonROBData.cxx:72
TrigMonROBData::kUNCLASSIFIED
@ kUNCLASSIFIED
Definition: TrigMonROBData.h:31
beamspotman.stat
stat
Definition: beamspotman.py:266
ReadFromCoolCompare.os
os
Definition: ReadFromCoolCompare.py:231
TrigMonROBData::getHistory
History getHistory() const
Definition: TrigMonROBData.cxx:108
TrigMonROBData::kRETRIEVED
@ kRETRIEVED
Definition: TrigMonROBData.h:32
TrigMonROBData::getStatus
Status getStatus() const
Definition: TrigMonROBData.cxx:117
TrigMonROBData::kPREFETCH
@ kPREFETCH
Definition: TrigMonROBData.h:39
str
std::string str(const TrigMonROBData &)
Definition: TrigMonROBData.cxx:132
Trig::getROBHistory
TrigMonROBData::History getROBHistory(unsigned int val)
Definition: TrigMonROBData.cxx:142
TrigMonROBData::kOK
@ kOK
Definition: TrigMonROBData.h:40
TrigMonROBData::~TrigMonROBData
~TrigMonROBData()
Definition: TrigMonROBData.h:45
TrigMonROBData::m_word
uint32_t m_word
Definition: TrigMonROBData.h:72
TrigMonROBData::isStatusPrefetched
bool isStatusPrefetched() const
Definition: TrigMonROBData.cxx:81
Pythia8_RapidityOrderMPI.val
val
Definition: Pythia8_RapidityOrderMPI.py:14
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
TrigMonROBDataCnv_p2
Definition: TrigMonROBDataCnv_p2.h:16
TrigMonROBData::kIGNORED
@ kIGNORED
Definition: TrigMonROBData.h:34
TrigMonROBData::isIgnored
bool isIgnored() const
Definition: TrigMonROBData.h:54
TrigMonROBData::isDisabled
bool isDisabled() const
Definition: TrigMonROBData.h:55
CLASS_DEF.h
macros to associate a CLID to a type
TrigMonROBData::kUNKNOWN
@ kUNKNOWN
Definition: TrigMonROBData.h:38