#include <SignalShaping.h>
Definition at line 69 of file SignalShaping.h.
util::SignalShaping::SignalShaping |
( |
| ) |
|
util::SignalShaping::~SignalShaping |
( |
| ) |
|
|
virtual |
void util::SignalShaping::AddFilterFunction |
( |
const std::vector< TComplex > & |
filt | ) |
|
Definition at line 168 of file SignalShaping.cxx.
173 throw cet::exception(
"SignalShaping") <<
"Configuration locked.\n";
188 for(
unsigned int i=0; i<
n; ++i)
190 for(
unsigned int i=n; i<
fFilter.size(); ++i)
std::vector< TComplex > fFilter
T min(sqlite3 *const db, std::string const &table_name, std::string const &column_name)
cet::coded_exception< error, detail::translate > exception
void util::SignalShaping::AddResponseFunction |
( |
const std::vector< double > & |
resp, |
|
|
bool |
ResetResponse = false |
|
) |
| |
Definition at line 62 of file SignalShaping.cxx.
67 throw cet::exception(
"SignalShaping") <<
"Configuration locked.\n";
95 std::vector<TComplex> kern(nticks/2 + 1);
101 throw cet::exception(
"SignalShaping") << __func__ <<
": inconsistent kernel size, " 104 for(
unsigned int i=0; i<kern.size(); ++i)
std::vector< TComplex > fConvKernel
void DoFFT(std::vector< T > &input, std::vector< TComplex > &output)
void DoInvFFT(std::vector< TComplex > &input, std::vector< T > &output)
std::vector< double > fResponse
cet::coded_exception< error, detail::translate > exception
void util::SignalShaping::CalculateDeconvKernel |
( |
| ) |
const |
Definition at line 251 of file SignalShaping.cxx.
256 throw cet::exception(
"SignalShaping") <<
"Configuration locked.\n";
270 <<
"Filter function has not been configured.\n";
276 if (2 * (
fFilter.size() - 1) != n)
278 throw cet::exception(
"SignalShaping") << __func__ <<
": inconsistent size, " 300 std::vector<double> deconv(n, 0.);
307 double peak_response = 0;
309 peak_response = 4096;
310 for(
unsigned int i = 0; i <
fResponse.size(); ++i) {
320 if (peak_response <= 0.) {
322 <<
": peak should always be positive (got " << peak_response <<
")\n";
328 double peak_deconv = 0.;
329 for(
unsigned int i = 0; i < deconv.size(); ++i) {
330 if(deconv[i] > peak_deconv)
331 peak_deconv = deconv[i];
333 if (peak_deconv <= 0.) {
335 <<
": deconvolution peak should always be positive (got " << peak_deconv <<
")\n";
341 double ratio = peak_response / peak_deconv;
std::vector< TComplex > fConvKernel
void LockResponse() const
std::vector< TComplex > fFilter
void DoInvFFT(std::vector< TComplex > &input, std::vector< T > &output)
int fDeconvKernelPolarity
std::vector< TComplex > fDeconvKernel
std::vector< double > fResponse
cet::coded_exception< error, detail::translate > exception
const std::vector<TComplex>& util::SignalShaping::ConvKernel |
( |
| ) |
const |
|
inline |
template<class T >
void util::SignalShaping::Convolute |
( |
std::vector< T > & |
func | ) |
const |
|
inline |
Definition at line 167 of file SignalShaping.h.
176 if(
int const n = func.size();
n != fft->
FFTSize())
177 throw cet::exception(
"SignalShaping") <<
"Bad time series size = " <<
n <<
"\n";
std::vector< TComplex > fConvKernel
void LockResponse() const
void Convolute(std::vector< T > &input, std::vector< T > &respFunc)
cet::coded_exception< error, detail::translate > exception
const std::vector<TComplex>& util::SignalShaping::DeconvKernel |
( |
| ) |
const |
|
inline |
template<class T >
void util::SignalShaping::Deconvolute |
( |
std::vector< T > & |
func | ) |
const |
|
inline |
Definition at line 184 of file SignalShaping.h.
193 if(
int const n = func.size();
n != fft->
FFTSize())
194 throw cet::exception(
"SignalShaping") <<
"Bad time series size = " <<
n <<
"\n";
void CalculateDeconvKernel() const
void Convolute(std::vector< T > &input, std::vector< T > &respFunc)
std::vector< TComplex > fDeconvKernel
cet::coded_exception< error, detail::translate > exception
const std::vector<TComplex>& util::SignalShaping::Filter |
( |
| ) |
const |
|
inline |
void util::SignalShaping::LockResponse |
( |
| ) |
const |
Definition at line 214 of file SignalShaping.cxx.
228 <<
"Response has not been configured.\n";
235 throw cet::exception(
"SignalShaping") << __func__ <<
": inconsistent kernel size, " 236 <<
fResponse.size() <<
" vs. " << n <<
"\n";
238 throw cet::exception(
"SignalShaping") << __func__ <<
": unexpected FFT size, " 239 << n <<
" vs. expected " << (2 * (
fConvKernel.size() - 1)) <<
"\n";
std::vector< TComplex > fConvKernel
std::vector< double > fResponse
cet::coded_exception< error, detail::translate > exception
void util::SignalShaping::Reset |
( |
void |
| ) |
|
Definition at line 47 of file SignalShaping.cxx.
std::vector< TComplex > fConvKernel
std::vector< TComplex > fFilter
int fDeconvKernelPolarity
std::vector< TComplex > fDeconvKernel
std::vector< double > fResponse
const std::vector<double>& util::SignalShaping::Response |
( |
| ) |
const |
|
inline |
const std::vector<double>& util::SignalShaping::Response_save |
( |
| ) |
const |
|
inline |
void util::SignalShaping::save_response |
( |
| ) |
|
|
inline |
Definition at line 100 of file SignalShaping.h.
std::vector< double > fResponse
std::vector< double > fResponse_save
void util::SignalShaping::set_normflag |
( |
bool |
flag | ) |
|
|
inline |
void util::SignalShaping::SetDeconvKernelPolarity |
( |
int |
pol | ) |
|
Definition at line 197 of file SignalShaping.cxx.
200 if ( (pol != 1) and (pol != -1) ) {
202 <<
": DeconvKernelPolarity should be +1 or -1 (got " << pol <<
"). Setting to +1\n";
int fDeconvKernelPolarity
cet::coded_exception< error, detail::translate > exception
void util::SignalShaping::SetPeakResponseTime |
( |
double |
tick | ) |
|
Definition at line 140 of file SignalShaping.cxx.
145 throw cet::exception(
"SignalShaping") <<
"Configuration locked.\n";
153 std::vector<double> delta(fft->
FFTSize(), 0.);
T PeakCorrelation(std::vector< T > &shape1, std::vector< T > &shape2)
tick_as<> tick
Tick number, represented by std::ptrdiff_t.
void ShiftResponseTime(double ticks)
std::vector< double > fResponse
cet::coded_exception< error, detail::translate > exception
void util::SignalShaping::ShiftResponseTime |
( |
double |
ticks | ) |
|
Definition at line 117 of file SignalShaping.cxx.
122 throw cet::exception(
"SignalShaping") <<
"Configuration locked.\n";
void ShiftData(std::vector< TComplex > &input, double shift)
std::vector< TComplex > fConvKernel
tick ticks
Alias for common language habits.
void DoInvFFT(std::vector< TComplex > &input, std::vector< T > &output)
std::vector< double > fResponse
cet::coded_exception< error, detail::translate > exception
std::vector<TComplex> util::SignalShaping::fDeconvKernel |
|
mutableprivate |
int util::SignalShaping::fDeconvKernelPolarity |
|
private |
bool util::SignalShaping::fFilterLocked |
|
mutableprivate |
bool util::SignalShaping::fNorm |
|
private |
std::vector<double> util::SignalShaping::fResponse_save |
|
private |
bool util::SignalShaping::fResponseLocked |
|
mutableprivate |
The documentation for this class was generated from the following files: