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

Comparing UserCode/JetFitAnalyzer/interface/JetFitAnalyzer.h (file contents):
Revision 1.2 by dnisson, Tue Nov 10 01:25:48 2009 UTC vs.
Revision 1.3 by dnisson, Fri Nov 13 03:57:48 2009 UTC

# Line 1 | Line 1
1 + #ifndef UserCode_JetFitAnalyzer_JetFitAnalyzer_h
2 + #define UserCode_JetFitAnalyzer_JetFitAnalyzer_h
3 +
4   // system include files
5   #include <memory>
3 #include <string>
6  
7   // user include files
8   #include "FWCore/Framework/interface/Frameworkfwd.h"
# Line 15 | Line 17
17  
18   #include "TH2.h"
19  
20 + #include <string>
21 + #include <vector>
22 +
23 + #include <TFormula.h>
24 + #include <TString.h>
25 + #include <TMinuit.h>
26 + #include <TH2.h>
27 +
28   class JetFitAnalyzer : public edm::EDAnalyzer {
29   public:
30    explicit JetFitAnalyzer(const edm::ParameterSet&);
31    ~JetFitAnalyzer();
32 +
33 +
34 +  enum TroubleStage {
35 +    T_NULL = 0,
36 +    T_SIMPLEX,
37 +    T_MIGRAD,
38 +    T_MINOS
39 +  };
40 +
41 +  struct VectorHisto {
42 +    vector< vector<double> > bins;
43 +    double Xlo, Xhi, Ylo, Yhi;
44 +  } energy;
45 +
46 +  struct Trouble {
47 +    TroubleStage occ;
48 +    int istat;
49 +  };
50 +
51 +  struct FitResults {
52 +    TH2 *rebinnedHisto;
53 +    std::vector< double > chisquare;
54 +    std::vector< std::vector<TString> > pars;
55 +    std::vector< std::vector<double> > pval;
56 +    std::vector< std::vector<double> > perr;
57 +    std::vector< std::vector<double> > plo;
58 +    std::vector< std::vector<double> > phi;
59 +  };
60 +
61 +  class ModelDefinition {
62 +  public:
63 +    int numberOfGaussians();
64 +    void setNumberOfGaussians(int);
65 +
66 +    double fitFunction(double, double, double *);
67 +
68 +    TFormula *getFormula();
69 +    void setFormula(TFormula *);
70 +    void indivParameter(int, std::string&, double&, double&, double&, double&);
71 +    void setIndivParameter(int, std::string, double, double, double, double);
72 +    void get_special_par(int, int, double&, double&, double&, double&);
73 +    void set_special_par(int, int, double, double, double, double);
74 +    unsigned get_n_special_par_sets();
75 +    int get_indiv_max_E();
76 +    void set_indiv_max_E(int);
77 +    int get_indiv_max_x();
78 +    void set_indiv_max_x(int);
79 +    int get_indiv_max_y();
80 +    void set_indiv_max_y(int);
81 +    virtual double chisquare_error(double) = 0;
82 +    double formula_int(double, double, double, double,
83 +                       double*, double, double, double*);
84 +    void par_init(TH2 *, TMinuit *, std::vector<TString> &,
85 +                  double *, double *, double *, double *,
86 +                  int, FitResults);
87 +
88 +
89 +  private:
90 +    TFormula *indiv_formula; // formula for individual Gaussian
91 +    std::vector<std::string> indiv_par_names;
92 +    std::vector<double> indiv_par_starts;
93 +    std::vector<double> indiv_par_start_steps;
94 +    std::vector<double> indiv_par_lo;
95 +    std::vector<double> indiv_par_hi;
96 +    std::vector< std::vector<double> > special_par_starts;
97 +    std::vector< std::vector<double> > special_par_start_steps;
98 +    std::vector< std::vector<double> > special_par_lo;
99 +    std::vector< std::vector<double> > special_par_hi;
100 +    int indiv_max_E;
101 +    int indiv_max_x;
102 +    int indiv_max_y;
103 +    int theNumberOfGaussians;
104 +  };
105 +
106 +  FitResults fit_histo(TH2 *hist, std::vector<Trouble> &t,
107 +                    void (*cc_minuit)(TMinuit *, TH2 *, int) = 0,
108 +                    int start_ngauss = 0,
109 +                    int rebinX = 1, int rebinY = 1,
110 +                    double P_cutoff_val = 0.5);
111 +
112 +  ModelDefinition& curr_ModelDefinition();
113 +  void set_ModelDefinition(ModelDefinition *_mdef);
114 +
115 +  bool get_ignorezero();
116 +  void set_ignorezero(bool);
117 +
118 +  double fit_fcn_TF2(double *, double *);  
119      
120   protected:
121    virtual void beginJob(const edm::EventSetup&);
# Line 50 | Line 147 | private:
147   //
148   // static data member definitions
149   //
150 +
151 + #endif

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines