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

#include <Protodune.h>

Inheritance diagram for WireCell::SigProc::Protodune::OneChannelNoise:
WireCell::IChannelFilter WireCell::SigProc::Protodune::ConfigFilterBase WireCell::IComponent< IChannelFilter > WireCell::IConfigurable WireCell::Interface WireCell::IComponent< IConfigurable > WireCell::Interface

Public Member Functions

 OneChannelNoise (const std::string &anode_tn="AnodePlane", const std::string &noisedb="OmniChannelNoiseDB")
 
virtual ~OneChannelNoise ()
 
virtual WireCell::Waveform::ChannelMaskMap apply (int channel, signal_t &sig) const
 
virtual WireCell::Waveform::ChannelMaskMap apply (channel_signals_t &chansig) const
 
void configure (const WireCell::Configuration &config)
 Accept a configuration. More...
 
WireCell::Configuration default_configuration () const
 Optional, override to return a hard-coded default configuration. More...
 
- Public Member Functions inherited from WireCell::IChannelFilter
virtual ~IChannelFilter ()
 
- Public Member Functions inherited from WireCell::IComponent< IChannelFilter >
virtual ~IComponent ()
 
- Public Member Functions inherited from WireCell::Interface
virtual ~Interface ()
 
- Public Member Functions inherited from WireCell::SigProc::Protodune::ConfigFilterBase
 ConfigFilterBase (const std::string &anode="AnodePlane", const std::string &noisedb="OmniChannelNoiseDB")
 
virtual ~ConfigFilterBase ()
 
void set_channel_noisedb (WireCell::IChannelNoiseDatabase::pointer ndb)
 
- Public Member Functions inherited from WireCell::IConfigurable
virtual ~IConfigurable ()
 
- Public Member Functions inherited from WireCell::IComponent< IConfigurable >
virtual ~IComponent ()
 

Private Attributes

Diagnostics::Partial m_check_partial
 
std::map< int, int > m_resmp
 

Additional Inherited Members

- Public Types inherited from WireCell::IChannelFilter
typedef Waveform::realseq_t signal_t
 
typedef std::map< int, signal_tchannel_signals_t
 
- Public Types inherited from WireCell::IComponent< IChannelFilter >
typedef std::shared_ptr< IChannelFilterpointer
 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...
 
- Protected Attributes inherited from WireCell::SigProc::Protodune::ConfigFilterBase
std::string m_anode_tn
 
std::string m_noisedb_tn
 
IAnodePlane::pointer m_anode
 
IChannelNoiseDatabase::pointer m_noisedb
 

Detailed Description

Definition at line 95 of file Protodune.h.

Constructor & Destructor Documentation

Protodune::OneChannelNoise::OneChannelNoise ( const std::string anode_tn = "AnodePlane",
const std::string noisedb = "OmniChannelNoiseDB" 
)

Definition at line 776 of file Protodune.cxx.

777  : ConfigFilterBase(anode, noisedb)
778  , m_check_partial() // fixme, here too.
779  , m_resmp()
780 {
781 }
ConfigFilterBase(const std::string &anode="AnodePlane", const std::string &noisedb="OmniChannelNoiseDB")
Definition: Protodune.cxx:599
Protodune::OneChannelNoise::~OneChannelNoise ( )
virtual

Definition at line 782 of file Protodune.cxx.

783 {
784 }

Member Function Documentation

virtual WireCell::Waveform::ChannelMaskMap WireCell::SigProc::Protodune::OneChannelNoise::apply ( int  channel,
signal_t sig 
) const
virtual

Filter in place the signal sig from given channel.

Implements WireCell::IChannelFilter.

virtual WireCell::Waveform::ChannelMaskMap WireCell::SigProc::Protodune::OneChannelNoise::apply ( channel_signals_t chansig) const
virtual

Filter in place a group of signals together.

Implements WireCell::IChannelFilter.

void Protodune::OneChannelNoise::configure ( const WireCell::Configuration config)
virtual

Accept a configuration.

Reimplemented from WireCell::SigProc::Protodune::ConfigFilterBase.

Definition at line 786 of file Protodune.cxx.

787 {
788  m_anode_tn = get(cfg, "anode", m_anode_tn);
789  m_anode = Factory::find_tn<IAnodePlane>(m_anode_tn);
790  if (!m_anode) {
791  THROW(KeyError() << errmsg{"failed to get IAnodePlane: " + m_anode_tn});
792  }
793 
794  m_noisedb_tn = get(cfg, "noisedb", m_noisedb_tn);
795  m_noisedb = Factory::find_tn<IChannelNoiseDatabase>(m_noisedb_tn);
796 
797  m_resmp.clear();
798  auto jext = cfg["resmp"];
799  if(!jext.isNull()){
800  for(auto jone: jext) {
801  int smpin = jone["sample_from"].asInt();
802  for(auto jch: jone["channels"]){
803  int channel = jch.asInt();
804  m_resmp[channel] = smpin;
805  }
806  }
807  }
808 
809 }
boost::error_info< struct tag_errmsg, std::string > errmsg
Definition: Exceptions.h:54
cfg
Definition: dbjson.py:29
#define THROW(e)
Definition: Exceptions.h:25
IChannelNoiseDatabase::pointer m_noisedb
Definition: Protodune.h:46
WireCell::Configuration Protodune::OneChannelNoise::default_configuration ( ) const
virtual

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

Reimplemented from WireCell::SigProc::Protodune::ConfigFilterBase.

Definition at line 810 of file Protodune.cxx.

811 {
813  cfg["anode"] = m_anode_tn;
814  cfg["noisedb"] = m_noisedb_tn;
815  return cfg;
816 }
cfg
Definition: dbjson.py:29
Json::Value Configuration
Definition: Configuration.h:50

Member Data Documentation

Diagnostics::Partial WireCell::SigProc::Protodune::OneChannelNoise::m_check_partial
private

Definition at line 114 of file Protodune.h.

std::map<int, int> WireCell::SigProc::Protodune::OneChannelNoise::m_resmp
private

Definition at line 115 of file Protodune.h.


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