ATLAS Offline Software
Loading...
Searching...
No Matches
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
14
15// Framework
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,
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
47 void addDecision(Decision value);
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
73std::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//
90inline bool operator==(const TrigMonChain &lhs, const TrigMonChain &rhs) {
91 return lhs.getEncodedId() == rhs.getEncodedId();
92}
93inline bool operator <(const TrigMonChain &lhs, const TrigMonChain &rhs) {
94 return lhs.getEncodedId() < rhs.getEncodedId();
95}
96
97inline bool operator==(const TrigMonChain &d, const TrigConfChain &c) {
98 return d.getEncodedId() == c.getEncodedId();
99}
100inline bool operator==(const TrigConfChain &c, const TrigMonChain &d) {
101 return d.getEncodedId() == c.getEncodedId();
102}
103
104inline bool operator==(const TrigMonChain &d, unsigned int i) {
105 return d.getEncodedId() == i;
106}
107inline bool operator==(unsigned int i, const TrigMonChain &d) {
108 return i == d.getEncodedId();
109}
110
111CLASS_DEF( TrigMonChain , 261329711 , 1 )
112
113#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 TrigMonChain &lhs, const TrigMonChain &rhs)
bool operator<(const TrigMonChain &lhs, const TrigMonChain &rhs)
Summary of chain decisions.
const std::vector< TrigMonVar > getVar() const
void addVar(const TrigMonVar &var)
const std::vector< float > & getVarVal() const
uint32_t getEncoded() const
uint32_t m_encoded
bool isPassed(Decision value=kPassed) const
std::vector< float > m_var_val
float getTimer() const
TrigMonChain(unsigned int encoded=0)
uint16_t getLevel() const
uint16_t getCounter() const
void print(std::ostream &os=std::cout) const
void addDecision(Decision value)
const std::vector< uint16_t > & getVarKey() const
void addTimer(float timer)
uint16_t getEncodedId() const
std::vector< uint16_t > m_var_key