test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 
25 GrandCanonical::GrandCanonical(int nmax, double temperature, double baryonPotential, double strangePotential, double electroPotential, double charmPotential) {
26  fNMax = nmax;
27  fTemperature = temperature;
28  fBaryonPotential = baryonPotential;
29  fStrangePotential = strangePotential;
30  fElectroPotential = electroPotential;
31  fCharmPotential = charmPotential;
32  fInitialized = kTRUE;
33 }
34 
36 
39  if(fNMax!=-1111 && fBaryonPotential!=-1111 && fStrangePotential!=-1111 && fElectroPotential!=-1111 && fCharmPotential!=-1111)
40  fInitialized = kTRUE;
41 }
42 
45  if(fNMax!=-1111 && fTemperature!=-1111 && fStrangePotential!=-1111 && fElectroPotential!=-1111 && fCharmPotential!=-1111)
46  fInitialized = kTRUE;
47 }
48 
51  if(fNMax!=-1111 && fTemperature!=-1111 && fBaryonPotential!=-1111 && fElectroPotential!=-1111 && fCharmPotential!=-1111)
52  fInitialized = kTRUE;
53 }
54 
57  if(fNMax!=-1111 && fTemperature!=-1111 && fBaryonPotential!=-1111 && fStrangePotential!=-1111 && fCharmPotential!=-1111)
58  fInitialized = kTRUE;
59 }
60 
63  if(fNMax!=-1111 && fTemperature!=-1111 && fBaryonPotential!=-1111 && fStrangePotential!=-1111 && fElectroPotential!=-1111)
64  fInitialized = kTRUE;
65 }
66 
68  fNMax = value;
69  if(fTemperature!=-1111 && fBaryonPotential!=-1111 && fStrangePotential!=-1111 && fElectroPotential!=-1111 && fCharmPotential!=-1111)
70  fInitialized = kTRUE;
71 }
72 
73 
75  // Check if all the thermodinamic parameters are set
76  if(!fInitialized)
77  Fatal("GrandCanonical::ParticleEnergyDensity", "GrandCanonical object not fully initialized!!");
78 
79  // Compute the particle energy density
80  double degFactor = 2.*particle->GetSpin() + 1.; // degeneracy factor
81  double mass = particle->GetMass(); // PDG table mass
82  double d = int(2.*particle->GetSpin()) & 1 ? 1. : -1; // Bose-Einstein/Fermi-Dirac factor
83  double preFactor = (degFactor*mass*mass*fTemperature*fTemperature/hbarc/hbarc/hbarc)/(2.*TMath::Pi()*TMath::Pi());
84 
85  double postFactor = 0.;
86  //compute chemical potential
87  double potential = fBaryonPotential * particle->GetBaryonNumber() +
88  fStrangePotential * particle->GetStrangeness() +
89  fElectroPotential * particle->GetElectricCharge() +
90  fCharmPotential * particle->GetCharmness();
91 
92  for(int n = 1; n <= fNMax; ++n) {
93  postFactor += TMath::Power(-d, n+1)/(n*n) *
94  TMath::Exp(n*potential/fTemperature) *
95  (3.*HankelKn(2, n*mass/fTemperature) + n*mass/fTemperature*HankelK1(n*mass/fTemperature));
96  }
97  return preFactor * postFactor;
98 }
99 
101  // Check if all the thermodinamic parameters are set
102  if(!fInitialized)
103  Fatal("GrandCanonical::ParticleNumberDensity", "GrandCanonical object not fully initialized!!");
104 
105  double degFactor = 2.*particle->GetSpin() + 1.;
106  double mass = particle->GetMass();
107  double d = int(2*particle->GetSpin()) & 1 ? 1. : -1.;
108  double preFactor = (degFactor*mass*mass*fTemperature/hbarc/hbarc/hbarc)/(2.*TMath::Pi()*TMath::Pi());
109 
110  double postFactor = 0.;
111  double potential = fBaryonPotential * particle->GetBaryonNumber() +
112  fStrangePotential * particle->GetStrangeness() +
113  fElectroPotential * particle->GetElectricCharge() +
114  fCharmPotential * particle->GetCharmness();
115 
116  for(int n = 1; n <= fNMax; ++n) {
117  postFactor += TMath::Power(-d, n+1)/n *
118  TMath::Exp(n*potential/fTemperature) *
119  HankelKn(2, n*mass/fTemperature);
120  }
121  return preFactor * postFactor;
122 }
123 
124 
126  // Check if all the thermodinamic parameters are set
127  if(!fInitialized)
128  Fatal("GrandCanonical::EnergyDensity", "GrandCanonical object not fully initialized!!");
129 
130  double meanEnergyDensity = 0.;
131 
132  for(int currParticle = 0; currParticle<database->GetNParticles(); currParticle++) {
133  ParticlePDG *particle = database->GetPDGParticleByIndex(currParticle);
134  meanEnergyDensity += ParticleEnergyDensity(particle);
135  }
136 
137  return meanEnergyDensity;
138 }
139 
141  // Check if all the thermodinamic parameters are set
142  if(!fInitialized)
143  Fatal("GrandCanonical::BaryonDensity", "GrandCanonical object not fully initialized!!");
144 
145  double meanBaryonDensity = 0.;
146 
147  for(int currParticle = 0; currParticle<database->GetNParticles(); currParticle++) {
148  ParticlePDG *particle = database->GetPDGParticleByIndex(currParticle);
149  meanBaryonDensity += ParticleNumberDensity(particle)*particle->GetBaryonNumber();
150  }
151  return meanBaryonDensity;
152 }
153 
155  // Check if all the thermodinamic parameters are set
156  if(!fInitialized)
157  Fatal("GrandCanonical::StrangeDensity", "GrandCanonical object not fully initialized!!");
158 
159  double meanStrangeDensity = 0.;
160 
161  for(int currParticle = 0; currParticle<database->GetNParticles(); currParticle++) {
162  ParticlePDG *particle = database->GetPDGParticleByIndex(currParticle);
163  meanStrangeDensity += ParticleNumberDensity(particle)*particle->GetStrangeness();
164  }
165 
166  return meanStrangeDensity;
167 }
168 
170  // Check if all the thermodinamic parameters are set
171  if(!fInitialized)
172  Fatal("GrandCanonical::ElectroDensity", "GrandCanonical object not fully initialized!!");
173 
174  double meanElectroDensity = 0.;
175 
176  //hadrons
177  for(int currParticle = 0; currParticle<database->GetNParticles(); currParticle++) {
178  ParticlePDG *particle = database->GetPDGParticleByIndex(currParticle);
179  meanElectroDensity += ParticleNumberDensity(particle)*particle->GetElectricCharge();
180  }
181 
182  return meanElectroDensity;
183 }
184 
186  // Check if all the thermodinamic parameters are set
187  if(!fInitialized)
188  Fatal("GrandCanonical::CharmDensity", "GrandCanonical object not fully initialized!!");
189 
190  double meanCharmDensity = 0.;
191 
192  for(int currParticle = 0; currParticle<database->GetNParticles(); currParticle++) {
193  ParticlePDG *particle = database->GetPDGParticleByIndex(currParticle);
194  meanCharmDensity += ParticleNumberDensity(particle)*particle->GetCharmness();
195  }
196 
197  return meanCharmDensity;
198 }
const double Pi
double ParticleEnergyDensity(ParticlePDG *particle)
int GetNParticles(bool all=kFALSE)
Definition: DatabasePDG.cc:574
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)
tuple d
Definition: ztail.py:151
double GetSpin()
Definition: ParticlePDG.h:71
ParticlePDG * GetPDGParticleByIndex(int index)
Definition: DatabasePDG.cc:202
double GetCharmness()
Definition: ParticlePDG.h:83
double CharmPotential()
double GetElectricCharge()
Definition: ParticlePDG.h:84
double fBaryonPotential
double BaryonPotential()
double CharmDensity(DatabasePDG *database)
double fElectroPotential
double GetBaryonNumber()
Definition: ParticlePDG.h:80
double HankelK1(double x)
double GetStrangeness()
Definition: ParticlePDG.h:82
double fCharmPotential
double Temperature()
double StrangeDensity(DatabasePDG *database)
double GetMass()
Definition: ParticlePDG.h:68
double ElectroDensity(DatabasePDG *database)
double StrangePotential()