Version: SMASH-3.1
smash::PauliBlocker Class Reference

#include <pauliblocking.h>

A class that stores parameters needed for Pauli blocking, tabulates necessary integrals and computes phase-space density.

Pauli blocking is the way to go from the classical Boltzmann equation to the quantum one, effectively reducing cross-sections by \(1 - f(r,p) \) factors, where \(f(r,p)\) is a phase-space density at coordinate and momentum of a final-state fermion. Effective reduction of cross-section is done via random rejection of reaction with probability \( 1 - f\). More details can be found in Gaitanos:2010fd [22], section III B. Our implementation mainly follows this article (and therefore GiBUU, see http://gibuu.hepforge.org).

Definition at line 38 of file pauliblocking.h.

Public Member Functions

 PauliBlocker (Configuration conf, const ExperimentParameters &parameters)
 PauliBlocker constructor. More...
 
 ~PauliBlocker ()
 Destructor. More...
 
double phasespace_dens (const ThreeVector &r, const ThreeVector &p, const std::vector< Particles > &ensembles, const PdgCode pdg, const ParticleList &disregard) const
 Calculate phase-space density of a particle species at the point (r,p). More...
 

Private Member Functions

void init_weights ()
 Tabulate integrals for weights. More...
 
void init_weights_analytical ()
 Analytical calculation of weights. More...
 

Private Attributes

double sig_
 Standard deviation of the gaussian used for smearing. More...
 
double rc_
 Radius, after which gaussians (used for averaging) are cut, fm. More...
 
double rr_
 Radius of averaging in coordinate space, fm. More...
 
double rp_
 Radius of averaging in momentum space, GeV. More...
 
int ntest_
 Testparticles number. More...
 
int n_ensembles_
 Number of ensembles. More...
 
std::array< double, 30 > weights_
 Weights: tabulated results of numerical integration. More...
 

Constructor & Destructor Documentation

◆ PauliBlocker()

smash::PauliBlocker::PauliBlocker ( Configuration  conf,
const ExperimentParameters parameters 
)

PauliBlocker constructor.

Gets parameters from configuration and experiment. Tabulates necessary integrals.

Parameters
[in]confConfigurations from config.yaml.
[in]parametersParameters given by Experiment.
Returns
The constructed object.

Definition at line 18 of file pauliblocking.cc.

20  : sig_(param.gaussian_sigma),
21  rc_(conf.take({"Gaussian_Cutoff"}, 2.2)),
22  rr_(conf.take({"Spatial_Averaging_Radius"}, 1.86)),
23  rp_(conf.take({"Momentum_Averaging_Radius"}, 0.08)),
24  ntest_(param.testparticles),
25  n_ensembles_(param.n_ensembles) {
26  if (ntest_ * n_ensembles_ < 20) {
27  logg[LPauliBlocking].warn(
28  "Phase-space density calculation in Pauli blocking will not work "
29  "reasonably.\nEither use testparticles or ensembles, or both.\n"
30  "The recommended testparticles * ensembles is at least 20.");
31  }
32 
33  if (rc_ < rr_ || rr_ < 0.0 || rp_ < 0) {
34  logg[LPauliBlocking].error(
35  "Please choose reasonable parameters for Pauli blocking:\n"
36  "All radii have to be positive and Gaussian_Cutoff should\n"
37  "be larger than Spatial_Averaging_Radius");
38  }
39 
41 }
void init_weights_analytical()
Analytical calculation of weights.
double rr_
Radius of averaging in coordinate space, fm.
Definition: pauliblocking.h:85
int n_ensembles_
Number of ensembles.
Definition: pauliblocking.h:94
double sig_
Standard deviation of the gaussian used for smearing.
Definition: pauliblocking.h:79
int ntest_
Testparticles number.
Definition: pauliblocking.h:91
double rc_
Radius, after which gaussians (used for averaging) are cut, fm.
Definition: pauliblocking.h:82
double rp_
Radius of averaging in momentum space, GeV.
Definition: pauliblocking.h:88
std::array< einhard::Logger<>, std::tuple_size< LogArea::AreaTuple >::value > logg
An array that stores all pre-configured Logger objects.
Definition: logging.cc:39
static constexpr int LPauliBlocking
Definition: action.cc:27

◆ ~PauliBlocker()

smash::PauliBlocker::~PauliBlocker ( )

Destructor.

Definition at line 43 of file pauliblocking.cc.

43 {}

Member Function Documentation

◆ phasespace_dens()

double smash::PauliBlocker::phasespace_dens ( const ThreeVector r,
const ThreeVector p,
const std::vector< Particles > &  ensembles,
const PdgCode  pdg,
const ParticleList &  disregard 
) const

Calculate phase-space density of a particle species at the point (r,p).

Parameters
[in]rPosition vector of the particle.
[in]pMomentum vector of the particle.
[in]ensemblesCurrent list of particles in all ensembles.
[in]pdgPDG number of species for which density to be calculated.
[in]disregardDo not count particles that should be disregarded. This is intended to avoid counting incoming particles when the phase-space density for outgoing ones is estimated.
Returns
Phase-space density

Definition at line 45 of file pauliblocking.cc.

48  {
49  double f = 0.0;
50 
51  /* TODO(oliiny): looping over all particles is inefficient,
52  * I need only particles within rp_ radius in momentum and
53  * within rr_+rc_ in coordinate space. Some search algorithm might help. */
54  for (const Particles &particles : ensembles) {
55  for (const ParticleData &part : particles) {
56  // Only consider identical particles
57  if (part.pdgcode() != pdg) {
58  continue;
59  }
60  // Only consider momenta in sphere of radius rp_ with center at p
61  const double pdist_sqr = (part.momentum().threevec() - p).sqr();
62  if (pdist_sqr > rp_ * rp_) {
63  continue;
64  }
65  const double rdist_sqr = (part.position().threevec() - r).sqr();
66  // Only consider coordinates in sphere of radius rr_+rc_ with center at r
67  if (rdist_sqr >= (rr_ + rc_) * (rr_ + rc_)) {
68  continue;
69  }
70  // Do not count particles that should be disregarded.
71  bool to_disregard = false;
72  for (const auto &disregard_part : disregard) {
73  if (part.id() == disregard_part.id()) {
74  to_disregard = true;
75  }
76  }
77  if (to_disregard) {
78  continue;
79  }
80  // 1st order interpolation using tabulated values
81  const double i_real =
82  std::sqrt(rdist_sqr) / (rr_ + rc_) * weights_.size();
83  const size_t i = std::floor(i_real);
84  const double rest = i_real - i;
85  if (likely(i + 1 < weights_.size())) {
86  f += weights_[i] * rest + weights_[i + 1] * (1. - rest);
87  }
88  } // loop over particles in one ensemble
89  } // loop over ensembles
90  return f / ntest_ / n_ensembles_;
91 }
std::array< double, 30 > weights_
Weights: tabulated results of numerical integration.
Definition: pauliblocking.h:97
#define likely(x)
Tell the branch predictor that this expression is likely true.
Definition: macros.h:14
constexpr int p
Proton.

◆ init_weights()

void smash::PauliBlocker::init_weights ( )
private

Tabulate integrals for weights.

◆ init_weights_analytical()

void smash::PauliBlocker::init_weights_analytical ( )
private

Analytical calculation of weights.

Definition at line 93 of file pauliblocking.cc.

93  {
94  const double pi = M_PI;
95  const double sqrt2 = std::sqrt(2.);
96  const double sqrt_2pi = std::sqrt(2. * pi);
97  // Volume of the phase-space area; Factor 2 stands for spin.
98  const double phase_volume =
99  2 * (4. / 3. * pi * rr_ * rr_ * rr_) * (4. / 3. * pi * rp_ * rp_ * rp_) /
100  ((2 * pi * hbarc) * (2 * pi * hbarc) * (2 * pi * hbarc));
101  // Analytical expression for integral in denominator
102  const double norm =
103  std::erf(rc_ / sqrt2 / sig_) -
104  rc_ * 2 / sqrt_2pi / sig_ * std::exp(-0.5 * rc_ * rc_ / sig_ / sig_);
105 
106  double integral;
107  // Step of the table for tabulated integral
108  const double d_pos = (rr_ + rc_) / static_cast<double>(weights_.size());
109 
110  for (size_t k = 0; k < weights_.size(); k++) {
111  // rdist = 0 ... rc_ (gauss cut) + rr_ (position cut)
112  const double rj = d_pos * k;
113  if (rj < really_small) {
114  // Assuming rc_ > rr_
115  const double A = rr_ / sqrt2 / sig_;
116  integral = sqrt_2pi * sig_ * std::erf(A) - 2 * rr_ * std::exp(-A * A);
117  integral *= sig_ * sig_;
118  } else if (rc_ > rj + rr_) {
119  const double A = (rj + rr_) / sqrt2 / sig_;
120  const double B = (rj - rr_) / sqrt2 / sig_;
121  integral = sig_ / rj * (std::exp(-A * A) - std::exp(-B * B)) +
122  0.5 * sqrt_2pi * (std::erf(A) - std::erf(B));
123  integral *= sig_ * sig_ * sig_;
124  } else {
125  const double A = rc_ / sqrt2 / sig_;
126  const double B = (rj - rr_) / sqrt2 / sig_;
127  const double C = (rc_ - rj) * (rc_ - rj) - rr_ * rr_ + 2 * sig_ * sig_;
128  integral =
129  (0.5 * std::exp(-A * A) * C - sig_ * sig_ * std::exp(-B * B)) / rj +
130  0.5 * sqrt_2pi * sig_ * (std::erf(A) - std::erf(B));
131  integral *= sig_ * sig_;
132  }
133  integral *= 2 * pi / std::pow(2 * pi * sig_ * sig_, 1.5);
134  weights_[k] = integral / norm / phase_volume;
135  logg[LPauliBlocking].debug("Analytical weights[", k, "] = ", weights_[k]);
136  }
137 }
constexpr double hbarc
GeV <-> fm conversion factor.
Definition: constants.h:25
constexpr double really_small
Numerical error tolerance.
Definition: constants.h:37

Member Data Documentation

◆ sig_

double smash::PauliBlocker::sig_
private

Standard deviation of the gaussian used for smearing.

Definition at line 79 of file pauliblocking.h.

◆ rc_

double smash::PauliBlocker::rc_
private

Radius, after which gaussians (used for averaging) are cut, fm.

Definition at line 82 of file pauliblocking.h.

◆ rr_

double smash::PauliBlocker::rr_
private

Radius of averaging in coordinate space, fm.

Definition at line 85 of file pauliblocking.h.

◆ rp_

double smash::PauliBlocker::rp_
private

Radius of averaging in momentum space, GeV.

Definition at line 88 of file pauliblocking.h.

◆ ntest_

int smash::PauliBlocker::ntest_
private

Testparticles number.

Definition at line 91 of file pauliblocking.h.

◆ n_ensembles_

int smash::PauliBlocker::n_ensembles_
private

Number of ensembles.

Definition at line 94 of file pauliblocking.h.

◆ weights_

std::array<double, 30> smash::PauliBlocker::weights_
private

Weights: tabulated results of numerical integration.

Definition at line 97 of file pauliblocking.h.


The documentation for this class was generated from the following files: