fisx
fisx::XRF Class Reference

Public Member Functions

 XRF ()
 
 XRF (const std::string &configurationFile)
 
void readConfigurationFromFile (const std::string &fileName)
 
void setBeam (const Beam &beam)
 
void setBeam (const std::vector< double > &energies, const std::vector< double > &weight, const std::vector< int > &characteristic=std::vector< int >(), const std::vector< double > &divergency=std::vector< double >())
 
void setBeam (const double &energy, const double &divergency=0.0)
 
void setBeamFilters (const std::vector< Layer > &filters)
 
void setUserBeamFilters (const std::vector< TransmissionTable > &userFilters)
 
void setSample (const std::vector< Layer > &layers, const int &referenceLayer=0)
 
void setSample (const std::string &name, const double &density=1.0, const double &thickness=1.0)
 
void setSample (const Layer &layer)
 
void setAttenuators (const std::vector< Layer > &attenuators)
 
void setUserAttenuators (const std::vector< TransmissionTable > &userAttenuators)
 
void setDetector (const Detector &detector)
 
void setGeometry (const double &alphaIn, const double &alphaOut, const double &scatteringAngle=-90.)
 
void setReferenceLayer (const int &index)
 
void setRefenceLayer (const std::string &name)
 
void setCollimators ()
 
void addCollimator ()
 
const XRFConfiggetConfiguration () const
 
void setConfiguration (const XRFConfig &configuration)
 
std::map< std::string, std::map< std::string, std::map< std::string, std::map< std::string, double > > > > getExpectedPrimaryEmission (const std::vector< std::string > &elementList, const Elements &elements)
 
double getGeometricEfficiency (const int &layerIndex=0) const
 
std::map< std::string, std::map< int, std::map< std::string, std::map< std::string, double > > > > getMultilayerFluorescence (const std::string &element, const Elements &elementsLibrary, const int &sampleLayerIndex=0, const std::string &lineFamily="", const int &secondary=0, const int &useGeometricEfficiency=1, const int &useMassFractions=0, const double &secondaryCalculationLimit=0.0)
 
std::map< std::string, std::map< int, std::map< std::string, std::map< std::string, double > > > > getMultilayerFluorescence (const std::vector< std::string > &elementFamilyLayer, const Elements &elementsLibrary, const int &secondary=0, const int &useGeometricEfficiency=1, const int &useMassFractions=0, const double &secondaryCalculationLimit=0.0)
 
std::map< std::string, std::map< int, std::map< std::string, std::map< std::string, double > > > > getMultilayerFluorescence (const std::vector< std::string > &elementList, const Elements &elementsLibrary, const std::vector< int > &layerList, const std::vector< std::string > &familyList, const int &secondary=0, const int &useGeometricEfficiency=1, const int &useMassFractions=0, const double &secondaryCalculationLimit=0.0)
 
double getEnergyThreshold (const std::string &elementName, const std::string &family, const Elements &elementsLibrary) const
 
const BeamgetBeam () const
 
const std::vector< Layer > & getBeamFilters () const
 
const std::vector< TransmissionTable > & getUserBeamFilters () const
 
const std::vector< Layer > & getSample () const
 
const std::vector< Layer > & getAttenuators () const
 
const std::vector< TransmissionTable > & getUserAttenuators () const
 
const DetectorgetDetector () const
 
const double & getAlphaIn () const
 
const double & getAlphaOut () const
 
const double & getScatteringAngle () const
 
const int & getReferenceLayer () const
 

Constructor & Destructor Documentation

§ XRF() [1/2]

fisx::XRF::XRF ( )

Default constructor

§ XRF() [2/2]

fisx::XRF::XRF ( const std::string &  configurationFile)

Constructor with configuration file

Member Function Documentation

§ getAttenuators()

const std::vector<Layer>& fisx::XRF::getAttenuators ( ) const
inline

Get the attenuator layers

§ getBeam()

const Beam& fisx::XRF::getBeam ( ) const
inline

Get the beam

§ getBeamFilters()

const std::vector<Layer>& fisx::XRF::getBeamFilters ( ) const
inline

Get the beam filters to be applied

§ getConfiguration()

const XRFConfig & fisx::XRF::getConfiguration ( ) const

Get the current configuration

§ getDetector()

const Detector& fisx::XRF::getDetector ( ) const
inline

Get the detector

§ getExpectedPrimaryEmission()

std::map< std::string, std::map< std::string, std::map<std::string, std::map<std::string, double> > > > fisx::XRF::getExpectedPrimaryEmission ( const std::vector< std::string > &  elementList,
const Elements elements 
)

Get the expected fluorescence emission coming from primary excitation per unit photon. It needs to be multiplied by the mass fraction and the total number of photons to get the actual primary fluorescence.

The output is a map:

Element -> Family -> Line -> energy: double, ratio: double

§ getGeometricEfficiency()

double fisx::XRF::getGeometricEfficiency ( const int &  layerIndex = 0) const

Get geometric efficiency term. Solid angle subtended by the detector at the sample divided by 4 * pi

§ getMultilayerFluorescence() [1/2]

std::map< std::string, std::map< int, std::map< std::string, std::map< std::string, double > > > > fisx::XRF::getMultilayerFluorescence ( const std::string &  element,
const Elements elementsLibrary,
const int &  sampleLayerIndex = 0,
const std::string &  lineFamily = "",
const int &  secondary = 0,
const int &  useGeometricEfficiency = 1,
const int &  useMassFractions = 0,
const double &  secondaryCalculationLimit = 0.0 
)

Return a complete output of the form [Element Family][Layer][line]["energy"] - Energy in keV of the emission line [Element Family][Layer][line]["primary"] - Primary rate prior to correct for detection efficiency [Element Family][Layer][line]["secondary"] - Secondary rate prior to correct for detection efficiency [Element Family][Layer][line]["rate"] - Overall rate [Element Family][Layer][line]["efficiency"] - Detection efficiency [Element Family][Layer][line][element line layer] - Secondary rate (prior to correct for detection efficiency) due to the fluorescence from the given element, line and layer index composing the map key.

§ getMultilayerFluorescence() [2/2]

std::map< std::string, std::map< int, std::map< std::string, std::map< std::string, double > > > > fisx::XRF::getMultilayerFluorescence ( const std::vector< std::string > &  elementFamilyLayer,
const Elements elementsLibrary,
const int &  secondary = 0,
const int &  useGeometricEfficiency = 1,
const int &  useMassFractions = 0,
const double &  secondaryCalculationLimit = 0.0 
)

Basis method called by all the other convenience methods.

Parameters
elementFamilyLayer- Vector of strings. Each string represents the information we are interested on.
"Cr" - We want the information for Cr, for all line families and sample layers
"Cr K" - We want the information for Cr, for the family of K-shell emission lines, in all layers.
"Cr K 0" - We want the information for Cr, for the family of K-shell emission lines, in layer 0.
elementsLibrary- Instance of library to be used for all the Physical constants
secondary- Flag to indicate different levels of secondary excitation to be considered.
0 Means not considered
1 Consider secondary excitation
2 Consider tertiary excitation
useGeometricEfficiency- Take into account solid angle or not. Default is 1 (yes)
useMassFractions- If 0 (default) the output corresponds to the requested information if the mass fraction of the element would be one on each calculated sample layer. To get the actual signal, one has to multiply the rates by the actual mass fraction of the element on each sample layer. If set to 1, the rate will be already corrected by the actual mass fraction.
Returns
Return a complete output of the form:
[Element Family][Layer][line]["energy"] - Energy in keV of the emission line
[Element Family][Layer][line]["primary"] - Primary rate prior to correct for detection efficiency
[Element Family][Layer][line]["secondary"] - Secondary rate prior to correct for detection efficiency
[Element Family][Layer][line]["rate"] - Overall rate
[Element Family][Layer][line]["efficiency"] - Detection efficiency
[Element Family][Layer][line][element line layer] - Secondary rate (prior to correct for detection efficiency) due to the fluorescence from the given element, line and layer index composing the map key.
[Element Family][Layer][line]["massFraction"] - Mass fraction of the element in the considered layer

§ getSample()

const std::vector<Layer>& fisx::XRF::getSample ( ) const
inline

Get the sample description

§ getUserAttenuators()

const std::vector<TransmissionTable>& fisx::XRF::getUserAttenuators ( ) const
inline

Get the user attenuators to be applied

§ getUserBeamFilters()

const std::vector<TransmissionTable>& fisx::XRF::getUserBeamFilters ( ) const
inline

Get the user beam filters to be applied

§ readConfigurationFromFile()

void fisx::XRF::readConfigurationFromFile ( const std::string &  fileName)

Read the configuration from file

§ setAttenuators()

void fisx::XRF::setAttenuators ( const std::vector< Layer > &  attenuators)

It consists on a set of layers of different materials, densities and thicknesses and "funny" factors.

§ setBeam() [1/3]

void fisx::XRF::setBeam ( const Beam beam)

Set the excitation beam

§ setBeam() [2/3]

void fisx::XRF::setBeam ( const std::vector< double > &  energies,
const std::vector< double > &  weight,
const std::vector< int > &  characteristic = std::vector<int>(),
const std::vector< double > &  divergency = std::vector<double>() 
)

Easy to wrap funtion to set the excitation beam

Parameters
energiesSet of double values corresponding to energies (in keV) describing the incoming beam
weightSet of weights with the relative intensity of each energy
characteristicInteger flag currently ignored by fisx library
divergencyBeam divergency in degrees (currently ignored by fisx library)

§ setBeam() [3/3]

void fisx::XRF::setBeam ( const double &  energy,
const double &  divergency = 0.0 
)

Funtion to set a single energy excitation beam

Parameters
energyEnergy of the incoming beam

§ setBeamFilters()

void fisx::XRF::setBeamFilters ( const std::vector< Layer > &  filters)

Set the beam filters to be applied

§ setCollimators()

void fisx::XRF::setCollimators ( )

Set the elements library to be used.

Collimators are not implemented yet. The collimators are attenuators that take into account their distance to the sample, their diameter, thickness and density

§ setConfiguration()

void fisx::XRF::setConfiguration ( const XRFConfig configuration)

Set the configuration

§ setDetector()

void fisx::XRF::setDetector ( const Detector detector)

Set the detector. For the time being it is very simple. It has active area/diameter, material, density, thickness and distance.

§ setGeometry()

void fisx::XRF::setGeometry ( const double &  alphaIn,
const double &  alphaOut,
const double &  scatteringAngle = -90. 
)

Set the excitation geometry. For the time being, just the incident, outgoing angles and scattering angle to detector center. A negative scattering angle of 90 degrees indicates the scattering angle is the sum of alphaIn and alphaOut.

§ setReferenceLayer()

void fisx::XRF::setReferenceLayer ( const int &  index)

Set the reference layer. The detector distance is measured from the reference layer surface. If not specified, the layer closest to the detector

§ setSample() [1/3]

void fisx::XRF::setSample ( const std::vector< Layer > &  layers,
const int &  referenceLayer = 0 
)

Set the sample description. It consists on a set of layers of different materials, densities and thicknesses. The top layer will be taken as reference layer. This can be changed calling setRefenceLayer

§ setSample() [2/3]

void fisx::XRF::setSample ( const std::string &  name,
const double &  density = 1.0,
const double &  thickness = 1.0 
)

Convenience method for single layer samples.

§ setSample() [3/3]

void fisx::XRF::setSample ( const Layer layer)

Convenience method for single layer samples.

§ setUserAttenuators()

void fisx::XRF::setUserAttenuators ( const std::vector< TransmissionTable > &  userAttenuators)

Set the user transmission tables to be applied as attenuators

§ setUserBeamFilters()

void fisx::XRF::setUserBeamFilters ( const std::vector< TransmissionTable > &  userFilters)

Set the user beam filters to be applied


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