8 #ifndef RANDOMGENERATORS_H 9 #define RANDOMGENERATORS_H 13 #include "MersenneTwister.h" 21 namespace RandomGenerators {
27 void SetSeed(
const unsigned int seed);
51 static double pn(
int n,
double a,
int nu);
54 static double R(
double x,
int nu);
56 static double mu(
double a,
int nu) {
return a *
R(a, nu) / 2; }
58 static double chi2(
double a,
int nu);
60 static int m(
double a,
int nu) {
return static_cast<int>((sqrt(a*a+static_cast<double>(nu)*nu) - nu)/2.); }
62 static double sig2(
double a,
int nu);
64 static double Q2(
double a,
int nu);
70 static double pmXmOverpm(
int X,
int tm,
double a,
int nu);
108 virtual std::vector<double> GetMomentum(
double mass = -1.)
const = 0;
132 m_Mass(mass), m_T(T), m_Mu(
mu), m_Statistics(statistics)
135 m_Max = ComputeMaximum(m_Mass);
144 double GetP(
double mass = -1.)
const;
148 double g(
double x,
double mass = -1.)
const;
150 double ComputeMaximum(
double mass)
const;
152 void FixParameters();
154 double m_Mass, m_T, m_Mu;
184 m_Gamma = 1. / sqrt(1. - m_Beta * m_Beta);
201 m_Gamma = 1. / sqrt(1. - m_Beta * m_Beta);
210 virtual std::vector<double> GetMomentum(
double mass = -1.)
const;
216 double w(
double p)
const {
217 return sqrt(p*p + m_Mass * m_Mass);
220 double alpha(
double p)
const {
221 return m_Gamma * m_Beta * p / m_T;
226 double g(
double x,
double mass = -1.)
const;
227 double g2(
double x,
double tp,
double mass = -1.)
const;
230 void FixParameters();
235 double GetRandom(
double mass = -1.)
const;
271 m_Generator(mass, statistics, T,
mu)
278 virtual std::vector<double> GetMomentum(
double mass = -1.)
const;
309 double Tkin = 0.100,
double etamax = 3.0,
double mass = 0.938,
int statistics = 0,
double mu = 0);
318 double EtaMax()
const {
return m_EtaMax; }
319 double Mass()
const {
return m_Mass; }
323 virtual std::vector<double> GetMomentum(
double mass = -1.)
const;
362 BreitWignerGenerator(
double M,
double gamma,
double mthr) : m_M(M), m_Gamma(gamma), m_Mthr(mthr) { FixParameters(); }
373 void SetParameters(
double M,
double gamma,
double mthr);
383 double GetRandom()
const;
387 double f(
double x)
const;
390 void FixParameters();
443 double GetRandom()
const;
447 virtual void FixParameters();
450 virtual double f(
double M)
const;
490 virtual void FixParameters();
492 virtual double f(
double M)
const;
508 namespace RandomGenerators {
533 SSHMomentumGenerator(
double T,
double betas,
double etamax,
double npow,
double mass) :m_T(T), m_BetaS(betas), m_EtaMax(etamax), m_n(npow), m_Mass(mass) {
534 m_distr =
SSHDistribution(0, m_Mass, m_T, m_BetaS, m_EtaMax, m_n,
false);
552 void SetParameters(
double T,
double betas,
double etamax,
double npow,
double mass) {
572 m_BetaS = (2. + m_n) / 2. * betaT;
587 std::vector<double> GetMomentum(
double mass = -1.)
const;
592 double w(
double p)
const {
593 return sqrt(p * p + m_Mass * m_Mass);
596 double g(
double x)
const {
597 return m_distr.dndpt(-log(x)) / x;
600 double g2(
double x)
const {
604 void FixParameters();
606 void FixParameters2();
609 void FindMaximumPt();
611 void FindMaximumY(
double pt);
613 void FindMaximumY2(
double pt);
616 std::pair<double, double> GetRandom(
double mass = -1.);
618 std::pair<double, double> GetRandom2(
double mass = -1.)
const;
620 double m_T, m_BetaS, m_EtaMax, m_n, m_Mass;
621 double m_MaxY, m_MaxPt;
624 std::vector<SplineFunction> m_dndy;
625 std::vector<double> m_MaxYs;
Class for generating mass of resonance in accordance with the constant width Breit-Wigner distributio...
int RandomPoisson(double mean)
Generates random integer distributed by Poisson with specified mean Uses randgenMT.
Class for generating the momentum of a particle in accordance with the longitudinally symmetric blast...
Base class for Monte Carlo sampling of particle momenta.
Class for generating the absolute values of the momentum of a particle in its local rest frame...
void SetParameters(double T, double betas, double etamax, double npow, double mass)
Sets the parameters of the distribution.
SiemensRasmussenMomentumGeneratorGeneralized(double T, double beta, double mass, int statistics=0, double mu=0)
Construct a new SiemensRasmussenMomentumGeneratorGeneralized object.
void SetMeanBetaT(double betaT)
Set the mean transverse flow velocity.
static int RandomBesselPoisson(double a, int nu)
static int RandomBesselCombined(double a, int nu)
static int RandomBesselDevroye3(double a, int nu)
SiemensRasmussenMomentumGenerator()
static int RandomBesselCombined(double a, int nu, MTRand &rangen)
SSHMomentumGenerator(double T, double betas, double etamax, double npow, double mass)
Construct a new SSHGenerator object.
static double sig2(double a, int nu)
static double R(double x, int nu)
Class implementing a simple linear spline.
static double mu(double a, int nu)
static int RandomBesselNormal(double a, int nu)
static int RandomBesselDevroye2(double a, int nu)
static double Q2(double a, int nu)
static int RandomBesselDevroye2(double a, int nu, MTRand &rangen)
Class for generating mass of resonance in accordance with the relativistic Breit-Wigner distribution...
static int RandomBesselDevroye1(double a, int nu, MTRand &rangen)
SiemensRasmussenMomentumGeneratorGeneralized()
~SiemensRasmussenMomentumGenerator()
void SetParameters(double T, double beta, double mass)
Sets the parameters of the Siemens-Rasmussen distribution.
void SetSeed(const unsigned int seed)
Set the seed of the random number generator randgenMT.
MTRand randgenMT
The Mersenne Twister random number generator.
Class containing all information about a particle specie.
static int RandomBesselNormal(double a, int nu, MTRand &rangen)
static double pn(int n, double a, int nu)
ThermalEnergyBreitWignerGenerator()
Generator of a random number from the Bessel distribution (a, nu), nu is integer Uses methods from ht...
double SkellamProbability(int k, double mu1, double mu2)
Probability of a Skellam distributed random variable with Poisson means mu1 and mu2 to have the value...
ParticleMomentumGenerator()
Default constructor.
double GetBetaSurface() const
ThermalBreitWignerGenerator()
Class for generating the momentum of a particle in accordance with the Siemens-Rasmussen formula...
static double chi2(double a, int nu)
ThermalEnergyBreitWignerGenerator(ThermalParticle *part, double T, double Mu)
Construct a new ThermalEnergyBreitWignerGenerator object.
BreitWignerGenerator(double M, double gamma, double mthr)
Construct a new BreitWignerGenerator object.
Base class implementing a longitudinally boost-invariant azimuthally symmetric freeze-out parametriza...
ThermalMomentumGenerator(double mass=0.938, int statistics=0, double T=0.100, double mu=0.)
Construct a new ThermalMomentumGenerator object.
virtual ~ThermalBreitWignerGenerator()
static int m(double a, int nu)
ThermalBreitWignerGenerator(ThermalParticle *part, double T, double Mu)
Construct a new ThermalBreitWignerGenerator object.
Class for generating momentum of a particle in accordance with a longitudinally boost invariant and a...
A generalized class for generating the momentum of a particle in accordance with the Siemens-Rasmusse...
Class for generating mass of resonance in accordance with the energy-dependent Breit-Wigner distribut...
~ThermalEnergyBreitWignerGenerator()
static double pmXmOverpm(int X, int tm, double a, int nu)
static int RandomBesselPoisson(double a, int nu, MTRand &rangen)
SiemensRasmussenMomentumGenerator(double T, double beta, double mass)
Construct a new SiemensRasmussenMomentumGenerator object.
static int RandomBesselDevroye1(double a, int nu)
The main namespace where all classes and functions of the Thermal-FIST library reside.
Class implementing the momentum distribution in the longitudinally symmetric Blast-Wave model...
virtual ~ParticleMomentumGenerator()
Destructor.
static int RandomBesselDevroye3(double a, int nu, MTRand &rangen)