Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

TGo4FitModelFunction.h

Go to the documentation of this file.
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 TGO4FITMODELFUNCTION_H
00017 #define TGO4FITMODELFUNCTION_H
00018 
00019 #include "TGo4FitModel.h"
00020 
00021 typedef Double_t (*TUserFunction)(Double_t*, Double_t*);
00022 
00045 class TGo4FitModelFunction : public TGo4FitModel {
00046    public:
00047 
00051       TGo4FitModelFunction();
00052 
00059       TGo4FitModelFunction(const char* iName, TUserFunction iUserFunction, Int_t iNPars, Bool_t AddAmplitude = kFALSE);
00060 
00065       TGo4FitModelFunction(const char* iName, const char* iLibraryName = "libName.so", const char* iFunctionName = "Funcname", Int_t iNPars = 0, Bool_t AddAmplitude = kFALSE);
00066 
00070       virtual ~TGo4FitModelFunction();
00071 
00075       virtual Bool_t CanAmplTouch() { return kTRUE; }
00076 
00080       void SetUserFunction(TUserFunction iUserFunction);
00081 
00086       void SetUserFunction(const char* iLibraryName, const char* iFunctionName);
00087 
00091       const char* GetLibraryName() { return fxLibraryName.Data(); }
00092 
00096       void SetLibraryName(const char* name) { fxLibraryName = name; }
00097 
00101       const char* GetFunctionName() { return fxFunctionName.Data(); }
00102 
00106       void SetFunctionName(const char* name) { fxFunctionName = name; }
00107 
00111       Int_t GetNumberOfFuncPar();
00112 
00116       Bool_t SetNumberOfFuncPar(Int_t num);
00117 
00118       void SetPosParIndex(Int_t naxis, Int_t indx = -1);
00119       void SetWidthParIndex(Int_t naxis, Int_t indx = -1);
00120 
00125       virtual Bool_t BeforeEval(Int_t ndim);
00126       virtual void AfterEval();
00127 
00128       virtual void Print(Option_t* option) const;
00129 
00130    protected:
00131 
00136       virtual Bool_t Initialize(Int_t UseBuffers = -1);
00137 
00142       virtual void Finalize();
00143 
00144       virtual TString GetFuncParName(Int_t n);
00145       TGo4FitParameter* GetFuncPar(Int_t n);
00146 
00147       virtual Int_t GetPosParIndex(Int_t naxis);
00148       virtual Int_t GetWidthParIndex(Int_t naxis);
00149 
00150       virtual Double_t UserFunction(Double_t* Coordinates, Double_t* Parameters);
00151 
00152       Bool_t LoadLibrary(Bool_t CloseFirst);
00153       void CloseLibrary();
00154 
00158       TString fxLibraryName;
00159 
00163       TString fxFunctionName;
00164 
00165       TArrayI fxPosIndex;
00166 
00167       TArrayI fxWidthIndex;
00168 
00169    private:
00170 
00174       TUserFunction fxUserFunction;             
00175 
00179       void* fxLibrary;                          
00180 
00181    ClassDef(TGo4FitModelFunction,1)
00182 };
00183 #endif // TGO4FITMODELFUNCTION_H
00184 
00185 //----------------------------END OF GO4 SOURCE FILE ---------------------

Generated on Fri Nov 28 12:59:12 2008 for Go4-v3.04-1 by  doxygen 1.4.2