Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
dunecore
dunecore
DuneCommon
Tool
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
12
using
Offset
=
FixedTimeOffsetTool::Offset
;
13
14
//**********************************************************************
15
16
FixedTimeOffsetTool::FixedTimeOffsetTool
(
fhicl::ParameterSet
const
&
ps
)
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
33
Offset
FixedTimeOffsetTool::offset
(
const
Data
&
dat
)
const
{
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
51
DEFINE_ART_CLASS_TOOL
(
FixedTimeOffsetTool
)
TimeOffsetTool::Data::event
Index event
Definition:
TimeOffsetTool.h:24
FixedTimeOffsetTool::m_Value
long m_Value
Definition:
FixedTimeOffsetTool.h:43
FixedTimeOffsetTool::FixedTimeOffsetTool
FixedTimeOffsetTool(fhicl::ParameterSet const &ps)
Definition:
FixedTimeOffsetTool_tool.cc:16
DEFINE_ART_CLASS_TOOL
#define DEFINE_ART_CLASS_TOOL(tool)
Definition:
ToolMacros.h:42
string
std::string string
Definition:
nybbler.cc:12
wirecell.sigproc.paper.noise.dat
dat
Definition:
noise.py:64
TimeOffsetTool::Offset::rem
double rem
Definition:
TimeOffsetTool.h:38
FixedTimeOffsetTool::m_LogLevel
Index m_LogLevel
Definition:
FixedTimeOffsetTool.h:42
TimeOffsetTool::Index
unsigned int Index
Definition:
TimeOffsetTool.h:15
FixedTimeOffsetTool::offset
Offset offset(const Data &dat) const override
Definition:
FixedTimeOffsetTool_tool.cc:33
FixedTimeOffsetTool
Definition:
FixedTimeOffsetTool.h:24
FixedTimeOffsetTool::Name
std::string Name
Definition:
FixedTimeOffsetTool.h:28
genie::units::ps
static constexpr double ps
Definition:
Units.h:99
TimeOffsetTool::Offset::value
long value
Definition:
TimeOffsetTool.h:37
FixedTimeOffsetTool::m_Unit
Name m_Unit
Definition:
FixedTimeOffsetTool.h:45
Offset
FixedTimeOffsetTool::Offset Offset
Definition:
FixedTimeOffsetTool_tool.cc:12
TimeOffsetTool::Data::run
Index run
Definition:
TimeOffsetTool.h:22
TimeOffsetTool::Data
Definition:
TimeOffsetTool.h:20
TimeOffsetTool::Offset
Definition:
TimeOffsetTool.h:34
art::get
auto const & get(AssnsNode< L, R, D > const &r)
Definition:
AssnsNode.h:115
TimeOffsetTool::Offset::unit
Name unit
Definition:
TimeOffsetTool.h:39
art::to_string
std::string to_string(ModuleType const mt)
Definition:
ModuleType.h:34
FixedTimeOffsetTool::m_Rem
double m_Rem
Definition:
FixedTimeOffsetTool.h:44
FixedTimeOffsetTool.h
endl
QTextStream & endl(QTextStream &s)
Definition:
qtextstream.cpp:2030
fhicl::ParameterSet
Definition:
ParameterSet.h:36
Generated by
1.8.11