WireCellToolkit
Wire Cell Simulation, Signal Process and Reconstruction Toolki for Liquid Argon Detectors
|
#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 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_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 () |
Definition at line 17 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 117 of file SimpleChannelNoiseDB.h.
typedef std::vector<mask_t> WireCell::SigProc::SimpleChannelNoiseDB::multimask_t |
Definition at line 118 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 34 of file SimpleChannelNoiseDB.cxx.
|
inlinevirtual |
Return channels which are considered a'priori "bad".
Reimplemented from WireCell::IChannelNoiseDatabase.
Definition at line 54 of file SimpleChannelNoiseDB.h.
|
inlinevirtual |
Return channel grouping for coherent noise subtraction.
Implements WireCell::IChannelNoiseDatabase.
Definition at line 51 of file SimpleChannelNoiseDB.h.
|
virtual |
Implements WireCell::IChannelNoiseDatabase.
Definition at line 135 of file SimpleChannelNoiseDB.cxx.
|
virtual |
Implements WireCell::IChannelNoiseDatabase.
Definition at line 117 of file SimpleChannelNoiseDB.cxx.
|
virtual |
Implements WireCell::IChannelNoiseDatabase.
Definition at line 108 of file SimpleChannelNoiseDB.cxx.
|
virtual |
Implements WireCell::IChannelNoiseDatabase.
Definition at line 126 of file SimpleChannelNoiseDB.cxx.
|
virtual |
Implements WireCell::IChannelNoiseDatabase.
Definition at line 153 of file SimpleChannelNoiseDB.cxx.
|
virtual |
Implements WireCell::IChannelNoiseDatabase.
Definition at line 144 of file SimpleChannelNoiseDB.cxx.
|
virtual |
Return the filter to correct any wrongly configured channels.
Implements WireCell::IChannelNoiseDatabase.
Definition at line 187 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 49 of file SimpleChannelNoiseDB.cxx.
|
virtual |
Implements WireCell::IChannelNoiseDatabase.
Definition at line 77 of file SimpleChannelNoiseDB.cxx.
|
virtual |
Implements WireCell::IChannelNoiseDatabase.
Definition at line 68 of file SimpleChannelNoiseDB.cxx.
|
virtual |
Return the filter to attenuate noise.
Implements WireCell::IChannelNoiseDatabase.
Definition at line 192 of file SimpleChannelNoiseDB.cxx.
|
virtual |
Return a nominal baseline correction (additive offset)
Implements WireCell::IChannelNoiseDatabase.
Definition at line 40 of file SimpleChannelNoiseDB.cxx.
|
virtual |
Implements WireCell::IChannelNoiseDatabase.
Definition at line 98 of file SimpleChannelNoiseDB.cxx.
|
virtual |
Implements WireCell::IChannelNoiseDatabase.
Definition at line 88 of file SimpleChannelNoiseDB.cxx.
|
virtual |
Return the filter for the RC+RC coupling response function.
Implements WireCell::IChannelNoiseDatabase.
Definition at line 182 of file SimpleChannelNoiseDB.cxx.
|
virtual |
A nominal detector response spectrum for a given channel.
Implements WireCell::IChannelNoiseDatabase.
Definition at line 197 of file SimpleChannelNoiseDB.cxx.
|
virtual |
Return a time offset associated with the response().
Implements WireCell::IChannelNoiseDatabase.
Definition at line 58 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 482 of file SimpleChannelNoiseDB.cxx.
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.
void SimpleChannelNoiseDB::set_coherent_nf_adc_limit | ( | const std::vector< int > & | channels, |
float | adc_limit | ||
) |
Definition at line 423 of file SimpleChannelNoiseDB.cxx.
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.
void SimpleChannelNoiseDB::set_coherent_nf_decon_limit | ( | const std::vector< int > & | channels, |
float | decon_limit | ||
) |
Definition at line 395 of file SimpleChannelNoiseDB.cxx.
void SimpleChannelNoiseDB::set_coherent_nf_decon_limit1 | ( | const std::vector< int > & | channels, |
float | decon_limit | ||
) |
Definition at line 414 of file SimpleChannelNoiseDB.cxx.
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.
void SimpleChannelNoiseDB::set_coherent_nf_protection_factor | ( | const std::vector< int > & | channels, |
float | protection_factor | ||
) |
Definition at line 432 of file SimpleChannelNoiseDB.cxx.
void SimpleChannelNoiseDB::set_filter | ( | const std::vector< int > & | channels, |
const multimask_t & | mask | ||
) |
Definition at line 451 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 285 of file SimpleChannelNoiseDB.cxx.
void SimpleChannelNoiseDB::set_max_rms_cut | ( | const std::vector< int > & | channels, |
double | max_rms | ||
) |
Definition at line 360 of file SimpleChannelNoiseDB.cxx.
void SimpleChannelNoiseDB::set_max_rms_cut_one | ( | int | channel, |
double | max_rms | ||
) |
Definition at line 369 of file SimpleChannelNoiseDB.cxx.
void SimpleChannelNoiseDB::set_min_rms_cut | ( | const std::vector< int > & | channels, |
double | min_rms | ||
) |
Definition at line 342 of file SimpleChannelNoiseDB.cxx.
void SimpleChannelNoiseDB::set_min_rms_cut_one | ( | int | channel, |
double | min_rms | ||
) |
Definition at line 351 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 235 of file SimpleChannelNoiseDB.cxx.
void SimpleChannelNoiseDB::set_pad_window_back | ( | const std::vector< int > & | channels, |
int | pad_b | ||
) |
Definition at line 386 of file SimpleChannelNoiseDB.cxx.
void SimpleChannelNoiseDB::set_pad_window_front | ( | const std::vector< int > & | channels, |
int | pad_f | ||
) |
Definition at line 377 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 242 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 274 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 331 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 203 of file SimpleChannelNoiseDB.cxx.