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

#include <Protodune.h>

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

Public Member Functions

 StickyCodeMitig (const std::string &anode_tn="AnodePlane", const std::string &noisedb="OmniChannelNoiseDB", float stky_sig_like_val=15.0, float stky_sig_like_rms=2.0, int stky_max_len=5)
 
virtual ~StickyCodeMitig ()
 
virtual WireCell::Waveform::ChannelMaskMap apply (int channel, signal_t &sig) const
 
virtual WireCell::Waveform::ChannelMaskMap apply (channel_signals_t &chansig) const
 
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::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::IConfigurable
virtual ~IConfigurable ()
 
- Public Member Functions inherited from WireCell::IComponent< IConfigurable >
virtual ~IComponent ()
 

Private Attributes

std::string m_anode_tn
 
std::string m_noisedb_tn
 
IAnodePlane::pointer m_anode
 
IChannelNoiseDatabase::pointer m_noisedb
 
std::map< int, std::vector< short int > > m_extra_stky
 
float m_stky_sig_like_val
 
float m_stky_sig_like_rms
 
int m_stky_max_len
 

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

Detailed Description

Microboone/ProtoDUNE style noise subtraction.

Fixme: in principle, this class could be general purpose for other detectors. However, it uses the functions above which hard code microboone-isms. If those microboone/protodune-specific parameters can be pulled out to a higher layer then this class can become generic and move outside of this file.

Definition at line 61 of file Protodune.h.

Constructor & Destructor Documentation

Protodune::StickyCodeMitig::StickyCodeMitig ( const std::string anode_tn = "AnodePlane",
const std::string noisedb = "OmniChannelNoiseDB",
float  stky_sig_like_val = 15.0,
float  stky_sig_like_rms = 2.0,
int  stky_max_len = 5 
)

Definition at line 621 of file Protodune.cxx.

623  : m_anode_tn(anode)
624  , m_noisedb_tn(noisedb)
625  , m_stky_sig_like_val(stky_sig_like_val)
626  , m_stky_sig_like_rms(stky_sig_like_rms)
627  , m_stky_max_len(stky_max_len)
628 
629 {
630 }
Protodune::StickyCodeMitig::~StickyCodeMitig ( )
virtual

Definition at line 631 of file Protodune.cxx.

632 {
633 }

Member Function Documentation

virtual WireCell::Waveform::ChannelMaskMap WireCell::SigProc::Protodune::StickyCodeMitig::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::StickyCodeMitig::apply ( channel_signals_t chansig) const
virtual

Filter in place a group of signals together.

Implements WireCell::IChannelFilter.

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

Accept a configuration.

Implements WireCell::IConfigurable.

Definition at line 635 of file Protodune.cxx.

636 {
637  m_anode_tn = get(cfg, "anode", m_anode_tn);
638  m_anode = Factory::find_tn<IAnodePlane>(m_anode_tn);
639  if (!m_anode) {
640  THROW(KeyError() << errmsg{"failed to get IAnodePlane: " + m_anode_tn});
641  }
642 
643  m_noisedb_tn = get(cfg, "noisedb", m_noisedb_tn);
644  m_noisedb = Factory::find_tn<IChannelNoiseDatabase>(m_noisedb_tn);
645 
646  m_extra_stky.clear();
647  auto jext = cfg["extra_stky"];
648  if(!jext.isNull()){
649  for(auto jone: jext) {
650  auto jchans = jone["channels"];
651  for (auto jchan: jchans){
652  int channel = jchan.asInt();
653  // std::cerr << "[wgu] ch# " << channel << " has " << jone["bits"].size() << " extra stky bits:" << std::endl;
654  for(auto bit: jone["bits"]){
655  // std::cerr << "[wgu] " << bit.asInt() << std::endl;
656  m_extra_stky[channel].push_back((short int)bit.asInt());
657  }
658  }
659 
660  }
661  }
662 
663  if (cfg.isMember("stky_sig_like_val")){
664  m_stky_sig_like_val = get(cfg, "stky_sig_like_val", m_stky_sig_like_val);
665  }
666 
667  if (cfg.isMember("stky_sig_like_rms")){
668  m_stky_sig_like_rms = get(cfg, "stky_sig_like_rms", m_stky_sig_like_rms);
669  }
670 
671  if (cfg.isMember("stky_max_len")){
672  m_stky_max_len = get(cfg, "stky_max_len", m_stky_max_len);
673  }
674 }
boost::error_info< struct tag_errmsg, std::string > errmsg
Definition: Exceptions.h:54
cfg
Definition: dbjson.py:29
IChannelNoiseDatabase::pointer m_noisedb
Definition: Protodune.h:86
std::map< int, std::vector< short int > > m_extra_stky
Definition: Protodune.h:88
#define THROW(e)
Definition: Exceptions.h:25
WireCell::Configuration Protodune::StickyCodeMitig::default_configuration ( ) const
virtual

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

Reimplemented from WireCell::IConfigurable.

Definition at line 675 of file Protodune.cxx.

676 {
678  cfg["anode"] = m_anode_tn;
679  cfg["noisedb"] = m_noisedb_tn;
680  cfg["stky_sig_like_val"] = m_stky_sig_like_val;
681  cfg["stky_sig_like_rms"] = m_stky_sig_like_rms;
682  cfg["stky_max_len"] = m_stky_max_len;
683  return cfg;
684 }
cfg
Definition: dbjson.py:29
Json::Value Configuration
Definition: Configuration.h:50

Member Data Documentation

IAnodePlane::pointer WireCell::SigProc::Protodune::StickyCodeMitig::m_anode
private

Definition at line 85 of file Protodune.h.

std::string WireCell::SigProc::Protodune::StickyCodeMitig::m_anode_tn
private

Definition at line 84 of file Protodune.h.

std::map<int, std::vector<short int> > WireCell::SigProc::Protodune::StickyCodeMitig::m_extra_stky
private

Definition at line 88 of file Protodune.h.

IChannelNoiseDatabase::pointer WireCell::SigProc::Protodune::StickyCodeMitig::m_noisedb
private

Definition at line 86 of file Protodune.h.

std::string WireCell::SigProc::Protodune::StickyCodeMitig::m_noisedb_tn
private

Definition at line 84 of file Protodune.h.

int WireCell::SigProc::Protodune::StickyCodeMitig::m_stky_max_len
private

Definition at line 91 of file Protodune.h.

float WireCell::SigProc::Protodune::StickyCodeMitig::m_stky_sig_like_rms
private

Definition at line 90 of file Protodune.h.

float WireCell::SigProc::Protodune::StickyCodeMitig::m_stky_sig_like_val
private

Definition at line 89 of file Protodune.h.


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