GRSISort "v4.0.0.5"
An extension of the ROOT analysis Framework
Loading...
Searching...
No Matches
TNucleus Class Reference

Detailed Description

This class builds a nucleus and sets all the basic information (mass, Z, symbol, radius, etc.)

Definition at line 23 of file TNucleus.h.

Public Member Functions

 TNucleus ()=default
 
 TNucleus (const char *name)
 
 TNucleus (const TNucleus &)=delete
 
 TNucleus (int charge, int neutrons, const char *MassFile=nullptr)
 
 TNucleus (int charge, int neutrons, double mass, const char *symbol)
 
 TNucleus (TNucleus &&) noexcept=delete
 
 ~TNucleus ()
 
void AddTransition (Double_t energy, Double_t intensity, Double_t energy_uncertainty=0.0, Double_t intensity_uncertainty=0.0)
 
void AddTransition (TTransition *tran)
 
int GetA () const
 
double GetBetaFromEnergy (double energy_MeV) const
 
double GetEnergyFromBeta (double beta) const
 
double GetMass () const
 
double GetMassExcess () const
 
int GetN () const
 
Int_t GetNTransitions () const
 
double GetRadius () const
 
const char * GetSymbol () const
 
TTransitionGetTransition (Int_t idx)
 
TTransitionGetTransitionByEnergy (Int_t idx)
 
TTransitionGetTransitionByIntensity (Int_t idx)
 
const TSortedList * GetTransitionList () const
 
const TSortedList * GetTransitionListByEnergy () const
 
const TSortedList * GetTransitionListByIntensity () const
 
int GetZ () const
 
int GetZfromSymbol (char *)
 
Int_t NTransitions () const
 
bool operator!= (const TNucleus &rhs) const
 
TNucleusoperator= (const TNucleus &)=delete
 
TNucleusoperator= (TNucleus &&) noexcept=delete
 
bool operator== (const TNucleus &rhs) const
 
void Print (Option_t *opt="") const override
 
void SetMass ()
 
void SetMass (double)
 
void SetMassExcess (double)
 
void SetN (int)
 
void SetSymbol (const char *)
 
void SetZ (int)
 
void WriteSourceFile (const std::string &outfilename="")
 

Static Public Member Functions

static void ParseName (const char *name, std::string &symbol, int &number, std::string &element)
 
static void ParseName (std::string name, std::string &symbol, int &number, std::string &element)
 
static std::string SortName (const char *input)
 
static std::string SortName (std::string input)
 
static std::string & SourceDirectory ()
 

Private Member Functions

bool LoadTransitionFile ()
 
void SetName (const char *name="") override
 

Static Private Member Functions

static std::string & Massfile ()
 

Private Attributes

int fA {0}
 
double fMass {0.}
 
double fMassExcess {0.}
 
int fN {0}
 
std::string fSymbol
 
TSortedList fTransitionListByEnergy
 
TSortedList fTransitionListByIntensity
 
int fZ {0}
 

Static Private Attributes

static std::string fSourceDirectory
 
static bool fSourceDirectoryChecked = false
 
+ Inheritance diagram for TNucleus:
+ Collaboration diagram for TNucleus:

Constructor & Destructor Documentation

◆ TNucleus() [1/6]

TNucleus::TNucleus ( )
default

Should not be used, here so we can write things to a root file.

◆ TNucleus() [2/6]

TNucleus::TNucleus ( const char * name)
explicit

Creates a nucleus based on symbol and sets all parameters from mass.dat.

Definition at line 41 of file TNucleus.cxx.

References LoadTransitionFile(), Massfile(), ParseName(), SetMass(), SetMassExcess(), SetN(), SetName(), SetSymbol(), and SetZ().

◆ TNucleus() [3/6]

TNucleus::TNucleus ( int charge,
int neutrons,
double mass,
const char * symbol )

Creates a nucleus with Z, N, mass, and symbol.

Creates a nucleus with Z, N, mass, and symbol

Definition at line 92 of file TNucleus.cxx.

References LoadTransitionFile(), and SetName().

◆ TNucleus() [4/6]

TNucleus::TNucleus ( int charge,
int neutrons,
const char * MassFile = nullptr )

Creates a nucleus with Z, N using mass table (default MassFile = "mass.dat")

Creates a nucleus with Z, N using mass table (default MassFile = "mass.dat")

Definition at line 100 of file TNucleus.cxx.

References Massfile().

◆ TNucleus() [5/6]

TNucleus::TNucleus ( const TNucleus & )
delete

◆ TNucleus() [6/6]

TNucleus::TNucleus ( TNucleus && )
deletenoexcept

◆ ~TNucleus()

TNucleus::~TNucleus ( )

Definition at line 151 of file TNucleus.cxx.

References fTransitionListByEnergy, and fTransitionListByIntensity.

Member Function Documentation

◆ AddTransition() [1/2]

void TNucleus::AddTransition ( Double_t energy,
Double_t intensity,
Double_t energy_uncertainty = 0.0,
Double_t intensity_uncertainty = 0.0 )

Definition at line 283 of file TNucleus.cxx.

References AddTransition().

Referenced by AddTransition(), and LoadTransitionFile().

◆ AddTransition() [2/2]

void TNucleus::AddTransition ( TTransition * tran)

Definition at line 295 of file TNucleus.cxx.

References fTransitionListByEnergy, and fTransitionListByIntensity.

◆ GetA()

int TNucleus::GetA ( ) const
inline

Gets the A (Z + N) of the nucleus.

Definition at line 59 of file TNucleus.h.

References fN, and fZ.

Referenced by GetRadius(), LoadTransitionFile(), TReaction::Print(), SetMass(), and SetName().

◆ GetBetaFromEnergy()

double TNucleus::GetBetaFromEnergy ( double energy_MeV) const

Definition at line 409 of file TNucleus.cxx.

References fMass.

◆ GetEnergyFromBeta()

double TNucleus::GetEnergyFromBeta ( double beta) const

Definition at line 403 of file TNucleus.cxx.

References fMass.

◆ GetMass()

double TNucleus::GetMass ( ) const
inline

◆ GetMassExcess()

double TNucleus::GetMassExcess ( ) const
inline

Gets the mass excess of the nucleus (in MeV)

Definition at line 60 of file TNucleus.h.

References fMassExcess.

Referenced by SetMass().

◆ GetN()

int TNucleus::GetN ( ) const
inline

Gets the N (# of neutrons) of the nucleus.

Definition at line 58 of file TNucleus.h.

References fN.

◆ GetNTransitions()

Int_t TNucleus::GetNTransitions ( ) const
inline

Definition at line 73 of file TNucleus.h.

References fTransitionListByIntensity.

◆ GetRadius()

double TNucleus::GetRadius ( ) const

Definition at line 276 of file TNucleus.cxx.

References GetA().

◆ GetSymbol()

const char * TNucleus::GetSymbol ( ) const
inline

Gets the atomic symbol of the nucleus.

Definition at line 62 of file TNucleus.h.

References fSymbol.

Referenced by LoadTransitionFile(), and SetName().

◆ GetTransition()

TTransition * TNucleus::GetTransition ( Int_t idx)
inline

Definition at line 68 of file TNucleus.h.

References GetTransitionByIntensity().

◆ GetTransitionByEnergy()

TTransition * TNucleus::GetTransitionByEnergy ( Int_t idx)

Definition at line 313 of file TNucleus.cxx.

References fTransitionListByEnergy.

◆ GetTransitionByIntensity()

TTransition * TNucleus::GetTransitionByIntensity ( Int_t idx)

Definition at line 303 of file TNucleus.cxx.

References fTransitionListByIntensity.

Referenced by GetTransition().

◆ GetTransitionList()

const TSortedList * TNucleus::GetTransitionList ( ) const
inline

Definition at line 80 of file TNucleus.h.

References GetTransitionListByIntensity().

Referenced by TCalibrator::AddData(), and TSourceList::SetNucleus().

◆ GetTransitionListByEnergy()

const TSortedList * TNucleus::GetTransitionListByEnergy ( ) const
inline

Definition at line 82 of file TNucleus.h.

References fTransitionListByEnergy.

◆ GetTransitionListByIntensity()

const TSortedList * TNucleus::GetTransitionListByIntensity ( ) const
inline

Definition at line 81 of file TNucleus.h.

References fTransitionListByIntensity.

Referenced by GetTransitionList().

◆ GetZ()

int TNucleus::GetZ ( ) const
inline

Gets the Z (# of protons) of the nucleus.

Definition at line 57 of file TNucleus.h.

References fZ.

Referenced by TReaction::Print(), and TKinematics::Rutherford().

◆ GetZfromSymbol()

int TNucleus::GetZfromSymbol ( char * symbol)

Definition at line 253 of file TNucleus.cxx.

References SetZ().

◆ LoadTransitionFile()

bool TNucleus::LoadTransitionFile ( )
private

Definition at line 350 of file TNucleus.cxx.

References AddTransition(), fTransitionListByIntensity, GetA(), GetSymbol(), and SourceDirectory().

Referenced by TNucleus(), and TNucleus().

◆ Massfile()

std::string & TNucleus::Massfile ( )
staticprivate

< Returns the directory with the .sou files and the mass file

Returns the massfile to be used, which includes Z, N, atomic symbol, and mass excess

Definition at line 35 of file TNucleus.cxx.

References SourceDirectory().

Referenced by TNucleus(), and TNucleus().

◆ NTransitions()

Int_t TNucleus::NTransitions ( ) const
inline

Definition at line 72 of file TNucleus.h.

References fTransitionListByIntensity.

Referenced by TEnergyCal::SetNucleus().

◆ operator!=()

bool TNucleus::operator!= ( const TNucleus & rhs) const
inline

Definition at line 85 of file TNucleus.h.

◆ operator=() [1/2]

TNucleus & TNucleus::operator= ( const TNucleus & )
delete

◆ operator=() [2/2]

TNucleus & TNucleus::operator= ( TNucleus && )
deletenoexcept

◆ operator==()

bool TNucleus::operator== ( const TNucleus & rhs) const
inline

Definition at line 84 of file TNucleus.h.

References fA, fN, and fZ.

◆ ParseName() [1/2]

static void TNucleus::ParseName ( const char * name,
std::string & symbol,
int & number,
std::string & element )
inlinestatic

Definition at line 36 of file TNucleus.h.

References ParseName().

Referenced by TNucleus(), ParseName(), and SortName().

◆ ParseName() [2/2]

void TNucleus::ParseName ( std::string name,
std::string & symbol,
int & number,
std::string & element )
static

Strips any non-alphanumeric character from input, parses rest as number and symbol. E.g. turns "na26" into "Na" and 26 or " 152 EU... " into "Eu" and 152. Only uses the first number and first letter, so "na26 eu152" would be turned into "Na" and 26, but "na26 152eu" would be turned into "Na" and 26152, and "26na 152eu" would be turned into "Na152eu" and 26. Special inputs are "p" for "H" and 1, "d" for "H" and 2, "t" for "H" and 3, and "a" for "He" and 4. element simply is the combined string of number and element.

Definition at line 157 of file TNucleus.cxx.

◆ Print()

void TNucleus::Print ( Option_t * opt = "") const
override

Definition at line 323 of file TNucleus.cxx.

References fTransitionListByIntensity.

◆ SetMass() [1/2]

void TNucleus::SetMass ( )

Sets the mass based on the A and mass excess of nucleus (in MeV)

Definition at line 241 of file TNucleus.cxx.

References amu, fMass, GetA(), and GetMassExcess().

Referenced by TNucleus().

◆ SetMass() [2/2]

void TNucleus::SetMass ( double mass)

Sets the mass manually (in MeV)

Definition at line 235 of file TNucleus.cxx.

References fMass.

◆ SetMassExcess()

void TNucleus::SetMassExcess ( double mass_ex)

Sets the mass excess of the nucleus (in MeV)

Definition at line 229 of file TNucleus.cxx.

References fMassExcess.

Referenced by TNucleus().

◆ SetN()

void TNucleus::SetN ( int neutrons)

Sets the N (# of neutrons) of the nucleus.

Definition at line 224 of file TNucleus.cxx.

References fN.

Referenced by TNucleus().

◆ SetName()

void TNucleus::SetName ( const char * name = "")
overrideprivate

Definition at line 144 of file TNucleus.cxx.

References GetA(), and GetSymbol().

Referenced by TNucleus(), and TNucleus().

◆ SetSymbol()

void TNucleus::SetSymbol ( const char * symbol)

Sets the atomic symbol for the nucleus.

Definition at line 247 of file TNucleus.cxx.

References fSymbol.

Referenced by TNucleus().

◆ SetZ()

void TNucleus::SetZ ( int charge)

Sets the Z (# of protons) of the nucleus.

Definition at line 219 of file TNucleus.cxx.

References fZ.

Referenced by TNucleus(), and GetZfromSymbol().

◆ SortName() [1/2]

static std::string TNucleus::SortName ( const char * input)
inlinestatic

Definition at line 41 of file TNucleus.h.

References SortName().

Referenced by SortName().

◆ SortName() [2/2]

std::string TNucleus::SortName ( std::string input)
static

Strips any non-alphanumeric character from input, parses rest as number and symbol. E.g. turns "na26" into "26Na" or " 152 EU... " into "152Eu". Special inputs are "p" for "1H", "d" for "2H", "t" for "2H", and "a" for "4He".

Definition at line 206 of file TNucleus.cxx.

References ParseName().

◆ SourceDirectory()

std::string & TNucleus::SourceDirectory ( )
static

◆ WriteSourceFile()

void TNucleus::WriteSourceFile ( const std::string & outfilename = "")

Definition at line 335 of file TNucleus.cxx.

References fTransitionListByIntensity.

Member Data Documentation

◆ fA

int TNucleus::fA {0}
private

Number of nucleons (Z + N)

Definition at line 96 of file TNucleus.h.

Referenced by operator==().

◆ fMass

double TNucleus::fMass {0.}
private

Mass (in MeV)

Definition at line 99 of file TNucleus.h.

Referenced by GetBetaFromEnergy(), GetEnergyFromBeta(), GetMass(), SetMass(), and SetMass().

◆ fMassExcess

double TNucleus::fMassExcess {0.}
private

Mass excess (in MeV)

Definition at line 100 of file TNucleus.h.

Referenced by GetMassExcess(), and SetMassExcess().

◆ fN

int TNucleus::fN {0}
private

Number of neutrons (N)

Definition at line 97 of file TNucleus.h.

Referenced by GetA(), GetN(), operator==(), and SetN().

◆ fSourceDirectory

std::string TNucleus::fSourceDirectory
staticprivate

! path of directory with .sou files

Definition at line 93 of file TNucleus.h.

Referenced by SourceDirectory().

◆ fSourceDirectoryChecked

bool TNucleus::fSourceDirectoryChecked = false
staticprivate

! flag to indicate whetehr the source directory path has been checked

Definition at line 94 of file TNucleus.h.

Referenced by SourceDirectory().

◆ fSymbol

std::string TNucleus::fSymbol
private

Atomic symbol (ex. Ba, C, O, N)

Definition at line 101 of file TNucleus.h.

Referenced by GetSymbol(), and SetSymbol().

◆ fTransitionListByEnergy

TSortedList TNucleus::fTransitionListByEnergy
private

◆ fTransitionListByIntensity

TSortedList TNucleus::fTransitionListByIntensity
private

◆ fZ

int TNucleus::fZ {0}
private

Number of protons (Z)

Definition at line 98 of file TNucleus.h.

Referenced by GetA(), GetZ(), operator==(), and SetZ().