Analysis Software
Documentation for sPHENIX simulation software
|
#include <JETSCAPE/blob/main/external_packages/trento/src/nucleus.h>
Public Types | |
using | size_type = std::vector< Nucleon >::size_type |
using | iterator = std::vector< Nucleon >::iterator |
using | const_iterator = std::vector< Nucleon >::const_iterator |
Public Member Functions | |
virtual | ~Nucleus ()=default |
Default virtual destructor for abstract base class. | |
virtual double | radius () const =0 |
void | sample_nucleons (double offset) |
size_type | size () const noexcept |
iterator | begin () noexcept |
iterator | end () noexcept |
const_iterator | begin () const noexcept |
const_iterator | end () const noexcept |
const_iterator | cbegin () const noexcept |
const_iterator | cend () const noexcept |
Static Public Member Functions | |
static NucleusPtr | create (const std::string &species, double nucleon_width, double nucleon_dmin=0) |
Protected Member Functions | |
Nucleus (std::size_t A) | |
void | set_nucleon_position (iterator nucleon, double x, double y, double z) |
Private Member Functions | |
virtual void | sample_nucleons_impl ()=0 |
Private Attributes | |
std::vector< Nucleon > | nucleons_ |
Internal storage of Nucleon objects. | |
double | offset_ |
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.
Definition at line 35 of file nucleus.h.
View newest version in sPHENIX GitHub at line 35 of file nucleus.h
using trento::Nucleus::const_iterator = std::vector<Nucleon>::const_iterator |
using trento::Nucleus::iterator = std::vector<Nucleon>::iterator |
using trento::Nucleus::size_type = std::vector<Nucleon>::size_type |
|
virtualdefault |
Default virtual destructor for abstract base class.
|
explicitprotected |
Constructor only accessible by derived classes.
A | number of nucleons |
Definition at line 90 of file nucleus.cxx.
View newest version in sPHENIX GitHub at line 90 of file nucleus.cxx
|
inlinenoexcept |
Definition at line 84 of file nucleus.h.
View newest version in sPHENIX GitHub at line 84 of file nucleus.h
References nucleons_.
Referenced by trento::MinDistNucleus::is_too_close(), trento::Proton::sample_nucleons_impl(), trento::Deuteron::sample_nucleons_impl(), and trento::DeformedWoodsSaxonNucleus::sample_nucleons_impl().
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
static |
The canonical way to create a Nucleus
. Constructs the appropriate subclass for the given species. Sets the Woods-Saxon parameters for Au, Pb, U, etc; parameters copied from the PHOBOS Glauber model:
Example::
std::unique_ptr<Nucleus> lead_nucleus = Nucleus::create("Pb"); double radius = lead_nucleus->radius(); lead_nucleus->sample_nucleons(0); for (const auto& nucleon : *lead_nucleus) do_something(nucleon)
species | standard symbol, e.g. "p" for proton or "Pb" for lead-208 |
nucleon_dmin | minimum nucleon-nucleon distance for Woods-Saxon nuclei (optional, default zero) |
std::unique_ptr<Nucleus>
std::invalid_argument | for unknown species |
Definition at line 35 of file nucleus.cxx.
View newest version in sPHENIX GitHub at line 35 of file nucleus.cxx
References utils::create, and trento::hdf5::filename_is_hdf5().
Referenced by TEST_CASE().
|
inlinenoexcept |
|
inlinenoexcept |
|
pure virtual |
The "radius", i.e. the maximum distance at which a nucleon could be placed.
Implemented in trento::DeformedWoodsSaxonNucleus, trento::WoodsSaxonNucleus, trento::Deuteron, and trento::Proton.
void trento::Nucleus::sample_nucleons | ( | double | offset | ) |
Sample a new ensemble of nucleon positions with the given offset in the x-direction.
Definition at line 92 of file nucleus.cxx.
View newest version in sPHENIX GitHub at line 92 of file nucleus.cxx
References offset, offset_, and sample_nucleons_impl().
|
privatepure virtual |
Internal interface to the actual implementation of the nucleon sampling algorithm, used in public function sample_nucleons(). This function must sample nucleon positions relative to the origin and set them using the protected function set_nucleon_position(), which enforces the offset.
Implemented in trento::DeformedWoodsSaxonNucleus, trento::WoodsSaxonNucleus, trento::Deuteron, and trento::Proton.
Referenced by sample_nucleons().
|
protected |
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.
Definition at line 97 of file nucleus.cxx.
View newest version in sPHENIX GitHub at line 97 of file nucleus.cxx
References offset_.
Referenced by trento::Proton::sample_nucleons_impl(), trento::Deuteron::sample_nucleons_impl(), and trento::DeformedWoodsSaxonNucleus::sample_nucleons_impl().
|
inlinenoexcept |
|
private |
|
private |
Offset of nucleon x-positions. This variable is reset upon each call of sample_nucleons() and is read by set_nucleon_position().
Definition at line 127 of file nucleus.h.
View newest version in sPHENIX GitHub at line 127 of file nucleus.h
Referenced by sample_nucleons(), and set_nucleon_position().