Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
dunedataprep
dunedataprep
DataPrep
Tool
AdcRoiShifter_tool.cc
Go to the documentation of this file.
1
// AdcRoiShifter_tool.cc
2
3
#include "
AdcRoiShifter.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
AdcRoiShifter::AdcRoiShifter
(
fhicl::ParameterSet
const
&
ps
)
15
: m_LogLevel(ps.
get
<
int
>(
"LogLevel"
)),
16
m_BinOffset(ps.
get
<
int
>(
"BinOffset"
)) {
17
const
string
myname =
"AdcRoiShifter::ctor: "
;
18
if
(
m_LogLevel
>= 1 ) {
19
cout << myname <<
"Configuration parameters:"
<<
endl
;
20
cout << myname <<
" LogLevel: "
<<
m_LogLevel
<<
endl
;
21
cout << myname <<
" BinOffset: "
<<
m_BinOffset
<<
endl
;
22
}
23
}
24
25
//**********************************************************************
26
27
DataMap
AdcRoiShifter::update
(
AdcChannelData
& acd)
const
{
28
const
string
myname =
"AdcRoiShifter::update: "
;
29
DataMap
ret;
30
AdcIndex
nsam = acd.
signal
.size();
31
if
( nsam ==0 ||
m_BinOffset
== 0 ) {
32
return
ret;
33
}
else
if
(
m_BinOffset
> 0 ) {
34
AdcIndex
shift =
m_BinOffset
;
35
for
(
AdcIndex
isam=nsam-1; isam>=shift; --isam ) {
36
acd.
signal
[isam] = acd.
signal
[isam-shift];
37
}
38
for
(
AdcIndex
isam=0; isam<shift; ++isam ) {
39
acd.
signal
[isam] =
false
;
40
}
41
}
else
{
42
AdcIndex
shift = -
m_BinOffset
;
43
for
(
AdcIndex
isam=0; isam<nsam-shift; ++isam ) {
44
acd.
signal
[isam] = acd.
signal
[isam+shift];
45
}
46
for
(
AdcIndex
isam=nsam-shift; isam<nsam; ++isam ) {
47
acd.
signal
[isam] =
false
;
48
}
49
}
50
acd.
roisFromSignal
();
51
if
(
m_LogLevel
>= 3 ) {
52
cout << myname <<
" # ROI: "
<< acd.
rois
.size() <<
endl
;
53
}
54
ret.
setInt
(
"nroi"
, acd.
rois
.size());
55
return
ret;
56
}
57
58
//**********************************************************************
59
60
DataMap
AdcRoiShifter::view
(
const
AdcChannelData
& acd)
const
{
61
AdcChannelData
acdtmp;
62
acdtmp.
signal
= acd.
signal
;
63
return
update
(acdtmp);
64
}
65
66
//**********************************************************************
67
68
DEFINE_ART_CLASS_TOOL
(
AdcRoiShifter
)
AdcRoiShifter::m_BinOffset
int m_BinOffset
Definition:
AdcRoiShifter.h:39
DEFINE_ART_CLASS_TOOL
#define DEFINE_ART_CLASS_TOOL(tool)
Definition:
ToolMacros.h:42
string
std::string string
Definition:
nybbler.cc:12
AdcRoiShifter::AdcRoiShifter
AdcRoiShifter(fhicl::ParameterSet const &ps)
Definition:
AdcRoiShifter_tool.cc:14
AdcChannelData
Definition:
AdcChannelData.h:95
AdcRoiShifter::view
DataMap view(const AdcChannelData &acd) const override
Definition:
AdcRoiShifter_tool.cc:60
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
AdcRoiShifter
Definition:
AdcRoiShifter.h:22
AdcIndex
unsigned int AdcIndex
Definition:
AdcTypes.h:15
keras_to_tensorflow.int
int
Definition:
keras_to_tensorflow.py:69
AdcRoiShifter::update
DataMap update(AdcChannelData &acd) const override
Definition:
AdcRoiShifter_tool.cc:27
AdcChannelData::signal
AdcFilterVector signal
Definition:
AdcChannelData.h:136
art::get
auto const & get(AssnsNode< L, R, D > const &r)
Definition:
AssnsNode.h:115
DataMap
Definition:
DataMap.h:43
AdcRoiShifter::m_LogLevel
int m_LogLevel
Definition:
AdcRoiShifter.h:38
endl
QTextStream & endl(QTextStream &s)
Definition:
qtextstream.cpp:2030
AdcRoiShifter.h
fhicl::ParameterSet
Definition:
ParameterSet.h:36
Generated by
1.8.11