Thermal-FIST 1.5
Package for hadron resonance gas model applications
Loading...
Searching...
No Matches
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
13namespace 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 throw std::invalid_argument("CylindricalBlastWaveParametrization: invalid parameter values!");
91 }
92 }
93
95 {
96 return m_R * zeta * m_tau * coshetaperp(zeta) * m_R;
97 }
98
101 m_RoverTauH(RoverTauH),
102 m_tauH(tauH)
103 {
104 if (tauH <= 0. || RoverTauH <= 0.) {
105 throw std::invalid_argument("CracowFreezeoutParametrization: invalid parameter values!");
106 }
107 }
108
110 {
111 return Rmax() * zeta * m_tauH * Rmax();
112 }
113
114} // namespace thermalfist
virtual double sinhetaperp(double zeta) const
virtual double coshetaperp(double zeta) const
virtual double taufunc(double zeta) const
Proper time \tau vs \zeta.
virtual double dRdZeta(double zeta) const
dR/d\zeta
virtual double ComputeProbabilitydMaximum()
Computes and sets the maximum of the \zeta probability density.
virtual double ZetaProbability(double zeta) const
Proportional to probability of having given \zeta value.
virtual double dtaudZeta(double zeta) const
d\tau/d\zeta
virtual double Rfunc(double zeta) const
Transverse radius vs \zeta.
virtual double ZetaProbability(double zeta) const
Proportional to probability of having given \zeta value.
CracowFreezeoutParametrization(double RoverTauH=1., double tauH=10.)
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 \zeta value.
virtual double coshetaperp(double zeta) const
The main namespace where all classes and functions of the Thermal-FIST library reside.
Definition CosmicEoS.h:9