Belle II Software  release-08-01-10
HardwareClockSettings.h
1 /**************************************************************************
2  * basf2 (Belle II Analysis Software Framework) *
3  * Author: The Belle II Collaboration *
4  * *
5  * See git log for contributors and copyright holders. *
6  * This file is licensed under LGPL-3.0, see LICENSE.md. *
7  **************************************************************************/
8 #pragma once
9 
10 #include <framework/gearbox/Const.h>
11 #include <TObject.h>
12 #include <map>
13 
14 namespace Belle2 {
25  class HardwareClockSettings : public TObject {
26 
27  public:
28 
31 
38  double getClockPrescale(Const::EDetector detector, std::string label) const;
39 
46  double getClockFrequency(Const::EDetector detector, std::string label) const;
47 
52  double getGlobalClockFrequency() const;
53 
58  double getAcceleratorRF() const;
59 
66  void setClockPrescale(const Const::EDetector detector, std::string label, double prescale);
67 
74  void setClockFrequency(const Const::EDetector detector, std::string label, double frequency);
75 
80  void setAcceleratorRF(double acceleratorRF);
81 
88  bool isPrescaleAvailable(Const::EDetector detector, std::string label) const;
89 
97  bool isFrequencyAvailable(Const::EDetector detector, std::string label) const;
98 
102  void print() const;
103 
104  private:
108  std::map<Const::EDetector, std::map<std::string, double>> m_prescaleMap;
109 
114  std::map<Const::EDetector, std::map<std::string, double>> m_clocksMap;
115 
119  double m_acceleratorRF = 0;
120 
121  ClassDef(HardwareClockSettings, 3)
122 
123  };
124 
126 }
EDetector
Enum for identifying the detector components (detector and subdetector).
Definition: Const.h:42
Database object containing the nominal accelerator RF value and the prescales to derive the clock fre...
void setClockFrequency(const Const::EDetector detector, std::string label, double frequency)
Set the frequency value of detector clock not derived from the global clock.
std::map< Const::EDetector, std::map< std::string, double > > m_prescaleMap
Map of prescale factors used to derive the clock frequencies from the global clock frequency.
double getGlobalClockFrequency() const
Get the global clock (system clock) frequency.
double getClockPrescale(Const::EDetector detector, std::string label) const
Get the prescale factor used to derive a detector clock from the global clock frequency.
std::map< Const::EDetector, std::map< std::string, double > > m_clocksMap
Map of clock frequencies not derived from the global clock frequency.
double m_acceleratorRF
Accelerator radio frequency [GHz].
bool isPrescaleAvailable(Const::EDetector detector, std::string label) const
Check if the prescale of a clock is available.
double getClockFrequency(Const::EDetector detector, std::string label) const
Get the frequency of a detector clock.
double getAcceleratorRF() const
Get the accelerator RF value.
bool isFrequencyAvailable(Const::EDetector detector, std::string label) const
Check if the frequency of a detector clock is available.
void print() const
Print the content of the class.
void setClockPrescale(const Const::EDetector detector, std::string label, double prescale)
Set the prescale value used to derive a detector clock from the global clock frequency.
void setAcceleratorRF(double acceleratorRF)
Set the accelerator RF value.
Abstract base class for different kinds of events.