23 for (
int i = 0; i < 32; i++) {
24 tmp += m_wlag[i] *
dndp(m_xlag[i] * m_T);
33 double alphap = alpha(p);
36 alphamn = sinh(alpha(p)) / alpha(p);
37 return m_Norm * p * p * exp(-m_Gamma * w(p) / m_T) * ((1. + m_T / m_Gamma / w(p))*alphamn - m_T / m_Gamma / w(p)*cosh(alpha(p)));
41 std::vector<double> x, w;
44 for (
int i = 0; i < 32; i++) {
45 double tpt = x[i] * m_T;
47 double tpz = tmt * sinh(y);
48 double tp = sqrt(tpt*tpt + tpz * tpz);
49 double ten = tmt * cosh(y);
51 double alphap = alpha(tp);
54 alphamn = sinh(alpha(tp)) / alpha(tp);
56 double tadd = w[i] * ten * tpt * exp(-m_Gamma * ten / m_T) * ((1. + m_T / m_Gamma / ten)*alphamn - m_T / m_Gamma / ten * cosh(alpha(tp)));
57 if (tadd != tadd)
break;
60 return m_T * m_Norm / 2. * ret;
64 std::vector<double> x, w;
67 for (
int i = 0; i < 32; i++) {
71 double tpz = tmt * sinh(ty);
72 double tp = sqrt(tpt*tpt + tpz * tpz);
73 double ten = tmt * cosh(ty);
75 double alphap = alpha(tp);
78 alphamn = sinh(alpha(tp)) / alpha(tp);
80 double tadd = w[i] * ten * exp(-m_Gamma * ten / m_T) * ((1. + m_T / m_Gamma / ten)*alphamn - m_T / m_Gamma / ten * cosh(alpha(tp)));
81 if (tadd != tadd)
break;
84 return m_Norm / 2. * ret;
87 double SiemensRasmussenDistribution::PAv()
const {
89 double tmp1 = 0., tmp2 = 0.;
90 for (
int i = 0; i < 32; i++) {
91 double tmp = m_wlag[i] *
dndp(m_xlag[i] * m_T);
92 tmp1 += tmp * m_xlag[i] * m_T;
98 std::vector<double> xy, wy;
100 std::vector<double> xpt, wpt;
102 double tmp1 = 0., tmp2 = 0.;
103 for (
size_t iy = 0; iy < xy.size(); ++iy) {
105 for (
size_t ipt = 0; ipt < xpt.size(); ++ipt) {
106 double tpt = xpt[ipt] * m_T;
107 double tmp = wy[iy] * wpt[ipt] *
d2ndptdy(tpt, ty);
108 if (tmp <= 0. || tmp != tmp)
continue;
110 double tpz = tmt * sinh(ty);
111 double tp = sqrt(tpt*tpt + tpz * tpz);
122 double tpt = pt, ty = y;
124 double tpz = tmt * sinh(ty);
125 double tp = sqrt(tpt*tpt + tpz * tpz);
126 double ten = tmt * cosh(ty);
128 double alphap = alpha(tp);
131 alphamn = sinh(alpha(tp)) / alpha(tp);
133 double ret = m_Norm / 2. * ten * tpt * exp(-m_Gamma * ten / m_T) * ((1. + m_T / m_Gamma / ten)*alphamn - m_T / m_Gamma / ten * cosh(alpha(tp)));
142 if (m_FreezeoutModel != NULL) {
143 delete m_FreezeoutModel;
149 m_Norm = m_NormY = m_NormPt = 1.;
155 for (
size_t i = 0; i < m_xlag.size(); i++) {
156 tmp += m_wlag[i] * dndpt(m_xlag[i] * m_T);
163 m_dndy.add_val(-100., 0.);
164 m_dndyint.clearall();
165 m_dndyint.add_val(-100., 0.);
168 for (
double yy = -4.; yy < 4.; yy += dy) {
170 for (
size_t j = 0; j < m_xlag.size(); j++) {
171 tmp += m_wlag[j] * dndptsingle(m_xlag[j] * m_T, yy) * m_T;
174 m_dndy.add_val(yy, tmp);
175 m_dndyint.add_val(yy + 0.5 * dy, tmp2);
177 m_dndy.add_val(100., 0.);
178 m_dndyint.add_val(100., tmp2);
180 m_NormY = m_Norm = 1. / tmp2;
182 if (m_xlegeta.size() > 1) {
183 m_NormY *= 1. / 2. / m_EtaMax;
184 m_Norm *= 1. / 2. / m_EtaMax;
192 double R = m_FreezeoutModel->Rfunc(zeta);
193 double tau = m_FreezeoutModel->taufunc(zeta);
194 double dRdZeta = m_FreezeoutModel->dRdZeta(zeta);
195 double dTaudZeta = m_FreezeoutModel->dtaudZeta(zeta);
197 double coshetaperp = m_FreezeoutModel->coshetaperp(zeta);
198 double sinhetaperp = m_FreezeoutModel->sinhetaperp(zeta);
206 if (m_xlegeta.size() > 1)
207 return (m_dndyint.f(m_EtaMax + y) - m_dndyint.f(-m_EtaMax + y)) * m_NormY;
209 return m_dndy.f(y) * m_NormY;
216 for (
size_t i = 0; i < m_xlegT.size(); i++) {
217 double tmp = m_wlegT[i] * ZetaIntegrandpT(m_xlegT[i], pt);
218 if (tmp != tmp)
break;
221 return ret * m_NormPt;
229 for (
size_t i = 0; i < m_xlegeta.size(); i++) {
230 for (
size_t j = 0; j < m_xlegT.size(); j++) {
231 double tmp = m_wlegeta[i] * m_wlegT[j] * ZetaIntegrandpTYSingleFireball(m_xlegeta[i], pt, y - m_xlegeta[i]);
236 if (!
m_useacc)
return ret * m_Norm * pt;
242 double R = m_FreezeoutModel->Rfunc(zeta);
243 double tau = m_FreezeoutModel->taufunc(zeta);
244 double dRdZeta = m_FreezeoutModel->dRdZeta(zeta);
245 double dTaudZeta = m_FreezeoutModel->dtaudZeta(zeta);
247 double coshetaperp = m_FreezeoutModel->coshetaperp(zeta);
248 double sinhetaperp = m_FreezeoutModel->sinhetaperp(zeta);
250 return R * tau * (mT * dRdZeta * cosh(y) *
xMath::BesselI0(pt * sinhetaperp / m_T)
251 - pt * dTaudZeta *
xMath::BesselI1(pt * sinhetaperp / m_T)) * exp(-mT * coshetaperp * cosh(y) / m_T);
254 void BoostInvariantMomentumDistribution::Initialize()
270 double BoostInvariantMomentumDistribution::dndysingle(
double y)
const 275 double BoostInvariantMomentumDistribution::dndptsingle(
double pt,
double y)
const 280 for (
size_t j = 0; j < m_xlegT.size(); j++) {
281 double tmp = m_wlegT[j] * ZetaIntegrandpTYSingleFireball(m_xlegT[j], pt, y);
288 double BoostInvariantMomentumDistribution::dndpt(
double pt,
double y)
const 293 for (
size_t i = 0; i < m_xlegeta.size(); i++) {
294 ret += m_wlegeta[i] * dndptsingle(pt, y - m_xlegeta[i]);
297 return ret * m_Norm * pt;
307 void SSHDistribution::Initialize() {
324 m_Norm = m_NormY = m_NormPt = 1.;
341 for (
size_t i = 0; i < m_xlag.size(); i++) {
342 tmp += m_wlag[i] * dndpt(m_xlag[i] * m_T);
349 m_dndy.add_val(-100., 0.);
350 m_dndyint.clearall();
351 m_dndyint.add_val(-100., 0.);
354 for (
double yy = -4.; yy < 4.; yy += dy) {
356 for (
size_t j = 0; j < m_xlag.size(); j++) {
357 tmp += m_wlag[j] * dndptsingle(m_xlag[j] * m_T, yy) * m_T;
360 m_dndy.add_val(yy, tmp);
361 m_dndyint.add_val(yy + 0.5 * dy, tmp2);
363 m_dndy.add_val(100., 0.);
364 m_dndyint.add_val(100., tmp2);
366 m_NormY = m_Norm = 1. / tmp2;
368 if (m_xlegeta.size() > 1) {
369 m_NormY *= 1. / 2. / m_EtaMax;
370 m_Norm *= 1. / 2. / m_EtaMax;
379 if (m_xlegeta.size() > 1)
380 return (m_dndyint.f(m_EtaMax + y) - m_dndyint.f(-m_EtaMax + y)) * m_NormY;
382 return m_dndy.f(y) * m_NormY;
392 for (
size_t i = 0; i < m_xlegT.size(); i++) {
393 double tmp = m_wlegT[i] * m_xlegT[i] * mt *
xMath::BesselI0(pt * sinh(rho(m_xlegT[i])) / m_T) *
xMath::BesselK1(mt * cosh(rho(m_xlegT[i])) / m_T);
394 if (tmp != tmp)
break;
397 return ret * m_NormPt;
404 for (
size_t i = 0; i < m_xlegeta.size(); i++) {
405 for (
size_t j = 0; j < m_xlegT.size(); j++) {
406 double tmp = mt * m_wlegeta[i] * m_wlegT[j] * cosh(y - m_xlegeta[i]) * m_xlegT[j] * exp(-mt * cosh(rho(m_xlegT[j])) * cosh(y - m_xlegeta[i]) / m_T) *
419 for (
size_t j = 0; j < m_xlegT.size(); j++) {
420 double tmp = mt * m_wlegT[j] * cosh(y) * m_xlegT[j] * exp(-mt * cosh(rho(m_xlegT[j])) * cosh(y) / m_T) *
436 for (
size_t i = 0; i < m_xlegeta.size(); i++) {
437 for (
size_t j = 0; j < m_xlegT.size(); j++) {
438 double tmp = mt * m_wlegeta[i] * m_wlegT[j] * cosh(y - m_xlegeta[i]) * m_xlegT[j] * exp(-mt * cosh(rho(m_xlegT[j])) * cosh(y - m_xlegeta[i]) / m_T) *
444 return ret * m_Norm * pt;
447 double SSHDistribution::dndptsingle(
double pt,
double y)
const {
451 for (
size_t j = 0; j < m_xlegT.size(); j++) {
452 double tmp = mt * m_wlegT[j] * cosh(y) * m_xlegT[j] * exp(-mt * cosh(rho(m_xlegT[j])) * cosh(y) / m_T) *
460 double SSHDistribution::MtAv()
const {
462 double tmp1 = 0., tmp2 = 0.;
463 for (
int i = 0; i < 32; i++) {
464 double tmppt = m_xlag[i] * m_T;
466 double tmp = m_wlag[i] * tmppt *
dnmtdmt(tmpmt);
473 std::vector<double> xy, wy;
475 std::vector<double> xpt, wpt;
477 double tmp1 = 0., tmp2 = 0.;
478 for (
size_t iy = 0; iy < xy.size(); ++iy) {
480 for (
size_t ipt = 0; ipt < xpt.size(); ++ipt) {
481 double tpt = xpt[ipt] * m_T;
482 double tmp = wy[iy] * wpt[ipt] *
d2ndptdy(tpt, ty);
483 if (tmp <= 0. || tmp != tmp)
continue;
493 double SSHDistribution::y2Av()
const {
495 double tmp1 = 0., tmp2 = 0.;
497 for (
double yy = 0.; yy < 4.; yy += dy) {
498 double tmp = dndysingle(yy);
499 tmp1 += tmp * yy * yy;
502 return (tmp1 / tmp2 + m_EtaMax * m_EtaMax / 3.);
505 std::vector<double> xy, wy;
507 std::vector<double> xpt, wpt;
509 double tmp1 = 0., tmp2 = 0.;
510 for (
size_t iy = 0; iy < xy.size(); ++iy) {
512 for (
size_t ipt = 0; ipt < xpt.size(); ++ipt) {
513 double tpt = xpt[ipt] * m_T;
514 double tmp = wy[iy] * wpt[ipt] *
d2ndptdy(tpt, ty);
515 if (tmp <= 0. || tmp != tmp)
continue;
517 tmp1 += tmp * ty * ty;
529 for (
size_t i = 0; i < m_xlegeta.size(); i++) {
530 for (
size_t j = 0; j < m_xlegT.size(); j++) {
531 double tmp = mt * m_wlegeta[i] * m_wlegT[j] * cosh(y - m_xlegeta[i]) * m_xlegT[j] * exp(-mt * cosh(rho(m_xlegT[j])) * cosh(y - m_xlegeta[i]) / m_T) *
537 if (!
m_useacc)
return ret * m_Norm * pt;
bool m_Normalized
Whether the distribution has been normalized to unity.
void Normalize()
Normalizes the momentum distribution to unity.
bool m_useacc
Whether the acceptance functions are used.
virtual double dndy(double y, double pt) const
Rapidity distribution at fixed pT.
virtual double dndy(double y) const
Distribution density over the longitudinal rapidity.
virtual double dndysingle(double y, double pt) const
Rapidity distribution of a single fireball at fixed pT.
double getAcceptance(const double &y, const double &pt) const
Binomial acceptance for the given values of y and pt.
void GetCoefsIntegrateLaguerre32(std::vector< double > *x, std::vector< double > *w)
virtual double dndpt(double pt) const
The pT distribution function.
virtual double dndp(double p) const
Distribution density over the absolute value of the 3-momentum.
void Normalize()
Normalizes the momentum distribution to unity.
void GetCoefsIntegrateLegendre40(double a, double b, std::vector< double > *x, std::vector< double > *w)
virtual double dnmtdmt(double mt) const
Transverse mass distribution.
virtual double ZetaIntegrandpT(double zeta, double pt) const
virtual double d2ndptdy(double pt, double y) const
2D distribution density in rapidity and transverse momentum
double BesselI1(double x)
modified Bessel function I_1(x)
Contains some extra mathematical functions used in the code.
double m_ycm
Center-of-mass rapidity for the acceptance function.
virtual double d2ndptdy(double pt, double y) const
2D distribution density in rapidity and transverse momentum
virtual ~BoostInvariantMomentumDistribution()
void GetCoefsIntegrateLegendre32(double a, double b, std::vector< double > *x, std::vector< double > *w)
double BesselK1(double x)
modified Bessel function K_1(x)
virtual double ZetaIntegrandpTYSingleFireball(double zeta, double pt, double y) const
void Normalize()
Normalizes the momentum distribution to unity.
double BesselK0(double x)
modified Bessel function K_0(x)
virtual double dnmtdmt(double mt) const
Transverse mass distribution.
virtual double dndy(double y) const
Distribution density over the longitudinal rapidity.
double m_Mass
Mass of a particle.
virtual double d2ndptdy(double pt, double y) const
2D distribution density in rapidity and transverse momentum
double BesselI0(double x)
modified Bessel function I_0(x)
Acceptance::AcceptanceFunction * m_acc
Pointer to acceptance function.
virtual double dnmtdmt(double mt) const
Transverse mass distribution.
The main namespace where all classes and functions of the Thermal-FIST library reside.