MARLEY (Model of Argon Reaction Low Energy Yields)  v1.2.0
A Monte Carlo event generator for tens-of-MeV neutrino interactions
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
marley::Target Class Reference

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...
 

Detailed Description

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

Constructor & Destructor Documentation

◆ Target() [1/3]

marley::Target::Target ( int  pdg)
explicit

Create a Target composed of a single nuclide.

Parameters
pdgParticle Data Group code for the atomic species

◆ Target() [2/3]

marley::Target::Target ( int  Z,
int  A 
)
explicit

Create a Target composed of a single nuclide.

Parameters
ZThe proton number of the target atom
AThe mass number of the target atom

◆ Target() [3/3]

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

Parameters
nuclidesTargetAtom objects specifying each atomic species
atom_fracsAtom fraction for each TargetAtom
Note
The nuclides and atom_fracs vectors must have the same length. If this is not the case, a marley::Error will be thrown

Member Function Documentation

◆ contains()

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

Member Data Documentation

◆ atom_fractions_

std::map< marley::TargetAtom, double > marley::Target::atom_fractions_
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.


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