1 #ifndef _UCORRELATOR_SYSTEM_RESPONSE_H 2 #define _UCORRELATOR_SYSTEM_RESPONSE_H 14 #include "FFTWComplex.h" 16 #include "AnalysisWaveform.h" 31 __attribute__((deprecated))
59 CLEANDeconvolution(
const TF1 * restoring_beam,
double gain = 0.05,
double threshold = 0.01,
double noiselevel = 10,
bool convolve_residuals =
true,
int maxiter = 5000)
60 : r(restoring_beam), gain(gain), threshold(threshold), noiselevel(noiselevel), convolve_residuals(convolve_residuals), max_iter(maxiter), debug(
false), cached_restoring(0) {; }
61 void setThreshold(
double t) { threshold = t; }
67 void enableSaveIntermediate(
bool enable =
true) { debug = enable; }
68 std::vector<AnalysisWaveform*> * getIntermediateXcorrs()
const {
return debug ? &save_xcorr : 0;}
69 std::vector<AnalysisWaveform*> * getIntermediateYs()
const {
return debug ? &save_ys : 0;}
70 std::vector<AnalysisWaveform*> * getIntermediateSubs()
const {
return debug ? &save_subtracted : 0;}
76 virtual ~
CLEANDeconvolution() { clearIntermediate();
if (cached_restoring)
delete cached_restoring; }
83 bool convolve_residuals;
86 mutable std::vector<AnalysisWaveform*> save_xcorr;
87 mutable std::vector<AnalysisWaveform*> save_ys;
88 mutable std::vector<AnalysisWaveform*> save_subtracted;
91 void clearIntermediate()
const;
145 virtual double snr(
double f,
double R2,
int N)
const;
148 const TGraph * snr_graph;
149 const double * scale;
150 const TF1 * snr_function;
160 : min_freq(minfreq),max_freq(maxfreq), edge_order(edgeorder)
170 double min_freq, max_freq;
200 CLEAN(
int max_loops = 1000,
double loop_gain = 0.02,
double thresh_factor = 1., TString restoring_beam =
"(1./10) * pow(x,2) * exp(-x/1.43)",
bool add_residuals = 1,
bool only_return_residuals = 0);
202 virtual ~
CLEAN() { ; }
206 double fThreshFactor;
207 TString fRestoringBeam;
209 bool fOnlyReturnResiduals;
219 virtual FFTWComplex getResponse(
double f,
double angle = 0)
const = 0;
220 virtual FFTWComplex * getResponseArray(
int N,
const double * f,
double angle = 0,
FFTWComplex * answer = 0)
const;
221 virtual FFTWComplex * getResponseArray(
int N,
double df,
double angle = 0,
FFTWComplex * answer = 0)
const ;
222 virtual double getMagnitude(
double f,
double angle= 0)
const;
223 virtual double getPhase(
double f,
double angle = 0)
const;
225 virtual AnalysisWaveform * impulseResponse(
double dt = 1./2.6,
int N = 256)
const;
228 virtual void convolveInPlace(
AnalysisWaveform * wf,
double angle = 0)
const;
241 Response(
const TGraph * time_domain,
int npad);
242 Response(
int Nfreq,
double df,
int nangles,
const double * angles,
const FFTWComplex ** responses);
245 void addResponseAtAngle(
double angle,
const FFTWComplex * response);
247 virtual FFTWComplex getResponse(
double f,
double angle = 0)
const;
250 const TH2 * getReal()
const {
return ℜ }
251 const TH2 * getImag()
const {
return &imag; }
260 std::map<double, FFTWComplex *> responses;
264 void recompute()
const;
271 void addResponse(
const AbstractResponse * response) { responses.push_back(response); }
272 virtual FFTWComplex getResponse(
double f,
double angle = 0)
const;
276 std::vector<const AbstractResponse * > responses;
WienerDeconvolution(const TGraph *g_snr, const double *scale=0)
This is a wrapper class for a complex number.
Inelasticity distributions: stores parametrizations and picks inelasticities.