Skip to content

Commit d009876

Browse files
author
Emmanuel FARHI
committed
mcxtrace: FluoCrystal: remove debug printf
1 parent 44c558f commit d009876

1 file changed

Lines changed: 13 additions & 15 deletions

File tree

mcxtrace-comps/samples/FluoCrystal.comp

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,7 @@
3636
* in the material. Leaving 'order=0' handles the single scattering only.
3737
*
3838
* Example: FluoCrystal(material="LaB6.cif",
39-
* xwidth=0.001,yheight=0.001,zdepth=0.0001, p_interact=0.99,
40-
* target_index=1, focus_xw=0.0005, focus_yh=0.0005)
39+
* xwidth=0.001,yheight=0.001,zdepth=0.0001, p_interact=0.99, mosaic=1)
4140
*
4241
* <b>Sample shape:</b>
4342
* Sample shape may be a cylinder, a sphere, a box or any other shape
@@ -844,9 +843,7 @@ do { /* while (intersect) Loop over multiple scattering events */
844843
int flag=0;
845844
double d_path, p_trans, p_scatt, mc_trans, mc_scatt;
846845

847-
/* actual fluorescence calculation */
848-
849-
/* compute total scattering cross section for incoming photon energy Ei */
846+
/* compute total scattering cross section ------------------------------ */
850847
/* compute each contribution XS */
851848
xs[FLUORESCENCE]=xs[COMPTON]=xs[RAYLEIGH]=xs[TRANSMISSION]=xs[DIFFRACTION]=sigma_barn=0;
852849
cum_xs_fluo[0] = cum_xs_Compton[0] = cum_xs_Rayleigh[0] = 0;
@@ -911,7 +908,8 @@ do { /* while (intersect) Loop over multiple scattering events */
911908
}
912909
}
913910

914-
/* probability to absorb/scatter */
911+
/* probability to absorb/scatter --------------------------------------- */
912+
/* determine scattering location in sample */
915913
my_s = fluo_rho*100*sigma_barn; /* mu 100: convert from barns to fm^2. my_s in [1/m] */
916914
d_path = ( dl0 +dl2 ); /* total path lenght in sample */
917915

@@ -953,6 +951,7 @@ do { /* while (intersect) Loop over multiple scattering events */
953951

954952
} /* if intersect (propagate) */
955953

954+
/* select scattering line ------------------------------------------------ */
956955
if (intersect) { /* scattering event */
957956
int i_Z=-1, Z, j=-1;
958957
double solid_angle;
@@ -986,15 +985,15 @@ do { /* while (intersect) Loop over multiple scattering events */
986985
sum=0;
987986
// choose a line among those possible, using F2 as relative probability/intensity
988987
j = hkl_select(T, tau_count, coh_refl, &sum,_particle);
989-
printf("DEBUG: %s: DIFF j=%i sum=%g\n", NAME_CURRENT_COMP, j, sum);
990988
if(j >= tau_count) j = tau_count - 1;
991-
} else j = 0;/* Select between tau_count Bragg spots */
989+
} else j = 0; /* Select between tau_count Bragg spots */
992990
break;
993991
default: // should never happen
994992
// printf("WARNING: %s: process %i unknown. Absorb.\n", NAME_CURRENT_COMP, type);
995993
ABSORB;
996994
}
997995

996+
// select scattering direction --------------------------------------------
998997
if (i_Z >= 0) {
999998
// fluorescence/Rayleigh/Compton: 4PI scattering
1000999
Z = compound->Elements[i_Z];
@@ -1028,14 +1027,15 @@ do { /* while (intersect) Loop over multiple scattering events */
10281027
double kfy = T[j].rho_y + T[j].oy + T[j].b1y*y1 + T[j].b2y*y2;
10291028
double kfz = T[j].rho_z + T[j].oz + T[j].b1z*y1 + T[j].b2z*y2;
10301029

1031-
/* kf(x,y,z) is already normalized to kf (in) */
1030+
/* Normalize kf to length of ki, to account for planer
1031+
approximation of the Ewald sphere. */
1032+
double adjust = ki/sqrt(kfx*kfx + kfy*kfy + kfz*kfz);
1033+
kfx *= adjust;
1034+
kfy *= adjust;
1035+
kfz *= adjust;
10321036

10331037
/* Adjust photon weight (see manual for explanation). */
10341038
double pmul = T[j].xsect*coh_refl/(coh_xsect*T[j].refl);
1035-
printf("DEBUG: L[%i] hkl=[%i %i %i] pmul=%g\n",
1036-
i, L[i].h, L[i].k, L[i].l, pmul);
1037-
printf(" kf(in)=%g %g %g -> kf(xyz)=%g %g %g \n",
1038-
kf_x, kf_y, kf_z, kfx, kfy, kfz);
10391039
if (!isnan(pmul)) p *= pmul;
10401040
kf_x = L[i].u1x*kfx + L[i].u2x*kfy + L[i].u3x*kfz;
10411041
kf_y = L[i].u1y*kfx + L[i].u2y*kfy + L[i].u3y*kfz;
@@ -1123,8 +1123,6 @@ FINALLY %{
11231123
MPI_MASTER(
11241124
printf("FluoCrystal: %s: scattered intensity: fluo=%g Compton=%g Rayleigh=%g Diffraction=%g\n",
11251125
NAME_CURRENT_COMP, p_fluo, p_Compton, p_Rayleigh, p_diff);
1126-
printf("FluoCrystal: %s: scattered events : fluo=%i Compton=%i Rayleigh=%i Diffraction=%i\n",
1127-
NAME_CURRENT_COMP, n_fluo, n_Compton, n_Rayleigh, n_diff);
11281126
);
11291127
%}
11301128

0 commit comments

Comments
 (0)