ATLAS Offline Software
Loading...
Searching...
No Matches
TrigMonL1Item.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_L1ITEM_H
6#define TRIGMON_L1ITEM_H
7
14
15// Framework
17
18// C/C++
19#include <stdint.h>
20
21// Local
23
25{
26 public:
27
28 enum Decision {
29 kReset = 0x0,
30 kPassed = 0x6000, // not stored
31 kPrescaled = 0x5000, // not stored
32 kL1AfterVeto = 0x4000,
35 };
36
38 explicit TrigMonL1Item(uint16_t encoded);
39 ~TrigMonL1Item() = default;
40
41 void setCtpId(unsigned int ctpid);
42 void addDecision(Decision value);
43
44 uint16_t getCtpId() const;
45 uint16_t getEncoded() const { return m_encoded; }
46 uint16_t getCounter() const { return getCtpId(); }
47 uint16_t getEncodedId() const;
48
49 bool isPassed(Decision value) const;
50
53 bool isPassedAfterVeto() const { return isPassed(kL1AfterVeto); }
54 bool isPassed() const { return isPassedAfterVeto(); }
56 bool isVeto() const { return isPassedAfterPrescale() && !isPassedAfterVeto(); }
57
58 void print(std::ostream &os = std::cout) const;
59
60 private:
61
62 uint16_t m_encoded; // Encoded ctp id and decisions
63};
64
65std::string str(const TrigMonL1Item &);
66
67//
68// m_encoded stores encoded ctp id and decisions
69//
70// m_encoded = adddcccccccccccc
71//
72// ctp id [c] low 12 bits
73// decision [d] mid 3 bits
74// available [a] top 1 bit
75//
76
77//
78// Inlined member and global functions
79//
80inline uint16_t TrigMonL1Item::getEncodedId() const
81{
82 return Trig::getEncodedId(1, getCounter());
83}
84
85inline bool operator==(const TrigMonL1Item &lhs, const TrigMonL1Item &rhs) {
86 return lhs.getEncodedId() == rhs.getEncodedId();
87}
88inline bool operator <(const TrigMonL1Item &lhs, const TrigMonL1Item &rhs) {
89 return lhs.getEncodedId() < rhs.getEncodedId();
90}
91
92inline bool operator==(const TrigMonL1Item &d, const TrigConfChain &c) {
93 return d.getEncodedId() == c.getEncodedId();
94}
95inline bool operator==(const TrigConfChain &c, const TrigMonL1Item &d) {
96 return d.getEncodedId() == c.getEncodedId();
97}
98
99CLASS_DEF( TrigMonL1Item , 98029077 , 1 )
100
101#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 TrigMonL1Item &lhs, const TrigMonL1Item &rhs)
bool operator==(const TrigMonL1Item &lhs, const TrigMonL1Item &rhs)
Encoded L1 decision for one item.
void print(std::ostream &os=std::cout) const
uint16_t getCtpId() const
bool isPassedBeforePrescale() const
bool isPassed() const
bool isPrescaled() const
uint16_t getEncodedId() const
void addDecision(Decision value)
uint16_t getEncoded() const
bool isVeto() const
bool isPassedAfterPrescale() const
bool isPassedAfterVeto() const
~TrigMonL1Item()=default
uint16_t m_encoded
uint16_t getCounter() const
void setCtpId(unsigned int ctpid)
uint16_t getEncodedId(int level, int counter)