Thermal-FIST  1.3
Package for hadron resonance gas model applications
ThermalModelPCE.h
Go to the documentation of this file.
1 #ifndef THERMALMODELPCE_H
2 #define THERMALMODELPCE_H
3 #include <map>
4 
6 #include "HRGBase/Broyden.h"
7 
8 namespace thermalfist {
9 
36  {
37  public:
45  enum PCEMode {
50  };
51 
52 
60  ThermalModelPCE(ThermalModelBase *THMbase, bool FreezeLonglived = false, double LonglivedResoWidthCut = 0.015);
61 
66  virtual ~ThermalModelPCE(void) { }
67 
69 
76  void UseSahaForNuclei(bool flag) { m_UseSahaForNuclei = true; m_StabilityFlagsSet = false; }
77  bool UseSahaForNuclei() const { return m_UseSahaForNuclei; }
79 
81 
92 
94 
101  void SetLonglivedResonanceWidthCut(double width_cut) { m_ResoWidthCut = width_cut; FreezeLonglivedResonances(true); }
102  double LonglivedResonanceWidthCut() const { return m_ResoWidthCut; }
104 
106 
113  virtual void SetStabilityFlags(const std::vector<int>& StabilityFlags);
114  const std::vector<int>& StabilityFlags() const { return m_StabilityFlags; }
116 
118 
125  void SetChemicalFreezeout(const ThermalModelParameters& params, const std::vector<double>& ChemInit = std::vector<double>(0));
127 
129 
134  void SetEntropyDensityChem(double sinit) { m_EntropyDensityInit = sinit; }
135  double EntropyDensityChem() const { return m_EntropyDensityInit; }
137 
141  ThermalModelBase* ThermalModel() const { return m_model; }
142 
151  virtual void CalculatePCE(double param, PCEMode mode = AtFixedTemperature);
152 
156  const std::vector<double>& ChemicalPotentials() const { return m_ChemCurrent; }
157 
161  double Volume() const { return m_ParametersCurrent.V; }
162 
168  static void PrepareNucleiForPCE(ThermalParticleSystem *TPS);
169 
178  static std::vector<int> ComputePCEStabilityFlags(
179  const ThermalParticleSystem* TPS,
180  bool SahaEquationForNuclei = true,
181  bool FreezeLongLived = false,
182  double WidthCut = 0.015);
183 
190 
191 
192  protected:
194 
197 
202 
205 
208 
211  std::vector<int> m_StabilityFlags;
213  std::vector< std::vector<double> > m_EffectiveCharges;
214  std::vector<int> m_StableMapTo;
215 
218  std::vector<double> m_ChemInit;
219  std::vector<double> m_DensitiesInit;
220  std::vector<double> m_StableDensitiesInit;
223 
226  std::vector<double> m_ChemCurrent;
227 
229  {
230  public:
231  BroydenEquationsPCE(ThermalModelPCE *model, int mode = 0) : BroydenEquations(), m_THM(model), m_Mode(mode) { m_N = m_THM->m_StableComponentsNumber + 1; }
232  std::vector<double> Equations(const std::vector<double> &x);
233  private:
234  ThermalModelPCE *m_THM;
235  int m_Mode;
236  };
237 
238  };
239 
240 } // namespace thermalfist
241 
242 #endif
243 
void SetLonglivedResonanceWidthCut(double width_cut)
The threshold resonance width value to consider the resonance long-lived and its abundance frozen in ...
Abstract base class for an HRG model implementation.
const std::vector< double > & ChemicalPotentials() const
std::vector< double > m_ChemCurrent
Partial chemical equilibrium at fixed value of the temperature.
Class implementing HRG in partial chemical equilibrium.
double EntropyDensityChem() const
void SetEntropyDensityChem(double sinit)
Sets the entropy density at the chemical freeze-out.
void SetChemicalFreezeout(const ThermalModelParameters &params, 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.
int m_N
The number of equations.
Definition: Broyden.h:66
Class containing the particle list.
bool FreezeLonglivedResonances() const
std::vector< int > m_StabilityFlags
std::vector< double > m_ChemInit
Structure containing all thermal parameters of the model.
Abstract class which defines the system of non-linear equations to be solved by the Broyden&#39;s method...
Definition: Broyden.h:31
virtual void CalculatePCE(double param, PCEMode mode=AtFixedTemperature)
Solves the equations of partial chemical equilibrium at a fixed temperature or a fixed volume...
bool m_FreezeLonglivedResonances
Whether long-lived resonances are frozen at Tch.
std::vector< double > m_StableDensitiesInit
void FreezeLonglivedResonances(bool flag)
Whether long-lived resonances yields should be frozen.
bool m_IsCalculated
Whether PCE has been calculated.
Partial chemical equilibrium at fixed value of the volume.
ThermalModelPCE(ThermalModelBase *THMbase, bool FreezeLonglived=false, double LonglivedResoWidthCut=0.015)
Construct a new ThermalModelPCE object.
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.
bool m_UseSahaForNuclei
Whether nuclear abundances are calculated via the Saha equation.
std::vector< int > m_StableMapTo
ThermalModelParameters m_ParametersCurrent
The current PCE thermal paratmeres and chemical potentials.
std::vector< std::vector< double > > m_EffectiveCharges
virtual ~ThermalModelPCE(void)
Destroy the ThermalModelPCE object.
std::vector< double > m_DensitiesInit
void UseSahaForNuclei(bool flag)
Whether the nuclear abundances are evaluated through the Saha equation.
ThermalModelParameters m_ParametersInit
Parameters at the chemical freeze-out.
bool m_StabilityFlagsSet
PCE configuration, list of stable species etc.
Implementation of the generic Broyden&#39;s method routines.
BroydenEquationsPCE(ThermalModelPCE *model, int mode=0)
double LonglivedResonanceWidthCut() const
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...
double m_ResoWidthCut
Resonance width cut for freezeing the resonance abundances.
const std::vector< int > & StabilityFlags() const
The main namespace where all classes and functions of the Thermal-FIST library reside.
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...