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

#include <VintageDeconvoluter.h>

Inheritance diagram for VintageDeconvoluter:
TpcDataTool

Public Member Functions

 VintageDeconvoluter (fhicl::ParameterSet const &ps)
 
 ~VintageDeconvoluter () 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 VintageDeconvoluter.h.

Constructor & Destructor Documentation

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

Definition at line 18 of file VintageDeconvoluter_tool.cc.

19 : m_LogLevel(ps.get<int>("LogLevel")) {
20  const string myname = "VintageDeconvoluter::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)
VintageDeconvoluter::~VintageDeconvoluter ( )
overridedefault

Member Function Documentation

DataMap VintageDeconvoluter::update ( AdcChannelData acd) const
overridevirtual

Reimplemented from AdcChannelTool.

Definition at line 33 of file VintageDeconvoluter_tool.cc.

33  {
34  const string myname = "VintageDeconvoluter::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  auto const clockData = art::ServiceHandle<detinfo::DetectorClocksService>()->DataForJob();
63  hsss->Deconvolute(clockData, chan, samples);
64  if ( pad ) samples.resize(nsam);
65  if ( m_LogLevel >= 3 ) cout << myname << " Normalizing." << endl;
66  float dnorm = hsss->GetDeconNorm();
67  float norm = dnorm > 0.0 ? 1.0/dnorm : 1.0;
68  if ( m_LogLevel >= 3 ) cout << myname << " Scale factor: " << norm << endl;
69  for ( float& sam : samples ) sam *= norm;
70  acd.sampleUnit = "Q_{dco}";
71  acd.sampleNoise = hsss->GetDeconNoise(chan);
72  // Done.
73  return ret;
74 }
void Deconvolute(detinfo::DetectorClocksData const &clockData, Channel channel, std::vector< T > &func) const
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)

Member Data Documentation

int VintageDeconvoluter::m_LogLevel
private

Definition at line 34 of file VintageDeconvoluter.h.


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