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.3 by dnisson, Fri Nov 13 03:57:48 2009 UTC vs.
Revision 1.11 by dnisson, Sat Mar 27 01:58:10 2010 UTC

# Line 13 | Line 13
13  
14   #include "FWCore/ParameterSet/interface/ParameterSet.h"
15  
16 #include "UserCode/JetFitAnalyzer/interface/jetfit.h"
17
16   #include "TH2.h"
17  
18   #include <string>
# Line 25 | Line 23
23   #include <TMinuit.h>
24   #include <TH2.h>
25  
26 + #include "UserCode/JetFitAnalyzer/interface/HistoFitter.h"
27 +
28   class JetFitAnalyzer : public edm::EDAnalyzer {
29 < public:
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:
32 >  
33 > protected:
34    virtual void beginJob(const edm::EventSetup&);
35    virtual void analyze(const edm::Event&, const edm::EventSetup&);
36    virtual void endJob();
37 <  virtual TH2D * make_histo(const edm::Event&, const edm::EventSetup&) = 0;
38 <  virtual jetfit::model_def& make_model_def(const edm::Event&,
39 <                                           const edm::EventSetup&,
40 <                                           TH2 *hist) = 0;
41 <  virtual void analyze_results(jetfit::results, std::vector<jetfit::trouble>,
37 >  virtual std::vector<TH2D *> make_histo(const edm::Event&, const edm::EventSetup&, std::vector<unsigned>&);
38 >  virtual HistoFitter::ModelDefinition& make_model_def(const edm::Event&,
39 >                                                       const edm::EventSetup&,
40 >                                                       TH2 *hist);
41 >  virtual void analyze_results(HistoFitter::FitResults,
42 >                               std::vector<HistoFitter::Trouble>,
43                                 TH2 *) = 0;
130  void set_user_minuit(void (*_user_minuit)(TMinuit *, TH2 *, int) ) {
131    user_minuit = _user_minuit;
132  }
44  
45 < private:
45 >  private:
46    // ----------member data ---------------------------
136  bool ignorezero_;
137  int rebinX_;
138  int rebinY_;
47    double P_cutoff_val_;
48 <  void (*user_minuit)(TMinuit *, TH2 *, int);
49 < };
48 >  int infoType_;
49 >  unsigned maxGaussians_;
50 >  double smear_;
51 >  std::string jet_algo_;
52 >  double gausSpread_;
53  
54   //
55   // constants, enums and typedefs
# Line 147 | Line 58 | private:
58   //
59   // static data member definitions
60   //
61 <
61 > };
62   #endif

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines