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

#include <AdcRoiShifter.h>

Inheritance diagram for AdcRoiShifter:
TpcDataTool AdcChannelTool

Public Member Functions

 AdcRoiShifter (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
 
int m_BinOffset
 

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 22 of file AdcRoiShifter.h.

Member Typedef Documentation

Definition at line 35 of file AdcRoiShifter.h.

Constructor & Destructor Documentation

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

Definition at line 14 of file AdcRoiShifter_tool.cc.

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 }
static constexpr double ps
Definition: Units.h:99
QTextStream & endl(QTextStream &s)

Member Function Documentation

DataMap AdcRoiShifter::update ( AdcChannelData acd) const
overridevirtual

Reimplemented from AdcChannelTool.

Definition at line 27 of file AdcRoiShifter_tool.cc.

27  {
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 }
AdcRoiVector rois
void setInt(Name name, int val)
Definition: DataMap.h:131
unsigned int AdcIndex
Definition: AdcTypes.h:15
AdcFilterVector signal
QTextStream & endl(QTextStream &s)
DataMap AdcRoiShifter::view ( const AdcChannelData acd) const
overridevirtual

Reimplemented from AdcChannelTool.

Definition at line 60 of file AdcRoiShifter_tool.cc.

60  {
61  AdcChannelData acdtmp;
62  acdtmp.signal = acd.signal;
63  return update(acdtmp);
64 }
DataMap update(AdcChannelData &acd) const override
AdcFilterVector signal

Member Data Documentation

int AdcRoiShifter::m_BinOffset
private

Definition at line 39 of file AdcRoiShifter.h.

int AdcRoiShifter::m_LogLevel
private

Definition at line 38 of file AdcRoiShifter.h.


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