Thermal-FIST  1.3
Package for hadron resonance gas model applications
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 
24 #include <string>
25 #include <vector>
26 #include <cmath>
27 
28 #include "HRGBase/ParticleDecay.h"
31 #include "HRGBase/xMath.h"
32 
33 namespace thermalfist {
34 
35 
36 
41  struct ConservedCharge {
46  enum Name {
51  };
52  static const int NumberOfTypes = 5;
53  };
54 
55 
56 
64  {
65  public:
67  typedef std::vector<ParticleDecayChannel> ParticleDecaysVector;
68 
75  NonRelativisticBreitWigner
76  };
77 
87  eBW,
88  eBWconstBR
89  };
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 
121  void FillCoefficientsDynamical();
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 
167  void NormalizeBranchingRatios();
168 
173  void RestoreBranchingRatios();
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 
232  double ScaledVariance(const ThermalModelParameters &params, bool useWidth = 0, double mu = 0.) const;
233 
248  double Skewness(const ThermalModelParameters &params, bool useWidth = 0, double mu = 0.) const;
249 
264  double Kurtosis(const ThermalModelParameters &params, bool useWidth = 0, double mu = 0.) const;
265 
275  double FD(double k, double T, double mu, double m) const;
276 
285  double GetAbsQ() const;
286 
294  double GetCharge(int index) const;
295 
303  double GetAbsCharge(int index) const;
304 
311  bool IsNeutral() const;
312 
314  bool IsStable() const { return m_Stable; }
315 
317  void SetStable(bool stable = true) { m_Stable = stable; }
318 
320  bool IsAntiParticle() const { return m_AntiParticle; }
321 
323  void SetAntiParticle(bool antpar = true) { m_AntiParticle = antpar; }
324 
326  const std::string& Name() const { return m_Name; }
327 
329  void SetName(const std::string &name) { m_Name = name; }
330 
332  long long PdgId() const { return m_PDGID; }
333 
335  void SetPdgId(long long PdgId) { m_PDGID = PdgId; }
336 
338  double Degeneracy() const { return m_Degeneracy; }
339 
341  void SetDegeneracy(double deg) { m_Degeneracy = deg; }
342 
352  int Statistics() const { return m_Statistics; }
353 
363  void SetStatistics(int stat) { m_Statistics = stat; }
364 
371  void UseStatistics(bool enable);
372 
374  double Mass() const { return m_Mass; }
375 
377  void SetMass(double mass);// { m_Mass = mass; }
378 
380  int BaryonCharge() const { return m_Baryon; }
381 
383  void SetBaryonCharge(int chg) { m_Baryon = chg; SetAbsoluteQuark(GetAbsQ()); }
384 
386  int ElectricCharge() const { return m_ElectricCharge; }
387 
389  void SetElectricCharge(int chg) { m_ElectricCharge = chg; }
390 
392  int Strangeness() const { return m_Strangeness; }
394  void SetStrangenessCharge(int chg) { m_Strangeness = chg; }
395 
397  int Charm() const { return m_Charm; }
398 
400  void SetCharm(int chg) { m_Charm = chg; }
401 
403  int ConservedCharge(ConservedCharge::Name chg) const;
404 
410  double ArbitraryCharge() const { return m_ArbitraryCharge; }
411 
417  void SetArbitraryCharge(double arbchg) { m_ArbitraryCharge = arbchg; }
418 
420  double AbsoluteQuark() const { return m_AbsQuark; }
421 
423  void SetAbsoluteQuark(double abschg) { m_AbsQuark = abschg; }
424 
426  double AbsoluteStrangeness() const { return m_AbsS; }
427 
429  void SetAbsoluteStrangeness(double abschg) { m_AbsS = abschg; SetAbsoluteQuark(GetAbsQ()); }
430 
432  double AbsoluteCharm() const { return m_AbsC; }
433 
435  void SetAbsoluteCharm(double abschg) { m_AbsC = abschg; SetAbsoluteQuark(GetAbsQ()); }
436 
438  bool ZeroWidthEnforced() const;
439 
441  double ResonanceWidth() const { return m_Width; }
442 
452  void SetResonanceWidth(double width);
453 
462  double DecayThresholdMass() const { return m_Threshold; }
472  void SetDecayThresholdMass(double threshold);
473 
474 
475 
479  double DecayThresholdMassDynamical() const { return m_ThresholdDynamical; }
480 
482  void SetDecayThresholdMassDynamical(double threshold);
483 
486  void CalculateAndSetDynamicalThreshold();
487 
495  ResonanceWidthShape GetResonanceWidthShape() const { return m_ResonanceWidthShape; }
496 
502  void SetResonanceWidthShape(ResonanceWidthShape shape);
503 
510  ResonanceWidthIntegration GetResonanceWidthIntegrationType() const { return m_ResonanceWidthIntegrationType; }
511 
518  void SetResonanceWidthIntegrationType(ResonanceWidthIntegration type);
519 
527  double MassDistribution(double m) const;
528 
529  // Resonance mass distribution with manually input width
530  double MassDistribution(double m, double width) const;
531 
540  double Weight() const { return m_Weight; }
541 
543  void SetWeight(double weight) { m_Weight = weight; }
544 
550  ParticleDecayType::DecayType DecayType() const { return m_DecayType; }
551 
553  void SetDecayType(ParticleDecayType::DecayType type) { m_DecayType = type; }
554 
563  const ParticleDecaysVector& Decays() const { return m_Decays; }
564 
566  ParticleDecaysVector& Decays() { return m_Decays; }
567 
575  void SetDecays(const ParticleDecaysVector &Decays) { m_Decays = Decays; }
576 
578  void ClearDecays() { m_Decays.resize(0); }
579 
581  const ParticleDecaysVector& DecaysOriginal() const { return m_DecaysOrig; }
583  ParticleDecaysVector& DecaysOriginal() { return m_DecaysOrig; }
584  void SetDecaysOriginal(const ParticleDecaysVector &DecaysOrig) { m_DecaysOrig = DecaysOrig; }
586 
588  void ReadDecays(std::string filename = "");
589 
590 
601  void CalculateThermalBranchingRatios(const ThermalModelParameters &params, bool useWidth = 0, double mu = 0.);
602 
608  void SetCalculationType(IdealGasFunctions::QStatsCalculationType type) { m_QuantumStatisticsCalculationType = type; }
609 
618  IdealGasFunctions::QStatsCalculationType CalculationType() const { return m_QuantumStatisticsCalculationType; }
619 
625  int ClusterExpansionOrder() const { return m_ClusterExpansionOrder; }
626 
628  void SetClusterExpansionOrder(int order) { m_ClusterExpansionOrder = order; }
629 
630  std::vector<double> BranchingRatioWeights(const std::vector<double> & ms) const;
631 
632  const std::vector<double>& Nch() const { return m_Nch; }
633  std::vector<double>& Nch() { return m_Nch; }
634 
635  const std::vector<double>& DeltaNch() const { return m_DeltaNch; }
636  std::vector<double>& DeltaNch() { return m_DeltaNch; }
637 
647  ThermalParticle GenerateAntiParticle(/*ThermalParticleSystem *TPS = NULL*/) const;
648 
649  bool operator==(const ThermalParticle &rhs) const; // TODO: improve
650  bool operator!=(const ThermalParticle &rhs) const { return !(*this == rhs); }
651 
652  private:
656  std::vector<double> m_xlag32, m_wlag32;
657  std::vector<double> m_xleg, m_wleg;
658  std::vector<double> m_xleg32, m_wleg32;
659  std::vector<double> m_brweight;
660 
661 
665  std::vector<double> m_xlegdyn, m_wlegdyn, m_vallegdyn;
666  std::vector<double> m_xlegpdyn, m_wlegpdyn, m_vallegpdyn;
667  std::vector<double> m_xlagdyn, m_wlagdyn, m_vallagdyn;
668 
669  std::vector<double> m_xalldyn, m_walldyn, m_densalldyn;
670 
671 
672  bool m_Stable;
673  ParticleDecayType::DecayType m_DecayType;
675  bool m_AntiParticle;
676  std::string m_Name;
677  long long m_PDGID;
678  double m_Degeneracy;
679  int m_Statistics;
680  int m_StatisticsOrig;
681  double m_Mass;
686  IdealGasFunctions::QStatsCalculationType m_QuantumStatisticsCalculationType;
687 
693  int m_ClusterExpansionOrder;
694 
695  int m_Baryon;
696  int m_ElectricCharge;
697  int m_Strangeness;
698  int m_Charm;
699  int m_Quark;
701  double m_ArbitraryCharge;
702  double m_AbsQuark;
703  double m_AbsS;
704  double m_AbsC;
706  double m_Width;
707  double m_Threshold;
708  double m_ThresholdDynamical;
709  ResonanceWidthShape m_ResonanceWidthShape;
710  ResonanceWidthIntegration m_ResonanceWidthIntegrationType;
711  double m_Radius;
712  double m_Vo;
713  double m_Weight;
715  ParticleDecaysVector m_Decays;
720  ParticleDecaysVector m_DecaysOrig;
721 
722 
727  std::vector<double> m_Nch;
728  std::vector<double> m_DeltaNch;
729 
731  bool m_LastDensityOk;
732  };
733 
734 } // namespace thermalfist
735 
736 #endif
void ClearDecays()
Remove all decays.
void SetAbsoluteQuark(double abschg)
Set absolute light quark content |u,d|.
ParticleDecaysVector & Decays()
Returns a non-const reference to Decays()
double AbsoluteStrangeness() const
Absolute strange quark content |s|.
DecayType
Type of particle&#39;s decay.
Definition: ParticleDecay.h:60
int Charm() const
Particle&#39;s charm.
std::vector< ParticleDecayChannel > ParticleDecaysVector
Vector of all decay channels of a particle.
ResonanceWidthShape GetResonanceWidthShape() const
Resonance width profile in use.
int ClusterExpansionOrder() const
Number of terms in the cluster expansion method.
std::vector< double > & Nch()
double Weight() const
Particle&#39;s weight.
void SetPdgId(long long PdgId)
Set particle&#39;s particle&#39;s Particle Data Group (PDG) ID number.
void SetAbsoluteCharm(double abschg)
Set absolute charm quark content |s|, light quark content then re-evaluted.
void SetElectricCharge(int chg)
Set particle&#39;s electric charge.
void SetBaryonCharge(int chg)
Set particle&#39;s baryon number.
Energy-independent Breit-Wigner in +-2 interval.
long long PdgId() const
Particle&#39;s Particle Data Group (PDG) ID number.
An auxiliary struct containing the list of conserved charges.
void SetDecays(const ParticleDecaysVector &Decays)
Set the Decays vector.
Energy-dependent Breit-Wigner scheme (eBW)
double ResonanceWidth() const
Particle&#39;s width at the pole mass (GeV)
Structure containing all thermal parameters of the model.
void SetDecayType(ParticleDecayType::DecayType type)
Set particle&#39;s Decay Type.
std::vector< double > & DeltaNch()
Contains some extra mathematical functions used in the code.
void SetAntiParticle(bool antpar=true)
Set manually whether particle is an antiparticle.
bool operator!=(const ThermalParticle &rhs) const
int BaryonCharge() const
Particle&#39;s baryon number.
void SetName(const std::string &name)
Set particle&#39;s name.
ResonanceWidthIntegration
Treatment of finite resonance widths.
Class containing all information about a particle specie.
ResonanceWidthShape
Relativistic vs non-relativistic Breit-Wigner shape.
double DecayThresholdMassDynamical() const
const std::string & Name() const
Particle&#39;s name.
void SetCharm(int chg)
Set particle&#39;s charm.
Energy-independent Breit-Wigner in full energy interval.
void SetClusterExpansionOrder(int order)
Set ClusterExpansionOrder()
Quantity
Identifies the thermodynamic function.
void SetStable(bool stable=true)
Sets particle stability flag.
Name
Set of all conserved charges considered.
void SetDecaysOriginal(const ParticleDecaysVector &DecaysOrig)
IdealGasFunctions::QStatsCalculationType CalculationType() const
Method to evaluate quantum statistics.
double Mass() const
Particle&#39;s mass [GeV].
ResonanceWidthIntegration GetResonanceWidthIntegrationType() const
Resonance width integration scheme used to treat finite resonance widths.
double AbsoluteQuark() const
Absolute light quark content |u,d|.
void SetStatistics(int stat)
Set particle&#39;s statistics.
const std::vector< double > & Nch() const
void SetDegeneracy(double deg)
Set particle&#39;s internal degeneracy factor.
bool IsStable() const
Return particle stability flag.
Energy-independent Breit-Wigner in full energy interval with weighted branching ratios.
double DecayThresholdMass() const
The decays threshold mass.
void SetCalculationType(IdealGasFunctions::QStatsCalculationType type)
Sets the CalculationType() method to evaluate quantum statistics.
int ElectricCharge() const
Particle&#39;s electric charge.
int Strangeness() const
Particle&#39;s strangeness.
ParticleDecayType::DecayType DecayType() const
Decay type of the particle.
Contains structures related to particle decays.
static const int NumberOfTypes
double Degeneracy() const
Particle&#39;s internal degeneracy factor.
QStatsCalculationType
Identifies whether quantum statistics are to be computed using the cluster expansion or numerical int...
void SetAbsoluteStrangeness(double abschg)
Set absolute strange quark content |s|, light quark content then re-evaluted.
ParticleDecaysVector & DecaysOriginal()
void SetStrangenessCharge(int chg)
Set particle&#39;s strangeness.
const ParticleDecaysVector & Decays() const
A vector of particle&#39;s decays.
double AbsoluteCharm() const
Absolute charm quark content |s|.
double ArbitraryCharge() const
Arbitrary (auxiliary) charge assigned to particle.
The main namespace where all classes and functions of the Thermal-FIST library reside.
bool IsAntiParticle() const
Whether particle is an antiparticle, i.e. its PDG ID is < 0.
const std::vector< double > & DeltaNch() const
void SetArbitraryCharge(double arbchg)
Assigns arbitrary (auxiliary) charge to particle.
int Statistics() const
Particle&#39;s statistics.
void SetWeight(double weight)
Set particle&#39;s weight factor.