Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
dunecore
dunecore
DuneCommon
Tool
TimingRawDecoderOffsetTool.h
Go to the documentation of this file.
1
// TimingRawDecoderOffsetTool.h
2
//
3
// David Adams
4
// June 2018
5
//
6
// Tool that calculates time offset using the timing clock received in an
7
// argumment.
8
//
9
// An earlier version of this tool read the timing clock from a text file
10
// written by the protoDUNE TimingRawDecoder module.
11
//
12
// Parameters:
13
// LogLevel - Message logging level (0=none, 1=ctor, 2=each call, ...)
14
// TpcTickPhase - See below.
15
// Unit - Unit in which the timing offset should be returned (daq, tick, ns).
16
// FembScaleIds - IDs of the FEMBs fo which the offset should be scaled.
17
// FembScaleValues - Scale factors for the scaled FEMBs.
18
// RunDataTool - Name of the tool used to fetch the run data.
19
//
20
// For protoDUNE, daq is us/50, i.e 20 ns.
21
//
22
// The TPC tick is
23
//
24
// t_TPC = scale*(t_daq + TpcTickPhase + runPhase)/TpcTickPeriod
25
//
26
// where t_daq is the count from the DAQ clock, TpcTickPeriod is (for now)
27
// fixed to 25 (50 MHz/2 MHz) and TpcTickPhase is a configuration parameter.
28
// Sensible values for the latter are 0, 1, 2, ..., TpcTickPeriod-1.
29
//
30
// The factor scale is otained from the corresponding position in FembScaleValues
31
// if the FEMB ID
32
//
33
// If the run data tool is found and has phaseGroup, then
34
// runPhase = rdat.phases[igrp]
35
36
#ifndef TimingRawDecoderOffsetTool_H
37
#define TimingRawDecoderOffsetTool_H
38
39
#include "
art/Utilities/ToolMacros.h
"
40
#include "
fhiclcpp/ParameterSet.h
"
41
#include "
dunecore/DuneInterface/Tool/TimeOffsetTool.h
"
42
#include <vector>
43
#include <map>
44
45
class
RunDataTool
;
46
47
class
TimingRawDecoderOffsetTool
:
public
TimeOffsetTool
{
48
49
public
:
50
51
using
Name
=
std::string
;
52
using
IndexVector
= std::vector<Index>;
53
using
DoubleVector
= std::vector<double>;
54
using
ScaleMap
= std::map<Index, double>;
55
56
// Ctor.
57
TimingRawDecoderOffsetTool
(
fhicl::ParameterSet
const
&
ps
);
58
59
// Dtor.
60
~TimingRawDecoderOffsetTool
()
override
=
default
;
61
62
// Return run data.
63
Offset
offset
(
const
Data
&
dat
)
const override
;
64
65
private
:
66
67
// Parameters.
68
Index
m_LogLevel
;
69
Index
m_TpcTickPhase
;
70
Name
m_Unit
;
71
IndexVector
m_FembScaleIds
;
72
DoubleVector
m_FembScaleValues
;
73
Name
m_RunDataTool
;
74
75
const
RunDataTool
*
m_pRunDataTool
=
nullptr
;
76
77
// Derived from configuration.
78
ScaleMap
m_fembScales
;
// Indexed by FEMB ID
79
80
};
81
82
83
#endif
TimingRawDecoderOffsetTool::offset
Offset offset(const Data &dat) const override
Definition:
TimingRawDecoderOffsetTool_tool.cc:65
TimingRawDecoderOffsetTool::m_TpcTickPhase
Index m_TpcTickPhase
Definition:
TimingRawDecoderOffsetTool.h:69
TimingRawDecoderOffsetTool::DoubleVector
std::vector< double > DoubleVector
Definition:
TimingRawDecoderOffsetTool.h:53
string
std::string string
Definition:
nybbler.cc:12
wirecell.sigproc.paper.noise.dat
dat
Definition:
noise.py:64
TimingRawDecoderOffsetTool::ScaleMap
std::map< Index, double > ScaleMap
Definition:
TimingRawDecoderOffsetTool.h:54
TimingRawDecoderOffsetTool
Definition:
TimingRawDecoderOffsetTool.h:47
TimingRawDecoderOffsetTool::m_RunDataTool
Name m_RunDataTool
Definition:
TimingRawDecoderOffsetTool.h:73
TimingRawDecoderOffsetTool::m_FembScaleIds
IndexVector m_FembScaleIds
Definition:
TimingRawDecoderOffsetTool.h:71
ParameterSet.h
TimeOffsetTool::Index
unsigned int Index
Definition:
TimeOffsetTool.h:15
TimingRawDecoderOffsetTool::TimingRawDecoderOffsetTool
TimingRawDecoderOffsetTool(fhicl::ParameterSet const &ps)
Definition:
TimingRawDecoderOffsetTool_tool.cc:20
ToolMacros.h
TimingRawDecoderOffsetTool::m_pRunDataTool
const RunDataTool * m_pRunDataTool
Definition:
TimingRawDecoderOffsetTool.h:75
TimeOffsetTool.h
TimingRawDecoderOffsetTool::Name
std::string Name
Definition:
TimingRawDecoderOffsetTool.h:51
genie::units::ps
static constexpr double ps
Definition:
Units.h:99
TimingRawDecoderOffsetTool::m_LogLevel
Index m_LogLevel
Definition:
TimingRawDecoderOffsetTool.h:68
TimingRawDecoderOffsetTool::m_Unit
Name m_Unit
Definition:
TimingRawDecoderOffsetTool.h:70
TimingRawDecoderOffsetTool::m_FembScaleValues
DoubleVector m_FembScaleValues
Definition:
TimingRawDecoderOffsetTool.h:72
TimeOffsetTool::Data
Definition:
TimeOffsetTool.h:20
TimeOffsetTool::Offset
Definition:
TimeOffsetTool.h:34
TimingRawDecoderOffsetTool::~TimingRawDecoderOffsetTool
~TimingRawDecoderOffsetTool() override=default
TimingRawDecoderOffsetTool::IndexVector
std::vector< Index > IndexVector
Definition:
TimingRawDecoderOffsetTool.h:52
TimeOffsetTool
Definition:
TimeOffsetTool.h:11
RunDataTool
Definition:
RunDataTool.h:10
TimingRawDecoderOffsetTool::m_fembScales
ScaleMap m_fembScales
Definition:
TimingRawDecoderOffsetTool.h:78
fhicl::ParameterSet
Definition:
ParameterSet.h:36
Generated by
1.8.11