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

#include <HfFilter.h>

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

Public Member Functions

 HfFilter (double max_freq=1 *units::megahertz, double sigma=3.0 *units::megahertz, double power=2, bool flag=true)
 
virtual ~HfFilter ()
 
virtual const Waveform::realseq_t filter_waveform (int nfbins) 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_sigma
 
double m_power
 
bool m_flag
 

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 HfFilter.h.

Constructor & Destructor Documentation

SigProc::HfFilter::HfFilter ( double  max_freq = 1 * units::megahertz,
double  sigma = 3.0* units::megahertz,
double  power = 2,
bool  flag = true 
)

Definition at line 11 of file HfFilter.cxx.

12  : m_max_freq(max_freq)
13  , m_sigma(sigma)
14  , m_power(power)
15  , m_flag(flag)
16 {
17 }
SigProc::HfFilter::~HfFilter ( )
virtual

Definition at line 19 of file HfFilter.cxx.

20 {
21 }

Member Function Documentation

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

Accept a configuration.

Implements WireCell::IConfigurable.

Definition at line 33 of file HfFilter.cxx.

34 {
35  m_sigma = get(cfg,"sigma",m_sigma);
36  m_power = get(cfg,"power",m_power);
37  m_flag = get(cfg,"flag",m_flag);
38 
39  m_max_freq = get(cfg,"max_freq",m_max_freq);
40 }
cfg
Definition: dbjson.py:29
WireCell::Configuration SigProc::HfFilter::default_configuration ( ) const
virtual

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

Reimplemented from WireCell::IConfigurable.

Definition at line 23 of file HfFilter.cxx.

24 {
26  cfg["sigma"] = m_sigma;
27  cfg["power"] = m_power;
28  cfg["flag"] = m_flag;
29  cfg["max_freq"] = m_max_freq;
30  return cfg;
31 }
cfg
Definition: dbjson.py:29
Json::Value Configuration
Definition: Configuration.h:50
const Waveform::realseq_t SigProc::HfFilter::filter_waveform ( int  nfbins) const
virtual

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

Implements WireCell::IFilterWaveform.

Definition at line 43 of file HfFilter.cxx.

44 {
46 
47  Response::HfFilter hf_filter(m_sigma,m_power,m_flag);
48 
49  for (size_t i=0; i!=m_wfs.size();i++){
50  double freq = i * 1.0 / int(m_wfs.size()) * 2 * m_max_freq;
51  if (freq > m_max_freq)
52  freq = freq - 2*m_max_freq;
53  m_wfs.at(i) = hf_filter(fabs(freq));
54  }
55  // std::cout << m_wfs.size() << std::endl;
56 
57  return m_wfs;
58 }
Sequence< real_t > realseq_t
Definition: Waveform.h:31
double hf_filter(double freq, double sigma=1, double power=2, bool zero_freq_removal=true)
Definition: Response.cxx:377

Member Data Documentation

bool WireCell::SigProc::HfFilter::m_flag
private

Definition at line 27 of file HfFilter.h.

double WireCell::SigProc::HfFilter::m_max_freq
private

Definition at line 24 of file HfFilter.h.

double WireCell::SigProc::HfFilter::m_power
private

Definition at line 26 of file HfFilter.h.

double WireCell::SigProc::HfFilter::m_sigma
private

Definition at line 25 of file HfFilter.h.


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