1 #ifndef PRESCALE_CONFIG_HH_
2 #define PRESCALE_CONFIG_HH_
5 #include "Mu2e-STMDAQ/config/config.hh"
10 const int consecutive;
11 const int eff_prescale;
13 prescale(p), consecutive(c), eff_prescale(c*p) {}
24 prescale_t(
int on_p,
int on_c,
int off_p,
int off_c)
25 : on_spill(on_p, on_c), off_spill(off_p, off_c) {}
37 const std::array<std::reference_wrapper<const prescale_t>, 2> prescales;
41 const std::shared_ptr<AsyncLogger> logger):
42 raw(cfg.getValue<
int>(
"stm.prescale.raw.on_spill.prescale_num"),
43 cfg.getValue<
int>(
"stm.prescale.raw.on_spill.store_consecutive"),
44 cfg.getValue<
int>(
"stm.prescale.raw.off_spill.prescale_num"),
45 cfg.getValue<
int>(
"stm.prescale.raw.off_spill.store_consecutive")),
46 zs(cfg.getValue<
int>(
"stm.prescale.zs.on_spill.prescale_num"),
47 cfg.getValue<
int>(
"stm.prescale.zs.on_spill.store_consecutive"),
48 cfg.getValue<
int>(
"stm.prescale.zs.off_spill.prescale_num"),
49 cfg.getValue<
int>(
"stm.prescale.zs.off_spill.store_consecutive")),
55 logger->log(
"Config:prescale_info: Raw on-spill prescale = " +
56 std::to_string(raw.on_spill.prescale) +
58 std::to_string(raw.on_spill.consecutive) +
59 " consecutive events. Effective prescale = " +
60 std::to_string(raw.on_spill.eff_prescale) +
62 logger->log(
"Config:prescale_info: Raw off-spill prescale = " +
63 std::to_string(raw.off_spill.prescale) +
65 std::to_string(raw.off_spill.consecutive) +
66 " consecutive events. Effective prescale = " +
67 std::to_string(raw.off_spill.eff_prescale) +
69 logger->log(
"Config:prescale_info: ZS on-spill prescale = " +
70 std::to_string(zs.on_spill.prescale) +
72 std::to_string(zs.on_spill.consecutive) +
73 " consecutive events. Effective prescale = " +
74 std::to_string(zs.on_spill.eff_prescale) +
76 logger->log(
"Config:prescale_info: ZS off-spill prescale = " +
77 std::to_string(zs.off_spill.prescale) +
79 std::to_string(zs.off_spill.consecutive) +
80 " consecutive events. Effective prescale = " +
81 std::to_string(zs.off_spill.eff_prescale) +