22 ifstream fin(filename.c_str());
26 while (fin >> tmpbr) {
36 fDecays.push_back(decay);
43 for (
unsigned int i = 0;
i < fDecays.size(); ++
i) {
44 sum += fDecays[
i].fBratio;
46 for (
unsigned int i = 0;
i < fDecays.size(); ++
i) {
47 fDecays[
i].fBratio *= 1. / sum;
58 if (fStatistics == 0) {
59 if (
fabs(gammaS - 1.) < 1e-5)
61 *
exp((fB * muB + fS * muS + fC * muQ + dMu - mass) / T) / 2.
67 *
exp((fB * muB + fS * muS + fC * muQ + dMu - mass) / T) / 2.
74 if (mass < 0.) mass = fMass;
79 double tMu = fB * muB + fS * muS + fC * muQ + dMu;
80 double tMass = mass / T;
82 if (tMu > tMass)
return 0.;
84 if (tMass > 70.)
return 0.;
85 for (
int i = 1;
i < 10; ++
i) {
87 *
exp(tMu *
i -
log(pow(gammaS, -fAbsS)) *
i) /
i;
89 if (
i != 1 && cur / ret < eps)
break;
91 if (fStatistics == 1)
Sign *= -1.;
92 if (fStatistics == 0)
break;
106 if (!useWidth || fWidth / fMass < 1e-2) {
108 return CalculateParticleDensity(T, muB, muS, muQ, gammaS, fMass, dMu);
110 return CalculateEnergyDensity(T, muB, muS, muQ, gammaS, fMass, dMu);
112 return CalculateEntropyDensity(T, muB, muS, muQ, gammaS, fMass, dMu);
114 return CalculatePressure(T, muB, muS, muQ, gammaS, fMass, dMu);
118 double a =
max(fThreshold, fMass - 2. * fWidth), b = fMass + 2. * fWidth;
120 if (fWidth / fMass < 1e-1) {
127 double ret1 = 0., ret2 = 0., tmp = 0.;
129 for (
int i = 0;
i < ind;
i++) {
130 tmp = w[
i] * fMass * fWidth *
x[
i]
131 / ((
x[
i] *
x[
i] - fMass * fMass) * (
x[
i] *
x[
i] - fMass * fMass)
132 + fMass * fMass * fWidth * fWidth);
135 dens = CalculateParticleDensity(T, muB, muS, muQ, gammaS,
x[
i], dMu);
137 dens = CalculateEnergyDensity(T, muB, muS, muQ, gammaS,
x[
i], dMu);
139 dens = CalculateEntropyDensity(T, muB, muS, muQ, gammaS,
x[
i], dMu);
141 dens = CalculatePressure(T, muB, muS, muQ, gammaS,
x[
i], dMu);
155 if (fStatistics == 0)
156 return CalculateParticleDensity(T, muB, muS, muQ, gammaS, mass);
158 if (mass < 0.) mass = fMass;
163 double tMu = fB * muB + fS * muS + fC * muQ + dMu;
164 double tMass = mass / T;
170 if (tMu > tMass)
return 0.;
172 for (
int i = 0;
i < 32;
i++) {
173 ret += w[
i] *
x[
i] *
x[
i]
174 / (
exp(
sqrt(
x[
i] *
x[
i] + tMass * tMass) - tMu) * pow(gammaS, -fAbsS)
189 if (fStatistics == 0)
190 return T * CalculateParticleDensity(T, muB, muS, muQ, mass, dMu);
192 if (mass < 0.) mass = fMass;
197 double tMu = fB * muB + fS * muS + fC * muQ + dMu;
198 double tMass = mass / T;
206 if (tMu > tMass)
return 0.;
208 for (
int i = 0;
i < 32;
i++) {
209 double x2 =
x[
i] *
x[
i];
210 double E =
sqrt(
x[
i] *
x[
i] + tMass * tMass);
212 w[
i] * x2 * x2 / (
exp(E - tMu) * pow(gammaS, -fAbsS) + fStatistics) / E;
226 if (fStatistics == 0)
227 return (CalculateEnergyDensity(T, muB, muS, muQ, gammaS, mass, dMu)
228 + CalculatePressure(T, muB, muS, muQ, gammaS, mass, dMu)
229 - (fB * muB + fS * muS + fC * muQ + dMu)
230 * CalculateParticleDensity(T, muB, muS, muQ, gammaS, mass, dMu))
233 if (mass < 0.) mass = fMass;
238 double tMu = fB * muB + fS * muS + fC * muQ + dMu;
239 double tMass = mass / T;
247 if (tMu > tMass)
return 0.;
249 for (
int i = 0;
i < 32;
i++) {
250 double x2 =
x[
i] *
x[
i];
251 double E =
sqrt(
x[
i] *
x[
i] + tMass * tMass);
252 ret += w[
i] * x2 / (
exp(E - tMu) * pow(gammaS, -fAbsS) + fStatistics)
253 * (x2 / 3. / E + E - tMu);
267 if (fStatistics == 0)
271 * CalculateParticleDensity(T, muB, muS, muQ, mass, dMu);
273 if (mass < 0.) mass = fMass;
278 double tMu = fB * muB + fS * muS + fC * muQ + dMu;
279 double tMass = mass / T;
285 if (tMu > tMass)
return 0.;
287 for (
int i = 0;
i < 32;
i++) {
289 double E =
sqrt(
x[
i] *
x[
i] + tMass * tMass);
290 ret += w[
i] *
x[
i] *
x[
i] * E
291 / (
exp(E - tMu) * pow(gammaS, -fAbsS) + fStatistics);