#include #include #include #include #include "mucal.h" #include "panel.h" /* **************************************************************************************** */ /* Calculation of Bragg scattering efficiency from mosaic crystals of finite thickness. Nomenclature follows "A study of focusing...", nl, 1992 Niels Lund September 2005 This routine calculates nominal Bragg energies for each facet and nOption */ int reflect2(reflect *REFL, facet *FACET, int nOption) { static int Z=-2, CM=-1, first = 1; int i, j, k, err, len; float E, thetaB, PI, TWOPI, GTORAD; float lambda, d; float fwhmt; float arcmin2rad, dE; PI = 3.14159; TWOPI = 2.0 * PI; GTORAD = TWOPI / 360.0; arcmin2rad = GTORAD / 60.0; CM = REFL->CM; /* Calculate Bragg-energy, E, corresponding to Z, Miller-index, Focal length and facet position */ d = REFL->dist_geo * 1.0e+8; /* separation between crystal planes (Angstroem) */ thetaB = FACET->thetaB; lambda = thetaB * 2.0 * d; /* X-ray wavelength according to Bragg's formula: thetaB = lambda / (2d) */ E = 12.39 / lambda; /* lambda in Angstroem, E in KeV */ dE = E * fwhmt * arcmin2rad / thetaB; FACET->E[nOption] = E; FACET->dE[nOption] = dE; return(1); }