Public Types | Public Member Functions | Private Attributes | List of all members
FixedTimeOffsetTool Class Reference

#include <FixedTimeOffsetTool.h>

Inheritance diagram for FixedTimeOffsetTool:
TimeOffsetTool

Public Types

using Name = std::string
 
- Public Types inherited from TimeOffsetTool
using Index = unsigned int
 
using LongIndex = unsigned long
 
using Name = std::string
 

Public Member Functions

 FixedTimeOffsetTool (fhicl::ParameterSet const &ps)
 
 ~FixedTimeOffsetTool () override=default
 
Offset offset (const Data &dat) const override
 
- Public Member Functions inherited from TimeOffsetTool
virtual ~TimeOffsetTool ()=default
 

Private Attributes

Index m_LogLevel
 
long m_Value
 
double m_Rem
 
Name m_Unit
 

Detailed Description

Definition at line 24 of file FixedTimeOffsetTool.h.

Member Typedef Documentation

Definition at line 28 of file FixedTimeOffsetTool.h.

Constructor & Destructor Documentation

FixedTimeOffsetTool::FixedTimeOffsetTool ( fhicl::ParameterSet const &  ps)

Definition at line 16 of file FixedTimeOffsetTool_tool.cc.

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 }
ChannelGroupService::Name Name
unsigned int Index
static constexpr double ps
Definition: Units.h:99
QTextStream & endl(QTextStream &s)
FixedTimeOffsetTool::~FixedTimeOffsetTool ( )
overridedefault

Member Function Documentation

Offset FixedTimeOffsetTool::offset ( const Data dat) const
overridevirtual

Implements TimeOffsetTool.

Definition at line 33 of file FixedTimeOffsetTool_tool.cc.

33  {
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 }
ChannelGroupService::Name Name
std::string to_string(ModuleType const mt)
Definition: ModuleType.h:34
QTextStream & endl(QTextStream &s)

Member Data Documentation

Index FixedTimeOffsetTool::m_LogLevel
private

Definition at line 42 of file FixedTimeOffsetTool.h.

double FixedTimeOffsetTool::m_Rem
private

Definition at line 44 of file FixedTimeOffsetTool.h.

Name FixedTimeOffsetTool::m_Unit
private

Definition at line 45 of file FixedTimeOffsetTool.h.

long FixedTimeOffsetTool::m_Value
private

Definition at line 43 of file FixedTimeOffsetTool.h.


The documentation for this class was generated from the following files: