ATLAS Offline Software
Loading...
Searching...
No Matches
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
6
9
10TrigConf::L1PrescalesSet::L1PrescalesSet(const boost::property_tree::ptree & data)
12{
13 load();
14}
15
16void
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
30void
36
37std::size_t
39{
40 return m_prescales.size();
41}
42
43unsigned int
45 return m_psk;
46}
47
48void
50 m_psk = psk;
51}
52
54TrigConf::L1PrescalesSet::prescale(const std::string & itemName) const {
55 return m_prescales.at(itemName);
56}
57const std::map<std::string, TrigConf::L1PrescalesSet::L1Prescale>&
61
73double
75 return static_cast<double>(0xFFFFFF) / ( 0x1000000 - cut );
76}
77
char data[hepevt_bytes_allocation_ATLAS]
Definition HepEvt.cxx:11
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.
std::map< std::string, L1Prescale > m_prescales
unsigned int m_psk
the prescale key
std::size_t size() const
number of L1 prescales
virtual void clear() override
Clearing the configuration data.
unsigned int psk() const
setter and getter for the L1 prescale key
const L1Prescale & prescale(const std::string &itemName) const
void setPSK(unsigned int psk)
const std::map< std::string, L1Prescale > & prescales() const
double getPrescaleFromCut(uint32_t cut) const
prescale = 2*24/(cut+1.)