ATLAS Offline Software
L1PrescalesSet.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef TRIGCONFDATA_L1PRESCALESSET_H
6 #define TRIGCONFDATA_L1PRESCALESSET_H
7 
9 
10 #include <map>
11 
12 namespace TrigConf {
13 
19  class L1PrescalesSet final : public DataStructure {
20  public:
21 
22  struct L1Prescale {
23  uint32_t cut { 1 };
24  bool enabled { false };
25  double prescale { 1 };
26  };
27 
28  double getPrescaleFromCut(uint32_t cut) const;
29 
32  L1PrescalesSet(const L1PrescalesSet &) = default;
34 
38  L1PrescalesSet(const ptree & data);
39 
41  virtual ~L1PrescalesSet() override = default;
42 
43  // class name
44  virtual std::string className() const override {
45  return "L1PrescaleSet";
46  }
47 
49  std::size_t size() const;
50 
52  unsigned int psk() const;
53  void setPSK(unsigned int psk);
54 
55  const L1Prescale & prescale(const std::string & itemName) const;
56  const std::map<std::string, L1Prescale>& prescales() const;
57 
59  virtual void clear() override;
60 
61  private:
62 
64  virtual void update() override { load(); };
65  void load();
66 
68  unsigned int m_psk {0};
69 
70  // maps L1 item names to prescales
71  std::map<std::string, L1Prescale> m_prescales;
72 
73  };
74 }
75 
76 #ifndef TRIGCONF_STANDALONE
77 #ifndef XAOD_STANDALONE
78 
79 #include "AthenaKernel/CLASS_DEF.h"
80 CLASS_DEF( TrigConf::L1PrescalesSet , 146597935 , 1 )
81 
82 #include "AthenaKernel/CondCont.h"
84 
85 #endif
86 #endif
87 
88 #endif
TrigConf::DataStructure::data
const ptree & data() const
Access to the underlying data, if needed.
Definition: DataStructure.h:83
TrigConf::L1PrescalesSet::L1Prescale::cut
uint32_t cut
Definition: L1PrescalesSet.h:23
TrigConf::L1PrescalesSet::update
virtual void update() override
Update the internal prescale map after modification of the data object.
Definition: L1PrescalesSet.h:64
TrigConf::L1PrescalesSet::L1Prescale::enabled
bool enabled
Definition: L1PrescalesSet.h:24
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
TrigConf::L1PrescalesSet::m_psk
unsigned int m_psk
the prescale key
Definition: L1PrescalesSet.h:68
TrigConf::L1PrescalesSet::L1PrescalesSet
L1PrescalesSet()
Constructor.
Definition: L1PrescalesSet.cxx:7
TrigConf::L1PrescalesSet::setPSK
void setPSK(unsigned int psk)
Definition: L1PrescalesSet.cxx:49
TrigConf
Forward iterator to traverse the main components of the trigger configuration.
Definition: Config.h:22
BindingsTest.cut
cut
This script demonstrates how to call a C++ class from Python Also how to use PyROOT is shown.
Definition: BindingsTest.py:13
TrigConf::L1PrescalesSet::psk
unsigned int psk() const
setter and getter for the L1 prescale key
Definition: L1PrescalesSet.cxx:44
TrigConf::L1PrescalesSet::getPrescaleFromCut
double getPrescaleFromCut(uint32_t cut) const
prescale = 2*24/(cut+1.)
Definition: L1PrescalesSet.cxx:74
TrigConf::L1PrescalesSet::clear
virtual void clear() override
Clearing the configuration data.
Definition: L1PrescalesSet.cxx:31
TrigConf::L1PrescalesSet::L1Prescale
Definition: L1PrescalesSet.h:22
TrigConf::L1PrescalesSet
L1 menu configuration.
Definition: L1PrescalesSet.h:19
TrigConf::L1PrescalesSet::m_prescales
std::map< std::string, L1Prescale > m_prescales
Definition: L1PrescalesSet.h:71
TrigConf::L1PrescalesSet::load
void load()
Definition: L1PrescalesSet.cxx:17
TrigConf::L1PrescalesSet::~L1PrescalesSet
virtual ~L1PrescalesSet() override=default
Destructor.
TrigConf::L1PrescalesSet::prescale
const L1Prescale & prescale(const std::string &itemName) const
Definition: L1PrescalesSet.cxx:54
TrigConf::L1PrescalesSet::className
virtual std::string className() const override
A string that is the name of the class.
Definition: L1PrescalesSet.h:44
TrigConf::DataStructure
Base class for Trigger configuration data and wrapper around underlying representation.
Definition: DataStructure.h:37
TrigConf::L1PrescalesSet::L1Prescale::prescale
double prescale
Definition: L1PrescalesSet.h:25
TrigConf::L1PrescalesSet::L1PrescalesSet
L1PrescalesSet(L1PrescalesSet &&)=default
CLASS_DEF
#define CLASS_DEF(NAME, CID, VERSION)
associate a clid and a version to a type eg
Definition: Control/AthenaKernel/AthenaKernel/CLASS_DEF.h:64
TrigConf::L1PrescalesSet::prescales
const std::map< std::string, L1Prescale > & prescales() const
Definition: L1PrescalesSet.cxx:58
CONDCONT_DEF
CONDCONT_DEF(TrigConf::L1PrescalesSet, 124562173)
TrigConf::L1PrescalesSet::size
std::size_t size() const
number of L1 prescales
Definition: L1PrescalesSet.cxx:38
TrigConf::L1PrescalesSet::L1PrescalesSet
L1PrescalesSet(const L1PrescalesSet &)=default
DataStructure.h
TrigConf::DataStructure::ptree
boost::property_tree::ptree ptree
Definition: DataStructure.h:40
CLASS_DEF.h
macros to associate a CLID to a type