Diagnostics.h
Go to the documentation of this file.
1 #ifndef WIRECELLSIGPROC_DIAGNOSTICS
2 #define WIRECELLSIGPROC_DIAGNOSTICS
3 
5 
6 namespace WireCell {
7  namespace SigProc {
8  namespace Diagnostics {
9 
10  // Functional object to find the first chirp region in the signal.
11  class Chirp {
12  const int windowSize;
14  public:
15  /// Create a chirp detector using magic numbers.
16  Chirp(int windowSize = 20, double chirpMinRMS = 0.9, double maxNormalNeighborFrac = 0.20);
17 
18  // Return true if a chirp region is found and set beg/end indices to its half-open bounds.
19  bool operator()(const WireCell::Waveform::realseq_t& sig, int& beg, int& end) const;
20  };
21 
22 
23  // Return true if DC component dominates over nfreqs lowest
24  // frequencies and if average low frequency power is more than
25  // maxpower.
26  //bool id_rc(const WireCell::Waveform::compseq_t& spec, int nfreqs=4, float maxpower=6000.0);
27  class Partial {
28  const int nfreqs;
29  const double maxpower;
30  public:
31  /// Create a partial waveform detector using magic numbers.
32  Partial(int nfreqs=4, double maxpower=6000.0);
33 
34  /// Return true if given frequency spectrum consistent with a partial waveform
35  bool operator()(const WireCell::Waveform::compseq_t& spec) const;
36 
37  };
38 
39 
40  }
41  }
42 }
43 
44 #endif
45 
46 // Local Variables:
47 // mode: c++
48 // c-basic-offset: 4
49 // End:
Sequence< real_t > realseq_t
Definition: Waveform.h:31
bool operator()(const WireCell::Waveform::realseq_t &sig, int &beg, int &end) const
Definition: Diagnostics.cxx:43
decltype(auto) constexpr end(T &&obj)
ADL-aware version of std::end.
Definition: StdUtils.h:72
Definition: Main.h:22
Sequence< complex_t > compseq_t
A complex-valued sequence, eg for discrete spectrum powers.
Definition: Waveform.h:34
Chirp(int windowSize=20, double chirpMinRMS=0.9, double maxNormalNeighborFrac=0.20)
Create a chirp detector using magic numbers.
Definition: Diagnostics.cxx:36