File indexing completed on 2025-12-16 09:28:13
0001
0002
0003 #pragma once
0004
0005 #include <vector>
0006 #include <map>
0007
0008 class waveform_fit_base {
0009 public:
0010 waveform_fit_base();
0011 virtual ~waveform_fit_base() = default;
0012
0013
0014 virtual void set_waveform(const std::vector<int> &waveform);
0015 virtual void set_parameter(int parameter, double value);
0016 virtual double get_parameter(int parameter);
0017 virtual int get_pedestal() = 0;
0018 virtual void fit() = 0;
0019 virtual void fit_with_average_ped(double ped) = 0;
0020
0021 bool is_stale() { return stale; }
0022 bool is_saturated() { return saturated; }
0023 double get_E();
0024 double get_fit_ndf();
0025 double get_fit_chi2();
0026
0027 protected:
0028 std::vector<int> waveform;
0029 std::map<int, double> parameters;
0030
0031 bool stale;
0032 bool saturated;
0033 double E;
0034 double fit_ndf;
0035 double fit_chi2;
0036 };