14 #include "ThermalFISTConfig.h" 18 #ifdef ThermalFIST_USENAMESPACE 23 return 1.308 / (1. + 0.273 * ss);
27 double Tss(
double ss) {
28 double tmpmuB =
muBss(ss);
29 return 0.166 - 0.139 * tmpmuB * tmpmuB - 0.053 * tmpmuB * tmpmuB * tmpmuB * tmpmuB;
46 double mn2 = 0., mn3 = 0.;
51 for (
size_t i = 0; i < decayDistributions.size(); ++i) {
52 njavr += decayDistributions[i].first * decayDistributions[i].second[j];
55 mn2 += ch1[j] * njavr;
56 mn3 += ch2[j] * njavr;
59 ret += mn1 * mn2 * mn3;
73 int main(
int argc,
char *argv[])
75 int withMonteCarlo = 1;
77 withMonteCarlo = atoi(argv[1]);
81 nevents = atoi(argv[2]);
83 string listname = string(ThermalFIST_INPUT_FOLDER) +
"/list/PDG2014/list.dat";
124 vector<double> coefsk(parts.
Particles().size(), 0.);
125 coefsk[parts.
PdgToId(321)] = 1.;
126 coefsk[parts.
PdgToId(-321)] = -1.;
136 double musp = 0., muqp = 0., mucp = 0.;
139 printf(
"Analytic\n");
141 FILE *f = fopen(
"cpc4.analyt.dat",
"w");
143 fprintf(f,
"%15s%15s%15s%15s%15s%15s%15s%15s%15s%15s%15s%15s%15s\n",
159 vector<double> ens, Ts, muBs, muQs, muSs;
161 double logSmin = log(smin);
162 double logSmax = log(smax);
163 double dlogS = (logSmax - logSmin) / iterss;
164 for (
int is = 0; is <= iterss; ++is) {
165 double ss = exp(logSmin + is * dlogS);
167 double muB =
muBss(ss);
186 muQs.push_back(muqp);
187 muSs.push_back(musp);
199 double chi2B = model->
Susc(ConservedCharge::BaryonCharge, ConservedCharge::BaryonCharge);
200 double chi2Q = model->
Susc(ConservedCharge::ElectricCharge, ConservedCharge::ElectricCharge);
201 double chi2S = model->
Susc(ConservedCharge::StrangenessCharge, ConservedCharge::StrangenessCharge);
202 double chi11BS = model->
Susc(ConservedCharge::BaryonCharge, ConservedCharge::StrangenessCharge);
203 double chi11QS = model->
Susc(ConservedCharge::ElectricCharge, ConservedCharge::StrangenessCharge);
204 double chi11BQ = model->
Susc(ConservedCharge::ElectricCharge, ConservedCharge::BaryonCharge);
206 double chi2p = model->
ProxySusc(ConservedCharge::BaryonCharge, ConservedCharge::BaryonCharge);
207 double chi2k = model->
ProxySusc(ConservedCharge::StrangenessCharge, ConservedCharge::StrangenessCharge);
208 double chi11pk = model->
ProxySusc(ConservedCharge::BaryonCharge, ConservedCharge::StrangenessCharge);
209 double chi11Qk = model->
ProxySusc(ConservedCharge::ElectricCharge, ConservedCharge::StrangenessCharge);
210 double chi11pQ = model->
ProxySusc(ConservedCharge::ElectricCharge, ConservedCharge::BaryonCharge);
214 printf(
"%15lf%15lf%15lf%15lf%15lf%15lf%15lf\n",
223 fprintf(f,
"%15lf%15lf%15lf%15lf%15lf%15lf%15lf%15lf%15lf%15lf%15lf%15lf%15lf\n",
247 printf(
"%30s %lf s\n",
"Running time:", (wt2 - wt1));
248 printf(
"%30s %lf s\n",
"Time per single calculation:", (wt2 - wt1) / iters);
255 printf(
"Monte Carlo\n");
257 f = fopen(
"cpc4.montecarlo.dat",
"w");
259 fprintf(f,
"%15s%15s%15s%15s%15s%15s%15s%15s%15s%15s%15s%15s\n",
279 for (
size_t ind = 0; ind < ens.size(); ind++) {
285 double mc_B = 0., mc_Q = 0., mc_S = 0., mc_p = 0., mc_k = 0.;
286 double mc_B2 = 0., mc_Q2 = 0., mc_S2 = 0., mc_BQ = 0., mc_QS = 0., mc_BS = 0.;
287 double mc_p2 = 0., mc_k2 = 0., mc_pk = 0., mc_pQ = 0., mc_Qk = 0.;
291 config.
fEnsemble = EventGeneratorConfiguration::GCE;
292 config.
fModelType = EventGeneratorConfiguration::PointParticle;
297 for (
int i = 0; i < nevents; ++i) {
299 int mcev_B = 0, mcev_Q = 0, mcev_S = 0, mcev_p = 0, mcev_k = 0;
301 for (
size_t part = 0; part < ev.
Particles.size(); ++part) {
302 long long pdgid = ev.
Particles[part].PDGID;
310 else if (pdgid == -2212)
315 else if (pdgid == -321)
319 mc_B += ev.
weight * mcev_B;
320 mc_Q += ev.
weight * mcev_Q;
321 mc_S += ev.
weight * mcev_S;
322 mc_p += ev.
weight * mcev_p;
323 mc_k += ev.
weight * mcev_k;
325 mc_B2 += ev.
weight * mcev_B * mcev_B;
326 mc_Q2 += ev.
weight * mcev_Q * mcev_Q;
327 mc_S2 += ev.
weight * mcev_S * mcev_S;
328 mc_p2 += ev.
weight * mcev_p * mcev_p;
329 mc_k2 += ev.
weight * mcev_k * mcev_k;
331 mc_BQ += ev.
weight * mcev_B * mcev_Q;
332 mc_QS += ev.
weight * mcev_Q * mcev_S;
333 mc_BS += ev.
weight * mcev_B * mcev_S;
334 mc_pQ += ev.
weight * mcev_p * mcev_Q;
335 mc_pk += ev.
weight * mcev_p * mcev_k;
336 mc_Qk += ev.
weight * mcev_Q * mcev_k;
341 double chi1B = mc_B / wsum;
342 double chi1Q = mc_Q / wsum;
343 double chi1S = mc_S / wsum;
345 double chi1p = mc_p / wsum;
346 double chi1k = mc_k / wsum;
348 double chi2B = mc_B2 / wsum - mc_B / wsum * mc_B / wsum;
349 double chi2Q = mc_Q2 / wsum - mc_Q / wsum * mc_Q / wsum;
350 double chi2S = mc_S2 / wsum - mc_S / wsum * mc_S / wsum;
351 double chi11BS = mc_BS / wsum - mc_B / wsum * mc_S / wsum;
352 double chi11QS = mc_QS / wsum - mc_Q / wsum * mc_S / wsum;
353 double chi11BQ = mc_BQ / wsum - mc_B / wsum * mc_Q / wsum;
355 double chi2p = mc_p2 / wsum - mc_p / wsum * mc_p / wsum;
356 double chi2k = mc_k2 / wsum - mc_k / wsum * mc_k / wsum;
357 double chi11pk = mc_pk / wsum - mc_p / wsum * mc_k / wsum;
358 double chi11Qk = mc_Qk / wsum - mc_Q / wsum * mc_k / wsum;
359 double chi11pQ = mc_pQ / wsum - mc_p / wsum * mc_Q / wsum;
361 printf(
"%15lf%15lf%15lf%15lf%15lf%15lf%15lf\n", ens[ind], chi11BS / chi2S, chi11QS / chi2S, chi11BQ / chi2B, chi11pk / chi2k, chi11Qk / chi2k, chi11pQ / chi2p);
364 fprintf(f,
"%15lf%15lf%15lf%15lf%15lf%15lf%15lf%15lf%15lf%15lf%15lf%15lf\n",
386 printf(
"%30s %lf s\n",
"Running time:", (wt2 - wt1));
387 printf(
"%30s %lf s\n",
"Time per single calculation:", (wt2 - wt1) / iters);
void ConstrainChemicalPotentials(bool resetInitialValues=true)
Constrains the chemical potentials by the conservation laws imposed.
Abstract base class for an HRG model implementation.
virtual void SetStrangenessChemicalPotential(double muS)
Set the strangeness chemical potential.
double ScaledVariancePrimordial(int id) const
Scaled variance of primordial particle number fluctuations for particle species id.
const std::vector< double > & Densities() const
double GeVtoifm()
A constant to transform GeV into fm .
virtual void SetElectricChemicalPotential(double muQ)
Set the electric chemical potential.
bool ConstrainMuC() const
virtual void SetBaryonChemicalPotential(double muB)
Set the baryon chemical potential.
virtual void SetStatistics(bool stats)
Ensemble fEnsemble
The statistical ensemble used.
void SetUseWidth(bool useWidth)
Sets whether finite resonance widths are used. Deprecated.
int PdgToId(long long pdgid)
Transforms PDG ID to a 0-based particle id number.
Class containing the particle list.
Structure containing the thermal event generator configuration.
double Susc(ConservedCharge::Name i, ConservedCharge::Name j) const
A 2nd order susceptibility of conserved charges.
double CalculateAveragedDecaysChi2(ThermalModelBase *model, const std::vector< double > &ch1, const std::vector< double > &ch2)
virtual void SetParameters(const ThermalModelParameters ¶ms)
The thermal parameters.
Structure holding information about a single event in the event generator.
Structure containing all thermal parameters of the model.
virtual double CalculateStrangenessDensity()
int ComponentsNumber() const
Number of different particle species in the list.
virtual void SetTemperature(double T)
Set the temperature.
void SetNormBratio(bool normBratio)
Whether branching ratios are renormalized to 100%.
virtual double CalculateBaryonDensity()
void SetSeed(const unsigned int seed)
Set the seed of the random number generator randgenMT.
std::vector< std::pair< double, std::vector< int > > > ResonanceFinalStatesDistribution
int BaryonCharge() const
Particle's baryon number.
Class containing all information about a particle specie.
ModelType fModelType
The type of interaction model.
virtual double CalculateChargeDensity()
double GetDensity(long long PDGID, int feeddown)
Same as GetDensity(int,Feeddown::Type)
const std::vector< ThermalParticle > & Particles() const
Returns the vector of all particle species.
double ProxySusc(ConservedCharge::Name i, ConservedCharge::Name j) const
A 2nd order susceptibility of conserved charges proxies.
const std::vector< ResonanceFinalStatesDistribution > & ResonanceFinalStatesDistributions() const
Final state particle number distributions for resonance decays.
void SetStable(bool stable=true)
Sets particle stability flag.
virtual void SetCharmChemicalPotential(double muC)
Set the charm chemical potential.
virtual SimpleEvent GetEvent(bool PerformDecays=true) const
Generates a single event.
std::vector< SimpleParticle > Particles
Vector of all final particles in the event.
Class implementing the Thermal Event Generator for the isotropic blast-wave scenario.
bool ConstrainMuQ() const
virtual void CalculateFluctuations()
Computes the fluctuation observables.
ThermalModelParameters CFOParameters
The chemical freeze-out parameters.
Class implementing the Ideal HRG model.
int ElectricCharge() const
Particle's electric charge.
int Strangeness() const
Particle's strangeness.
const ThermalModelParameters & Parameters() const
int main(int argc, char *argv[])
The main namespace where all classes and functions of the Thermal-FIST library reside.
double weight
Event weight factor.
ThermalParticleSystem * TPS()
bool ConstrainMuS() const
ThermalParticle & ParticleByPDG(long long pdgid)
ThermalParticle object corresponding to particle species with a provided PDG ID.