ATLAS Offline Software
Loading...
Searching...
No Matches
L1Menu.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2021 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
21namespace TrigConf {
22
28 class L1Menu final : public DataStructure {
29 public:
30
32 L1Menu();
33
37 L1Menu(const ptree & data);
38
40 virtual ~L1Menu() override = default;
41
42 // class name
43 virtual std::string className() const override {
44 return "L1Menu";
45 }
46
48 unsigned int version() const;
49
51 unsigned int ctpVersion() const;
52
54 std::size_t size() const;
55
57 unsigned int smk() const;
58 void setSMK(unsigned int psk);
59
61 L1Item item(const std::string & itemName) const;
62
65
70 const_iterator begin() const;
71
76 const_iterator end() const;
77
79 std::vector<std::string> thresholdTypes() const;
80
82 std::vector<std::string> thresholdNames() const;
83
85 std::vector<std::shared_ptr<TrigConf::L1Threshold>> thresholds() const;
86
88 const std::vector<std::shared_ptr<TrigConf::L1Threshold>> & thresholds(const std::string & typeName) const;
89
91 const TrigConf::L1Threshold & threshold(const std::string & thresholdName) const;
92
94 const TrigConf::L1Threshold & threshold(const std::string & typeName, unsigned int mapping) const;
95
97 const L1ThrExtraInfo & thrExtraInfo() const;
98
107 std::vector<std::string> topoAlgorithmNames(const std::string & category) const;
108
110 std::vector<std::string> topoAlgorithmOutputNames(const std::string & category) const;
111
113 const TrigConf::L1TopoAlgorithm & algorithm(const std::string & algoName, const std::string & category) const;
114
121 const TrigConf::L1TopoAlgorithm & algorithmFromTriggerline(const std::string & triggerlineName) const;
122
127 const TrigConf::L1TopoAlgorithm & algorithmFromOutput(const std::string & bareOutputName, const std::string & category) const;
128
130 const TrigConf::L1Board & board(const std::string & boardName) const;
131
133 std::vector<std::string> boardNames() const;
134
136 const TrigConf::L1Connector & connector(const std::string & connectorName) const;
137
139 std::vector<std::string> connectorNames() const;
140
142 const std::string & connectorNameFromThreshold(const std::string & thresholdName) const;
143
145 const TrigConf::L1CTP & ctp() const { return m_ctp; }
146
148 void printMenu(bool full = false) const;
149
150 bool isRun2() const { return m_run == 2; }
151
152 unsigned int run() const { return m_run; }
153
155 virtual void clear() override;
156
157 private:
158
160 virtual void update() override { load(); };
161 void load();
162
164 unsigned int m_smk {0};
165
166 unsigned int m_run{3}; // this variable is set to 2 for L1 menus from Run 2 which have a much reduced content
167
169 std::map<std::string, TrigConf::L1Connector> m_connectors{};
170
172 std::map<std::string, std::string> m_threshold2ConnectorName{};
173
175 std::map<std::string, TrigConf::L1Board> m_boards{};
176
178 std::map<std::string, std::vector<std::shared_ptr<TrigConf::L1Threshold>>> m_thresholdsByType{};
179 std::map<std::string, std::shared_ptr<TrigConf::L1Threshold>> m_thresholdsByName{};
180 std::map<std::string, std::map<unsigned int, std::shared_ptr<TrigConf::L1Threshold>>> m_thresholdsByTypeAndMapping{};
181
183
185 std::map<std::string, std::vector<TrigConf::L1TopoAlgorithm>> m_algorithmsByCategory{}; // primary set of vectors of algos, one per category (TOPO, R2TOPO, MUTOPO, MULTTOPO)
186 std::map<std::string, std::map<std::string, TrigConf::L1TopoAlgorithm*>> m_algorithmsByName{}; // map from category and algorithm name to algorithm
187 std::map<std::string, std::map<std::string, TrigConf::L1TopoAlgorithm*>> m_algorithmsByOutput{}; // map from category and output name to algorithm
188
190
191 };
192
193}
194
195#ifndef TRIGCONF_STANDALONE
196#ifndef XAOD_STANDALONE
197
199CLASS_DEF( TrigConf::L1Menu , 26419484 , 1 )
200
201#include "AthenaKernel/CondCont.h"
203
204#endif
205#endif
206
207#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:28
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:394
virtual void update() override
Update the internal data after modification of the data object.
Definition L1Menu.h:160
std::map< std::string, std::vector< TrigConf::L1TopoAlgorithm > > m_algorithmsByCategory
algorithm maps
Definition L1Menu.h:185
std::vector< std::string > connectorNames() const
Connector names.
Definition L1Menu.cxx:325
std::vector< std::string > boardNames() const
Board names.
Definition L1Menu.cxx:441
const L1ThrExtraInfo & thrExtraInfo() const
Access to extra info for threshold types.
Definition L1Menu.cxx:307
unsigned int ctpVersion() const
Accessor to the version of the CTP format.
Definition L1Menu.cxx:179
std::map< std::string, std::vector< std::shared_ptr< TrigConf::L1Threshold > > > m_thresholdsByType
threshold maps
Definition L1Menu.h:178
bool isRun2() const
Definition L1Menu.h:150
std::map< std::string, TrigConf::L1Connector > m_connectors
connector by name
Definition L1Menu.h:169
std::vector< std::shared_ptr< TrigConf::L1Threshold > > thresholds() const
Access to list of all L1Thresholds.
Definition L1Menu.cxx:267
unsigned int m_run
Definition L1Menu.h:166
void printMenu(bool full=false) const
print overview of L1 Menu
Definition L1Menu.cxx:455
const std::string & connectorNameFromThreshold(const std::string &thresholdName) const
Name of connector from name of threshold or triggerline.
Definition L1Menu.cxx:313
virtual std::string className() const override
A string that is the name of the class.
Definition L1Menu.h:43
std::vector< std::string > topoAlgorithmNames(const std::string &category) const
Access to topo algorithm names.
Definition L1Menu.cxx:347
const TrigConf::L1Connector & connector(const std::string &connectorName) const
Access to connector by name.
Definition L1Menu.cxx:335
std::vector< std::string > topoAlgorithmOutputNames(const std::string &category) const
Access to topo algoritm output names.
Definition L1Menu.cxx:364
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:175
ConstIter< ptree, L1Item > const_iterator
Iterator over the L1 items.
Definition L1Menu.h:64
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:152
const TrigConf::L1Threshold & threshold(const std::string &thresholdName) const
Access to L1Threshold by name.
Definition L1Menu.cxx:279
virtual void clear() override
Clearing the configuration data.
Definition L1Menu.cxx:150
TrigConf::L1CTP m_ctp
Definition L1Menu.h:189
virtual ~L1Menu() override=default
Destructor.
std::map< std::string, std::map< unsigned int, std::shared_ptr< TrigConf::L1Threshold > > > m_thresholdsByTypeAndMapping
Definition L1Menu.h:180
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:417
std::map< std::string, std::map< std::string, TrigConf::L1TopoAlgorithm * > > m_algorithmsByName
Definition L1Menu.h:186
std::map< std::string, std::map< std::string, TrigConf::L1TopoAlgorithm * > > m_algorithmsByOutput
Definition L1Menu.h:187
std::map< std::string, std::shared_ptr< TrigConf::L1Threshold > > m_thresholdsByName
Definition L1Menu.h:179
const TrigConf::L1Board & board(const std::string &boardName) const
Access to boards by name.
Definition L1Menu.cxx:429
void setSMK(unsigned int psk)
Definition L1Menu.cxx:196
unsigned int m_smk
the supermasterkey
Definition L1Menu.h:164
std::map< std::string, std::string > m_threshold2ConnectorName
connector name by threshold name
Definition L1Menu.h:172
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:182
const TrigConf::L1CTP & ctp() const
the CTP configuration
Definition L1Menu.h:145
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:85
Forward iterator to traverse the main components of the trigger configuration.
Definition Config.h:22