36    std::vector<double> Weights;
 
   37    for (
auto& element : (*Hypersurface)) {
 
   39      for (
int mu = 0; mu < 4; ++mu)
 
   40        dVeff += element.dsigma[mu] * element.u[mu];
 
   41      Weights.push_back(dVeff);
 
 
   48    m_CumulativeProbabilities = std::vector<double>(Weights.size(), 0.);
 
   49    double totalWeight = 0.;
 
   50    for (
int i = 0; i < Weights.size(); ++i) {
 
   51      totalWeight += Weights[i];
 
   52      m_CumulativeProbabilities[i] += Weights[i];
 
   54        m_CumulativeProbabilities[i] += m_CumulativeProbabilities[i - 1];
 
   56    for (
double& prob : m_CumulativeProbabilities) {
 
 
   63    double prob = rangen.rand();
 
   64    const auto& it = std::lower_bound(m_CumulativeProbabilities.begin(), m_CumulativeProbabilities.end(), prob);
 
   65    int tind = std::distance(m_CumulativeProbabilities.begin(), it);
 
   66    if (tind < 0) tind = 0;
 
   67    if (tind >= 
static_cast<int>(m_CumulativeProbabilities.size())) tind = m_CumulativeProbabilities.size() - 1;
 
 
   77    m_ParticlizationHypersurface(hypersurface),
 
   79    m_VolumeElementSampler(positionsampler),
 
   80    m_EtaSmear(config.etaSmear),
 
   81    m_ShearCorrection(config.shearCorrection),
 
   82    m_BulkCorrection(config.bulkCorrection),
 
   83    m_SpeedOfSoundSquared(config.speedOfSoundSquared)
 
 
   90    if (m_VolumeElementSampler == NULL || m_ParticlizationHypersurface == NULL) {
 
   91      throw std::runtime_error(
"RandomGenerators::HypersurfaceMomentumGenerator::GetMomentum(double mass): Hypersurface not initialized!");
 
   97    int VolumeElementIndex = m_VolumeElementSampler->SampleVolumeElement();
 
 
  132    return m_FullSpaceYields;
 
 
  137    return m_FullSpaceYields;
 
 
  157    vector<vector<double>> allweights(
m_THM->TPS()->ComponentsNumber(), vector<double>(m_ParticlizationHypersurface->size(), 0.));
 
  159    m_FullSpaceYields = vector<double>(
m_THM->TPS()->ComponentsNumber(), 0.);
 
  161    m_Musav = vector<double>(
m_THM->TPS()->ComponentsNumber(), 0.);
 
  165    vector<double> FullDensities(
m_THM->TPS()->ComponentsNumber(), 0.), FullDensitiesIdeal(
m_THM->TPS()->ComponentsNumber(), 0.);
 
  167    cout << 
"Processing " << m_ParticlizationHypersurface->size() << 
" volume elements" << endl;
 
  172    double rescaleTmu_EMatch = 0., rescaleTmu_Etot = 0.;
 
  175    for (
size_t ielem = 0; ielem < m_ParticlizationHypersurface->size(); ++ielem) {
 
  176      if (ielem % 10000 == 0) {
 
  177        cout << ielem << 
" ";
 
  180      const auto& elem = m_ParticlizationHypersurface->operator[](ielem);
 
  182      m_THM->SetTemperature(elem.T);
 
  183      m_THM->SetBaryonChemicalPotential(elem.muB);
 
  184      m_THM->SetElectricChemicalPotential(elem.muQ);
 
  185      m_THM->SetStrangenessChemicalPotential(elem.muS);
 
  187      if (
m_Config.CFOParameters.gammaq != 1.0)
 
  190      if (
m_Config.CFOParameters.gammaS != 1.0)
 
  193      if (
m_Config.CFOParameters.gammaC != 1.0)
 
  197      for (
int mu = 0; mu < 4; ++mu)
 
  198        dVeff += elem.dsigma[mu] * elem.u[mu];
 
  204      if (abs(elem.edens - m_edens) <= 1.e-3)
 
  205        rescaleTmu_EMatch += dVeff * elem.edens;
 
  208      rescaleTmu_Etot += dVeff * elem.edens;
 
  211      m_Tav += elem.T * dVeff;
 
  213      m_THM->CalculatePrimordialDensities();
 
  215      std::vector<double>* densitiesIdeal = &
m_THM->Densities();
 
  216      std::vector<double> tdens;
 
  217      if (
m_THM->TAG() != 
"ThermalModelIdeal") {
 
  218        tdens = 
m_THM->GetIdealGasDensities();
 
  219        densitiesIdeal = &tdens;
 
  222      for (
size_t ipart = 0; ipart < 
m_THM->TPS()->ComponentsNumber(); ++ipart) {
 
  223        allweights[ipart][ielem] = 
m_THM->Densities()[ipart] * dVeff;
 
  225        m_Musav[ipart] += 
m_THM->ChemicalPotential(ipart) * dVeff;
 
  226        FullDensities[ipart] += 
m_THM->Densities()[ipart] * dVeff;
 
  227        FullDensitiesIdeal[ipart] += densitiesIdeal->operator[](ipart) * dVeff;
 
  234    std::vector<RandomGenerators::VolumeElementSampler>().swap(m_VolumeElementSamplers);
 
  235    m_VolumeElementSamplers.clear();
 
  236    for (
size_t ipart = 0; ipart < 
m_THM->TPS()->ComponentsNumber(); ++ipart) {
 
  239      vector<double>().swap(allweights[ipart]);
 
  242    m_FullSpaceYields = FullDensities;
 
  245    for (
size_t ipart = 0; ipart < 
m_THM->TPS()->ComponentsNumber(); ++ipart) {
 
  246      m_Musav[ipart] /= Veff;
 
  247      FullDensities[ipart] /= Veff;
 
  248      FullDensitiesIdeal[ipart] /= Veff;
 
  252    cout << 
"V     = " << Veff << endl;
 
  253    cout << 
"<T>   = " << m_Tav << endl;
 
  254    cout << 
"<muB> = " << m_Musav[
m_THM->TPS()->PdgToId(2112)] << endl;
 
  258      if (rescaleTmu_EMatch/rescaleTmu_Etot < 0.90) {
 
  259        printf(
"**WARNING** Energy density mismatch for T-Mu rescaling: %lf\n", rescaleTmu_EMatch/rescaleTmu_Etot);
 
  261      cout << 
"Edens match fraction = " << rescaleTmu_EMatch/rescaleTmu_Etot << endl;
 
  269      double totB = 0., totQ = 0., totS = 0., totC = 0.;
 
  270      for (
size_t ipart = 0; ipart < 
m_THM->TPS()->ComponentsNumber(); ++ipart) {
 
  271        totB += 
m_THM->TPS()->Particle(ipart).BaryonCharge() * m_FullSpaceYields[ipart];
 
  272        totQ += 
m_THM->TPS()->Particle(ipart).ElectricCharge() * m_FullSpaceYields[ipart];
 
  273        totS += 
m_THM->TPS()->Particle(ipart).Strangeness() * m_FullSpaceYields[ipart];
 
  274        totC += 
m_THM->TPS()->Particle(ipart).Charm() * m_FullSpaceYields[ipart];
 
  278      cout << 
"Integrated values of conserved charges:" << endl;
 
  279      cout << 
"B = " << totB << endl;
 
  280      cout << 
"Q = " << totQ << endl;
 
  281      cout << 
"S = " << totS << endl;
 
  282      cout << 
"C = " << totC << endl;
 
  287        if (abs(totB) > 1.e-6) {
 
  288          Vcorr = round(totB) / totB;
 
  290          cout << 
"Volume rescaling factor Vcorr = " << Vcorr << endl;
 
  291          cout << 
"B: " << totB << 
" -> " << round(totB) << endl;
 
  298        cout << 
"Q: " << totQ * Vcorr << 
" -> " << round(totQ * Vcorr) << endl;
 
  303        cout << 
"S: " << totS * Vcorr << 
" -> " << round(totS * Vcorr) << endl;
 
  308        cout << 
"C: " << totC * Vcorr << 
" -> " << round(totC * Vcorr) << endl;
 
  316    m_THM->SetVolume(Veff);
 
  317    m_THM->SetCanonicalVolume(Veff);
 
  318    m_THM->Densities() = FullDensities;
 
 
  326    cout << 
"Remapping T and mu along e = " << edens << 
" surface..." << endl;
 
  327    vector<double> rhos, Ts, muBs, muSs, muQs, Ps;
 
  328    vector<double> Tmusini = { 0.150, 0.100, 0.033, -0.05 };
 
  329    for (
double rho = rhomin; rho < rhomax + 1.e-9; rho += drho) {
 
  332      if (rho == rhomin || rho - drho == rhomin) {
 
  339      auto Tmus = MatchEnergyBaryonDensities(model, edens, rho);
 
  340      Ts.push_back(Tmus[0]);
 
  341      muBs.push_back(Tmus[1]);
 
  342      muSs.push_back(Tmus[2]);
 
  343      muQs.push_back(Tmus[3]);
 
  344      Ps.push_back(Tmus[4]);
 
  347    return { rhos, Ts, muBs, muSs, muQs, Ps };
 
 
  353    m_RescaleTmu = rescale;
 
 
  369      for (
size_t i = 0; i < 
m_THM->TPS()->Particles().size(); ++i) {
 
  372          m_ParticlizationHypersurface,
 
  373          &
m_THM->TPS()->Particle(i),
 
  374          &m_VolumeElementSamplers[i],
 
  375          m_MomentumGeneratorConfig
 
  380        double Mu = m_Musav[i];
 
 
  391                                                                      double rhomin, 
double rhomax, 
double drho,
 
  394    vector<SplineFunction> SplinesTMu(5);
 
  395    for(
int i = 0; i < 5; ++i)
 
  396      SplinesTMu[i].fill(TMuMap[0], TMuMap[1+i]);
 
  398    for(
auto& elem : *hypersurface) {
 
  399      if (abs(elem.edens - edens) > 1.e-3 || elem.rhoB < 0.0 || elem.rhoB > 0.25) {
 
  403        elem.T = SplinesTMu[0].f(elem.rhoB);
 
  404        elem.muB = SplinesTMu[1].f(elem.rhoB);
 
  405        elem.muS = SplinesTMu[2].f(elem.rhoB);
 
  406        elem.muQ = SplinesTMu[3].f(elem.rhoB);
 
  407        elem.P = SplinesTMu[4].f(elem.rhoB);
 
 
  415    VolumeElementSampler* positionsampler, 
double Tkin, 
double etamax, 
double mass, 
int statistics, 
double mu) :
 
  416    m_ParticlizationHypersurface(hypersurface),
 
  417    m_VolumeElementSampler(positionsampler),
 
  418    m_Tkin(Tkin), m_EtaMax(etamax), m_Mass(mass),
 
  419    m_Generator(mass, statistics, Tkin, mu)
 
 
  426    if (m_VolumeElementSampler == NULL || m_ParticlizationHypersurface == NULL) {
 
  427      throw std::runtime_error(
"RandomGenerators::BoostInvariantHypersurfaceMomentumGenerator::GetMomentum(double mass): Hypersurface not initialized!");
 
  433    std::vector<double> ret(3, 0.);
 
  434    int VolumeElementIndex = m_VolumeElementSampler->SampleVolumeElement();
 
  438    double etaF = 0.5 * log((elem.
u[0] + elem.
u[3]) / (elem.
u[0] - elem.
u[3]));
 
  441    double vx = elem.
u[1] / elem.
u[0];
 
  442    double vy = elem.
u[2] / elem.
u[0];
 
  443    double vz = tanh(etaF);
 
  448    std::vector<double> dsigma_loc =
 
  453    double maxWeight = 1. + std::abs(dsigma_loc[1] / dsigma_loc[0]) + std::abs(dsigma_loc[2] / dsigma_loc[0]) + std::abs(dsigma_loc[3] / dsigma_loc[0]);
 
  456      double tp = m_Generator.GetP(mass);
 
  459      double sthe = sqrt(1. - cthe * cthe);
 
  460      part.
px = tp * cos(tphi) * sthe;
 
  461      part.
py = tp * sin(tphi) * sthe;
 
  463      part.
p0 = sqrt(mass * mass + tp * tp);
 
  465      double p0LRF = part.
p0;
 
  467      double dsigmamu_pmu_loc = dsigma_loc[0] * part.
p0 
  468        - dsigma_loc[1] * part.
px - dsigma_loc[2] * part.
py - dsigma_loc[3] * part.
pz;
 
  471      double dsigmamu_umu_loc = dsigma_loc[0];
 
  473      double dumu_pmu_loc = p0LRF;
 
  475      double Weight = dsigmamu_pmu_loc / dsigmamu_umu_loc / dumu_pmu_loc / maxWeight;
 
  478        printf(
"**WARNING** BoostInvariantHypersurfaceMomentumGenerator::GetMomentum: Weight exceeds unity by %E\n",
 
  486    if (vx != 0.0 || vy != 0.0 || vz != 0.0)
 
  489    double eta = elem.
eta;
 
  490    double cosheta = cosh(eta);
 
  491    double sinheta = sinh(eta);
 
  496      double tpz = part.
GetMt() * std::sinh(part.
GetY() + deta);
 
  497      double tp0 = sqrt(part.
m * part.
m + part.
px * part.
px + part.
py * part.
py + tpz * tpz);
 
  517    double tau = elem.
tau;
 
  518    double r0 = tau * cosheta;
 
  519    double rz = tau * sinheta;
 
 
  538    const double vv [3] = {vx, vy, vz} ;
 
  539    const double v2 = vx*vx+vy*vy+vz*vz ;
 
  540    const double gamma = 1.0/sqrt(1.0-v2) ;
 
  541    if(std::isinf(gamma)||std::isnan(gamma)){ 
throw std::runtime_error(
"boost vector invalid"); }
 
  542    boostMatrix[0][0] = gamma ;
 
  543    boostMatrix[0][1] = boostMatrix[1][0] = vx*gamma ;
 
  544    boostMatrix[0][2] = boostMatrix[2][0] = vy*gamma ;
 
  545    boostMatrix[0][3] = boostMatrix[3][0] = vz*gamma ;
 
  547    for(
int i=1; i<4; i++)
 
  548    for(
int j=1; j<4; j++)
 
  549    boostMatrix[i][j] = (gamma-1.0)*vv[i-1]*vv[j-1]/v2 ;
 
  551    for(
int i=1; i<4; i++)
 
  552    for(
int j=1; j<4; j++)
 
  553    boostMatrix[i][j] = 0.0 ;
 
  555    for(
int i=1; i<4; i++) boostMatrix[i][i] += 1.0 ;
 
 
  560    if(i>3 || j>3 || i<0 || j<0) {std::cout<<
"index44: i j " <<i<<
" "<<j<<endl ; exit(1) ; }
 
  561    if(j<i) 
return (i*(i+1))/2 + j ;
 
  562    else return (j*(j+1))/2 + i ;
 
 
  567    if (particle == NULL) {
 
  568      throw std::runtime_error(
"HypersurfaceMomentumGenerator::SamplePhaseSpaceCoordinateFromElement(): Unknown particle species!");
 
  571    double etaF = 0.5 * log((elem->
u[0] + elem->
u[3]) / (elem->
u[0] - elem->
u[3]));
 
  573    double vx = elem->
u[1] / elem->
u[0];
 
  574    double vy = elem->
u[2] / elem->
u[0];
 
  575    double vz = tanh(etaF);
 
  580    std::vector<double> dsigma_loc =
 
  586    double maxWeight = 1. + std::abs(dsigma_loc[1] / dsigma_loc[0]) + std::abs(dsigma_loc[2] / dsigma_loc[0]) + std::abs(dsigma_loc[3] / dsigma_loc[0]);
 
  589    double Wvisc_min = 0.1, Wvisc_max = 10.0;  
 
  597    const double gmumu[4] = {1., -1., -1., -1.};
 
  602    const double feq = C_Feq / (exp((part.
p0-mu)/T) - stat); 
 
  604    double boostMatrix[4][4];
 
  605    if (shear_correction){
 
  606      maxWeight *= Wvisc_max;
 
  609      for (
int i=0; i<4; i++){
 
  610        for (
int j=0; j<4; j++){
 
  612          for (
int k=0; k<4; k++){
 
  613            for (
int l=0; l<4; l++){
 
  614              pi_lrf[
index44(i,j)] += elem->
pi[
index44(k,l)] * boostMatrix[i][k] * boostMatrix[j][l];
 
  622      double tp = Generator.
GetP(mass);
 
  625      double sthe = sqrt(1. - cthe * cthe);
 
  626      part.
px = tp * cos(tphi) * sthe;
 
  627      part.
py = tp * sin(tphi) * sthe;
 
  629      part.
p0 = sqrt(mass * mass + tp * tp);
 
  631      double p0LRF = part.
p0;
 
  633      double dsigmamu_pmu_loc = dsigma_loc[0] * part.
p0 
  634        - dsigma_loc[1] * part.
px - dsigma_loc[2] * part.
py - dsigma_loc[3] * part.
pz;
 
  636      double dsigmamu_umu_loc = dsigma_loc[0];
 
  638      double dumu_pmu_loc = p0LRF;
 
  640      double Weight = dsigmamu_pmu_loc / dsigmamu_umu_loc / dumu_pmu_loc / maxWeight;
 
  642      double Weight_visc = 1.0;
 
  643      if (shear_correction){
 
  644        double mom[4] = {part.
p0, part.
px, part.
py, part.
pz};
 
  646        for (
int i=0; i<4; i++){
 
  647          for (
int j=0; j<4; j++){
 
  648            pipp += mom[i] * mom[j] * gmumu[i] * gmumu[j] * pi_lrf[
index44(i,j)];
 
  653        Weight_visc += ((1.0 + stat * feq) * pipp / (2.0 * T * T * (elem->
edens + elem->
P)));
 
  656      if (bulk_correction){
 
  660         double mom[4] = {part.
p0, part.
px, part.
py, part.
pz};
 
  661         Weight_visc -= (1.0+stat*feq)*elem->
Pi 
  662                 *(mass*mass/(3*mom[0])-mom[0]*(1.0/3.0-speed_of_sound_squared))
 
  663                 /(15*(1.0/3.0-speed_of_sound_squared)*(1.0/3.0-speed_of_sound_squared)*T*(elem->
edens + elem->
P))  ;
 
  665      if (bulk_correction || shear_correction){
 
  666        if (Weight_visc<Wvisc_min) Weight_visc = Wvisc_min;
 
  667        if (Weight_visc>Wvisc_max) Weight_visc = Wvisc_max;
 
  669        Weight *= Weight_visc;
 
  675        printf(
"**WARNING** HypersurfaceSampler::GetMomentum: Weight exceeds unity by %E\n",
 
  682    if (vx != 0.0 || vy != 0.0 || vz != 0.0)
 
  685    double eta = elem->
eta;
 
  686    double cosheta = cosh(eta);
 
  687    double sinheta = sinh(eta);
 
  690    if (etasmear > 0.0) {
 
  693      double tpz = part.
GetMt() * std::sinh(part.
GetY() + deta);
 
  694      double tp0 = sqrt(part.
m * part.
m + part.
px * part.
px + part.
py * part.
py + tpz * tpz);
 
  705    double tau = elem->
tau;
 
  706    double r0 = tau * cosheta;
 
  707    double rz = tau * sinheta;
 
  712    return { part.
px, part.
py, part.
pz, r0, rx, ry, rz };
 
 
  716    : m_VolumeElementSampler(NULL)
 
 
  725    if (m_VolumeElementSampler != NULL)
 
  726      delete m_VolumeElementSampler;
 
 
  732    m_ParticlizationHypersurface = hypersurface;
 
 
  741    if (m_VolumeElementSampler != NULL)
 
  742      delete m_VolumeElementSampler;
 
  744    m_VolumeElementSampler =
 
  749      for (
size_t i = 0; i < 
m_THM->TPS()->Particles().size(); ++i) {
 
  752          m_ParticlizationHypersurface,
 
  753          m_VolumeElementSampler,
 
  758          m_THM->FullIdealChemicalPotential(i)
 
  761        double T = 
m_THM->Parameters().T;
 
  762        double Mu = 
m_THM->FullIdealChemicalPotential(i);
 
 
  775    std::pair< std::vector<int>, 
double > yieldsW = 
SampleYields();
 
  776    std::pair<int, int> NBBbar = ComputeNBNBbar(yieldsW.first);
 
  777    double wgtB    = 
EVHRGWeight( NBBbar.first,  m_MeanB, m_VEff, m_b);
 
  778    double wgtBbar = 
EVHRGWeight(NBBbar.second, m_MeanAB, m_VEff, m_b);
 
  781      NBBbar = ComputeNBNBbar(yieldsW.first);
 
  782      wgtB = 
EVHRGWeight(NBBbar.first, m_MeanB, m_VEff, m_b);
 
  783      wgtBbar = 
EVHRGWeight(NBBbar.second, m_MeanAB, m_VEff, m_b);
 
  786    std::vector<int>& yields = yieldsW.first;
 
 
  798    double nev = meanN / V;
 
  799    return pow((1. - b * sampledN / V) / (1. - b * nev), sampledN)
 
  800      * exp(b * nev / (1. - b * nev) * (sampledN - meanN));
 
 
  806    m_MeanB = 0.0; m_MeanAB = 0.0;
 
  807    m_VEff = 
m_THM->Volume();
 
  809    for (
int ipart = 0; ipart < 
m_THM->TPS()->ComponentsNumber(); ++ipart) {
 
  817    cout << 
"nB  = " << m_MeanB  / m_VEff << endl;
 
  818    cout << 
"naB = " << m_MeanAB / m_VEff << endl;
 
 
  831    std::vector<int> idsM, idsB, idsaB;
 
  832    for (
int i = 0; i < 
m_THM->TPS()->Particles().size(); ++i)
 
  833      if (
m_THM->TPS()->Particles()[i].BaryonCharge() != 1 && 
m_THM->TPS()->Particles()[i].BaryonCharge() != -1)
 
  834        for (
int part = 0; part < yields[i]; ++part)
 
  838    for (
int i = 0; i < 
m_THM->TPS()->Particles().size(); ++i)
 
  839      if (
m_THM->TPS()->Particles()[i].BaryonCharge() == 1)
 
  840        for (
int part = 0; part < yields[i]; ++part)
 
  844    for (
int i = 0; i < 
m_THM->TPS()->Particles().size(); ++i)
 
  845      if (
m_THM->TPS()->Particles()[i].BaryonCharge() == -1)
 
  846        for (
int part = 0; part < yields[i]; ++part)
 
  851    std::vector<int> ids;
 
  852    ids.insert(ids.end(), idsM.begin(), idsM.end());
 
  853    ids.insert(ids.end(), idsB.begin(), idsB.end());
 
  854    ids.insert(ids.end(), idsaB.begin(), idsaB.end());
 
  856    int idBstart = idsM.size();
 
  857    int idaBstart = idsM.size() + idsB.size();
 
  860    for (
int ip = 0; ip < ids.size(); ++ip) {
 
  867          bool flOverlap = 
false;
 
  869          while (tip >= 0 && 
m_THM->TPS()->Particles()[ids[tip]].BaryonCharge() == species.
BaryonCharge()) {
 
  871            flOverlap |= (dist2 <= 4. * radB * radB);
 
 
  905  std::pair<int, int> HypersurfaceEventGeneratorEVHRG::ComputeNBNBbar(
const std::vector<int>& yields)
 const 
  907    int NB = 0, NBbar = 0;
 
  908    for (
int ipart = 0; ipart < 
m_THM->TPS()->ComponentsNumber(); ++ipart) {
 
  913        NBbar += yields[ipart];
 
  915    return std::make_pair(NB, NBbar);
 
Contains some functions to deal with excluded volumes.
 
BoostInvariantHypersurfaceEventGenerator(ThermalParticleSystem *TPS=NULL, const EventGeneratorConfiguration &config=EventGeneratorConfiguration(), double etamax=0.5, const ParticlizationHypersurface *hypersurface=NULL)
Construct a new BoostInvariantHypersurfaceEventGenerator object.
 
virtual ~BoostInvariantHypersurfaceEventGenerator()
 
void SetMomentumGenerators()
 
std::vector< RandomGenerators::ThermalBreitWignerGenerator * > m_BWGens
 
EventGeneratorBase()
Constructor.
 
static SimpleEvent PerformDecays(const SimpleEvent &evtin, const ThermalParticleSystem *TPS, const DecayerFlags &decayerFlags=DecayerFlags())
Performs decays of all unstable particles until only stable ones left.
 
virtual std::pair< std::vector< int >, double > SampleYields() const
Samples the primordial yields for each particle species.
 
virtual SimpleEvent GetEvent(bool PerformDecays=true) const
Generates a single event.
 
std::vector< RandomGenerators::ParticleMomentumGenerator * > m_MomentumGens
Vector of momentum generators for each particle species.
 
virtual SimpleParticle SampleParticle(int id) const
Samples the position and momentum of a particle species i.
 
void ClearMomentumGenerators()
Clears the momentum generators for all particles.
 
void PrepareMultinomials()
 
EventGeneratorConfiguration m_Config
 
virtual void CheckSetParameters()
Sets the hypersurface parameters.
 
std::vector< double > m_DensitiesIdeal
Ideal gas densities used for sampling an interacting HRG.
 
void SetConfiguration(ThermalParticleSystem *TPS, const EventGeneratorConfiguration &config)
Sets the event generator configuration.
 
virtual void SetParameters()
Sets up the event generator ready for production.
 
static double EVHRGWeight(int sampledN, double meanN, double V, double b)
 
virtual SimpleEvent GetEvent(bool DoDecays=true) const
Generates a single event.
 
HypersurfaceEventGeneratorEVHRG(ThermalParticleSystem *TPS, const EventGeneratorConfiguration &config=EventGeneratorConfiguration(), const ParticlizationHypersurface *hypersurface=NULL, double etasmear=0.0, bool shear_correction=false)
 
virtual SimpleEvent SampleParticles(const std::vector< int > &yields) const
 
virtual void SetParameters()
Sets the hypersurface parameters.
 
void SetRescaleTmu(bool rescale=false, double edens=0.26)
 
virtual void SetParameters()
Sets the hypersurface parameters.
 
HypersurfaceEventGenerator(const ParticlizationHypersurface *hypersurface=NULL, ThermalModelBase *model=NULL, double etasmear=0.0, bool shear_correction=false, bool bulk_correction=false, double speed_of_sound_squared=0.15)
Construct a new HypersurfaceEventGenerator object.
 
void SetEtaSmear(double etaSmear)
 
static std::vector< std::vector< double > > CalculateTMuMap(ThermalModelBase *model, double edens, double rhomin=0.0, double rhomax=0.27, double drho=0.001)
Calculates the (T,muB,muS,muQ) values as function of baryon density at fixed constant energy density.
 
void SetBulkCorrection(bool bulk_correction)
 
void SetHypersurface(const ParticlizationHypersurface *hypersurface)
 
static void RescaleHypersurfaceParametersEdens(ParticlizationHypersurface *hypersurface, ThermalModelBase *model, double edens, double rhomin=0.0, double rhomax=0.27, double drho=0.001, double rhocrit=0.16)
Rescales the hypersurface parameters to match the given energy and baryon density.
 
const std::vector< double > & FullSpaceYields() const
The computed grand-canonical yields in 4pi.
 
void SetMomentumGeneratorConfig(const RandomGenerators::HypersurfaceMomentumGenerator::HypersurfaceMomentumGeneratorConfiguration &config)
 
void ProcessVolumeElements()
Processes the volume elements to calculate the multinomial volume element sampling probabilities and ...
 
virtual SimpleEvent GetEvent(bool PerformDecays=true) const
Sets the hypersurface parameters.
 
void SetSpeedOfSoundSquared(double speed_of_sound_squared)
 
virtual std::vector< double > GCEMeanYields() const
Override.
 
void SetShearCorrection(bool shear_correction)
 
void SetMomentumGenerators()
Sets the hypersurface parameters.
 
Class for generating momentum of a particle from a longitudinally boost-invariant (2+1)-D hypersurfac...
 
virtual std::vector< double > GetMomentum(double mass=-1.) const
 
BoostInvariantHypersurfaceMomentumGenerator(const ParticlizationHypersurface *hypersurface=NULL, VolumeElementSampler *positionsampler=NULL, double Tkin=0.100, double etamax=3.0, double mass=0.938, int statistics=0, double mu=0)
Construct a new BoostInvariantMomentumGenerator object.
 
Class for generating momentum of a particle from a hypersurface.
 
virtual std::vector< double > GetMomentum(double mass=-1.) const
 
bool ShearCorrection() const
 
double SpeedOfSoundSquared() const
 
HypersurfaceMomentumGenerator(const ParticlizationHypersurface *hypersurface=NULL, const ThermalParticle *particle=NULL, const VolumeElementSampler *positionsampler=NULL, const HypersurfaceMomentumGeneratorConfiguration &config=HypersurfaceMomentumGeneratorConfiguration())
Construct a new BoostInvariantMomentumGenerator object.
 
bool BulkCorrection() const
 
static std::vector< double > SamplePhaseSpaceCoordinateFromElement(const ParticlizationHypersurfaceElement *elem, const ThermalParticle *particle, const double &mass=-1., const double &etasmear=0., const bool shear_correction=false, const bool bulk_correction=false, const double speed_of_sound_squared=0.15)
Samples the Cartesian phase-space coordinates of a particle emmited from a hypersurface element.
 
Class for generating mass of resonance in accordance with the constant width Breit-Wigner distributio...
 
Class for generating mass of resonance in accordance with the energy-dependent Breit-Wigner distribut...
 
Class for generating the absolute values of the momentum of a particle in its local rest frame.
 
double GetP(double mass=-1.) const
Samples the momentum of a particle.
 
Sample the volume element on a hypersurface from a multinomial distribution.
 
VolumeElementSampler(const ParticlizationHypersurface *Hypersurface=NULL)
 
void FillProbabilities(const ParticlizationHypersurface *Hypersurface)
 
int SampleVolumeElement(MTRand &rangen=RandomGenerators::randgenMT) const
 
Abstract base class for an HRG model implementation.
 
virtual void SetTemperature(double T)
Set the temperature.
 
virtual void SetBaryonChemicalPotential(double muB)
Set the baryon chemical potential.
 
virtual void SetElectricChemicalPotential(double muQ)
Set the electric chemical potential.
 
virtual void SetStrangenessChemicalPotential(double muS)
Set the strangeness chemical potential.
 
Class containing all information about a particle specie.
 
int BaryonCharge() const
Particle's baryon number.
 
int Statistics() const
Particle's statistics.
 
double Mass() const
Particle's mass [GeV].
 
int Strangeness() const
Particle's strangeness.
 
@ eBWconstBR
Energy-dependent Breit-Wigner scheme (eBW) with constant branching ratios when evaluating feeddown.
 
@ eBW
Energy-dependent Breit-Wigner scheme (eBW)
 
int ElectricCharge() const
Particle's electric charge.
 
Class containing the particle list.
 
double rv(double v)
Computes the radius parameter from a given excluded volume parameter value.
 
double ParticleDistanceSquared(const SimpleParticle &part1, const SimpleParticle &part2)
Return the square of the distance between particles at equal time.
 
SimpleParticle LorentzBoostMomentumOnly(const SimpleParticle &part, double vx, double vy, double vz)
Lorentz boost of the 4-momentum of a particle.
 
MTRand randgenMT
The Mersenne Twister random number generator.
 
std::mt19937 rng_std
The Mersenne Twister random number generator from STD library.
 
constexpr double Pi()
Pi constant.
 
constexpr double GeVtoifm()
A constant to transform GeV into fm .
 
The main namespace where all classes and functions of the Thermal-FIST library reside.
 
void fillBoostMatrix(double vx, double vy, double vz, double boostMatrix[4][4])
 
std::vector< double > LorentzBoost(const std::vector< double > &fourvector, double vx, double vy, double vz)
Performs a Lorentz boost on a four-vector.
 
int index44(const int &i, const int &j)
 
std::vector< ParticlizationHypersurfaceElement > ParticlizationHypersurface
 
Structure containing the thermal event generator configuration.
 
Configuration structure for the HypersurfaceMomentumGenerator.
 
Structure holding information about a single event in the event generator.
 
std::vector< SimpleParticle > Particles
Vector of all final particles in the event.
 
std::vector< SimpleParticle > AllParticles
Vector of all particles which ever appeared in the event (including those that decay and photons/lept...
 
std::vector< int > DecayMap
 
std::vector< int > DecayMapFinal
Vector for each Particles element pointing to the index of the primordial resonance from which this p...
 
Structure holding information about a single particle in the event generator.
 
double GetMt() const
Transverse mass (in GeV)
 
double pz
3-momentum components (in GeV)
 
double GetY() const
The longitudinal rapidity.