Thermal-FIST 1.5
Package for hadron resonance gas model applications
Loading...
Searching...
No Matches
ThermalParticle.h
Go to the documentation of this file.
1/*
2 * Thermal-FIST package
3 *
4 * Copyright (c) 2014-2019 Volodymyr Vovchenko
5 *
6 * GNU General Public License (GPLv3 or later)
7 */
8#ifndef THERMALPARTICLE_H
9#define THERMALPARTICLE_H
10
11
22
23
24#include <string>
25#include <vector>
26#include <cmath>
27
31#include "HRGBase/xMath.h"
32
33namespace thermalfist {
34
35
36
52 static const int NumberOfTypes = 4;
53 };
54
55
56
64 {
65 public:
67 typedef std::vector<ParticleDecayChannel> ParticleDecaysVector;
68
77
90
110 ThermalParticle(bool Stable = true, std::string Name = "hadron", long long PDGID = 0, double Deg = 1., int Stat = 0, double Mass = 0.,
111 int Strange = 0, int Baryon = 0, int Charge = 0, double AbsS = 0., double Width = 0., double Threshold = 0., int Charm = 0, double AbsC = 0., int Quark = 0);
112 ~ThermalParticle(void);
113
118 void FillCoefficients();
119
122
124 double TotalWidtheBW(double M) const;
125
133 std::vector<double> BranchingRatiosM(double M, bool eBW = true) const;
134
147 double ThermalMassDistribution(double M, double T, double Mu, double width);
148
160 double ThermalMassDistribution(double M, double T, double Mu);
161
168
174
188 double Density(const ThermalModelParameters &params, IdealGasFunctions::Quantity type = IdealGasFunctions::ParticleDensity, bool useWidth = 0, double mu = 0.) const;
189
201 double DensityCluster(int n, const ThermalModelParameters &params, IdealGasFunctions::Quantity type = IdealGasFunctions::ParticleDensity, bool useWidth = 0, double mu = 0.) const;
202
217 double chi(int index, const ThermalModelParameters &params, bool useWidth = 0, double mu = 0.) const;
218
233 double chiDimensionfull(int index, const ThermalModelParameters& params, bool useWidth = 0, double mu = 0.) const;
234
248 double ScaledVariance(const ThermalModelParameters &params, bool useWidth = 0, double mu = 0.) const;
249
264 double Skewness(const ThermalModelParameters &params, bool useWidth = 0, double mu = 0.) const;
265
280 double Kurtosis(const ThermalModelParameters &params, bool useWidth = 0, double mu = 0.) const;
281
291 double FD(double k, double T, double mu, double m) const;
292
301 double GetAbsQ() const;
302
310 double GetCharge(int index) const;
311
319 double GetAbsCharge(int index) const;
320
327 bool IsNeutral() const;
328
330 bool IsStable() const { return m_Stable; }
331
333 void SetStable(bool stable = true) { m_Stable = stable; }
334
336 bool IsAntiParticle() const { return m_AntiParticle; }
337
339 void SetAntiParticle(bool antpar = true) { m_AntiParticle = antpar; }
340
342 const std::string& Name() const { return m_Name; }
343
345 void SetName(const std::string &name) { m_Name = name; }
346
348 long long PdgId() const { return m_PDGID; }
349
351 void SetPdgId(long long PdgId) { m_PDGID = PdgId; }
352
354 double Degeneracy() const { return m_Degeneracy; }
355
357 void SetDegeneracy(double deg) { m_Degeneracy = deg; }
358
368 int Statistics() const { return m_Statistics; }
369
379 void SetStatistics(int stat) { m_Statistics = stat; }
380
387 void UseStatistics(bool enable);
388
390 double Mass() const { return m_Mass; }
391
393 void SetMass(double mass);// { m_Mass = mass; }
394
396 int BaryonCharge() const { return m_Baryon; }
397
399 void SetBaryonCharge(int chg) { m_Baryon = chg; SetAbsoluteQuark(GetAbsQ()); }
400
402 int ElectricCharge() const { return m_ElectricCharge; }
403
405 void SetElectricCharge(int chg) { m_ElectricCharge = chg; }
406
408 int Strangeness() const { return m_Strangeness; }
410 void SetStrangenessCharge(int chg) { m_Strangeness = chg; }
411
413 int Charm() const { return m_Charm; }
414
416 void SetCharm(int chg) { m_Charm = chg; }
417
420
426 double ArbitraryCharge() const { return m_ArbitraryCharge; }
427
433 void SetArbitraryCharge(double arbchg) { m_ArbitraryCharge = arbchg; }
434
436 double AbsoluteQuark() const { return m_AbsQuark; }
437
439 void SetAbsoluteQuark(double abschg) { m_AbsQuark = abschg; }
440
442 double AbsoluteStrangeness() const { return m_AbsS; }
443
445 void SetAbsoluteStrangeness(double abschg) { m_AbsS = abschg; SetAbsoluteQuark(GetAbsQ()); }
446
448 double AbsoluteCharm() const { return m_AbsC; }
449
451 void SetAbsoluteCharm(double abschg) { m_AbsC = abschg; SetAbsoluteQuark(GetAbsQ()); }
452
454 bool ZeroWidthEnforced() const;
455
457 double ResonanceWidth() const { return m_Width; }
458
468 void SetResonanceWidth(double width);
469
478 double DecayThresholdMass() const { return m_Threshold; }
488 void SetDecayThresholdMass(double threshold);
489
490
491
495 double DecayThresholdMassDynamical() const { return m_ThresholdDynamical; }
496
498 void SetDecayThresholdMassDynamical(double threshold);
499
503
511 ResonanceWidthShape GetResonanceWidthShape() const { return m_ResonanceWidthShape; }
512
519
526 ResonanceWidthIntegration GetResonanceWidthIntegrationType() const { return m_ResonanceWidthIntegrationType; }
527
535
543 double MassDistribution(double m) const;
544
545 // Resonance mass distribution with manually input width
546 double MassDistribution(double m, double width) const;
547
556 double Weight() const { return m_Weight; }
557
559 void SetWeight(double weight) { m_Weight = weight; }
560
566 ParticleDecayType::DecayType DecayType() const { return m_DecayType; }
567
569 void SetDecayType(ParticleDecayType::DecayType type) { m_DecayType = type; }
570
579 const ParticleDecaysVector& Decays() const { return m_Decays; }
580
582 ParticleDecaysVector& Decays() { return m_Decays; }
583
591 void SetDecays(const ParticleDecaysVector &Decays) { m_Decays = Decays; }
592
594 void ClearDecays() { m_Decays.resize(0); }
595
597
598 const ParticleDecaysVector& DecaysOriginal() const { return m_DecaysOrig; }
599 ParticleDecaysVector& DecaysOriginal() { return m_DecaysOrig; }
600 void SetDecaysOriginal(const ParticleDecaysVector &DecaysOrig) { m_DecaysOrig = DecaysOrig; }
602
604 void ReadDecays(std::string filename = "");
605
606
617 void CalculateThermalBranchingRatios(const ThermalModelParameters &params, bool useWidth = 0, double mu = 0.);
618
624 void SetCalculationType(IdealGasFunctions::QStatsCalculationType type) { m_QuantumStatisticsCalculationType = type; }
625
634 IdealGasFunctions::QStatsCalculationType CalculationType() const { return m_QuantumStatisticsCalculationType; }
635
641 int ClusterExpansionOrder() const { return m_ClusterExpansionOrder; }
642
644 void SetClusterExpansionOrder(int order) { m_ClusterExpansionOrder = order; }
645
646 std::vector<double> BranchingRatioWeights(const std::vector<double> & ms) const;
647
648 const std::vector<double>& Nch() const { return m_Nch; }
649 std::vector<double>& Nch() { return m_Nch; }
650
651 const std::vector<double>& DeltaNch() const { return m_DeltaNch; }
652 std::vector<double>& DeltaNch() { return m_DeltaNch; }
653
663 ThermalParticle GenerateAntiParticle(/*ThermalParticleSystem *TPS = NULL*/) const;
664
665 bool operator==(const ThermalParticle &rhs) const; // TODO: improve
666 bool operator!=(const ThermalParticle &rhs) const { return !(*this == rhs); }
667
669 GeneralizedDensity* GetGeneralizedDensity() const { return m_GeneralizedDensity; }
670 void SetGeneralizedDensity(GeneralizedDensity *density_model);
671
674
678 void SetMagneticField(double B = 0.0, int lmax = 1);
679
681 void ClearMagneticField() { m_IGFExtraConfig.MagneticField.B = 0.0; }
682
683 private:
687 std::vector<double> m_xlag32, m_wlag32;
688 std::vector<double> m_xleg, m_wleg;
689 std::vector<double> m_xleg32, m_wleg32;
690 std::vector<double> m_brweight;
691
692
696 std::vector<double> m_xlegdyn, m_wlegdyn, m_vallegdyn;
697 std::vector<double> m_xlegpdyn, m_wlegpdyn, m_vallegpdyn;
698 std::vector<double> m_xlagdyn, m_wlagdyn, m_vallagdyn;
699
700 std::vector<double> m_xalldyn, m_walldyn, m_densalldyn;
701
702
703 bool m_Stable;
704 ParticleDecayType::DecayType m_DecayType;
705
706 bool m_AntiParticle;
707 std::string m_Name;
708 long long m_PDGID;
709 double m_Degeneracy;
710 int m_Statistics;
711 int m_StatisticsOrig;
712 double m_Mass;
713
717 IdealGasFunctions::QStatsCalculationType m_QuantumStatisticsCalculationType;
718
724 int m_ClusterExpansionOrder;
725
726 int m_Baryon;
727 int m_ElectricCharge;
728 int m_Strangeness;
729 int m_Charm;
730 int m_Quark;
731
732 double m_ArbitraryCharge;
733 double m_AbsQuark;
734 double m_AbsS;
735 double m_AbsC;
736
737 double m_Width;
738 double m_Threshold;
739 double m_ThresholdDynamical;
740 ResonanceWidthShape m_ResonanceWidthShape;
741 ResonanceWidthIntegration m_ResonanceWidthIntegrationType;
742 double m_Radius;
743 double m_Weight;
744
745 ParticleDecaysVector m_Decays;
746
750 ParticleDecaysVector m_DecaysOrig;
751
752
757 std::vector<double> m_Nch;
758 std::vector<double> m_DeltaNch;
759
761 bool m_LastDensityOk;
762
764 GeneralizedDensity *m_GeneralizedDensity;
765
768 };
769
770} // namespace thermalfist
771
772#endif
map< string, double > params
Contains structures related to particle decays.
Implements the possibility of a generalized calculation of the densities. For example,...
Class containing all information about a particle specie.
double MassDistribution(double m) const
long long PdgId() const
Particle's Particle Data Group (PDG) ID number.
void SetAntiParticle(bool antpar=true)
Set manually whether particle is an antiparticle.
double AbsoluteCharm() const
Absolute charm quark content |s|.
const std::vector< double > & DeltaNch() const
std::vector< double > & Nch()
void ClearMagneticField()
Clears the magnetic field.
void SetAbsoluteQuark(double abschg)
Set absolute light quark content |u,d|.
int BaryonCharge() const
Particle's baryon number.
double Kurtosis(const ThermalModelParameters &params, bool useWidth=0, double mu=0.) const
Computes the normalized excess kurtosis of particle number fluctuations in the ideal gas.
ParticleDecaysVector & DecaysOriginal()
int Statistics() const
Particle's statistics.
void FillCoefficients()
Fills coefficients for mass integration in the energy independent BW scheme.
void RestoreBranchingRatios()
Restores all branching ratios to the original values.
double Mass() const
Particle's mass [GeV].
void SetDecayType(ParticleDecayType::DecayType type)
Set particle's Decay Type.
double ArbitraryCharge() const
Arbitrary (auxiliary) charge assigned to particle.
std::vector< ParticleDecayChannel > ParticleDecaysVector
Vector of all decay channels of a particle.
ResonanceWidthShape GetResonanceWidthShape() const
Resonance width profile in use.
ResonanceWidthIntegration GetResonanceWidthIntegrationType() const
Resonance width integration scheme used to treat finite resonance widths.
double chiDimensionfull(int index, const ThermalModelParameters &params, bool useWidth=0, double mu=0.) const
Computes the ideal gas dimensionfull susceptibility .
int Strangeness() const
Particle's strangeness.
void SetCalculationType(IdealGasFunctions::QStatsCalculationType type)
Sets the CalculationType() method to evaluate quantum statistics.
double TotalWidtheBW(double M) const
Total width (eBW scheme) at a given mass.
void SetResonanceWidthShape(ResonanceWidthShape shape)
Set the resonance width profile to use.
void SetDecayThresholdMassDynamical(double threshold)
Set the threshold mass manually for use in the eBW scheme.
void SetDecaysOriginal(const ParticleDecaysVector &DecaysOrig)
double Density(const ThermalModelParameters &params, IdealGasFunctions::Quantity type=IdealGasFunctions::ParticleDensity, bool useWidth=0, double mu=0.) const
Computes a specified ideal gas thermodynamic function.
const std::vector< double > & Nch() const
const ParticleDecaysVector & Decays() const
A vector of particle's decays.
void SetResonanceWidthIntegrationType(ResonanceWidthIntegration type)
Set the ResonanceWidthIntegration scheme used to treat finite resonance widths.
ResonanceWidthIntegration
Treatment of finite resonance widths.
@ FullIntervalWeighted
Energy-independent Breit-Wigner in full energy interval with weighted branching ratios.
@ eBWconstBR
Energy-dependent Breit-Wigner scheme (eBW) with constant branching ratios when evaluating feeddown.
@ eBW
Energy-dependent Breit-Wigner scheme (eBW)
@ BWTwoGamma
Energy-independent Breit-Wigner in +-2\Gamma interval.
@ FullInterval
Energy-independent Breit-Wigner in full energy interval.
@ ZeroWidth
Zero-width approximation.
IdealGasFunctions::QStatsCalculationType CalculationType() const
Method to evaluate quantum statistics.
ParticleDecayType::DecayType DecayType() const
Decay type of the particle.
void ClearGeneralizedDensity()
Clear the generalized density.
void SetArbitraryCharge(double arbchg)
Assigns arbitrary (auxiliary) charge to particle.
ParticleDecaysVector & Decays()
Returns a non-const reference to Decays()
void SetStable(bool stable=true)
Sets particle stability flag.
double AbsoluteStrangeness() const
Absolute strange quark content |s|.
double FD(double k, double T, double mu, double m) const
Fermi-Dirac distribution function.
void ReadDecays(std::string filename="")
Read decays from a file and assign them to the particle.
double DecayThresholdMass() const
The decays threshold mass.
int ElectricCharge() const
Particle's electric charge.
void SetStrangenessCharge(int chg)
Set particle's strangeness.
ResonanceWidthShape
Relativistic vs non-relativistic Breit-Wigner shape.
bool IsNeutral() const
Whether particle is neutral one.
void SetPdgId(long long PdgId)
Set particle's particle's Particle Data Group (PDG) ID number.
void SetDecayThresholdMass(double threshold)
Set the decays threshold mass.
bool operator!=(const ThermalParticle &rhs) const
void SetCharm(int chg)
Set particle's charm.
int Charm() const
Particle's charm.
double AbsoluteQuark() const
Absolute light quark content |u,d|.
double Weight() const
Particle's weight.
double chi(int index, const ThermalModelParameters &params, bool useWidth=0, double mu=0.) const
Computes the ideal gas generalized susceptibility .
int ClusterExpansionOrder() const
Number of terms in the cluster expansion method.
ThermalParticle(bool Stable=true, std::string Name="hadron", long long PDGID=0, double Deg=1., int Stat=0, double Mass=0., int Strange=0, int Baryon=0, int Charge=0, double AbsS=0., double Width=0., double Threshold=0., int Charm=0, double AbsC=0., int Quark=0)
Construct a new ThermalParticle object.
double ThermalMassDistribution(double M, double T, double Mu, double width)
Mass distribution of a resonance in a thermal environment.
void SetMass(double mass)
Set particle's mass [GeV].
bool IsAntiParticle() const
Whether particle is an antiparticle, i.e. its PDG ID is < 0.
double DensityCluster(int n, const ThermalModelParameters &params, IdealGasFunctions::Quantity type=IdealGasFunctions::ParticleDensity, bool useWidth=0, double mu=0.) const
void SetBaryonCharge(int chg)
Set particle's baryon number.
void SetWeight(double weight)
Set particle's weight factor.
void SetMagneticField(double B=0.0, int lmax=1)
Sets the value of magnetic field and the number of Landau levels to include.
double Skewness(const ThermalModelParameters &params, bool useWidth=0, double mu=0.) const
Computes the normalized skewness of particle number fluctuations in the ideal gas.
double GetCharge(int index) const
Get the quantum number numbered by the index.
std::vector< double > & DeltaNch()
bool operator==(const ThermalParticle &rhs) const
const std::string & Name() const
Particle's name.
int ConservedCharge(ConservedCharge::Name chg) const
One of the four QCD conserved charges.
double ResonanceWidth() const
Particle's width at the pole mass (GeV)
std::vector< double > BranchingRatioWeights(const std::vector< double > &ms) const
GeneralizedDensity * GetGeneralizedDensity() const
Getter/Setter for the generalized density object.
void SetGeneralizedDensity(GeneralizedDensity *density_model)
void ClearDecays()
Remove all decays.
bool IsStable() const
Return particle stability flag.
void SetStatistics(int stat)
Set particle's statistics.
void SetResonanceWidth(double width)
Sets the particle's width at the pole mass.
void SetDecays(const ParticleDecaysVector &Decays)
Set the Decays vector.
void SetName(const std::string &name)
Set particle's name.
ThermalParticle GenerateAntiParticle() const
Generates the anti-particle to the current particle specie.
double Degeneracy() const
Particle's internal degeneracy factor.
void NormalizeBranchingRatios()
Normalizes all branching ratios such that they sum up to 100%.
void SetDegeneracy(double deg)
Set particle's internal degeneracy factor.
void UseStatistics(bool enable)
Use quantum statistics.
double DecayThresholdMassDynamical() const
std::vector< double > BranchingRatiosM(double M, bool eBW=true) const
(Energy-dependent) branching ratios
const ParticleDecaysVector & DecaysOriginal() const
A backup copy of particle's decays.
bool ZeroWidthEnforced() const
Whether zero-width approximation is enforced for this particle species.
void SetElectricCharge(int chg)
Set particle's electric charge.
void FillCoefficientsDynamical()
Fills coefficients for mass integration in the eBW scheme.
void CalculateThermalBranchingRatios(const ThermalModelParameters &params, bool useWidth=0, double mu=0.)
Computes average decay branching ratios by integrating over the thermal mass distribution.
double GetAbsCharge(int index) const
Get the absolute value of a quantum number.
double ScaledVariance(const ThermalModelParameters &params, bool useWidth=0, double mu=0.) const
Computes the scaled variance of particle number fluctuations in the ideal gas. Computes the scaled va...
void SetAbsoluteCharm(double abschg)
Set absolute charm quark content |s|, light quark content then re-evaluted.
void SetClusterExpansionOrder(int order)
Set ClusterExpansionOrder()
void SetAbsoluteStrangeness(double abschg)
Set absolute strange quark content |s|, light quark content then re-evaluted.
QStatsCalculationType
Identifies whether quantum statistics are to be computed using the cluster expansion or numerical int...
Quantity
Identifies the thermodynamic function.
The main namespace where all classes and functions of the Thermal-FIST library reside.
Definition CosmicEoS.h:9
An auxiliary struct containing the list of conserved charges.
Name
Set of all conserved charges considered.
@ ElectricCharge
Electric charge.
DecayType
Type of particle's decay.
Structure containing all thermal parameters of the model.
Contains some extra mathematical functions used in the code.