#include <SignalShaper.h>
Definition at line 13 of file SignalShaper.h.
util::SignalShaper::SignalShaper |
( |
int |
fftsize, |
|
|
std::string |
fftopt |
|
) |
| |
Definition at line 9 of file SignalShaper.cxx.
std::unique_ptr< util::LArFFTWPlan > fFFTPlan
std::unique_ptr< util::LArFFTW > fFFT
util::SignalShaper::~SignalShaper |
( |
| ) |
|
|
virtual |
void util::SignalShaper::AddFilterFunction |
( |
const std::vector< std::complex< double >> & |
filt | ) |
|
Definition at line 138 of file SignalShaper.cxx.
143 throw cet::exception(
"SignalShaper") <<
"Configuration locked.\n";
153 unsigned int n = std::min(
fFilter.size(), filt.size());
154 for(
unsigned int i=0; i<
n; ++i)
156 for(
unsigned int i=n; i<
fFilter.size(); ++i)
std::vector< std::complex< double > > fFilter
void util::SignalShaper::AddResponseFunction |
( |
const std::vector< double > & |
resp, |
|
|
bool |
ResetResponse = false |
|
) |
| |
Definition at line 43 of file SignalShaper.cxx.
48 throw cet::exception(
"SignalShaper") <<
"Configuration locked.\n";
73 std::vector<std::complex<double>> kern(nticks/2 + 1);
79 throw cet::exception(
"SignalShaper") << __func__ <<
": inconsistent kernel size, "
82 for(
unsigned int i=0; i<kern.size(); ++i)
std::vector< double > fResponse
std::unique_ptr< util::LArFFTW > fFFT
std::vector< std::complex< double > > fConvKernel
void util::SignalShaper::CalculateDeconvKernel |
( |
| ) |
const |
Definition at line 213 of file SignalShaper.cxx.
218 throw cet::exception(
"SignalShaper") <<
"Configuration locked.\n";
227 throw cet::exception(
"SignalShaper")
228 <<
"Filter function has not been configured.\n";
234 if (2 * (
fFilter.size() - 1) != n)
236 throw cet::exception(
"SignalShaper") << __func__ <<
": inconsistent size, "
258 std::vector<double> deconv(n, 0.);
259 fFFT->DoInvFFT(
const_cast<std::vector<std::complex<double>
>&>(
fFilter), deconv);
266 double peak_response = 0;
268 peak_response = 4096;
269 for(
unsigned int i = 0; i <
fResponse.size(); ++i) {
279 if (peak_response <= 0.) {
280 throw cet::exception(
"SignalShaper") << __func__
281 <<
": peak should always be positive (got " << peak_response <<
")\n";
287 double peak_deconv = 0.;
288 for(
unsigned int i = 0; i < deconv.size(); ++i) {
289 if(deconv[i] > peak_deconv)
290 peak_deconv = deconv[i];
292 if (peak_deconv <= 0.) {
293 throw cet::exception(
"SignalShaper") << __func__
294 <<
": deconvolution peak should always be positive (got " << peak_deconv <<
")\n";
300 double ratio = peak_response / peak_deconv;
void LockResponse() const
std::vector< double > fResponse
std::unique_ptr< util::LArFFTW > fFFT
return match has_match and(match.match_pdg==11 or match.match_pdg==-11)
int fDeconvKernelPolarity
std::vector< std::complex< double > > fConvKernel
std::vector< std::complex< double > > fDeconvKernel
std::vector< std::complex< double > > fFilter
const std::vector<std::complex<double> >& util::SignalShaper::ConvKernel |
( |
| ) |
const |
|
inline |
Definition at line 23 of file SignalShaper.h.
std::vector< std::complex< double > > fConvKernel
template<class T >
void util::SignalShaper::Convolute |
( |
std::vector< T > & |
func | ) |
const |
const std::vector<std::complex<double> >& util::SignalShaper::DeconvKernel |
( |
| ) |
const |
|
inline |
Definition at line 25 of file SignalShaper.h.
std::vector< std::complex< double > > fDeconvKernel
template<class T >
void util::SignalShaper::Deconvolute |
( |
std::vector< T > & |
func | ) |
const |
const std::vector<std::complex<double> >& util::SignalShaper::Filter |
( |
| ) |
const |
|
inline |
Definition at line 24 of file SignalShaper.h.
std::vector< std::complex< double > > fFilter
void util::SignalShaper::LockResponse |
( |
| ) |
const |
Definition at line 180 of file SignalShaper.cxx.
189 throw cet::exception(
"SignalShaper")
190 <<
"Response has not been configured.\n";
197 throw cet::exception(
"SignalShaper") << __func__ <<
": inconsistent kernel size, "
198 <<
fResponse.size() <<
" vs. " << n <<
"\n";
200 throw cet::exception(
"SignalShaper") << __func__ <<
": unexpected FFT size, "
201 << n <<
" vs. expected " << (2 * (
fConvKernel.size() - 1)) <<
"\n";
std::vector< double > fResponse
std::vector< std::complex< double > > fConvKernel
void util::SignalShaper::Reset |
( |
| ) |
|
Definition at line 28 of file SignalShaper.cxx.
std::vector< double > fResponse
int fDeconvKernelPolarity
std::vector< std::complex< double > > fConvKernel
std::vector< std::complex< double > > fDeconvKernel
std::vector< std::complex< double > > fFilter
const std::vector<double>& util::SignalShaper::Response |
( |
| ) |
const |
|
inline |
const std::vector<double>& util::SignalShaper::Response_save |
( |
| ) |
const |
|
inline |
Definition at line 22 of file SignalShaper.h.
std::vector< double > fResponse_save
void util::SignalShaper::save_response |
( |
| ) |
|
|
inline |
Definition at line 41 of file SignalShaper.h.
std::vector< double > fResponse_save
std::vector< double > fResponse
void util::SignalShaper::set_normflag |
( |
bool |
flag | ) |
|
|
inline |
void util::SignalShaper::SetDeconvKernelPolarity |
( |
int |
pol | ) |
|
Definition at line 163 of file SignalShaper.cxx.
166 if ( (pol != 1)
and (pol != -1) ) {
167 throw cet::exception(
"SignalShaper") << __func__
168 <<
": DeconvKernelPolarity should be +1 or -1 (got " << pol <<
"). Setting to +1\n";
return match has_match and(match.match_pdg==11 or match.match_pdg==-11)
int fDeconvKernelPolarity
void util::SignalShaper::SetPeakResponseTime |
( |
double |
tick | ) |
|
Definition at line 114 of file SignalShaper.cxx.
119 throw cet::exception(
"SignalShaper") <<
"Configuration locked.\n";
123 std::vector<double> delta(
fFFTSize, 0.);
void ShiftResponseTime(double ticks)
std::vector< double > fResponse
std::unique_ptr< util::LArFFTW > fFFT
tick_as<> tick
Tick number, represented by std::ptrdiff_t.
void util::SignalShaper::ShiftResponseTime |
( |
double |
ticks | ) |
|
Definition at line 95 of file SignalShaper.cxx.
100 throw cet::exception(
"SignalShaper") <<
"Configuration locked.\n";
tick ticks
Alias for common language habits.
std::vector< double > fResponse
std::unique_ptr< util::LArFFTW > fFFT
std::vector< std::complex< double > > fConvKernel
std::vector<std::complex<double> > util::SignalShaper::fConvKernel |
|
private |
std::vector<std::complex<double> > util::SignalShaper::fDeconvKernel |
|
mutableprivate |
int util::SignalShaper::fDeconvKernelPolarity |
|
private |
int util::SignalShaper::fFFTSize |
|
private |
std::vector<std::complex<double> > util::SignalShaper::fFilter |
|
private |
bool util::SignalShaper::fFilterLocked |
|
mutableprivate |
bool util::SignalShaper::fNorm |
|
private |
const void* util::SignalShaper::fPlan |
|
private |
std::vector<double> util::SignalShaper::fResponse |
|
private |
std::vector<double> util::SignalShaper::fResponse_save |
|
private |
bool util::SignalShaper::fResponseLocked |
|
mutableprivate |
const void* util::SignalShaper::rPlan |
|
private |
The documentation for this class was generated from the following files: