WireCellToolkit
Wire Cell Simulation, Signal Process and Reconstruction Toolki for Liquid Argon Detectors
WireCell::SigProc::SimpleChannelNoiseDB Class Reference

#include <SimpleChannelNoiseDB.h>

Inheritance diagram for WireCell::SigProc::SimpleChannelNoiseDB:
Collaboration diagram for WireCell::SigProc::SimpleChannelNoiseDB:

Public Types

typedef std::tuple< double, int, int > mask_t
 
typedef std::vector< mask_tmultimask_t
 
- Public Types inherited from WireCell::IChannelNoiseDatabase
typedef WireCell::Waveform::compseq_t filter_t
 The data type for all frequency-space, multiplicative filters. More...
 
typedef std::vector< int > channel_group_t
 
- Public Types inherited from WireCell::IComponent< IChannelNoiseDatabase >
typedef std::shared_ptr< IChannelNoiseDatabasepointer
 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 Member Functions

 SimpleChannelNoiseDB (double tick=0.5 *units::us, int nsamples=9600)
 
virtual ~SimpleChannelNoiseDB ()
 
virtual double sample_time () const
 FIXME: how to handle state changes? More...
 
virtual double nominal_baseline (int channel) const
 Return a nominal baseline correction (additive offset) More...
 
virtual double gain_correction (int channel) const
 
virtual double response_offset (int channel) const
 Return a time offset associated with the response(). More...
 
virtual int pad_window_front (int channel) const
 
virtual int pad_window_back (int channel) const
 
virtual float coherent_nf_decon_limit (int channel) const
 
virtual float coherent_nf_decon_lf_cutoff (int channel) const
 
virtual float coherent_nf_decon_limit1 (int channel) const
 
virtual float coherent_nf_adc_limit (int channel) const
 
virtual float coherent_nf_protection_factor (int channel) const
 
virtual float coherent_nf_min_adc_limit (int channel) const
 
virtual double min_rms_cut (int channel) const
 
virtual double max_rms_cut (int channel) const
 
virtual const filter_trcrc (int channel) const
 Return the filter for the RC+RC coupling response function. More...
 
virtual const filter_tconfig (int channel) const
 Return the filter to correct any wrongly configured channels. More...
 
virtual const filter_tnoise (int channel) const
 Return the filter to attenuate noise. More...
 
virtual const filter_tresponse (int channel) const
 A nominal detector response spectrum for a given channel. More...
 
virtual std::vector< channel_group_tcoherent_channels () const
 Return channel grouping for coherent noise subtraction. More...
 
virtual channel_group_t bad_channels () const
 Return channels which are considered a'priori "bad". More...
 
void set_sampling (double tick=0.5 *units::us, int nsamples=9600)
 
void set_nominal_baseline (const std::vector< int > &channels, double baseline)
 Set nominal baseline in units of ADC (eg uB is -2048 for U/V, -400 for W) More...
 
void set_gains_shapings (const std::vector< int > &channels, double from_gain_mVfC=7.8, double to_gain_mVfC=14.0, double from_shaping=1.0 *units::us, double to_shaping=2.0 *units::us)
 
void set_response_offset (const std::vector< int > &channels, double offset)
 Set a response offset for the given set of channels. More...
 
void set_pad_window_front (const std::vector< int > &channels, int pad_f)
 
void set_pad_window_back (const std::vector< int > &channels, int pad_b)
 
void set_coherent_nf_decon_limit (const std::vector< int > &channels, float decon_limit)
 
void set_coherent_nf_decon_lf_cutoff (const std::vector< int > &channels, float decon_lf_cutoff)
 
void set_coherent_nf_decon_limit1 (const std::vector< int > &channels, float decon_limit)
 
void set_coherent_nf_adc_limit (const std::vector< int > &channels, float adc_limit)
 
void set_coherent_nf_protection_factor (const std::vector< int > &channels, float protection_factor)
 
void set_coherent_nf_min_adc_limit (const std::vector< int > &channels, float min_adc_limit)
 
void set_min_rms_cut (const std::vector< int > &channels, double min_rms)
 
void set_min_rms_cut_one (int channel, double min_rms)
 
void set_max_rms_cut (const std::vector< int > &channels, double max_rms)
 
void set_max_rms_cut_one (int channel, double max_rms)
 
void set_rcrc_constant (const std::vector< int > &channels, double rcrc=2000.0)
 
void set_response (const std::vector< int > &channels, const filter_t &spectrum)
 Set a detector response spectrum for the set of channels. More...
 
void set_filter (const std::vector< int > &channels, const multimask_t &mask)
 
void set_channel_groups (const std::vector< channel_group_t > &channel_groups)
 Set the channel groups. More...
 
void set_bad_channels (const channel_group_t &bc)
 Set "bad" channels. More...
 
- Public Member Functions inherited from WireCell::IChannelNoiseDatabase
virtual ~IChannelNoiseDatabase ()
 
virtual channel_group_t miscfg_channels () const
 Return channels which are considered a'priori "misconfigured". More...
 
- Public Member Functions inherited from WireCell::IComponent< IChannelNoiseDatabase >
virtual ~IComponent ()
 
- Public Member Functions inherited from WireCell::Interface
virtual ~Interface ()
 

Detailed Description

Definition at line 17 of file SimpleChannelNoiseDB.h.

Member Typedef Documentation

◆ mask_t

typedef std::tuple<double, int, int> WireCell::SigProc::SimpleChannelNoiseDB::mask_t

Set a constant scaling to a band covering the given frequency bins (inclusively) for the given channels. Frequency bin "i" is from i*f to (i+1)*f where f is 1.0/(nsamples*tick). The largest meaningful frequency bin is nsamples/2. The frequency band is inclusive of both min and max frequency bins. Note, it's up to caller to appropriately segment multiple masks across multiple channels. For any given channel, last call to this method wins.

Definition at line 117 of file SimpleChannelNoiseDB.h.

◆ multimask_t

Constructor & Destructor Documentation

◆ SimpleChannelNoiseDB()

SimpleChannelNoiseDB::SimpleChannelNoiseDB ( double  tick = 0.5*units::us,
int  nsamples = 9600 
)

Create a simple channel noise DB for digitized waveforms with the given size and number of samples. Default is for microboone.

Definition at line 15 of file SimpleChannelNoiseDB.cxx.

Here is the call graph for this function:

◆ ~SimpleChannelNoiseDB()

SimpleChannelNoiseDB::~SimpleChannelNoiseDB ( )
virtual

Definition at line 34 of file SimpleChannelNoiseDB.cxx.

Member Function Documentation

◆ bad_channels()

virtual channel_group_t WireCell::SigProc::SimpleChannelNoiseDB::bad_channels ( ) const
inlinevirtual

Return channels which are considered a'priori "bad".

Reimplemented from WireCell::IChannelNoiseDatabase.

Definition at line 54 of file SimpleChannelNoiseDB.h.

Here is the call graph for this function:

◆ coherent_channels()

virtual std::vector<channel_group_t> WireCell::SigProc::SimpleChannelNoiseDB::coherent_channels ( ) const
inlinevirtual

Return channel grouping for coherent noise subtraction.

Implements WireCell::IChannelNoiseDatabase.

Definition at line 51 of file SimpleChannelNoiseDB.h.

◆ coherent_nf_adc_limit()

float SimpleChannelNoiseDB::coherent_nf_adc_limit ( int  channel) const
virtual

Implements WireCell::IChannelNoiseDatabase.

Definition at line 135 of file SimpleChannelNoiseDB.cxx.

Here is the caller graph for this function:

◆ coherent_nf_decon_lf_cutoff()

float SimpleChannelNoiseDB::coherent_nf_decon_lf_cutoff ( int  channel) const
virtual

Implements WireCell::IChannelNoiseDatabase.

Definition at line 117 of file SimpleChannelNoiseDB.cxx.

Here is the caller graph for this function:

◆ coherent_nf_decon_limit()

float SimpleChannelNoiseDB::coherent_nf_decon_limit ( int  channel) const
virtual

Implements WireCell::IChannelNoiseDatabase.

Definition at line 108 of file SimpleChannelNoiseDB.cxx.

Here is the caller graph for this function:

◆ coherent_nf_decon_limit1()

float SimpleChannelNoiseDB::coherent_nf_decon_limit1 ( int  channel) const
virtual

Implements WireCell::IChannelNoiseDatabase.

Definition at line 126 of file SimpleChannelNoiseDB.cxx.

Here is the caller graph for this function:

◆ coherent_nf_min_adc_limit()

float SimpleChannelNoiseDB::coherent_nf_min_adc_limit ( int  channel) const
virtual

Implements WireCell::IChannelNoiseDatabase.

Definition at line 153 of file SimpleChannelNoiseDB.cxx.

Here is the caller graph for this function:

◆ coherent_nf_protection_factor()

float SimpleChannelNoiseDB::coherent_nf_protection_factor ( int  channel) const
virtual

Implements WireCell::IChannelNoiseDatabase.

Definition at line 144 of file SimpleChannelNoiseDB.cxx.

Here is the caller graph for this function:

◆ config()

const IChannelNoiseDatabase::filter_t & SimpleChannelNoiseDB::config ( int  channel) const
virtual

Return the filter to correct any wrongly configured channels.

Implements WireCell::IChannelNoiseDatabase.

Definition at line 187 of file SimpleChannelNoiseDB.cxx.

Here is the caller graph for this function:

◆ gain_correction()

double SimpleChannelNoiseDB::gain_correction ( int  channel) const
virtual

Return simple gain correction (a multiplicative, unitless scaling) to apply to a given channel.

Implements WireCell::IChannelNoiseDatabase.

Definition at line 49 of file SimpleChannelNoiseDB.cxx.

Here is the caller graph for this function:

◆ max_rms_cut()

double SimpleChannelNoiseDB::max_rms_cut ( int  channel) const
virtual

Implements WireCell::IChannelNoiseDatabase.

Definition at line 77 of file SimpleChannelNoiseDB.cxx.

Here is the caller graph for this function:

◆ min_rms_cut()

double SimpleChannelNoiseDB::min_rms_cut ( int  channel) const
virtual

Implements WireCell::IChannelNoiseDatabase.

Definition at line 68 of file SimpleChannelNoiseDB.cxx.

Here is the caller graph for this function:

◆ noise()

const IChannelNoiseDatabase::filter_t & SimpleChannelNoiseDB::noise ( int  channel) const
virtual

Return the filter to attenuate noise.

Implements WireCell::IChannelNoiseDatabase.

Definition at line 192 of file SimpleChannelNoiseDB.cxx.

Here is the caller graph for this function:

◆ nominal_baseline()

double SimpleChannelNoiseDB::nominal_baseline ( int  channel) const
virtual

Return a nominal baseline correction (additive offset)

Implements WireCell::IChannelNoiseDatabase.

Definition at line 40 of file SimpleChannelNoiseDB.cxx.

Here is the caller graph for this function:

◆ pad_window_back()

int SimpleChannelNoiseDB::pad_window_back ( int  channel) const
virtual

Implements WireCell::IChannelNoiseDatabase.

Definition at line 98 of file SimpleChannelNoiseDB.cxx.

Here is the caller graph for this function:

◆ pad_window_front()

int SimpleChannelNoiseDB::pad_window_front ( int  channel) const
virtual

Implements WireCell::IChannelNoiseDatabase.

Definition at line 88 of file SimpleChannelNoiseDB.cxx.

Here is the caller graph for this function:

◆ rcrc()

const IChannelNoiseDatabase::filter_t & SimpleChannelNoiseDB::rcrc ( int  channel) const
virtual

Return the filter for the RC+RC coupling response function.

Implements WireCell::IChannelNoiseDatabase.

Definition at line 182 of file SimpleChannelNoiseDB.cxx.

Here is the caller graph for this function:

◆ response()

const IChannelNoiseDatabase::filter_t & SimpleChannelNoiseDB::response ( int  channel) const
virtual

A nominal detector response spectrum for a given channel.

Implements WireCell::IChannelNoiseDatabase.

Definition at line 197 of file SimpleChannelNoiseDB.cxx.

Here is the caller graph for this function:

◆ response_offset()

double SimpleChannelNoiseDB::response_offset ( int  channel) const
virtual

Return a time offset associated with the response().

Implements WireCell::IChannelNoiseDatabase.

Definition at line 58 of file SimpleChannelNoiseDB.cxx.

Here is the caller graph for this function:

◆ sample_time()

virtual double WireCell::SigProc::SimpleChannelNoiseDB::sample_time ( ) const
inlinevirtual

FIXME: how to handle state changes?

Return the time-domain sample period (time in system of units) which is was used in producing the filter response spectral functions (filter_t).

Warning: take care that the number of frequency samples (filter_t::size()) is fixed and may not match the number of ticks in your waveform.

Implements WireCell::IChannelNoiseDatabase.

Definition at line 27 of file SimpleChannelNoiseDB.h.

Here is the call graph for this function:

◆ set_bad_channels()

void SimpleChannelNoiseDB::set_bad_channels ( const channel_group_t bc)

Set "bad" channels.

Definition at line 482 of file SimpleChannelNoiseDB.cxx.

◆ set_channel_groups()

void SimpleChannelNoiseDB::set_channel_groups ( const std::vector< channel_group_t > &  channel_groups)

Set the channel groups.

Definition at line 475 of file SimpleChannelNoiseDB.cxx.

◆ set_coherent_nf_adc_limit()

void SimpleChannelNoiseDB::set_coherent_nf_adc_limit ( const std::vector< int > &  channels,
float  adc_limit 
)

Definition at line 423 of file SimpleChannelNoiseDB.cxx.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_coherent_nf_decon_lf_cutoff()

void SimpleChannelNoiseDB::set_coherent_nf_decon_lf_cutoff ( const std::vector< int > &  channels,
float  decon_lf_cutoff 
)

Definition at line 404 of file SimpleChannelNoiseDB.cxx.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_coherent_nf_decon_limit()

void SimpleChannelNoiseDB::set_coherent_nf_decon_limit ( const std::vector< int > &  channels,
float  decon_limit 
)

Definition at line 395 of file SimpleChannelNoiseDB.cxx.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_coherent_nf_decon_limit1()

void SimpleChannelNoiseDB::set_coherent_nf_decon_limit1 ( const std::vector< int > &  channels,
float  decon_limit 
)

Definition at line 414 of file SimpleChannelNoiseDB.cxx.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_coherent_nf_min_adc_limit()

void SimpleChannelNoiseDB::set_coherent_nf_min_adc_limit ( const std::vector< int > &  channels,
float  min_adc_limit 
)

Definition at line 441 of file SimpleChannelNoiseDB.cxx.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_coherent_nf_protection_factor()

void SimpleChannelNoiseDB::set_coherent_nf_protection_factor ( const std::vector< int > &  channels,
float  protection_factor 
)

Definition at line 432 of file SimpleChannelNoiseDB.cxx.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_filter()

void SimpleChannelNoiseDB::set_filter ( const std::vector< int > &  channels,
const multimask_t mask 
)

Definition at line 451 of file SimpleChannelNoiseDB.cxx.

◆ set_gains_shapings()

void SimpleChannelNoiseDB::set_gains_shapings ( const std::vector< int > &  channels,
double  from_gain_mVfC = 7.8,
double  to_gain_mVfC = 14.0,
double  from_shaping = 1.0*units::us,
double  to_shaping = 2.0*units::us 
)

Set gain/shaping corrections for cnofig_correction. Gains are assumed to be in mV/fC. Shaping times should be in the system of units. Defaults are microboone (but you need to give channels).

Definition at line 285 of file SimpleChannelNoiseDB.cxx.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_max_rms_cut()

void SimpleChannelNoiseDB::set_max_rms_cut ( const std::vector< int > &  channels,
double  max_rms 
)

Definition at line 360 of file SimpleChannelNoiseDB.cxx.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_max_rms_cut_one()

void SimpleChannelNoiseDB::set_max_rms_cut_one ( int  channel,
double  max_rms 
)

Definition at line 369 of file SimpleChannelNoiseDB.cxx.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_min_rms_cut()

void SimpleChannelNoiseDB::set_min_rms_cut ( const std::vector< int > &  channels,
double  min_rms 
)

Definition at line 342 of file SimpleChannelNoiseDB.cxx.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_min_rms_cut_one()

void SimpleChannelNoiseDB::set_min_rms_cut_one ( int  channel,
double  min_rms 
)

Definition at line 351 of file SimpleChannelNoiseDB.cxx.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_nominal_baseline()

void SimpleChannelNoiseDB::set_nominal_baseline ( const std::vector< int > &  channels,
double  baseline 
)

Set nominal baseline in units of ADC (eg uB is -2048 for U/V, -400 for W)

Definition at line 235 of file SimpleChannelNoiseDB.cxx.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_pad_window_back()

void SimpleChannelNoiseDB::set_pad_window_back ( const std::vector< int > &  channels,
int  pad_b 
)

Definition at line 386 of file SimpleChannelNoiseDB.cxx.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_pad_window_front()

void SimpleChannelNoiseDB::set_pad_window_front ( const std::vector< int > &  channels,
int  pad_f 
)

Definition at line 377 of file SimpleChannelNoiseDB.cxx.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_rcrc_constant()

void SimpleChannelNoiseDB::set_rcrc_constant ( const std::vector< int > &  channels,
double  rcrc = 2000.0 
)

Set the RC+RC time constant in the system of units for the digitization sample time ("tick"). Default is for microboone.

Definition at line 242 of file SimpleChannelNoiseDB.cxx.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_response()

void SimpleChannelNoiseDB::set_response ( const std::vector< int > &  channels,
const filter_t spectrum 
)

Set a detector response spectrum for the set of channels.

Definition at line 274 of file SimpleChannelNoiseDB.cxx.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_response_offset()

void SimpleChannelNoiseDB::set_response_offset ( const std::vector< int > &  channels,
double  offset 
)

Set a response offset for the given set of channels.

Definition at line 331 of file SimpleChannelNoiseDB.cxx.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_sampling()

void SimpleChannelNoiseDB::set_sampling ( double  tick = 0.5*units::us,
int  nsamples = 9600 
)

Set the size and number of samples of a channel's waveform, default is for microboone.

Warning: calling this will reset any settings for gains+shaping and rcrc as they depend on knowing the sampling.

Definition at line 203 of file SimpleChannelNoiseDB.cxx.

Here is the caller graph for this function:

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