ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigConfiguration
TrigConfData
src
L1PrescalesSet.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/L1PrescalesSet.h
"
6
7
TrigConf::L1PrescalesSet::L1PrescalesSet
()
8
{}
9
10
TrigConf::L1PrescalesSet::L1PrescalesSet
(
const
boost::property_tree::ptree &
data
)
11
:
DataStructure
(
data
)
12
{
13
load
();
14
}
15
16
void
17
TrigConf::L1PrescalesSet::load
()
18
{
19
m_name
=
getAttribute
(
"name"
);
20
const
auto
& cuts =
data
().get_child(
"cutValues"
);
21
for
(
auto
& c : cuts ) {
22
L1Prescale
ps;
23
ps.cut = c.second.get_child(
"cut"
).get_value<int32_t>();
24
ps.enabled = c.second.get_child(
"enabled"
).get_value<
bool
>();
25
ps.prescale =
getPrescaleFromCut
(ps.cut);
26
m_prescales
[c.first] = ps;
27
}
28
}
29
30
void
31
TrigConf::L1PrescalesSet::clear
()
32
{
33
m_psk
= 0;
34
m_prescales
.clear();
35
}
36
37
std::size_t
38
TrigConf::L1PrescalesSet::size
()
const
39
{
40
return
m_prescales
.size();
41
}
42
43
unsigned
int
44
TrigConf::L1PrescalesSet::psk
()
const
{
45
return
m_psk
;
46
}
47
48
void
49
TrigConf::L1PrescalesSet::setPSK
(
unsigned
int
psk
) {
50
m_psk
=
psk
;
51
}
52
53
const
TrigConf::L1PrescalesSet::L1Prescale
&
54
TrigConf::L1PrescalesSet::prescale
(
const
std::string & itemName)
const
{
55
return
m_prescales
.at(itemName);
56
}
57
const
std::map<std::string, TrigConf::L1PrescalesSet::L1Prescale>&
58
TrigConf::L1PrescalesSet::prescales
()
const
{
59
return
m_prescales
;
60
}
61
73
double
74
TrigConf::L1PrescalesSet::getPrescaleFromCut
(uint32_t cut)
const
{
75
return
static_cast<
double
>
(0xFFFFFF) / ( 0x1000000 - cut );
76
}
77
L1PrescalesSet.h
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::L1PrescalesSet::m_prescales
std::map< std::string, L1Prescale > m_prescales
Definition
L1PrescalesSet.h:71
TrigConf::L1PrescalesSet::m_psk
unsigned int m_psk
the prescale key
Definition
L1PrescalesSet.h:68
TrigConf::L1PrescalesSet::size
std::size_t size() const
number of L1 prescales
Definition
L1PrescalesSet.cxx:38
TrigConf::L1PrescalesSet::clear
virtual void clear() override
Clearing the configuration data.
Definition
L1PrescalesSet.cxx:31
TrigConf::L1PrescalesSet::psk
unsigned int psk() const
setter and getter for the L1 prescale key
Definition
L1PrescalesSet.cxx:44
TrigConf::L1PrescalesSet::prescale
const L1Prescale & prescale(const std::string &itemName) const
Definition
L1PrescalesSet.cxx:54
TrigConf::L1PrescalesSet::setPSK
void setPSK(unsigned int psk)
Definition
L1PrescalesSet.cxx:49
TrigConf::L1PrescalesSet::prescales
const std::map< std::string, L1Prescale > & prescales() const
Definition
L1PrescalesSet.cxx:58
TrigConf::L1PrescalesSet::L1PrescalesSet
L1PrescalesSet()
Constructor.
Definition
L1PrescalesSet.cxx:7
TrigConf::L1PrescalesSet::getPrescaleFromCut
double getPrescaleFromCut(uint32_t cut) const
prescale = 2*24/(cut+1.)
Definition
L1PrescalesSet.cxx:74
TrigConf::L1PrescalesSet::load
void load()
Definition
L1PrescalesSet.cxx:17
TrigConf::L1PrescalesSet::L1Prescale
Definition
L1PrescalesSet.h:22
Generated on
for ATLAS Offline Software by
1.17.0