GSI Object Oriented Online Offline (Go4)
GO4-6.3.0
Go4Fit
TGo4FitDependency.cxx
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
#include "
TGo4FitDependency.h
"
15
16
#include <iostream>
17
18
#include "TFormula.h"
19
20
TGo4FitDependency::TGo4FitDependency
() :
21
TObject(), fxParameter(), fxExpression(), fdInitValue(0.), fiNumPar(0), fxFormula(nullptr) {
22
}
23
24
25
TGo4FitDependency::TGo4FitDependency
(
const
char
*iParameter,
const
char
*iExpression) :
26
TObject(),
fxParameter
(iParameter),
fxExpression
(iExpression),
fdInitValue
(0.),
fiNumPar
(0),
fxFormula
(nullptr) {
27
}
28
29
TGo4FitDependency::TGo4FitDependency
(
const
char
*iParameter, Double_t InitValue) :
30
TObject(),
fxParameter
(iParameter),
fxExpression
(),
fdInitValue
(InitValue),
fiNumPar
(0),
fxFormula
(nullptr) {
31
}
32
33
TGo4FitDependency::~TGo4FitDependency
() {
34
if
(
fxFormula
)
delete
fxFormula
;
35
}
36
37
void
TGo4FitDependency::SetParameter
(
const
char
*iParameter) {
38
fxParameter
= iParameter;
39
}
40
41
void
TGo4FitDependency::SetInitValue
(Double_t InitValue)
42
{
43
fxExpression
.Remove(0);
44
fdInitValue
= InitValue;
45
46
}
47
void
TGo4FitDependency::SetExpression
(
const
char
*iExpression)
48
{
49
fxExpression
= iExpression;
50
}
51
52
void
TGo4FitDependency::Initialize
(Int_t iNumPar,
const
char
*iFormula)
53
{
54
fiNumPar
= iNumPar;
55
if
(iFormula) {
56
if
(
fxFormula
)
delete
fxFormula
;
57
fxFormula
=
new
TFormula(
""
, iFormula);
58
}
else
{
59
fxFormula
=
nullptr
;
60
}
61
}
62
63
Double_t
TGo4FitDependency::ExecuteDependency
(Double_t *Params)
64
{
65
Double_t res =
fxFormula
?
fxFormula
->EvalPar(
nullptr
,Params) :
fdInitValue
;
66
if
(
fiNumPar
>= 0) Params[
fiNumPar
] = res;
67
return
res;
68
}
69
70
void
TGo4FitDependency::Finalize
()
71
{
72
if
(
fxFormula
) {
73
delete
fxFormula
;
74
fxFormula
=
nullptr
;
75
}
76
}
77
78
void
TGo4FitDependency::Print
(Option_t *option)
const
79
{
80
std::cout <<
"Pars dependency: "
<<
fxParameter
<<
" = "
;
81
if
(
fxExpression
.Length()>0) std::cout <<
fxExpression
<< std::endl;
82
else
std::cout <<
fdInitValue
<< std::endl;
83
}
TGo4FitDependency::fdInitValue
Double_t fdInitValue
Definition:
TGo4FitDependency.h:55
TGo4FitDependency::fxExpression
TString fxExpression
Definition:
TGo4FitDependency.h:54
TGo4FitDependency::SetExpression
void SetExpression(const char *iExpression)
Definition:
TGo4FitDependency.cxx:47
TGo4FitDependency::TGo4FitDependency
TGo4FitDependency()
Definition:
TGo4FitDependency.cxx:20
TGo4FitDependency::Print
void Print(Option_t *option="") const override
Definition:
TGo4FitDependency.cxx:78
TGo4FitDependency::Initialize
void Initialize(Int_t iNumPar, const char *iFormula)
Definition:
TGo4FitDependency.cxx:52
TGo4FitDependency::SetParameter
void SetParameter(const char *iParameter)
Definition:
TGo4FitDependency.cxx:37
TGo4FitDependency::fxFormula
TFormula * fxFormula
Definition:
TGo4FitDependency.h:57
TGo4FitDependency.h
TGo4FitDependency::~TGo4FitDependency
virtual ~TGo4FitDependency()
Definition:
TGo4FitDependency.cxx:33
TGo4FitDependency::fiNumPar
Int_t fiNumPar
Definition:
TGo4FitDependency.h:56
TGo4FitDependency::SetInitValue
void SetInitValue(Double_t InitValue)
Definition:
TGo4FitDependency.cxx:41
TGo4FitDependency::fxParameter
TString fxParameter
Definition:
TGo4FitDependency.h:53
TGo4FitDependency::Finalize
void Finalize()
Definition:
TGo4FitDependency.cxx:70
TGo4FitDependency::ExecuteDependency
Double_t ExecuteDependency(Double_t *Params)
Definition:
TGo4FitDependency.cxx:63
Generated on Wed Jan 10 2024 15:04:17 for GSI Object Oriented Online Offline (Go4) by
1.8.13