1 |
|
/* jetfit.h - User-callable function prototypes from jetfit */ |
2 |
|
|
3 |
< |
#ifndef JETFIT_H |
4 |
< |
#define JETFIT_H |
3 |
> |
#ifndef UserCode_JetFitAnalyzer_jetfit_h |
4 |
> |
#define UserCode_JetFitAnalyzer_jetfit_h |
5 |
|
|
6 |
|
#include <string> |
7 |
|
#include <vector> |
13 |
|
|
14 |
|
namespace jetfit { |
15 |
|
|
16 |
< |
enum trouble_occ_t { |
16 |
> |
enum TroubleStage { |
17 |
|
T_NULL = 0, |
18 |
|
T_SIMPLEX, |
19 |
|
T_MIGRAD, |
20 |
|
T_MINOS |
21 |
|
}; |
22 |
|
|
23 |
< |
struct trouble { |
24 |
< |
trouble_occ_t occ; |
23 |
> |
struct VectorHisto { |
24 |
> |
vector< vector<double> > bins; |
25 |
> |
double Xlo, Xhi, Ylo, Yhi; |
26 |
> |
} energy; |
27 |
> |
|
28 |
> |
struct Trouble { |
29 |
> |
TroubleStage occ; |
30 |
|
int istat; |
31 |
|
}; |
32 |
|
|
33 |
< |
struct results { |
34 |
< |
TH2 *hist_rebinned; |
33 |
> |
struct FitResults { |
34 |
> |
TH2 *rebinnedHisto; |
35 |
|
std::vector< double > chisquare; |
36 |
|
std::vector< std::vector<TString> > pars; |
37 |
|
std::vector< std::vector<double> > pval; |
40 |
|
std::vector< std::vector<double> > phi; |
41 |
|
}; |
42 |
|
|
43 |
< |
class model_def { |
43 |
> |
class ModelDefinition { |
44 |
|
public: |
45 |
< |
int get_ngauss(); |
46 |
< |
void set_ngauss(int _ngauss); |
45 |
> |
int numberOfGaussians(); |
46 |
> |
void setNumberOfGaussians(int); |
47 |
|
|
48 |
< |
double fit_fcn(double, double, double *); |
48 |
> |
double fitFunction(double, double, double *); |
49 |
|
|
50 |
< |
TFormula *get_formula(); |
51 |
< |
void set_formula(TFormula *); |
52 |
< |
void get_indiv_par(int, std::string&, double&, double&, double&, double&); |
53 |
< |
void set_indiv_par(int, std::string, double, double, double, double); |
50 |
> |
TFormula *getFormula(); |
51 |
> |
void setFormula(TFormula *); |
52 |
> |
void indivParameter(int, std::string&, double&, double&, double&, double&); |
53 |
> |
void setIndivParameter(int, std::string, double, double, double, double); |
54 |
|
void get_special_par(int, int, double&, double&, double&, double&); |
55 |
|
void set_special_par(int, int, double, double, double, double); |
56 |
|
unsigned get_n_special_par_sets(); |
65 |
|
double*, double, double, double*); |
66 |
|
void par_init(TH2 *, TMinuit *, std::vector<TString> &, |
67 |
|
double *, double *, double *, double *, |
68 |
< |
int, results); |
68 |
> |
int, FitResults); |
69 |
|
|
70 |
|
|
71 |
|
private: |
82 |
|
int indiv_max_E; |
83 |
|
int indiv_max_x; |
84 |
|
int indiv_max_y; |
85 |
< |
int ngauss; |
85 |
> |
int theNumberOfGaussians; |
86 |
|
}; |
87 |
|
|
88 |
< |
results fit_histo(TH2 *hist, std::vector<trouble> &t, |
88 |
> |
FitResults fit_histo(TH2 *hist, std::vector<Trouble> &t, |
89 |
|
void (*cc_minuit)(TMinuit *, TH2 *, int) = 0, |
90 |
|
int start_ngauss = 0, |
91 |
|
int rebinX = 1, int rebinY = 1, |
92 |
|
double P_cutoff_val = 0.5); |
93 |
|
|
94 |
< |
model_def& curr_model_def(); |
95 |
< |
void set_model_def(model_def *_mdef); |
94 |
> |
ModelDefinition& curr_ModelDefinition(); |
95 |
> |
void set_ModelDefinition(ModelDefinition *_mdef); |
96 |
|
|
97 |
|
bool get_ignorezero(); |
98 |
|
void set_ignorezero(bool); |