1 |
|
// Original Author: David Nisson |
2 |
< |
// A histogram fitter |
2 |
> |
// Fits a two-dimensional model in eta and phi consisting of summed |
3 |
> |
// Gaussians to a histogram, supplied in the function fit_histo. |
4 |
> |
// This histogram can be of mass, energy, or momentum. |
5 |
|
|
6 |
|
#ifndef UserCode_JetFitAnalyzer_HistoFitter_h |
7 |
|
#define UserCode_JetFitAnalyzer_HistoFitter_h |
22 |
|
double YbinSize, |
23 |
|
double cutoffRad = 0.2); |
24 |
|
|
25 |
+ |
// place where fitting trouble happened |
26 |
|
enum TroubleStage { |
27 |
|
T_NULL = 0, |
28 |
|
T_SIMPLEX, |
30 |
|
T_MINOS |
31 |
|
}; |
32 |
|
|
33 |
+ |
// the histogram class used internally by HistoFitter |
34 |
|
struct VectorHisto { |
35 |
|
std::vector< std::vector<double> > bins; |
36 |
|
double Xlo, Xhi, Ylo, Yhi; |
37 |
|
}; |
38 |
|
|
39 |
+ |
// information about fitting trouble |
40 |
|
struct Trouble { |
41 |
|
TroubleStage occ; |
42 |
|
int istat; |
43 |
|
}; |
44 |
|
|
45 |
+ |
// structure that stores the fit results |
46 |
|
struct FitResults { |
47 |
|
TH2 *rebinnedHisto; |
48 |
|
std::vector< double > chisquare; |
112 |
|
int getNumberOfDegreesOfFreedom(VectorHisto, int); |
113 |
|
|
114 |
|
FitResults putParsInFitResults(std::vector<TString>, |
115 |
< |
double *, double *, double *, double *); |
115 |
> |
double *, double *, double *, double *, |
116 |
> |
FitResults&); |
117 |
|
static VectorHisto loadTH2IntoVectorHisto(TH2*); |
118 |
|
Trouble minimize(TMinuit*, VectorHisto, int); |
119 |
|
|
128 |
|
|
129 |
|
double fitFunction_TF2(double *, double *); |
130 |
|
protected: |
124 |
– |
ModelDefinition *mdef; |
131 |
|
static ModelDefinition *static_mdef; |
132 |
|
static VectorHisto energy; |
133 |
|
}; |