ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigConfiguration
TrigConfData
src
L1Board.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
TrigConfData/L1Board.h
"
6
7
#include <stdexcept>
8
#define BOOST_BIND_GLOBAL_PLACEHOLDERS
// Needed to silence Boost pragma message
9
#include <boost/property_tree/json_parser.hpp>
10
11
using namespace
std
;
12
13
TrigConf::L1Board::L1Board
()
14
{}
15
16
TrigConf::L1Board::L1Board
(
const
std::string & boardName,
const
boost::property_tree::ptree &
data
)
17
:
DataStructure
(
data
)
18
{
19
m_name
= boardName;
20
L1Board::update
();
21
}
22
23
std::string
24
TrigConf::L1Board::className
()
const
{
25
return
"L1Board"
;
26
}
27
28
void
29
TrigConf::L1Board::update
()
30
{
31
if
(!
isInitialized
() ||
empty
() ) {
32
return
;
33
}
34
m_name
=
getAttribute
(
"name"
,
true
,
m_name
);
35
m_legacy
=
getAttribute<bool>
(
"legacy"
,
true
,
false
);
// if legacy flag doesn't exist, it is considered to be false
36
37
std::string
boardType
(
getAttribute
(
"type"
));
38
if
(
boardType
==
"MUCTPI"
) {
39
m_boardType
=
BoardType::MUCTPI
;
40
}
else
if
(
boardType
==
"CTPIN"
) {
41
m_boardType
=
BoardType::CTPIN
;
42
}
else
if
(
boardType
==
"TOPO"
) {
43
m_boardType
=
BoardType::TOPO
;
44
}
else
if
(
boardType
==
"MERGER"
) {
45
m_boardType
=
BoardType::MERGER
;
46
}
else
{
47
throw
std::runtime_error(
"Unknown board type "
+
boardType
);
48
}
49
50
// connectors
51
for
(
auto
& conn :
getList
(
"connectors"
) ) {
52
m_connectorNames
.push_back(conn.getValue<std::string>());
53
}
54
}
55
56
57
std::size_t
58
TrigConf::L1Board::size
()
const
59
{
60
return
m_connectorNames
.size();
61
}
62
63
TrigConf::L1Board::BoardType
64
TrigConf::L1Board::boardType
()
const
65
{
66
return
m_boardType
;
67
}
68
69
std::string
70
TrigConf::L1Board::type
()
const
71
{
72
switch
(
boardType
() ) {
73
case
BoardType::CTPIN
:
74
return
"CTPIN"
;
75
case
BoardType::MUCTPI
:
76
return
"MUCTPI"
;
77
case
BoardType::TOPO
:
78
return
"TOPO"
;
79
case
BoardType::MERGER
:
80
return
"MERGER"
;
81
default
:
82
return
""
;
83
}
84
}
85
86
bool
87
TrigConf::L1Board::legacy
()
const
88
{
89
return
m_legacy
;
90
}
91
92
const
std::vector<std::string> &
93
TrigConf::L1Board::connectorNames
()
const
94
{
95
return
m_connectorNames
;
96
}
L1Board.h
empty
static const Attributes_t empty
Definition
XmlStreamer.cxx:16
TrigConf::DataStructure::getList
std::vector< DataStructure > getList(const std::string &pathToChild, bool ignoreIfMissing=false) const
Access to array structure.
Definition
DataStructure.cxx:157
TrigConf::DataStructure::isInitialized
bool isInitialized() const
Definition
DataStructure.h:216
TrigConf::DataStructure::data
const ptree & data() const
Access to the underlying data, if needed.
Definition
DataStructure.h:83
TrigConf::DataStructure::DataStructure
DataStructure()
Default constructor, leading to an uninitialized configuration object.
Definition
DataStructure.cxx:11
TrigConf::DataStructure::m_name
std::string m_name
Definition
DataStructure.h:259
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
TrigConf::L1Board::update
virtual void update() override
Update the internal members.
Definition
L1Board.cxx:29
TrigConf::L1Board::L1Board
L1Board()
Constructor.
Definition
L1Board.cxx:13
TrigConf::L1Board::BoardType
BoardType
Definition
L1Board.h:26
TrigConf::L1Board::BoardType::TOPO
@ TOPO
Definition
L1Board.h:26
TrigConf::L1Board::BoardType::MERGER
@ MERGER
Definition
L1Board.h:26
TrigConf::L1Board::BoardType::CTPIN
@ CTPIN
Definition
L1Board.h:26
TrigConf::L1Board::BoardType::MUCTPI
@ MUCTPI
Definition
L1Board.h:26
TrigConf::L1Board::legacy
bool legacy() const
Accessor to the connector type.
Definition
L1Board.cxx:87
TrigConf::L1Board::type
std::string type() const
Definition
L1Board.cxx:70
TrigConf::L1Board::boardType
BoardType boardType() const
Definition
L1Board.cxx:64
TrigConf::L1Board::m_legacy
bool m_legacy
Definition
L1Board.h:64
TrigConf::L1Board::className
virtual std::string className() const override
A string that is the name of the class.
Definition
L1Board.cxx:24
TrigConf::L1Board::size
std::size_t size() const
Accessor to the number of connectors.
Definition
L1Board.cxx:58
TrigConf::L1Board::m_connectorNames
std::vector< std::string > m_connectorNames
Definition
L1Board.h:65
TrigConf::L1Board::connectorNames
const std::vector< std::string > & connectorNames() const
Accessor to connector names.
Definition
L1Board.cxx:93
TrigConf::L1Board::m_boardType
BoardType m_boardType
Definition
L1Board.h:63
std
STL namespace.
Generated on
for ATLAS Offline Software by
1.17.0