TGo4FitModelFunction.h

Go to the documentation of this file.
00001 // $Id: TGo4FitModelFunction.h 478 2009-10-29 12:26:09Z linev $
00002 //-----------------------------------------------------------------------
00003 //       The GSI Online Offline Object Oriented (Go4) Project
00004 //         Experiment Data Processing at EE department, GSI
00005 //-----------------------------------------------------------------------
00006 // Copyright (C) 2000- GSI Helmholtzzentrum für Schwerionenforschung GmbH
00007 //                     Planckstr. 1, 64291 Darmstadt, Germany
00008 // Contact:            http://go4.gsi.de
00009 //-----------------------------------------------------------------------
00010 // This software can be used under the license agreements as stated
00011 // in Go4License.txt file which is part of the distribution.
00012 //-----------------------------------------------------------------------
00013 
00014 #ifndef TGO4FITMODELFUNCTION_H
00015 #define TGO4FITMODELFUNCTION_H
00016 
00017 #include "TGo4FitModel.h"
00018 
00019 typedef Double_t (*TUserFunction)(Double_t*, Double_t*);
00020 
00043 class TGo4FitModelFunction : public TGo4FitModel {
00044    public:
00045 
00049       TGo4FitModelFunction();
00050 
00057       TGo4FitModelFunction(const char* iName, TUserFunction iUserFunction, Int_t iNPars, Bool_t AddAmplitude = kFALSE);
00058 
00063       TGo4FitModelFunction(const char* iName, const char* iLibraryName = "libName.so", const char* iFunctionName = "Funcname", Int_t iNPars = 0, Bool_t AddAmplitude = kFALSE);
00064 
00068       virtual ~TGo4FitModelFunction();
00069 
00073       virtual Bool_t CanAmplTouch() { return kTRUE; }
00074 
00078       void SetUserFunction(TUserFunction iUserFunction);
00079 
00084       void SetUserFunction(const char* iLibraryName, const char* iFunctionName);
00085 
00089       const char* GetLibraryName() { return fxLibraryName.Data(); }
00090 
00094       void SetLibraryName(const char* name) { fxLibraryName = name; }
00095 
00099       const char* GetFunctionName() { return fxFunctionName.Data(); }
00100 
00104       void SetFunctionName(const char* name) { fxFunctionName = name; }
00105 
00109       Int_t GetNumberOfFuncPar();
00110 
00114       Bool_t SetNumberOfFuncPar(Int_t num);
00115 
00116       void SetPosParIndex(Int_t naxis, Int_t indx = -1);
00117       void SetWidthParIndex(Int_t naxis, Int_t indx = -1);
00118 
00123       virtual Bool_t BeforeEval(Int_t ndim);
00124       virtual void AfterEval();
00125 
00126       virtual void Print(Option_t* option) const;
00127 
00128    protected:
00129 
00134       virtual Bool_t Initialize(Int_t UseBuffers = -1);
00135 
00140       virtual void Finalize();
00141 
00142       virtual TString GetFuncParName(Int_t n);
00143       TGo4FitParameter* GetFuncPar(Int_t n);
00144 
00145       virtual Int_t GetPosParIndex(Int_t naxis);
00146       virtual Int_t GetWidthParIndex(Int_t naxis);
00147 
00148       virtual Double_t UserFunction(Double_t* Coordinates, Double_t* Parameters);
00149 
00150       Bool_t LoadLibrary(Bool_t CloseFirst);
00151       void CloseLibrary();
00152 
00156       TString fxLibraryName;
00157 
00161       TString fxFunctionName;
00162 
00163       TArrayI fxPosIndex;
00164 
00165       TArrayI fxWidthIndex;
00166 
00167    private:
00168 
00172       TUserFunction fxUserFunction;             
00173 
00177       void* fxLibrary;                          
00178 
00179    ClassDef(TGo4FitModelFunction,1)
00180 };
00181 #endif // TGO4FITMODELFUNCTION_H

Generated on Thu Oct 28 15:54:12 2010 for Go4-Fitpackagev4.04-2 by  doxygen 1.5.1