Tests rely on the Catch C++ test framework, which CMake downloads automatically during the build process.
If for some reason this fails, manually download the header catch.hpp and place it in the test directory.

where \(\text{Ei}\) is the exponential integral.
This is still a transcendental equation but it can be quickly solved numerically for a given cross section and nucleon width.

The code determines \(\sigma_{gg}\) at runtime by solving this equation using a standard root finding algorithm.
The relevant function is compute_cross_sec_param in nucleon.cxx.
Note that it actually optimizes over the dimensionless variable \(\log({\sigma_{gg}/4\pi w^2})\).

The nucleon unit test verifies that the cross section is accurately reproduced.

This section is automatically generated from the source code by Doxygen and converted into Sphinx format by Breathe.
In order to emphasize functionality—rather than implementation details—private class methods are not shown.

Orchestrates event generation and output. Owns instances of several other
TRENTO classes and knows how they work together. Responsible for sampling
impact parameters. After instantiation, call run_events() to do
everything.

The primary computation class, responsible for constructing nuclear
thickness functions and calculating event observables. Designed to be
created once and used many times by repeatedly calling compute().
Stores its observables internally and provides inspector methods.

Compute thickness functions and event observables for a pair of
Nucleus objects and a NucleonProfile. The nuclei must have
already sampled nucleon positions and participants before passing to this
function.

Interface class to all nucleus types. Stores an ensemble of nucleons and
randomly samples their positions. Implements a standard iterator interface
through begin() and end() functions. Iterating over a Nucleus
means iterating over its Nucleon members.

Set a Nucleon position. This function provides a consistent interface
to derived classes and ensures the position is correctly offset.
Nucleus is a friend of Nucleon and therefore able to set nucleon
positions; the derived classes must use this function to set positions.

Fast exponential approximation, to be used as a drop-in replacement for
std::exp when it will be evaluated many times within a fixed range.
Works by pre-tabulating exp() values and exploiting the leading-order Taylor
expansion; for step size \(dx\) the error is \(\mathcal O(dx^2)\).