CbmRoot
RapidityFitBlastWave.h
Go to the documentation of this file.
1 #ifndef RAPIDITYFIT_H
2 #define RAPIDITYFIT_H
3 
4 #include <cmath>
5 #include <string>
6 #include <vector>
7 
9  bool toFit;
10  double value;
11  double error;
12  double xmin, xmax;
13  std::string name;
14  RapidityFitBlastWaveParameter(std::string name_ = "",
15  bool toFit_ = true,
16  double val = 1.,
17  double err = 0.,
18  double vmin = -2.,
19  double vmax = 2.)
20  : toFit(toFit_)
21  , value(val)
22  , error(err)
23  , xmin(vmin)
24  , xmax(vmax)
25  , name(name_) {}
26 };
27 
30  double chi2ndf;
31  RapidityFitBlastWaveParameters(double A_ = 200., double eta_ = 0.3)
32  : A(RapidityFitBlastWaveParameter("A", true, A_, 1000., 0., 200000.))
33  , eta(RapidityFitBlastWaveParameter("eta", true, eta_, 0.2, 0., 10.))
34  , chi2ndf(1.) {
35  // A = RapidityFitBlastWaveParameter("A", true, A_, 1000., 0., 200000.);
36  // eta = RapidityFitBlastWaveParameter("eta", true, eta_, 0.2, 0., 10.);
37  }
38  RapidityFitBlastWaveParameter GetParamater(const std::string& name) const {
39  if (A.name == name) return A;
40  if (eta.name == name) return eta;
42  }
43  void SetParameter(const std::string& name,
44  const RapidityFitBlastWaveParameter& param) {
45  if (A.name == name) A = param;
46  if (eta.name == name) eta = param;
47  }
48  void SetParameter(const std::string& name,
49  double val,
50  double err,
51  double xmin,
52  double xmax) {
53  if (A.name == name)
54  A = RapidityFitBlastWaveParameter(name, true, val, err, xmin, xmax);
55  if (eta.name == name)
56  eta = RapidityFitBlastWaveParameter(name, true, val, err, xmin, xmax);
57  }
58  void SetParameterFitFlag(const std::string& name, bool toFit) {
59  if (A.name == name) A.toFit = toFit;
60  if (eta.name == name) eta.toFit = toFit;
61  }
62 };
63 
65  double dndy(double y, double A, double eta, double T, double mass);
66 };
67 
69  std::vector<double> y, dndy, err;
71  double fT, fMass;
72 
73 public:
74  RapidityFitBlastWave(const std::vector<double>& y_,
75  const std::vector<double>& dndy_,
76  const std::vector<double>& err_,
77  double T,
78  double mass,
79  double A_ = 200.,
80  double eta_ = 0.3)
81  : y(y_), dndy(dndy_), err(err_), Parameters(A_, eta_), fT(T), fMass(mass) {}
83  void SetFitFlag(const std::string& name, bool flag) {
84  Parameters.SetParameterFitFlag(name, flag);
85  }
86  void SetData(const std::vector<double>& y_,
87  const std::vector<double>& dndy_,
88  const std::vector<double>& err_) {
89  y = y_;
90  dndy = dndy_;
91  err = err_;
92  }
93 
95 };
96 
97 #endif
RapidityFitBlastWaveParameters::A
RapidityFitBlastWaveParameter A
Definition: RapidityFitBlastWave.h:29
RapidityFitBlastWaveParameters::SetParameter
void SetParameter(const std::string &name, const RapidityFitBlastWaveParameter &param)
Definition: RapidityFitBlastWave.h:43
RapidityFitBlastWave::SetData
void SetData(const std::vector< double > &y_, const std::vector< double > &dndy_, const std::vector< double > &err_)
Definition: RapidityFitBlastWave.h:86
RapidityFitBlastWaveParameter::name
std::string name
Definition: RapidityFitBlastWave.h:13
RapidityFitBlastWave::~RapidityFitBlastWave
~RapidityFitBlastWave(void)
Definition: RapidityFitBlastWave.cxx:74
RapidityFitBlastWaveParameter::toFit
bool toFit
Definition: RapidityFitBlastWave.h:9
RapidityFitBlastWave::fT
double fT
Definition: RapidityFitBlastWave.h:71
RapidityFitBlastWaveParameters::GetParamater
RapidityFitBlastWaveParameter GetParamater(const std::string &name) const
Definition: RapidityFitBlastWave.h:38
RapidityFitBlastWaveParameters
Definition: RapidityFitBlastWave.h:28
RapidityFitBlastWaveParameter
Definition: RapidityFitBlastWave.h:8
RapidityFitBlastWave::fMass
double fMass
Definition: RapidityFitBlastWave.h:71
RapidityFitBlastWave::err
std::vector< double > err
Definition: RapidityFitBlastWave.h:69
RapidityFitBlastWaveParameter::value
double value
Definition: RapidityFitBlastWave.h:10
RapidityFitBlastWave::y
std::vector< double > y
Definition: RapidityFitBlastWave.h:69
RapidityFitBlastWave::Parameters
RapidityFitBlastWaveParameters Parameters
Definition: RapidityFitBlastWave.h:70
RapidityFitBlastWaveParameter::RapidityFitBlastWaveParameter
RapidityFitBlastWaveParameter(std::string name_="", bool toFit_=true, double val=1., double err=0., double vmin=-2., double vmax=2.)
Definition: RapidityFitBlastWave.h:14
RapidityFitBlastWaveParameters::chi2ndf
double chi2ndf
Definition: RapidityFitBlastWave.h:30
RapidityFitBlastWave::SetFitFlag
void SetFitFlag(const std::string &name, bool flag)
Definition: RapidityFitBlastWave.h:83
RapidityFitBlastWaveNamespace::dndy
double dndy(double y, double A, double eta, double T, double mass)
Definition: RapidityFitBlastWave.cxx:20
RapidityFitBlastWaveParameter::error
double error
Definition: RapidityFitBlastWave.h:11
RapidityFitBlastWave
Definition: RapidityFitBlastWave.h:68
RapidityFitBlastWaveParameters::eta
RapidityFitBlastWaveParameter eta
Definition: RapidityFitBlastWave.h:29
RapidityFitBlastWaveParameter::xmax
double xmax
Definition: RapidityFitBlastWave.h:12
RapidityFitBlastWaveNamespace
Definition: RapidityFitBlastWave.cxx:19
y
Double_t y
Definition: CbmMvdSensorDigiToHitTask.cxx:68
RapidityFitBlastWaveParameters::SetParameter
void SetParameter(const std::string &name, double val, double err, double xmin, double xmax)
Definition: RapidityFitBlastWave.h:48
RapidityFitBlastWave::PerformFit
RapidityFitBlastWaveParameters PerformFit()
Definition: RapidityFitBlastWave.cxx:76
RapidityFitBlastWave::RapidityFitBlastWave
RapidityFitBlastWave(const std::vector< double > &y_, const std::vector< double > &dndy_, const std::vector< double > &err_, double T, double mass, double A_=200., double eta_=0.3)
Definition: RapidityFitBlastWave.h:74
RapidityFitBlastWaveParameter::xmin
double xmin
Definition: RapidityFitBlastWave.h:12
RapidityFitBlastWaveParameters::RapidityFitBlastWaveParameters
RapidityFitBlastWaveParameters(double A_=200., double eta_=0.3)
Definition: RapidityFitBlastWave.h:31
RapidityFitBlastWave::dndy
std::vector< double > dndy
Definition: RapidityFitBlastWave.h:69
RapidityFitBlastWaveParameters::SetParameterFitFlag
void SetParameterFitFlag(const std::string &name, bool toFit)
Definition: RapidityFitBlastWave.h:58