MARLEY (Model of Argon Reaction Low Energy Yields)
v1.2.0
A Monte Carlo event generator for tens-of-MeV neutrino interactions
|
Description of a macroscopic target for scattering reactions. More...
#include <Target.hh>
Public Member Functions | |
Target (const std::vector< TargetAtom > &nuclides, const std::vector< double > &atom_fracs) | |
Create a composite Target. More... | |
Target (int pdg) | |
Create a Target composed of a single nuclide. More... | |
Target (int Z, int A) | |
Create a Target composed of a single nuclide. More... | |
double | atom_fraction (const marley::TargetAtom &atom) const |
Returns the atom fraction for the requested nuclide. | |
const std::map< marley::TargetAtom, double > & | atom_fraction_map () const |
Get read-only access to the map of atom fractions. | |
bool | contains (const marley::TargetAtom &atom) const |
Return true if the target contains the requested atom, or false otherwise. More... | |
bool | has_single_nuclide () const |
Returns true if the target consists of a single kind of target atom, or false otherwise. | |
void | print (std::ostream &out) const |
Print a textual representation of the Target to a std::ostream. | |
Protected Member Functions | |
void | initialize (const std::vector< TargetAtom > &nuclides, const std::vector< double > &atom_fracs) |
General helper function for the constructors. | |
void | initialize_single_nuclide (int pdg) |
Helper function for the constructors that use a single nuclide. | |
Protected Attributes | |
std::map< marley::TargetAtom, double > | atom_fractions_ |
Map storing the atom fraction for each nuclide in the target material. More... | |
Description of a macroscopic target for scattering reactions.
The target is composed of one or more nuclides and stores their relative abundances as atom fractions
|
explicit |
|
explicit |
Create a Target composed of a single nuclide.
Z | The proton number of the target atom |
A | The mass number of the target atom |
marley::Target::Target | ( | const std::vector< TargetAtom > & | nuclides, |
const std::vector< double > & | atom_fracs | ||
) |
Create a composite Target.
Atom fractions that do not sum to unity will automatically be renormalized to do so
nuclides | TargetAtom objects specifying each atomic species |
atom_fracs | Atom fraction for each TargetAtom |
bool marley::Target::contains | ( | const marley::TargetAtom & | atom | ) | const |
Return true if the target contains the requested atom, or false otherwise.
Even if the target atom appears in the map, this function will return false if its atom fraction is exactly zero
|
protected |
Map storing the atom fraction for each nuclide in the target material.
Keys are TargetAtom objects representing each nuclide, values are atom fractions. The Target class ensures that the atom fractions always sum to unity.