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

#include <LfFilter.h>

Inheritance diagram for WireCell::SigProc::LfFilter:
WireCell::IFilterWaveform WireCell::IConfigurable WireCell::IComponent< IFilterWaveform > WireCell::IComponent< IConfigurable > WireCell::Interface WireCell::Interface

Public Member Functions

 LfFilter (double max_freq=1 *units::megahertz, double tau=0.02 *units::megahertz)
 
virtual ~LfFilter ()
 
virtual const Waveform::realseq_t filter_waveform (int nbins) const
 Provide the filter waveform with a given number of frequency bins. More...
 
virtual void configure (const WireCell::Configuration &config)
 Accept a configuration. More...
 
virtual WireCell::Configuration default_configuration () const
 Optional, override to return a hard-coded default configuration. More...
 
- Public Member Functions inherited from WireCell::IFilterWaveform
virtual ~IFilterWaveform ()
 
- Public Member Functions inherited from WireCell::IComponent< IFilterWaveform >
virtual ~IComponent ()
 
- Public Member Functions inherited from WireCell::Interface
virtual ~Interface ()
 
- Public Member Functions inherited from WireCell::IConfigurable
virtual ~IConfigurable ()
 
- Public Member Functions inherited from WireCell::IComponent< IConfigurable >
virtual ~IComponent ()
 

Private Attributes

double m_max_freq
 
double m_tau
 

Additional Inherited Members

- Public Types inherited from WireCell::IComponent< IFilterWaveform >
typedef std::shared_ptr< IFilterWaveformpointer
 Access subclass facet by pointer. More...
 
typedef std::vector< pointervector
 Vector of shared pointers. More...
 
- Public Types inherited from WireCell::Interface
typedef std::shared_ptr< Interfacepointer
 
- Public Types inherited from WireCell::IComponent< IConfigurable >
typedef std::shared_ptr< IConfigurablepointer
 Access subclass facet by pointer. More...
 
typedef std::vector< pointervector
 Vector of shared pointers. More...
 

Detailed Description

Definition at line 11 of file LfFilter.h.

Constructor & Destructor Documentation

SigProc::LfFilter::LfFilter ( double  max_freq = 1 * units::megahertz,
double  tau = 0.02* units::megahertz 
)

Definition at line 11 of file LfFilter.cxx.

12  : m_max_freq(max_freq)
13  , m_tau(tau)
14 {
15 }
SigProc::LfFilter::~LfFilter ( )
virtual

Definition at line 17 of file LfFilter.cxx.

18 {
19 }

Member Function Documentation

void SigProc::LfFilter::configure ( const WireCell::Configuration config)
virtual

Accept a configuration.

Implements WireCell::IConfigurable.

Definition at line 29 of file LfFilter.cxx.

30 {
31  m_tau = get(cfg,"tau",m_tau);
32  m_max_freq = get(cfg,"max_freq",m_max_freq);
33 }
cfg
Definition: dbjson.py:29
WireCell::Configuration SigProc::LfFilter::default_configuration ( ) const
virtual

Optional, override to return a hard-coded default configuration.

Reimplemented from WireCell::IConfigurable.

Definition at line 21 of file LfFilter.cxx.

22 {
24  cfg["tau"] = m_tau;
25  cfg["max_freq"] = m_max_freq;
26  return cfg;
27 }
cfg
Definition: dbjson.py:29
Json::Value Configuration
Definition: Configuration.h:50
const Waveform::realseq_t SigProc::LfFilter::filter_waveform ( int  nfbins) const
virtual

Provide the filter waveform with a given number of frequency bins.

Implements WireCell::IFilterWaveform.

Definition at line 36 of file LfFilter.cxx.

37 {
39 
40  Response::LfFilter lf_filter(m_tau);
41 
42  for (size_t i=0; i!=m_wfs.size();i++){
43  double freq = i * 1.0 / int(m_wfs.size()) * 2 * m_max_freq;
44  if (freq > m_max_freq)
45  freq = freq - 2*m_max_freq;
46  m_wfs.at(i) = lf_filter(fabs(freq));
47  }
48  // std::cout << m_wfs.size() << std::endl;
49 
50  return m_wfs;
51 }
Sequence< real_t > realseq_t
Definition: Waveform.h:31
double lf_filter(double freq, double tau=0.02)
Definition: Response.cxx:386

Member Data Documentation

double WireCell::SigProc::LfFilter::m_max_freq
private

Definition at line 24 of file LfFilter.h.

double WireCell::SigProc::LfFilter::m_tau
private

Definition at line 25 of file LfFilter.h.


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