Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
trento::Nucleus Class Referenceabstract

#include <JETSCAPE/blob/main/external_packages/trento/src/nucleus.h>

+ Inheritance diagram for trento::Nucleus:
+ Collaboration diagram for trento::Nucleus:

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< Nucleonnucleons_
 Internal storage of Nucleon objects.
 
double offset_
 

Detailed Description

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

Member Typedef Documentation

Definition at line 77 of file nucleus.h.

View newest version in sPHENIX GitHub at line 77 of file nucleus.h

Definition at line 76 of file nucleus.h.

View newest version in sPHENIX GitHub at line 76 of file nucleus.h

Definition at line 75 of file nucleus.h.

View newest version in sPHENIX GitHub at line 75 of file nucleus.h

Constructor & Destructor Documentation

virtual trento::Nucleus::~Nucleus ( )
virtualdefault

Default virtual destructor for abstract base class.

trento::Nucleus::Nucleus ( std::size_t  A)
explicitprotected

Constructor only accessible by derived classes.

Parameters
Anumber of nucleons

Definition at line 90 of file nucleus.cxx.

View newest version in sPHENIX GitHub at line 90 of file nucleus.cxx

Member Function Documentation

iterator trento::Nucleus::begin ( void  )
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().

+ Here is the caller graph for this function:

const_iterator trento::Nucleus::begin ( void  ) const
inlinenoexcept

Definition at line 90 of file nucleus.h.

View newest version in sPHENIX GitHub at line 90 of file nucleus.h

References nucleons_.

const_iterator trento::Nucleus::cbegin ( ) const
inlinenoexcept

Definition at line 96 of file nucleus.h.

View newest version in sPHENIX GitHub at line 96 of file nucleus.h

References nucleons_.

const_iterator trento::Nucleus::cend ( ) const
inlinenoexcept

Definition at line 98 of file nucleus.h.

View newest version in sPHENIX GitHub at line 98 of file nucleus.h

References nucleons_.

NucleusPtr trento::Nucleus::create ( const std::string &  species,
double  nucleon_width,
double  nucleon_dmin = 0 
)
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)

Parameters
speciesstandard symbol, e.g. "p" for proton or "Pb" for lead-208
nucleon_dminminimum nucleon-nucleon distance for Woods-Saxon nuclei (optional, default zero)
Returns
a smart pointer std::unique_ptr<Nucleus>
Exceptions
std::invalid_argumentfor 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().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

iterator trento::Nucleus::end ( void  )
inlinenoexcept

Definition at line 86 of file nucleus.h.

View newest version in sPHENIX GitHub at line 86 of file nucleus.h

References nucleons_.

Referenced by trento::DeformedWoodsSaxonNucleus::sample_nucleons_impl().

+ Here is the caller graph for this function:

const_iterator trento::Nucleus::end ( void  ) const
inlinenoexcept

Definition at line 92 of file nucleus.h.

View newest version in sPHENIX GitHub at line 92 of file nucleus.h

References nucleons_.

virtual double trento::Nucleus::radius ( ) const
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().

+ Here is the call graph for this function:

virtual void trento::Nucleus::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().

+ Here is the caller graph for this function:

void trento::Nucleus::set_nucleon_position ( iterator  nucleon,
double  x,
double  y,
double  z 
)
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().

+ Here is the caller graph for this function:

size_type trento::Nucleus::size ( void  ) const
inlinenoexcept

Definition at line 80 of file nucleus.h.

View newest version in sPHENIX GitHub at line 80 of file nucleus.h

References nucleons_.

Referenced by trento::DeformedWoodsSaxonNucleus::sample_nucleons_impl().

+ Here is the caller graph for this function:

Member Data Documentation

std::vector<Nucleon> trento::Nucleus::nucleons_
private

Internal storage of Nucleon objects.

Definition at line 122 of file nucleus.h.

View newest version in sPHENIX GitHub at line 122 of file nucleus.h

Referenced by begin(), cbegin(), cend(), end(), and size().

double trento::Nucleus::offset_
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().


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