ATLAS Offline Software
TrigMonChain.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_CHAIN_H
6 #define TRIGMON_CHAIN_H
7 
15 // Framework
16 #include "AthenaKernel/CLASS_DEF.h"
17 
18 // C/C++
19 #include <stdint.h>
20 
21 // Local
24 
26 {
27  public:
28 
29  enum Decision {
30  kReset = 0x0,
31  kPassed = 0x010000,
32  kPassedRaw = 0x020000,
33  kPassedThrough = 0x040000,
34  kResurrected = 0x080000,
35  kPrescaled = 0x100000,
36  kL1AfterVeto = 0x200000,
37  kL1BeforePrescale = 0x400000,
38  kL1AfterPrescale = 0x800000,
39  kExpressStream = 0x1000000
40  };
41 
42  TrigMonChain(unsigned int encoded = 0);
43  TrigMonChain(unsigned int level, unsigned int counter);
44  TrigMonChain(const std::string &level, unsigned int counter);
46 
48  void addTimer(float timer);
49  void addVar(const TrigMonVar &var);
50 
51  uint16_t getCounter() const;
52  uint16_t getLevel() const;
53  uint16_t getEncodedId() const;
54  uint32_t getEncoded() const { return m_encoded; }
55 
56  float getTimer() const;
57 
58  bool isPassed(Decision value = kPassed) const;
59 
60  const std::vector<TrigMonVar> getVar() const;
61  const std::vector<uint16_t>& getVarKey() const { return m_var_key; }
62  const std::vector<float>& getVarVal() const { return m_var_val; }
63 
64  void print(std::ostream &os = std::cout) const;
65 
66  private:
67 
68  uint32_t m_encoded; // Encoded chain word (see below)
69  std::vector<uint16_t> m_var_key; // Variable key
70  std::vector<float> m_var_val; // Variable value
71 };
72 
73 std::string str(const TrigMonChain &);
74 
75 //
76 // m_encoded stores encoded trigger id and decisions
77 //
78 // m_encoded 16 low bits:
79 // chain level [l] 2 bits (0:3) = 1 (L1), 2 (L2), 3 (EF)
80 // chain counter [c] 14 bits (0:16384)
81 //
82 // m_encoded 16 top bits:
83 // chain decision [d] 9 bits packed with Decision enums
84 // [f] 7 bits are free
85 //
86 
87 //
88 // Inlined member and global functions
89 //
90 inline bool operator==(const TrigMonChain &lhs, const TrigMonChain &rhs) {
91  return lhs.getEncodedId() == rhs.getEncodedId();
92 }
93 inline bool operator <(const TrigMonChain &lhs, const TrigMonChain &rhs) {
94  return lhs.getEncodedId() < rhs.getEncodedId();
95 }
96 
97 inline bool operator==(const TrigMonChain &d, const TrigConfChain &c) {
98  return d.getEncodedId() == c.getEncodedId();
99 }
100 inline bool operator==(const TrigConfChain &c, const TrigMonChain &d) {
101  return d.getEncodedId() == c.getEncodedId();
102 }
103 
104 inline bool operator==(const TrigMonChain &d, unsigned int i) {
105  return d.getEncodedId() == i;
106 }
107 inline bool operator==(unsigned int i, const TrigMonChain &d) {
108  return i == d.getEncodedId();
109 }
110 
111 CLASS_DEF( TrigMonChain , 261329711 , 1 )
112 
113 #endif
TrigMonChain::getVarKey
const std::vector< uint16_t > & getVarKey() const
Definition: TrigMonChain.h:61
str
std::string str(const TrigMonChain &)
Definition: TrigMonChain.cxx:149
beamspotnt.var
var
Definition: bin/beamspotnt.py:1394
TrigMonChain::kPassed
@ kPassed
Definition: TrigMonChain.h:31
TrigMonChain::TrigMonChain
TrigMonChain(unsigned int encoded=0)
Definition: TrigMonChain.cxx:18
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
hist_file_dump.d
d
Definition: hist_file_dump.py:137
TrigMonChain::m_var_key
std::vector< uint16_t > m_var_key
Definition: TrigMonChain.h:69
TrigMonVar.h
TrigMonChain::kL1AfterPrescale
@ kL1AfterPrescale
Definition: TrigMonChain.h:38
TrigMonChain::kPassedThrough
@ kPassedThrough
Definition: TrigMonChain.h:33
TrigMonChain::addVar
void addVar(const TrigMonVar &var)
Definition: TrigMonChain.cxx:62
TrigMonChain::getEncodedId
uint16_t getEncodedId() const
Definition: TrigMonChain.cxx:74
athena.value
value
Definition: athena.py:122
TrigMonChain::print
void print(std::ostream &os=std::cout) const
Definition: TrigMonChain.cxx:143
TrigMonChain::kL1AfterVeto
@ kL1AfterVeto
Definition: TrigMonChain.h:36
TrigMonChain::kPrescaled
@ kPrescaled
Definition: TrigMonChain.h:35
TrigMonChain::getLevel
uint16_t getLevel() const
Definition: TrigMonChain.cxx:42
python.utils.AtlRunQueryTimer.timer
def timer(name, disabled=False)
Definition: AtlRunQueryTimer.py:86
operator<
bool operator<(const TrigMonChain &lhs, const TrigMonChain &rhs)
Definition: TrigMonChain.h:93
python.iconfTool.models.loaders.level
level
Definition: loaders.py:20
TrigMonChain::kReset
@ kReset
Definition: TrigMonChain.h:30
xAOD::uint16_t
setWord1 uint16_t
Definition: eFexEMRoI_v1.cxx:88
TrigConfChain
Definition: TrigConfChain.h:32
lumiFormat.i
int i
Definition: lumiFormat.py:92
TrigConfChain.h
TrigMonChain::kL1BeforePrescale
@ kL1BeforePrescale
Definition: TrigMonChain.h:37
TrigMonChain::getVarVal
const std::vector< float > & getVarVal() const
Definition: TrigMonChain.h:62
TrigMonVar
Definition: TrigMonVar.h:59
TrigMonChain::Decision
Decision
Definition: TrigMonChain.h:29
operator==
bool operator==(const TrigMonChain &lhs, const TrigMonChain &rhs)
Definition: TrigMonChain.h:90
TrigMonChain::~TrigMonChain
~TrigMonChain()
Definition: TrigMonChain.h:45
TrigMonChain::kResurrected
@ kResurrected
Definition: TrigMonChain.h:34
ReadFromCoolCompare.os
os
Definition: ReadFromCoolCompare.py:231
TrigMonChain::getEncoded
uint32_t getEncoded() const
Definition: TrigMonChain.h:54
TrigMonChain::addTimer
void addTimer(float timer)
Definition: TrigMonChain.cxx:83
TrigMonChain::getTimer
float getTimer() const
Definition: TrigMonChain.cxx:93
TrigMonChain::kExpressStream
@ kExpressStream
Definition: TrigMonChain.h:39
TrigMonChain::getVar
const std::vector< TrigMonVar > getVar() const
Definition: TrigMonChain.cxx:121
TrigMonChain
Summary of chain decisions.
Definition: TrigMonChain.h:26
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
TrigMonChain::isPassed
bool isPassed(Decision value=kPassed) const
Definition: TrigMonChain.cxx:112
TrigMonChain::kPassedRaw
@ kPassedRaw
Definition: TrigMonChain.h:32
TrigMonChain::getCounter
uint16_t getCounter() const
Definition: TrigMonChain.cxx:36
test_pyathena.counter
counter
Definition: test_pyathena.py:15
TrigMonChain::addDecision
void addDecision(Decision value)
Definition: TrigMonChain.cxx:48
python.compressB64.c
def c
Definition: compressB64.py:93
CLASS_DEF.h
macros to associate a CLID to a type
TrigMonChain::m_var_val
std::vector< float > m_var_val
Definition: TrigMonChain.h:70
TrigMonChain::m_encoded
uint32_t m_encoded
Definition: TrigMonChain.h:68