ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/JetFitAnalyzer/interface/jetfit.h
(Generate patch)

Comparing UserCode/JetFitAnalyzer/interface/jetfit.h (file contents):
Revision 1.2 by dnisson, Fri Sep 4 20:01:19 2009 UTC vs.
Revision 1.5 by dnisson, Fri Nov 13 03:57:48 2009 UTC

# Line 1 | Line 1
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>
# Line 12 | Line 12
12   #include <TH2.h>
13  
14   namespace jetfit {
15 <  class model_def {
15 >
16 >  enum TroubleStage {
17 >    T_NULL = 0,
18 >    T_SIMPLEX,
19 >    T_MIGRAD,
20 >    T_MINOS
21 >  };
22 >
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 FitResults {
34 >    TH2 *rebinnedHisto;
35 >    std::vector< double > chisquare;
36 >    std::vector< std::vector<TString> > pars;
37 >    std::vector< std::vector<double> > pval;
38 >    std::vector< std::vector<double> > perr;
39 >    std::vector< std::vector<double> > plo;
40 >    std::vector< std::vector<double> > phi;
41 >  };
42 >
43 >  class ModelDefinition {
44    public:
45 <    TFormula *get_formula();
46 <    void set_formula(TFormula *);
47 <    void get_indiv_par(int, std::string&, double&, double&, double&, double&);
48 <    void set_indiv_par(int, std::string, double, double, double, double);
45 >    int numberOfGaussians();
46 >    void setNumberOfGaussians(int);
47 >
48 >    double fitFunction(double, double, double *);
49 >
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();
# Line 28 | Line 61 | namespace jetfit {
61      int get_indiv_max_y();
62      void set_indiv_max_y(int);
63      virtual double chisquare_error(double) = 0;
64 +    double formula_int(double, double, double, double,
65 +                       double*, double, double, double*);
66 +    void par_init(TH2 *, TMinuit *, std::vector<TString> &,
67 +                  double *, double *, double *, double *,
68 +                  int, FitResults);
69 +
70 +
71    private:
72      TFormula *indiv_formula; // formula for individual Gaussian
73      std::vector<std::string> indiv_par_names;
# Line 42 | Line 82 | namespace jetfit {
82      int indiv_max_E;
83      int indiv_max_x;
84      int indiv_max_y;
85 +    int theNumberOfGaussians;
86    };
87  
88 <  enum trouble_occ_t {
48 <    T_NULL = 0,
49 <    T_SIMPLEX,
50 <    T_MIGRAD,
51 <    T_MINOS
52 <  };
53 <
54 <  struct trouble {
55 <    trouble_occ_t occ;
56 <    int istat;
57 <  };
58 <
59 <  struct results {
60 <    TH2 *hist_rebinned;
61 <    std::vector< double > chisquare;
62 <    std::vector< std::vector<TString> > pars;
63 <    std::vector< std::vector<double> > pval;
64 <    std::vector< std::vector<double> > perr;
65 <    std::vector< std::vector<double> > plo;
66 <    std::vector< std::vector<double> > phi;
67 <  };
68 <
69 <  model_def& curr_model_def();
70 <  void set_model_def(model_def *_mdef);
71 <
72 <  int get_ngauss();
73 <  void set_ngauss(int _ngauss);
74 <  double fit_fcn(double, double, double *);
75 <  double fit_fcn_TF2(double *, double *);
76 <  bool get_ignorezero();
77 <  void set_ignorezero(bool);
78 <  
79 <  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 +  ModelDefinition& curr_ModelDefinition();
95 +  void set_ModelDefinition(ModelDefinition *_mdef);
96 +
97 +  bool get_ignorezero();
98 +  void set_ignorezero(bool);
99 +
100 +  double fit_fcn_TF2(double *, double *);  
101   }
102  
103   #endif

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines