Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
dunedataprep
dunedataprep
DataPrep
Tool
AdcKeepAllSignalFinder_tool.cc
Go to the documentation of this file.
1
// AdcKeepAllSignalFinder_tool.cc
2
3
#include "
AdcKeepAllSignalFinder.h
"
4
#include <iostream>
5
6
using
std::string
;
7
using
std::cout;
8
using
std::endl
;
9
10
//**********************************************************************
11
// Class methods.
12
//**********************************************************************
13
14
AdcKeepAllSignalFinder::AdcKeepAllSignalFinder
(
fhicl::ParameterSet
const
&
ps
)
15
: m_LogLevel(ps.
get
<
int
>(
"LogLevel"
)),
16
m_DataPath(ps.
get
<
Name
>(
"DataPath"
)) {
17
const
string
myname =
"AdcKeepAllSignalFinder::ctor: "
;
18
if
(
m_LogLevel
>= 1 ) {
19
cout << myname <<
"Configuration parameters:"
<<
endl
;
20
cout << myname <<
" LogLevel: "
<<
m_LogLevel
<<
endl
;
21
cout << myname <<
" DataPath: "
<<
m_DataPath
<<
endl
;
22
}
23
}
24
25
//**********************************************************************
26
27
DataMap
AdcKeepAllSignalFinder::update
(
AdcChannelData
& acdtop)
const
{
28
const
string
myname =
"AdcKeepAllSignalFinder::update: "
;
29
DataMap
ret;
30
Index
nvie = acdtop.
viewSize
(
m_DataPath
);
31
Index
nroi = 0;
32
for
(
Index
ivie=0; ivie<nvie; ++ivie ) {
33
AdcChannelData
* pacd = acdtop.
mutableViewEntry
(
m_DataPath
, ivie);
34
if
( pacd ==
nullptr
) {
35
cout << myname <<
"WARNING: Skipping null data."
<<
endl
;
36
continue
;
37
}
38
AdcChannelData
& acd = *pacd;
39
AdcIndex
nsam = acd.
samples
.size();
40
acd.
signal
.clear();
41
acd.
rois
.clear();
42
if
( nsam == 0 ) {
43
cout << myname <<
"ERROR: No samples found in channel "
<< acd.
channel
()
44
<<
" view "
<< ivie <<
endl
;
45
return
ret.
setStatus
(1);
46
}
47
if
(
m_LogLevel
>= 2 ) {
48
cout << myname <<
"Building ROI for channel "
<< acd.
channel
()
49
<<
" view "
<< ivie <<
"/"
<< nvie <<
"."
<<
endl
;
50
}
51
acd.
signal
.resize(nsam,
true
);
52
acd.
roisFromSignal
();
53
nroi += acd.
rois
.size();
54
}
55
ret.
setInt
(
"nroi"
, nroi);
56
return
ret;
57
}
58
59
//**********************************************************************
60
61
DataMap
AdcKeepAllSignalFinder::view
(
const
AdcChannelData
& acd)
const
{
62
AdcChannelData
acdtmp;
63
acdtmp.
samples
= acd.
samples
;
64
return
update
(acdtmp);
65
}
66
67
//**********************************************************************
68
69
DEFINE_ART_CLASS_TOOL
(
AdcKeepAllSignalFinder
)
DEFINE_ART_CLASS_TOOL
#define DEFINE_ART_CLASS_TOOL(tool)
Definition:
ToolMacros.h:42
AdcChannelTool::Index
unsigned int Index
Definition:
AdcChannelTool.h:58
DataMap::setStatus
DataMap & setStatus(int stat)
Definition:
DataMap.h:130
string
std::string string
Definition:
nybbler.cc:12
AdcChannelData
Definition:
AdcChannelData.h:95
AdcKeepAllSignalFinder::m_DataPath
Name m_DataPath
Definition:
AdcKeepAllSignalFinder.h:45
AdcKeepAllSignalFinder::Name
std::string Name
Definition:
AdcKeepAllSignalFinder.h:41
AdcChannelData::rois
AdcRoiVector rois
Definition:
AdcChannelData.h:137
DataMap::setInt
void setInt(Name name, int val)
Definition:
DataMap.h:131
AdcChannelData::roisFromSignal
void roisFromSignal()
Definition:
AdcChannelData.h:413
genie::units::ps
static constexpr double ps
Definition:
Units.h:99
AdcIndex
unsigned int AdcIndex
Definition:
AdcTypes.h:15
keras_to_tensorflow.int
int
Definition:
keras_to_tensorflow.py:69
AdcChannelData::channel
Channel channel() const
Definition:
AdcChannelData.h:199
AdcKeepAllSignalFinder::update
DataMap update(AdcChannelData &acd) const override
Definition:
AdcKeepAllSignalFinder_tool.cc:27
AdcChannelData::signal
AdcFilterVector signal
Definition:
AdcChannelData.h:136
AdcKeepAllSignalFinder::m_LogLevel
int m_LogLevel
Definition:
AdcKeepAllSignalFinder.h:44
AdcChannelData::mutableViewEntry
AdcChannelData * mutableViewEntry(Name vpnam, AdcIndex ient)
Definition:
AdcChannelData.h:518
AdcKeepAllSignalFinder::AdcKeepAllSignalFinder
AdcKeepAllSignalFinder(fhicl::ParameterSet const &ps)
Definition:
AdcKeepAllSignalFinder_tool.cc:14
AdcChannelData::viewSize
size_t viewSize() const
Definition:
AdcChannelData.h:340
art::get
auto const & get(AssnsNode< L, R, D > const &r)
Definition:
AssnsNode.h:115
AdcKeepAllSignalFinder.h
AdcKeepAllSignalFinder::view
DataMap view(const AdcChannelData &acd) const override
Definition:
AdcKeepAllSignalFinder_tool.cc:61
DataMap
Definition:
DataMap.h:43
AdcChannelData::samples
AdcSignalVector samples
Definition:
AdcChannelData.h:131
endl
QTextStream & endl(QTextStream &s)
Definition:
qtextstream.cpp:2030
fhicl::ParameterSet
Definition:
ParameterSet.h:36
AdcKeepAllSignalFinder
Definition:
AdcKeepAllSignalFinder.h:28
Generated by
1.8.11