8#include <framework/dbobjects/HardwareClockSettings.h>
9#include <framework/logging/Logger.h>
10#include <framework/gearbox/Unit.h>
36 bool isDetectorInPrescaleMap =
true;
49 return std::numeric_limits<double>::quiet_NaN();
69 return std::numeric_limits<double>::quiet_NaN();
90 std::cout << std::endl;
92 std::cout <<
"Clock prescale factors:" << std::endl;
93 std::cout <<
"===================================" << std::endl;
97 for (
const auto& clock : det.second) std::cout <<
" " << clock.first <<
" " << clock.second << std::endl;
99 std::cout <<
"===================================" << std::endl;
101 std::cout <<
"Clock frequencies:" << std::endl;
102 std::cout <<
"===================================" << std::endl;
105 for (
const auto& clock : det.second) {
106 std::cout <<
" " << clock.first <<
" " << clock.second /
Unit::MHz <<
" MHz" << std::endl;
109 std::cout <<
"===================================" << std::endl;
EDetector
Enum for identifying the detector components (detector and subdetector).
static std::string parseDetectors(EDetector det)
Converts Const::EDetector object to string.
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.
HardwareClockSettings()
Constructor.
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.
static const double MHz
[Megahertz]
Abstract base class for different kinds of events.