Public Member Functions | Private Types | Private Attributes | List of all members
FembMappedAdcModifier Class Reference

#include <FembMappedAdcModifier.h>

Inheritance diagram for FembMappedAdcModifier:
TpcDataTool AdcChannelTool

Public Member Functions

 FembMappedAdcModifier (fhicl::ParameterSet const &ps)
 
DataMap view (const AdcChannelData &acd) const override
 
DataMap update (AdcChannelData &acd) const override
 
- Public Member Functions inherited from TpcDataTool
virtual DataMap updateTpcData (TpcData &) const
 
virtual DataMap viewTpcData (const TpcData &) const
 
virtual int forwardTpcData () const
 
- Public Member Functions inherited from AdcChannelTool
virtual ~AdcChannelTool ()=default
 
virtual DataMap updateMap (AdcChannelDataMap &acds) const
 
virtual DataMap viewMap (const AdcChannelDataMap &acds) const
 
virtual bool updateWithView () const
 
virtual bool viewWithUpdate () const
 
virtual DataMap beginEvent (const DuneEventInfo &) const
 
virtual DataMap endEvent (const DuneEventInfo &) const
 
virtual DataMap close (const DataMap *dmin=nullptr)
 

Private Types

using Name = std::string
 

Private Attributes

int m_LogLevel
 
Name m_ToolBase
 
Name m_DirName
 

Additional Inherited Members

- Public Types inherited from AdcChannelTool
using Index = unsigned int
 
- Static Public Member Functions inherited from AdcChannelTool
static int interfaceNotImplemented ()
 

Detailed Description

Definition at line 29 of file FembMappedAdcModifier.h.

Member Typedef Documentation

Definition at line 42 of file FembMappedAdcModifier.h.

Constructor & Destructor Documentation

FembMappedAdcModifier::FembMappedAdcModifier ( fhicl::ParameterSet const &  ps)

Definition at line 19 of file FembMappedAdcModifier_tool.cc.

20 : m_LogLevel(ps.get<int>("LogLevel")),
21  m_ToolBase(ps.get<Name>("ToolBase")),
22  m_DirName(ps.get<Name>("DirName")) {
23  const string myname = "FembMappedAdcModifier::ctor: ";
24  if ( m_LogLevel >= 1 ) {
25  cout << myname << " Log level: " << m_LogLevel << endl;
26  cout << myname << " Tool base: " << m_ToolBase << endl;
27  cout << myname << " Fcl dir: " << m_DirName << endl;
28  }
29 }
ChannelGroupService::Name Name
static constexpr double ps
Definition: Units.h:99
QTextStream & endl(QTextStream &s)

Member Function Documentation

DataMap FembMappedAdcModifier::update ( AdcChannelData acd) const
overridevirtual

Reimplemented from AdcChannelTool.

Definition at line 42 of file FembMappedAdcModifier_tool.cc.

42  {
43  const string myname = "FembMappedAdcModifier::update: ";
44  DataMap res;
45  AdcChannel ifmb = acd.fembID();
46  ostringstream sstool;
47  sstool << m_ToolBase;
48  if ( ifmb == AdcChannelData::badIndex() ) sstool << "Default";
49  else sstool << ifmb;
50  Name toolName = sstool.str();
51  DuneToolManager* pdtm = nullptr;
52  std::unique_ptr<DuneToolManager> pdtmManaged;
53  if ( m_DirName.size() ) {
54  Name fclfile = m_DirName + "/" + toolName + ".fcl";
55  if ( gSystem->AccessPathName(fclfile.c_str()) ) {
56  cout << myname << "ERROR: No such file: " << fclfile << endl;
57  return res.setStatus(2000);
58  }
59  pdtmManaged.reset(new DuneToolManager(fclfile));
60  pdtm = pdtmManaged.get();
61  } else {
63  }
64  ToolPtr ptool = pdtm->getPrivate<TpcDataTool>(toolName);
65  if ( ptool == nullptr ) {
66  if ( m_LogLevel >= 2 ) {
67  cout << myname << "ERROR: Unable find tool " << toolName << endl;
68  }
69  return res.setStatus(1000);
70  }
71  return ptool->update(acd);
72 }
DataMap & setStatus(int stat)
Definition: DataMap.h:130
ChannelGroupService::Name Name
std::unique_ptr< TpcDataTool > ToolPtr
Index fembID() const
std::unique_ptr< T > getPrivate(std::string name)
unsigned int AdcChannel
Definition: AdcTypes.h:50
static Index badIndex()
static DuneToolManager * instance(std::string fclname="", int dbg=1)
QTextStream & endl(QTextStream &s)
DataMap FembMappedAdcModifier::view ( const AdcChannelData acd) const
overridevirtual

Reimplemented from AdcChannelTool.

Definition at line 33 of file FembMappedAdcModifier_tool.cc.

33  {
35  AdcChannelData acdtmp(acd);
36  acdtmp.samples = acd.samples;
37  return update(acdtmp);
38 }
static QCString result
DataMap update(AdcChannelData &acd) const override
AdcSignalVector samples

Member Data Documentation

Name FembMappedAdcModifier::m_DirName
private

Definition at line 47 of file FembMappedAdcModifier.h.

int FembMappedAdcModifier::m_LogLevel
private

Definition at line 45 of file FembMappedAdcModifier.h.

Name FembMappedAdcModifier::m_ToolBase
private

Definition at line 46 of file FembMappedAdcModifier.h.


The documentation for this class was generated from the following files: