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 
39 void
41 {
45 }
46 
47 bool
49 {
50  if (ps.has_key("module_label")) { return false; }
51  return std::all_of(fConfigName.cbegin(), fConfigName.cend(), [&ps](auto const& config_name) {
52  return ps.has_key(config_name);
53  });
54 }
55 
56 
57 void
59 {
60  std::cout << "fConfigValues contents: " << std::endl;
61 
62  for(auto const& [ name, value ]: util::zip(fConfigName, fConfigValue))
63  std::cout << "\n " << name << " ... " << value;
64  std::cout << std::endl;
65 
66  DataForJob().debugReport(std::cout);
67  std::cout.flush();
68 
69 } // detinfo::DetectorClocksStandard::debugReport()
70 
static QCString name
Definition: declinfo.cpp:673
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::string string
Definition: nybbler.cc:12
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
static constexpr double ps
Definition: Units.h:99
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:295
void debugReport(Stream &out) const
QTextStream & endl(QTextStream &s)