Version: SMASH-1.5
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, section III B. Our implementation mainly follows this article (and therefore GiBUU, see http://gibuu.hepforge.org).

Definition at line 36 of file pauliblocking.h.

Collaboration diagram for smash::PauliBlocker:
[legend]

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 Particles &particles, 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/c. More...
 
int ntest_
 Testparticles number. 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.

◆ ~PauliBlocker()

smash::PauliBlocker::~PauliBlocker ( )

Destructor.

Definition at line 55 of file pauliblocking.cc.

55 {}

Member Function Documentation

◆ phasespace_dens()

double smash::PauliBlocker::phasespace_dens ( const ThreeVector r,
const ThreeVector p,
const Particles particles,
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]particlesList of all current particles.
[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 57 of file pauliblocking.cc.

60  {
61  double f = 0.0;
62 
63  /* TODO(oliiny): looping over all particles is inefficient,
64  * I need only particles within rp_ radius in momentum and
65  * within rr_+rc_ in coordinate space. Some search algorithm might help. */
66  for (const auto &part : particles) {
67  // Only consider identical particles
68  if (part.pdgcode() != pdg) {
69  continue;
70  }
71  // Only consider momenta in sphere of radius rp_ with center at p
72  const double pdist_sqr = (part.momentum().threevec() - p).sqr();
73  if (pdist_sqr > rp_ * rp_) {
74  continue;
75  }
76  const double rdist_sqr = (part.position().threevec() - r).sqr();
77  // Only consider coordinates in sphere of radius rr_+rc_ with center at r
78  if (rdist_sqr >= (rr_ + rc_) * (rr_ + rc_)) {
79  continue;
80  }
81  // Do not count particles that should be disregarded.
82  bool to_disregard = false;
83  for (const auto &disregard_part : disregard) {
84  if (part.id() == disregard_part.id()) {
85  to_disregard = true;
86  }
87  }
88  if (to_disregard) {
89  continue;
90  }
91  // 1st order interpolation using tabulated values
92  const double i_real = std::sqrt(rdist_sqr) / (rr_ + rc_) * weights_.size();
93  const size_t i = std::floor(i_real);
94  const double rest = i_real - i;
95  if (likely(i + 1 < weights_.size())) {
96  f += weights_[i] * rest + weights_[i + 1] * (1. - rest);
97  }
98  }
99  return f / ntest_;
100 }
#define likely(x)
Tell the branch predictor that this expression is likely true.
Definition: macros.h:14
double rp_
Radius of averaging in momentum space, GeV/c.
Definition: pauliblocking.h:85
int ntest_
Testparticles number.
Definition: pauliblocking.h:88
constexpr int p
Proton.
double rc_
Radius, after which gaussians (used for averaging) are cut, fm.
Definition: pauliblocking.h:79
std::array< double, 30 > weights_
Weights: tabulated results of numerical integration.
Definition: pauliblocking.h:91
double rr_
Radius of averaging in coordinate space, fm.
Definition: pauliblocking.h:82
Here is the caller graph for this function:

◆ 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 102 of file pauliblocking.cc.

102  {
103  const auto &log = logger<LogArea::PauliBlocking>();
104 
105  const double pi = M_PI;
106  const double sqrt2 = std::sqrt(2.);
107  const double sqrt_2pi = std::sqrt(2. * pi);
108  // Volume of the phase-space area; Factor 2 stands for spin.
109  const double phase_volume =
110  2 * (4. / 3. * pi * rr_ * rr_ * rr_) * (4. / 3. * pi * rp_ * rp_ * rp_) /
111  ((2 * pi * hbarc) * (2 * pi * hbarc) * (2 * pi * hbarc));
112  // Analytical expression for integral in denominator
113  const double norm =
114  std::erf(rc_ / sqrt2 / sig_) -
115  rc_ * 2 / sqrt_2pi / sig_ * std::exp(-0.5 * rc_ * rc_ / sig_ / sig_);
116 
117  double integral;
118  // Step of the table for tabulated integral
119  const double d_pos = (rr_ + rc_) / static_cast<double>(weights_.size());
120 
121  for (size_t k = 0; k < weights_.size(); k++) {
122  // rdist = 0 ... rc_ (gauss cut) + rr_ (position cut)
123  const double rj = d_pos * k;
124  if (rj < really_small) {
125  // Assuming rc_ > rr_
126  const double A = rr_ / sqrt2 / sig_;
127  integral = sqrt_2pi * sig_ * std::erf(A) - 2 * rr_ * std::exp(-A * A);
128  integral *= sig_ * sig_;
129  } else if (rc_ > rj + rr_) {
130  const double A = (rj + rr_) / sqrt2 / sig_;
131  const double B = (rj - rr_) / sqrt2 / sig_;
132  integral = sig_ / rj * (std::exp(-A * A) - std::exp(-B * B)) +
133  0.5 * sqrt_2pi * (std::erf(A) - std::erf(B));
134  integral *= sig_ * sig_ * sig_;
135  } else {
136  const double A = rc_ / sqrt2 / sig_;
137  const double B = (rj - rr_) / sqrt2 / sig_;
138  const double C = (rc_ - rj) * (rc_ - rj) - rr_ * rr_ + 2 * sig_ * sig_;
139  integral =
140  (0.5 * std::exp(-A * A) * C - sig_ * sig_ * std::exp(-B * B)) / rj +
141  0.5 * sqrt_2pi * sig_ * (std::erf(A) - std::erf(B));
142  integral *= sig_ * sig_;
143  }
144  integral *= 2 * pi / std::pow(2 * pi * sig_ * sig_, 1.5);
145  weights_[k] = integral / norm / phase_volume;
146  log.debug("Analytical weights[", k, "] = ", weights_[k]);
147  }
148 }
constexpr double really_small
Numerical error tolerance.
Definition: constants.h:34
constexpr double hbarc
GeV <-> fm conversion factor.
Definition: constants.h:25
double rp_
Radius of averaging in momentum space, GeV/c.
Definition: pauliblocking.h:85
double sig_
Standard deviation of the gaussian used for smearing.
Definition: pauliblocking.h:76
double rc_
Radius, after which gaussians (used for averaging) are cut, fm.
Definition: pauliblocking.h:79
std::array< double, 30 > weights_
Weights: tabulated results of numerical integration.
Definition: pauliblocking.h:91
double rr_
Radius of averaging in coordinate space, fm.
Definition: pauliblocking.h:82

Member Data Documentation

◆ sig_

double smash::PauliBlocker::sig_
private

Standard deviation of the gaussian used for smearing.

Definition at line 76 of file pauliblocking.h.

◆ rc_

double smash::PauliBlocker::rc_
private

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

Definition at line 79 of file pauliblocking.h.

◆ rr_

double smash::PauliBlocker::rr_
private

Radius of averaging in coordinate space, fm.

Definition at line 82 of file pauliblocking.h.

◆ rp_

double smash::PauliBlocker::rp_
private

Radius of averaging in momentum space, GeV/c.

Definition at line 85 of file pauliblocking.h.

◆ ntest_

int smash::PauliBlocker::ntest_
private

Testparticles number.

Definition at line 88 of file pauliblocking.h.

◆ weights_

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

Weights: tabulated results of numerical integration.

Definition at line 91 of file pauliblocking.h.


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