CMS 3D CMS Logo

GrandCanonical.cc
Go to the documentation of this file.
1 /*
2 
3 Nikolai Amelin, Ludmila Malinina, Timur Pocheptsov (C) JINR/Dubna
4 amelin@sunhe.jinr.ru, malinina@sunhe.jinr.ru, pocheptsov@sunhe.jinr.ru
5 November. 2, 2005
6 
7 */
8 #include <iostream>
9 #include <TMath.h>
10 
14 
16  fInitialized = kFALSE;
17  fNMax = -1111;
18  fTemperature = -1111;
19  fBaryonPotential = -1111;
20  fStrangePotential = -1111;
21  fElectroPotential = -1111;
22  fCharmPotential = -1111;
23 }
24 
26  double temperature,
27  double baryonPotential,
28  double strangePotential,
29  double electroPotential,
30  double charmPotential) {
31  fNMax = nmax;
33  fBaryonPotential = baryonPotential;
34  fStrangePotential = strangePotential;
35  fElectroPotential = electroPotential;
36  fCharmPotential = charmPotential;
37  fInitialized = kTRUE;
38 }
39 
41 
44  if (fNMax != -1111 && fBaryonPotential != -1111 && fStrangePotential != -1111 && fElectroPotential != -1111 &&
45  fCharmPotential != -1111)
46  fInitialized = kTRUE;
47 }
48 
51  if (fNMax != -1111 && fTemperature != -1111 && fStrangePotential != -1111 && fElectroPotential != -1111 &&
52  fCharmPotential != -1111)
53  fInitialized = kTRUE;
54 }
55 
58  if (fNMax != -1111 && fTemperature != -1111 && fBaryonPotential != -1111 && fElectroPotential != -1111 &&
59  fCharmPotential != -1111)
60  fInitialized = kTRUE;
61 }
62 
65  if (fNMax != -1111 && fTemperature != -1111 && fBaryonPotential != -1111 && fStrangePotential != -1111 &&
66  fCharmPotential != -1111)
67  fInitialized = kTRUE;
68 }
69 
72  if (fNMax != -1111 && fTemperature != -1111 && fBaryonPotential != -1111 && fStrangePotential != -1111 &&
73  fElectroPotential != -1111)
74  fInitialized = kTRUE;
75 }
76 
78  fNMax = value;
79  if (fTemperature != -1111 && fBaryonPotential != -1111 && fStrangePotential != -1111 && fElectroPotential != -1111 &&
80  fCharmPotential != -1111)
81  fInitialized = kTRUE;
82 }
83 
85  // Check if all the thermodinamic parameters are set
86  if (!fInitialized)
87  Fatal("GrandCanonical::ParticleEnergyDensity", "GrandCanonical object not fully initialized!!");
88 
89  // Compute the particle energy density
90  double degFactor = 2. * particle->GetSpin() + 1.; // degeneracy factor
91  double mass = particle->GetMass(); // PDG table mass
92  double d = int(2. * particle->GetSpin()) & 1 ? 1. : -1; // Bose-Einstein/Fermi-Dirac factor
93  double preFactor = (degFactor * mass * mass * fTemperature * fTemperature / hbarc / hbarc / hbarc) /
94  (2. * TMath::Pi() * TMath::Pi());
95 
96  double postFactor = 0.;
97  //compute chemical potential
98  double potential = fBaryonPotential * particle->GetBaryonNumber() + fStrangePotential * particle->GetStrangeness() +
100 
101  for (int n = 1; n <= fNMax; ++n) {
102  postFactor +=
103  TMath::Power(-d, n + 1) / (n * n) * TMath::Exp(n * potential / fTemperature) *
104  (3. * HankelKn(2, n * mass / fTemperature) + n * mass / fTemperature * HankelK1(n * mass / fTemperature));
105  }
106  return preFactor * postFactor;
107 }
108 
110  // Check if all the thermodinamic parameters are set
111  if (!fInitialized)
112  Fatal("GrandCanonical::ParticleNumberDensity", "GrandCanonical object not fully initialized!!");
113 
114  double degFactor = 2. * particle->GetSpin() + 1.;
115  double mass = particle->GetMass();
116  double d = int(2 * particle->GetSpin()) & 1 ? 1. : -1.;
117  double preFactor =
118  (degFactor * mass * mass * fTemperature / hbarc / hbarc / hbarc) / (2. * TMath::Pi() * TMath::Pi());
119 
120  double postFactor = 0.;
121  double potential = fBaryonPotential * particle->GetBaryonNumber() + fStrangePotential * particle->GetStrangeness() +
122  fElectroPotential * particle->GetElectricCharge() + fCharmPotential * particle->GetCharmness();
123 
124  for (int n = 1; n <= fNMax; ++n) {
125  postFactor +=
126  TMath::Power(-d, n + 1) / n * TMath::Exp(n * potential / fTemperature) * HankelKn(2, n * mass / fTemperature);
127  }
128  return preFactor * postFactor;
129 }
130 
132  // Check if all the thermodinamic parameters are set
133  if (!fInitialized)
134  Fatal("GrandCanonical::EnergyDensity", "GrandCanonical object not fully initialized!!");
135 
136  double meanEnergyDensity = 0.;
137 
138  for (int currParticle = 0; currParticle < database->GetNParticles(); currParticle++) {
139  ParticlePDG* particle = database->GetPDGParticleByIndex(currParticle);
140  meanEnergyDensity += ParticleEnergyDensity(particle);
141  }
142 
143  return meanEnergyDensity;
144 }
145 
147  // Check if all the thermodinamic parameters are set
148  if (!fInitialized)
149  Fatal("GrandCanonical::BaryonDensity", "GrandCanonical object not fully initialized!!");
150 
151  double meanBaryonDensity = 0.;
152 
153  for (int currParticle = 0; currParticle < database->GetNParticles(); currParticle++) {
154  ParticlePDG* particle = database->GetPDGParticleByIndex(currParticle);
155  meanBaryonDensity += ParticleNumberDensity(particle) * particle->GetBaryonNumber();
156  }
157  return meanBaryonDensity;
158 }
159 
161  // Check if all the thermodinamic parameters are set
162  if (!fInitialized)
163  Fatal("GrandCanonical::StrangeDensity", "GrandCanonical object not fully initialized!!");
164 
165  double meanStrangeDensity = 0.;
166 
167  for (int currParticle = 0; currParticle < database->GetNParticles(); currParticle++) {
168  ParticlePDG* particle = database->GetPDGParticleByIndex(currParticle);
169  meanStrangeDensity += ParticleNumberDensity(particle) * particle->GetStrangeness();
170  }
171 
172  return meanStrangeDensity;
173 }
174 
176  // Check if all the thermodinamic parameters are set
177  if (!fInitialized)
178  Fatal("GrandCanonical::ElectroDensity", "GrandCanonical object not fully initialized!!");
179 
180  double meanElectroDensity = 0.;
181 
182  //hadrons
183  for (int currParticle = 0; currParticle < database->GetNParticles(); currParticle++) {
184  ParticlePDG* particle = database->GetPDGParticleByIndex(currParticle);
185  meanElectroDensity += ParticleNumberDensity(particle) * particle->GetElectricCharge();
186  }
187 
188  return meanElectroDensity;
189 }
190 
192  // Check if all the thermodinamic parameters are set
193  if (!fInitialized)
194  Fatal("GrandCanonical::CharmDensity", "GrandCanonical object not fully initialized!!");
195 
196  double meanCharmDensity = 0.;
197 
198  for (int currParticle = 0; currParticle < database->GetNParticles(); currParticle++) {
199  ParticlePDG* particle = database->GetPDGParticleByIndex(currParticle);
200  meanCharmDensity += ParticleNumberDensity(particle) * particle->GetCharmness();
201  }
202 
203  return meanCharmDensity;
204 }
const double Pi
double ParticleEnergyDensity(ParticlePDG *particle)
int GetNParticles(bool all=kFALSE)
Definition: DatabasePDG.cc:582
double ParticleNumberDensity(ParticlePDG *particle)
const double hbarc
Definition: MathUtil.h:18
double ElectroPotential()
double HankelKn(int n, double x)
double EnergyDensity(DatabasePDG *database)
double fStrangePotential
double BaryonDensity(DatabasePDG *database)
double GetSpin()
Definition: ParticlePDG.h:73
ParticlePDG * GetPDGParticleByIndex(int index)
Definition: DatabasePDG.cc:198
double GetCharmness()
Definition: ParticlePDG.h:88
double CharmPotential()
double GetElectricCharge()
Definition: ParticlePDG.h:89
double fBaryonPotential
double BaryonPotential()
double CharmDensity(DatabasePDG *database)
Definition: value.py:1
double fElectroPotential
double GetBaryonNumber()
Definition: ParticlePDG.h:82
double HankelK1(double x)
d
Definition: ztail.py:151
double GetStrangeness()
Definition: ParticlePDG.h:87
double fCharmPotential
double Temperature()
double StrangeDensity(DatabasePDG *database)
double GetMass()
Definition: ParticlePDG.h:70
double ElectroDensity(DatabasePDG *database)
double StrangePotential()