-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFitter.hh
66 lines (57 loc) · 1.67 KB
/
Fitter.hh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#ifndef FITTER_HH
#define FITTER_HH
#include "Event.hh"
#include "Samples.hh"
#include "ShapingCurve.hh"
#include "TObject.h"
#include "TMinuit.h"
class Fitter : public TObject
{
public:
Fitter(ShapingCurve *sc, int sCount, int pCount, double noise);
~Fitter();
protected:
int nPeaks; //number of peaks to fit
int nSamples; //number of samples
double * y; //samples
double sigma_noise; //noise level
double * sigma; //sample error
double startTime, sampleInterval; //sample start time, interval
int status; //0 for good fit
ShapingCurve *shape;
double *fit_par, *fit_err;
bool * useSample;
int verbose;
int dof;
public:
void print_fit();
void setVerbosity(int verbosity);
void getFitTimes(double *times);
void getFitHeights(double *heights);
void getFitPar(double *par);
void getFitErr(double *err);
void readSamples(Samples *input);
double getChisq(double *par, bool use_all=false);
double getFitChisq();
int getDOF();
int getStatus();
ShapingCurve * getShape();
int getNumPeaks();
void printResiduals();
double getSignal(double time);
void setSigmaNoise(double sigma);
double getFirstPeak();
//void setUsedSamples();
void sortFit();
void setUseSample(int i, bool use);
int getNumUsedSamples(int start=0, int end=-1);
virtual void doFit() {}
virtual void plotFit(Event *evt, const char *name) =0;
virtual void plotFCN(Event *evt, const char *name, int res, const char *style, double x_min, double x_max, double y_min, double y_max) {}
virtual void print_guess() {}
virtual double guessChisq() { return -1;}
};
extern TMinuit *gMinuit;
extern Fitter *currentFitter;
Double_t evtCurve(Double_t *x, Double_t *par);
#endif