KaliVeda
Toolkit for HIC analysis
Loading...
Searching...
No Matches
algebraic_fitting_function.cpp
1#include "algebraic_fitting_function.h"
2
4
6
8
10
11 algebraic_fitting_function::algebraic_fitting_function(const algebraic_fitting_function& other)
12 : params(other.params)
13 {
14 }
15
16
23
25
26 algebraic_fitting_function::algebraic_fitting_function(double alph, double gam, double thet, double Xmi, double Xma)
27 {
28 double p[] = {thet, Xma, Xmi, alph, gam};
30 }
31
32
35
37
38 double algebraic_fitting_function::k_cb(double cb) const
39 {
40 if (params.alpha.value <= 0) return 0;
41 if (params.gamma.value <= 0) return 0;
42 if (cb < 0 || cb > 1) return 0;
43 double arg = 1. - TMath::Power(cb, params.alpha.value);
44 if (arg < 0) return 0;
45 return params.kmax.value * TMath::Power(arg, params.gamma.value) + params.k0.value;
46 }
47
48
56
58
60 {
61 params.theta.value = p[0];
62 params.Xmax.value = p[1];
63 params.k0.value = p[2] / p[0];
64 params.kmax.value = params.Xmax.value / params.theta.value - params.k0.value;
65 params.alpha.value = p[3];
66 params.gamma.value = p[4];
67 }
68
69
77
79
81 {
82 p[0] = params.theta.value;
83 p[1] = params.Xmax.value;
84 p[2] = params.theta.value * params.k0.value;
85 p[3] = params.alpha.value;
86 p[4] = params.gamma.value;
87 }
88
89
92
94
96 {
97 f.SetParNames("#theta", "X_{max}", "X_{min}", "#alpha", "#gamma");
98 }
99
100
104
106
108 {
109 f.SetParameter(0, params.theta.value = 0.5);
110 f.SetParLimits(0, 0.1, 100.);
111 double xmax = h->GetXaxis()->GetBinUpEdge(h->GetNbinsX());
112 double xmin = xmax / 7.;
113 f.SetParameter(1, params.Xmax.value = xmin * 2);
114 f.SetParLimits(1, xmin, xmax);
115 f.SetParameter(2, params.k0.value = 0);
116 f.SetParLimits(2, 0, xmin);
117 f.SetParameter(3, params.alpha.value = 1);
118 f.SetParLimits(3, 0.1, 5);
119 f.SetParameter(4, params.gamma.value = 1);
120 f.SetParLimits(4, 0.1, 10);
121 }
122
123
124}
125
#define f(i)
winID h TVirtualViewer3D TVirtualGLPainter p
float xmin
float xmax
templateClassImp(THaarMatrixT)
Algebraic relationship between mean value of observable and centrality.
class KVImpactParameters::algebraic_fitting_function::bce_fit_results params
virtual Double_t GetBinUpEdge(Int_t bin) const
TAxis * GetXaxis()
virtual Int_t GetNbinsX() const
TH1 * h
Double_t Power(Double_t x, Double_t y)