ATLAS Offline Software
Loading...
Searching...
No Matches
TrigConfSig.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef TRIGCONF_SIG_H
6#define TRIGCONF_SIG_H
7
8/*
9 @author Rustem Ospanov
10 @date July 2009
11
12 @brief This is a helper class used by TrigConfChain class.
13 It stores signature configuration and helps to match
14 TrigConfSeq and TrigMonSeq to chains.
15*/
16
17// Framework
19
20// C/C++
21#include <iosfwd>
22#include <stdint.h>
23#include <string>
24#include <vector>
25
27{
28 public:
29
30 TrigConfSig() = default;
31 TrigConfSig(uint32_t counter, int logic, const std::string &label);
32
33 void clearStrings();
34
35 void addOutputTE(uint32_t te) { m_output_te.push_back(te); }
36
37 uint32_t getCounter() const { return m_counter; }
38 int getLogic() const { return m_logic; }
39 const std::string& getLabel() const { return m_label; }
40
41 const std::vector<uint32_t>& getOutputTEs() const { return m_output_te; }
42
43 bool matchOutputTE(uint32_t te) const;
44
45 void print(std::ostream &os) const;
46 void print() const; //uses cout
47 private:
48
49 uint32_t m_counter{}; // Signature counter in chain
50 int m_logic{}; // Signature logic
51 std::string m_label; // Signature label
52 std::vector<uint32_t> m_output_te; // Id list of output TEs
53};
54
55std::string str(const TrigConfSig &);
56
57//
58// Inline global operators
59//
60inline bool operator==(const TrigConfSig &lhs, const TrigConfSig &rhs) {
61 return lhs.getLabel() == rhs.getLabel();
62}
63inline bool operator!=(const TrigConfSig &lhs, const TrigConfSig &rhs) {
64 return !(lhs == rhs);
65}
66inline bool operator <(const TrigConfSig &lhs, const TrigConfSig &rhs) {
67 return lhs.getLabel() < rhs.getLabel();
68}
69
70//
71// Compare TrigConfSig with other types
72//
73inline bool operator==(const TrigConfSig &seq, const std::string &name) {
74 return seq.getLabel() == name;
75}
76inline bool operator==(const std::string &name, const TrigConfSig &seq) {
77 return name == seq.getLabel();
78}
79
80inline bool operator <(const TrigConfSig &seq, const std::string &name) {
81 return seq.getLabel() < name;
82}
83inline bool operator <(const std::string &name, const TrigConfSig &seq) {
84 return name < seq.getLabel();
85}
86
87CLASS_DEF( TrigConfSig , 34893644 , 1 )
88
89#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 TrigConfSig &lhs, const TrigConfSig &rhs)
Definition TrigConfSig.h:66
bool operator!=(const TrigConfSig &lhs, const TrigConfSig &rhs)
Definition TrigConfSig.h:63
bool operator==(const TrigConfSig &lhs, const TrigConfSig &rhs)
Definition TrigConfSig.h:60
std::vector< uint32_t > m_output_te
Definition TrigConfSig.h:52
uint32_t m_counter
Definition TrigConfSig.h:49
int getLogic() const
Definition TrigConfSig.h:38
TrigConfSig()=default
const std::vector< uint32_t > & getOutputTEs() const
Definition TrigConfSig.h:41
bool matchOutputTE(uint32_t te) const
void addOutputTE(uint32_t te)
Definition TrigConfSig.h:35
void clearStrings()
void print() const
std::string m_label
Definition TrigConfSig.h:51
uint32_t getCounter() const
Definition TrigConfSig.h:37
const std::string & getLabel() const
Definition TrigConfSig.h:39
std::string label(const std::string &format, int i)
Definition label.h:19