CbmRoot
ThermalModel.h
Go to the documentation of this file.
1 #ifndef THERMALMODEL_H
2 #define THERMALMODEL_H
3 #include "ThermalModelBase.h"
4 
5 #include <cmath>
6 //#include <omp.h>
7 
8 
9 class ThermalModel : public ThermalModelBase {
10 public:
11  ThermalModel(/*std::string InputFile="",*/ ThermalParticleSystem* TPS_,
12  double T = 0.125,
13  double muB = 0.45,
14  double muS = 0.1,
15  double muQ = -0.01,
16  double gammaS = 1.,
17  double V = 4000.,
18  double R = 1.)
19  : ThermalModelBase(TPS_, T, muB, muS, muQ, gammaS, V, R) {
20  densities.resize(TPS->fParticles.size());
21  densitiestotal.resize(TPS->fParticles.size());
22  }
23  ThermalModel(/*std::string InputFile="",*/ ThermalParticleSystem* TPS_,
24  const ThermalModelParameters& params)
25  : ThermalModelBase(TPS_, params) {
26  densities.resize(TPS->fParticles.size());
27  densitiestotal.resize(TPS->fParticles.size());
28  }
29  virtual ~ThermalModel(void);
30 
31  virtual void ChangeTPS(ThermalParticleSystem* TPS_) {
33  densities.resize(TPS->fParticles.size());
34  densitiestotal.resize(TPS->fParticles.size());
35  }
36 
37  virtual void FixParameters();
38  virtual void FixParameters(double QB); // And zero net strangeness
39  void SolveTwoRatios(int PDG11,
40  int PDG12,
41  double R1,
42  int PDG21,
43  int PDG22,
44  double R2,
45  double QB = 0.5); // And zero strangeness
46  virtual void CalculateDensities() {
47  for (unsigned int i = 0; i < TPS->fParticles.size(); ++i) {
48  densities[i] = TPS->fParticles[i].CalculateDensity(Parameters.T,
53  0,
54  fUseWidth);
55  }
56 
57  //#pragma omp parallel for
58  for (int i = 0; i < static_cast<int>(TPS->fParticles.size()); ++i) {
59  //if (TPS->fParticles[i].fStable==0) densitiestotal[i] = 0.;
60  //else
61  {
63  for (int j = 0;
64  j < static_cast<int>(TPS->fParticles[i].ResonanceBR.size());
65  ++j)
66  if (i != TPS->fParticles[i].ResonanceBR[j].second)
67  densitiestotal[i] +=
68  TPS->fParticles[i].ResonanceBR[j].first
69  * densities[TPS->fParticles[i].ResonanceBR[j].second];
70  }
71  }
72  fCalculated = true;
73  }
74  virtual double GetParticlePrimordialDensity(int part) {
76  if (part >= static_cast<int>(densities.size())) return 0.;
77  return densities[part];
78  }
79  virtual double GetParticleTotalDensity(int part) {
81  if (part >= static_cast<int>(densitiestotal.size())) return 0.;
82  return densitiestotal[part];
83  }
84  virtual double CalculateHadronDensity() {
86  double ret = 0.;
87  for (unsigned int i = 0; i < TPS->fParticles.size(); ++i)
88  ret += densities[i];
89  return ret;
90  }
91  virtual double CalculateBaryonDensity() {
93  double ret = 0.;
94  for (unsigned int i = 0; i < TPS->fParticles.size(); ++i)
95  ret += TPS->fParticles[i].fB * densities[i];
96  return ret;
97  }
98  virtual double CalculateChargeDensity() {
100  double ret = 0.;
101  for (unsigned int i = 0; i < TPS->fParticles.size(); ++i)
102  ret += TPS->fParticles[i].fC * densities[i];
103  return ret;
104  }
105  virtual double CalculateStrangenessDensity() {
107  double ret = 0.;
108  for (unsigned int i = 0; i < TPS->fParticles.size(); ++i)
109  ret += TPS->fParticles[i].fS * densities[i];
110  return ret;
111  }
112  virtual double CalculateCharmDensity() {
114  double ret = 0.;
115  for (unsigned int i = 0; i < TPS->fParticles.size(); ++i)
116  ret += TPS->fParticles[i].fCharm * densities[i];
117  return ret;
118  }
121  double ret = 0.;
122  for (unsigned int i = 0; i < TPS->fParticles.size(); ++i)
123  ret += TPS->fParticles[i].fAbsS * densities[i];
124  return ret;
125  }
126  virtual double CalculateAbsoluteCharmDensity() {
128  double ret = 0.;
129  for (unsigned int i = 0; i < TPS->fParticles.size(); ++i)
130  ret += TPS->fParticles[i].fAbsC * densities[i];
131  return ret;
132  }
133  virtual double CalculateEnergyDensity() {
134  double ret = 0.;
135  for (unsigned int i = 0; i < TPS->fParticles.size(); ++i)
136  ret += TPS->fParticles[i].CalculateDensity(Parameters.T,
137  Parameters.muB,
138  Parameters.muS,
139  Parameters.muQ,
141  1,
142  fUseWidth);
143  return ret;
144  }
145  virtual double CalculateEntropyDensity() {
146  double ret = 0.;
147  for (unsigned int i = 0; i < TPS->fParticles.size(); ++i)
148  ret += TPS->fParticles[i].CalculateDensity(Parameters.T,
149  Parameters.muB,
150  Parameters.muS,
151  Parameters.muQ,
153  2,
154  fUseWidth);
155  return ret;
156  }
158  double ret = 0.;
159  for (unsigned int i = 0; i < TPS->fParticles.size(); ++i)
160  if (TPS->fParticles[i].fB != 0)
161  ret += TPS->fParticles[i].CalculateDensity(Parameters.T,
162  Parameters.muB,
163  Parameters.muS,
164  Parameters.muQ,
166  2,
167  fUseWidth);
168  return ret;
169  }
171  double ret = 0.;
172  for (unsigned int i = 0; i < TPS->fParticles.size(); ++i)
173  if (TPS->fParticles[i].fB == 0)
174  ret += TPS->fParticles[i].CalculateDensity(Parameters.T,
175  Parameters.muB,
176  Parameters.muS,
177  Parameters.muQ,
179  2,
180  fUseWidth);
181  return ret;
182  }
183  virtual double CalculatePressure() {
184  double ret = 0.;
185  for (unsigned int i = 0; i < TPS->fParticles.size(); ++i)
186  ret += TPS->fParticles[i].CalculateDensity(Parameters.T,
187  Parameters.muB,
188  Parameters.muS,
189  Parameters.muQ,
191  3,
192  fUseWidth);
193  return ret;
194  }
195  virtual double CalculateShearViscosity() { return 0.; }
196 };
197 
198 #endif
ThermalModelParameters::muS
double muS
Definition: ThermalModelBase.h:7
ThermalParticleSystem::fParticles
std::vector< ThermalParticle > fParticles
Definition: ThermalParticleSystem.h:9
ThermalModel
Definition: ThermalModel.h:9
ThermalModelBase::densitiestotal
std::vector< double > densitiestotal
Definition: ThermalModelBase.h:33
ThermalModel::GetParticlePrimordialDensity
virtual double GetParticlePrimordialDensity(int part)
Definition: ThermalModel.h:74
ThermalModel::~ThermalModel
virtual ~ThermalModel(void)
Definition: ThermalModel.cxx:109
ThermalModelBase.h
i
int i
Definition: L1/vectors/P4_F32vec4.h:25
ThermalModel::FixParameters
virtual void FixParameters()
Definition: ThermalModel.cxx:111
ThermalModel::CalculateHadronDensity
virtual double CalculateHadronDensity()
Definition: ThermalModel.h:84
ThermalModel::ChangeTPS
virtual void ChangeTPS(ThermalParticleSystem *TPS_)
Definition: ThermalModel.h:31
ThermalModelParameters::gammaS
double gammaS
Definition: ThermalModelBase.h:7
ThermalModel::CalculateDensities
virtual void CalculateDensities()
Definition: ThermalModel.h:46
ThermalModel::CalculateShearViscosity
virtual double CalculateShearViscosity()
Definition: ThermalModel.h:195
ThermalModel::CalculateMesonMatterEntropyDensity
virtual double CalculateMesonMatterEntropyDensity()
Definition: ThermalModel.h:170
ThermalModelBase
Definition: ThermalModelBase.h:18
ThermalModelBase::ChangeTPS
virtual void ChangeTPS(ThermalParticleSystem *TPS_)
Definition: ThermalModelBase.h:125
ThermalModel::CalculateAbsoluteStrangenessDensity
virtual double CalculateAbsoluteStrangenessDensity()
Definition: ThermalModel.h:119
ThermalModelBase::TPS
ThermalParticleSystem * TPS
Definition: ThermalModelBase.h:20
ThermalModelBase::fCalculated
bool fCalculated
Definition: ThermalModelBase.h:23
ThermalModelParameters::muB
double muB
Definition: ThermalModelBase.h:7
ThermalModel::CalculatePressure
virtual double CalculatePressure()
Definition: ThermalModel.h:183
ThermalModel::SolveTwoRatios
void SolveTwoRatios(int PDG11, int PDG12, double R1, int PDG21, int PDG22, double R2, double QB=0.5)
ThermalModelBase::fUseWidth
bool fUseWidth
Definition: ThermalModelBase.h:22
ThermalModel::CalculateChargeDensity
virtual double CalculateChargeDensity()
Definition: ThermalModel.h:98
ThermalModelParameters::T
double T
Definition: ThermalModelBase.h:7
ThermalModel::CalculateEntropyDensity
virtual double CalculateEntropyDensity()
Definition: ThermalModel.h:145
ThermalModel::ThermalModel
ThermalModel(ThermalParticleSystem *TPS_, const ThermalModelParameters &params)
Definition: ThermalModel.h:23
ThermalParticleSystem
Definition: ThermalParticleSystem.h:7
ThermalModel::CalculateStrangenessDensity
virtual double CalculateStrangenessDensity()
Definition: ThermalModel.h:105
ThermalModel::CalculateCharmDensity
virtual double CalculateCharmDensity()
Definition: ThermalModel.h:112
ThermalModelParameters
Definition: ThermalModelBase.h:6
ThermalModel::CalculateBaryonMatterEntropyDensity
virtual double CalculateBaryonMatterEntropyDensity()
Definition: ThermalModel.h:157
ThermalModelParameters::muQ
double muQ
Definition: ThermalModelBase.h:7
ThermalModelBase::densities
std::vector< double > densities
Definition: ThermalModelBase.h:32
ThermalModel::CalculateAbsoluteCharmDensity
virtual double CalculateAbsoluteCharmDensity()
Definition: ThermalModel.h:126
ThermalModelBase::Parameters
ThermalModelParameters Parameters
Definition: ThermalModelBase.h:21
ThermalModel::GetParticleTotalDensity
virtual double GetParticleTotalDensity(int part)
Definition: ThermalModel.h:79
ThermalModel::CalculateEnergyDensity
virtual double CalculateEnergyDensity()
Definition: ThermalModel.h:133
ThermalModel::ThermalModel
ThermalModel(ThermalParticleSystem *TPS_, double T=0.125, double muB=0.45, double muS=0.1, double muQ=-0.01, double gammaS=1., double V=4000., double R=1.)
Definition: ThermalModel.h:11
ThermalModel::CalculateBaryonDensity
virtual double CalculateBaryonDensity()
Definition: ThermalModel.h:91