GSI Object Oriented Online Offline (Go4)  GO4-6.2.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
TGo4FitModelFunction.h
Go to the documentation of this file.
1 // $Id: TGo4FitModelFunction.h 2628 2019-10-01 08:14:31Z linev $
2 //-----------------------------------------------------------------------
3 // The GSI Online Offline Object Oriented (Go4) Project
4 // Experiment Data Processing at EE department, GSI
5 //-----------------------------------------------------------------------
6 // Copyright (C) 2000- GSI Helmholtzzentrum fuer Schwerionenforschung GmbH
7 // Planckstr. 1, 64291 Darmstadt, Germany
8 // Contact: http://go4.gsi.de
9 //-----------------------------------------------------------------------
10 // This software can be used under the license agreements as stated
11 // in Go4License.txt file which is part of the distribution.
12 //-----------------------------------------------------------------------
13 
14 #ifndef TGO4FITMODELFUNCTION_H
15 #define TGO4FITMODELFUNCTION_H
16 
17 #include "TGo4FitModel.h"
18 
19 typedef Double_t (*TUserFunction)(Double_t*, Double_t*);
20 
44  public:
45 
50 
57  TGo4FitModelFunction(const char* iName, TUserFunction iUserFunction, Int_t iNPars, Bool_t AddAmplitude = kFALSE);
58 
63  TGo4FitModelFunction(const char* iName, const char* iLibraryName = "libName.so", const char* iFunctionName = "Funcname", Int_t iNPars = 0, Bool_t AddAmplitude = kFALSE);
64 
68  virtual ~TGo4FitModelFunction();
69 
73  virtual Bool_t CanAmplTouch() { return kTRUE; }
74 
78  void SetUserFunction(TUserFunction iUserFunction);
79 
84  void SetUserFunction(const char* iLibraryName, const char* iFunctionName);
85 
89  const char* GetLibraryName() const { return fxLibraryName.Data(); }
90 
94  void SetLibraryName(const char* name) { fxLibraryName = name; }
95 
99  const char* GetFunctionName() const { return fxFunctionName.Data(); }
100 
104  void SetFunctionName(const char* name) { fxFunctionName = name; }
105 
109  Int_t GetNumberOfFuncPar();
110 
114  Bool_t SetNumberOfFuncPar(Int_t num);
115 
116  void SetPosParIndex(Int_t naxis, Int_t indx = -1);
117  void SetWidthParIndex(Int_t naxis, Int_t indx = -1);
118 
123  virtual Bool_t BeforeEval(Int_t ndim);
124  virtual void AfterEval();
125 
126  virtual void Print(Option_t* option) const;
127 
128  protected:
129 
134  virtual Bool_t Initialize(Int_t UseBuffers = -1);
135 
140  virtual void Finalize();
141 
142  virtual TString GetFuncParName(Int_t n);
143  TGo4FitParameter* GetFuncPar(Int_t n);
144 
145  virtual Int_t GetPosParIndex(Int_t naxis);
146  virtual Int_t GetWidthParIndex(Int_t naxis);
147 
148  virtual Double_t UserFunction(Double_t* Coordinates, Double_t* Parameters);
149 
150  Bool_t LoadLibrary(Bool_t CloseFirst);
151  void CloseLibrary();
152 
156  TString fxLibraryName;
157 
161  TString fxFunctionName;
162 
163  TArrayI fxPosIndex;
164 
165  TArrayI fxWidthIndex;
166 
167  private:
168 
173 
177  void* fxLibrary;
178 
180 };
181 
182 #endif // TGO4FITMODELFUNCTION_H
virtual Bool_t Initialize(Int_t UseBuffers=-1)
virtual Bool_t CanAmplTouch()
void SetUserFunction(TUserFunction iUserFunction)
Bool_t SetNumberOfFuncPar(Int_t num)
Double_t(* TUserFunction)(Double_t *, Double_t *)
void SetFunctionName(const char *name)
virtual TString GetFuncParName(Int_t n)
virtual Int_t GetWidthParIndex(Int_t naxis)
virtual Bool_t BeforeEval(Int_t ndim)
Bool_t LoadLibrary(Bool_t CloseFirst)
void SetLibraryName(const char *name)
void SetPosParIndex(Int_t naxis, Int_t indx=-1)
TGo4FitParameter * GetFuncPar(Int_t n)
virtual void Print(Option_t *option) const
ClassDef(TGo4FitSlotList, 1)
virtual Int_t GetPosParIndex(Int_t naxis)
const char * GetLibraryName() const
const char * GetFunctionName() const
void SetWidthParIndex(Int_t naxis, Int_t indx=-1)
virtual Double_t UserFunction(Double_t *Coordinates, Double_t *Parameters)