AdcResultDumper_tool.cc
Go to the documentation of this file.
1 // AdcResultDumper_tool.cc
2 
3 #include "AdcResultDumper.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 
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;
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 
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 
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 
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 
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 
DataMap updateMap(AdcChannelDataMap &acds) const override
std::unique_ptr< TpcDataTool > TpcDataToolPtr
#define DEFINE_ART_CLASS_TOOL(tool)
Definition: ToolMacros.h:42
std::string string
Definition: nybbler.cc:12
void print(std::ostream *pout) const
Definition: DataMap.h:245
std::string m_Tool
DataMap view(const AdcChannelData &acd) const override
std::unique_ptr< TpcDataTool > m_ptool
DataMap update(AdcChannelData &acd) const override
DataMap viewMap(const AdcChannelDataMap &acds) const override
static constexpr double ps
Definition: Units.h:99
std::unique_ptr< T > getPrivate(std::string name)
AdcResultDumper(fhicl::ParameterSet const &ps)
std::map< AdcChannel, AdcChannelData > AdcChannelDataMap
auto const & get(AssnsNode< L, R, D > const &r)
Definition: AssnsNode.h:115
static DuneToolManager * instance(std::string fclname="", int dbg=1)
QTextStream & endl(QTextStream &s)