fisx
fisx::Element Class Reference

Public Member Functions

 Element ()
 
 Element (std::string name, int z)
 
void setName (const std::string &name)
 
std::string getName () const
 
void setAtomicNumber (const int &z)
 
const int & getAtomicNumber () const
 
void setAtomicMass (const double &mass)
 
const double & getAtomicMass () const
 
void setDensity (const double &)
 
double getDensity () const
 
void setLongName (const std::string &name)
 
std::string getLongName () const
 
void setColumn (const int &)
 
int getColumn () const
 
void setRow (const int &)
 
int getRow () const
 
void setBindingEnergies (std::map< std::string, double > bindingEnergies)
 
void setBindingEnergies (std::vector< std::string > labels, std::vector< double > energies)
 
const std::map< std::string, double > & getBindingEnergies () const
 
std::vector< std::string > getExcitedShells (const double &energy) const
 
void setMassAttenuationCoefficients (const std::vector< double > &energies, const std::vector< double > &photoelectric, const std::vector< double > &coherent, const std::vector< double > &incoherent, const std::vector< double > &pair)
 
void setMassAttenuationCoefficients (const std::vector< double > &energies, const std::vector< double > &photoelectric, const std::vector< double > &coherent, const std::vector< double > &incoherent)
 
void setTotalMassAttenuationCoefficient (const std::vector< double > &energies, const std::vector< double > &total)
 
const std::map< std::string, std::vector< double > > & getMassAttenuationCoefficients () const
 
std::map< std::string, std::vector< double > > getMassAttenuationCoefficients (const std::vector< double > &energy) const
 
std::map< std::string, double > getMassAttenuationCoefficients (const double &energy) const
 
std::map< std::string, std::pair< double, int > > extractEdgeEnergiesFromMassAttenuationCoefficients ()
 
std::map< std::string, std::pair< double, int > > extractEdgeEnergiesFromMassAttenuationCoefficients (const std::vector< double > &energies, const std::vector< double > &muPhotoelectric)
 
void setPartialPhotoelectricMassAttenuationCoefficients (const std::string &shell, const std::vector< double > &energy, const std::vector< double > &partialPhotoelectric)
 
std::map< std::string, double > getPartialPhotoelectricMassAttenuationCoefficients (const double &energy) const
 
void setRadiativeTransitions (std::string subshell, std::map< std::string, double > values)
 
void setRadiativeTransitions (std::string subshell, std::vector< std::string >, std::vector< double > values)
 
const std::map< std::string, double > & getRadiativeTransitions (const std::string &subshell) const
 
void setNonradiativeTransitions (std::string subshell, std::vector< std::string >, std::vector< double > values)
 
void setNonradiativeTransitions (std::string subshell, std::map< std::string, double > values)
 
const std::map< std::string, double > & getNonradiativeTransitions (const std::string &subshell) const
 
void setShellConstants (std::string subshell, std::map< std::string, double > constants)
 
std::map< std::string, double > getShellConstants (const std::string &subshell) const
 
double getTransitionEnergy (const std::string &transition) const
 
const std::map< std::string, double > & getXRayLines (const std::string &family="") const
 
std::map< std::string, double > getEmittedXRayLines (const double &energy=1000.) const
 
std::map< std::string, std::vector< double > > getInitialPhotoelectricVacancyDistribution (const std::vector< double > &energies) const
 
std::map< std::string, double > getInitialPhotoelectricVacancyDistribution (const double &energy) const
 
std::map< std::string, double > getCascadeModifiedVacancyDistribution (const std::map< std::string, double > &distribution) const
 
std::map< std::string, std::map< std::string, double > > getXRayLinesFromVacancyDistribution (const std::map< std::string, double > &distribution, const int &cascade=1, const int &useFluorescenceYield=1) const
 
std::vector< std::map< std::string, std::map< std::string, double > > > getPhotoelectricExcitationFactors (const std::vector< double > &energy, const std::vector< double > &weights=std::vector< double >()) const
 
std::map< std::string, std::map< std::string, double > > getPhotoelectricExcitationFactors (const double &energy, const double &weight=1.0) const
 
const ShellgetShell (const std::string &) const
 
const std::map< std::string, double > & getFluorescenceRatios (const std::string &subshell) const
 
const std::map< std::string, double > & getAugerRatios (std::string subshell)
 
const std::map< std::string, std::map< std::string, double > > & getCosterKronigRatios (std::string subshell)
 
std::pair< long, long > getInterpolationIndices (const std::vector< double > &, const double &) const
 
void setCascadeCacheEnabled (const int &flag=1)
 
int isCascadeCacheFilled () const
 
void fillCascadeCache ()
 
void emptyCascadeCache ()
 
void fillCache (const std::vector< double > &energy)
 
void setCacheEnabled (const int &flag=1)
 
void updateCache (const std::vector< double > &energy)
 
void clearCache ()
 
const int isCacheEnabled () const
 
int getCacheSize () const
 

Constructor & Destructor Documentation

§ Element() [1/2]

fisx::Element::Element ( )

Create a new Element instance. It will need calls to setName and setAtomicNumber in order to be able to use other methods.

§ Element() [2/2]

fisx::Element::Element ( std::string  name,
int  z = 0 
)

Create a new Element instance of an element with the given name and atomic number. It will need calls to setName and setAtomicNumber in order to be able to use other methods. This is the expected instantiation method.

Member Function Documentation

§ clearCache()

void fisx::Element::clearCache ( )

Clear the calculation cache

§ fillCache()

void fisx::Element::fillCache ( const std::vector< double > &  energy)

Clear the calculation cache and fill it at the selected energies

§ getAtomicMass()

const double & fisx::Element::getAtomicMass ( ) const

Retrieves the given element atomic mass.

§ getAtomicNumber()

const int & fisx::Element::getAtomicNumber ( ) const

Retrieves the given element atomic number.

§ getBindingEnergies()

const std::map< std::string, double > & fisx::Element::getBindingEnergies ( ) const

Retrieves the internal map of binding energies

§ getCacheSize()

int fisx::Element::getCacheSize ( ) const

Return the number of energies for which the calculations are stored

§ getColumn()

int fisx::Element::getColumn ( ) const

Retrieves the element column position in the periodic table.

§ getDensity()

double fisx::Element::getDensity ( ) const

Retrieves the given element density.

§ getEmittedXRayLines()

std::map< std::string, double > fisx::Element::getEmittedXRayLines ( const double &  energy = 1000.) const

Given an excitation energy (in keV), return a map where the key is the line name and the content the energy.

§ getExcitedShells()

std::vector< std::string > fisx::Element::getExcitedShells ( const double &  energy) const

Given a photon energie (in keV) gives back the excited shells

§ getFluorescenceRatios()

const std::map< std::string, double > & fisx::Element::getFluorescenceRatios ( const std::string &  subshell) const

Provide an easier to wrap interface than calling getShell to access important shell functions

§ getInitialPhotoelectricVacancyDistribution() [1/2]

std::map< std::string, std::vector< double > > fisx::Element::getInitialPhotoelectricVacancyDistribution ( const std::vector< double > &  energies) const

Given a set of energies, give the initial distribution of vacancies (before cascade) due to photoelectric effect. The output map keys correspond to the different partial photoelectric shells and the values are just vectors of mu_photoelectric(shell, E)/mu_photoelectric(total, E)

§ getInitialPhotoelectricVacancyDistribution() [2/2]

std::map< std::string, double > fisx::Element::getInitialPhotoelectricVacancyDistribution ( const double &  energy) const

Given one energy, give the initial distribution of vacancies (before cascade) due to photoelectric effect. The output map keys correspond to the different subshells and the values are just mu_photoelectric(shell, E)/mu_photoelectric(total, E).

§ getInterpolationIndices()

std::pair< long, long > fisx::Element::getInterpolationIndices ( const std::vector< double > &  vec,
const double &  x 
) const

Helper to locate interpolation indices.

§ getLongName()

std::string fisx::Element::getLongName ( ) const

Retrieves the element long name.

§ getMassAttenuationCoefficients() [1/3]

const std::map< std::string, std::vector< double > > & fisx::Element::getMassAttenuationCoefficients ( ) const

Retrieves the internal table of energies and associated mass attenuation coefficients

§ getMassAttenuationCoefficients() [2/3]

std::map< std::string, std::vector< double > > fisx::Element::getMassAttenuationCoefficients ( const std::vector< double > &  energy) const

Calculates via log-log interpolation in the internal table the mass attenuation coefficients at the given set of energies.

§ getMassAttenuationCoefficients() [3/3]

std::map< std::string, double > fisx::Element::getMassAttenuationCoefficients ( const double &  energy) const

Convenience method. Calculates via log-log interpolation in the internal table the mass attenuation coefficients at the given energy.

§ getName()

std::string fisx::Element::getName ( ) const

Retrieves the given element name.

§ getPartialPhotoelectricMassAttenuationCoefficients()

std::map< std::string, double > fisx::Element::getPartialPhotoelectricMassAttenuationCoefficients ( const double &  energy) const

Retrieves the internal table of partial photoelectric cross sections (in cm2/g) at the given energy.

§ getPhotoelectricExcitationFactors() [1/2]

std::vector< std::map< std::string, std::map< std::string, double > > > fisx::Element::getPhotoelectricExcitationFactors ( const std::vector< double > &  energy,
const std::vector< double > &  weights = std::vector<double>() 
) const

Given a set of energies and (optional) weights returns the emitted X-ray already corrected for cascade and fluorescence yield following photoelectric interaction.

§ getPhotoelectricExcitationFactors() [2/2]

std::map< std::string, std::map< std::string, double > > fisx::Element::getPhotoelectricExcitationFactors ( const double &  energy,
const double &  weight = 1.0 
) const

Given an energy and its (optional) weight, returns the emitted X-ray already corrected for cascade and fluorescence yield. If the weight is one, that corresponds to the different emitted x-rays per incident photon following photoelectric interaction.

§ getRow()

int fisx::Element::getRow ( ) const

Retrieves the element row position in the periodic table.

§ getTransitionEnergy()

double fisx::Element::getTransitionEnergy ( const std::string &  transition) const

Given a transition (KL3, L3M5, ...) returns the transition energy

§ getXRayLines()

const std::map< std::string, double > & fisx::Element::getXRayLines ( const std::string &  family = "") const

Given a subshell, return a map where the key is the line name and the content the energy.

§ getXRayLinesFromVacancyDistribution()

std::map< std::string, std::map< std::string, double > > fisx::Element::getXRayLinesFromVacancyDistribution ( const std::map< std::string, double > &  distribution,
const int &  cascade = 1,
const int &  useFluorescenceYield = 1 
) const

Given an initial vacancy distribution, returns the emitted X-rays.

Input: distribution - Map[key, double] of the form [(sub)shell][amount of vacancies] cascade - Consider de-excitation cascade (default is 1 = true) useFluorescenceYield - Correct by fluorescence yield (default is 1 = true)

Output: map[key]["rate"] - emission rate where key is the transition line (ex. KL3) map[key]["energy"] - emission energy where key is the transition line (ex. KL3)

§ isCacheEnabled()

const int fisx::Element::isCacheEnabled ( ) const

Return 1 if the calculation cache is enabled

§ setAtomicMass()

void fisx::Element::setAtomicMass ( const double &  mass)

Set the given element atomic number. WARNING: An element atomic mass not be changed unless we are making a copy from other element in order to change some properties.

§ setAtomicNumber()

void fisx::Element::setAtomicNumber ( const int &  z)

Set atomic number. It has to be a positive integer. WARNING: An element atomic number not be changed unless we are making a copy from other element in order to change some properties.

§ setBindingEnergies() [1/2]

void fisx::Element::setBindingEnergies ( std::map< std::string, double >  bindingEnergies)

Set element binding energies (in keV) as a map of doubles whith the keys indicating the respective atomic shells: K, L1, L2, L3, M1, ... , M5, N1, ..., N7, and so on.

§ setBindingEnergies() [2/2]

void fisx::Element::setBindingEnergies ( std::vector< std::string >  labels,
std::vector< double >  energies 
)

Convenience method to set the binding energies.

§ setCacheEnabled()

void fisx::Element::setCacheEnabled ( const int &  flag = 1)

Enable or disable the use of the stored calculations (if any). It does not clear the cache when disabling.

§ setCascadeCacheEnabled()

void fisx::Element::setCascadeCacheEnabled ( const int &  flag = 1)

Keep a cache for speed up de-excitation cascade calculation. It is expected to speed up things when having to calculate the de-excitation cascade for many energies. WARNING:

  • With less excitation energies than element shells it may be slower
  • For the time being is the responsibility of the user to reset the cache (due to a change of fluorescence, auger or CosterKronig yields, of emission ratios or binding energies.

§ setColumn()

void fisx::Element::setColumn ( const int &  column)

Set the column position in the periodic table

§ setDensity()

void fisx::Element::setDensity ( const double &  density)

Set the given element density (in g/cm3). Initialized by default to 1.0 g/cm3. WARNING: An already changed element density not be modified unless we are making a copy from other element in order to change some properties.

§ setLongName()

void fisx::Element::setLongName ( const std::string &  name)

Set element long name.

§ setMassAttenuationCoefficients() [1/2]

void fisx::Element::setMassAttenuationCoefficients ( const std::vector< double > &  energies,
const std::vector< double > &  photoelectric,
const std::vector< double > &  coherent,
const std::vector< double > &  incoherent,
const std::vector< double > &  pair = std::vector<double>() 
)

Set the photon mass attenuation coefficcients (in cm2/g) of the element at the given energies (in keV).

§ setMassAttenuationCoefficients() [2/2]

void fisx::Element::setMassAttenuationCoefficients ( const std::vector< double > &  energies,
const std::vector< double > &  photoelectric,
const std::vector< double > &  coherent,
const std::vector< double > &  incoherent 
)

Convenience method skipping pair production mass attenuation coefficients. They will be internaly considered as zero.

§ setName()

void fisx::Element::setName ( const std::string &  name)

Set element name. It is not limited to two characters. WARNING: An element name should not be changed unless we are making a copy from other element in order to change some properties.

§ setPartialPhotoelectricMassAttenuationCoefficients()

void fisx::Element::setPartialPhotoelectricMassAttenuationCoefficients ( const std::string &  shell,
const std::vector< double > &  energy,
const std::vector< double > &  partialPhotoelectric 
)

Set the photon partial photoelectric cross sections (in cm2/g) for the given shell name. Only the EPDL97 library seems to offer these cross sections.

§ setRow()

void fisx::Element::setRow ( const int &  row)

Set the element row position in the periodic table

§ setTotalMassAttenuationCoefficient()

void fisx::Element::setTotalMassAttenuationCoefficient ( const std::vector< double > &  energies,
const std::vector< double > &  total 
)

TODO. Not yet implemented. If the this total mass attenuation is supplied, photoelectric effect mass attenuation will be defined as this total minus the sum of the other effects. The idea is to be able to supply a measured absorption spectrum.

§ updateCache()

void fisx::Element::updateCache ( const std::vector< double > &  energy)

Update the cache with those energy values not already present. The existing values will be kept.


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