ATLAS Offline Software
Loading...
Searching...
No Matches
TrigMonSeq.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_SEQ_H
6#define TRIGMON_SEQ_H
7
8/*
9 @author Rustem Ospanov
10 @date July 2009
11
12 @brief Summary of sequence execution.
13*/
14
15// Framework
17
18// C/C++
19#include <vector>
20
21// Local
26
28{
29 public:
30
31 enum State {
32 kUnknown = 0x0, // Default state
33 kInitial = 0x010000, // Initialization of sequence execution
34 kStart = 0x020000, // Start running algorithms
35 kAlreadyExecuted = 0x040000, // Sequence (TE) was cached
36 kPrevious = 0x080000 // Sequence was executed by other sequence
37 };
38
39 TrigMonSeq();
40 explicit TrigMonSeq(uint32_t encoded);
41 TrigMonSeq(const TrigConfChain &chn, const TrigConfSeq &seq);
43
44 void addAlg (const TrigMonAlg &alg) { m_alg.push_back(alg); }
45 void addVar (const TrigMonVar &var);
46 void addTimer(float timer);
47 void addState(State value);
48
49 bool isInitial() const;
50 bool isExecuted() const;
51 bool isAlreadyExecuted() const;
52 bool isPrevious() const;
53
54 uint16_t getLevel() const;
55 uint16_t getChnCounter() const;
56 uint16_t getChnEncodedId() const;
57 uint16_t getSeqIndex() const;
58 uint32_t getEncoded() const { return m_encoded; }
59
60 float getSeqTimer() const;
61 double getAlgTimer() const;
62
63 std::vector<TrigMonAlg>& getAlg() { return m_alg; }
64 const std::vector<TrigMonAlg>& getAlg() const { return m_alg; }
65 const std::vector<TrigMonVar> getVar() const;
66
67 const std::vector<uint16_t>& getVarKey() const { return m_var_key; }
68 const std::vector<float>& getVarVal() const { return m_var_val; }
69
70 void print(const TrigConfSeq &confg, std::ostream &os = std::cout) const;
71
72 private:
73 friend class TrigMonSeqCnv_p1;
74
75 uint32_t m_encoded; // Encoded data (see below)
76 std::vector<TrigMonAlg> m_alg; // Algorithm execution and/or caching records
77 std::vector<uint16_t> m_var_key; // Variable key
78 std::vector<float> m_var_val; // Variable value
79};
80
81//
82// m_encoded stores chain encoded id, seq index and seq state
83//
84// m_encoded low 16 bits:
85// 16 bits chain encoded id (see TrigConfChain.h)
86
87// m_encoded top 16 bits:
88//
89// seq state [s] 4 bits (0:4) State num bits
90// seq index [i] 12 bits (0:4,096) Number of configured sequences
91//
92
93inline bool operator==(const TrigMonSeq &lhs, const TrigMonSeq &rhs) {
94 return (lhs.getSeqIndex() == rhs.getSeqIndex());
95}
96inline bool operator!=(const TrigMonSeq &lhs, const TrigMonSeq &rhs) {
97 return !(lhs == rhs);
98}
99inline bool operator<(const TrigMonSeq &lhs, const TrigMonSeq &rhs) {
100 return lhs.getSeqIndex() < rhs.getSeqIndex();
101}
102
103inline bool operator==(const TrigMonSeq &entry, const TrigConfSeq &confg) {
104 return entry.getSeqIndex() == confg.getIndex();
105}
106inline bool operator==(const TrigConfSeq &confg, const TrigMonSeq &entry) {
107 return entry.getSeqIndex() == confg.getIndex();
108}
109inline bool operator==(const TrigMonSeq &entry, const TrigConfChain &confg) {
110 return entry.getChnEncodedId() == confg.getEncodedId();
111}
112inline bool operator==(const TrigConfChain &confg, const TrigMonSeq &entry) {
113 return entry.getChnEncodedId() == confg.getEncodedId();
114}
115
116CLASS_DEF( TrigMonSeq , 81476271 , 1 )
117
118#endif
macros to associate a CLID to a type
#define CLASS_DEF(NAME, CID, VERSION)
associate a clid and a version to a type eg
bool operator!=(const TrigMonSeq &lhs, const TrigMonSeq &rhs)
Definition TrigMonSeq.h:96
bool operator==(const TrigMonSeq &lhs, const TrigMonSeq &rhs)
Definition TrigMonSeq.h:93
bool operator<(const TrigMonSeq &lhs, const TrigMonSeq &rhs)
Definition TrigMonSeq.h:99
uint16_t getEncodedId() const
uint16_t getIndex() const
Definition TrigConfSeq.h:42
Summary of single agorithm execution. Algorithm is identified by position within parent sequence....
Definition TrigMonAlg.h:30
std::vector< uint16_t > m_var_key
Definition TrigMonSeq.h:77
uint32_t m_encoded
Definition TrigMonSeq.h:75
uint16_t getSeqIndex() const
std::vector< TrigMonAlg > m_alg
Definition TrigMonSeq.h:76
std::vector< TrigMonAlg > & getAlg()
Definition TrigMonSeq.h:63
bool isPrevious() const
uint16_t getChnEncodedId() const
double getAlgTimer() const
bool isExecuted() const
void addState(State value)
const std::vector< TrigMonAlg > & getAlg() const
Definition TrigMonSeq.h:64
void addTimer(float timer)
const std::vector< TrigMonVar > getVar() const
const std::vector< uint16_t > & getVarKey() const
Definition TrigMonSeq.h:67
void print(const TrigConfSeq &confg, std::ostream &os=std::cout) const
const std::vector< float > & getVarVal() const
Definition TrigMonSeq.h:68
float getSeqTimer() const
uint32_t getEncoded() const
Definition TrigMonSeq.h:58
void addVar(const TrigMonVar &var)
void addAlg(const TrigMonAlg &alg)
Definition TrigMonSeq.h:44
bool isInitial() const
bool isAlreadyExecuted() const
uint16_t getChnCounter() const
std::vector< float > m_var_val
Definition TrigMonSeq.h:78
uint16_t getLevel() const
friend class TrigMonSeqCnv_p1
Definition TrigMonSeq.h:73
@ kAlreadyExecuted
Definition TrigMonSeq.h:35