Thermal-FIST  1.3
Package for hadron resonance gas model applications
FreezeoutModels.cpp
Go to the documentation of this file.
1 /*
2  * Thermal-FIST package
3  *
4  * Copyright (c) 2019-2019 Volodymyr Vovchenko
5  *
6  * GNU General Public License (GPLv3 or later)
7  */
9 
10 #include <fstream>
11 #include <iostream>
12 
13 namespace thermalfist {
14 
15  const double BoostInvariantFreezeoutParametrization::dzeta = 0.001;
16 
18  {
19  return Rfunc(zeta) * taufunc(zeta) * (coshetaperp(zeta) * dRdZeta(zeta) - sinhetaperp(zeta) * dtaudZeta(zeta));
20  }
21 
23  {
24  if (!m_ProbabilityMaximumComputed) {
25  m_ProbabilityMaximum = ComputeProbabilitydMaximum();
26  m_ProbabilityMaximumComputed = true;
27  }
28  return m_ProbabilityMaximum;
29  }
30 
32  {
33  // Global ternary search
34  m_ProbabilityMaximum = TernarySearchForIntegrandMaximum(0., 1.);
35 
36  // Look for a possibility that the ternary search has produced a local minimum instead of the global one
37  double tmax = 0., tzetamax = 0.;
38  double dzeta = 0.01;
39  for (double tzeta = 0.; tzeta <= 1. + 1.e9; tzeta += dzeta) {
40  double tprob = ZetaProbability(tzeta);
41  if (tprob > tmax) {
42  tmax = tprob;
43  tzetamax = tzeta;
44  }
45  }
46 
47  if (tmax > m_ProbabilityMaximum) {
48  m_ProbabilityMaximum = TernarySearchForIntegrandMaximum(tzetamax - dzeta, tzetamax + dzeta);
49  }
50 
51  return m_ProbabilityMaximum;
52  }
53 
54  double BoostInvariantFreezeoutParametrization::TernarySearchForIntegrandMaximum(double zetaMin, double zetaMax) const
55  {
56  double eps = 1e-8;
57  double l = zetaMin, r = zetaMax;
58 
59  if (l < 0.)
60  l = 0.;
61  if (r > 1.)
62  r = 1.;
63 
64  double m1 = l + (r - l) / 3.;
65  double m2 = r - (r - l) / 3.;
66  int MAXITERS = 200;
67  int iter = 0;
68  while (fabs(m2 - m1) > eps && iter < MAXITERS) {
69  if (ZetaProbability(m1) < ZetaProbability(m2)) {
70  l = m1;
71  }
72  else {
73  r = m2;
74  }
75  m1 = l + (r - l) / 3.;
76  m2 = r - (r - l) / 3.;
77  iter++;
78  }
79  return ZetaProbability((m1 + m2) / 2.);
80  }
81 
82  CylindricalBlastWaveParametrization::CylindricalBlastWaveParametrization(double betaSurface, double nPower, double tau, double Rmax) :
84  m_BetaS(betaSurface),
85  m_n(nPower),
86  m_tau(tau),
87  m_R(Rmax)
88  {
89  if (tau <= 0. || Rmax <= 0. || m_n < 0. || (m_BetaS < 0. || m_BetaS > 1.)) {
90  std::cerr << "**ERROR** CylindricalBlastWaveParametrization::CylindricalBlastWaveParametrization: invalid parameter values!" << std::endl;
91  exit(1);
92  }
93  }
94 
96  {
97  return m_R * zeta * m_tau * coshetaperp(zeta) * m_R;
98  }
99 
102  m_RoverTauH(RoverTauH),
103  m_tauH(tauH)
104  {
105  if (tauH <= 0. || RoverTauH <= 0.) {
106  std::cerr << "**ERROR** CracowFreezeoutParametrization::CracowFreezeoutParametrization: invalid parameter values!" << std::endl;
107  exit(1);
108  }
109  }
110 
112  {
113  return Rmax() * zeta * m_tauH * Rmax();
114  }
115 
116 } // namespace thermalfist
virtual double taufunc(double zeta) const
Proper time vs .
virtual double coshetaperp(double zeta) const
CylindricalBlastWaveParametrization(double betaSurface=0.5, double nPower=1., double tau=10., double Rmax=6.)
virtual double ZetaProbability(double zeta) const
Proportional to probability of having given value.
virtual double ZetaProbability(double zeta) const
Proportional to probability of having given value.
virtual double dtaudZeta(double zeta) const
d/d
virtual double ComputeProbabilitydMaximum()
Computes and sets the maximum of the probability density.
CracowFreezeoutParametrization(double RoverTauH=1., double tauH=10.)
virtual double ZetaProbability(double zeta) const
Proportional to probability of having given value.
virtual double Rfunc(double zeta) const
Transverse radius vs .
virtual double dRdZeta(double zeta) const
dR/d
Base class implementing a longitudinally boost-invariant azimuthally symmetric freeze-out parametriza...
virtual double sinhetaperp(double zeta) const
virtual double coshetaperp(double zeta) const
The main namespace where all classes and functions of the Thermal-FIST library reside.