ATLAS Offline Software
L1TopoConfigOutputList.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef TopoCore_L1TopoConfigOutputList
6 #define TopoCore_L1TopoConfigOutputList
7 
8 #include <vector>
9 #include <string>
10 #include <unordered_set>
11 
12 namespace TXC {
13 
14 
15  class TriggerLine {
16  public:
17  TriggerLine(const std::string& name,
18  const std::string& algoname,
19  unsigned int algoId,
20  unsigned int module,
21  unsigned int fpga,
22  unsigned int clock,
23  unsigned int bit) :
24  m_name(name),
26  m_algoId(algoId),
28  m_fpga(fpga),
29  m_clock(clock),
30  m_bit(bit)
31  {
32  calcCounter();
33  };
34  const std::string & name() const { return m_name; }
35  const std::string & algoname() const { return m_algoname; }
36  unsigned int algoid() const { return m_algoId; }
37  unsigned int module() const { return m_module; }
38  unsigned int fpga() const { return m_fpga; }
39  unsigned int clock() const { return m_clock; }
40  unsigned int bit() const { return m_bit; }
41  unsigned int counter() const { return m_counter; } // unique counter between 0 and 191 - to be used everywhere
42 
43  private:
44  std::string m_name{""};
45  std::string m_algoname{""};
46  unsigned int m_algoId{0};
47  unsigned int m_module{0};
48  unsigned int m_fpga{0};
49  unsigned int m_clock{0};
50  unsigned int m_bit{0};
51  unsigned int m_counter{0};
52 
53  void calcCounter();
54 
55  };
56 
58  public:
59  OutputListElement(const std::string & algoname,
60  unsigned int algoId,
61  unsigned int module,
62  unsigned int fpga,
63  unsigned int clock,
64  unsigned int firstBit) :
66  m_algoId(algoId),
68  m_fpga(fpga),
69  m_clock(clock),
70  m_firstBit(firstBit)
71  {}
72 
73  const std::string & algoname() const { return m_algoname; }
74  unsigned int algoid() const { return m_algoId; }
75  unsigned int module() const { return m_module; }
76  unsigned int fpga() const { return m_fpga; }
77  unsigned int clock() const { return m_clock; }
78  unsigned int firstbit() const { return m_firstBit; }
79  private:
80  std::string m_algoname {""};
81  unsigned int m_algoId {0};
82  unsigned int m_module {0};
83  unsigned int m_fpga {0};
84  unsigned int m_clock {0};
85  unsigned int m_firstBit {0};
86  };
87 
88 
90  public:
91 
92  // default constructor
94 
95  // destructor
97 
98  //move constructors
101 
102  // get all OutputList elements
104 
105  const std::vector<TriggerLine> & getTriggerLines() const { return m_triggerlines; }
106 
107  bool hasTrigger(const std::string & trigger) const;
108  const TXC::TriggerLine & getTrigger(const std::string & trigger) const;
109 
111 
112  void addTriggerLine(const TriggerLine & trigger);
113 
114  void sort();
115 
116  private:
117 
118  // OutputList elements stored here
119  std::vector<OutputListElement> m_outputListElements;
120 
121  std::vector<TriggerLine> m_triggerlines;
122 
123  TXC::TriggerLine m_undef{"UNDEF","",0,0,0,0,0};
124 
125  std::unordered_set<std::string> m_triggernames;
126  std::unordered_set<unsigned int> m_triggercounters;
127  };
128 
129 std::ostream & operator<<(std::ostream &, const L1TopoConfigOutputList &);
130 
131 std::ostream & operator<<(std::ostream &, const TriggerLine &);
132 
133 } // end of namespace TXC
134 
135 
136 #endif
TXC::operator<<
std::ostream & operator<<(std::ostream &, const TXC::L1TopoConfigAlg &)
Definition: L1TopoConfigAlg.cxx:104
TXC::L1TopoConfigOutputList::getTriggerLines
const std::vector< TriggerLine > & getTriggerLines() const
Definition: L1TopoConfigOutputList.h:105
TXC::OutputListElement::m_fpga
unsigned int m_fpga
Definition: L1TopoConfigOutputList.h:83
TXC::L1TopoConfigOutputList::getTrigger
const TXC::TriggerLine & getTrigger(const std::string &trigger) const
Definition: L1TopoConfigOutputList.cxx:62
TXC::L1TopoConfigOutputList::addTriggerLine
void addTriggerLine(const TriggerLine &trigger)
Definition: L1TopoConfigOutputList.cxx:34
TXC::OutputListElement::module
unsigned int module() const
Definition: L1TopoConfigOutputList.h:75
TXC::OutputListElement::algoname
const std::string & algoname() const
Definition: L1TopoConfigOutputList.h:73
TXC::L1TopoConfigOutputList::sort
void sort()
Definition: L1TopoConfigOutputList.cxx:73
TXC::TriggerLine::name
const std::string & name() const
Definition: L1TopoConfigOutputList.h:34
TXC::L1TopoConfigOutputList::getOutputList
const std::vector< OutputListElement > & getOutputList() const
Definition: L1TopoConfigOutputList.h:103
TXC::OutputListElement::algoid
unsigned int algoid() const
Definition: L1TopoConfigOutputList.h:74
TXC::OutputListElement::clock
unsigned int clock() const
Definition: L1TopoConfigOutputList.h:77
TXC::TriggerLine::m_clock
unsigned int m_clock
Definition: L1TopoConfigOutputList.h:49
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:560
TXC::TriggerLine::calcCounter
void calcCounter()
Definition: L1TopoConfigOutputList.cxx:18
TXC::TriggerLine::m_algoId
unsigned int m_algoId
Definition: L1TopoConfigOutputList.h:46
TXC::TriggerLine::TriggerLine
TriggerLine(const std::string &name, const std::string &algoname, unsigned int algoId, unsigned int module, unsigned int fpga, unsigned int clock, unsigned int bit)
Definition: L1TopoConfigOutputList.h:17
TXC::L1TopoConfigOutputList
Definition: L1TopoConfigOutputList.h:89
TXC::OutputListElement::OutputListElement
OutputListElement(const std::string &algoname, unsigned int algoId, unsigned int module, unsigned int fpga, unsigned int clock, unsigned int firstBit)
Definition: L1TopoConfigOutputList.h:59
TXC::L1TopoConfigOutputList::m_undef
TXC::TriggerLine m_undef
Definition: L1TopoConfigOutputList.h:123
TXC::TriggerLine::algoid
unsigned int algoid() const
Definition: L1TopoConfigOutputList.h:36
TXC::OutputListElement::m_module
unsigned int m_module
Definition: L1TopoConfigOutputList.h:82
TXC::TriggerLine::fpga
unsigned int fpga() const
Definition: L1TopoConfigOutputList.h:38
TXC::OutputListElement::firstbit
unsigned int firstbit() const
Definition: L1TopoConfigOutputList.h:78
TXC::TriggerLine::m_bit
unsigned int m_bit
Definition: L1TopoConfigOutputList.h:50
TXC::L1TopoConfigOutputList::m_outputListElements
std::vector< OutputListElement > m_outputListElements
Definition: L1TopoConfigOutputList.h:119
TXC::TriggerLine::m_counter
unsigned int m_counter
Definition: L1TopoConfigOutputList.h:51
TXC::TriggerLine::bit
unsigned int bit() const
Definition: L1TopoConfigOutputList.h:40
vector
Definition: MultiHisto.h:13
TXC::OutputListElement
Definition: L1TopoConfigOutputList.h:57
TXC::OutputListElement::fpga
unsigned int fpga() const
Definition: L1TopoConfigOutputList.h:76
TXC::TriggerLine::clock
unsigned int clock() const
Definition: L1TopoConfigOutputList.h:39
TXC::OutputListElement::m_firstBit
unsigned int m_firstBit
Definition: L1TopoConfigOutputList.h:85
TXC::OutputListElement::m_algoId
unsigned int m_algoId
Definition: L1TopoConfigOutputList.h:81
TXC::TriggerLine::m_fpga
unsigned int m_fpga
Definition: L1TopoConfigOutputList.h:48
TXC::L1TopoConfigOutputList::addOutputListElement
void addOutputListElement(const OutputListElement &output)
Definition: L1TopoConfigOutputList.cxx:28
TXC::L1TopoConfigOutputList::~L1TopoConfigOutputList
virtual ~L1TopoConfigOutputList()
Definition: L1TopoConfigOutputList.h:96
TXC::TriggerLine::module
unsigned int module() const
Definition: L1TopoConfigOutputList.h:37
merge.output
output
Definition: merge.py:17
TXC
Definition: IL1TopoMenuLoader.h:10
TXC::OutputListElement::m_algoname
std::string m_algoname
Definition: L1TopoConfigOutputList.h:80
TXC::TriggerLine
Definition: L1TopoConfigOutputList.h:15
TXC::L1TopoConfigOutputList::L1TopoConfigOutputList
L1TopoConfigOutputList(L1TopoConfigOutputList &&) noexcept=default
TXC::TriggerLine::m_module
unsigned int m_module
Definition: L1TopoConfigOutputList.h:47
TXC::TriggerLine::counter
unsigned int counter() const
Definition: L1TopoConfigOutputList.h:41
TXC::L1TopoConfigOutputList::L1TopoConfigOutputList
L1TopoConfigOutputList()
Definition: L1TopoConfigOutputList.h:93
TXC::TriggerLine::m_algoname
std::string m_algoname
Definition: L1TopoConfigOutputList.h:45
TXC::TriggerLine::algoname
const std::string & algoname() const
Definition: L1TopoConfigOutputList.h:35
TXC::TriggerLine::m_name
std::string m_name
Definition: L1TopoConfigOutputList.h:44
TXC::OutputListElement::m_clock
unsigned int m_clock
Definition: L1TopoConfigOutputList.h:84
TXC::L1TopoConfigOutputList::m_triggercounters
std::unordered_set< unsigned int > m_triggercounters
Definition: L1TopoConfigOutputList.h:126
python.CaloScaleNoiseConfig.default
default
Definition: CaloScaleNoiseConfig.py:79
TXC::L1TopoConfigOutputList::hasTrigger
bool hasTrigger(const std::string &trigger) const
Definition: L1TopoConfigOutputList.cxx:54
TXC::L1TopoConfigOutputList::m_triggernames
std::unordered_set< std::string > m_triggernames
Definition: L1TopoConfigOutputList.h:125
TXC::L1TopoConfigOutputList::m_triggerlines
std::vector< TriggerLine > m_triggerlines
Definition: L1TopoConfigOutputList.h:121