ATLAS Offline Software
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
16 #include "AthenaKernel/CLASS_DEF.h"
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 
93 inline bool operator==(const TrigMonSeq &lhs, const TrigMonSeq &rhs) {
94  return (lhs.getSeqIndex() == rhs.getSeqIndex());
95 }
96 inline bool operator!=(const TrigMonSeq &lhs, const TrigMonSeq &rhs) {
97  return !(lhs == rhs);
98 }
99 inline bool operator<(const TrigMonSeq &lhs, const TrigMonSeq &rhs) {
100  return lhs.getSeqIndex() < rhs.getSeqIndex();
101 }
102 
103 inline bool operator==(const TrigMonSeq &entry, const TrigConfSeq &confg) {
104  return entry.getSeqIndex() == confg.getIndex();
105 }
106 inline bool operator==(const TrigConfSeq &confg, const TrigMonSeq &entry) {
107  return entry.getSeqIndex() == confg.getIndex();
108 }
109 inline bool operator==(const TrigMonSeq &entry, const TrigConfChain &confg) {
110  return entry.getChnEncodedId() == confg.getEncodedId();
111 }
112 inline bool operator==(const TrigConfChain &confg, const TrigMonSeq &entry) {
113  return entry.getChnEncodedId() == confg.getEncodedId();
114 }
115 
116 CLASS_DEF( TrigMonSeq , 81476271 , 1 )
117 
118 #endif
test_athena_ntuple_filter.seq
seq
filter configuration ## -> we use the special sequence 'AthMasterSeq' which is run before any other a...
Definition: test_athena_ntuple_filter.py:18
TrigMonSeqCnv_p1
Definition: TrigMonSeqCnv_p1.h:21
TrigMonSeq::getAlg
std::vector< TrigMonAlg > & getAlg()
Definition: TrigMonSeq.h:63
operator!=
bool operator!=(const TrigMonSeq &lhs, const TrigMonSeq &rhs)
Definition: TrigMonSeq.h:96
beamspotnt.var
var
Definition: bin/beamspotnt.py:1394
TrigMonSeq::kUnknown
@ kUnknown
Definition: TrigMonSeq.h:32
operator==
bool operator==(const TrigMonSeq &lhs, const TrigMonSeq &rhs)
Definition: TrigMonSeq.h:93
SGout2dot.alg
alg
Definition: SGout2dot.py:243
TrigMonSeq::print
void print(const TrigConfSeq &confg, std::ostream &os=std::cout) const
Definition: TrigMonSeq.cxx:213
TrigMonSeq::kStart
@ kStart
Definition: TrigMonSeq.h:34
TrigMonSeq::getVarVal
const std::vector< float > & getVarVal() const
Definition: TrigMonSeq.h:68
TrigMonSeq::getSeqIndex
uint16_t getSeqIndex() const
Definition: TrigMonSeq.cxx:143
TrigConfChain::getEncodedId
uint16_t getEncodedId() const
Definition: TrigConfChain.cxx:151
TrigMonSeq::getLevel
uint16_t getLevel() const
Definition: TrigMonSeq.cxx:122
TrigMonSeq::getVar
const std::vector< TrigMonVar > getVar() const
Definition: TrigMonSeq.cxx:189
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
TrigMonSeq::kPrevious
@ kPrevious
Definition: TrigMonSeq.h:36
TrigMonSeq::~TrigMonSeq
~TrigMonSeq()
Definition: TrigMonSeq.h:42
TrigMonSeq::isInitial
bool isInitial() const
Definition: TrigMonSeq.cxx:86
TrigMonVar.h
TrigMonSeq::getVarKey
const std::vector< uint16_t > & getVarKey() const
Definition: TrigMonSeq.h:67
athena.value
value
Definition: athena.py:124
TrigMonSeq::kAlreadyExecuted
@ kAlreadyExecuted
Definition: TrigMonSeq.h:35
python.utils.AtlRunQueryTimer.timer
def timer(name, disabled=False)
Definition: AtlRunQueryTimer.py:86
TrigMonSeq::addAlg
void addAlg(const TrigMonAlg &alg)
Definition: TrigMonSeq.h:44
operator<
bool operator<(const TrigMonSeq &lhs, const TrigMonSeq &rhs)
Definition: TrigMonSeq.h:99
TrigMonSeq::State
State
Definition: TrigMonSeq.h:31
TrigMonSeq::m_var_key
std::vector< uint16_t > m_var_key
Definition: TrigMonSeq.h:77
TrigMonSeq::isExecuted
bool isExecuted() const
Definition: TrigMonSeq.cxx:95
TrigMonSeq::kInitial
@ kInitial
Definition: TrigMonSeq.h:33
xAOD::uint16_t
setWord1 uint16_t
Definition: eFexEMRoI_v1.cxx:93
TrigConfChain
Definition: TrigConfChain.h:32
TrigConfSeq.h
TrigConfChain.h
TrigMonSeq::getEncoded
uint32_t getEncoded() const
Definition: TrigMonSeq.h:58
TrigConfSeq
Definition: TrigConfSeq.h:29
TrigMonVar
Definition: TrigMonVar.h:59
TrigMonSeq::getAlg
const std::vector< TrigMonAlg > & getAlg() const
Definition: TrigMonSeq.h:64
TrigMonSeq
Definition: TrigMonSeq.h:28
TrigConfSeq::getIndex
uint16_t getIndex() const
Definition: TrigConfSeq.h:42
TrigMonSeq::getChnEncodedId
uint16_t getChnEncodedId() const
Definition: TrigMonSeq.cxx:134
ReadFromCoolCompare.os
os
Definition: ReadFromCoolCompare.py:231
TrigMonSeq::m_var_val
std::vector< float > m_var_val
Definition: TrigMonSeq.h:78
GetAllXsec.entry
list entry
Definition: GetAllXsec.py:132
TrigMonAlg.h
TrigMonSeq::m_encoded
uint32_t m_encoded
Definition: TrigMonSeq.h:75
TrigMonSeq::getSeqTimer
float getSeqTimer() const
Definition: TrigMonSeq.cxx:170
TrigMonSeq::addTimer
void addTimer(float timer)
Definition: TrigMonSeq.cxx:67
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
TrigMonSeq::getChnCounter
uint16_t getChnCounter() const
Definition: TrigMonSeq.cxx:128
TrigMonSeq::m_alg
std::vector< TrigMonAlg > m_alg
Definition: TrigMonSeq.h:76
TrigMonAlg
Summary of single agorithm execution. Algorithm is identified by position within parent sequence....
Definition: TrigMonAlg.h:30
TrigMonSeq::isAlreadyExecuted
bool isAlreadyExecuted() const
Definition: TrigMonSeq.cxx:104
TrigMonSeq::TrigMonSeq
TrigMonSeq()
Definition: TrigMonSeq.cxx:25
TrigMonSeq::addState
void addState(State value)
Definition: TrigMonSeq.cxx:77
TrigMonSeq::isPrevious
bool isPrevious() const
Definition: TrigMonSeq.cxx:113
CLASS_DEF.h
macros to associate a CLID to a type
TrigMonSeq::addVar
void addVar(const TrigMonVar &var)
Definition: TrigMonSeq.cxx:55
TrigMonSeq::getAlgTimer
double getAlgTimer() const
Definition: TrigMonSeq.cxx:156