ATLAS Offline Software
Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
TrigConf::L1Menu Class Referencefinal

L1 menu configuration. More...

#include <L1Menu.h>

Inheritance diagram for TrigConf::L1Menu:
Collaboration diagram for TrigConf::L1Menu:

Public Types

using const_iterator = ConstIter< ptree, L1Item >
 Iterator over the L1 items. More...
 
using ptree = boost::property_tree::ptree
 

Public Member Functions

 L1Menu ()
 Constructor. More...
 
 L1Menu (const ptree &data)
 Constructor initialized with configuration data. More...
 
virtual ~L1Menu () override=default
 Destructor. More...
 
virtual std::string className () const override
 A string that is the name of the class. More...
 
unsigned int version () const
 Accessor to the menu version. More...
 
unsigned int ctpVersion () const
 Accessor to the version of the CTP format. More...
 
std::size_t size () const
 Accessor to the number of L1 items. More...
 
unsigned int smk () const
 setter and getter for the supermasterkey More...
 
void setSMK (unsigned int psk)
 
L1Item item (const std::string &itemName) const
 Get item by name. More...
 
const_iterator begin () const
 Begin of the L1 items list. More...
 
const_iterator end () const
 End of the L1 items list. More...
 
std::vector< std::string > thresholdTypes () const
 List of L1 thresholds types. More...
 
std::vector< std::string > thresholdNames () const
 List of L1 thresholds names. More...
 
std::vector< std::shared_ptr< TrigConf::L1Threshold > > thresholds () const
 Access to list of all L1Thresholds. More...
 
const std::vector< std::shared_ptr< TrigConf::L1Threshold > > & thresholds (const std::string &typeName) const
 Access to list of L1Thresholds by type. More...
 
const TrigConf::L1Thresholdthreshold (const std::string &thresholdName) const
 Access to L1Threshold by name. More...
 
const TrigConf::L1Thresholdthreshold (const std::string &typeName, unsigned int mapping) const
 Access to L1Threshold by type and mapping index. More...
 
const L1ThrExtraInfothrExtraInfo () const
 Access to extra info for threshold types. More...
 
std::vector< std::string > topoAlgorithmNames (const std::string &category) const
 Access to topo algorithm names. More...
 
std::vector< std::string > topoAlgorithmOutputNames (const std::string &category) const
 Access to topo algoritm output names. More...
 
const TrigConf::L1TopoAlgorithmalgorithm (const std::string &algoName, const std::string &category) const
 Access to topo algorithm by name. More...
 
const TrigConf::L1TopoAlgorithmalgorithmFromTriggerline (const std::string &triggerlineName) const
 Access to topo algorithm by name of triggerline as given in topo connector specification. More...
 
const TrigConf::L1TopoAlgorithmalgorithmFromOutput (const std::string &bareOutputName, const std::string &category) const
 Access to topo algorithm by name of the output as given in the algorithm definition. More...
 
const TrigConf::L1Boardboard (const std::string &boardName) const
 Access to boards by name. More...
 
std::vector< std::string > boardNames () const
 Board names. More...
 
const TrigConf::L1Connectorconnector (const std::string &connectorName) const
 Access to connector by name. More...
 
std::vector< std::string > connectorNames () const
 Connector names. More...
 
const std::string & connectorNameFromThreshold (const std::string &thresholdName) const
 Name of connector from name of threshold or triggerline. More...
 
const TrigConf::L1CTPctp () const
 the CTP configuration More...
 
void printMenu (bool full=false) const
 print overview of L1 Menu More...
 
bool isRun2 () const
 
unsigned int run () const
 
virtual void clear () override
 Clearing the configuration data. More...
 
void setData (const ptree &data)
 Setting the configuration data. More...
 
void setData (ptree &&data)
 
void setName (const std::string &n)
 Setting the configuration element name. More...
 
virtual const std::string & name () const final
 
const ptreedata () const
 Access to the underlying data, if needed. More...
 
bool isValue () const
 Check for attribute. More...
 
std::string getValue () const
 Access to simple content. More...
 
template<class T >
getValue () const
 
template<class T >
std::optional< T > getValue_optional () const
 access to content of the note Will return false if the value could not be converted into T More...
 
bool hasAttribute (const std::string &key) const
 Check for attribute. More...
 
bool isNull (const std::string &key) const
 Check if an attribute is null. More...
 
bool hasChild (const std::string &path) const
 Check if child exists. More...
 
std::string operator[] (const std::string &key) const
 Access to simple attribute. More...
 
template<class T >
getAttribute (const std::string &key, bool ignoreIfMissing=false, const T &def=T()) const
 Access to simple attribute. More...
 
const std::string & getAttribute (const std::string &key, bool ignoreIfMissing=false, const std::string &def="") const
 
template<class T >
std::optional< T > getAttribute_optional (const std::string &key) const
 
std::vector< DataStructuregetList (const std::string &pathToChild, bool ignoreIfMissing=false) const
 Access to array structure. More...
 
std::optional< std::vector< DataStructure > > getList_optional (const std::string &pathToChild) const
 
DataStructure getObject (const std::string &pathToChild, bool ignoreIfMissing=false) const
 Access to configuration object. More...
 
std::optional< TrigConf::DataStructuregetObject_optional (const std::string &pathToChild) const
 
std::vector< std::string > getKeys () const
 Access to the keys of an DataStructure which presents a dictionary. More...
 
 operator bool () const
 Access to initialized state. More...
 
bool isValid () const
 
bool isInitialized () const
 
bool empty () const
 Check if children exist. More...
 
void printRaw (std::ostream &os=std::cout) const
 
virtual void print (std::ostream &os=std::cout) const
 
bool ownsData () const
 

Static Public Member Functions

static void printElement (const std::string &key, const ptree &data, uint level=0, std::ostream &os=std::cout)
 Static function to print a ptree object. More...
 

Protected Attributes

bool m_initialized { false }
 if initialized, the underlying ptree is has been assigned to (can be empty) More...
 
std::shared_ptr< ptreem_dataSPtr { nullptr }
 
const ptreem_dataPtr { nullptr }
 
std::string m_name {""}
 

Private Member Functions

virtual void update () override
 Update the internal data after modification of the data object. More...
 
void load ()
 

Private Attributes

unsigned int m_smk {0}
 the supermasterkey More...
 
unsigned int m_run {3}
 
std::map< std::string, TrigConf::L1Connectorm_connectors {}
 connector by name More...
 
std::map< std::string, std::string > m_threshold2ConnectorName {}
 connector name by threshold name More...
 
std::map< std::string, TrigConf::L1Boardm_boards {}
 board by name More...
 
std::map< std::string, std::vector< std::shared_ptr< TrigConf::L1Threshold > > > m_thresholdsByType {}
 threshold maps More...
 
std::map< std::string, std::shared_ptr< TrigConf::L1Threshold > > m_thresholdsByName {}
 
std::map< std::string, std::map< unsigned int, std::shared_ptr< TrigConf::L1Threshold > > > m_thresholdsByTypeAndMapping {}
 
TrigConf::L1ThrExtraInfo m_thrExtraInfo
 
std::map< std::string, std::vector< TrigConf::L1TopoAlgorithm > > m_algorithmsByCategory {}
 algorithm maps More...
 
std::map< std::string, std::map< std::string, TrigConf::L1TopoAlgorithm * > > m_algorithmsByName {}
 
std::map< std::string, std::map< std::string, TrigConf::L1TopoAlgorithm * > > m_algorithmsByOutput {}
 
TrigConf::L1CTP m_ctp
 

Detailed Description

L1 menu configuration.

Provides access to menu name and ctpVersion and to the L1 items and thresholds

Definition at line 28 of file L1Menu.h.

Member Typedef Documentation

◆ const_iterator

Iterator over the L1 items.

Definition at line 64 of file L1Menu.h.

◆ ptree

using TrigConf::DataStructure::ptree = boost::property_tree::ptree
inherited

Definition at line 40 of file DataStructure.h.

Constructor & Destructor Documentation

◆ L1Menu() [1/2]

TrigConf::L1Menu::L1Menu ( )

Constructor.

Definition at line 10 of file L1Menu.cxx.

11 {}

◆ L1Menu() [2/2]

TrigConf::L1Menu::L1Menu ( const ptree data)

Constructor initialized with configuration data.

Parameters
dataThe data containing the L1 menu

Definition at line 13 of file L1Menu.cxx.

15 {
16  load();
17 }

◆ ~L1Menu()

virtual TrigConf::L1Menu::~L1Menu ( )
overridevirtualdefault

Destructor.

Member Function Documentation

◆ algorithm()

const TrigConf::L1TopoAlgorithm & TrigConf::L1Menu::algorithm ( const std::string &  algoName,
const std::string &  category 
) const

Access to topo algorithm by name.

Definition at line 382 of file L1Menu.cxx.

383 {
384  try {
385  return * m_algorithmsByName.at(category).at(algoName);
386  }
387  catch(std::exception & ex) {
388  std::cerr << "No algorithm " << algoName << " of category " << category << " defined in the L1 menu" << std::endl;
389  throw;
390  }
391 }

◆ algorithmFromOutput()

const TrigConf::L1TopoAlgorithm & TrigConf::L1Menu::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.

Parameters
fullOutputNamestring name of the output prefixed with the category, e.g. ("HT150-J20s5.ETA31","TOPO") or ("0INVM9-EM7ab-EMab","R2TOPO")
Returns
reference to the algorithm that produces this output

Definition at line 417 of file L1Menu.cxx.

418 {
419  try {
420  return * m_algorithmsByOutput.at(type).at(bareOutputName);
421  }
422  catch(std::exception & ex) {
423  std::cerr << "No output " << bareOutputName << " defined by any algorithm of type " << type << " in the L1 menu" << std::endl;
424  throw;
425  }
426 }

◆ algorithmFromTriggerline()

const TrigConf::L1TopoAlgorithm & TrigConf::L1Menu::algorithmFromTriggerline ( const std::string &  triggerlineName) const

Access to topo algorithm by name of triggerline as given in topo connector specification.

Parameters
triggerlineNamestring name of the triggerline
Returns
reference to the algorithm that produces this output

The name of the triggerline starts with "TOPO_", "MUTOPO_", or "R2TOPO_", except in the case of multiplicity output lines which are just the threshold name

Definition at line 394 of file L1Menu.cxx.

395 {
396  std::string category {"MULTTOPO"};
397  std::string outputName {triggerlineName};
398  if( std::size_t pos = triggerlineName.find('_'); pos != std::string::npos ) {
399  category = triggerlineName.substr(0,pos);
400  outputName = triggerlineName.substr(pos+1);
401  }
402  const static std::vector<string> topoTypes {"TOPO", "R2TOPO", "MULTTOPO", "MUTOPO"};
403  if( std::none_of(cbegin(topoTypes), cend(topoTypes), [&category](const std::string & str){return str==category;}) ) {
404  std::string msg = "L1Menu::algorithmFromTriggerLine(" + triggerlineName + "): triggerline " + triggerlineName + " is not produced by a topo algorithm.";
405  throw std::runtime_error(msg);
406  }
407  try {
408  return * m_algorithmsByOutput.at(category).at(outputName);
409  }
410  catch(std::exception & ex) {
411  std::cerr << "L1Menu::algorithmFromTriggerLine(): No output " << outputName << " defined by any algorithm of category " << category << " in the L1 menu. (It was asked for " << triggerlineName << ")" << std::endl;
412  throw;
413  }
414 }

◆ begin()

TrigConf::L1Menu::const_iterator TrigConf::L1Menu::begin ( ) const

Begin of the L1 items list.

Needed for range-based loops

Definition at line 216 of file L1Menu.cxx.

217 {
218  return {data().get_child("items"), 0, [](auto & x){return L1Item(x.second);}};
219 }

◆ board()

const TrigConf::L1Board & TrigConf::L1Menu::board ( const std::string &  boardName) const

Access to boards by name.

Definition at line 429 of file L1Menu.cxx.

430 {
431  try {
432  return m_boards.at(boardName);
433  }
434  catch(std::exception & ex) {
435  std::cerr << "No board " << boardName << " defined in the L1 menu" << std::endl;
436  throw;
437  }
438 }

◆ boardNames()

std::vector< std::string > TrigConf::L1Menu::boardNames ( ) const

Board names.

Definition at line 441 of file L1Menu.cxx.

442 {
443  std::vector<std::string> boardNames;
444  boardNames.reserve(m_boards.size());
445  for(auto & board : m_boards) {
446  boardNames.emplace_back(board.first);
447  }
448  return boardNames;
449 }

◆ className()

virtual std::string TrigConf::L1Menu::className ( ) const
inlineoverridevirtual

A string that is the name of the class.

Reimplemented from TrigConf::DataStructure.

Definition at line 43 of file L1Menu.h.

43  {
44  return "L1Menu";
45  }

◆ clear()

void TrigConf::L1Menu::clear ( )
overridevirtual

Clearing the configuration data.

Reimplemented from TrigConf::DataStructure.

Definition at line 150 of file L1Menu.cxx.

151 {
153 
154  m_smk = 0;
155  m_run = 3;
156  m_connectors.clear();
158  m_boards.clear();
159  m_thresholdsByType.clear();
160  m_thresholdsByName.clear();
162 
164 
165  m_algorithmsByCategory.clear();
166  m_algorithmsByName.clear();
167  m_algorithmsByOutput.clear();
168 
169  m_ctp.clear();
170 }

◆ connector()

const TrigConf::L1Connector & TrigConf::L1Menu::connector ( const std::string &  connectorName) const

Access to connector by name.

Definition at line 335 of file L1Menu.cxx.

335  {
336  try {
337  return m_connectors.at(connectorName);
338  }
339  catch(std::exception & ex) {
340  std::cerr << "No connector " << connectorName << " defined in the L1 menu" << std::endl;
341  throw;
342  }
343 }

◆ connectorNameFromThreshold()

const std::string & TrigConf::L1Menu::connectorNameFromThreshold ( const std::string &  thresholdName) const

Name of connector from name of threshold or triggerline.

Definition at line 313 of file L1Menu.cxx.

314 {
315  try {
316  return m_threshold2ConnectorName.at(thresholdName);
317  }
318  catch(...) {
319  std::cerr << "Threshold '" << thresholdName << "' not defined as triggerline in the L1 menu" << std::endl;
320  throw;
321  }
322 }

◆ connectorNames()

std::vector< std::string > TrigConf::L1Menu::connectorNames ( ) const

Connector names.

Definition at line 325 of file L1Menu.cxx.

325  {
326  std::vector<std::string> connNames;
327  connNames.reserve(m_connectors.size());
328  for( auto & x : m_connectors ) {
329  connNames.emplace_back(x.first);
330  }
331  return connNames;
332 }

◆ ctp()

const TrigConf::L1CTP& TrigConf::L1Menu::ctp ( ) const
inline

the CTP configuration

Definition at line 145 of file L1Menu.h.

145 { return m_ctp; }

◆ ctpVersion()

unsigned int TrigConf::L1Menu::ctpVersion ( ) const

Accessor to the version of the CTP format.

Definition at line 179 of file L1Menu.cxx.

180 {
181  return getAttribute<unsigned int>("ctpVersion");
182 }

◆ data()

const ptree& TrigConf::DataStructure::data ( ) const
inlineinherited

Access to the underlying data, if needed.

Definition at line 83 of file DataStructure.h.

83  {
84  if( ! isInitialized() ) {
85  throw std::runtime_error("Trying to access data of uninitialized object of type " + className());
86  }
87  // Don't use ?: operator here: it confuses cppcheck.
88  if (ownsData()) {
89  return *m_dataSPtr.get();
90  }
91  return *m_dataPtr;
92  }

◆ empty()

bool TrigConf::DataStructure::empty ( ) const
inlineinherited

Check if children exist.

Definition at line 219 of file DataStructure.h.

219 { return data().empty(); }

◆ end()

TrigConf::L1Menu::const_iterator TrigConf::L1Menu::end ( ) const

End of the L1 items list.

Needed for range-based loops

Definition at line 223 of file L1Menu.cxx.

224 {
225  const auto & items = data().get_child("items");
226  return {items, items.size(), [](auto & x){return L1Item(x.second);}};
227 }

◆ getAttribute() [1/2]

const std::string & TrigConf::DataStructure::getAttribute ( const std::string &  key,
bool  ignoreIfMissing = false,
const std::string &  def = "" 
) const
inherited

Definition at line 136 of file DataStructure.cxx.

137 {
138  const auto & obj = data().get_child_optional(key);
139  if( !obj ) {
140  if( ignoreIfMissing ) {
141  return def;
142  } else {
143  throw std::runtime_error(className() + "#" + name() + ": structure '" + key + "' does not exist" );
144  }
145  }
146  // check if the key points to a plain string value
147  if ( !obj.get().empty() ) {
148  if ( obj.get().front().first.empty() ) {
149  throw std::runtime_error(className() + "#" + name() + ": structure '" + key + "' is not a simple attribute but a list [], it needs to be accessed via getList(\"" + key + "\") -> vector<DataStructure>");
150  } else {
151  throw std::runtime_error(className() + "#" + name() + ": structure '" + key + "' is not a simple attribute but an object {}, it needs to be accessed via getObject(\"" + key + "\") -> DataStructure");
152  }
153  }
154  return obj.get().data();
155 }

◆ getAttribute() [2/2]

template<class T >
T TrigConf::DataStructure::getAttribute ( const std::string &  key,
bool  ignoreIfMissing = false,
const T &  def = T() 
) const
inlineinherited

Access to simple attribute.

Parameters
keyThe path to the attribute name, relative to the current one in form "path.to.child"
ignoreIfMissingControls the behavior in case of missing configuration child

Definition at line 152 of file DataStructure.h.

152  {
153  const auto & obj = data().get_child_optional(key);
154  if( !obj ) {
155  if( ignoreIfMissing ) {
156  return def;
157  } else {
158  throw std::runtime_error(className() + "#" + name() + ": structure '" + key + "' does not exist" );
159  }
160  }
161  return obj.get().get_value<T>();
162  }

◆ getAttribute_optional()

template<class T >
std::optional<T> TrigConf::DataStructure::getAttribute_optional ( const std::string &  key) const
inlineinherited

Definition at line 165 of file DataStructure.h.

165  {
166  const auto & obj = data().get_child_optional(key);
167  if( ! obj ) {
168  return std::nullopt;
169  }
170  auto v = obj.get().get_value_optional<T>();
171  return v ? std::optional(std::move(*v)) : std::nullopt;
172  }

◆ getKeys()

std::vector< std::string > TrigConf::DataStructure::getKeys ( ) const
inherited

Access to the keys of an DataStructure which presents a dictionary.

In case the DataStructure is a list or a simple attribute, an empty vector is returned

Definition at line 250 of file DataStructure.cxx.

251 {
252  std::vector<std::string> keys;
253  if ( ! data().empty() &&
254  ! data().front().first.empty() )
255  {
256  keys.reserve(data().size());
257  for( auto & entry : data() ) {
258  keys.push_back(entry.first);
259  }
260  }
261  return keys;
262 }

◆ getList()

std::vector< TrigConf::DataStructure > TrigConf::DataStructure::getList ( const std::string &  pathToChild,
bool  ignoreIfMissing = false 
) const
inherited

Access to array structure.

Parameters
pathToChildThe path to the configuration child, relative to the current one in form "path.to.child"
ignoreIfMissingControls the behavior in case of missing configuration child

In case the child is missing and ignoreIfMissing is set to true, and empty vector will be returned. Otherwise a runtime exception will be thrown.

Definition at line 158 of file DataStructure.cxx.

159 {
160  std::vector<TrigConf::DataStructure> childList;
161  const auto & list = data().get_child_optional(pathToChild);
162  if( ! list ) {
163  if ( ignoreIfMissing ) {
164  return childList;
165  } else {
166  throw std::runtime_error(className() + "#" + name() + ": structure '" + pathToChild + "' does not exist.");
167  }
168  }
169 
170  // check if the pathToChild points to a list
171 
172  // this check is not complete, because boost::ptree can not
173  // distinguish between and empty list and an empty string. In both cases
174  // the value is empty and there are no children
175 
176  if ( list.get().empty() ) {
177  if ( list.get().get_value<std::string>() != "" ) {
178  // if the value is not empty, then it is for sure an attribute ("key" : "value")
179  throw std::runtime_error(className() + "#" + name() + ": structure '" + pathToChild + "' is not a list [] but a simple attribute, it needs to be accessed via [\"" + pathToChild + "\"] -> string");
180  }
181  // else: if the value is empty, we can not say for sure and will not
182  // give this debugging hint (an empty list will be returned
183  } else if ( ! list.get().front().first.empty() ) {
184  throw std::runtime_error(className() + "#" + name() + ": structure '" + pathToChild + "' is not a list [] but an object {}, it needs to be accessed via getObject(\"" + pathToChild + "\") -> DataStructure");
185  }
186 
187  childList.reserve(list.get().size());
188 
189  for( auto & childData : list.get() )
190  childList.emplace_back( childData.second );
191 
192  return childList;
193 }

◆ getList_optional()

std::optional< std::vector< TrigConf::DataStructure > > TrigConf::DataStructure::getList_optional ( const std::string &  pathToChild) const
inherited

Definition at line 197 of file DataStructure.cxx.

198 {
199  if(data().find(pathToChild) == data().not_found()) {
200  return std::nullopt;
201  }
202  return std::optional<std::vector<TrigConf::DataStructure> >(getList(pathToChild));
203 }

◆ getObject()

TrigConf::DataStructure TrigConf::DataStructure::getObject ( const std::string &  pathToChild,
bool  ignoreIfMissing = false 
) const
inherited

Access to configuration object.

Parameters
pathToChildThe path to the configuration child, relative to the current one
ignoreIfMissingControls the behavior in case of missing configuration child

In case the child is missing and ignoreIfMissing is set to true, an uninitialized DataStructure will be returned. Otherwise a runtime exception will be thrown.

*bool ignoreIfMissing = true;
*if( const DataStructure & child = ds.getObject("path.to.child", ignoreIfMissing) ) {
cout << child["key"] << endl;
}

Definition at line 207 of file DataStructure.cxx.

208 {
209  const auto & obj = data().get_child_optional(pathToChild);
210  if( ! obj ) {
211  if ( ignoreIfMissing ) {
212  return DataStructure();
213  } else {
214  throw std::runtime_error(className() + "#" + name() + ": structure '" + pathToChild + "' does not exist.");
215  }
216  }
217  // check if the pathToChild is an attribute
218  if( obj.get().get_value<std::string>() != "" ) {
219  throw std::runtime_error(className() + "#" + name() + ": structure '" + pathToChild + "' is not an object {} but a simple attribute, it needs to be accessed via [\"" + pathToChild + "\"] -> string");
220  }
221  // check if the pathToChild points to a list
222  if ( obj.get().front().first.empty() ) {
223  throw std::runtime_error(className() + "#" + name() + ": structure '" + pathToChild + "' is not an object {} but a list [], it needs to be accessed via getList(\"" + pathToChild + "\") -> vector<DataStructure>");
224  }
225  return { obj.get() };
226 }

◆ getObject_optional()

std::optional< TrigConf::DataStructure > TrigConf::DataStructure::getObject_optional ( const std::string &  pathToChild) const
inherited

Definition at line 230 of file DataStructure.cxx.

231 {
232 
233  if(const auto & obj = data().get_child_optional(pathToChild)) {
234  // check if the pathToChild is an attribute
235  if( obj.get().get_value<std::string>() != "" ) {
236  throw std::runtime_error(className() + "#" + name() + ": structure '" + pathToChild + "' is not an object {} but a simple attribute, it needs to be accessed via [\"" + pathToChild + "\"] -> string");
237  }
238  // check if the pathToChild points to a list
239  if ( obj.get().front().first.empty() ) {
240  throw std::runtime_error(className() + "#" + name() + ": structure '" + pathToChild + "' is not an object {} but a list [], it needs to be accessed via getList(\"" + pathToChild + "\") -> vector<DataStructure>");
241  }
242  return std::optional<TrigConf::DataStructure>(obj.get());
243  }
244  return std::nullopt;
245 }

◆ getValue() [1/2]

std::string TrigConf::DataStructure::getValue ( ) const
inherited

Access to simple content.

Returns
string that is the content of the structure

For instance when the json structure contains an array of values (ptree only works with strings) which one retrieved via getList, then the values in the vector<DataStructure> can be accessed using getValue

Definition at line 80 of file DataStructure.cxx.

80  {
81  const std::string value = data().get_value<std::string>();
82  return value;
83 }

◆ getValue() [2/2]

template<class T >
T TrigConf::DataStructure::getValue ( ) const
inlineinherited

Definition at line 108 of file DataStructure.h.

108  {
109  return data().get_value<T>();
110  }

◆ getValue_optional()

template<class T >
std::optional<T> TrigConf::DataStructure::getValue_optional ( ) const
inlineinherited

access to content of the note Will return false if the value could not be converted into T

Definition at line 116 of file DataStructure.h.

116  {
117  auto v = data().get_value_optional<T>();
118  return v ? std::optional<T>(std::move(*v)) : std::nullopt;
119  }

◆ hasAttribute()

bool TrigConf::DataStructure::hasAttribute ( const std::string &  key) const
inherited

Check for attribute.

Parameters
keyThe path to the attribute name, relative to the current one in form "path.to.child"
Returns
true if path key exists and is an attribute

Definition at line 86 of file DataStructure.cxx.

86  {
87  const auto & child = data().get_child_optional( key );
88  if( ! bool(child) ) // key does not exist
89  return false;
90  return child.get().empty(); // if empty then it is an attribute, otherwise a child note
91 }

◆ hasChild()

bool TrigConf::DataStructure::hasChild ( const std::string &  path) const
inherited

Check if child exists.

Parameters
pathThe path to the child, relative to the current one in form "path.to.child"
Returns
true if path exists

Definition at line 114 of file DataStructure.cxx.

114  {
115  const auto & child = data().get_child_optional( path );
116  return bool(child);
117 }

◆ isInitialized()

bool TrigConf::DataStructure::isInitialized ( ) const
inlineinherited

Definition at line 216 of file DataStructure.h.

216 { return m_initialized; }

◆ isNull()

bool TrigConf::DataStructure::isNull ( const std::string &  key) const
inherited

Check if an attribute is null.

Parameters
keyThe path to the attribute name, relative to the current one in form "path.to.child"
Returns
true if path key exists and is null

If the attribute doesn't exist, the function returns false. To check if an attribute exists and is null, use it together with hasAttribute.

Definition at line 94 of file DataStructure.cxx.

94  {
95  auto child = data().get_child_optional( key );
96  if( ! child ) {
97  return false;
98  }
99  return child->get_value<std::string>() == "null";
100 }

◆ isRun2()

bool TrigConf::L1Menu::isRun2 ( ) const
inline

Definition at line 150 of file L1Menu.h.

150 { return m_run == 2; }

◆ isValid()

bool TrigConf::DataStructure::isValid ( ) const
inlineinherited

Definition at line 215 of file DataStructure.h.

215 { return m_initialized; }

◆ isValue()

bool TrigConf::DataStructure::isValue ( ) const
inherited

Check for attribute.

Returns
true if the structure is just a value

Definition at line 74 of file DataStructure.cxx.

74  {
75  return data().empty(); // just a key->value pair, no children
76 }

◆ item()

TrigConf::L1Item TrigConf::L1Menu::item ( const std::string &  itemName) const

Get item by name.

Definition at line 201 of file L1Menu.cxx.

202 {
203  if(itemName=="") {
204  throw std::runtime_error("L1Menu::item() was called with empty itemName");
205  }
206  const ptree * pt;
207  try {
208  pt = & data().get_child(ptree::path_type("items/"+itemName,'/')); // '/' is not used in any item Name, so we can use it as separator in the path
209  } catch(boost::property_tree::ptree_bad_path & ex) {
210  throw std::runtime_error("L1Item " + itemName + " does not exist in the menu");
211  }
212  return L1Item(*pt);
213 }

◆ load()

void TrigConf::L1Menu::load ( )
private

Definition at line 20 of file L1Menu.cxx.

21 {
22  if(! isInitialized() || empty() ) {
23  return;
24  }
25 
26  m_run = getAttribute_optional<int>("run").value_or(3);
27 
28  // thresholds
29  try {
30  m_name = getAttribute("name");
31  for( const std::string path : {"thresholds", "thresholds.legacyCalo" } ) {
32  for( auto & thrByType : data().get_child( path ) ) {
33  const std::string & thrType = thrByType.first;
34  if (thrType == "legacyCalo")
35  continue;
36 
37  // first create the extraInfo object for this type of thresholds
38  auto extraInfo = m_thrExtraInfo.addExtraInfo(thrByType.first,thrByType.second);
39 
40  auto & v = m_thresholdsByType[thrType] = std::vector<std::shared_ptr<TrigConf::L1Threshold>>();
41  if(thrType == "internal") {
42  for( auto & thr : data().get_child( path + ".internal.names") ) {
43  const std::string thrName = thr.second.data();
44  v.push_back( L1Threshold::createThreshold( thrName, thrType, extraInfo, thr.second ) );
45  }
46  } else {
47  for( auto & thr : data().get_child( path + "." + thrType + ".thresholds") ) {
48  const std::string thrName = thr.first;
49  v.push_back( L1Threshold::createThreshold( thrName, thrType, extraInfo, thr.second ) );
50  }
51  }
52  for( auto & thr : v ) {
53  m_thresholdsByName[ thr->name() ] = thr;
54  }
55  for (auto &thr : v) {
56  m_thresholdsByTypeAndMapping[thrType][thr->mapping()] = thr;
57  }
58  }
59  }
60  }
61  catch(std::exception & ex) {
62  std::cerr << "ERROR: problem when building L1 menu structure (thresholds). " << ex.what() << std::endl;
63  throw;
64  }
65 
66  // boards
67  try {
68  for( auto & board : data().get_child( "boards" ) ) {
69  m_boards.emplace( std::piecewise_construct,
70  std::forward_as_tuple(board.first),
71  std::forward_as_tuple(board.first, board.second) );
72  }
73  }
74  catch(std::exception & ex) {
75  std::cerr << "ERROR: problem when building L1 menu structure (boards). " << ex.what() << std::endl;
76  throw;
77  }
78 
79  // connectors
80  try {
81  for( auto & conn : data().get_child( "connectors" ) ) {
82  auto res = m_connectors.emplace( std::piecewise_construct,
83  std::forward_as_tuple(conn.first),
84  std::forward_as_tuple(conn.first, conn.second) );
85  for( auto & tl : res.first->second.triggerLineNames() ) {
86  m_threshold2ConnectorName.emplace( std::piecewise_construct,
87  std::forward_as_tuple(tl),
88  std::forward_as_tuple(conn.first));
89  }
90  }
91  }
92  catch(std::exception & ex) {
93  std::cerr << "ERROR: problem when building L1 menu structure (connectors). " << ex.what() << std::endl;
94  throw;
95  }
96 
97  // algorithms
98  if(m_run>1) {
99  try {
100  auto topoCategories = isRun2() ? std::vector<std::string> {"R2TOPO"} : std::vector<std::string> {"TOPO", "MUTOPO", "MULTTOPO", "R2TOPO"};
101  for( const std::string& algoCategory : topoCategories ) {
102  auto & v = m_algorithmsByCategory[algoCategory] = std::vector<TrigConf::L1TopoAlgorithm>();
103  m_algorithmsByName.emplace(algoCategory, std::map<std::string, TrigConf::L1TopoAlgorithm*>());
104  m_algorithmsByOutput.emplace(algoCategory, std::map<std::string, TrigConf::L1TopoAlgorithm*>());
105  if(algoCategory == "MULTTOPO") {
106  for( auto & alg : data().get_child( "topoAlgorithms." + algoCategory + ".multiplicityAlgorithms" ) ) {
107  v.emplace_back( alg.first, L1TopoAlgorithm::AlgorithmType::MULTIPLICITY, algoCategory, alg.second );
108  }
109  } else {
111  std::string subpath = "topoAlgorithms." + algoCategory + (algoType==L1TopoAlgorithm::AlgorithmType::DECISION ? ".decisionAlgorithms" : ".sortingAlgorithms" );
112  for( auto & algorithm : data().get_child( subpath ) ) {
113  v.emplace_back( algorithm.first, algoType, algoCategory, algorithm.second );
114  }
115  }
116  }
117  for( auto & algo : v ) {
118  if( m_algorithmsByName[algoCategory].count(algo.name()) > 0 ) {
119  std::cerr << "ERROR : Topo algorithm with name " << algo.name() << " and of type " << algoCategory << " already exists" << std::endl;
120  throw std::runtime_error("Found duplicate topo algorithm name " + algo.name() + " of type " + algoCategory);
121  }
122  m_algorithmsByName[ algoCategory ][ algo.name() ] = & algo;
123  for( const std::string & output : algo.outputs() ) {
124  if( m_algorithmsByOutput[algoCategory].count(output) > 0 ) {
125  std::cerr << "ERROR : Topo algorithm output " << output << " already exists" << std::endl;
126  throw std::runtime_error("Found duplicate topo algorithm output " + output + " of type " + algoCategory);
127  }
128  m_algorithmsByOutput[algoCategory][output] = & algo;
129  }
130  }
131  }
132  }
133  catch(std::exception & ex) {
134  std::cerr << "ERROR: problem when building L1 menu structure (algorithms). " << ex.what() << std::endl;
135  throw;
136  }
137  }
138 
139  // CTP
140  try {
141  m_ctp.setData(data().get_child("ctp"));
142  }
143  catch(std::exception & ex) {
144  std::cerr << "ERROR: problem when building L1 menu structure (CTP). " << ex.what() << std::endl;
145  throw;
146  }
147 }

◆ name()

const std::string & TrigConf::DataStructure::name ( ) const
finalvirtualinherited

Definition at line 109 of file DataStructure.cxx.

109  {
110  return m_name;
111 }

◆ operator bool()

TrigConf::DataStructure::operator bool ( ) const
inlineexplicitinherited

Access to initialized state.

Definition at line 214 of file DataStructure.h.

214 { return m_initialized; }

◆ operator[]()

std::string TrigConf::DataStructure::operator[] ( const std::string &  key) const
inherited

Access to simple attribute.

Parameters
keyThe path to the attribute name, relative to the current one in form "path.to.child"

Definition at line 121 of file DataStructure.cxx.

122 {
123  const auto & obj = data().get_child(key);
124  // check if the key points to a plain string value
125  if ( !obj.empty() ) {
126  if ( obj.front().first.empty() ) {
127  throw std::runtime_error(className() + "#" + name() + ": structure '" + key + "' is not a simple attribute but a list [], it needs to be accessed via getList(\"" + key + "\") -> vector<DataStructure>");
128  } else {
129  throw std::runtime_error(className() + "#" + name() + ": structure '" + key + "' is not a simple attribute but an object {}, it needs to be accessed via getObject(\"" + key + "\") -> DataStructure");
130  }
131  }
132  return obj.data();
133 }

◆ ownsData()

bool TrigConf::DataStructure::ownsData ( ) const
inlineinherited

Definition at line 242 of file DataStructure.h.

242  {
243  return (bool)m_dataSPtr;
244  }

◆ print()

void TrigConf::DataStructure::print ( std::ostream &  os = std::cout) const
virtualinherited

Reimplemented in TrigConf::L1TopoAlgorithm, and TrigConf::L1Threshold_EM.

Definition at line 272 of file DataStructure.cxx.

273 {
274  printElement("", data(), 0, os);
275  os << std::endl;
276 }

◆ printElement()

void TrigConf::DataStructure::printElement ( const std::string &  key,
const ptree data,
uint  level = 0,
std::ostream &  os = std::cout 
)
staticinherited

Static function to print a ptree object.

Parameters
keyThe key of this data as found in the parent structure
dataThe ptree to print
levelThe substruture level used to indent the output
osThe output stream

Definition at line 279 of file DataStructure.cxx.

280 {
281  constexpr char del = '"';
282 
283  const std::string value = data.get_value<std::string>();
284 
285  if( data.empty() ) { // no children, so just a key->value pair
286  uint n(4*level); while(n--) os << " ";
287  os << del << key << del << ": " << del << value << del;
288  return;
289  }
290 
291 
292  bool isArray ( data.begin()->first.empty() ); // dictionaries have keys, arrays don't
293  { uint n(4*level); while(n--) os << " "; }
294  if ( ! key.empty() )
295  os << del << key << del << ": ";
296  os << (isArray ? "[" : "{") << std::endl;
297 
298  size_t childCounter = data.size();
299  for( const boost::property_tree::ptree::value_type & x : data ) {
300  printElement(x.first, x.second, level + 1, os);
301  if( --childCounter ) os << ",";
302  os << std::endl;
303  }
304  { uint n(4*level); while(n--) os << " "; }
305  os << (isArray ? "]" : "}");
306 
307 }

◆ printMenu()

void TrigConf::L1Menu::printMenu ( bool  full = false) const

print overview of L1 Menu

Definition at line 455 of file L1Menu.cxx.

456 {
457  cout << "L1 menu '" << name() << "'" << endl;
458  cout << "Items: " << size() << endl;
459  if(full) {
460  int c(0);
461  for(const L1Item & item : *this ) {
462  cout << " " << c++ << ": " << item.name() << endl;
463  }
464  }
465  cout << "Thresholds: " << thresholds().size() << "(of " << thresholdTypes().size() << " different types)" << endl;
466  if(full) {
467  int c(0);
468  for(const std::string & thrType : thresholdTypes() ) {
469  cout << thrType << " :" << endl;
470  for(auto & thr : thresholds(thrType)) {
471  cout << " " << c++ << ": " << thr->name() << "[" << thr->type() << "]" << endl;
472  }
473  }
474  }
475  if(m_run>1) {
476  cout << "Topo algorithms: " << endl;
477  cout << " new : " << data().get_child("topoAlgorithms.TOPO.decisionAlgorithms").size() << endl;
478  cout << " muon : " << data().get_child("topoAlgorithms.MUTOPO.decisionAlgorithms").size() << endl;
479  cout << " mult : " << data().get_child("topoAlgorithms.MULTTOPO.multiplicityAlgorithms").size() << endl;
480  cout << " legacy: " << data().get_child("topoAlgorithms.R2TOPO.decisionAlgorithms").size() << endl;
481  }
482  cout << "Boards: " << data().get_child("boards").size() << endl;
483  cout << "Connectors: " << data().get_child("connectors").size() << endl;
484  unsigned int ctpinputs = data().get_child("ctp.inputs.optical").size();
485  ctpinputs += data().get_child("ctp.inputs.electrical").size();
486  ctpinputs += data().get_child("ctp.inputs.ctpin.slot7").size();
487  ctpinputs += data().get_child("ctp.inputs.ctpin.slot8").size();
488  ctpinputs += data().get_child("ctp.inputs.ctpin.slot9").size();
489  cout << "CTP connections: " << ctpinputs << endl;
490 }

◆ printRaw()

void TrigConf::DataStructure::printRaw ( std::ostream &  os = std::cout) const
inherited

Definition at line 265 of file DataStructure.cxx.

266 {
267  boost::property_tree::json_parser::write_json( os, data() );
268 }

◆ run()

unsigned int TrigConf::L1Menu::run ( ) const
inline

Definition at line 152 of file L1Menu.h.

152 { return m_run; }

◆ setData() [1/2]

void TrigConf::DataStructure::setData ( const ptree data)
inherited

Setting the configuration data.

Definition at line 39 of file DataStructure.cxx.

40 {
41  clear();
42  m_initialized = true;
43  m_dataSPtr.reset();
44  m_dataPtr = &data;
45  update();
46 }

◆ setData() [2/2]

void TrigConf::DataStructure::setData ( ptree &&  data)
inherited

Definition at line 50 of file DataStructure.cxx.

51 {
52  clear();
53  m_initialized = true;
54  m_dataSPtr = std::make_shared<ptree>(std::move(data));
55  m_dataPtr = nullptr;
56  update();
57 }

◆ setName()

void TrigConf::DataStructure::setName ( const std::string &  n)
inherited

Setting the configuration element name.

Definition at line 59 of file DataStructure.cxx.

59  {
60  m_name = n;
61 }

◆ setSMK()

void TrigConf::L1Menu::setSMK ( unsigned int  psk)

Definition at line 196 of file L1Menu.cxx.

196  {
197  m_smk = smk;
198 }

◆ size()

std::size_t TrigConf::L1Menu::size ( ) const

Accessor to the number of L1 items.

Definition at line 185 of file L1Menu.cxx.

186 {
187  return data().get_child("items").size();
188 }

◆ smk()

unsigned int TrigConf::L1Menu::smk ( ) const

setter and getter for the supermasterkey

Definition at line 191 of file L1Menu.cxx.

191  {
192  return m_smk;
193 }

◆ threshold() [1/2]

const TrigConf::L1Threshold & TrigConf::L1Menu::threshold ( const std::string &  thresholdName) const

Access to L1Threshold by name.

Definition at line 279 of file L1Menu.cxx.

280 {
281  try {
282  return * m_thresholdsByName.at(thresholdName);
283  }
284  catch(std::exception & ex) {
285  std::cerr << "No threshold '" << thresholdName << "' defined in the thresholds section of the L1 menu" << std::endl;
286  throw;
287  }
288 }

◆ threshold() [2/2]

const TrigConf::L1Threshold & TrigConf::L1Menu::threshold ( const std::string &  typeName,
unsigned int  mapping 
) const

Access to L1Threshold by type and mapping index.

Definition at line 292 of file L1Menu.cxx.

293 {
294  try
295  {
297  }
298  catch (std::exception &ex)
299  {
300  std::cerr << "No threshold of type '" << typeName << "' with mapping " << mapping
301  << " defined in the thresholds section of the L1 menu" << std::endl;
302  throw;
303  }
304 }

◆ thresholdNames()

std::vector< std::string > TrigConf::L1Menu::thresholdNames ( ) const

List of L1 thresholds names.

Definition at line 242 of file L1Menu.cxx.

243 {
244  std::vector<std::string> thrNames;
245  thrNames.reserve(m_thresholdsByName.size());
246  for( auto x : m_thresholdsByName ) {
247  thrNames.emplace_back(x.first);
248  }
249  return thrNames;
250 }

◆ thresholds() [1/2]

std::vector< std::shared_ptr< TrigConf::L1Threshold > > TrigConf::L1Menu::thresholds ( ) const

Access to list of all L1Thresholds.

Definition at line 267 of file L1Menu.cxx.

268 {
269  std::vector<std::shared_ptr<TrigConf::L1Threshold>> thrlist;
270  for ( const std::string & type : thresholdTypes() ) {
271  const auto & thrOfType = thresholds(type);
272  std::copy(thrOfType.begin(), thrOfType.end(), std::back_inserter(thrlist));
273  }
274  return thrlist;
275 }

◆ thresholds() [2/2]

const std::vector< std::shared_ptr< TrigConf::L1Threshold > > & TrigConf::L1Menu::thresholds ( const std::string &  typeName) const

Access to list of L1Thresholds by type.

Definition at line 254 of file L1Menu.cxx.

255 {
256  try {
257  return m_thresholdsByType.at(typeName);
258  }
259  catch(std::exception & ex) {
260  std::cerr << "No threshold type '" << typeName << "' defined in the thresholds section of the L1 menu" << std::endl;
261  throw;
262  }
263 }

◆ thresholdTypes()

std::vector< std::string > TrigConf::L1Menu::thresholdTypes ( ) const

List of L1 thresholds types.

Definition at line 231 of file L1Menu.cxx.

232 {
233  std::vector<std::string> thrTypeNames;
234  thrTypeNames.reserve(m_thresholdsByType.size());
235  for( auto x : m_thresholdsByType ) {
236  thrTypeNames.emplace_back(x.first);
237  }
238  return thrTypeNames;
239 }

◆ thrExtraInfo()

const TrigConf::L1ThrExtraInfo & TrigConf::L1Menu::thrExtraInfo ( ) const

Access to extra info for threshold types.

Definition at line 307 of file L1Menu.cxx.

308 {
309  return m_thrExtraInfo;
310 }

◆ topoAlgorithmNames()

std::vector< std::string > TrigConf::L1Menu::topoAlgorithmNames ( const std::string &  category) const

Access to topo algorithm names.

Parameters
categorymust be one of "TOPO", "MUTOPO", "MULTTOPO", or "R2TOPO"

TOPO ... new topo algorithms, R2TOPO ... Run-2 topo algorithms MUTOPO ... MUCTPI topo algorithms MULTTOPO ... multiplicity algorithms

Definition at line 347 of file L1Menu.cxx.

348 {
349  std::vector<std::string> algoNames;
350  try {
351  for(auto & entry : m_algorithmsByName.at(category) ) {
352  algoNames.push_back(entry.first);
353  }
354  }
355  catch(std::exception & ex) {
356  std::cerr << "No algorithm category '" << category << "' defined in the L1 menu" << std::endl;
357  throw;
358  }
359  return algoNames;
360 }

◆ topoAlgorithmOutputNames()

std::vector< std::string > TrigConf::L1Menu::topoAlgorithmOutputNames ( const std::string &  category) const

Access to topo algoritm output names.

Definition at line 364 of file L1Menu.cxx.

365 {
366  std::vector<std::string> outputNames;
367  try {
368  for(auto & entry : m_algorithmsByOutput.at(category) ) {
369  outputNames.push_back(entry.first);
370  }
371  }
372  catch(std::exception & ex) {
373  std::cerr << "No algorithm category '" << category << "' defined in the L1 menu" << std::endl;
374  throw;
375  }
376  return outputNames;
377 }

◆ update()

virtual void TrigConf::L1Menu::update ( )
inlineoverrideprivatevirtual

Update the internal data after modification of the data object.

Reimplemented from TrigConf::DataStructure.

Definition at line 160 of file L1Menu.h.

160 { load(); };

◆ version()

unsigned int TrigConf::L1Menu::version ( ) const

Accessor to the menu version.

Definition at line 173 of file L1Menu.cxx.

174 {
175  return getAttribute<unsigned int>("version");
176 }

Member Data Documentation

◆ m_algorithmsByCategory

std::map<std::string, std::vector<TrigConf::L1TopoAlgorithm> > TrigConf::L1Menu::m_algorithmsByCategory {}
private

algorithm maps

Definition at line 185 of file L1Menu.h.

◆ m_algorithmsByName

std::map<std::string, std::map<std::string, TrigConf::L1TopoAlgorithm*> > TrigConf::L1Menu::m_algorithmsByName {}
private

Definition at line 186 of file L1Menu.h.

◆ m_algorithmsByOutput

std::map<std::string, std::map<std::string, TrigConf::L1TopoAlgorithm*> > TrigConf::L1Menu::m_algorithmsByOutput {}
private

Definition at line 187 of file L1Menu.h.

◆ m_boards

std::map<std::string, TrigConf::L1Board> TrigConf::L1Menu::m_boards {}
private

board by name

Definition at line 175 of file L1Menu.h.

◆ m_connectors

std::map<std::string, TrigConf::L1Connector> TrigConf::L1Menu::m_connectors {}
private

connector by name

Definition at line 169 of file L1Menu.h.

◆ m_ctp

TrigConf::L1CTP TrigConf::L1Menu::m_ctp
private

Definition at line 189 of file L1Menu.h.

◆ m_dataPtr

const ptree* TrigConf::DataStructure::m_dataPtr { nullptr }
protectedinherited

Definition at line 257 of file DataStructure.h.

◆ m_dataSPtr

std::shared_ptr<ptree> TrigConf::DataStructure::m_dataSPtr { nullptr }
protectedinherited

Definition at line 256 of file DataStructure.h.

◆ m_initialized

bool TrigConf::DataStructure::m_initialized { false }
protectedinherited

if initialized, the underlying ptree is has been assigned to (can be empty)

Definition at line 254 of file DataStructure.h.

◆ m_name

std::string TrigConf::DataStructure::m_name {""}
protectedinherited

Definition at line 259 of file DataStructure.h.

◆ m_run

unsigned int TrigConf::L1Menu::m_run {3}
private

Definition at line 166 of file L1Menu.h.

◆ m_smk

unsigned int TrigConf::L1Menu::m_smk {0}
private

the supermasterkey

Definition at line 164 of file L1Menu.h.

◆ m_threshold2ConnectorName

std::map<std::string, std::string> TrigConf::L1Menu::m_threshold2ConnectorName {}
private

connector name by threshold name

Definition at line 172 of file L1Menu.h.

◆ m_thresholdsByName

std::map<std::string, std::shared_ptr<TrigConf::L1Threshold> > TrigConf::L1Menu::m_thresholdsByName {}
private

Definition at line 179 of file L1Menu.h.

◆ m_thresholdsByType

std::map<std::string, std::vector<std::shared_ptr<TrigConf::L1Threshold> > > TrigConf::L1Menu::m_thresholdsByType {}
private

threshold maps

Definition at line 178 of file L1Menu.h.

◆ m_thresholdsByTypeAndMapping

std::map<std::string, std::map<unsigned int, std::shared_ptr<TrigConf::L1Threshold> > > TrigConf::L1Menu::m_thresholdsByTypeAndMapping {}
private

Definition at line 180 of file L1Menu.h.

◆ m_thrExtraInfo

TrigConf::L1ThrExtraInfo TrigConf::L1Menu::m_thrExtraInfo
private

Definition at line 182 of file L1Menu.h.


The documentation for this class was generated from the following files:
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::L1ThrExtraInfo::clear
void clear()
Definition: L1ThrExtraInfo.cxx:75
checkxAOD.ds
ds
Definition: Tools/PyUtils/bin/checkxAOD.py:258
checkCorrelInHIST.conn
conn
Definition: checkCorrelInHIST.py:25
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
SGout2dot.alg
alg
Definition: SGout2dot.py:243
TrigConf::DataStructure::isInitialized
bool isInitialized() const
Definition: DataStructure.h:216
athena.path
path
python interpreter configuration --------------------------------------—
Definition: athena.py:128
TrigConf::L1Menu::load
void load()
Definition: L1Menu.cxx:20
find
std::string find(const std::string &s)
return a remapped string
Definition: hcg.cxx:135
TrigConf::DataStructure::empty
bool empty() const
Check if children exist.
Definition: DataStructure.h:219
TrigConf::DataStructure::printElement
static void printElement(const std::string &key, const ptree &data, uint level=0, std::ostream &os=std::cout)
Static function to print a ptree object.
Definition: DataStructure.cxx:279
TrigConf::L1Menu::m_thresholdsByType
std::map< std::string, std::vector< std::shared_ptr< TrigConf::L1Threshold > > > m_thresholdsByType
threshold maps
Definition: L1Menu.h:178
test_pyathena.pt
pt
Definition: test_pyathena.py:11
TrigConf::DataStructure::getAttribute
T getAttribute(const std::string &key, bool ignoreIfMissing=false, const T &def=T()) const
Access to simple attribute.
Definition: DataStructure.h:152
athena.value
value
Definition: athena.py:124
TrigConf::DataStructure::m_dataSPtr
std::shared_ptr< ptree > m_dataSPtr
Definition: DataStructure.h:256
TrigConf::DataStructure::name
virtual const std::string & name() const final
Definition: DataStructure.cxx:109
TrigConf::DataStructure::m_name
std::string m_name
Definition: DataStructure.h:259
x
#define x
find_tgc_unfilled_channelids.mapping
mapping
Definition: find_tgc_unfilled_channelids.py:17
XMLtoHeader.count
count
Definition: XMLtoHeader.py:85
TrigConf::L1Menu::m_smk
unsigned int m_smk
the supermasterkey
Definition: L1Menu.h:164
TrigConf::DataStructure::setData
void setData(const ptree &data)
Setting the configuration data.
Definition: DataStructure.cxx:39
python.iconfTool.models.loaders.level
level
Definition: loaders.py:20
TrigConf::L1Menu::m_thresholdsByName
std::map< std::string, std::shared_ptr< TrigConf::L1Threshold > > m_thresholdsByName
Definition: L1Menu.h:179
TrigConf::L1TopoAlgorithm::AlgorithmType::SORTING
@ SORTING
TrigConf::L1Menu::m_connectors
std::map< std::string, TrigConf::L1Connector > m_connectors
connector by name
Definition: L1Menu.h:169
TrigConf::L1Menu::m_ctp
TrigConf::L1CTP m_ctp
Definition: L1Menu.h:189
TrigConf::L1CTP::clear
virtual void clear() override
Clearing the configuration data.
Definition: L1CTP.cxx:58
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
uint
unsigned int uint
Definition: LArOFPhaseFill.cxx:20
TrigConf::L1Threshold::createThreshold
static std::shared_ptr< L1Threshold > createThreshold(const std::string &name, const std::string &type, std::weak_ptr< L1ThrExtraInfoBase > extraInfo, const ptree &data)
static method to create type-specific L1Thresholds
Definition: L1ThresholdBase.cxx:28
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
beamspotman.n
n
Definition: beamspotman.py:731
ReweightUtils.category
category
Definition: ReweightUtils.py:15
calibdata.exception
exception
Definition: calibdata.py:496
res
std::pair< std::vector< unsigned int >, bool > res
Definition: JetGroupProductTest.cxx:14
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::thresholdTypes
std::vector< std::string > thresholdTypes() const
List of L1 thresholds types.
Definition: L1Menu.cxx:231
TrigConf::DataStructure::className
virtual std::string className() const
A string that is the name of the class.
Definition: DataStructure.cxx:104
histSizes.list
def list(name, path='/')
Definition: histSizes.py:38
TrigConf::L1Menu::smk
unsigned int smk() const
setter and getter for the supermasterkey
Definition: L1Menu.cxx:191
TrigConf::L1ThrExtraInfo::addExtraInfo
std::weak_ptr< TrigConf::L1ThrExtraInfoBase > addExtraInfo(const std::string &thrTypeName, const boost::property_tree::ptree &data)
Definition: L1ThrExtraInfo.cxx:82
TrigConf::L1TopoAlgorithm::AlgorithmType::MULTIPLICITY
@ MULTIPLICITY
TrigConf::L1Menu::m_thrExtraInfo
TrigConf::L1ThrExtraInfo m_thrExtraInfo
Definition: L1Menu.h:182
ReadFromCoolCompare.os
os
Definition: ReadFromCoolCompare.py:231
TrigConf::L1Menu::boardNames
std::vector< std::string > boardNames() const
Board names.
Definition: L1Menu.cxx:441
TrigConf::L1Menu::m_threshold2ConnectorName
std::map< std::string, std::string > m_threshold2ConnectorName
connector name by threshold name
Definition: L1Menu.h:172
merge.output
output
Definition: merge.py:17
GetAllXsec.entry
list entry
Definition: GetAllXsec.py:132
TrigConf::L1Menu::m_boards
std::map< std::string, TrigConf::L1Board > m_boards
board by name
Definition: L1Menu.h:175
ptree
boost::property_tree::ptree ptree
Definition: JsonFileLoader.cxx:16
TrigConf::DataStructure::getList
std::vector< DataStructure > getList(const std::string &pathToChild, bool ignoreIfMissing=false) const
Access to array structure.
Definition: DataStructure.cxx:158
TrigConf::DataStructure::m_initialized
bool m_initialized
if initialized, the underlying ptree is has been assigned to (can be empty)
Definition: DataStructure.h:254
XMLtoHeader.outputNames
outputNames
Definition: XMLtoHeader.py:18
TrigJetMonitorAlgorithm.items
items
Definition: TrigJetMonitorAlgorithm.py:79
item
Definition: ItemListSvc.h:43
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
lumiFormat.outputName
string outputName
Definition: lumiFormat.py:65
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
python.PyAthena.v
v
Definition: PyAthena.py:154
TrigConf::L1TopoAlgorithm::AlgorithmType::DECISION
@ DECISION
TrigConf::L1TopoAlgorithm::AlgorithmType
AlgorithmType
Definition: L1TopoAlgorithm.h:23
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
DeMoScan.first
bool first
Definition: DeMoScan.py:536
TrigConf::DataStructure::clear
virtual void clear()
Clearing the configuration data.
Definition: DataStructure.cxx:65
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
str
Definition: BTagTrackIpAccessor.cxx:11
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798
TrigConf::DataStructure::ownsData
bool ownsData() const
Definition: DataStructure.h:242
dqt_zlumi_alleff_HIST.tl
tl
Definition: dqt_zlumi_alleff_HIST.py:73
calibdata.copy
bool copy
Definition: calibdata.py:27
TrigConf::L1Menu::m_thresholdsByTypeAndMapping
std::map< std::string, std::map< unsigned int, std::shared_ptr< TrigConf::L1Threshold > > > m_thresholdsByTypeAndMapping
Definition: L1Menu.h:180
python.PyAthena.obj
obj
Definition: PyAthena.py:132
TrigConf::DataStructure::DataStructure
DataStructure()
Default constructor, leading to an uninitialized configuration object.
Definition: DataStructure.cxx:11
xAOD::bool
setBGCode setTAP setLVL2ErrorBits bool
Definition: TrigDecision_v1.cxx:60
python.compressB64.c
def c
Definition: compressB64.py:93
python.AutoConfigFlags.msg
msg
Definition: AutoConfigFlags.py:7
TSU::T
unsigned long long T
Definition: L1TopoDataTypes.h:35
TrigConf::DataStructure::m_dataPtr
const ptree * m_dataPtr
Definition: DataStructure.h:257
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37
TrigConf::DataStructure::update
virtual void update()
Update the internal data after modification of the data object.
Definition: DataStructure.h:252