CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
GrandCanonical Class Reference

#include <GrandCanonical.h>

Public Member Functions

double BaryonDensity (DatabasePDG *database)
 
double BaryonPotential ()
 
void BaryonPotential (double value)
 
double CharmDensity (DatabasePDG *database)
 
double CharmPotential ()
 
void CharmPotential (double value)
 
double ElectroDensity (DatabasePDG *database)
 
double ElectroPotential ()
 
void ElectroPotential (double value)
 
double EnergyDensity (DatabasePDG *database)
 
 GrandCanonical ()
 
 GrandCanonical (int nmax, double temperature, double baryonPotential, double strangePotential, double electroPotential, double charmPotential)
 
int NMax ()
 
void NMax (int value)
 
double ParticleEnergyDensity (ParticlePDG *particle)
 
double ParticleNumberDensity (ParticlePDG *particle)
 
double StrangeDensity (DatabasePDG *database)
 
double StrangePotential ()
 
void StrangePotential (double value)
 
double Temperature ()
 
void Temperature (double value)
 
 ~GrandCanonical ()
 

Private Attributes

double fBaryonPotential
 
double fCharmPotential
 
double fElectroPotential
 
bool fInitialized
 
int fNMax
 
double fStrangePotential
 
double fTemperature
 

Detailed Description

Definition at line 14 of file GrandCanonical.h.

Constructor & Destructor Documentation

◆ GrandCanonical() [1/2]

GrandCanonical::GrandCanonical ( )

Definition at line 15 of file GrandCanonical.cc.

15  {
16  fInitialized = kFALSE;
17  fNMax = -1111;
18  fTemperature = -1111;
19  fBaryonPotential = -1111;
20  fStrangePotential = -1111;
21  fElectroPotential = -1111;
22  fCharmPotential = -1111;
23 }

References fBaryonPotential, fCharmPotential, fElectroPotential, fInitialized, fNMax, fStrangePotential, and fTemperature.

◆ GrandCanonical() [2/2]

GrandCanonical::GrandCanonical ( int  nmax,
double  temperature,
double  baryonPotential,
double  strangePotential,
double  electroPotential,
double  charmPotential 
)

Definition at line 25 of file GrandCanonical.cc.

30  {
31  fNMax = nmax;
33  fBaryonPotential = baryonPotential;
34  fStrangePotential = strangePotential;
35  fElectroPotential = electroPotential;
36  fCharmPotential = charmPotential;
37  fInitialized = kTRUE;
38 }

References fBaryonPotential, fCharmPotential, fElectroPotential, fInitialized, fNMax, fStrangePotential, fTemperature, and jvcParameters_cfi::temperature.

◆ ~GrandCanonical()

GrandCanonical::~GrandCanonical ( )

Definition at line 40 of file GrandCanonical.cc.

40 {}

Member Function Documentation

◆ BaryonDensity()

double GrandCanonical::BaryonDensity ( DatabasePDG database)

Definition at line 146 of file GrandCanonical.cc.

146  {
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 }

References fInitialized, ParticlePDG::GetBaryonNumber(), DatabasePDG::GetNParticles(), DatabasePDG::GetPDGParticleByIndex(), and ParticleNumberDensity().

◆ BaryonPotential() [1/2]

double GrandCanonical::BaryonPotential ( )
inline

Definition at line 40 of file GrandCanonical.h.

40 { return fBaryonPotential; }

References fBaryonPotential.

◆ BaryonPotential() [2/2]

void GrandCanonical::BaryonPotential ( double  value)

Definition at line 49 of file GrandCanonical.cc.

49  {
51  if (fNMax != -1111 && fTemperature != -1111 && fStrangePotential != -1111 && fElectroPotential != -1111 &&
52  fCharmPotential != -1111)
53  fInitialized = kTRUE;
54 }

References fBaryonPotential, fCharmPotential, fElectroPotential, fInitialized, fNMax, fStrangePotential, fTemperature, and relativeConstraints::value.

◆ CharmDensity()

double GrandCanonical::CharmDensity ( DatabasePDG database)

Definition at line 191 of file GrandCanonical.cc.

191  {
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 }

References fInitialized, ParticlePDG::GetCharmness(), DatabasePDG::GetNParticles(), DatabasePDG::GetPDGParticleByIndex(), and ParticleNumberDensity().

◆ CharmPotential() [1/2]

double GrandCanonical::CharmPotential ( )
inline

Definition at line 46 of file GrandCanonical.h.

46 { return fCharmPotential; }

References fCharmPotential.

◆ CharmPotential() [2/2]

void GrandCanonical::CharmPotential ( double  value)

Definition at line 70 of file GrandCanonical.cc.

70  {
72  if (fNMax != -1111 && fTemperature != -1111 && fBaryonPotential != -1111 && fStrangePotential != -1111 &&
73  fElectroPotential != -1111)
74  fInitialized = kTRUE;
75 }

References fBaryonPotential, fCharmPotential, fElectroPotential, fInitialized, fNMax, fStrangePotential, fTemperature, and relativeConstraints::value.

◆ ElectroDensity()

double GrandCanonical::ElectroDensity ( DatabasePDG database)

Definition at line 175 of file GrandCanonical.cc.

175  {
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 }

References fInitialized, ParticlePDG::GetElectricCharge(), DatabasePDG::GetNParticles(), DatabasePDG::GetPDGParticleByIndex(), and ParticleNumberDensity().

◆ ElectroPotential() [1/2]

double GrandCanonical::ElectroPotential ( )
inline

Definition at line 44 of file GrandCanonical.h.

44 { return fElectroPotential; }

References fElectroPotential.

◆ ElectroPotential() [2/2]

void GrandCanonical::ElectroPotential ( double  value)

Definition at line 63 of file GrandCanonical.cc.

63  {
65  if (fNMax != -1111 && fTemperature != -1111 && fBaryonPotential != -1111 && fStrangePotential != -1111 &&
66  fCharmPotential != -1111)
67  fInitialized = kTRUE;
68 }

References fBaryonPotential, fCharmPotential, fElectroPotential, fInitialized, fNMax, fStrangePotential, fTemperature, and relativeConstraints::value.

◆ EnergyDensity()

double GrandCanonical::EnergyDensity ( DatabasePDG database)

Definition at line 131 of file GrandCanonical.cc.

131  {
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 }

References fInitialized, DatabasePDG::GetNParticles(), DatabasePDG::GetPDGParticleByIndex(), and ParticleEnergyDensity().

◆ NMax() [1/2]

int GrandCanonical::NMax ( )
inline

Definition at line 49 of file GrandCanonical.h.

49 { return fNMax; }

References fNMax.

◆ NMax() [2/2]

void GrandCanonical::NMax ( int  value)

Definition at line 77 of file GrandCanonical.cc.

77  {
78  fNMax = value;
79  if (fTemperature != -1111 && fBaryonPotential != -1111 && fStrangePotential != -1111 && fElectroPotential != -1111 &&
80  fCharmPotential != -1111)
81  fInitialized = kTRUE;
82 }

References fBaryonPotential, fCharmPotential, fElectroPotential, fInitialized, fNMax, fStrangePotential, fTemperature, and relativeConstraints::value.

◆ ParticleEnergyDensity()

double GrandCanonical::ParticleEnergyDensity ( ParticlePDG particle)

Definition at line 84 of file GrandCanonical.cc.

84  {
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 }

References ztail::d, fBaryonPotential, fCharmPotential, fElectroPotential, fInitialized, fNMax, fStrangePotential, fTemperature, ParticlePDG::GetBaryonNumber(), ParticlePDG::GetCharmness(), ParticlePDG::GetElectricCharge(), ParticlePDG::GetMass(), ParticlePDG::GetSpin(), ParticlePDG::GetStrangeness(), HankelK1(), HankelKn(), hbarc, createfilelist::int, EgHLTOffHistBins_cfi::mass, dqmiodumpmetadata::n, and Pi.

Referenced by EnergyDensity().

◆ ParticleNumberDensity()

double GrandCanonical::ParticleNumberDensity ( ParticlePDG particle)

Definition at line 109 of file GrandCanonical.cc.

109  {
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 }

References ztail::d, fBaryonPotential, fCharmPotential, fElectroPotential, fInitialized, fNMax, fStrangePotential, fTemperature, ParticlePDG::GetBaryonNumber(), ParticlePDG::GetCharmness(), ParticlePDG::GetElectricCharge(), ParticlePDG::GetMass(), ParticlePDG::GetSpin(), ParticlePDG::GetStrangeness(), HankelKn(), hbarc, createfilelist::int, EgHLTOffHistBins_cfi::mass, dqmiodumpmetadata::n, and Pi.

Referenced by BaryonDensity(), CharmDensity(), ElectroDensity(), gen::Hydjet2Hadronizer::initializeForInternalPartons(), and StrangeDensity().

◆ StrangeDensity()

double GrandCanonical::StrangeDensity ( DatabasePDG database)

Definition at line 160 of file GrandCanonical.cc.

160  {
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 }

References fInitialized, DatabasePDG::GetNParticles(), DatabasePDG::GetPDGParticleByIndex(), ParticlePDG::GetStrangeness(), and ParticleNumberDensity().

◆ StrangePotential() [1/2]

double GrandCanonical::StrangePotential ( )
inline

Definition at line 42 of file GrandCanonical.h.

42 { return fStrangePotential; }

References fStrangePotential.

◆ StrangePotential() [2/2]

void GrandCanonical::StrangePotential ( double  value)

Definition at line 56 of file GrandCanonical.cc.

56  {
58  if (fNMax != -1111 && fTemperature != -1111 && fBaryonPotential != -1111 && fElectroPotential != -1111 &&
59  fCharmPotential != -1111)
60  fInitialized = kTRUE;
61 }

References fBaryonPotential, fCharmPotential, fElectroPotential, fInitialized, fNMax, fStrangePotential, fTemperature, and relativeConstraints::value.

◆ Temperature() [1/2]

double GrandCanonical::Temperature ( )
inline

Definition at line 38 of file GrandCanonical.h.

38 { return fTemperature; }

References fTemperature.

◆ Temperature() [2/2]

void GrandCanonical::Temperature ( double  value)

Definition at line 42 of file GrandCanonical.cc.

42  {
44  if (fNMax != -1111 && fBaryonPotential != -1111 && fStrangePotential != -1111 && fElectroPotential != -1111 &&
45  fCharmPotential != -1111)
46  fInitialized = kTRUE;
47 }

References fBaryonPotential, fCharmPotential, fElectroPotential, fInitialized, fNMax, fStrangePotential, fTemperature, and relativeConstraints::value.

Member Data Documentation

◆ fBaryonPotential

double GrandCanonical::fBaryonPotential
private

◆ fCharmPotential

double GrandCanonical::fCharmPotential
private

◆ fElectroPotential

double GrandCanonical::fElectroPotential
private

◆ fInitialized

bool GrandCanonical::fInitialized
private

◆ fNMax

int GrandCanonical::fNMax
private

◆ fStrangePotential

double GrandCanonical::fStrangePotential
private

◆ fTemperature

double GrandCanonical::fTemperature
private
GrandCanonical::fCharmPotential
double fCharmPotential
Definition: GrandCanonical.h:20
GrandCanonical::fBaryonPotential
double fBaryonPotential
Definition: GrandCanonical.h:17
GrandCanonical::fElectroPotential
double fElectroPotential
Definition: GrandCanonical.h:19
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
GrandCanonical::fNMax
int fNMax
Definition: GrandCanonical.h:24
DatabasePDG::GetNParticles
int GetNParticles(bool all=kFALSE)
Definition: DatabasePDG.cc:582
GrandCanonical::ParticleEnergyDensity
double ParticleEnergyDensity(ParticlePDG *particle)
Definition: GrandCanonical.cc:84
DatabasePDG::GetPDGParticleByIndex
ParticlePDG * GetPDGParticleByIndex(int index)
Definition: DatabasePDG.cc:198
GrandCanonical::fStrangePotential
double fStrangePotential
Definition: GrandCanonical.h:18
ParticlePDG::GetStrangeness
double GetStrangeness()
Definition: ParticlePDG.h:87
ParticlePDG
Definition: ParticlePDG.h:24
GrandCanonical::ParticleNumberDensity
double ParticleNumberDensity(ParticlePDG *particle)
Definition: GrandCanonical.cc:109
HankelKn
double HankelKn(int n, double x)
Definition: HankelFunction.cc:202
ParticlePDG::GetCharmness
double GetCharmness()
Definition: ParticlePDG.h:88
GrandCanonical::fTemperature
double fTemperature
Definition: GrandCanonical.h:16
HankelK1
double HankelK1(double x)
Definition: HankelFunction.cc:169
createfilelist.int
int
Definition: createfilelist.py:10
hbarc
const double hbarc
Definition: MathUtil.h:18
ParticlePDG::GetSpin
double GetSpin()
Definition: ParticlePDG.h:73
ParticlePDG::GetMass
double GetMass()
Definition: ParticlePDG.h:70
jvcParameters_cfi.temperature
temperature
Definition: jvcParameters_cfi.py:7
ParticlePDG::GetElectricCharge
double GetElectricCharge()
Definition: ParticlePDG.h:89
GrandCanonical::fInitialized
bool fInitialized
Definition: GrandCanonical.h:25
relativeConstraints.value
value
Definition: relativeConstraints.py:53
EgHLTOffHistBins_cfi.mass
mass
Definition: EgHLTOffHistBins_cfi.py:34
ParticlePDG::GetBaryonNumber
double GetBaryonNumber()
Definition: ParticlePDG.h:82
Pi
const double Pi
Definition: CosmicMuonParameters.h:18
ztail.d
d
Definition: ztail.py:151