8#ifndef THERMALPARTICLESYSTEM_H
9#define THERMALPARTICLESYSTEM_H
42 ThermalParticleSystem(
const std::string& InputFile =
"",
bool GenAntiP =
true,
double mcut = -1.) { Initialize(InputFile, std::string(
""), GenAntiP, mcut); }
54 ThermalParticleSystem(
const std::string& InputFile,
const std::string& DecayFile,
bool GenAntiP =
true,
double mcut = -1.) { Initialize(InputFile, DecayFile, GenAntiP, mcut); }
78 const std::vector<std::string>& ListFiles,
79 const std::vector<std::string>& DecayFiles = std::vector<std::string>(0),
80 const std::set<std::string>& flags = std::set<std::string>(),
222 void LoadList(
const std::vector<std::string>& ListFiles,
223 const std::vector<std::string>& DecayFiles = std::vector<std::string>(0),
224 const std::set<std::string>& flags = std::set<std::string>(),
238 void LoadList(
const std::string& InputFile,
const std::string& DecayFile,
bool GenerateAntiParticles =
true,
double mcut = 1.e9);
252 void LoadList(
const std::string& InputFile =
"",
bool GenerateAntiParticles =
true,
double mcut = -1.) {
LoadList(InputFile, std::string(
""), GenerateAntiParticles, mcut); }
254 void AddParticlesToListFromFile(
const std::string& InputFile =
"",
const std::set<std::string>& flags = std::set<std::string>(),
double mcut = -1.);
262 void LoadTable(
const std::string& InputFile =
"",
bool GenerateAntiParticles =
true,
double mcut = -1.) {
LoadList(InputFile, GenerateAntiParticles, mcut); }
271 void SetTableFromVector(
const std::vector<ThermalParticle> &part_in,
bool GenerateAntiParticles =
true);
282 void WriteTableToFile(
const std::string& OutputFile =
"",
bool WriteAntiParticles =
false);
291 void LoadDecays(
const std::vector<std::string>& DecayFiles,
const std::set<std::string>& flags = std::set<std::string>());
300 void LoadDecays(
const std::string& DecaysFile =
"",
bool GenerateAntiParticles =
true);
308 void WriteDecaysToFile(
const std::string& OutputFile =
"",
bool WriteAntiParticles =
false);
408 const std::vector<ThermalParticle>&
Particles()
const {
return m_Particles; }
409 std::vector<ThermalParticle>&
Particles() {
return m_Particles; }
444 int PdgToId(
long long pdgid)
const;
454 long long IdToPdg(
int id)
const {
return (
id >= 0 &&
id <
static_cast<int>(m_Particles.size())) ? m_Particles[id].PdgId() : 0; }
552 void GoResonance(
int ind,
int startind,
double BR);
554 void GoResonanceByFeeddown(
int ind,
int startind,
double BR,
Feeddown::Type feeddown);
556 std::vector<double> GoResonanceDecayProbs(
int ind,
int goalind,
bool firstdecay =
false);
558 std::vector<double> GoResonanceDecayProbsCharge(
int ind,
int nch,
bool firstdecay =
false);
562 bool AcceptParticle(
const ThermalParticle& part,
const std::set<std::string>& flags,
double mcut = -1.)
const;
564 void LoadTable_OldFormat(std::ifstream& fin,
const std::set<std::string>& flags = std::set<std::string>(),
double mcut = 1.e9);
566 void LoadTable_NewFormat(std::ifstream& fin,
const std::set<std::string>& flags = std::set<std::string>(),
double mcut = 1.e9);
568 void ReadDecays_OldFormat(std::ifstream &fin);
570 void ReadDecays_NewFormat(std::ifstream &fin);
572 void Initialize(
const std::vector<std::string>& ListFiles,
573 const std::vector<std::string>& DecayFiles = std::vector<std::string>(0),
574 const std::set<std::string>& flags = std::set<std::string>(),
577 void Initialize(
const std::string& InputFile =
"",
const std::string& DecayFile =
"",
bool GenAntiP =
true,
double mcut = -1.);
579 void FinalizeListLoad();
581 void FinalizeDecaysLoad();
584 bool CheckListIsiSS(
const std::string &filename);
587 void LoadListiSS(
const std::string& filename,
const std::set<std::string>& flags = std::set<std::string>(),
double mcut = 1.e9);
590 std::vector<ThermalParticle> m_Particles;
591 std::map<long long, int> m_PDGtoID;
596 int m_MaxAbsBaryonNumber;
598 int m_NumberOfParticles;
606 std::vector<DecayContributionsToAllParticles> m_DecayContributionsByFeeddown;
612 std::vector<ResonanceFinalStatesDistribution> m_ResonanceFinalStatesDistributions;
615 std::vector<ResonanceFinalStatesDistribution> m_DecayDistributionsMap;
622 std::vector<std::string>
split(
const std::string &s,
char delim);
Class containing all information about a particle specie.
std::vector< ParticleDecayChannel > ParticleDecaysVector
Vector of all decay channels of a particle.
ResonanceWidthIntegration
Treatment of finite resonance widths.
ResonanceWidthShape
Relativistic vs non-relativistic Breit-Wigner shape.
Class containing the particle list.
void SetResonanceWidthIntegrationType(ThermalParticle::ResonanceWidthIntegration type)
Set (or get) the ThermalParticle::ResonanceWidthIntegration scheme for all particles.
void SetTableFromVector(const std::vector< ThermalParticle > &part_in, bool GenerateAntiParticles=true)
Sets the particle list from a provided vector of ThermalParticle objects.
IdealGasFunctions::QStatsCalculationType QStatsCalculationType() const
const DecayCumulantsContributionsToAllParticles & DecayCumulants() const
Cumulants of particle number distributions of from decays.
bool CheckAbsoluteQuarkNumbers() const
void LoadTable(const std::string &InputFile="", bool GenerateAntiParticles=true, double mcut=-1.)
Same as LoadList()
const std::vector< DecayContributionsToAllParticles > & DecayContributionsByFeeddown() const
std::vector< DecayProbabilityDistributionsToParticle > DecayProbabilityDistributionsToAllParticles
ThermalParticle::ResonanceWidthIntegration ResonanceWidthIntegrationType() const
std::vector< std::pair< double, std::vector< int > > > ResonanceFinalStatesDistribution
ThermalParticleSystem(const std::string &InputFile="", bool GenAntiP=true, double mcut=-1.)
Construct a new ThermalParticleSystem object.
ThermalParticleSystem(const std::string &InputFile, const std::string &DecayFile, bool GenAntiP=true, double mcut=-1.)
Construct a new ThermalParticleSystem object.
static const std::string flag_noexcitednuclei
int PdgToId(long long pdgid) const
Transforms PDG ID to a 0-based particle id number.
std::vector< SingleDecayProbabilityDistribution > DecayProbabilityDistributionsToParticle
A vector of SingleDecayProbabilityDistribution where each element corresponds to a certain resonance ...
static const std::string flag_nonuclei
SortModeType SortMode() const
Current mode to sort particle species.
void WriteTableToFile(const std::string &OutputFile="", bool WriteAntiParticles=false)
Writes the particle list to file.
void LoadList(const std::string &InputFile="", bool GenerateAntiParticles=true, double mcut=-1.)
Loads the particle list from file.
void ProcessDecays()
Computes the decay contributions of decaying resonances to all particle yields.
bool hasMultiBaryons() const
std::string GetNameFromPDG(long long pdgid)
Get the name of particle species with the specified PDG ID.
bool CheckDecayChannelsAreSpecified() const
ThermalParticle::ParticleDecaysVector GetDecaysFromAntiParticle(const ThermalParticle::ParticleDecaysVector &Decays)
Generates the decay channels for an antiparticle based on the provided decay channels of a particle.
std::vector< DecayCumulantsContributionsToParticle > DecayCumulantsContributionsToAllParticles
void SetCalculationType(IdealGasFunctions::QStatsCalculationType type)
Sets the CalculationType() method to evaluate quantum statistics.
static const std::string flag_nocharm
void NormalizeBranchingRatios()
Normalize branching ratios for all particles such that they add up to 100%.
bool operator==(const ThermalParticleSystem &rhs) const
void SetClusterExpansionOrder(int order)
Set the number of terms in the cluster expansion method.
const std::vector< ThermalParticle > & Particles() const
Returns the vector of all particle species.
std::vector< SingleDecayContribution > DecayContributionsToParticle
A vector of SingleDecayContribution where each element corresponds to a certain resonance species.
void RestoreBranchingRatios()
Restore the original values of all the branching ratios.
void FillDecayProperties()
Computes and fills decay channels of all particles with extra information.
void LoadList(const std::vector< std::string > &ListFiles, const std::vector< std::string > &DecayFiles=std::vector< std::string >(0), const std::set< std::string > &flags=std::set< std::string >(), double mcut=1.e9)
Loads the particle list from file.
static const std::string flag_no_antiparticles
std::pair< double, int > SingleDecayContribution
void FillResonanceDecaysByFeeddown()
Same as FillResonanceDecays() but separately for weak, electromagnetic, and strong decay feeddowns.
std::pair< std::vector< double >, int > SingleDecayCumulantsContribution
void FillDecayThresholds()
Computes mass thresholds of all decay channels of all particles. Obsolete.
void AddParticlesToListFromFile(const std::string &InputFile="", const std::set< std::string > &flags=std::set< std::string >(), double mcut=-1.)
static const std::string flag_nostrangeness
void SetSortMode(SortModeType type)
std::vector< int > CheckDecayChargesConservationVector(int ind) const
std::pair< std::vector< double >, int > SingleDecayProbabilityDistribution
static ParticleDecayType::DecayType DecayTypeByParticleType(const ThermalParticle &part)
Determines the decay type of a given particle specie.
const ThermalParticle & Particle(int id) const
ThermalParticle object corresponding to particle species with a provided 0-based index.
void RemoveParticleAt(int ind)
Removes particle specie with specified 0-based particle id number from the list.
long long IdToPdg(int id) const
Transforms 0-based particle id number to a PDG ID.
std::vector< DecayContributionsToParticle > DecayContributionsToAllParticles
const std::vector< ResonanceFinalStatesDistribution > & ResonanceFinalStatesDistributions() const
Final state particle number distributions for resonance decays.
std::vector< ThermalParticle > & Particles()
void AddParticle(const ThermalParticle &part)
Adds a new particle specie to the list.
ThermalParticle::ResonanceWidthShape ResonanceWidthShape() const
bool CheckDecayChargesConservation(int ind) const
void SetResonanceWidthShape(ThermalParticle::ResonanceWidthShape shape)
Set (or get) the ThermalParticle::ResonanceWidthShape for all particles.
void LoadDecays(const std::vector< std::string > &DecayFiles, const std::set< std::string > &flags=std::set< std::string >())
Load the decay channels for all particles from a file.
const ThermalParticle & ParticleByPDG(long long pdgid) const
ThermalParticle object corresponding to particle species with a provided PDG ID.
void FillResonanceDecays()
Computes the decay contributions of decaying resonances to all particle yields.
std::vector< double > GetConservedChargesVector(ConservedCharge::Name charge)
Calculates vector of conserved charges for all particle species.
int ComponentsNumber() const
Number of different particle species in the list.
bool operator!=(const ThermalParticleSystem &rhs) const
void WriteDecaysToFile(const std::string &OutputFile="", bool WriteAntiParticles=false)
Writes the decay channels to a file.
SortModeType
Mode list to sort particles species.
@ SortByBaryonAndMassAndPDG
~ThermalParticleSystem(void)
Destroy the ThermalParticleSystem object.
std::vector< SingleDecayCumulantsContribution > DecayCumulantsContributionsToParticle
A vector of SingleDecayCumulantsContribution where each element corresponds to a certain resonance sp...
Contains several helper routines.
void cutDecayDistributionsVector(std::vector< std::pair< double, std::vector< int > > > &vect, int maxsize=1000)
std::vector< std::string > split(const std::string &s, char delim)
Contains decay lifetimes needed for propagation in Monte Carlo.
double GetLifetime(long long pdg)
QStatsCalculationType
Identifies whether quantum statistics are to be computed using the cluster expansion or numerical int...
The main namespace where all classes and functions of the Thermal-FIST library reside.
Name
Set of all conserved charges considered.
DecayType
Type of particle's decay.