Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
dunedataprep
dunedataprep
DataPrep
Tool
StandardAdcChannelStringTool.h
Go to the documentation of this file.
1
// StandardAdcChannelStringTool.h
2
3
// David Adams
4
// May 2018
5
//
6
// Tool to construct a string from an input template taking data
7
// from AdcChannelData and DataMap objects.
8
//
9
// The string is the pattern with the following replacements:
10
// %RUN% --> acd.run
11
// %SUBRUN% --> acd.subRun
12
// %EVENT% --> acd.event
13
// %CHAN% --> acd.channel
14
// %FEMB% --> acd.fembID
15
// %SUNIT% --> "sunit" where sunit = acd.sampleUnit
16
// % SUNIT% --> " sunit" or "" if sunit is empty
17
// %(SUNIT)% --> "(sunit)" or "" if sunit is empty
18
// % (SUNIT)% --> " (sunit)" or "" if sunit is empty
19
// %((SUNIT))% --> "(sunit)" or sunit if there is no space in sunit
20
// % ((SUNIT))% --> add preceding space to this if sunit is not blank
21
// %[SUNIT]% --> "[sunit]" or "" if sunit is empty
22
// % [SUNIT]% --> " [sunit]" or "" if sunit is empty
23
// Same patterns with ASUNIT substitute sunit-tick
24
// %COUNT% --> dm.getInt("count") passed in call to build
25
// %CHAN1% --> dm.getInt("chan1") passed in call to build
26
// %CHAN2% --> dm.getInt("chan2") passed in call to build
27
// %TRIG% --> acd.trigger
28
// %TRIGNAME% --> TrigNames[acd.trigger]
29
// %TRIGNAMECAP% --> TrigNames[acd.trigger] with first letter capitalized.
30
// %UTCTIME% --> Time string in UTC (implicit), e.g. "2018-10-23 15:31:12"
31
// %UTCTIMEn% --> Previous plus fractional seconds to n digits for n=0-9.
32
// where acd is the AdcChannelData object and dm is the DataMap object
33
// passed in the call to build.
34
//
35
// E.g. if acd.run = 123, then "%RUN%" is replaced with "123".
36
//
37
// In addition, any number can be prefixed with a digit to indicate that
38
// the number should be padded with leading zeros to a width equal to that
39
// digit if its natural width is less that that value. E.g. %6RUN% will
40
// produce "000123" if acd.run = 123.
41
//
42
// If a number is prefixed with 0, then the width used is specified by
43
// the configuration here. E.g. if RunWidth == 5, then "%0RUN" will be
44
// replaced with "00123" if acd.run = 123.
45
//
46
// Tool configuration:
47
// LogLevel - 1 to log from ctor
48
// 2 to log every call to build
49
// RunWidth - width for run
50
// SubRunWidth - width for subrun
51
// EventWidth - width for event
52
// ChannelWidth - width for channel
53
// FembWidth - width for FEMB
54
// TrigNames - Names for triggers.
55
56
#ifndef StandardAdcChannelStringTool_H
57
#define StandardAdcChannelStringTool_H
58
59
#include "
art/Utilities/ToolMacros.h
"
60
#include "
fhiclcpp/ParameterSet.h
"
61
#include "
dunecore/DuneInterface/Tool/AdcChannelStringTool.h
"
62
#include <vector>
63
64
class
StandardAdcChannelStringTool
65
:
public
AdcChannelStringTool
{
66
67
public
:
68
69
using
Index
=
unsigned
int
;
70
using
Name
=
std::string
;
71
using
NameVector
= std::vector<Name>;
72
73
StandardAdcChannelStringTool
(
fhicl::ParameterSet
const
&
ps
);
74
75
std::string
build
(
const
AdcChannelData
& acd,
const
DataMap
& dm,
std::string
spat)
const override
;
76
77
private
:
78
79
// Configuration data.
80
int
m_LogLevel
;
81
Index
m_RunWidth
;
82
Index
m_SubRunWidth
;
83
Index
m_EventWidth
;
84
Index
m_ChannelWidth
;
85
Index
m_CountWidth
;
86
Index
m_FembWidth
;
87
Index
m_TriggerWidth
;
88
NameVector
m_TrigNames
;
89
90
static
const
Index
m_nrep
= 9;
91
Index
m_wids
[
m_nrep
];
92
std::string
m_reps
[
m_nrep
];
93
std::string
m_bads
[
m_nrep
];
94
95
};
96
97
98
#endif
StandardAdcChannelStringTool::m_FembWidth
Index m_FembWidth
Definition:
StandardAdcChannelStringTool.h:86
string
std::string string
Definition:
nybbler.cc:12
AdcChannelStringTool::Index
unsigned int Index
Definition:
AdcChannelStringTool.h:19
StandardAdcChannelStringTool::m_TrigNames
NameVector m_TrigNames
Definition:
StandardAdcChannelStringTool.h:88
StandardAdcChannelStringTool::m_ChannelWidth
Index m_ChannelWidth
Definition:
StandardAdcChannelStringTool.h:84
StandardAdcChannelStringTool::StandardAdcChannelStringTool
StandardAdcChannelStringTool(fhicl::ParameterSet const &ps)
Definition:
StandardAdcChannelStringTool_tool.cc:21
AdcChannelData
Definition:
AdcChannelData.h:95
ParameterSet.h
StandardAdcChannelStringTool::m_reps
std::string m_reps[m_nrep]
Definition:
StandardAdcChannelStringTool.h:92
StandardAdcChannelStringTool
Definition:
StandardAdcChannelStringTool.h:64
ToolMacros.h
StandardAdcChannelStringTool::m_CountWidth
Index m_CountWidth
Definition:
StandardAdcChannelStringTool.h:85
StandardAdcChannelStringTool::m_bads
std::string m_bads[m_nrep]
Definition:
StandardAdcChannelStringTool.h:93
StandardAdcChannelStringTool::m_TriggerWidth
Index m_TriggerWidth
Definition:
StandardAdcChannelStringTool.h:87
StandardAdcChannelStringTool::m_EventWidth
Index m_EventWidth
Definition:
StandardAdcChannelStringTool.h:83
genie::units::ps
static constexpr double ps
Definition:
Units.h:99
keras_to_tensorflow.int
int
Definition:
keras_to_tensorflow.py:69
StandardAdcChannelStringTool::NameVector
std::vector< Name > NameVector
Definition:
StandardAdcChannelStringTool.h:71
StandardAdcChannelStringTool::Name
std::string Name
Definition:
StandardAdcChannelStringTool.h:70
StandardAdcChannelStringTool::m_nrep
static const Index m_nrep
Definition:
StandardAdcChannelStringTool.h:90
AdcChannelStringTool
Definition:
AdcChannelStringTool.h:15
StandardAdcChannelStringTool::build
std::string build(const AdcChannelData &acd, const DataMap &dm, std::string spat) const override
Definition:
StandardAdcChannelStringTool_tool.cc:86
StandardAdcChannelStringTool::m_wids
Index m_wids[m_nrep]
Definition:
StandardAdcChannelStringTool.h:91
StandardAdcChannelStringTool::m_LogLevel
int m_LogLevel
Definition:
StandardAdcChannelStringTool.h:80
DataMap
Definition:
DataMap.h:43
StandardAdcChannelStringTool::m_SubRunWidth
Index m_SubRunWidth
Definition:
StandardAdcChannelStringTool.h:82
AdcChannelStringTool.h
fhicl::ParameterSet
Definition:
ParameterSet.h:36
StandardAdcChannelStringTool::m_RunWidth
Index m_RunWidth
Definition:
StandardAdcChannelStringTool.h:81
Generated by
1.8.11