00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef dFitter3d_hh
00012 #define dFitter3d_hh
00013
00014
00015 #include "TH3.h"
00016 #include "TH1.h"
00017 #include "TMinuit.h"
00018 #include "TVector3.h"
00019 #include "TString.h"
00020 #include "TObject.h"
00021
00022 class dFitter3d : public TObject
00023 {
00024 public :
00026
00028 dFitter3d( TMinuit* gMinuit, TH3D* numerator, TH3D* denominator, TString opt, TString opt2 ) ;
00029 ~dFitter3d() ;
00030
00032
00034
00035 void FillInternalArrays() ;
00036
00037 void doFit() ;
00038
00040
00042
00043 void setFitMethod(TString opt) ;
00044
00045 void mfcn(Int_t &nParamters, Double_t *gin, Double_t &finalChi2, Double_t *parameterSet, Int_t iflag) ;
00046
00047 void fcnChi2(Int_t &nParamters, Double_t *gin, Double_t &finalChi2, Double_t *parameterSet, Int_t iflag) ;
00048
00049 void fcnMml(Int_t &nParamters, Double_t *gin, Double_t &finalChi2, Double_t *parameterSet, Int_t iflag) ;
00050
00051 double lnfactorial(double arg) ;
00052
00053
00055
00057
00058 void setCorrFctn(TString opt) ;
00059
00060 double mCorrelationFunction(TVector3& position, double* parameterSet ) ;
00061
00062 double ykpCorrelationFunction(TVector3& position, double* parameterSet ) ;
00063
00064 double bpCorrelationFunction(TVector3& position, double* parameterSet ) ;
00065
00066
00068
00070
00071 TH3D* Numerator() ;
00072 TH3D* Denominator() ;
00073 TH3D* Ratio() ;
00074
00075 void SetNormFactor(double norm) ;
00076 double Norm() ;
00077
00078 void SetThresholdNumerator(double thresN) ;
00079 void SetThresholdDenominator(double thresD) ;
00080 double ThresholdNumerator() ;
00081 double ThresholdDenominator() ;
00082
00083 void SetHistos(TH3D* numerator, TH3D* denominator) ;
00084
00085 TMinuit* getMinuit() { return mMinuit ; } ;
00086
00087 void SetSphereLimit(double limit) { mSphereLimit = limit*limit ; } ;
00088 double GetSphereLimit() { return mSphereLimit; } ;
00089
00090
00091 private :
00092
00093
00094 TMinuit* mMinuit ;
00095
00096
00097 int mInternalArraySize ;
00098 double* mRatioInternalArray ;
00099 double* mNumeratorInternalArray ;
00100 double* mDenominatorInternalArray ;
00101 double* mErrorInternalArray ;
00102 TVector3* mVariablePositionArray ;
00103
00104
00105
00106
00107 TString mFitMethod ;
00108
00109 TString mCorrFctnType ;
00110
00111 double mSphereLimit ;
00112
00113
00114 void Bin1ToBin3(TH3D* histo, int bin, int& binx, int& biny, int& binz) ;
00115
00116
00117 int countMinuitCalls ;
00118
00119
00120
00121 TH3D* mNumerator ;
00122 TH3D* mDenominator ;
00123 TH3D* mRatio ;
00124
00125
00126 double mNorm ;
00127 double mThresholdNumerator ;
00128 double mThresholdDenominator ;
00129
00130
00131 double mhc ;
00132 double mhc2 ;
00133
00134
00135 #ifdef __ROOT__
00136 ClassDef(dFitter3d, 0)
00137 #endif
00138
00139 };
00140
00142
00144
00145 inline TH3D* dFitter3d::Numerator(){return mNumerator;}
00146 inline TH3D* dFitter3d::Denominator(){return mDenominator;}
00147 inline TH3D* dFitter3d::Ratio(){return mRatio;}
00148
00149 inline double dFitter3d::Norm(){return mNorm; }
00150 inline void dFitter3d::SetNormFactor(double norm) { mNorm = norm ; }
00151
00152 inline double dFitter3d::ThresholdNumerator(){return mThresholdNumerator; }
00153 inline double dFitter3d::ThresholdDenominator(){return mThresholdDenominator; }
00154 inline void dFitter3d::SetThresholdNumerator(double thresN) { mThresholdNumerator = thresN ; }
00155 inline void dFitter3d::SetThresholdDenominator(double thresD) { mThresholdDenominator = thresD ; }
00156
00157
00158 #endif