00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035 #ifndef ST_GAMMA_FITTER_H
00036 #define ST_GAMMA_FITTER_H
00037
00038
00039 class TH1;
00040 class TF1;
00041 class TFile;
00042 class TCanvas;
00043
00044
00045 class StGammaEvent;
00046 class StGammaCandidate;
00047 class StGammaTrack;
00048 class StGammaFitterResult;
00049
00050
00051 #include "TObject.h"
00052
00053 class StGammaFitter : public TObject {
00054 public:
00056 ~StGammaFitter();
00057
00060 static StGammaFitter* instance();
00061
00062 virtual const char* GetCVS() const
00063 {static const char cvs[]="Tag $Name: $ $Id: StGammaFitter.h,v 1.6 2009/06/18 17:21:24 jwebb Exp $ built "__DATE__" "__TIME__; return cvs;}
00064
00065
00084 int fit(StGammaCandidate* candidate, StGammaFitterResult* fits, Int_t plane=0);
00085
00088 static double distanceToQuadraticCut(double x, double y);
00089
00090 static TH1* getUhistogram();
00091 static TH1* getVhistogram();
00092 static TF1* getUfunction();
00093 static TF1* getVfunction();
00094
00095 protected:
00098 StGammaFitter();
00099
00100 private:
00102 static StGammaFitter* mInstance;
00103
00104 void estimateYieldMean(TH1* h1, float& yield, float& mean);
00105
00110 float residual(TH1* h1, TF1* f1);
00111
00113 static float GetMaximum(TH1* h1, float xmin, float xmax);
00114
00115 static TH1* hU;
00116 static TH1* hV;
00117 static TF1* fFit[2];
00118 static TF1* fResidualCut;
00119 static int mNdf;
00120 static TCanvas* mCanvas;
00121 static TF1* mShowerShapes[3];
00122
00123 ClassDef(StGammaFitter, 1);
00124 };
00125
00126 inline TH1* StGammaFitter::getUhistogram() { return hU; }
00127 inline TH1* StGammaFitter::getVhistogram() { return hV; }
00128 inline TF1* StGammaFitter::getUfunction() { return fFit[0]; }
00129 inline TF1* StGammaFitter::getVfunction() { return fFit[1]; }
00130
00131 #endif