1 #ifndef ARTDAQ_DAQDATA_GLOBALS_HH
2 #define ARTDAQ_DAQDATA_GLOBALS_HH
4 #include "artdaq-core/Utilities/configureMessageFacility.hh"
7 #include "artdaq-utilities/Plugins/MetricManager.hh"
8 #include "artdaq-core/Utilities/TimeUtils.hh"
10 #define my_rank artdaq::Globals::my_rank_
11 #define app_name artdaq::Globals::app_name_
12 #define metricMan artdaq::Globals::metricMan_
13 #define seedAndRandom() artdaq::Globals::seedAndRandom_()
42 static bool initialized_ =
false;
44 int fp = open(
"/dev/random", O_RDONLY);
45 if (fp == -1) abort();
48 while (pos <
sizeof(seed))
50 int amt = read(fp, (
char *)&seed + pos,
sizeof(seed) - pos);
51 if (amt <= 0) abort();
63 #endif // ARTDAQ_DAQDATA_GLOBALS_HH
static uint32_t seedAndRandom_()
Seed the C random number generator with the current time (if that has not been done already) and gene...
static int my_rank_
The rank of the current application.
static std::string app_name_
The name of the current application, to be used in logging and metrics.
static MetricManager * metricMan_
A handle to MetricManager.
The artdaq::Globals class contains several variables which are useful across the entire artdaq system...