ATLAS Offline Software
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
18 #include "AthenaKernel/CLASS_DEF.h"
19 
20 // C/C++
21 #include <iostream>
22 #include <stdint.h>
23 #include <string>
24 #include <vector>
25 
27 {
28  public:
29 
30  TrigConfSig();
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 
56 std::string str(const TrigConfSig &);
57 
58 //
59 // Inline global operators
60 //
61 inline bool operator==(const TrigConfSig &lhs, const TrigConfSig &rhs) {
62  return lhs.getLabel() == rhs.getLabel();
63 }
64 inline bool operator!=(const TrigConfSig &lhs, const TrigConfSig &rhs) {
65  return !(lhs == rhs);
66 }
67 inline bool operator <(const TrigConfSig &lhs, const TrigConfSig &rhs) {
68  return lhs.getLabel() < rhs.getLabel();
69 }
70 
71 //
72 // Compare TrigConfSig with other types
73 //
74 inline bool operator==(const TrigConfSig &seq, const std::string &name) {
75  return seq.getLabel() == name;
76 }
77 inline bool operator==(const std::string &name, const TrigConfSig &seq) {
78  return name == seq.getLabel();
79 }
80 
81 inline bool operator <(const TrigConfSig &seq, const std::string &name) {
82  return seq.getLabel() < name;
83 }
84 inline bool operator <(const std::string &name, const TrigConfSig &seq) {
85  return name < seq.getLabel();
86 }
87 
88 CLASS_DEF( TrigConfSig , 34893644 , 1 )
89 
90 #endif
test_athena_ntuple_filter.seq
seq
filter configuration ## -> we use the special sequence 'AthMasterSeq' which is run before any other a...
Definition: test_athena_ntuple_filter.py:18
TrigConfSig::matchOutputTE
bool matchOutputTE(uint32_t te) const
Definition: TrigConfSig.cxx:40
TrigConfSig::m_label
std::string m_label
Definition: TrigConfSig.h:52
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
TrigConfSig::getCounter
uint32_t getCounter() const
Definition: TrigConfSig.h:38
PlotCalibFromCool.label
label
Definition: PlotCalibFromCool.py:78
TrigConfSig::print
void print(std::ostream &os=std::cout) const
Definition: TrigConfSig.cxx:46
TrigConfSig::getLabel
const std::string & getLabel() const
Definition: TrigConfSig.h:40
TrigConfSig::clearStrings
void clearStrings()
Definition: TrigConfSig.cxx:31
TrigConfSig::getLogic
int getLogic() const
Definition: TrigConfSig.h:39
operator!=
bool operator!=(const TrigConfSig &lhs, const TrigConfSig &rhs)
Definition: TrigConfSig.h:64
operator==
bool operator==(const TrigConfSig &lhs, const TrigConfSig &rhs)
Definition: TrigConfSig.h:61
str
std::string str(const TrigConfSig &)
Definition: TrigConfSig.cxx:52
TrigConfSig::~TrigConfSig
~TrigConfSig()
Definition: TrigConfSig.h:32
TrigConfSig
Definition: TrigConfSig.h:27
ReadFromCoolCompare.os
os
Definition: ReadFromCoolCompare.py:231
TrigConfSig::TrigConfSig
TrigConfSig()
Definition: TrigConfSig.cxx:15
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
TrigConfSig::m_logic
int m_logic
Definition: TrigConfSig.h:51
TrigConfSig::addOutputTE
void addOutputTE(uint32_t te)
Definition: TrigConfSig.h:36
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
operator<
bool operator<(const TrigConfSig &lhs, const TrigConfSig &rhs)
Definition: TrigConfSig.h:67
TrigConfSig::m_output_te
std::vector< uint32_t > m_output_te
Definition: TrigConfSig.h:53
TrigConfSig::m_counter
uint32_t m_counter
Definition: TrigConfSig.h:50
TrigConfSig::getOutputTEs
const std::vector< uint32_t > & getOutputTEs() const
Definition: TrigConfSig.h:42
test_pyathena.counter
counter
Definition: test_pyathena.py:15
CLASS_DEF.h
macros to associate a CLID to a type