ATLAS Offline Software
Loading...
Searching...
No Matches
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
6
7using TV = boost::property_tree::ptree::value_type; // tree-value type
8using namespace std;
9
12
13TrigConf::HLTMenu::HLTMenu(const boost::property_tree::ptree & data)
15{
16 load();
17}
18
19void
21{
22 if(! isInitialized() || empty() ) {
23 return;
24 }
25 m_name = getAttribute("name");
26}
27
28void
33
34std::size_t
36{
37 return data().get_child("chains").size();
38}
39
40unsigned int
42 return m_smk;
43}
44
45void
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
64std::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
79std::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
95void
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}
boost::property_tree::ptree::value_type TV
Definition HLTMenu.cxx:7
char data[hepevt_bytes_allocation_ATLAS]
Definition HepEvt.cxx:11
#define x
static const Attributes_t empty
virtual const std::string & name() const final
const ptree & data() const
Access to the underlying data, if needed.
DataStructure()
Default constructor, leading to an uninitialized configuration object.
T getAttribute(const std::string &key, bool ignoreIfMissing=false, const T &def=T()) const
Access to simple attribute.
DataStructure getObject(const std::string &pathToChild, bool ignoreIfMissing=false) const
Access to configuration object.
std::vector< DataStructure > streams() const
Accessor to the connected output streams.
Definition HLTMenu.cxx:65
const_iterator end() const
End of the HLT chains list.
Definition HLTMenu.cxx:57
const_iterator begin() const
Begin of the HLT chains list.
Definition HLTMenu.cxx:51
ConstIter< ptree, Chain > const_iterator
Iterator over the HLT chains.
Definition HLTMenu.h:50
std::map< std::string, std::vector< std::string > > sequencers() const
Accessor to the sequencers.
Definition HLTMenu.cxx:80
void setSMK(unsigned int psk)
Definition HLTMenu.cxx:46
std::size_t size() const
Accessor to the number of HLT chains.
Definition HLTMenu.cxx:35
void printMenu(bool full=false) const
print overview of L1 Menu
Definition HLTMenu.cxx:96
HLTMenu()
Constructor.
Definition HLTMenu.cxx:10
virtual void clear() override
Clearing the configuration data.
Definition HLTMenu.cxx:29
unsigned int m_smk
the supermasterkey
Definition HLTMenu.h:83
unsigned int smk() const
setter and getter for the supermasterkey
Definition HLTMenu.cxx:41
STL namespace.