fisx
|
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 Shell & | getShell (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 |
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.
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.
void fisx::Element::clearCache | ( | ) |
Clear the calculation cache
void fisx::Element::fillCache | ( | const std::vector< double > & | energy | ) |
Clear the calculation cache and fill it at the selected energies
const double & fisx::Element::getAtomicMass | ( | ) | const |
Retrieves the given element atomic mass.
const int & fisx::Element::getAtomicNumber | ( | ) | const |
Retrieves the given element atomic number.
const std::map< std::string, double > & fisx::Element::getBindingEnergies | ( | ) | const |
Retrieves the internal map of binding energies
int fisx::Element::getCacheSize | ( | ) | const |
Return the number of energies for which the calculations are stored
int fisx::Element::getColumn | ( | ) | const |
Retrieves the element column position in the periodic table.
double fisx::Element::getDensity | ( | ) | const |
Retrieves the given element density.
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.
std::vector< std::string > fisx::Element::getExcitedShells | ( | const double & | energy | ) | const |
Given a photon energie (in keV) gives back the excited shells
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
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)
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).
std::pair< long, long > fisx::Element::getInterpolationIndices | ( | const std::vector< double > & | vec, |
const double & | x | ||
) | const |
Helper to locate interpolation indices.
std::string fisx::Element::getLongName | ( | ) | const |
Retrieves the element long name.
const std::map< std::string, std::vector< double > > & fisx::Element::getMassAttenuationCoefficients | ( | ) | const |
Retrieves the internal table of energies and associated mass attenuation coefficients
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.
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.
std::string fisx::Element::getName | ( | ) | const |
Retrieves the given element name.
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.
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.
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.
int fisx::Element::getRow | ( | ) | const |
Retrieves the element row position in the periodic table.
double fisx::Element::getTransitionEnergy | ( | const std::string & | transition | ) | const |
Given a transition (KL3, L3M5, ...) returns the transition energy
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.
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)
const int fisx::Element::isCacheEnabled | ( | ) | const |
Return 1 if the calculation cache is enabled
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.
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.
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.
void fisx::Element::setBindingEnergies | ( | std::vector< std::string > | labels, |
std::vector< double > | energies | ||
) |
Convenience method to set the binding energies.
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.
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:
void fisx::Element::setColumn | ( | const int & | column | ) |
Set the column position in the periodic table
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.
void fisx::Element::setLongName | ( | const std::string & | name | ) |
Set element long name.
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).
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.
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.
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.
void fisx::Element::setRow | ( | const int & | row | ) |
Set the element row position in the periodic table
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.
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.