LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
DetectorClocksStandard.cxx
Go to the documentation of this file.
3 
5 
6 #include <iostream>
7 
8 //-------------------------------------------------------------------------
10  : fConfigName{"G4RefTime",
11  "TriggerOffsetTPC",
12  "FramePeriod",
13  "ClockSpeedTPC",
14  "ClockSpeedOptical",
15  "ClockSpeedTrigger",
16  "ClockSpeedExternal",
17  "DefaultTrigTime",
18  "DefaultBeamTime"}
19  , fConfigValue{pset.get<double>(fConfigName[kG4RefTime]),
20  pset.get<double>(fConfigName[kTriggerOffsetTPC]),
21  pset.get<double>(fConfigName[kFramePeriod]),
22  pset.get<double>(fConfigName[kClockSpeedTPC]),
23  pset.get<double>(fConfigName[kClockSpeedOptical]),
24  pset.get<double>(fConfigName[kClockSpeedTrigger]),
25  pset.get<double>(fConfigName[kClockSpeedExternal]),
26  pset.get<double>(fConfigName[kDefaultTrigTime]),
27  pset.get<double>(fConfigName[kDefaultBeamTime])}
28  , fTrigModuleName{pset.get<std::string>("TrigModuleName")}
29  , fG4RefCorrTrigModuleName{pset.get<std::string>("G4RefCorrTrigModuleName", "baddefault")}
35 {
37 }
38 
40 {
44 }
45 
47 {
48  if (ps.has_key("module_label")) { return false; }
49  return std::all_of(fConfigName.cbegin(), fConfigName.cend(), [&ps](auto const& config_name) {
50  return ps.has_key(config_name);
51  });
52 }
53 
55 {
56  std::cout << "fConfigValues contents: " << std::endl;
57 
58  for (auto const& [name, value] : util::zip(fConfigName, fConfigValue))
59  std::cout << "\n " << name << " ... " << value;
60  std::cout << std::endl;
61 
62  DataForJob().debugReport(std::cout);
63  std::cout.flush();
64 
65 } // detinfo::DetectorClocksStandard::debugReport()
DetectorClocksData DataForJob() const override
Returns a complete detinfo::DetectorClocksData object.
Definition of util::zip().
bool IsRightConfig(const fhicl::ParameterSet &ps) const
void debugReport() const
Dumps the current configuration to screen.
std::vector< std::string > fConfigName
double fTriggerTime
Trigger time in [us].
void ApplyParams()
Internal function to apply loaded parameters to member attributes.
double fBeamGateTime
BeamGate time in [us].
double fTriggerOffsetTPC
Time offset from trigger to TPC readout start.
bool has_key(std::string const &key) const
double value
Definition: spectrum.C:18
void SetTriggerTime(double const trig_time, double const beam_time)
Setter for trigger times.
DetectorClocksStandard(fhicl::ParameterSet const &pset)
auto zip(Iterables &&...iterables)
Range-for loop helper iterating across many collections at the same time.
Definition: zip.h:293
void debugReport(Stream &out) const