ATLAS Offline Software
TrigMonROB.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef TRIGMON_ROB_H
6 #define TRIGMON_ROB_H
7 
8 /*
9  @author Rustem Ospanov
10  @date July 2009
11 
12  @brief Summary of single request for ROB data.
13  This is a reduced copy of ROBDataMonitorStruct.
14 */
15 
16 // Framework
17 #include "AthenaKernel/CLASS_DEF.h"
18 
19 // C/C++
20 #include <stdint.h>
21 #include <iostream>
22 #include <vector>
23 
24 // Local
28 
30 {
31  public:
32 
33  TrigMonROB();
34  TrigMonROB(uint32_t requestor_id,
35  long int beg_sec, long int beg_usec,
36  long int end_sec, long int end_usec);
38 
39  void addData(const TrigMonROBData &data) { m_data.push_back(data); }
40  void addWord(const uint32_t word) { m_word.push_back(word); }
41 
42  std::vector<TrigMonROBData>& getData() { return m_data; }
43  std::vector<uint32_t>& getWord() { return m_word; }
44 
45  uint32_t getRequestorId() const { return m_word[0]; }
46  double getTimer() const { return elapsed(); }
47  double elapsed() const { return stop().getElapsed(start()); }
48 
49  const TrigMonTimer start() const { return TrigMonTimer(getStart()); }
50  const TrigMonTimer stop() const { return TrigMonTimer(getStop()); }
51 
52  const std::vector<TrigMonROBData>& getData() const { return m_data; }
53  const std::vector<TrigMonROBSum> getSum() const;
54 
55  uint32_t getStart() const { return m_word[1]; }
56  uint32_t getStop() const { return m_word[2]; }
57 
58  const std::vector<uint32_t>& getWord() const { return m_word; }
59 
60  void print(std::ostream &os = std::cout) const;
61 
62  private:
63 
64  std::vector<uint32_t> m_word; // Data payload (see below)
65  std::vector<TrigMonROBData> m_data; // Full data for requested robs
66 };
67 
68 //
69 // m_word[0] = Hash id of requesting algorithm name
70 // m_word[1] = Encoded TrigMonTimer for start time
71 // m_word[2] = Encoded TrigMonTimer for stop time
72 // m_word[i] = Encoded words for TrigMonROBSum, i = 3,...
73 //
74 
75 std::string str(const TrigMonROB &);
76 
77 //
78 // Inlined comparison operators
79 //
80 inline bool operator==(const TrigMonROB &lhs, const TrigMonROB &rhs) {
81  return lhs.getRequestorId() == rhs.getRequestorId();
82 }
83 inline bool operator <(const TrigMonROB &lhs, const TrigMonROB &rhs) {
84  return lhs.getRequestorId() < rhs.getRequestorId();
85 }
86 
87 inline bool operator==(const TrigMonROB &rob, unsigned int id) {
88  return rob.getRequestorId() == id;
89 }
90 inline bool operator==(unsigned int id, const TrigMonROB &rob) {
91  return rob.getRequestorId() == id;
92 }
93 
94 CLASS_DEF( TrigMonROB , 157550435 , 1 )
95 
96 #endif
TrigMonROB::elapsed
double elapsed() const
Definition: TrigMonROB.h:47
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
TrigMonROB::m_word
std::vector< uint32_t > m_word
Definition: TrigMonROB.h:64
TrigMonROBData.h
TrigMonROB::stop
const TrigMonTimer stop() const
Definition: TrigMonROB.h:50
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
operator<
bool operator<(const TrigMonROB &lhs, const TrigMonROB &rhs)
Definition: TrigMonROB.h:83
TrigMonROBSum.h
TrigMonROB::getWord
std::vector< uint32_t > & getWord()
Definition: TrigMonROB.h:43
TrigMonROB::getSum
const std::vector< TrigMonROBSum > getSum() const
Definition: TrigMonROB.cxx:34
TrigMonROB::getData
const std::vector< TrigMonROBData > & getData() const
Definition: TrigMonROB.h:52
TrigMonROB::TrigMonROB
TrigMonROB()
Definition: TrigMonROB.cxx:16
TrigMonROB::getStop
uint32_t getStop() const
Definition: TrigMonROB.h:56
TrigMonTimer
Definition: TrigMonTimer.h:27
TrigMonROB::getWord
const std::vector< uint32_t > & getWord() const
Definition: TrigMonROB.h:58
TrigMonROB::m_data
std::vector< TrigMonROBData > m_data
Definition: TrigMonROB.h:65
TrigMonROB::print
void print(std::ostream &os=std::cout) const
Definition: TrigMonROB.cxx:49
TrigMonROB::start
const TrigMonTimer start() const
Definition: TrigMonROB.h:49
TrigMonROB
Definition: TrigMonROB.h:30
TrigMonTimer::getElapsed
double getElapsed(const TrigMonTimer &start) const
Definition: TrigMonTimer.cxx:75
TrigMonROBData
Definition: TrigMonROBData.h:27
TrigMonROB::~TrigMonROB
~TrigMonROB()
Definition: TrigMonROB.h:37
ReadFromCoolCompare.os
os
Definition: ReadFromCoolCompare.py:231
operator==
bool operator==(const TrigMonROB &lhs, const TrigMonROB &rhs)
Definition: TrigMonROB.h:80
id
SG::auxid_t id
Definition: Control/AthContainers/Root/debug.cxx:227
TrigMonROB::getTimer
double getTimer() const
Definition: TrigMonROB.h:46
TrigMonROB::getData
std::vector< TrigMonROBData > & getData()
Definition: TrigMonROB.h:42
TrigMonTimer.h
TrigMonROB::addWord
void addWord(const uint32_t word)
Definition: TrigMonROB.h:40
TrigMonROB::getStart
uint32_t getStart() const
Definition: TrigMonROB.h:55
str
std::string str(const TrigMonROB &)
Definition: TrigMonROB.cxx:55
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
TrigMonROB::getRequestorId
uint32_t getRequestorId() const
Definition: TrigMonROB.h:45
CLASS_DEF.h
macros to associate a CLID to a type
TrigMonROB::addData
void addData(const TrigMonROBData &data)
Definition: TrigMonROB.h:39