GSI Object Oriented Online Offline (Go4)  GO4-6.3.0
TGo4FitModelFormula.h
Go to the documentation of this file.
1 // $Id$
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 TGO4FITMODELFORMULA_H
15 #define TGO4FITMODELFORMULA_H
16 
17 #include "TGo4FitModel.h"
18 
19 class TFormula;
20 
29  public:
30 
35 
40  TGo4FitModelFormula(const char *iName, const char *iExpressionStr = "", Int_t iNPars = 0, Bool_t AddAmplitude = kFALSE);
41 
45  virtual ~TGo4FitModelFormula();
46 
50  Bool_t CanAmplTouch() override { return kTRUE; }
51 
55  const char *GetExpression() const { return fxExpression.Data(); }
56 
60  void SetExpression(const char *expr) { fxExpression = expr; }
61 
65  Int_t GetNumberOfExprPar();
66 
70  Bool_t SetNumberOfExprPar(Int_t num);
71 
72  void SetPosParIndex(Int_t naxis, Int_t indx = -1);
73  void SetWidthParIndex(Int_t naxis, Int_t indx = -1);
74 
75  Bool_t BeforeEval(Int_t ndim) override;
76  Double_t EvalN(const Double_t *v) override;
77  void AfterEval() override;
78 
82  void Print(Option_t *option = "") const override;
83 
84  protected:
85 
86  Bool_t Initialize(Int_t UseBuffers = -1) override;
87  void Finalize() override;
88 
89  TGo4FitParameter *GetExprPar(Int_t n);
90  TString GetExprParName(Int_t n);
91 
92  Bool_t CompileFormula();
93  void CloseFormula();
94 
95  Int_t GetPosParIndex(Int_t naxis) override;
96  Int_t GetWidthParIndex(Int_t naxis) override;
97 
101  TString fxExpression;
102 
103  TArrayI fxPosIndex;
104 
105  TArrayI fxWidthIndex;
106 
110  TFormula *fxFormula{nullptr};
111  private:
112 
116  Int_t Par_ndim{0};
117 
118  ClassDefOverride(TGo4FitModelFormula,1)
119 };
120 
121 #endif // TGO4FITMODELFORMULA_H
Double_t EvalN(const Double_t *v) override
void SetExpression(const char *expr)
void Print(Option_t *option="") const override
TString GetExprParName(Int_t n)
TGo4FitParameter * GetExprPar(Int_t n)
Bool_t CanAmplTouch() override
const char * GetExpression() const
Bool_t BeforeEval(Int_t ndim) override
void SetPosParIndex(Int_t naxis, Int_t indx=-1)
Bool_t SetNumberOfExprPar(Int_t num)
Bool_t Initialize(Int_t UseBuffers=-1) override
void SetWidthParIndex(Int_t naxis, Int_t indx=-1)
Int_t GetPosParIndex(Int_t naxis) override
Int_t GetWidthParIndex(Int_t naxis) override