ATLAS Offline Software
Loading...
Searching...
No Matches
TrigConfSig.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 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 <iostream>
22#include <stdint.h>
23#include <string>
24#include <vector>
25
27{
28 public:
29
31 TrigConfSig(uint32_t counter, int logic, const std::string &label);
33
34 void clearStrings();
35
36 void addOutputTE(uint32_t te) { m_output_te.push_back(te); }
37
38 uint32_t getCounter() const { return m_counter; }
39 int getLogic() const { return m_logic; }
40 const std::string& getLabel() const { return m_label; }
41
42 const std::vector<uint32_t>& getOutputTEs() const { return m_output_te; }
43
44 bool matchOutputTE(uint32_t te) const;
45
46 void print(std::ostream &os = std::cout) const;
47
48 private:
49
50 uint32_t m_counter; // Signature counter in chain
51 int m_logic; // Signature logic
52 std::string m_label; // Signature label
53 std::vector<uint32_t> m_output_te; // Id list of output TEs
54};
55
56std::string str(const TrigConfSig &);
57
58//
59// Inline global operators
60//
61inline bool operator==(const TrigConfSig &lhs, const TrigConfSig &rhs) {
62 return lhs.getLabel() == rhs.getLabel();
63}
64inline bool operator!=(const TrigConfSig &lhs, const TrigConfSig &rhs) {
65 return !(lhs == rhs);
66}
67inline bool operator <(const TrigConfSig &lhs, const TrigConfSig &rhs) {
68 return lhs.getLabel() < rhs.getLabel();
69}
70
71//
72// Compare TrigConfSig with other types
73//
74inline bool operator==(const TrigConfSig &seq, const std::string &name) {
75 return seq.getLabel() == name;
76}
77inline bool operator==(const std::string &name, const TrigConfSig &seq) {
78 return name == seq.getLabel();
79}
80
81inline bool operator <(const TrigConfSig &seq, const std::string &name) {
82 return seq.getLabel() < name;
83}
84inline bool operator <(const std::string &name, const TrigConfSig &seq) {
85 return name < seq.getLabel();
86}
87
88CLASS_DEF( TrigConfSig , 34893644 , 1 )
89
90#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:67
bool operator!=(const TrigConfSig &lhs, const TrigConfSig &rhs)
Definition TrigConfSig.h:64
bool operator==(const TrigConfSig &lhs, const TrigConfSig &rhs)
Definition TrigConfSig.h:61
std::vector< uint32_t > m_output_te
Definition TrigConfSig.h:53
uint32_t m_counter
Definition TrigConfSig.h:50
void print(std::ostream &os=std::cout) const
int getLogic() const
Definition TrigConfSig.h:39
const std::vector< uint32_t > & getOutputTEs() const
Definition TrigConfSig.h:42
bool matchOutputTE(uint32_t te) const
void addOutputTE(uint32_t te)
Definition TrigConfSig.h:36
void clearStrings()
std::string m_label
Definition TrigConfSig.h:52
uint32_t getCounter() const
Definition TrigConfSig.h:38
const std::string & getLabel() const
Definition TrigConfSig.h:40
std::string label(const std::string &format, int i)
Definition label.h:19