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

#include <PddpVintageDeconvoluter.h>

Inheritance diagram for PddpVintageDeconvoluter:
TpcDataTool

Public Member Functions

 PddpVintageDeconvoluter (fhicl::ParameterSet const &ps)
 
 ~PddpVintageDeconvoluter () override=default
 
DataMap update (AdcChannelData &acd) const override
 

Private Attributes

int m_LogLevel
 

Additional Inherited Members

- Private Types inherited from AdcChannelTool
using Index = unsigned int
 
- Private Member Functions inherited from TpcDataTool
virtual DataMap updateTpcData (TpcData &) const
 
virtual DataMap viewTpcData (const TpcData &) const
 
virtual int forwardTpcData () const
 
- Private Member Functions inherited from AdcChannelTool
virtual ~AdcChannelTool ()=default
 
virtual DataMap view (const AdcChannelData &acd) const
 
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)
 
- Static Private Member Functions inherited from AdcChannelTool
static int interfaceNotImplemented ()
 

Detailed Description

Definition at line 21 of file PddpVintageDeconvoluter.h.

Constructor & Destructor Documentation

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

Definition at line 18 of file PddpVintageDeconvoluter_tool.cc.

19 : m_LogLevel(ps.get<int>("LogLevel")) {
20  const string myname = "PddpVintageDeconvoluter::ctor: ";
21  if ( m_LogLevel >= 1 ) {
22  cout << myname << "Parameters:" << endl;
23  cout << myname << " LogLevel: " << m_LogLevel << endl;
25  float dnorm = hsss->GetDeconNorm();
26  float norm = dnorm > 0.0 ? 1.0/dnorm : 1.0;
27  cout << myname << "Normalization factor: " << norm << endl;
28  }
29 }
static constexpr double ps
Definition: Units.h:99
auto norm(Vector const &v)
Return norm of the specified vector.
QTextStream & endl(QTextStream &s)
PddpVintageDeconvoluter::~PddpVintageDeconvoluter ( )
overridedefault

Member Function Documentation

DataMap PddpVintageDeconvoluter::update ( AdcChannelData acd) const
overridevirtual

Reimplemented from AdcChannelTool.

Definition at line 33 of file PddpVintageDeconvoluter_tool.cc.

33  {
34  const string myname = "PddpVintageDeconvoluter::view: ";
35  DataMap ret;
36  AdcChannel chan = acd.channel();
37  AdcSignalVector& samples = acd.samples;
38  unsigned int nsam = samples.size();
39  if ( m_LogLevel >= 2 ) cout << myname << "Deconvoluting channel " << chan
40  << " with " << nsam << " samples." << endl;
41  // Fetch the FFT size.
43  unsigned int fftsize = hFFT->FFTSize();
44  if ( nsam > fftsize ) {
45  cout << myname << "ERROR: Data has too many ticks for FFT: "
46  << nsam << " > " << fftsize << "." << endl;
47  return ret.setStatus(1);
48  }
49  // Pad the data to the FFT size.
50  bool pad = fftsize > nsam;
51  if ( pad ) {
52  if ( m_LogLevel >= 3 ) cout << myname << " Padding sample vector to " << fftsize << endl;
53  samples.resize(fftsize);
54  for ( unsigned int isam=nsam; isam<fftsize; ++isam ) {
55  //samples[isam] = samples[isam-nsam];
56  samples[isam] = 0;
57  }
58  }
59  // Deconvolute.
61  if ( m_LogLevel >= 3 ) cout << myname << " Deconvoluting." << endl;
62  hsss->Deconvolute(chan, samples);
63  if ( pad ) samples.resize(nsam);
64  if ( m_LogLevel >= 3 ) cout << myname << " Normalizing." << endl;
65  float dnorm = hsss->GetDeconNorm();
66  float norm = dnorm > 0.0 ? 1.0/dnorm : 1.0;
67  if ( m_LogLevel >= 3 ) cout << myname << " Scale factor: " << norm << endl;
68  for ( float& sam : samples ) sam *= norm;
69  acd.sampleUnit = "Q_{dco}";
70  acd.sampleNoise = hsss->GetDeconNoise(chan);
71  // Done.
72  return ret;
73 }
DataMap & setStatus(int stat)
Definition: DataMap.h:130
double GetDeconNoise(Channel channel) const override
int FFTSize() const
Definition: LArFFT.h:69
AdcSignal sampleNoise
auto norm(Vector const &v)
Return norm of the specified vector.
Channel channel() const
unsigned int AdcChannel
Definition: AdcTypes.h:50
std::vector< AdcSignal > AdcSignalVector
Definition: AdcTypes.h:22
AdcSignalVector samples
QTextStream & endl(QTextStream &s)
void Deconvolute(unsigned int channel, std::vector< T > &func) const

Member Data Documentation

int PddpVintageDeconvoluter::m_LogLevel
private

Definition at line 34 of file PddpVintageDeconvoluter.h.


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