Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
dunedataprep
dunedataprep
DataPrep
Tool
AdcResultDumper_tool.cc
Go to the documentation of this file.
1
// AdcResultDumper_tool.cc
2
3
#include "
AdcResultDumper.h
"
4
#include "
dunecore/ArtSupport/DuneToolManager.h
"
5
#include <iostream>
6
7
using
std::string
;
8
using
std::cout;
9
using
std::endl
;
10
11
using
TpcDataToolPtr
= std::unique_ptr<TpcDataTool>;
12
13
//**********************************************************************
14
// Class methods.
15
//**********************************************************************
16
17
AdcResultDumper::AdcResultDumper
(
fhicl::ParameterSet
const
&
ps
)
18
: m_LogLevel(ps.
get
<
int
>(
"LogLevel"
)),
19
m_Tool(ps.
get
<
string
>(
"Tool"
))
20
{
21
const
string
myname =
"AdcResultDumper::ctor: "
;
22
if
(
m_LogLevel
) {
23
cout << myname <<
"Configuration: "
<<
endl
;
24
cout << myname <<
" LogLevel: "
<<
m_LogLevel
<<
endl
;
25
cout << myname <<
" Tool: "
<<
m_Tool
<<
endl
;
26
}
27
if
(
m_LogLevel
) cout << myname <<
"Retrieving tool."
<<
endl
;
28
DuneToolManager
* ptm =
DuneToolManager::instance
();
29
m_ptool
= ptm->
getPrivate
<
TpcDataTool
>(
m_Tool
);
30
if
(
m_ptool
==
nullptr
) {
31
cout << myname <<
"Tool retrieval failed."
<<
endl
;
32
}
else
if
(
m_LogLevel
) {
33
cout << myname <<
"Tool retrieval succeeded."
<<
endl
;
34
}
35
}
36
37
//**********************************************************************
38
39
DataMap
AdcResultDumper::view
(
const
AdcChannelData
& acd)
const
{
40
const
string
myname =
"AdcResultDumper::view: "
;
41
if
(
m_ptool
==
nullptr
)
return
DataMap
(101);
42
if
(
m_LogLevel
>= 2 ) cout << myname <<
"Calling tool "
<<
m_Tool
<<
endl
;
43
DataMap
ret =
m_ptool
->view(acd);
44
ret.
print
();
45
return
ret;
46
}
47
48
//**********************************************************************
49
50
DataMap
AdcResultDumper::update
(
AdcChannelData
& acd)
const
{
51
const
string
myname =
"AdcResultDumper::updateMap: "
;
52
if
(
m_ptool
==
nullptr
)
return
DataMap
(101);
53
if
(
m_LogLevel
>= 2 ) cout << myname <<
"Calling tool "
<<
m_Tool
<<
endl
;
54
DataMap
ret =
m_ptool
->update(acd);
55
ret.
print
();
56
return
ret;
57
}
58
59
//**********************************************************************
60
61
DataMap
AdcResultDumper::viewMap
(
const
AdcChannelDataMap
& acds)
const
{
62
const
string
myname =
"AdcResultDumper::viewMap: "
;
63
if
(
m_ptool
==
nullptr
)
return
DataMap
(101);
64
if
(
m_LogLevel
>= 2 ) cout << myname <<
"Calling tool "
<<
m_Tool
<<
endl
;
65
DataMap
ret =
m_ptool
->viewMap(acds);
66
ret.
print
();
67
return
ret;
68
}
69
70
//**********************************************************************
71
72
DataMap
AdcResultDumper::updateMap
(
AdcChannelDataMap
& acds)
const
{
73
const
string
myname =
"AdcResultDumper::updateMap: "
;
74
if
(
m_ptool
==
nullptr
)
return
DataMap
(101);
75
if
(
m_LogLevel
>= 2 ) cout << myname <<
"Calling tool "
<<
m_Tool
<<
endl
;
76
DataMap
ret =
m_ptool
->updateMap(acds);
77
ret.
print
();
78
return
ret;
79
}
80
81
//**********************************************************************
82
83
DEFINE_ART_CLASS_TOOL
(
AdcResultDumper
)
AdcResultDumper::updateMap
DataMap updateMap(AdcChannelDataMap &acds) const override
Definition:
AdcResultDumper_tool.cc:72
TpcDataToolPtr
std::unique_ptr< TpcDataTool > TpcDataToolPtr
Definition:
AdcResultDumper_tool.cc:11
DEFINE_ART_CLASS_TOOL
#define DEFINE_ART_CLASS_TOOL(tool)
Definition:
ToolMacros.h:42
AdcResultDumper
Definition:
AdcResultDumper.h:21
string
std::string string
Definition:
nybbler.cc:12
AdcResultDumper::m_LogLevel
int m_LogLevel
Definition:
AdcResultDumper.h:38
AdcChannelData
Definition:
AdcChannelData.h:95
DataMap::print
void print(std::ostream *pout) const
Definition:
DataMap.h:245
AdcResultDumper::m_Tool
std::string m_Tool
Definition:
AdcResultDumper.h:39
TpcDataTool
Definition:
TpcDataTool.h:17
AdcResultDumper::view
DataMap view(const AdcChannelData &acd) const override
Definition:
AdcResultDumper_tool.cc:39
AdcResultDumper.h
AdcResultDumper::m_ptool
std::unique_ptr< TpcDataTool > m_ptool
Definition:
AdcResultDumper.h:41
AdcResultDumper::update
DataMap update(AdcChannelData &acd) const override
Definition:
AdcResultDumper_tool.cc:50
DuneToolManager.h
AdcResultDumper::viewMap
DataMap viewMap(const AdcChannelDataMap &acds) const override
Definition:
AdcResultDumper_tool.cc:61
genie::units::ps
static constexpr double ps
Definition:
Units.h:99
keras_to_tensorflow.int
int
Definition:
keras_to_tensorflow.py:69
DuneToolManager::getPrivate
std::unique_ptr< T > getPrivate(std::string name)
Definition:
DuneToolManager.h:82
DuneToolManager
Definition:
DuneToolManager.h:34
AdcResultDumper::AdcResultDumper
AdcResultDumper(fhicl::ParameterSet const &ps)
Definition:
AdcResultDumper_tool.cc:17
AdcChannelDataMap
std::map< AdcChannel, AdcChannelData > AdcChannelDataMap
Definition:
AdcChannelData.h:378
art::get
auto const & get(AssnsNode< L, R, D > const &r)
Definition:
AssnsNode.h:115
DataMap
Definition:
DataMap.h:43
DuneToolManager::instance
static DuneToolManager * instance(std::string fclname="", int dbg=1)
Definition:
DuneToolManager.cxx:95
endl
QTextStream & endl(QTextStream &s)
Definition:
qtextstream.cpp:2030
fhicl::ParameterSet
Definition:
ParameterSet.h:36
Generated by
1.8.11