Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
dunecore
dunecore
DuneInterface
Tool
TpcDataTool.h
Go to the documentation of this file.
1
// TpcDataTool.h
2
3
// David Adams
4
// April 2018
5
//
6
// Interface for tools that view or update TpcData objects.
7
//
8
// It inherits from AdcChannelTool and the default implementation here
9
// calls the ADC channel map methods of that class.
10
11
#ifndef TpcDataTool_H
12
#define TpcDataTool_H
13
14
#include "
dunecore/DuneInterface/Tool/AdcChannelTool.h
"
15
#include "
dunecore/DuneInterface/Data/TpcData.h
"
16
17
class
TpcDataTool
:
public
AdcChannelTool
{
18
19
public
:
20
21
// Modify TpcData.
22
virtual
DataMap
updateTpcData
(
TpcData
&)
const
;
23
24
// View TpcData.
25
virtual
DataMap
viewTpcData
(
const
TpcData
&)
const
;
26
27
// Method indicating how unimplemented calls to TpcData should be forwarded.
28
// 0: No forward.
29
// 1: AdcChannelDataMap
30
virtual
int
forwardTpcData
()
const
{
return
1; }
31
32
};
33
34
//**********************************************************************
35
// Definitions for the above declarations.
36
//**********************************************************************
37
38
inline
39
DataMap
TpcDataTool::updateTpcData
(
TpcData
& tpd)
const
{
40
if
(
forwardTpcData
() == 1 ) {
41
DataMap
dm;
42
for
(
TpcData::AdcDataPtr
padc : tpd.
getAdcData
() ) {
43
if
( padc ) dm =
updateMap
(*padc);
44
}
45
return
dm;
46
}
else
if
(
updateWithView
() ) {
47
return
viewTpcData
(tpd);
48
}
49
return
DataMap
(
interfaceNotImplemented
());
50
}
51
52
//**********************************************************************
53
54
inline
55
DataMap
TpcDataTool::viewTpcData
(
const
TpcData
& tpd)
const
{
56
if
(
forwardTpcData
() == 1 ) {
57
DataMap
dm;
58
for
(
TpcData::AdcDataPtr
padc : tpd.
getAdcData
() ) {
59
if
( padc ) dm =
viewMap
(*padc);
60
}
61
return
dm;
62
}
63
// We do not copy TpcData.
64
return
DataMap
(
interfaceNotImplemented
());
65
}
66
67
//**********************************************************************
68
69
#endif
AdcChannelTool::viewMap
virtual DataMap viewMap(const AdcChannelDataMap &acds) const
Definition:
AdcChannelTool.h:162
AdcChannelTool::interfaceNotImplemented
static int interfaceNotImplemented()
Definition:
AdcChannelTool.h:62
TpcData::AdcDataPtr
std::shared_ptr< AdcChannelDataMap > AdcDataPtr
Definition:
TpcData.h:35
TpcDataTool::viewTpcData
virtual DataMap viewTpcData(const TpcData &) const
Definition:
TpcDataTool.h:55
TpcDataTool
Definition:
TpcDataTool.h:17
TpcData::getAdcData
AdcDataVector & getAdcData()
Definition:
TpcData.h:55
AdcChannelTool.h
TpcData.h
TpcDataTool::updateTpcData
virtual DataMap updateTpcData(TpcData &) const
Definition:
TpcDataTool.h:39
AdcChannelTool::updateMap
virtual DataMap updateMap(AdcChannelDataMap &acds) const
Definition:
AdcChannelTool.h:138
AdcChannelTool::updateWithView
virtual bool updateWithView() const
Definition:
AdcChannelTool.h:92
AdcChannelTool
Definition:
AdcChannelTool.h:54
TpcDataTool::forwardTpcData
virtual int forwardTpcData() const
Definition:
TpcDataTool.h:30
TpcData
Definition:
TpcData.h:25
DataMap
Definition:
DataMap.h:43
Generated by
1.8.11