Thermal-FIST  1.3
Package for hadron resonance gas model applications
ThermalModelCanonical.h
Go to the documentation of this file.
1 /*
2  * Thermal-FIST package
3  *
4  * Copyright (c) 2015-2019 Volodymyr Vovchenko
5  *
6  * GNU General Public License (GPLv3 or later)
7  */
8 #ifndef THERMALMODELCANONICAL_H
9 #define THERMALMODELCANONICAL_H
10 
11 #include <map>
12 
13 
15 
16 namespace thermalfist {
17 
24  {
25  int B;
26  int Q;
27  int S;
28  int C;
29 
38  QuantumNumbers(int iB = 0, int iQ = 0, int iS = 0, int iC = 0) :
39  B(iB), Q(iQ), S(iS), C(iC) { }
40  const bool operator < (const QuantumNumbers &r) const {
41  if (B != r.B)
42  return (B < r.B);
43  else if (Q != r.Q)
44  return (Q < r.Q);
45  else if (S != r.S)
46  return (S < r.S);
47  else
48  return (C < r.C);
49  }
50  };
51 
65  public ThermalModelBase
66  {
67  public:
75 
80  virtual ~ThermalModelCanonical(void);
81 
91  virtual void CalculateQuantumNumbersRange(bool computeFluctuations = false);
92 
107  virtual void CalculatePartitionFunctions(double Vc = -1.);
108 
121  virtual bool IsParticleCanonical(const ThermalParticle &part);
122 
130  virtual void ConserveBaryonCharge(bool conserve = true) { m_BCE = static_cast<int>(conserve); }
131 
139  virtual void ConserveElectricCharge(bool conserve = true) { m_QCE = static_cast<int>(conserve); }
140 
148  virtual void ConserveStrangeness(bool conserve = true) { m_SCE = static_cast<int>(conserve); }
149 
157  virtual void ConserveCharm(bool conserve = true) { m_CCE = static_cast<int>(conserve); }
158 
159  virtual bool IsConservedChargeCanonical(ConservedCharge::Name charge) const;
160 
167  virtual double GetGCEDensity(int i) const;
168 
174  int IntegrationIterationsMultiplier() const { return m_IntegrationIterationsMultiplier; }
175 
183  void SetIntegrationIterationsMultiplier(int multiplier) { (multiplier > 0 ? m_IntegrationIterationsMultiplier = multiplier : m_IntegrationIterationsMultiplier = 1); }
184 
185 
186  // Override functions begin
187 
188  void ChangeTPS(ThermalParticleSystem *TPS);
189 
190  virtual void SetStatistics(bool stats);
191 
192  virtual void FixParameters();
193 
194  virtual void FixParametersNoReset();
195 
196  virtual void CalculatePrimordialDensities();
197 
198  virtual void ValidateCalculation();
199 
200  virtual double ParticleScaledVariance(int part);
201 
202  virtual void CalculateTwoParticleCorrelations();
203 
210  virtual void CalculateFluctuations();
211 
212  virtual double CalculateEnergyDensity();
213 
214  virtual double CalculatePressure();
215 
216  virtual double CalculateEntropyDensity();
217 
218  virtual double ParticleScalarDensity(int /*part*/) { return 0.; }
219 
220  // Override functions end
221 
222  private:
224 
231  void PrepareModelGCE();
233  void CleanModelGCE();
235 
236  protected:
237 
244  std::vector<QuantumNumbers> m_QNvec;
245 
251  std::map<QuantumNumbers, int> m_QNMap;
252 
260  std::vector<double> m_Corr;
261 
271  std::vector<double> m_PartialZ;
272 
280 
281  int m_BMAX, m_QMAX, m_SMAX, m_CMAX;
282  int m_BMAX_list, m_QMAX_list, m_SMAX_list, m_CMAX_list;
283 
284  double m_MultExp;
286 
288 
289  int m_BCE, m_QCE, m_SCE, m_CCE;
290 
291  bool m_Banalyt;
292  };
293 
294 } // namespace thermalfist
295 
296 #endif
Abstract base class for an HRG model implementation.
std::vector< QuantumNumbers > m_QNvec
A set of QuantumNumbers combinations for which it is necessary to compute the canonical partition fun...
int IntegrationIterationsMultiplier() const
The multiplier of the number of iterations in the numerical integration.
virtual void ConserveStrangeness(bool conserve=true)
Specifies whether the strangeness charge is treated canonically.
void SetIntegrationIterationsMultiplier(int multiplier)
Assigns the multiplier of the number of iterations in the numerical integration.
Class containing the particle list.
Structure containing all thermal parameters of the model.
const bool operator<(const QuantumNumbers &r) const
virtual void ConserveCharm(bool conserve=true)
Specifies whether the charm charge is treated canonically.
Class containing all information about a particle specie.
virtual void ConserveBaryonCharge(bool conserve=true)
Specifies whether the baryon number is treated canonically.
Name
Set of all conserved charges considered.
std::vector< double > m_PartialZ
The computed canonical partition function.
QuantumNumbers(int iB=0, int iQ=0, int iS=0, int iC=0)
Construct a new QuantumNumbers object.
Struct containing a set of quantum numbers: Baryon number, electric charge, strangeness, and charm.
Class implementing the ideal HRG model in the canonical ensemble.
std::vector< double > m_Corr
A vector of chemical factors.
virtual double ParticleScalarDensity(int)
The scalar density of the particle species i.
Class implementing the Ideal HRG model.
virtual void ConserveElectricCharge(bool conserve=true)
Specifies whether the electric charge is treated canonically.
The main namespace where all classes and functions of the Thermal-FIST library reside.
int m_IntegrationIterationsMultiplier
A multiplier to increase the number of iterations during the numerical integration used to calculate ...
std::map< QuantumNumbers, int > m_QNMap
Maps QuantumNumbers combinations to a 1-dimensional index.