28 bool cmpParticleMass(
const ThermalParticle &a,
const ThermalParticle &b) {
29 return (a.Mass() < b.Mass());
34 bool cmpParticleMassAndPdg(
const ThermalParticle& a,
const ThermalParticle& b) {
35 if (a.Mass() == b.Mass()) {
36 if (abs(a.PdgId()) != abs(b.PdgId()))
37 return abs(a.PdgId()) < abs(b.PdgId());
38 return (a.PdgId() > b.PdgId());
40 return (a.Mass() < b.Mass());
44 bool cmpParticlePDG(
const ThermalParticle &a,
const ThermalParticle &b) {
45 if (abs(a.Charm()) != abs(b.Charm()))
return (abs(a.Charm()) < abs(b.Charm()));
46 if (abs(a.AbsoluteCharm()) != abs(b.AbsoluteCharm()))
return (abs(a.AbsoluteCharm()) < abs(b.AbsoluteCharm()));
47 if (abs(a.BaryonCharge()) != abs(b.BaryonCharge()))
return (abs(a.BaryonCharge()) < abs(b.BaryonCharge()));
48 if (abs(a.Strangeness()) != abs(b.Strangeness()))
return (abs(a.Strangeness()) < abs(b.Strangeness()));
49 if (a.Mass() == b.Mass()) {
50 if (abs(a.PdgId()) != abs(b.PdgId()))
51 return abs(a.PdgId()) < abs(b.PdgId());
52 return (a.PdgId() > b.PdgId());
54 return (a.Mass() < b.Mass());
58 const std::string ThermalParticleSystem::flag_no_antiparticles =
"no_antiparticles";
59 const std::string ThermalParticleSystem::flag_nostrangeness =
"no_strangeness";
60 const std::string ThermalParticleSystem::flag_nocharm =
"no_charm";
61 const std::string ThermalParticleSystem::flag_nonuclei =
"no_nuclei";
62 const std::string ThermalParticleSystem::flag_noexcitednuclei =
"no_excitednuclei";
65 ThermalParticleSystem::ThermalParticleSystem(
const std::vector<std::string>& ListFiles,
const std::vector<std::string>& DecayFiles,
const std::set<std::string>& flags,
double mcut)
67 Initialize(ListFiles, DecayFiles, flags, mcut);
70 ThermalParticleSystem::~ThermalParticleSystem(
void)
76 for (
unsigned int i = 0; i < ret.size(); ++i) {
77 for (
unsigned int j = 0; j < ret[i].mDaughters.size(); ++j) {
78 if (m_PDGtoID.count(-ret[i].mDaughters[j]) > 0) ret[i].mDaughters[j] = -ret[i].mDaughters[j];
84 void ThermalParticleSystem::ProcessDecays()
86 FillResonanceDecays();
87 FillResonanceDecaysByFeeddown();
90 void ThermalParticleSystem::FillDecayProperties()
92 for (
size_t i = 0; i < m_Particles.size(); ++i) {
93 if (m_Particles[i].Decays().size() != 0) {
96 for (
size_t j = 0; j < m_Particles[i].Decays().size(); ++j) {
98 m_Particles[i].Decays()[j].mPole = m_Particles[i].Mass();
100 std::string tname =
"";
104 for (
size_t k = 0; k < m_Particles[i].Decays()[j].mDaughters.size(); ++k) {
105 int tid =
PdgToId(m_Particles[i].Decays()[j].mDaughters[k]);
107 M0 += m_Particles[tid].Mass();
108 tS += max(0., (m_Particles[tid].Degeneracy() - 1.) / 2.);
111 tname += m_Particles[tid].Name();
114 m_Particles[i].Decays()[j].mM0 = M0;
115 m_Particles[i].Decays()[j].mL = abs(max(0., (m_Particles[i].Degeneracy() - 1.) / 2.) - tS);
117 tsumb += m_Particles[i].Decays()[j].mBratio;
118 m_Particles[i].Decays()[j].mBratioAverage = m_Particles[i].Decays()[j].mBratio;
120 if (tname.size() > 0)
121 m_Particles[i].Decays()[j].mChannelName = tname;
124 m_Particles[i].CalculateAndSetDynamicalThreshold();
125 m_Particles[i].FillCoefficientsDynamical();
129 void ThermalParticleSystem::FillDecayThresholds()
131 for (
size_t i = 0; i < m_Particles.size(); ++i) {
132 if (m_Particles[i].Decays().size() != 0) {
133 for (
size_t j = 0; j < m_Particles[i].Decays().size(); ++j) {
135 for (
size_t k = 0; k < m_Particles[i].Decays()[j].mDaughters.size(); ++k) {
136 if (
PdgToId(m_Particles[i].Decays()[j].mDaughters[k]) != -1)
137 M0 += m_Particles[
PdgToId(m_Particles[i].Decays()[j].mDaughters[k])].Mass();
139 m_Particles[i].Decays()[j].mM0 = M0;
141 m_Particles[i].FillCoefficients();
146 void ThermalParticleSystem::FillResonanceDecays() {
147 m_DecayContributionsByFeeddown[Feeddown::StabilityFlag].resize(m_Particles.size());
148 m_DecayCumulants.resize(m_Particles.size());
149 m_DecayProbabilities.resize(m_Particles.size());
150 for (
size_t i = 0; i < m_Particles.size(); ++i) {
151 m_DecayContributionsByFeeddown[Feeddown::StabilityFlag][i].resize(0);
152 m_DecayProbabilities[i].resize(0);
153 m_DecayCumulants[i].resize(0);
155 for (
int i = static_cast<int>(m_Particles.size()) - 1; i >= 0; i--)
156 if (!m_Particles[i].IsStable()) {
157 GoResonance(i, i, 1.);
160 for (
size_t i = 0; i < m_Particles.size(); ++i) {
161 for (
size_t j = 0; j < m_DecayContributionsByFeeddown[Feeddown::StabilityFlag][i].size(); ++j) {
163 vector<double> tmp = GoResonanceDecayProbs(DecayContrib.second, i,
true);
164 if (tmp.size() > 1) m_DecayProbabilities[i].push_back(make_pair(tmp, DecayContrib.second));
166 for (
size_t j = 0; j < m_DecayProbabilities[i].size(); ++j) {
167 double tmp = 0., tmp2 = 0., tmp3 = 0., tmp4 = 0.;
168 for (
int jj = 0; jj < static_cast<int>(m_DecayProbabilities[i][j].first.size()); ++jj) {
169 tmp += m_DecayProbabilities[i][j].first[jj] * jj;
170 tmp2 += m_DecayProbabilities[i][j].first[jj] * jj * jj;
171 tmp3 += m_DecayProbabilities[i][j].first[jj] * jj * jj * jj;
172 tmp4 += m_DecayProbabilities[i][j].first[jj] * jj * jj * jj * jj;
174 double n2 = 0., n3 = 0., n4 = 0.;
175 n2 = tmp2 - tmp * tmp;
176 n3 = tmp3 - 3. * tmp2 * tmp + 2. * tmp * tmp * tmp;
177 n4 = tmp4 - 4. * tmp3 * tmp + 6. * tmp2 * tmp * tmp - 3. * tmp * tmp * tmp * tmp - 3. * n2 * n2;
178 vector<double> moments(0);
179 moments.push_back(tmp);
180 moments.push_back(n2);
181 moments.push_back(n3);
182 moments.push_back(n4);
183 m_DecayCumulants[i].push_back(make_pair(moments, m_DecayProbabilities[i][j].second));
187 m_DecayDistributionsMap.resize(m_Particles.size());
188 m_ResonanceFinalStatesDistributions.resize(m_Particles.size());
189 for (
size_t i = 0; i < m_Particles.size(); ++i) {
190 m_ResonanceFinalStatesDistributions[i].resize(0);
191 m_DecayDistributionsMap[i].resize(0);
193 for (
size_t i = 0; i < m_Particles.size(); ++i) {
194 m_ResonanceFinalStatesDistributions[i] = GoResonanceDecayDistributions(i,
true);
197 std::vector< std::vector< std::pair<double, std::vector<int> > > >().swap(m_DecayDistributionsMap);
199 for (
size_t i = 0; i < m_Particles.size(); ++i) {
200 vector<int> nchtyp(0);
203 nchtyp.push_back(-1);
205 m_Particles[i].Nch().resize(0);
206 m_Particles[i].DeltaNch().resize(0);
208 for (
int nti = 0; nti < 3; nti++) {
209 vector<double> prob = GoResonanceDecayProbsCharge(i, nchtyp[nti],
true);
210 double tmp = 0., tmp2 = 0., tmp3 = 0., tmp4 = 0.;
211 for (
int jj = 0; jj < static_cast<int>(prob.size()); ++jj) {
212 tmp += prob[jj] * jj;
213 tmp2 += prob[jj] * jj * jj;
214 tmp3 += prob[jj] * jj * jj * jj;
215 tmp4 += prob[jj] * jj * jj * jj * jj;
217 double n2 = 0., n3 = 0., n4 = 0.;
218 n2 = tmp2 - tmp * tmp;
219 n3 = tmp3 - 3. * tmp2 * tmp + 2. * tmp * tmp * tmp;
220 n4 = tmp4 - 4. * tmp3 * tmp + 6. * tmp2 * tmp * tmp - 3. * tmp * tmp * tmp * tmp - 3. * n2 * n2;
221 m_Particles[i].Nch().push_back(tmp);
222 m_Particles[i].DeltaNch().push_back(n2);
229 void ThermalParticleSystem::GoResonance(
int ind,
int startind,
double BR) {
231 if (ind != startind && DecayContrib.size() > 0 && DecayContrib[DecayContrib.size() - 1].second == startind)
233 DecayContrib[DecayContrib.size() - 1].first += BR;
235 else if (ind != startind)
236 DecayContrib.push_back(make_pair(BR, startind));
238 if (!m_Particles[ind].IsStable()) {
239 for (
size_t i = 0; i < m_Particles[ind].Decays().size(); ++i) {
241 double tbr = decaychannel.
mBratio;
243 if (m_ResonanceWidthIntegrationType == ThermalParticle::eBW && ind == startind)
246 for (
size_t j = 0; j < decaychannel.
mDaughters.size(); ++j) {
247 if (m_PDGtoID.count(decaychannel.
mDaughters[j]) != 0)
248 GoResonance(m_PDGtoID[decaychannel.
mDaughters[j]], startind, BR*tbr);
254 std::vector<double> ThermalParticleSystem::GoResonanceDecayProbs(
int ind,
int goalind,
bool firstdecay) {
255 std::vector<double> ret(1, 0.);
256 if (m_Particles[ind].IsStable()) {
257 if (ind == goalind) ret.push_back(1.);
261 else if (ind == goalind) {
268 for (
size_t i = 0; i < m_Particles[ind].Decays().size(); ++i) {
269 double tbr = m_Particles[ind].Decays()[i].mBratio;
270 if (m_ResonanceWidthIntegrationType == ThermalParticle::eBW && firstdecay)
271 tbr = m_Particles[ind].Decays()[i].mBratioAverage;
275 for (
size_t j = 0; j < m_Particles[ind].Decays()[i].mDaughters.size(); ++j) {
276 if (m_PDGtoID.count(m_Particles[ind].Decays()[i].mDaughters[j]) != 0) {
277 vector<double> tmp = GoResonanceDecayProbs(m_PDGtoID[m_Particles[ind].Decays()[i].mDaughters[j]], goalind);
278 vector<double> tmp2(tret.size() + tmp.size() - 1, 0.);
279 for (
size_t i1 = 0; i1 < tret.size(); ++i1)
280 for (
size_t i2 = 0; i2 < tmp.size(); ++i2)
281 tmp2[i1 + i2] += tret[i1] * tmp[i2];
285 if (ret.size() < tret.size()) ret.resize(tret.size(), 0.);
286 for (
size_t j = 0; j < tret.size(); ++j)
287 ret[j] += tbr * tret[j];
290 for (
size_t i = 0; i < ret.size(); ++i)
293 for (
size_t i = 0; i < ret.size(); ++i)
294 ret[i] *= 1. / totprob;
297 ret[0] += 1. - totprob;
304 std::vector<double> ThermalParticleSystem::GoResonanceDecayProbsCharge(
int ind,
int nch,
bool firstdecay)
307 int tQ = m_Particles[ind].ElectricCharge();
308 if (nch == 0 && tQ != 0)
310 if (nch == 1 && tQ > 0)
312 if (nch == -1 && tQ < 0)
315 std::vector<double> ret(1, 0.);
316 if (m_Particles[ind].IsStable()) {
317 if (fl) ret.push_back(1.);
324 for (
size_t i = 0; i < m_Particles[ind].Decays().size(); ++i) {
325 double tbr = m_Particles[ind].Decays()[i].mBratio;
326 if (m_ResonanceWidthIntegrationType == ThermalParticle::eBW && firstdecay)
327 tbr = m_Particles[ind].Decays()[i].mBratioAverage;
331 for (
size_t j = 0; j < m_Particles[ind].Decays()[i].mDaughters.size(); ++j) {
332 if (m_PDGtoID.count(m_Particles[ind].Decays()[i].mDaughters[j]) != 0) {
333 vector<double> tmp = GoResonanceDecayProbsCharge(m_PDGtoID[m_Particles[ind].Decays()[i].mDaughters[j]], nch);
334 vector<double> tmp2(tret.size() + tmp.size() - 1, 0.);
335 for (
size_t i1 = 0; i1 < tret.size(); ++i1)
336 for (
size_t i2 = 0; i2 < tmp.size(); ++i2)
337 tmp2[i1 + i2] += tret[i1] * tmp[i2];
341 if (ret.size() < tret.size())
342 ret.resize(tret.size(), 0.);
343 for (
size_t j = 0; j < tret.size(); ++j)
344 ret[j] += tbr * tret[j];
347 for (
size_t i = 0; i < ret.size(); ++i)
350 for (
size_t i = 0; i < ret.size(); ++i)
351 ret[i] *= 1. / totprob;
354 ret[0] += 1. - totprob;
363 if (!firstdecay && m_DecayDistributionsMap[ind].size() != 0)
364 return m_DecayDistributionsMap[ind];
367 std::vector< std::pair<double, std::vector<int> > > retorig(1);
368 retorig[0].first = 1.;
369 retorig[0].second = std::vector<int>(m_Particles.size(), 0);
370 retorig[0].second[ind] = 1;
372 std::vector< std::pair<double, std::vector<int> > > ret(0);
377 m_ResonanceFinalStatesDistributions[ind] = retorig;
381 for (
size_t i = 0; i < tpart.
Decays().size(); ++i) {
382 double tbr = tpart.
Decays()[i].mBratio;
383 if (m_ResonanceWidthIntegrationType == ThermalParticle::eBW && firstdecay)
384 tbr = m_Particles[ind].Decays()[i].mBratioAverage;
386 std::vector< std::pair<double, std::vector<int> > > tret = retorig;
388 for (
size_t j = 0; j < tpart.
Decays()[i].mDaughters.size(); ++j) {
389 if (m_PDGtoID.count(tpart.
Decays()[i].mDaughters[j]) != 0) {
391 std::vector< std::pair<double, std::vector<int> > > tmp = GoResonanceDecayDistributions(m_PDGtoID[tpart.
Decays()[i].mDaughters[j]]);
392 std::vector< std::pair<double, std::vector<int> > > tmp2(tret.size() * tmp.size());
393 for (
int i1 = 0; i1 < static_cast<int>(tret.size()); ++i1) {
394 for (
int i2 = 0; i2 < static_cast<int>(tmp.size()); ++i2) {
395 tmp2[i1*tmp.size() + i2].first = tret[i1].first * tmp[i2].first;
396 tmp2[i1*tmp.size() + i2].second.resize(m_Particles.size());
397 for (
size_t jj = 0; jj < tmp2[i1*tmp.size() + i2].second.size(); ++jj)
398 tmp2[i1*tmp.size() + i2].second[jj] = tret[i1].second[jj] + tmp[i2].second[jj];
404 if (tret.size() > 1500) {
405 printf(
"**WARNING** %s (%lld) Decay Distributions: Too large array, cutting the number of channels to 1500!\n",
406 m_Particles[ind].Name().c_str(),
407 m_Particles[ind].PdgId());
413 for (
size_t j = 0; j < tret.size(); ++j) {
414 tret[j].first *= tbr;
415 ret.push_back(tret[j]);
420 if (ret.size() > 1500) {
421 printf(
"**WARNING** %s (%lld) Decay Distributions: Too large array, cutting the number of channels to 1500!\n",
422 m_Particles[ind].Name().c_str(),
423 m_Particles[ind].PdgId());
428 for (
size_t i = 0; i < ret.size(); ++i)
429 totprob += ret[i].first;
431 for (
size_t i = 0; i < ret.size(); ++i)
432 ret[i].first *= 1. / totprob;
434 else if (totprob < 1.) {
435 double emptyprob = 1. - totprob;
436 ret.push_back(std::make_pair(emptyprob, retorig[0].second));
440 m_DecayDistributionsMap[ind] = ret;
466 bool ThermalParticleSystem::AcceptParticle(
const ThermalParticle& part,
const std::set<std::string>& flags,
double mcut)
const 468 if (mcut >= 0. && part.
Mass() > mcut)
470 if (flags.count(ThermalParticleSystem::flag_nostrangeness) > 0 && part.
AbsoluteStrangeness() != 0)
472 if (flags.count(ThermalParticleSystem::flag_nocharm) > 0 && part.
AbsoluteCharm() != 0)
474 if (flags.count(ThermalParticleSystem::flag_nonuclei) > 0 && abs(part.
BaryonCharge() > 1))
476 if (flags.count(ThermalParticleSystem::flag_noexcitednuclei) > 0 && abs(part.
BaryonCharge() > 1) && !part.
IsStable())
481 void ThermalParticleSystem::LoadList(
const std::vector<std::string>& ListFiles,
const std::vector<std::string>& DecayFiles,
const std::set<std::string>& flags,
double mcut)
483 m_NumberOfParticles = 0;
484 m_Particles.resize(0);
487 m_NumBaryons = m_NumCharged = m_NumStrange = m_NumCharmed = 0;
489 for(
int i = 0; i < ListFiles.size(); ++i)
490 AddParticlesToListFromFile(ListFiles[i], flags, mcut);
494 std::vector<std::string> tDecayFiles = DecayFiles;
495 if (tDecayFiles.size() == 1 && tDecayFiles[0] ==
"")
498 if (tDecayFiles.size() == 0 && ListFiles.size() > 0) {
499 for (
size_t ilist = 0; ilist < ListFiles.size(); ++ilist) {
500 string decayprefix =
"";
501 string decayprefixfile =
"";
503 for (
int i = ListFiles[ilist].size() - 1; i >= 0; --i) {
504 if (ListFiles[ilist][i] ==
'\\' || ListFiles[ilist][i] ==
'/')
506 decayprefix = ListFiles[ilist].substr(0, i + 1);
509 decayprefixfile += ListFiles[ilist][i];
512 reverse(decayprefixfile.begin(), decayprefixfile.end());
515 string DecayFile =
"";
516 if (decayprefixfile.substr(0, 4) ==
"list") {
517 DecayFile = decayprefix +
"decays" + decayprefixfile.substr(4);
520 DecayFile = decayprefix +
"decays.dat";
524 tDecayFiles.push_back(decayprefix +
"decays.dat");
526 tDecayFiles.push_back(DecayFile);
530 LoadDecays(tDecayFiles, flags);
532 SetResonanceWidthShape(m_ResonanceWidthShape);
533 SetResonanceWidthIntegrationType(m_ResonanceWidthIntegrationType);
534 SetCalculationType(m_QStatsCalculationType);
536 CheckDecayChannelsAreSpecified();
539 void ThermalParticleSystem::LoadList(
const std::string& InputFile,
const std::string& DecayFile,
bool GenAntiP,
double mcut) {
541 std::set<std::string> flags;
543 flags.insert(ThermalParticleSystem::flag_no_antiparticles);
545 std::vector<std::string> DecayFiles(0);
547 DecayFiles.push_back(DecayFile);
549 LoadList(std::vector<std::string>(1, InputFile), DecayFiles, flags, mcut);
552 void ThermalParticleSystem::AddParticlesToListFromFile(
const std::string& InputFile,
const std::set<std::string>& flags,
double mcut)
555 fin.open(InputFile.c_str());
559 fin.getline(tmpc, 2000);
560 string tmp = string(tmpc);
570 fin.seekg(0, ios::beg);
573 LoadTable_NewFormat(fin, flags, mcut);
575 LoadTable_OldFormat(fin, flags, mcut);
582 void ThermalParticleSystem::LoadTable_OldFormat(std::ifstream & fin,
const std::set<std::string>& flags,
double mcut)
584 bool GenerateAntiParticles = (flags.count(ThermalParticleSystem::flag_no_antiparticles) == 0);
588 fin.getline(tmpc, 500);
592 if (fields.size() < 14)
break;
593 int stable, spin, stat, str, bary, chg, charm;
595 double mass, width, threshold, abss, absc, radius = 0.5;
596 string name, decayname =
"";
597 stable = atoi(fields[0].c_str());
601 spin = atoi(fields[3].c_str());
602 stat = atoi(fields[4].c_str());
603 mass = atof(fields[5].c_str());
604 str = atoi(fields[6].c_str());
605 bary = atoi(fields[7].c_str());
606 chg = atoi(fields[8].c_str());
607 charm = atoi(fields[9].c_str());
608 abss = atof(fields[10].c_str());
609 absc = atof(fields[11].c_str());
610 width = atof(fields[12].c_str());
611 threshold = atof(fields[13].c_str());
612 if (fields.size() >= 15) radius = atof(fields[14].c_str());
613 if (fields.size() == 16) decayname = fields[15];
615 ThermalParticle part_candidate =
ThermalParticle(static_cast<bool>(stable), name, pdgid, static_cast<double>(spin), stat, mass, str, bary, chg, abss, width, threshold, charm, absc);
618 if (!AcceptParticle(part_candidate, flags, mcut) || m_PDGtoID.count(pdgid) != 0) {
619 fin.getline(tmpc, 500);
624 if (bary != 0) m_NumBaryons++;
625 if (chg != 0) m_NumCharged++;
626 if (str != 0) m_NumStrange++;
627 if (charm != 0) m_NumCharmed++;
629 m_Particles.push_back(part_candidate);
630 m_PDGtoID[pdgid] = m_Particles.size() - 1;
631 m_NumberOfParticles++;
633 if (GenerateAntiParticles && !(bary == 0 && chg == 0 && str == 0 && charm == 0) && (m_PDGtoID.count(-pdgid) == 0)) {
635 if (bary != 0) m_NumBaryons++;
636 if (chg != 0) m_NumCharged++;
637 if (str != 0) m_NumStrange++;
638 if (charm != 0) m_NumCharmed++;
640 if (bary == 0 && name[name.size() - 1] ==
'+')
641 name[name.size() - 1] =
'-';
642 else if (bary == 0 && name[name.size() - 1] ==
'-')
643 name[name.size() - 1] =
'+';
645 name =
"anti-" + name;
646 m_Particles.push_back(
ThermalParticle(static_cast<bool>(stable), name, -pdgid, static_cast<double>(spin), stat, mass, -str, -bary, -chg, abss, width, threshold, -charm, absc));
647 m_Particles[m_Particles.size() - 1].SetAntiParticle(
true);
648 m_PDGtoID[-pdgid] = m_Particles.size() - 1;
651 fin.getline(tmpc, 500);
657 void ThermalParticleSystem::LoadTable_NewFormat(std::ifstream & fin,
const std::set<std::string>& flags,
double mcut)
659 bool GenerateAntiParticles = (flags.count(ThermalParticleSystem::flag_no_antiparticles) == 0);
663 fin.getline(cc, 2000);
664 string tmp = string(cc);
666 if (elems.size() < 1 || elems[0].size() == 0)
669 istringstream iss(elems[0]);
671 int stable, stat, str, bary, chg, charm;
673 double mass, degeneracy, width, threshold, abss, absc;
691 ThermalParticle part_candidate =
ThermalParticle((
bool)stable, name, pdgid, degeneracy, stat, mass, str, bary, chg, abss, width, threshold, charm, absc);
694 if (!AcceptParticle(part_candidate, flags, mcut) || m_PDGtoID.count(pdgid) != 0)
697 if (bary != 0) m_NumBaryons++;
698 if (chg != 0) m_NumCharged++;
699 if (str != 0) m_NumStrange++;
700 if (charm != 0) m_NumCharmed++;
702 m_Particles.push_back(part_candidate);
703 m_PDGtoID[pdgid] = m_Particles.size() - 1;
704 m_NumberOfParticles++;
706 if (GenerateAntiParticles && !(bary == 0 && chg == 0 && str == 0 && charm == 0) && (m_PDGtoID.count(-pdgid) == 0)) {
708 if (bary != 0) m_NumBaryons++;
709 if (chg != 0) m_NumCharged++;
710 if (str != 0) m_NumStrange++;
711 if (charm != 0) m_NumCharmed++;
713 if (bary == 0 && name[name.size() - 1] ==
'+')
714 name[name.size() - 1] =
'-';
715 else if (bary == 0 && name[name.size() - 1] ==
'-')
716 name[name.size() - 1] =
'+';
718 name =
"anti-" + name;
719 m_Particles.push_back(
ThermalParticle((
bool)stable, name, -pdgid, degeneracy, stat, mass, -str, -bary, -chg, abss, width, threshold, -charm, absc));
720 m_Particles[m_Particles.size() - 1].SetAntiParticle(
true);
721 m_PDGtoID[pdgid] = m_Particles.size() - 1;
728 void ThermalParticleSystem::SetTableFromVector(
const std::vector<ThermalParticle>& part_in,
bool GenerateAntiParticles)
730 m_Particles.resize(0);
732 for (
size_t i = 0; i < part_in.size(); ++i) {
734 if (!GenerateAntiParticles) {
735 m_Particles.push_back(part);
737 else if (part.
PdgId() > 0) {
738 m_Particles.push_back(part);
748 if (GenerateAntiParticles) {
749 for (
size_t i = 0; i < m_Particles.size(); ++i) {
750 if (m_Particles[i].IsAntiParticle() &&
PdgToId(-m_Particles[i].PdgId()) != -1) {
751 m_Particles[i].SetDecays(GetDecaysFromAntiParticle(m_Particles[
PdgToId(-m_Particles[i].PdgId())].Decays()));
756 FillDecayProperties();
757 FillDecayThresholds();
761 void ThermalParticleSystem::WriteTableToFile(
const std::string& OutputFile,
bool WriteAntiParticles)
763 std::ofstream fout(OutputFile.c_str());
764 if (fout.is_open()) {
766 << std::setw(14) <<
"pdgid" 767 << std::setw(20) <<
"name" 768 << std::setw(15) <<
"stable" 769 << std::setw(15) <<
"mass[GeV]" 770 << std::setw(15) <<
"degeneracy" 771 << std::setw(15) <<
"statistics" 772 << std::setw(15) <<
"B" 773 << std::setw(15) <<
"Q" 774 << std::setw(15) <<
"S" 775 << std::setw(15) <<
"C" 776 << std::setw(15) <<
"|S|" 777 << std::setw(15) <<
"|C|" 778 << std::setw(15) <<
"width[GeV]" 779 << std::setw(15) <<
"threshold[GeV]" 782 for (
size_t i = 0; i < m_Particles.size(); ++i) {
784 if (part.
PdgId() < 0 && !WriteAntiParticles)
787 fout << std::setw(15) << part.
PdgId()
788 << std::setw(20) << part.
Name()
789 << std::setw(15) <<
static_cast<int>(part.
IsStable())
790 << std::setw(15) << part.
Mass()
796 << std::setw(15) << part.
Charm()
807 void ThermalParticleSystem::LoadDecays(
const std::vector<std::string>& DecayFiles,
const std::set<std::string>& flags)
809 for (
size_t i = 0; i < m_Particles.size(); ++i)
810 m_Particles[i].ClearDecays();
812 for (
size_t i = 0; i < DecayFiles.size(); ++i) {
813 ifstream fin(DecayFiles[i].c_str());
818 fin.getline(tmpc, 2000);
819 string tmp = string(tmpc);
823 if (tmp.size() == 0 || elems.size() >= 2)
829 fin.seekg(0, ios::beg);
832 ReadDecays_NewFormat(fin);
834 ReadDecays_OldFormat(fin);
842 if (flags.count(ThermalParticleSystem::flag_no_antiparticles) == 0) {
843 for (
size_t i = 0; i < m_Particles.size(); ++i) {
844 if (m_Particles[i].PdgId() < 0)
845 m_Particles[i].SetDecays(GetDecaysFromAntiParticle(m_Particles[m_PDGtoID[-m_Particles[i].PdgId()]].Decays()));
849 for (
size_t i = 0; i < m_Particles.size(); ++i)
850 m_Particles[i].SetDecaysOriginal(m_Particles[i].Decays());
852 FillDecayProperties();
853 FillDecayThresholds();
857 void ThermalParticleSystem::LoadDecays(
const std::string& DecaysFile,
bool GenerateAntiParticles)
859 std::set<std::string> flags;
860 if (!GenerateAntiParticles)
861 flags.insert(ThermalParticleSystem::flag_no_antiparticles);
863 LoadDecays(vector<string>(1, DecaysFile), flags);
866 void ThermalParticleSystem::ReadDecays_NewFormat(std::ifstream & fin)
868 vector< ThermalParticle::ParticleDecaysVector > decays(0);
869 map<long long, int> decaymap;
877 fin.getline(cc, 2000);
878 string tmp = string(cc);
880 if (elems.size() < 1 || elems[0].size() == 0)
883 int tdecaysnumber = 0;
884 long long tpdgid = 0;
887 istringstream iss(elems[0]);
888 if (!(iss >> tpdgid))
continue;
893 if (fin.eof())
break;
894 fin.getline(cc, 500);
897 if (elems.size() < 1 || elems[0].size() == 0)
900 istringstream isstnum(elems[0]);
901 if (!(isstnum >> tdecaysnumber)) {
909 for (
int i = 0; i < tdecaysnumber; ++i) {
912 if (fin.eof())
break;
913 fin.getline(cc, 500);
916 if (elems.size() < 1 || elems[0].size() == 0)
920 istringstream issdec(elems[0]);
921 if (!(issdec >> tdecay.
mBratio))
continue;
923 while (issdec >> tmpid) {
926 tdecays.push_back(tdecay);
931 if (static_cast<int>(tdecays.size()) == tdecaysnumber && static_cast<int>(tdecays.size()) != 0) {
932 decays.push_back(tdecays);
933 decaymap[tpdgid] = index;
938 for (
size_t i = 0; i < m_Particles.size(); ++i) {
939 if (decaymap.count(m_Particles[i].PdgId()) != 0)
940 m_Particles[i].SetDecays(decays[decaymap[m_Particles[i].PdgId()]]);
945 void ThermalParticleSystem::Initialize(
const std::vector<std::string>& ListFiles,
const std::vector<std::string>& DecayFiles,
const std::set<std::string>& flags,
double mcut)
947 if (!Disclaimer::DisclaimerPrinted)
948 Disclaimer::DisclaimerPrinted = Disclaimer::PrintDisclaimer();
950 m_NumberOfParticles = 0;
951 m_Particles.resize(0);
954 m_SortMode = ThermalParticleSystem::SortByMass;
956 m_DecayContributionsByFeeddown.resize(Feeddown::NumberOfTypes);
958 SetResonanceWidthShape(ThermalParticle::RelativisticBreitWigner);
959 SetResonanceWidthIntegrationType(ThermalParticle::ZeroWidth);
962 LoadList(ListFiles, DecayFiles, flags, mcut);
965 void ThermalParticleSystem::Initialize(
const std::string& InputFile,
const std::string& DecayFile,
bool GenAntiP,
double mcut)
967 std::set<std::string> flags;
969 flags.insert(ThermalParticleSystem::flag_no_antiparticles);
970 Initialize(vector<string>(1, InputFile), vector<string>(1, DecayFile), flags, mcut);
973 void ThermalParticleSystem::WriteDecaysToFile(
const std::string& OutputFile,
bool WriteAntiParticles)
975 std::ofstream fout(OutputFile.c_str());
976 if (fout.is_open()) {
977 fout <<
"# the list of decays" << std::endl;
978 fout <<
"# each entry consists of the following:" << std::endl;
979 fout <<
"# a line with the pdgid of decaying particle" << std::endl;
980 fout <<
"# a line with the number of decay channels" << std::endl;
981 fout <<
"# for each channel a line containing whitespace-separated values of the channel branching ratio and pdg ids of the daughter products" << std::endl;
982 fout <<
"# everything after the # symbol is treated as a comment and ignored" << std::endl;
983 fout <<
"# decays of antiparticles are not listed but generated from the listed decays of particles" << std::endl;
986 for (
unsigned int i = 0; i < m_Particles.size(); ++i) {
987 if ((m_Particles[i].PdgId()>0 || WriteAntiParticles) && m_Particles[i].Decays().size()>0) {
988 fout << std::left << std::setw(36) << m_Particles[i].PdgId();
989 fout <<
" # " << m_Particles[i].Name() << std::endl;
991 fout << std::left << std::setw(36) << m_Particles[i].Decays().size();
992 fout <<
" # " << m_Particles[i].Decays().size() <<
" decay channel";
993 if (m_Particles[i].Decays().size() % 10 != 1 || m_Particles[i].Decays().size() % 100 == 11) fout <<
"s";
996 for (
unsigned int j = 0; j < m_Particles[i].Decays().size(); ++j) {
997 fout << std::left << std::setw(15) << m_Particles[i].Decays()[j].mBratio <<
" ";
998 std::ostringstream oss;
999 for (
unsigned int k = 0; k < m_Particles[i].Decays()[j].mDaughters.size(); ++k) {
1000 oss << m_Particles[i].Decays()[j].mDaughters[k];
1001 if (k != m_Particles[i].Decays()[j].mDaughters.size() - 1)
1004 fout << std::left << std::setw(20) << oss.str();
1005 fout <<
" # " << m_Particles[i].Name() <<
" -> ";
1006 for (
unsigned int k = 0; k < m_Particles[i].Decays()[j].mDaughters.size(); ++k) {
1007 if (m_PDGtoID.count(m_Particles[i].Decays()[j].mDaughters[k]) == 0) {
1009 long long tpdg = m_Particles[i].Decays()[j].mDaughters[k];
1015 fout << m_Particles[m_PDGtoID[m_Particles[i].Decays()[j].mDaughters[k]]].Name();
1016 if (k != m_Particles[i].Decays()[j].mDaughters.size() - 1)
1029 void ThermalParticleSystem::ReadDecays_OldFormat(std::ifstream & fin)
1031 vector< ThermalParticle::ParticleDecaysVector > decays(0);
1032 vector<long long> pdgids(0);
1033 map<long long, int> decaymap;
1036 if (fin.is_open()) {
1037 int decaypartnumber = 0;
1038 fin >> decaypartnumber;
1039 decays.reserve(decaypartnumber);
1041 for (
int i = 0; i < decaypartnumber; ++i) {
1042 int decaysnumber, daughters;
1043 long long pdgid, tmpid;
1045 fin >> pdgid >> decaysnumber;
1046 decaymap[pdgid] = i;
1048 pdgids.push_back(pdgid);
1049 for (
int j = 0; j < decaysnumber; ++j) {
1052 decay.
mBratio = bratio / 100.;
1055 for (
int k = 0; k < daughters; ++k) {
1059 decays[i].push_back(decay);
1064 for (
size_t i = 0; i < m_Particles.size(); ++i) {
1065 if (decaymap.count(m_Particles[i].PdgId()) != 0)
1066 m_Particles[i].SetDecays(decays[decaymap[m_Particles[i].PdgId()]]);
1071 std::string ThermalParticleSystem::GetNameFromPDG(
long long pdgid) {
1072 if (m_PDGtoID.count(pdgid) != 0)
1073 return m_Particles[m_PDGtoID[pdgid]].Name();
1074 if (pdgid == 1)
return string(
"Npart");
1075 if (pdgid == 310)
return string(
"K0S");
1076 if (pdgid == 130)
return string(
"K0L");
1077 if (pdgid % 10 == 0) {
1078 long long tpdgid = pdgid / 10;
1080 return m_Particles[
PdgToId(tpdgid)].Name() +
"+" + m_Particles[
PdgToId(-tpdgid)].Name();
1082 if (pdgid == 22122112)
return string(
"p+n");
1089 void ThermalParticleSystem::NormalizeBranchingRatios() {
1090 for (
size_t i = 0; i < m_Particles.size(); ++i) m_Particles[i].NormalizeBranchingRatios();
1095 void ThermalParticleSystem::RestoreBranchingRatios() {
1096 for (
size_t i = 0; i < m_Particles.size(); ++i) m_Particles[i].RestoreBranchingRatios();
1102 m_QStatsCalculationType = type;
1103 for (
size_t i = 0; i < m_Particles.size(); ++i)
1104 m_Particles[i].SetCalculationType(type);
1107 void ThermalParticleSystem::SetClusterExpansionOrder(
int order)
1109 for (
size_t i = 0; i < m_Particles.size(); ++i)
1110 m_Particles[i].SetClusterExpansionOrder(order);
1115 m_ResonanceWidthShape = shape;
1116 for (
size_t i = 0; i < m_Particles.size(); ++i)
1117 m_Particles[i].SetResonanceWidthShape(shape);
1122 bool dodecays = (type != m_ResonanceWidthIntegrationType);
1124 m_ResonanceWidthIntegrationType = type;
1126 for (
size_t i = 0; i < m_Particles.size(); ++i) {
1127 if (!m_Particles[i].ZeroWidthEnforced())
1128 m_Particles[i].SetResonanceWidthIntegrationType(type);
1137 if (id < 0 || id >= static_cast<int>(m_Particles.size())) {
1138 printf(
"**ERROR** ThermalParticleSystem::Particle(int id): id is out of bounds!");
1141 return m_Particles[id];
1146 if (id < 0 || id >= static_cast<int>(m_Particles.size())) {
1147 printf(
"**ERROR** ThermalParticleSystem::Particle(int id): id is out of bounds!\n");
1150 return m_Particles[id];
1155 if (m_PDGtoID.count(pdgid) == 0) {
1156 printf(
"**ERROR** ThermalParticleSystem::ParticleByPDG(long long pdgid): pdgid %lld is unknown\n", pdgid);
1159 return m_Particles[m_PDGtoID[pdgid]];
1162 void ThermalParticleSystem::FillPdgMap()
1164 m_NumBaryons = m_NumCharged = m_NumStrange = m_NumCharmed = 0;
1165 m_NumberOfParticles = 0;
1167 for (
size_t i = 0; i < m_Particles.size(); ++i) {
1168 m_PDGtoID[m_Particles[i].PdgId()] = i;
1169 if (m_Particles[i].BaryonCharge() != 0) m_NumBaryons++;
1170 if (m_Particles[i].ElectricCharge() != 0) m_NumCharged++;
1171 if (m_Particles[i].Strangeness() != 0) m_NumStrange++;
1172 if (m_Particles[i].Charm() != 0) m_NumCharmed++;
1173 if (m_Particles[i].PdgId() > 0) m_NumberOfParticles++;
1176 for (
size_t i = 0; i < m_DecayContributionsByFeeddown.size(); ++i)
1177 m_DecayContributionsByFeeddown[i].resize(m_Particles.size());
1180 void ThermalParticleSystem::FinalizeList()
1182 if (SortMode() == ThermalParticleSystem::SortByMass)
1183 sort(m_Particles.begin(), m_Particles.end(), cmpParticleMass);
1184 else if (SortMode() == ThermalParticleSystem::SortByMassAndPDG)
1185 sort(m_Particles.begin(), m_Particles.end(), cmpParticleMassAndPdg);
1187 sort(m_Particles.begin(), m_Particles.end(), cmpParticlePDG);
1189 for (
size_t i = 0; i < m_Particles.size(); ++i) {
1190 if (m_Particles[i].DecayType() == ParticleDecayType::Default)
1191 m_Particles[i].SetDecayType( DecayTypeByParticleType(m_Particles[i]) );
1197 m_Particles.push_back(part);
1201 void ThermalParticleSystem::RemoveParticleAt(
int ind)
1203 if (ind >= 0 && ind < static_cast<int>(m_Particles.size())) {
1204 m_Particles.erase(m_Particles.begin() + ind);
1209 bool ThermalParticleSystem::CheckDecayChargesConservation(
int ind)
const 1211 std::vector<int> check = CheckDecayChargesConservationVector(ind);
1212 for (
int i = 0; i < check.size(); ++i)
1218 bool ThermalParticleSystem::CheckDecayChannelsAreSpecified()
const 1222 for (
int i = 0; i < Particles().size(); ++i) {
1225 printf(
"**WARNING** %s (%lld): Particle marked unstable but no decay channels found!\n",
1226 part.
Name().c_str(),
1231 printf(
"**WARNING** Further warnings are discarded...\n");
1238 std::vector<int> ThermalParticleSystem::CheckDecayChargesConservationVector(
int ind)
const 1244 int goalC = part.
Charm();
1246 std::map<long long, int> tPDGtoID = m_PDGtoID;
1248 std::vector<int> ret(4, 1);
1250 for (
size_t i = 0; i < part.
Decays().size(); ++i) {
1251 int decB = 0, decQ = 0, decS = 0, decC = 0;
1252 for (
size_t j = 0; j < part.
Decays()[i].mDaughters.size(); ++j) {
1253 long long tpdg = part.
Decays()[i].mDaughters[j];
1254 if (tPDGtoID.count(tpdg) != 0) {
1255 int tid = tPDGtoID[tpdg];
1256 decB += Particles()[tid].BaryonCharge();
1257 decQ += Particles()[tid].ElectricCharge();
1258 decS += Particles()[tid].Strangeness();
1259 decC += Particles()[tid].Charm();
1286 ret &= m_PDGtoID == rhs.m_PDGtoID;
1287 ret &= m_NumBaryons == rhs.m_NumBaryons;
1288 ret &= m_NumCharged == rhs.m_NumCharged;
1289 ret &= m_NumStrange == rhs.m_NumStrange;
1290 ret &= m_NumCharmed == rhs.m_NumCharmed;
1291 ret &= m_NumberOfParticles == rhs.m_NumberOfParticles;
1292 ret &= m_ResonanceWidthIntegrationType == rhs.m_ResonanceWidthIntegrationType;
1293 ret &= m_DecayDistributionsMap == rhs.m_DecayDistributionsMap;
1295 ret &= m_Particles == rhs.m_Particles;
1303 set<long long> stablePDG;
1304 stablePDG.insert(2212); stablePDG.insert(-2212);
1305 stablePDG.insert(2112); stablePDG.insert(-2112);
1306 stablePDG.insert(1000010020); stablePDG.insert(-1000010020);
1307 stablePDG.insert(1000020030); stablePDG.insert(-1000020030);
1308 stablePDG.insert(1000010030); stablePDG.insert(-1000010030);
1309 stablePDG.insert(1000020040); stablePDG.insert(-1000020040);
1311 if (stablePDG.count(part.
PdgId()) > 0) {
1312 return ParticleDecayType::Stable;
1316 set<long long> weakPDG;
1317 weakPDG.insert(310);
1318 weakPDG.insert(130);
1319 weakPDG.insert(211); weakPDG.insert(-211);
1320 weakPDG.insert(321); weakPDG.insert(-321);
1321 weakPDG.insert(3122); weakPDG.insert(-3122);
1322 weakPDG.insert(3222); weakPDG.insert(-3222);
1323 weakPDG.insert(3112); weakPDG.insert(-3112);
1324 weakPDG.insert(3322); weakPDG.insert(-3322);
1325 weakPDG.insert(3312); weakPDG.insert(-3312);
1326 weakPDG.insert(3334); weakPDG.insert(-3334);
1327 weakPDG.insert(411); weakPDG.insert(-411);
1328 weakPDG.insert(421); weakPDG.insert(-421);
1329 weakPDG.insert(431); weakPDG.insert(-431);
1330 weakPDG.insert(4232); weakPDG.insert(-4232);
1331 weakPDG.insert(4132); weakPDG.insert(-4132);
1332 weakPDG.insert(4422); weakPDG.insert(-4422);
1333 weakPDG.insert(4412); weakPDG.insert(-4412);
1334 weakPDG.insert(4332); weakPDG.insert(-4332);
1336 if (weakPDG.count(part.
PdgId()) > 0) {
1337 return ParticleDecayType::Weak;
1342 set<long long> emPDG;
1346 emPDG.insert(3212); emPDG.insert(-3212);
1348 if (emPDG.count(part.
PdgId()) > 0) {
1349 return ParticleDecayType::Electromagnetic;
1354 return ParticleDecayType::Strong;
1359 return ParticleDecayType::Weak;
1361 return ParticleDecayType::Stable;
1365 return ParticleDecayType::Default;
1368 void ThermalParticleSystem::FillResonanceDecaysByFeeddown() {
1369 m_DecayContributionsByFeeddown[Feeddown::Weak].resize(m_Particles.size());
1370 m_DecayContributionsByFeeddown[Feeddown::Electromagnetic].resize(m_Particles.size());
1371 m_DecayContributionsByFeeddown[Feeddown::Strong].resize(m_Particles.size());
1372 for (
size_t i = 0; i < m_Particles.size(); ++i) {
1373 m_DecayContributionsByFeeddown[Feeddown::Weak][i].resize(0);
1374 m_DecayContributionsByFeeddown[Feeddown::Electromagnetic][i].resize(0);
1375 m_DecayContributionsByFeeddown[Feeddown::Strong][i].resize(0);
1377 for (
int i = static_cast<int>(m_Particles.size()) - 1; i >= 0; i--)
1378 if (m_Particles[i].DecayType() != ParticleDecayType::Stable && m_Particles[i].DecayType() != ParticleDecayType::Default) {
1379 GoResonanceByFeeddown(i, i, 1.,
Feeddown::Type(static_cast<int>(m_Particles[i].DecayType())));
1383 void ThermalParticleSystem::GoResonanceByFeeddown(
int ind,
int startind,
double BR,
Feeddown::Type feeddown) {
1384 for (
int feed_index = static_cast<int>(Feeddown::Weak); feed_index <= static_cast<int>(Feeddown::Strong); ++feed_index) {
1385 if (static_cast<int>(feeddown) < feed_index)
continue;
1388 if (ind != startind && decayContributions.size() > 0 && decayContributions[decayContributions.size() - 1].second == startind)
1390 decayContributions[decayContributions.size() - 1].first += BR;
1392 else if (ind != startind) {
1393 decayContributions.push_back(make_pair(BR, startind));
1398 if (m_Particles[ind].DecayType() != ParticleDecayType::Stable && m_Particles[ind].DecayType() != ParticleDecayType::Default) {
1399 for (
size_t i = 0; i < m_Particles[ind].Decays().size(); ++i) {
1401 double tbr = decaychannel.
mBratio;
1403 if (m_ResonanceWidthIntegrationType == ThermalParticle::eBW && ind == startind)
1406 for (
size_t j = 0; j < decaychannel.
mDaughters.size(); ++j) {
1407 if (m_PDGtoID.count(decaychannel.
mDaughters[j]) != 0)
1408 GoResonanceByFeeddown(m_PDGtoID[decaychannel.
mDaughters[j]], startind, BR*tbr,
Feeddown::Type(static_cast<int>(m_Particles[ind].DecayType())));
1415 namespace CuteHRGHelper {
1416 std::vector<std::string>&
split(
const std::string& s,
char delim, std::vector<std::string>& elems) {
1417 std::stringstream ss(s);
1419 while (std::getline(ss, item, delim)) {
1420 elems.push_back(item);
1425 std::vector<std::string>
split(
const std::string& s,
char delim) {
1426 std::vector<std::string> elems;
1427 split(s, delim, elems);
1433 if (static_cast<int>(vect.size()) > maxsize) {
1434 std::sort(vect.begin(), vect.end());
1435 std::reverse(vect.begin(), vect.end());
1441 namespace ExtraParticles {
1442 static std::vector<ThermalParticle> Particles;
1443 static std::map<long long, int> PdgIdMap;
1444 static bool isInitialized =
Init();
1447 if (id < 0 || id >= Particles.size()) {
1448 printf(
"**ERROR** ExtraParticles::Particle(int id): id is out of bounds!");
1451 return Particles[id];
1457 printf(
"**ERROR** ExtraParticles::ParticleByPdg(long long pdgid): pdgid %lld is unknown\n", pdgid);
1464 return (PdgIdMap.count(pdgid) > 0) ? PdgIdMap[pdgid] : -1;
1474 PdgIdMap[Particles[tsz].PdgId()] = tsz;
1478 Particles.push_back(
ThermalParticle(
true,
"e-", 11, 2., 1, 5.109989461E-04, 0, 0, -1));
1479 PdgIdMap[Particles[tsz].PdgId()] = tsz;
1481 Particles.push_back(
ThermalParticle(
true,
"e+", -11, 2., 1, 5.109989461E-04, 0, 0, 1));
1482 PdgIdMap[Particles[tsz].PdgId()] = tsz;
1486 Particles.push_back(
ThermalParticle(
true,
"mu-", 13, 2., 1, 1.056583745E-01, 0, 0, -1));
1487 PdgIdMap[Particles[tsz].PdgId()] = tsz;
1489 Particles.push_back(
ThermalParticle(
true,
"mu+", -13, 2., 1, 1.056583745E-01, 0, 0, 1));
1490 PdgIdMap[Particles[tsz].PdgId()] = tsz;
1494 Particles.push_back(
ThermalParticle(
true,
"tau-", 15, 2., 1, 1.77686E+00, 0, 0, -1));
1495 PdgIdMap[Particles[tsz].PdgId()] = tsz;
1497 Particles.push_back(
ThermalParticle(
true,
"tau+", -15, 2., 1, 1.77686E+00, 0, 0, 1));
1498 PdgIdMap[Particles[tsz].PdgId()] = tsz;
1503 PdgIdMap[Particles[tsz].PdgId()] = tsz;
1505 Particles.push_back(
ThermalParticle(
true,
"anti-nu(e)", -12, 1., 1, 0.));
1506 PdgIdMap[Particles[tsz].PdgId()] = tsz;
1511 PdgIdMap[Particles[tsz].PdgId()] = tsz;
1513 Particles.push_back(
ThermalParticle(
true,
"anti-nu(mu)", -14, 1., 1, 0.));
1514 PdgIdMap[Particles[tsz].PdgId()] = tsz;
1519 PdgIdMap[Particles[tsz].PdgId()] = tsz;
1521 Particles.push_back(
ThermalParticle(
true,
"anti-nu(tau)", -16, 1., 1, 0.));
1522 PdgIdMap[Particles[tsz].PdgId()] = tsz;
1532 return string(
"???");
long long stringToLongLong(const std::string &str)
Structure containing information about a single decay channel of a particle.
std::string NameByPdg(long long pdg)
double AbsoluteStrangeness() const
Absolute strange quark content |s|.
std::vector< std::string > & split(const std::string &s, char delim, std::vector< std::string > &elems)
DecayType
Type of particle's decay.
int Charm() const
Particle's charm.
std::vector< ParticleDecayChannel > ParticleDecaysVector
Vector of all decay channels of a particle.
Contains some helper functions.
long long PdgId() const
Particle's Particle Data Group (PDG) ID number.
Class containing the particle list.
double ResonanceWidth() const
Particle's width at the pole mass (GeV)
void cutDecayDistributionsVector(std::vector< std::pair< double, std::vector< int > > > &vect, int maxsize=1000)
std::vector< std::pair< double, std::vector< int > > > ResonanceFinalStatesDistribution
const ThermalParticle & ParticleByPdg(long long pdg)
int BaryonCharge() const
Particle's baryon number.
ResonanceWidthIntegration
Treatment of finite resonance widths.
Class containing all information about a particle specie.
ResonanceWidthShape
Relativistic vs non-relativistic Breit-Wigner shape.
std::vector< SingleDecayContribution > DecayContributionsToParticle
A vector of SingleDecayContribution where each element corresponds to a certain resonance species...
const std::string & Name() const
Particle's name.
int PdgToId(long long pdg)
bool IsNeutral() const
Whether particle is neutral one.
std::vector< long long > mDaughters
double Mass() const
Particle's mass [GeV].
ThermalParticle GenerateAntiParticle() const
Generates the anti-particle to the current particle specie.
bool IsStable() const
Return particle stability flag.
double DecayThresholdMass() const
The decays threshold mass.
int ElectricCharge() const
Particle's electric charge.
int Strangeness() const
Particle's strangeness.
const ThermalParticle & Particle(int id)
double Degeneracy() const
Particle's internal degeneracy factor.
QStatsCalculationType
Identifies whether quantum statistics are to be computed using the cluster expansion or numerical int...
const ParticleDecaysVector & Decays() const
A vector of particle's decays.
double AbsoluteCharm() const
Absolute charm quark content |s|.
The main namespace where all classes and functions of the Thermal-FIST library reside.
std::pair< double, int > SingleDecayContribution
int Statistics() const
Particle's statistics.