Closed farhi closed 1 year ago
A link with xraylib (libxrl) is a straight-forward solution. An implementation with Compton scattering shows how libxrl can be used:
In principle, fluo, Compton, etc can be used the same. The list of all cross sections is available:
For instance:
double CS_Energy(int Z, double E, xrl_error **error);
Given an element Z and an energy E, returns the mass-energy absorption cross section in cm2g
double CS_Total_CP(const char compound[], double E, xrl_error **error);
double CS_Photo_CP(const char compound[], double E, xrl_error **error);
double CS_Rayl_CP(const char compound[], double E, xrl_error **error);
double CS_Compt_CP(const char compound[], double E, xrl_error **error);
double CSb_Total_CP(const char compound[], double E, xrl_error **error);
double CSb_Photo_CP(const char compound[], double E, xrl_error **error);
double CSb_Rayl_CP(const char compound[], double E, xrl_error **error);
double CSb_Compt_CP(const char compound[], double E, xrl_error **error);
double CS_Total_Kissel_CP(const char compound[], double E, xrl_error **error);
double CSb_Total_Kissel_CP(const char compound[], double E, xrl_error **error);
double CS_Energy(const char compound[], double E, xrl_error **error);
Identical to the earlier mentioned functions, but require a chemical formula or a NIST compound name compound as first argument.
A C implementation is:
Use X-ray lib to simulate the energy and probability of fluorescence lines:
In any case there are questions to assess: