FixedTimeOffsetTool_tool.cc
Go to the documentation of this file.
1 // FixedTimeOffsetTool_tool.cc
2 
3 #include "FixedTimeOffsetTool.h"
4 #include <iostream>
5 #include <fstream>
6 
7 using std::cout;
8 using std::endl;
9 using std::string;
10 using std::ifstream;
11 
13 
14 //**********************************************************************
15 
17 : m_LogLevel(ps.get<Index>("LogLevel")),
18  m_Value(ps.get<long>("Value")),
19  m_Rem(ps.get<double>("Rem")),
20  m_Unit(ps.get<Name>("Unit")) {
21  const Name myname = "FixedTimeOffsetTool::ctor: ";
22  if ( m_LogLevel ) {
23  cout << "Configuration:" << endl;
24  cout << " LogLevel: " << m_LogLevel << endl;
25  cout << " Value: " << m_Value << endl;
26  cout << " Rem: " << m_Rem << endl;
27  cout << " Unit: " << m_Unit << endl;
28  }
29 }
30 
31 //**********************************************************************
32 
34  const Name myname = "FixedTimeOffsetTool::offset: ";
35  Name ifname = "artdaqTimestamp-Run" + std::to_string(dat.run) +
36  "-Event" + std::to_string(dat.event) + ".dat";
37  Offset res;
38  res.value = m_Value;
39  res.rem = m_Rem;
40  res.unit = m_Unit;
41  if ( m_LogLevel >= 2 ) {
42  cout << myname << "Offset is " << res.value;
43  if ( res.rem ) cout << " + " << res.rem;
44  cout << " " << res.unit << endl;
45  }
46  return res;
47 }
48 
49 //**********************************************************************
50 
FixedTimeOffsetTool(fhicl::ParameterSet const &ps)
#define DEFINE_ART_CLASS_TOOL(tool)
Definition: ToolMacros.h:42
std::string string
Definition: nybbler.cc:12
unsigned int Index
Offset offset(const Data &dat) const override
static constexpr double ps
Definition: Units.h:99
FixedTimeOffsetTool::Offset Offset
auto const & get(AssnsNode< L, R, D > const &r)
Definition: AssnsNode.h:115
std::string to_string(ModuleType const mt)
Definition: ModuleType.h:34
QTextStream & endl(QTextStream &s)