ATLAS Offline Software
Loading...
Searching...
No Matches
L1Menu.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef TRIGCONFDATA_L1MENU_H
6#define TRIGCONFDATA_L1MENU_H
7
10#include "TrigConfData/L1Item.h"
16#include "TrigConfData/L1CTP.h"
17
18#include <vector>
19#include <map>
20#include <string_view>
21
22namespace TrigConf {
23
29 class L1Menu final : public DataStructure {
30 public:
31
33 L1Menu();
34
38 L1Menu(const ptree & data);
39
41 virtual ~L1Menu() override = default;
42
43 // class name
44 virtual std::string className() const override {
45 return "L1Menu";
46 }
47
49 unsigned int version() const;
50
52 unsigned int ctpVersion() const;
53
55 std::size_t size() const;
56
58 unsigned int smk() const;
59 void setSMK(unsigned int psk);
60
62 L1Item item(const std::string & itemName) const;
63
66
71 const_iterator begin() const;
72
77 const_iterator end() const;
78
80 std::vector<std::string> thresholdTypes() const;
81
83 std::vector<std::string> thresholdNames() const;
84
86 std::vector<std::shared_ptr<TrigConf::L1Threshold>> thresholds() const;
87
89 const std::vector<std::shared_ptr<TrigConf::L1Threshold>> & thresholds(std::string_view typeName) const;
90
92 const TrigConf::L1Threshold & threshold(std::string_view thresholdName) const;
93
95 const TrigConf::L1Threshold & threshold(std::string_view typeName, unsigned int mapping) const;
96
98 const L1ThrExtraInfo & thrExtraInfo() const;
99
108 std::vector<std::string> topoAlgorithmNames(const std::string & category) const;
109
111 std::vector<std::string> topoAlgorithmOutputNames(const std::string & category) const;
112
114 const TrigConf::L1TopoAlgorithm & algorithm(const std::string & algoName, std::string_view ategory) const;
115
122 const TrigConf::L1TopoAlgorithm & algorithmFromTriggerline(const std::string & triggerlineName) const;
123
128 const TrigConf::L1TopoAlgorithm & algorithmFromOutput(const std::string & bareOutputName, const std::string & category) const;
129
131 const TrigConf::L1Board & board(const std::string & boardName) const;
132
134 std::vector<std::string> boardNames() const;
135
137 const TrigConf::L1Connector & connector(const std::string & connectorName) const;
138
140 std::vector<std::string> connectorNames() const;
141
143 const std::string & connectorNameFromThreshold(const std::string & thresholdName) const;
144
146 const TrigConf::L1CTP & ctp() const { return m_ctp; }
147
149 void printMenu(bool full = false) const;
150
151 bool isRun2() const { return m_run == 2; }
152
153 unsigned int run() const { return m_run; }
154
156 virtual void clear() override;
157
158 private:
159
161 virtual void update() override { load(); };
162 void load();
163
165 unsigned int m_smk {0};
166
167 unsigned int m_run{3}; // this variable is set to 2 for L1 menus from Run 2 which have a much reduced content
168
170 std::map<std::string, TrigConf::L1Connector> m_connectors{};
171
173 std::map<std::string, std::string> m_threshold2ConnectorName{};
174
176 std::map<std::string, TrigConf::L1Board> m_boards{};
177
179 std::map<std::string, std::vector<std::shared_ptr<TrigConf::L1Threshold>>, std::less<> > m_thresholdsByType{};
180 std::map<std::string, std::shared_ptr<TrigConf::L1Threshold>, std::less<> > m_thresholdsByName{};
181 std::map<std::string, std::map<unsigned int, std::shared_ptr<TrigConf::L1Threshold>>, std::less<> > m_thresholdsByTypeAndMapping{};
182
184
186 std::map<std::string, std::vector<TrigConf::L1TopoAlgorithm>, std::less<> > m_algorithmsByCategory{}; // primary set of vectors of algos, one per category (TOPO, R2TOPO, MUTOPO, MULTTOPO)
187 std::map<std::string, std::map<std::string, TrigConf::L1TopoAlgorithm*>, std::less<> > m_algorithmsByName{}; // map from category and algorithm name to algorithm
188 std::map<std::string, std::map<std::string, TrigConf::L1TopoAlgorithm*>, std::less<> > m_algorithmsByOutput{}; // map from category and output name to algorithm
189
191
192 };
193
194}
195
196#ifndef TRIGCONF_STANDALONE
197#ifndef XAOD_STANDALONE
198
200CLASS_DEF( TrigConf::L1Menu , 26419484 , 1 )
201
202#include "AthenaKernel/CondCont.h"
204
205#endif
206#endif
207
208#endif
#define CONDCONT_DEF(...)
Definition CondCont.h:1413
macros to associate a CLID to a type
#define CLASS_DEF(NAME, CID, VERSION)
associate a clid and a version to a type eg
Forward iterator over an iterable of type V returning an object of type T.
Definition ConstIter.h:31
const ptree & data() const
Access to the underlying data, if needed.
DataStructure()
Default constructor, leading to an uninitialized configuration object.
boost::property_tree::ptree ptree
a TriggerLine entry describes the location of a threshold multiplicity on a cable (connector)
Definition L1Board.h:23
a TriggerLine entry describes the location of a threshold multiplicity on a cable (connector)
Definition L1CTP.h:21
L1 connectors configuration.
Definition L1Connector.h:46
L1 threshold configuration.
Definition L1Item.h:18
L1 menu configuration.
Definition L1Menu.h:29
std::vector< std::string > thresholdNames() const
List of L1 thresholds names.
Definition L1Menu.cxx:242
const TrigConf::L1TopoAlgorithm & algorithmFromTriggerline(const std::string &triggerlineName) const
Access to topo algorithm by name of triggerline as given in topo connector specification.
Definition L1Menu.cxx:404
virtual void update() override
Update the internal data after modification of the data object.
Definition L1Menu.h:161
std::vector< std::string > connectorNames() const
Connector names.
Definition L1Menu.cxx:331
std::vector< std::string > boardNames() const
Board names.
Definition L1Menu.cxx:451
const L1ThrExtraInfo & thrExtraInfo() const
Access to extra info for threshold types.
Definition L1Menu.cxx:313
unsigned int ctpVersion() const
Accessor to the version of the CTP format.
Definition L1Menu.cxx:179
std::map< std::string, std::map< std::string, TrigConf::L1TopoAlgorithm * >, std::less<> > m_algorithmsByOutput
Definition L1Menu.h:188
std::map< std::string, std::vector< std::shared_ptr< TrigConf::L1Threshold > >, std::less<> > m_thresholdsByType
threshold maps
Definition L1Menu.h:179
bool isRun2() const
Definition L1Menu.h:151
std::map< std::string, std::map< unsigned int, std::shared_ptr< TrigConf::L1Threshold > >, std::less<> > m_thresholdsByTypeAndMapping
Definition L1Menu.h:181
std::map< std::string, TrigConf::L1Connector > m_connectors
connector by name
Definition L1Menu.h:170
std::vector< std::shared_ptr< TrigConf::L1Threshold > > thresholds() const
Access to list of all L1Thresholds.
Definition L1Menu.cxx:266
unsigned int m_run
Definition L1Menu.h:167
void printMenu(bool full=false) const
print overview of L1 Menu
Definition L1Menu.cxx:465
const std::string & connectorNameFromThreshold(const std::string &thresholdName) const
Name of connector from name of threshold or triggerline.
Definition L1Menu.cxx:319
virtual std::string className() const override
A string that is the name of the class.
Definition L1Menu.h:44
std::vector< std::string > topoAlgorithmNames(const std::string &category) const
Access to topo algorithm names.
Definition L1Menu.cxx:353
const TrigConf::L1Connector & connector(const std::string &connectorName) const
Access to connector by name.
Definition L1Menu.cxx:341
std::vector< std::string > topoAlgorithmOutputNames(const std::string &category) const
Access to topo algoritm output names.
Definition L1Menu.cxx:370
const_iterator begin() const
Begin of the L1 items list.
Definition L1Menu.cxx:216
std::map< std::string, TrigConf::L1Board > m_boards
board by name
Definition L1Menu.h:176
ConstIter< ptree, L1Item > const_iterator
Iterator over the L1 items.
Definition L1Menu.h:65
unsigned int version() const
Accessor to the menu version.
Definition L1Menu.cxx:173
std::vector< std::string > thresholdTypes() const
List of L1 thresholds types.
Definition L1Menu.cxx:231
unsigned int smk() const
setter and getter for the supermasterkey
Definition L1Menu.cxx:191
std::size_t size() const
Accessor to the number of L1 items.
Definition L1Menu.cxx:185
unsigned int run() const
Definition L1Menu.h:153
std::map< std::string, std::vector< TrigConf::L1TopoAlgorithm >, std::less<> > m_algorithmsByCategory
algorithm maps
Definition L1Menu.h:186
std::map< std::string, std::shared_ptr< TrigConf::L1Threshold >, std::less<> > m_thresholdsByName
Definition L1Menu.h:180
virtual void clear() override
Clearing the configuration data.
Definition L1Menu.cxx:150
TrigConf::L1CTP m_ctp
Definition L1Menu.h:190
virtual ~L1Menu() override=default
Destructor.
const TrigConf::L1TopoAlgorithm & algorithmFromOutput(const std::string &bareOutputName, const std::string &category) const
Access to topo algorithm by name of the output as given in the algorithm definition.
Definition L1Menu.cxx:427
const TrigConf::L1Board & board(const std::string &boardName) const
Access to boards by name.
Definition L1Menu.cxx:439
const TrigConf::L1Threshold & threshold(std::string_view thresholdName) const
Access to L1Threshold by name.
Definition L1Menu.cxx:278
void setSMK(unsigned int psk)
Definition L1Menu.cxx:196
std::map< std::string, std::map< std::string, TrigConf::L1TopoAlgorithm * >, std::less<> > m_algorithmsByName
Definition L1Menu.h:187
unsigned int m_smk
the supermasterkey
Definition L1Menu.h:165
std::map< std::string, std::string > m_threshold2ConnectorName
connector name by threshold name
Definition L1Menu.h:173
const_iterator end() const
End of the L1 items list.
Definition L1Menu.cxx:223
L1Menu()
Constructor.
Definition L1Menu.cxx:10
TrigConf::L1ThrExtraInfo m_thrExtraInfo
Definition L1Menu.h:183
const TrigConf::L1CTP & ctp() const
the CTP configuration
Definition L1Menu.h:146
L1Item item(const std::string &itemName) const
Get item by name.
Definition L1Menu.cxx:201
Standard L1 threshold configuration.
L1Topo algorithm configuration.
std::string algorithm
Definition hcg.cxx:87
Forward iterator to traverse the main components of the trigger configuration.
Definition Config.h:22