ATLAS Offline Software
Loading...
Searching...
No Matches
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
12namespace TXC {
13
14
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),
30 m_bit(bit)
31 {
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),
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
100 L1TopoConfigOutputList& operator=(L1TopoConfigOutputList&&) noexcept = default;
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
110 void addOutputListElement(const OutputListElement & output);
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
129std::ostream & operator<<(std::ostream &, const L1TopoConfigOutputList &);
130
131std::ostream & operator<<(std::ostream &, const TriggerLine &);
132
133} // end of namespace TXC
134
135
136#endif
const TXC::TriggerLine & getTrigger(const std::string &trigger) const
bool hasTrigger(const std::string &trigger) const
std::unordered_set< unsigned int > m_triggercounters
std::unordered_set< std::string > m_triggernames
const std::vector< OutputListElement > & getOutputList() const
std::vector< OutputListElement > m_outputListElements
void addTriggerLine(const TriggerLine &trigger)
std::vector< TriggerLine > m_triggerlines
L1TopoConfigOutputList(L1TopoConfigOutputList &&) noexcept=default
void addOutputListElement(const OutputListElement &output)
const std::vector< TriggerLine > & getTriggerLines() const
const std::string & algoname() const
OutputListElement(const std::string &algoname, unsigned int algoId, unsigned int module, unsigned int fpga, unsigned int clock, unsigned int firstBit)
unsigned int module() const
unsigned int firstbit() const
unsigned int algoid() const
unsigned int algoid() const
TriggerLine(const std::string &name, const std::string &algoname, unsigned int algoId, unsigned int module, unsigned int fpga, unsigned int clock, unsigned int bit)
unsigned int fpga() const
unsigned int counter() const
unsigned int module() const
const std::string & name() const
unsigned int bit() const
unsigned int clock() const
const std::string & algoname() const
std::ostream & operator<<(std::ostream &, const TXC::L1TopoConfigAlg &)
STL namespace.