KaliVeda
Toolkit for HIC analysis
algebraic_fitting_function.h
1 #ifndef ALGEBRAIC_FITTING_FUNCTION_H
2 #define ALGEBRAIC_FITTING_FUNCTION_H
3 
4 #include "ipde_fit_parameter.h"
5 #include <TH1.h>
6 #include "KVNameValueList.h"
7 namespace KVImpactParameters {
33  public:
34  ipde_fit_parameter k0; // minimum of k at c=1
35  ipde_fit_parameter alpha; // power of centrality
36  ipde_fit_parameter gamma; // power of (1-pow(c,alpha))
37  ipde_fit_parameter theta; // the (b-independent) fluctuation width Eqs(1),(2)
38  ipde_fit_parameter kmax; // value of k at b=0 Eq(8)
39  ipde_fit_parameter Xmax; // value of X at b=0
40  double chisquare;
41  double ndf;
42 
43  bce_fit_results() = default;
45  : k0(other.k0), alpha(other.alpha), gamma(other.gamma), theta(other.theta), kmax(other.kmax), Xmax(other.Xmax)
46  {}
48  {
49  if (&other != this) {
50  k0 = (other.k0);
51  alpha = (other.alpha);
52  gamma = (other.gamma);
53  theta = (other.theta);
54  kmax = (other.kmax);
55  Xmax = (other.Xmax);
56  }
57  return *this;
58  }
59  void Print(Option_t* = "") const
60  {
62  std:: cout << " kmax = ";
63  kmax.print();
64  std::cout << " k0 = ";
65  k0.print();
66  std::cout << " alpha = ";
67  alpha.print();
68  std:: cout << " gamma = ";
69  gamma.print();
70  std::cout << " theta = ";
71  theta.print();
72  std::cout << std::endl;
73  }
75  public:
78  algebraic_fitting_function(double alph, double gam, double thet, double Xmi, double Xma);
80  {
83  }
85  {
88  }
90  {
92  params.kmax.value = 1. / params.theta.value;
93  params.k0.value = 0;
94  params.Xmax.value = 1;
95  }
96 
97  int npar() const
98  {
99  return 5;
100  }
101  double k_cb(double cb) const;
102  void fill_params_from_array(double* p);
103  void fill_array_from_params(double* p) const;
104  KVNameValueList get_params() const;
105  double theta() const
106  {
107  return params.theta.value;
108  }
109  void set_par_names(TF1& f) const;
110  void set_initial_parameters(TH1* h, TF1& f);
111  void print_fit_params() const
112  {
113  params.Print();
114  }
115  double meanX(double cb) const
116  {
117  return theta() * k_cb(cb);
118  }
119  double redVar(double) const
120  {
121  return theta();
122  }
123  };
124 
125 }
126 
127 #endif // ALGEBRAIC_FITTING_FUNCTION_H
const char Option_t
Contains fit parameters for algebraic impact parameter dependence.
Algebraic relationship between mean value of observable and centrality.
KVNameValueList get_params() const
Fill list with names and values of parameters.
class KVImpactParameters::algebraic_fitting_function::bce_fit_results param_backup
class KVImpactParameters::algebraic_fitting_function::bce_fit_results params
Handles lists of named parameters with different types, a list of KVNamedParameter objects.