@@ -28,7 +28,7 @@ Ray behaveCrystal(Ray r, const Behaviour behaviour, [[maybe_unused]] Collision c
2828 double polFactorS = 1.0 ;
2929 double polFactorP = std::fabs (cos (2 * bragg));
3030
31- double wavelength = inm2eV / r.m_energy ;
31+ double wavelength = energyToWaveLength ( r.m_energy ) ;
3232 double gamma = getDiffractionPrefactor (wavelength, b.m_unitCellVolume );
3333
3434 std::complex <double > F0 (b.m_structureFactorReF0 , b.m_structureFactorImF0 );
@@ -80,7 +80,7 @@ Ray behaveSlit(Ray r, const Behaviour behaviour, Rand& __restrict rand) {
8080
8181 double dPhi = 0 ;
8282 double dPsi = 0 ;
83- double wavelength = hvlam (r.m_energy );
83+ double wavelength = energyToWaveLength (r.m_energy );
8484
8585 // this was previously called "diffraction"
8686 if (wavelength > 0 ) {
@@ -109,7 +109,7 @@ RAYX_FN_ACC
109109Ray behaveRZP (Ray r, const Behaviour behaviour, const Collision col, Rand& __restrict rand) {
110110 RZPBehaviour b = deserializeRZP (behaviour);
111111
112- double WL = hvlam (r.m_energy );
112+ double WL = energyToWaveLength (r.m_energy );
113113 double Ord = b.m_orderOfDiffraction ;
114114 int additional_order = int (b.m_additionalOrder );
115115
@@ -137,7 +137,7 @@ Ray behaveGrating(Ray r, const Behaviour behaviour, const Collision col) {
137137 GratingBehaviour b = deserializeGrating (behaviour);
138138
139139 // vls parameters passed in q.elementParams
140- double WL = hvlam (r.m_energy );
140+ double WL = energyToWaveLength (r.m_energy );
141141 double lineDensity = b.m_lineDensity ;
142142 double orderOfDiffraction = b.m_orderOfDiffraction ;
143143
@@ -177,7 +177,7 @@ RAYX_FN_ACC
177177Ray behaveFoil (Ray r, const Behaviour behaviour, const Collision col, const int material, const int * __restrict materialIndices,
178178 const double * __restrict materialTable) {
179179 FoilBehaviour f = deserializeFoil (behaviour);
180- const double wavelength = hvlam (r.m_energy );
180+ const double wavelength = energyToWaveLength (r.m_energy );
181181
182182 const auto indexVacuum = complex::Complex (1 ., 0 .);
183183 const auto indexMaterial = getRefractiveIndex (r.m_energy , material, materialIndices, materialTable);
0 commit comments