15 ThermalModelPCE::ThermalModelPCE(
ThermalModelBase * THMbase,
bool FreezeLonglived,
double LonglivedResoWidthCut) :
17 m_UseSahaForNuclei(true),
18 m_FreezeLonglivedResonances(FreezeLonglived),
19 m_ResoWidthCut(LonglivedResoWidthCut),
20 m_ChemicalFreezeoutSet(false),
21 m_StabilityFlagsSet(false),
38 for (
int i = 0; i < TPShelper.
Particles().size(); ++i) {
49 for (
int i = 0; i < TPShelper.
Particles().size(); ++i) {
52 if (stab_index >= m_EffectiveCharges[0].size()) {
53 printf(
"**ERROR** ThermalModelPCE::SetStabilityFlags: Wrong number of stable components!\n");
56 m_EffectiveCharges[i][stab_index] = 1.;
58 for (
int j = 0; j < decayContributions.size(); ++j) {
59 const pair<double,int> Contrs = decayContributions[j];
60 m_EffectiveCharges[Contrs.second][stab_index] = Contrs.first;
120 printf(
"**ERROR** ThermalModelPCE::CalculatePCE:" 121 "Tried to make a PCE calculation without setting the chemical freze-out!" 122 "Call ThermalModelPCE::SetChemicalFreezeout() first.\n");
151 printf(
"**ERROR** ThermalModelPCE::CalculatePCE: Wrong number of stable components!\n");
169 PCEParams = broydn.
Solve(PCEParams);
185 vector<long long> nuclpdgs;
186 vector<string> nuclnames;
187 vector< vector<long long> > nuclcontent;
189 nuclpdgs.push_back(1000010020);
190 nuclnames.push_back(
"d");
191 nuclcontent.push_back(vector<long long>());
192 nuclcontent[nuclcontent.size() - 1].push_back(2212);
193 nuclcontent[nuclcontent.size() - 1].push_back(2112);
195 nuclpdgs.push_back(1000020030);
196 nuclnames.push_back(
"He3");
197 nuclcontent.push_back(vector<long long>());
198 nuclcontent[nuclcontent.size() - 1].push_back(2212);
199 nuclcontent[nuclcontent.size() - 1].push_back(2212);
200 nuclcontent[nuclcontent.size() - 1].push_back(2112);
202 nuclpdgs.push_back(1010010030);
203 nuclnames.push_back(
"H3La");
204 nuclcontent.push_back(vector<long long>());
205 nuclcontent[nuclcontent.size() - 1].push_back(2212);
206 nuclcontent[nuclcontent.size() - 1].push_back(2112);
207 nuclcontent[nuclcontent.size() - 1].push_back(3122);
209 nuclpdgs.push_back(1000020040);
210 nuclnames.push_back(
"He4");
211 nuclcontent.push_back(vector<long long>());
212 nuclcontent[nuclcontent.size() - 1].push_back(2212);
213 nuclcontent[nuclcontent.size() - 1].push_back(2112);
214 nuclcontent[nuclcontent.size() - 1].push_back(2212);
215 nuclcontent[nuclcontent.size() - 1].push_back(2112);
217 nuclpdgs.push_back(1010000020);
218 nuclnames.push_back(
"LambdaNeutron");
219 nuclcontent.push_back(vector<long long>());
220 nuclcontent[nuclcontent.size() - 1].push_back(2112);
221 nuclcontent[nuclcontent.size() - 1].push_back(3122);
223 nuclpdgs.push_back(1010010020);
224 nuclnames.push_back(
"LambdaProton");
225 nuclcontent.push_back(vector<long long>());
226 nuclcontent[nuclcontent.size() - 1].push_back(2212);
227 nuclcontent[nuclcontent.size() - 1].push_back(3122);
229 nuclpdgs.push_back(1020000020);
230 nuclnames.push_back(
"DiLambda");
231 nuclcontent.push_back(vector<long long>());
232 nuclcontent[nuclcontent.size() - 1].push_back(3122);
233 nuclcontent[nuclcontent.size() - 1].push_back(3122);
235 nuclpdgs.push_back(1000010030);
236 nuclnames.push_back(
"Triton");
237 nuclcontent.push_back(vector<long long>());
238 nuclcontent[nuclcontent.size() - 1].push_back(2212);
239 nuclcontent[nuclcontent.size() - 1].push_back(2112);
240 nuclcontent[nuclcontent.size() - 1].push_back(2112);
242 nuclpdgs.push_back(1010020040);
243 nuclnames.push_back(
"He4La");
244 nuclcontent.push_back(vector<long long>());
245 nuclcontent[nuclcontent.size() - 1].push_back(2212);
246 nuclcontent[nuclcontent.size() - 1].push_back(2112);
247 nuclcontent[nuclcontent.size() - 1].push_back(2212);
248 nuclcontent[nuclcontent.size() - 1].push_back(3122);
250 nuclpdgs.push_back(1010010040);
251 nuclnames.push_back(
"H4La");
252 nuclcontent.push_back(vector<long long>());
253 nuclcontent[nuclcontent.size() - 1].push_back(2212);
254 nuclcontent[nuclcontent.size() - 1].push_back(2112);
255 nuclcontent[nuclcontent.size() - 1].push_back(2112);
256 nuclcontent[nuclcontent.size() - 1].push_back(3122);
258 nuclpdgs.push_back(1010020050);
259 nuclnames.push_back(
"He5La");
260 nuclcontent.push_back(vector<long long>());
261 nuclcontent[nuclcontent.size() - 1].push_back(2212);
262 nuclcontent[nuclcontent.size() - 1].push_back(2112);
263 nuclcontent[nuclcontent.size() - 1].push_back(2212);
264 nuclcontent[nuclcontent.size() - 1].push_back(2112);
265 nuclcontent[nuclcontent.size() - 1].push_back(3122);
267 nuclpdgs.push_back(1020010020);
268 nuclnames.push_back(
"XiProton");
269 nuclcontent.push_back(vector<long long>());
270 nuclcontent[nuclcontent.size() - 1].push_back(3322);
271 nuclcontent[nuclcontent.size() - 1].push_back(2212);
273 nuclpdgs.push_back(1030000020);
274 nuclnames.push_back(
"OmegaProton");
275 nuclcontent.push_back(vector<long long>());
276 nuclcontent[nuclcontent.size() - 1].push_back(3334);
277 nuclcontent[nuclcontent.size() - 1].push_back(2212);
279 nuclpdgs.push_back(1040000020);
280 nuclnames.push_back(
"DiXi0");
281 nuclcontent.push_back(vector<long long>());
282 nuclcontent[nuclcontent.size() - 1].push_back(3322);
283 nuclcontent[nuclcontent.size() - 1].push_back(3322);
286 for (
int i = 0; i < parts.
Particles().size(); ++i) {
289 for (
int j = 0; j < nuclpdgs.size(); ++j) {
290 if (part.
PdgId() == nuclpdgs[j] || part.
PdgId() == -nuclpdgs[j]) {
293 if (part.
PdgId() < 0)
295 std::vector<long long> daughters;
296 for (
int k = 0; k < nuclcontent[j].size(); ++k) {
297 daughters.push_back(sign * nuclcontent[j][k]);
309 vector<int> stability_flags(0);
310 for (
int i = 0; i < TPS->
Particles().size(); ++i) {
317 if (SahaEquationForNuclei && abs(part.
BaryonCharge()) > 1)
325 if (part.
PdgId() == 310 || part.
PdgId() == 130)
327 if (part.
PdgId() == 311 || part.
PdgId() == -311)
330 stability_flags.push_back(frozen);
332 return stability_flags;
359 std::vector<double> ret(x.size(), 0.);
361 std::vector<double> Chem(m_THM->ThermalModel()->Densities().size(), 0.);
362 for (
int i = 0; i < m_THM->m_EffectiveCharges.size(); ++i) {
363 for (
int is = 0; is < m_THM->m_EffectiveCharges[i].size(); ++is) {
364 Chem[i] += m_THM->m_EffectiveCharges[i][is] * x[is];
372 const double& Vtmp = x[x.size() - 1];
373 m_THM->m_ParametersCurrent.V = Vtmp;
376 const double& Ttmp = x[x.size() - 1];
377 m_THM->m_ParametersCurrent.T = Ttmp;
379 double V = m_THM->m_ParametersCurrent.V;
384 for (
int is = 0; is < m_THM->m_StableComponentsNumber; ++is) {
386 for (
int i = 0; i < m_THM->m_EffectiveCharges.size(); ++i) {
387 totdens += m_THM->m_EffectiveCharges[i][is] * model->
Densities()[i];
391 ret[is] = (totdens * V) / (m_THM->m_StableDensitiesInit[is] * m_THM->m_ParametersInit.V) - 1.;
394 ret[ret.size() - 1] = (model->
CalculateEntropyDensity() * V) / (m_THM->m_EntropyDensityInit * m_THM->m_ParametersInit.V) - 1.;
Abstract base class for an HRG model implementation.
Structure containing information about a single decay channel of a particle.
const std::vector< double > & Densities() const
double m_EntropyDensityInit
Class implementing the Broyden method to solve a system of non-linear equations.
std::vector< double > m_ChemCurrent
double EntropyDensity()
Entropy density (fm )
ThermalModelBase * m_model
const ThermalParticle & Particle(int id) const
ThermalParticle object corresponding to particle species with a provided 0-based index.
void SetChemicalFreezeout(const ThermalModelParameters ¶ms, const std::vector< double > &ChemInit=std::vector< double >(0))
Sets the chemical freeze-out conditions to be used as an initial condition for PCE calculations...
std::vector< double > Equations(const std::vector< double > &x)
ThermalModelBase * ThermalModel() const
Pointer to the HRG model used in calculations.
virtual void SetStabilityFlags(const std::vector< int > &StabilityFlags)
Manually set the PCE stability flags for all species.
long long PdgId() const
Particle's Particle Data Group (PDG) ID number.
Class containing the particle list.
bool FreezeLonglivedResonances() const
double HadronDensity()
Total number density of all particle (fm )
virtual void CalculatePrimordialDensities()=0
Calculates the primordial densities of all species.
int m_StableComponentsNumber
std::vector< int > m_StabilityFlags
const std::vector< double > & ChemicalPotentials() const
A vector of chemical potentials of all particles.
virtual void SetParameters(const ThermalModelParameters ¶ms)
The thermal parameters.
double ResonanceWidth() const
Particle's width at the pole mass (GeV)
std::vector< double > m_ChemInit
Structure containing all thermal parameters of the model.
virtual void CalculatePCE(double param, PCEMode mode=AtFixedTemperature)
Solves the equations of partial chemical equilibrium at a fixed temperature or a fixed volume...
std::vector< double > m_StableDensitiesInit
double m_ParticleDensityInit
void FillCoefficientsDynamical()
Fills coefficients for mass integration in the eBW scheme.
bool UseSahaForNuclei() const
bool m_IsCalculated
Whether PCE has been calculated.
virtual void FillChemicalPotentials()
Sets the chemical potentials of all particles.
int BaryonCharge() const
Particle's baryon number.
Class containing all information about a particle specie.
std::vector< SingleDecayContribution > DecayContributionsToParticle
A vector of SingleDecayContribution where each element corresponds to a certain resonance species...
bool m_ChemicalFreezeoutSet
Whether the chemical freeze-out "initial" condition has been set.
static void PrepareNucleiForPCE(ThermalParticleSystem *TPS)
Fills the "decay" products of light nuclei in accordance with their baryon content.
virtual std::vector< double > Solve(const std::vector< double > &x0, BroydenSolutionCriterium *solcrit=NULL, int max_iterations=MAX_ITERS)
double DecayThresholdMassDynamical() const
const std::string & Name() const
Particle's name.
std::vector< int > m_StableMapTo
const std::vector< ThermalParticle > & Particles() const
Returns the vector of all particle species.
ThermalModelParameters m_ParametersCurrent
The current PCE thermal paratmeres and chemical potentials.
std::vector< std::vector< double > > m_EffectiveCharges
void SetStable(bool stable=true)
Sets particle stability flag.
virtual double CalculateEntropyDensity()=0
void UsePartialChemicalEquilibrium(bool usePCE)
Sets whether partial chemical equilibrium with additional chemical potentials is used.
double Mass() const
Particle's mass [GeV].
ThermalModelParameters m_ParametersInit
Parameters at the chemical freeze-out.
bool m_StabilityFlagsSet
PCE configuration, list of stable species etc.
bool ZeroWidthEnforced() const
Whether zero-width approximation is enforced for this particle species.
void FillResonanceDecays()
Computes the decay contributions of decaying resonances to all particle yields.
bool IsStable() const
Return particle stability flag.
virtual void CalculateFeeddown()
Calculates the total densities which include feeddown contributions.
const std::vector< DecayContributionsToAllParticles > & DecayContributionsByFeeddown() const
double LonglivedResonanceWidthCut() const
ParticleDecayType::DecayType DecayType() const
Decay type of the particle.
void ProcessDecays()
Computes the decay contributions of decaying resonances to all particle yields.
PCEMode
Whether partial chemical equilibrium should be calculated at a fixed value of the temperature or a fi...
void ApplyFixForBoseCondensation()
Modifies the decay threshold masses of bosonic resonances such that the Bose-Condesation does not occ...
const ParticleDecaysVector & Decays() const
A vector of particle's decays.
const std::vector< int > & StabilityFlags() const
The main namespace where all classes and functions of the Thermal-FIST library reside.
virtual void SetChemicalPotentials(const std::vector< double > &chem=std::vector< double >(0))
Sets the chemical potentials of all particles.
Feeddown from all particles marked as unstable.
void SetDecayThresholdMassDynamical(double threshold)
Set the threshold mass manually for use in the eBW scheme.
int ComponentsNumber() const
Number of different particle species in the list.
ThermalParticleSystem * TPS()
static std::vector< int > ComputePCEStabilityFlags(const ThermalParticleSystem *TPS, bool SahaEquationForNuclei=true, bool FreezeLongLived=false, double WidthCut=0.015)
Computes the PCE stability flags based on the provided particle list and a number of parameters...
int Statistics() const
Particle's statistics.