#include <SimpleChannelNoiseDB.h>
Public Types | |
typedef std::tuple< double, int, int > | mask_t |
typedef std::vector< mask_t > | multimask_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< IChannelNoiseDatabase > | pointer |
Access subclass facet by pointer. More... | |
typedef std::vector< pointer > | vector |
Vector of shared pointers. More... | |
Public Types inherited from WireCell::Interface | |
typedef std::shared_ptr< Interface > | pointer |
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 float | coherent_nf_roi_min_max_ratio (int channel) const |
virtual double | min_rms_cut (int channel) const |
virtual double | max_rms_cut (int channel) const |
virtual const filter_t & | rcrc (int channel) const |
Return the filter for the RC+RC coupling response function. More... | |
virtual const filter_t & | config (int channel) const |
Return the filter to correct any wrongly configured channels. More... | |
virtual const filter_t & | noise (int channel) const |
Return the filter to attenuate noise. More... | |
virtual const filter_t & | response (int channel) const |
A nominal detector response spectrum for a given channel. More... | |
virtual std::vector< channel_group_t > | coherent_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_coherent_nf_roi_min_max_ratio (const std::vector< int > &channels, float roi_min_max_ratio) |
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 () |
Private Types | |
typedef std::shared_ptr< filter_t > | shared_filter_t |
typedef std::vector< shared_filter_t > | filter_vector_t |
Private Member Functions | |
int | chind (int ch) const |
const IChannelNoiseDatabase::filter_t & | get_filter (int channel, const filter_vector_t &fv) const |
Definition at line 17 of file SimpleChannelNoiseDB.h.
|
private |
Definition at line 145 of file SimpleChannelNoiseDB.h.
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 119 of file SimpleChannelNoiseDB.h.
Definition at line 120 of file SimpleChannelNoiseDB.h.
|
private |
Definition at line 144 of file SimpleChannelNoiseDB.h.
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.
|
virtual |
Definition at line 35 of file SimpleChannelNoiseDB.cxx.
|
inlinevirtual |
Return channels which are considered a'priori "bad".
Reimplemented from WireCell::IChannelNoiseDatabase.
Definition at line 55 of file SimpleChannelNoiseDB.h.
|
private |
Definition at line 506 of file SimpleChannelNoiseDB.cxx.
|
inlinevirtual |
Return channel grouping for coherent noise subtraction.
Implements WireCell::IChannelNoiseDatabase.
Definition at line 52 of file SimpleChannelNoiseDB.h.
|
virtual |
Implements WireCell::IChannelNoiseDatabase.
Definition at line 136 of file SimpleChannelNoiseDB.cxx.
|
virtual |
Implements WireCell::IChannelNoiseDatabase.
Definition at line 118 of file SimpleChannelNoiseDB.cxx.
|
virtual |
Implements WireCell::IChannelNoiseDatabase.
Definition at line 109 of file SimpleChannelNoiseDB.cxx.
|
virtual |
Implements WireCell::IChannelNoiseDatabase.
Definition at line 127 of file SimpleChannelNoiseDB.cxx.
|
virtual |
Implements WireCell::IChannelNoiseDatabase.
Definition at line 154 of file SimpleChannelNoiseDB.cxx.
|
virtual |
Implements WireCell::IChannelNoiseDatabase.
Definition at line 145 of file SimpleChannelNoiseDB.cxx.
|
virtual |
Implements WireCell::IChannelNoiseDatabase.
Definition at line 164 of file SimpleChannelNoiseDB.cxx.
|
virtual |
Return the filter to correct any wrongly configured channels.
Implements WireCell::IChannelNoiseDatabase.
Definition at line 197 of file SimpleChannelNoiseDB.cxx.
|
virtual |
Return simple gain correction (a multiplicative, unitless scaling) to apply to a given channel.
Implements WireCell::IChannelNoiseDatabase.
Definition at line 50 of file SimpleChannelNoiseDB.cxx.
|
private |
Definition at line 174 of file SimpleChannelNoiseDB.cxx.
|
virtual |
Implements WireCell::IChannelNoiseDatabase.
Definition at line 78 of file SimpleChannelNoiseDB.cxx.
|
virtual |
Implements WireCell::IChannelNoiseDatabase.
Definition at line 69 of file SimpleChannelNoiseDB.cxx.
|
virtual |
Return the filter to attenuate noise.
Implements WireCell::IChannelNoiseDatabase.
Definition at line 202 of file SimpleChannelNoiseDB.cxx.
|
virtual |
Return a nominal baseline correction (additive offset)
Implements WireCell::IChannelNoiseDatabase.
Definition at line 41 of file SimpleChannelNoiseDB.cxx.
|
virtual |
Implements WireCell::IChannelNoiseDatabase.
Definition at line 99 of file SimpleChannelNoiseDB.cxx.
|
virtual |
Implements WireCell::IChannelNoiseDatabase.
Definition at line 89 of file SimpleChannelNoiseDB.cxx.
|
virtual |
Return the filter for the RC+RC coupling response function.
Implements WireCell::IChannelNoiseDatabase.
Definition at line 192 of file SimpleChannelNoiseDB.cxx.
|
virtual |
A nominal detector response spectrum for a given channel.
Implements WireCell::IChannelNoiseDatabase.
Definition at line 207 of file SimpleChannelNoiseDB.cxx.
|
virtual |
Return a time offset associated with the response().
Implements WireCell::IChannelNoiseDatabase.
Definition at line 59 of file SimpleChannelNoiseDB.cxx.
|
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.
void SimpleChannelNoiseDB::set_bad_channels | ( | const channel_group_t & | bc | ) |
Set "bad" channels.
Definition at line 500 of file SimpleChannelNoiseDB.cxx.
void SimpleChannelNoiseDB::set_channel_groups | ( | const std::vector< channel_group_t > & | channel_groups | ) |
Set the channel groups.
Definition at line 493 of file SimpleChannelNoiseDB.cxx.
void SimpleChannelNoiseDB::set_coherent_nf_adc_limit | ( | const std::vector< int > & | channels, |
float | adc_limit | ||
) |
Definition at line 433 of file SimpleChannelNoiseDB.cxx.
void SimpleChannelNoiseDB::set_coherent_nf_decon_lf_cutoff | ( | const std::vector< int > & | channels, |
float | decon_lf_cutoff | ||
) |
Definition at line 414 of file SimpleChannelNoiseDB.cxx.
void SimpleChannelNoiseDB::set_coherent_nf_decon_limit | ( | const std::vector< int > & | channels, |
float | decon_limit | ||
) |
Definition at line 405 of file SimpleChannelNoiseDB.cxx.
void SimpleChannelNoiseDB::set_coherent_nf_decon_limit1 | ( | const std::vector< int > & | channels, |
float | decon_limit | ||
) |
Definition at line 424 of file SimpleChannelNoiseDB.cxx.
void SimpleChannelNoiseDB::set_coherent_nf_min_adc_limit | ( | const std::vector< int > & | channels, |
float | min_adc_limit | ||
) |
Definition at line 451 of file SimpleChannelNoiseDB.cxx.
void SimpleChannelNoiseDB::set_coherent_nf_protection_factor | ( | const std::vector< int > & | channels, |
float | protection_factor | ||
) |
Definition at line 442 of file SimpleChannelNoiseDB.cxx.
void SimpleChannelNoiseDB::set_coherent_nf_roi_min_max_ratio | ( | const std::vector< int > & | channels, |
float | roi_min_max_ratio | ||
) |
Definition at line 460 of file SimpleChannelNoiseDB.cxx.
void SimpleChannelNoiseDB::set_filter | ( | const std::vector< int > & | channels, |
const multimask_t & | mask | ||
) |
Definition at line 469 of file SimpleChannelNoiseDB.cxx.
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 295 of file SimpleChannelNoiseDB.cxx.
void SimpleChannelNoiseDB::set_max_rms_cut | ( | const std::vector< int > & | channels, |
double | max_rms | ||
) |
Definition at line 370 of file SimpleChannelNoiseDB.cxx.
void SimpleChannelNoiseDB::set_max_rms_cut_one | ( | int | channel, |
double | max_rms | ||
) |
Definition at line 379 of file SimpleChannelNoiseDB.cxx.
void SimpleChannelNoiseDB::set_min_rms_cut | ( | const std::vector< int > & | channels, |
double | min_rms | ||
) |
Definition at line 352 of file SimpleChannelNoiseDB.cxx.
void SimpleChannelNoiseDB::set_min_rms_cut_one | ( | int | channel, |
double | min_rms | ||
) |
Definition at line 361 of file SimpleChannelNoiseDB.cxx.
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 245 of file SimpleChannelNoiseDB.cxx.
void SimpleChannelNoiseDB::set_pad_window_back | ( | const std::vector< int > & | channels, |
int | pad_b | ||
) |
Definition at line 396 of file SimpleChannelNoiseDB.cxx.
void SimpleChannelNoiseDB::set_pad_window_front | ( | const std::vector< int > & | channels, |
int | pad_f | ||
) |
Definition at line 387 of file SimpleChannelNoiseDB.cxx.
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 252 of file SimpleChannelNoiseDB.cxx.
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 284 of file SimpleChannelNoiseDB.cxx.
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 341 of file SimpleChannelNoiseDB.cxx.
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 213 of file SimpleChannelNoiseDB.cxx.
|
private |
Definition at line 141 of file SimpleChannelNoiseDB.h.
|
private |
Definition at line 156 of file SimpleChannelNoiseDB.h.
|
private |
Definition at line 139 of file SimpleChannelNoiseDB.h.
|
mutableprivate |
Definition at line 150 of file SimpleChannelNoiseDB.h.
|
private |
Definition at line 155 of file SimpleChannelNoiseDB.h.
|
private |
Definition at line 146 of file SimpleChannelNoiseDB.h.
|
private |
Definition at line 141 of file SimpleChannelNoiseDB.h.
|
private |
Definition at line 141 of file SimpleChannelNoiseDB.h.
|
private |
Definition at line 141 of file SimpleChannelNoiseDB.h.
|
private |
Definition at line 137 of file SimpleChannelNoiseDB.h.
|
private |
Definition at line 134 of file SimpleChannelNoiseDB.h.
|
private |
Definition at line 137 of file SimpleChannelNoiseDB.h.
|
private |
Definition at line 137 of file SimpleChannelNoiseDB.h.
|
private |
Definition at line 137 of file SimpleChannelNoiseDB.h.
|
private |
Definition at line 147 of file SimpleChannelNoiseDB.h.
|
private |
Definition at line 134 of file SimpleChannelNoiseDB.h.
|
private |
Definition at line 135 of file SimpleChannelNoiseDB.h.
|
private |
Definition at line 137 of file SimpleChannelNoiseDB.h.
|
private |
Definition at line 135 of file SimpleChannelNoiseDB.h.
|
private |
Definition at line 134 of file SimpleChannelNoiseDB.h.
|
private |
Definition at line 136 of file SimpleChannelNoiseDB.h.
|
private |
Definition at line 136 of file SimpleChannelNoiseDB.h.
|
private |
Definition at line 137 of file SimpleChannelNoiseDB.h.
|
private |
Definition at line 148 of file SimpleChannelNoiseDB.h.
|
private |
Definition at line 137 of file SimpleChannelNoiseDB.h.
|
private |
Definition at line 139 of file SimpleChannelNoiseDB.h.
|
private |
Definition at line 146 of file SimpleChannelNoiseDB.h.
|
private |
Definition at line 139 of file SimpleChannelNoiseDB.h.
|
private |
Definition at line 141 of file SimpleChannelNoiseDB.h.
|
private |
Definition at line 139 of file SimpleChannelNoiseDB.h.
|
private |
Definition at line 132 of file SimpleChannelNoiseDB.h.
|
private |
Definition at line 139 of file SimpleChannelNoiseDB.h.
|
private |
Definition at line 140 of file SimpleChannelNoiseDB.h.
|
private |
Definition at line 140 of file SimpleChannelNoiseDB.h.
|
private |
Definition at line 141 of file SimpleChannelNoiseDB.h.
|
private |
Definition at line 146 of file SimpleChannelNoiseDB.h.
|
private |
Definition at line 146 of file SimpleChannelNoiseDB.h.
|
private |
Definition at line 141 of file SimpleChannelNoiseDB.h.
|
private |
Definition at line 131 of file SimpleChannelNoiseDB.h.