ToSI.keV(props
.getNumericProperty(SpectrumProperties.BeamEnergy));
// Create strategy
Strategy strategy = AlgorithmUser.getGlobalStrategy();
PhiRhoZAlgorithm corrAlg =
(PhiRhoZAlgorithm) strategy
.getAlgorithm(PhiRhoZAlgorithm.class);
if (corrAlg == null)
throw new NullPointerException("No correction algorithm defined");
IonizationCrossSection icx =
(IonizationCrossSection) strategy
.getAlgorithm(IonizationCrossSection.class);
if (icx == null)
icx = AbsoluteIonizationCrossSection.BoteSalvat2008;
FluorescenceYield fy =
(FluorescenceYield) strategy
.getAlgorithm(FluorescenceYield.class);
// Calculate intensities
Element element;
AtomicShell shell;
double q, wf, yield, lineWeight, atomicWeight, factor;
for (XRayTransition xrt : transitions) {
element = xrt.getElement();
if (comp.containsElement(element)) {
shell = xrt.getDestination();
corrAlg.initialize(comp, shell, props);
q = icx.computeShell(shell, energy);
wf = comp.weightFraction(element, false);
yield = fy.compute(shell);
atomicWeight = element.getAtomicWeight();
lineWeight = xrt.getWeight(XRayTransition.NormalizeFamily);
factor =
(q * yield * lineWeight)
* (wf / atomicWeight * PhysicalConstants.AvagadroNumber);
etIntensities.put(xrt, corrAlg.computeZAFCorrection(xrt)
* factor);
enfIntensities.put(xrt, corrAlg.computeZACorrection(xrt)
* factor);
gnfIntensities.put(xrt, corrAlg.generated(xrt) * factor);
} else {
etIntensities.put(xrt, 0.0);
enfIntensities.put(xrt, 0.0);
gnfIntensities.put(xrt, 0.0);
}