Public Member Functions | Private Attributes | List of all members
WireCell::SigProc::Diagnostics::Partial Class Reference

#include <Diagnostics.h>

Public Member Functions

 Partial (int nfreqs=4, double maxpower=6000.0)
 Create a partial waveform detector using magic numbers. More...
 
bool operator() (const WireCell::Waveform::compseq_t &spec) const
 Return true if given frequency spectrum consistent with a partial waveform. More...
 

Private Attributes

const int nfreqs
 
const double maxpower
 

Detailed Description

Definition at line 27 of file Diagnostics.h.

Constructor & Destructor Documentation

Diagnostics::Partial::Partial ( int  nfreqs = 4,
double  maxpower = 6000.0 
)

Create a partial waveform detector using magic numbers.

Definition at line 11 of file Diagnostics.cxx.

Member Function Documentation

bool Diagnostics::Partial::operator() ( const WireCell::Waveform::compseq_t spec) const

Return true if given frequency spectrum consistent with a partial waveform.

Definition at line 17 of file Diagnostics.cxx.

18 {
19  const double mag0 = std::abs(spec[0+1]);
20  double sum = mag0;
21  for (int ind=1; ind<= nfreqs && ind < (int)spec.size(); ++ind) {
22  const double magi = std::abs(spec[ind+1]);
23  if (mag0 <= magi) {
24  return false;
25  }
26  sum += magi;
27  }
28  // if (sum/(nfreqs+1) > maxpower){
29  // std::cout << mag0 << " " << std::abs(spec[2]) << " " << std::abs(spec[3]) << " " << std::abs(spec[4]) << " " << std::abs(spec[5]) << std::endl;
30  // }
31 
32  return sum/(nfreqs+1) > maxpower;
33 }
T abs(T value)
IFrame::pointer sum(std::vector< IFrame::pointer > frames, int ident)
Definition: FrameUtil.cxx:15

Member Data Documentation

const double WireCell::SigProc::Diagnostics::Partial::maxpower
private

Definition at line 29 of file Diagnostics.h.

const int WireCell::SigProc::Diagnostics::Partial::nfreqs
private

Definition at line 28 of file Diagnostics.h.


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