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

Comparing UserCode/JetFitAnalyzer/interface/HistoFitter.h (file contents):
Revision 1.5 by dnisson, Sun Dec 13 19:56:28 2009 UTC vs.
Revision 1.7 by dnisson, Fri Jan 22 23:53:09 2010 UTC

# Line 1 | Line 1
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
# Line 20 | Line 22 | public:
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,
# Line 27 | Line 30 | public:
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;
# Line 80 | Line 86 | public:
86                                int, FitResults);
87      void findInitialValues(std::vector<TString> &,
88                             double *, double *, double *, double *,
89 <                           int, FitResults);
90 <    double initNewN(FitResults);
91 <    double initNewMeanX(FitResults);
92 <    double initNewMeanY(FitResults);
89 >                           int, FitResults, int);
90 >    double initNewN(FitResults, int);
91 >    double initNewMeanX(FitResults, int);
92 >    double initNewMeanY(FitResults, int);
93      void initParameters(TH2 *, TMinuit *, std::vector<TString> &,
94                    double *, double *, double *, double *,
95                    int, FitResults);
# Line 110 | Line 116 | public:
116    static VectorHisto loadTH2IntoVectorHisto(TH2*);
117    Trouble minimize(TMinuit*, VectorHisto, int);
118  
119 +  int findNnewGauss(TH2 *, VectorHisto, FitResults);
120    FitResults fit_histo(TH2 *hist,
121                          std::vector<Trouble> &t,
122                      int start_theNumberOfGaussians = 1,
# Line 120 | Line 127 | public:
127  
128    double fitFunction_TF2(double *, double *);
129   protected:
123  ModelDefinition *mdef;
130    static ModelDefinition *static_mdef;
131    static VectorHisto energy;
132   };

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines