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>(),
201 const DecayCumulantsContributionsToAllParticles&
DecayCumulants()
const {
return m_DecayCumulants; }
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);
404 const std::vector<ThermalParticle>&
Particles()
const {
return m_Particles; }
438 int PdgToId(
long long pdgid) {
return (m_PDGtoID.count(pdgid) > 0) ? m_PDGtoID[pdgid] : -1; }
448 long long IdToPdg(
int id)
const {
return (
id >= 0 &&
id < static_cast<int>(m_Particles.size())) ? m_Particles[id].PdgId() : 0; }
534 void GoResonance(
int ind,
int startind,
double BR);
536 void GoResonanceByFeeddown(
int ind,
int startind,
double BR,
Feeddown::Type feeddown);
538 std::vector<double> GoResonanceDecayProbs(
int ind,
int goalind,
bool firstdecay =
false);
540 std::vector<double> GoResonanceDecayProbsCharge(
int ind,
int nch,
bool firstdecay =
false);
542 ResonanceFinalStatesDistribution GoResonanceDecayDistributions(
int ind,
bool firstdecay =
false);
544 bool AcceptParticle(
const ThermalParticle& part,
const std::set<std::string>& flags,
double mcut = -1.)
const;
547 void LoadTable_OldFormat(std::ifstream& fin,
const std::set<std::string>& flags = std::set<std::string>(),
double mcut = 1.e9);
550 void LoadTable_NewFormat(std::ifstream& fin,
const std::set<std::string>& flags = std::set<std::string>(),
double mcut = 1.e9);
552 void ReadDecays_OldFormat(std::ifstream &fin);
554 void ReadDecays_NewFormat(std::ifstream &fin);
556 void Initialize(
const std::vector<std::string>& ListFiles,
557 const std::vector<std::string>& DecayFiles = std::vector<std::string>(0),
558 const std::set<std::string>& flags = std::set<std::string>(),
561 void Initialize(
const std::string& InputFile =
"",
const std::string& DecayFile =
"",
bool GenAntiP =
true,
double mcut = -1.);
565 std::vector<ThermalParticle> m_Particles;
566 std::map<long long, int> m_PDGtoID;
572 int m_NumberOfParticles;
580 std::vector<DecayContributionsToAllParticles> m_DecayContributionsByFeeddown;
582 DecayCumulantsContributionsToAllParticles m_DecayCumulants;
584 DecayProbabilityDistributionsToAllParticles m_DecayProbabilities;
586 std::vector<ResonanceFinalStatesDistribution> m_ResonanceFinalStatesDistributions;
589 std::vector<ResonanceFinalStatesDistribution> m_DecayDistributionsMap;
595 namespace CuteHRGHelper {
596 std::vector<std::string>
split(
const std::string &s,
char delim);
601 namespace ExtraParticles {
SortModeType
Mode list to sort particles species.
ThermalParticle::ParticleDecaysVector GetDecaysFromAntiParticle(const ThermalParticle::ParticleDecaysVector &Decays)
Generates the decay channels for an antiparticle based on the provided decay channels of a particle...
static ParticleDecayType::DecayType DecayTypeByParticleType(const ThermalParticle &part)
Determines the decay type of a given particle specie.
std::vector< std::string > split(const std::string &s, char delim)
std::string NameByPdg(long long pdg)
DecayType
Type of particle's decay.
std::vector< ParticleDecayChannel > ParticleDecaysVector
Vector of all decay channels of a particle.
const ThermalParticle & Particle(int id) const
ThermalParticle object corresponding to particle species with a provided 0-based index.
void SetSortMode(SortModeType type)
bool operator==(const ThermalParticleSystem &rhs) const
std::vector< SingleDecayCumulantsContribution > DecayCumulantsContributionsToParticle
A vector of SingleDecayCumulantsContribution where each element corresponds to a certain resonance sp...
std::pair< std::vector< double >, int > SingleDecayCumulantsContribution
int PdgToId(long long pdgid)
Transforms PDG ID to a 0-based particle id number.
Class containing the particle list.
std::string GetNameFromPDG(long long pdgid)
Get the name of particle species with the specified PDG ID.
static const std::string flag_no_antiparticles
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.
void cutDecayDistributionsVector(std::vector< std::pair< double, std::vector< int > > > &vect, int maxsize=1000)
ThermalParticleSystem(const std::string &InputFile="", bool GenAntiP=true, double mcut=-1.)
Construct a new ThermalParticleSystem object.
int ComponentsNumber() const
Number of different particle species in the list.
bool CheckDecayChannelsAreSpecified() const
void SetResonanceWidthShape(ThermalParticle::ResonanceWidthShape shape)
Set (or get) the ThermalParticle::ResonanceWidthShape for all particles.
std::vector< SingleDecayProbabilityDistribution > DecayProbabilityDistributionsToParticle
A vector of SingleDecayProbabilityDistribution where each element corresponds to a certain resonance ...
static const std::string flag_nocharm
void WriteDecaysToFile(const std::string &OutputFile="", bool WriteAntiParticles=false)
Writes the decay channels to a file.
ThermalParticle::ResonanceWidthShape ResonanceWidthShape() const
void NormalizeBranchingRatios()
Normalize branching ratios for all particles such that they add up to 100%.
void FillResonanceDecaysByFeeddown()
Same as FillResonanceDecays() but separately for weak, electromagnetic, and strong decay feeddowns...
void SetCalculationType(IdealGasFunctions::QStatsCalculationType type)
Sets the CalculationType() method to evaluate quantum statistics.
void SetTableFromVector(const std::vector< ThermalParticle > &part_in, bool GenerateAntiParticles=true)
Sets the particle list from a provided vector of ThermalParticle objects.
ThermalParticleSystem(const std::string &InputFile, const std::string &DecayFile, bool GenAntiP=true, double mcut=-1.)
Construct a new ThermalParticleSystem object.
std::vector< std::pair< double, std::vector< int > > > ResonanceFinalStatesDistribution
const ThermalParticle & ParticleByPdg(long long pdg)
ResonanceWidthIntegration
Treatment of finite resonance widths.
void SetClusterExpansionOrder(int order)
Set the number of terms in the cluster expansion method.
std::vector< DecayContributionsToParticle > DecayContributionsToAllParticles
Class containing all information about a particle specie.
std::pair< std::vector< double >, int > SingleDecayProbabilityDistribution
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...
std::vector< DecayProbabilityDistributionsToParticle > DecayProbabilityDistributionsToAllParticles
void FillDecayThresholds()
Computes mass thresholds of all decay channels of all particles. Obsolete.
const std::vector< ThermalParticle > & Particles() const
Returns the vector of all particle species.
void RemoveParticleAt(int ind)
Removes particle specie with specified 0-based particle id number from the list.
IdealGasFunctions::QStatsCalculationType QStatsCalculationType() const
const std::vector< ResonanceFinalStatesDistribution > & ResonanceFinalStatesDistributions() const
Final state particle number distributions for resonance decays.
static const std::string flag_nonuclei
void FillDecayProperties()
Computes and fills decay channels of all particles with extra information.
bool CheckDecayChargesConservation(int ind) const
const DecayCumulantsContributionsToAllParticles & DecayCumulants() const
Cumulants of particle number distributions of from decays.
bool operator!=(const ThermalParticleSystem &rhs) const
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.
void FillResonanceDecays()
Computes the decay contributions of decaying resonances to all particle yields.
~ThermalParticleSystem(void)
Destroy the ThermalParticleSystem object.
void LoadTable(const std::string &InputFile="", bool GenerateAntiParticles=true, double mcut=-1.)
Same as LoadList()
std::vector< int > CheckDecayChargesConservationVector(int ind) const
const std::vector< DecayContributionsToAllParticles > & DecayContributionsByFeeddown() const
void AddParticlesToListFromFile(const std::string &InputFile="", const std::set< std::string > &flags=std::set< std::string >(), double mcut=-1.)
std::vector< DecayCumulantsContributionsToParticle > DecayCumulantsContributionsToAllParticles
ThermalParticle::ResonanceWidthIntegration ResonanceWidthIntegrationType() const
void ProcessDecays()
Computes the decay contributions of decaying resonances to all particle yields.
QStatsCalculationType
Identifies whether quantum statistics are to be computed using the cluster expansion or numerical int...
void LoadList(const std::string &InputFile="", bool GenerateAntiParticles=true, double mcut=-1.)
Loads the particle list from file.
void SetResonanceWidthIntegrationType(ThermalParticle::ResonanceWidthIntegration type)
Set (or get) the ThermalParticle::ResonanceWidthIntegration scheme for all particles.
void AddParticle(const ThermalParticle &part)
Adds a new particle specie to the list.
The main namespace where all classes and functions of the Thermal-FIST library reside.
std::pair< double, int > SingleDecayContribution
void WriteTableToFile(const std::string &OutputFile="", bool WriteAntiParticles=false)
Writes the particle list to file.
long long IdToPdg(int id) const
Transforms 0-based particle id number to a PDG ID.
static const std::string flag_noexcitednuclei
static const std::string flag_nostrangeness
void RestoreBranchingRatios()
Restore the original values of all the branching ratios.
SortModeType SortMode() const
Current mode to sort particle species.
ThermalParticle & ParticleByPDG(long long pdgid)
ThermalParticle object corresponding to particle species with a provided PDG ID.