ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigConfiguration
TrigConfData
src
L1CTP.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
TrigConfData/L1CTP.h
"
6
7
TrigConf::L1CTP::L1CTP
(
const
std::string &
name
,
const
boost::property_tree::ptree &
data
)
8
:
DataStructure
(
name
,
data
)
9
{
10
load
();
11
}
12
13
void
14
TrigConf::L1CTP::load
()
15
{
16
if
(!
isInitialized
() ||
empty
() ) {
17
return
;
18
}
19
auto
inputs =
data
().get_child(
"inputs"
);
20
const
std::string prefix{
"ctpin.slot"
};
21
const
std::string suffix{
".connector"
};
22
const
std::string emptyStr{};
23
for
(
size_t
slot = 7; slot<=9; ++slot) {
24
const
std::string slotStr = std::to_string(slot);
25
for
(
size_t
conn=0; conn<4; ++conn) {
26
m_ctpin
[slot-7][conn] = inputs.get_optional<std::string>(prefix + slotStr + suffix + std::to_string(conn)).get_value_or(emptyStr);
27
}
28
}
29
const
auto
&
electrical
= inputs.get_child(
"electrical"
);
30
const
std::string connectorStr{
"connector"
};
31
for
(
size_t
i=0; i<3; ++i) {
32
m_electrical
[i] =
electrical
.get_optional<std::string>(connectorStr + std::to_string(i)).get_value_or(emptyStr);
33
}
34
if
(
auto
optical
= inputs.get_child_optional(
"optical"
)) {
35
for
(
size_t
i=0; i<12; ++i) {
36
m_optical
[i] =
optical
->get_optional<std::string>(connectorStr + std::to_string(i)).get_value_or(emptyStr);
37
}
38
}
39
const
std::string multiplicityStr{
"multiplicity"
};
40
const
std::string thrStr{
"thr"
};
41
for
(
auto
& mon :
data
().get_child(
"monitoring.ctpmon"
) ) {
42
std::string monName = mon.first;
43
size_t
multiplicity = mon.second.get_child(multiplicityStr).get_value<
size_t
>();
44
std::string thr = mon.second.get_child(thrStr).get_value<std::string>();
45
m_ctpmon
.emplace( std::piecewise_construct,
46
std::forward_as_tuple(monName),
47
std::forward_as_tuple(multiplicity, thr)
48
);
49
}
50
auto
ctpinMon
=
data
().get_child_optional(
"monitoring.ctpin"
);
51
if
(
ctpinMon
) {
52
for
(
auto
& mon : *
ctpinMon
) {
53
std::string monName = mon.first;
54
size_t
multiplicity = mon.second.get_child(multiplicityStr).get_value<
size_t
>();
55
std::string thr = mon.second.get_child(thrStr).get_value<std::string>();
56
m_ctpinMon
.emplace( std::piecewise_construct,
57
std::forward_as_tuple(monName),
58
std::forward_as_tuple(multiplicity, thr)
59
);
60
}
61
}
62
}
63
64
void
65
TrigConf::L1CTP::clear
()
66
{
67
m_ctpmon
.clear();
68
}
69
70
const
std::string &
71
TrigConf::L1CTP::ctpin
(
size_t
slot,
size_t
conn)
const
72
{
73
if
(slot<7 or slot>9) {
74
throw
std::runtime_error(
"CTPIN slot must be between 7 and 9, but "
+ std::to_string(slot) +
"was specified"
);
75
}
76
if
(conn>3) {
77
throw
std::runtime_error(
"CTPIN connector must be between 0 and 3, but "
+ std::to_string(conn) +
"was specified"
);
78
}
79
return
m_ctpin
[slot-7][conn];
80
}
81
82
83
const
std::string &
84
TrigConf::L1CTP::electrical
(
size_t
conn)
const
{
85
if
(conn>2) {
86
throw
std::runtime_error(
"Electrical connector must be between 0 and 2, but "
+ std::to_string(conn) +
"was specified"
);
87
}
88
return
m_electrical
[conn];
89
}
90
91
const
std::string &
92
TrigConf::L1CTP::optical
(
size_t
conn)
const
{
93
if
(conn>11) {
94
throw
std::runtime_error(
"Optical connector must be between 0 and 11, but "
+ std::to_string(conn) +
"was specified"
);
95
}
96
return
m_optical
[conn];
97
}
L1CTP.h
empty
static const Attributes_t empty
Definition
XmlStreamer.cxx:16
TrigConf::DataStructure::name
virtual const std::string & name() const final
Definition
DataStructure.cxx:108
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::L1CTP::clear
virtual void clear() override
Clearing the configuration data.
Definition
L1CTP.cxx:65
TrigConf::L1CTP::m_electrical
std::string m_electrical[3]
Definition
L1CTP.h:68
TrigConf::L1CTP::m_ctpinMon
std::map< std::string, std::pair< size_t, std::string > > m_ctpinMon
Definition
L1CTP.h:72
TrigConf::L1CTP::m_optical
std::string m_optical[12]
Definition
L1CTP.h:69
TrigConf::L1CTP::m_ctpin
std::string m_ctpin[3][4]
Definition
L1CTP.h:67
TrigConf::L1CTP::m_ctpmon
std::map< std::string, std::pair< size_t, std::string > > m_ctpmon
Definition
L1CTP.h:71
TrigConf::L1CTP::ctpinMon
const std::map< std::string, std::pair< size_t, std::string > > & ctpinMon() const
CTPIN monitors.
Definition
L1CTP.h:56
TrigConf::L1CTP::load
void load()
Definition
L1CTP.cxx:14
TrigConf::L1CTP::electrical
const std::string & electrical(size_t conn) const
Definition
L1CTP.cxx:84
TrigConf::L1CTP::optical
const std::string & optical(size_t conn) const
Definition
L1CTP.cxx:92
TrigConf::L1CTP::ctpin
const std::string & ctpin(size_t slot, size_t conn) const
name of ctpin connector
Definition
L1CTP.cxx:71
TrigConf::L1CTP::L1CTP
L1CTP()=default
Generated on
for ATLAS Offline Software by
1.17.0