00001 //------------------------------------------------------------- 00002 // Go4 Release Package v3.04-01 (build 30401) 00003 // 28-November-2008 00004 //--------------------------------------------------------------- 00005 // The GSI Online Offline Object Oriented (Go4) Project 00006 // Experiment Data Processing at EE department, GSI 00007 //--------------------------------------------------------------- 00008 // 00009 //Copyright (C) 2000- Gesellschaft f. Schwerionenforschung, GSI 00010 // Planckstr. 1, 64291 Darmstadt, Germany 00011 //Contact: http://go4.gsi.de 00012 //---------------------------------------------------------------- 00013 //This software can be used under the license agreements as stated 00014 //in Go4License.txt file which is part of the distribution. 00015 //---------------------------------------------------------------- 00016 #ifndef TGO4FITMODELFORMULA_H 00017 #define TGO4FITMODELFORMULA_H 00018 00019 #include "TGo4FitModel.h" 00020 00021 class TFormula; 00022 00030 class TGo4FitModelFormula : public TGo4FitModel { 00031 public: 00032 00036 TGo4FitModelFormula(); 00037 00042 TGo4FitModelFormula(const char* iName, const char* iExpressionStr = "", Int_t iNPars = 0, Bool_t AddAmplitude = kFALSE); 00043 00047 virtual ~TGo4FitModelFormula(); 00048 00052 virtual Bool_t CanAmplTouch() { return kTRUE; } 00053 00057 const char* GetExpression() { return fxExpression.Data(); } 00058 00062 void SetExpression(const char* expr) { fxExpression = expr; } 00063 00067 Int_t GetNumberOfExprPar(); 00068 00072 Bool_t SetNumberOfExprPar(Int_t num); 00073 00074 void SetPosParIndex(Int_t naxis, Int_t indx = -1); 00075 void SetWidthParIndex(Int_t naxis, Int_t indx = -1); 00076 00077 virtual Bool_t BeforeEval(Int_t ndim); 00078 virtual Double_t EvalN(const Double_t* v); 00079 virtual void AfterEval(); 00080 00084 virtual void Print(Option_t* option) const; 00085 00086 protected: 00087 00088 virtual Bool_t Initialize(Int_t UseBuffers = -1); 00089 virtual void Finalize(); 00090 00091 TGo4FitParameter* GetExprPar(Int_t n); 00092 TString GetExprParName(Int_t n); 00093 00094 Bool_t CompileFormula(); 00095 void CloseFormula(); 00096 00097 virtual Int_t GetPosParIndex(Int_t naxis); 00098 virtual Int_t GetWidthParIndex(Int_t naxis); 00099 00103 TString fxExpression; 00104 00105 TArrayI fxPosIndex; 00106 00107 TArrayI fxWidthIndex; 00108 00112 TFormula *fxFormula; 00113 private: 00114 00118 Int_t Par_ndim; 00119 00120 ClassDef(TGo4FitModelFormula,1) 00121 }; 00122 #endif // TGO4FITMODELFORMULA_H 00123 00124 //----------------------------END OF GO4 SOURCE FILE ---------------------