ATLAS Offline Software
TrigConfSeq.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_SEQ_H
6 #define TRIGCONF_SEQ_H
7 
8 /*
9  @author Rustem Ospanov
10  @date July 2009
11 
12  @brief This class provides map between monitoring
13  object TrigMonSeq and sequence configuration.
14 */
15 
16 // Framework
17 #include "AthenaKernel/CLASS_DEF.h"
18 
19 // C/C++
20 #include <iostream>
21 #include <stdint.h>
22 #include <string>
23 #include <vector>
24 
25 // Local
27 
29 {
30  public:
31 
32  TrigConfSeq();
33  TrigConfSeq(unsigned int id, unsigned int index, const std::string &name);
35 
36  void clearStrings();
37 
38  void addAlg (const TrigConfAlg &alg) { m_alg.push_back(alg); }
39  void addInputTE(uint32_t te_id) { m_input_te.push_back(te_id); }
40  void setTopoTE (uint32_t te_id) { m_topo_te = te_id; }
41 
42  uint16_t getIndex() const { return m_output_te_index; }
43  uint32_t getId() const { return m_output_te_id; }
44  const std::string& getName() const { return m_output_te_name; }
45  uint32_t getTopoTE() const { return m_topo_te; }
46 
47  const std::vector<uint32_t>& getInputTEs() const { return m_input_te; }
48 
49  const TrigConfAlg & getAlg(unsigned int pos) const;
50  const std::vector<TrigConfAlg>& getAlg() const { return m_alg; }
51 
52  unsigned int getNAlg() const { return m_alg.size(); }
53 
54  std::vector<TrigConfAlg>::const_iterator algBeg() const { return m_alg.begin(); }
55  std::vector<TrigConfAlg>::const_iterator algEnd() const { return m_alg.end(); }
56 
57  std::vector<TrigConfAlg>::const_iterator findName(const std::string &aname) const;
58  std::vector<TrigConfAlg>::const_iterator findType(const std::string &atype) const;
59 
60  bool matchAlgName(const std::string &aname) const;
61  bool matchAlgType(const std::string &atype) const;
62 
63  void print(std::ostream &os = std::cout) const;
64 
65  private:
66 
67  std::string m_output_te_name; // Name of output TE
68  uint16_t m_output_te_index; // Index of output TE (in current configuration)
69  uint32_t m_output_te_id; // Id of output TE
70  uint32_t m_topo_te; // Id of topo start TE
71  std::vector<TrigConfAlg> m_alg; // List of children algorithms
72  std::vector<uint32_t> m_input_te; // Id list of input TEs
73 };
74 
75 std::string str(const TrigConfSeq &);
76 
77 //
78 // Inline global operators
79 //
80 inline bool operator==(const TrigConfSeq &lhs, const TrigConfSeq &rhs) {
81  return lhs.getName() == rhs.getName();
82 }
83 inline bool operator!=(const TrigConfSeq &lhs, const TrigConfSeq &rhs) {
84  return !(lhs == rhs);
85 }
86 inline bool operator <(const TrigConfSeq &lhs, const TrigConfSeq &rhs) {
87  return lhs.getName() < rhs.getName();
88 }
89 
90 //
91 // Compare TrigConfSeq to other types
92 //
93 inline bool operator==(const TrigConfSeq &s, const std::string &n) { return s.getName() == n; }
94 inline bool operator==(const std::string &n, const TrigConfSeq &s) { return n == s.getName(); }
95 
96 inline bool operator <(const TrigConfSeq &s, const std::string &n) { return s.getName() < n; }
97 inline bool operator <(const std::string &n, const TrigConfSeq &s) { return n < s.getName(); }
98 
99 inline bool operator==(const TrigConfSeq &s, unsigned int i) { return s.getId() == i; }
100 inline bool operator==(unsigned int i, const TrigConfSeq &s) { return i == s.getId(); }
101 
102 inline bool operator <(const TrigConfSeq &s, unsigned int i) { return s.getId() < i; }
103 inline bool operator <(unsigned int i, const TrigConfSeq &s) { return i < s.getId(); }
104 
105 CLASS_DEF( TrigConfSeq , 46893630 , 1 )
106 
107 #endif
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
TrigConfSeq::matchAlgType
bool matchAlgType(const std::string &atype) const
Definition: TrigConfSeq.cxx:95
TrigConfSeq::clearStrings
void clearStrings()
Definition: TrigConfSeq.cxx:34
SGout2dot.alg
alg
Definition: SGout2dot.py:243
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
TrigConfSeq::getInputTEs
const std::vector< uint32_t > & getInputTEs() const
Definition: TrigConfSeq.h:47
index
Definition: index.py:1
TrigConfSeq::findName
std::vector< TrigConfAlg >::const_iterator findName(const std::string &aname) const
Definition: TrigConfSeq.cxx:60
operator==
bool operator==(const TrigConfSeq &lhs, const TrigConfSeq &rhs)
Definition: TrigConfSeq.h:80
TrigConfSeq::m_alg
std::vector< TrigConfAlg > m_alg
Definition: TrigConfSeq.h:71
TrigConfSeq::getId
uint32_t getId() const
Definition: TrigConfSeq.h:43
TrigConfSeq::m_topo_te
uint32_t m_topo_te
Definition: TrigConfSeq.h:70
TrigConfSeq::findType
std::vector< TrigConfAlg >::const_iterator findType(const std::string &atype) const
Definition: TrigConfSeq.cxx:73
TrigConfAlg.h
TrigConfSeq::m_output_te_index
uint16_t m_output_te_index
Definition: TrigConfSeq.h:68
python.Dumpers.aname
string aname
Definition: Dumpers.py:5546
operator<
bool operator<(const TrigConfSeq &lhs, const TrigConfSeq &rhs)
Definition: TrigConfSeq.h:86
TrigConfSeq::TrigConfSeq
TrigConfSeq()
Definition: TrigConfSeq.cxx:14
TrigConfSeq::getTopoTE
uint32_t getTopoTE() const
Definition: TrigConfSeq.h:45
xAOD::uint16_t
setWord1 uint16_t
Definition: eFexEMRoI_v1.cxx:93
TrigConfSeq::~TrigConfSeq
~TrigConfSeq()
Definition: TrigConfSeq.h:34
TrigConfSeq::addAlg
void addAlg(const TrigConfAlg &alg)
Definition: TrigConfSeq.h:38
lumiFormat.i
int i
Definition: lumiFormat.py:85
TrigConfSeq::setTopoTE
void setTopoTE(uint32_t te_id)
Definition: TrigConfSeq.h:40
beamspotman.n
n
Definition: beamspotman.py:731
TrigConfSeq::algEnd
std::vector< TrigConfAlg >::const_iterator algEnd() const
Definition: TrigConfSeq.h:55
TrigConfSeq
Definition: TrigConfSeq.h:29
TrigConfAlg
Definition: TrigConfAlg.h:25
operator!=
bool operator!=(const TrigConfSeq &lhs, const TrigConfSeq &rhs)
Definition: TrigConfSeq.h:83
TrigConfSeq::getIndex
uint16_t getIndex() const
Definition: TrigConfSeq.h:42
TrigConfSeq::m_input_te
std::vector< uint32_t > m_input_te
Definition: TrigConfSeq.h:72
ReadFromCoolCompare.os
os
Definition: ReadFromCoolCompare.py:231
TrigConfSeq::getNAlg
unsigned int getNAlg() const
Definition: TrigConfSeq.h:52
TrigConfSeq::getAlg
const std::vector< TrigConfAlg > & getAlg() const
Definition: TrigConfSeq.h:50
TrigConfSeq::addInputTE
void addInputTE(uint32_t te_id)
Definition: TrigConfSeq.h:39
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
TrigConfSeq::matchAlgName
bool matchAlgName(const std::string &aname) const
Definition: TrigConfSeq.cxx:86
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
TrigConfSeq::m_output_te_name
std::string m_output_te_name
Definition: TrigConfSeq.h:67
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
TrigConfSeq::m_output_te_id
uint32_t m_output_te_id
Definition: TrigConfSeq.h:69
TrigConfSeq::getName
const std::string & getName() const
Definition: TrigConfSeq.h:44
TrigConfSeq::algBeg
std::vector< TrigConfAlg >::const_iterator algBeg() const
Definition: TrigConfSeq.h:54
TrigConfSeq::print
void print(std::ostream &os=std::cout) const
Definition: TrigConfSeq.cxx:104
str
std::string str(const TrigConfSeq &)
Definition: TrigConfSeq.cxx:110
CLASS_DEF.h
macros to associate a CLID to a type