ATLAS Offline Software
HLTMenu.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #include "TrigConfData/HLTMenu.h"
6 
7 using TV = boost::property_tree::ptree::value_type; // tree-value type
8 using namespace std;
9 
11 {}
12 
15 {
16  load();
17 }
18 
19 void
21 {
22  if(! isInitialized() || empty() ) {
23  return;
24  }
25  m_name = getAttribute("name");
26 }
27 
28 void
30 {
31  m_smk = 0;
32 }
33 
34 std::size_t
36 {
37  return data().get_child("chains").size();
38 }
39 
40 unsigned int
42  return m_smk;
43 }
44 
45 void
47  m_smk = smk;
48 }
49 
52 {
53  return {data().get_child("chains"), 0, [](auto & x){auto chain = Chain(x.first, x.second); return chain; }};
54 }
55 
58 {
59  auto & pt = data().get_child("chains");
60  return { pt, pt.size(), [](auto & x){return Chain(x.second);} };
61 }
62 
63 
64 std::vector<TrigConf::DataStructure>
66 {
67  std::vector<DataStructure> strlist;
68  auto streams = data().get_child_optional("streams");
69  if(streams) {
70  strlist.reserve(streams->size());
71  for( auto & strData : *streams ) {
72  strlist.emplace_back( strData.second );
73  }
74  }
75  return strlist;
76 }
77 
78 
79 std::map<std::string, std::vector<std::string>>
81 {
82  std::map<std::string, std::vector<std::string>> result;
83  const auto & sequencers = getObject("sequencers");
84 
85  for( auto & sequence : sequencers.getKeys() ) {
86  for( auto & alg : sequencers.getList(sequence) ) {
87  result[sequence].emplace_back(alg.getValue<std::string>());
88  }
89  }
90 
91  return result;
92 }
93 
94 
95 void
97 {
98  cout << "HLT menu '" << name() << "'" << endl;
99  cout << "Streams: " << streams().size() << endl;
100  cout << "Chains: " << size() << endl;
101  if(full) {
102  int c(0);
103  for( auto & chain : *this ) {
104  cout << " " << c++ << ": " << chain.name() << endl;
105  }
106  }
107 }
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
SGout2dot.alg
alg
Definition: SGout2dot.py:243
get_generator_info.result
result
Definition: get_generator_info.py:21
runLayerRecalibration.chain
chain
Definition: runLayerRecalibration.py:175
TrigConf::HLTMenu::printMenu
void printMenu(bool full=false) const
print overview of L1 Menu
Definition: HLTMenu.cxx:96
python.outputTest_v2.streams
streams
Definition: outputTest_v2.py:55
TrigConf::HLTMenu::smk
unsigned int smk() const
setter and getter for the supermasterkey
Definition: HLTMenu.cxx:41
RunEBWeightsComputation.smk
smk
Definition: RunEBWeightsComputation.py:87
test_pyathena.pt
pt
Definition: test_pyathena.py:11
TrigConf::HLTMenu::setSMK
void setSMK(unsigned int psk)
Definition: HLTMenu.cxx:46
x
#define x
empty
bool empty(TH1 *h)
Definition: computils.cxx:294
TrigConf::HLTMenu::load
void load()
Definition: HLTMenu.cxx:20
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
TrigConf::HLTMenu::streams
std::vector< DataStructure > streams() const
Accessor to the connected output streams.
Definition: HLTMenu.cxx:65
TrigConf::HLTMenu::begin
const_iterator begin() const
Begin of the HLT chains list.
Definition: HLTMenu.cxx:51
TrigConf::HLTMenu::clear
virtual void clear() override
Clearing the configuration data.
Definition: HLTMenu.cxx:29
TrigConf::HLTMenu::size
std::size_t size() const
Accessor to the number of HLT chains.
Definition: HLTMenu.cxx:35
TrigConf::ConstIter
Forward iterator over an iterable of type V returning an object of type T.
Definition: ConstIter.h:32
ptree
boost::property_tree::ptree ptree
Definition: JsonFileLoader.cxx:16
TrigConf::HLTMenu::HLTMenu
HLTMenu()
Constructor.
Definition: HLTMenu.cxx:10
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
TrigConf::DataStructure
Base class for Trigger configuration data and wrapper around underlying representation.
Definition: DataStructure.h:37
find_data.full
full
Definition: find_data.py:27
TrigConf::HLTMenu::sequencers
std::map< std::string, std::vector< std::string > > sequencers() const
Accessor to the sequencers.
Definition: HLTMenu.cxx:80
HLTMenu.h
TrigConf::Chain
HLT chain configuration.
Definition: TrigConfData/TrigConfData/HLTChain.h:18
python.compressB64.c
def c
Definition: compressB64.py:93
TV
boost::property_tree::ptree::value_type TV
Definition: HLTMenu.cxx:7
TrigConf::HLTMenu::end
const_iterator end() const
End of the HLT chains list.
Definition: HLTMenu.cxx:57