ATLAS Offline Software
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"
12 #include "TrigConfData/L1Board.h"
16 #include "TrigConfData/L1CTP.h"
17 
18 #include <vector>
19 #include <map>
20 
21 namespace 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 
198 #include "AthenaKernel/CLASS_DEF.h"
199 CLASS_DEF( TrigConf::L1Menu , 26419484 , 1 )
200 
201 #include "AthenaKernel/CondCont.h"
203 
204 #endif
205 #endif
206 
207 #endif
TrigConf::L1Menu::size
std::size_t size() const
Accessor to the number of L1 items.
Definition: L1Menu.cxx:185
TrigConf::DataStructure::data
const ptree & data() const
Access to the underlying data, if needed.
Definition: DataStructure.h:83
TrigConf::L1Menu::setSMK
void setSMK(unsigned int psk)
Definition: L1Menu.cxx:196
TrigConf::L1Menu::className
virtual std::string className() const override
A string that is the name of the class.
Definition: L1Menu.h:43
TrigConf::L1TopoAlgorithm
L1Topo algorithm configuration.
Definition: L1TopoAlgorithm.h:20
TrigConf::L1Menu::m_run
unsigned int m_run
Definition: L1Menu.h:166
TrigConf::L1Menu::algorithm
const TrigConf::L1TopoAlgorithm & algorithm(const std::string &algoName, const std::string &category) const
Access to topo algorithm by name.
Definition: L1Menu.cxx:382
TrigConf::L1Connector
L1 connectors configuration.
Definition: L1Connector.h:45
TrigConf::L1Menu::run
unsigned int run() const
Definition: L1Menu.h:152
TrigConf::L1Menu::load
void load()
Definition: L1Menu.cxx:20
L1Item.h
L1Board.h
TrigConf::L1Menu::topoAlgorithmNames
std::vector< std::string > topoAlgorithmNames(const std::string &category) const
Access to topo algorithm names.
Definition: L1Menu.cxx:347
TrigConf::L1Menu::connectorNameFromThreshold
const std::string & connectorNameFromThreshold(const std::string &thresholdName) const
Name of connector from name of threshold or triggerline.
Definition: L1Menu.cxx:313
TrigConf::L1Menu::thrExtraInfo
const L1ThrExtraInfo & thrExtraInfo() const
Access to extra info for threshold types.
Definition: L1Menu.cxx:307
CONDCONT_DEF
CONDCONT_DEF(TrigConf::L1Menu, 11747932)
TrigConf::L1Menu::ctp
const TrigConf::L1CTP & ctp() const
the CTP configuration
Definition: L1Menu.h:145
TrigConf::L1Menu::m_thresholdsByType
std::map< std::string, std::vector< std::shared_ptr< TrigConf::L1Threshold > > > m_thresholdsByType
threshold maps
Definition: L1Menu.h:178
TrigConf::L1Menu::end
const_iterator end() const
End of the L1 items list.
Definition: L1Menu.cxx:223
TrigConf::L1Menu::printMenu
void printMenu(bool full=false) const
print overview of L1 Menu
Definition: L1Menu.cxx:455
TrigConf::L1Menu::clear
virtual void clear() override
Clearing the configuration data.
Definition: L1Menu.cxx:150
TrigConf::L1Menu::L1Menu
L1Menu()
Constructor.
Definition: L1Menu.cxx:10
TrigConf::L1Menu
L1 menu configuration.
Definition: L1Menu.h:28
TrigConf::L1Menu::thresholdNames
std::vector< std::string > thresholdNames() const
List of L1 thresholds names.
Definition: L1Menu.cxx:242
TrigConf::L1Menu::topoAlgorithmOutputNames
std::vector< std::string > topoAlgorithmOutputNames(const std::string &category) const
Access to topo algoritm output names.
Definition: L1Menu.cxx:364
L1Threshold.h
find_tgc_unfilled_channelids.mapping
mapping
Definition: find_tgc_unfilled_channelids.py:17
TrigConf::L1Menu::m_smk
unsigned int m_smk
the supermasterkey
Definition: L1Menu.h:164
TrigConf::L1Menu::m_thresholdsByName
std::map< std::string, std::shared_ptr< TrigConf::L1Threshold > > m_thresholdsByName
Definition: L1Menu.h:179
TrigConf::L1ThrExtraInfo
Definition: L1ThrExtraInfo.h:36
TrigConf::L1Menu::m_connectors
std::map< std::string, TrigConf::L1Connector > m_connectors
connector by name
Definition: L1Menu.h:169
TrigConf
Forward iterator to traverse the main components of the trigger configuration.
Definition: Config.h:22
TrigConf::L1CTP
a TriggerLine entry describes the location of a threshold multiplicity on a cable (connector)
Definition: L1CTP.h:21
TrigConf::L1Menu::m_ctp
TrigConf::L1CTP m_ctp
Definition: L1Menu.h:189
TrigConf::L1Menu::m_algorithmsByOutput
std::map< std::string, std::map< std::string, TrigConf::L1TopoAlgorithm * > > m_algorithmsByOutput
Definition: L1Menu.h:187
TrigConf::L1Menu::m_algorithmsByCategory
std::map< std::string, std::vector< TrigConf::L1TopoAlgorithm > > m_algorithmsByCategory
algorithm maps
Definition: L1Menu.h:185
ReweightUtils.category
category
Definition: ReweightUtils.py:15
TrigConf::L1Menu::item
L1Item item(const std::string &itemName) const
Get item by name.
Definition: L1Menu.cxx:201
TrigConf::L1Menu::isRun2
bool isRun2() const
Definition: L1Menu.h:150
TrigConf::L1Menu::thresholds
std::vector< std::shared_ptr< TrigConf::L1Threshold > > thresholds() const
Access to list of all L1Thresholds.
Definition: L1Menu.cxx:267
TrigConf::L1Menu::ctpVersion
unsigned int ctpVersion() const
Accessor to the version of the CTP format.
Definition: L1Menu.cxx:179
TrigConf::L1Menu::thresholdTypes
std::vector< std::string > thresholdTypes() const
List of L1 thresholds types.
Definition: L1Menu.cxx:231
TrigConf::L1Item
L1 threshold configuration.
Definition: L1Item.h:18
TrigConf::L1Menu::smk
unsigned int smk() const
setter and getter for the supermasterkey
Definition: L1Menu.cxx:191
L1Connector.h
TrigConf::L1Menu::m_thrExtraInfo
TrigConf::L1ThrExtraInfo m_thrExtraInfo
Definition: L1Menu.h:182
L1CTP.h
TrigConf::L1Menu::boardNames
std::vector< std::string > boardNames() const
Board names.
Definition: L1Menu.cxx:441
TrigConf::ConstIter
Forward iterator over an iterable of type V returning an object of type T.
Definition: ConstIter.h:32
TrigConf::L1Menu::connectorNames
std::vector< std::string > connectorNames() const
Connector names.
Definition: L1Menu.cxx:325
TrigConf::L1Menu::m_threshold2ConnectorName
std::map< std::string, std::string > m_threshold2ConnectorName
connector name by threshold name
Definition: L1Menu.h:172
TrigConf::L1Menu::begin
const_iterator begin() const
Begin of the L1 items list.
Definition: L1Menu.cxx:216
TrigConf::L1Menu::m_boards
std::map< std::string, TrigConf::L1Board > m_boards
board by name
Definition: L1Menu.h:175
ConstIter.h
TrigConf::L1Menu::threshold
const TrigConf::L1Threshold & threshold(const std::string &thresholdName) const
Access to L1Threshold by name.
Definition: L1Menu.cxx:279
TrigConf::DataStructure
Base class for Trigger configuration data and wrapper around underlying representation.
Definition: DataStructure.h:37
TrigConf::L1Menu::connector
const TrigConf::L1Connector & connector(const std::string &connectorName) const
Access to connector by name.
Definition: L1Menu.cxx:335
TrigConf::L1Menu::update
virtual void update() override
Update the internal data after modification of the data object.
Definition: L1Menu.h:160
find_data.full
full
Definition: find_data.py:27
TrigConf::L1Menu::board
const TrigConf::L1Board & board(const std::string &boardName) const
Access to boards by name.
Definition: L1Menu.cxx:429
TrigConf::L1Menu::algorithmFromTriggerline
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
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
TrigConf::L1Menu::version
unsigned int version() const
Accessor to the menu version.
Definition: L1Menu.cxx:173
ReadCalibFromCool.typeName
typeName
Definition: ReadCalibFromCool.py:477
TrigConf::L1Menu::m_algorithmsByName
std::map< std::string, std::map< std::string, TrigConf::L1TopoAlgorithm * > > m_algorithmsByName
Definition: L1Menu.h:186
L1TopoAlgorithm.h
TrigConf::L1Menu::m_thresholdsByTypeAndMapping
std::map< std::string, std::map< unsigned int, std::shared_ptr< TrigConf::L1Threshold > > > m_thresholdsByTypeAndMapping
Definition: L1Menu.h:180
TrigConf::L1Menu::~L1Menu
virtual ~L1Menu() override=default
Destructor.
DataStructure.h
TrigConf::DataStructure::ptree
boost::property_tree::ptree ptree
Definition: DataStructure.h:40
CLASS_DEF.h
macros to associate a CLID to a type
TrigConf::L1Board
a TriggerLine entry describes the location of a threshold multiplicity on a cable (connector)
Definition: L1Board.h:23
L1ThrExtraInfo.h
TrigConf::L1Threshold
Standard L1 threshold configuration.
Definition: L1ThresholdBase.h:125
TrigConf::L1Menu::algorithmFromOutput
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