/******************************************************************************* * * McStas, version 1.0, released October 26, 1998 * Maintained by Kristian Nielsen and Kim Lefmann, * Risoe National Laboratory, Roskilde, Denmark * * Component: PSD_bidim * * %I * Written by: KL, Feb 3, 1998 (PSD_monitor.comp) * Modified by: Thomas Hansen, ILL Grenoble, France, 1999: Output modified * Modified by: EF, 2004. Obsoleted as it is not stable/working * * %D * An (n times m) pixel PSD monitor. This component may also be used as a beam * detector. * OBSOLETE: rather use monitors/Monitor_nD with options="... banana ..." * * %P * INPUT PARAMETERS: * * xmin: Lower x bound of detector opening (m) * xmax: Upper x bound of detector opening (m) * ymin: Lower y bound of detector opening (m) * ymax: Upper y bound of detector opening (m) * nx: Number of pixel columns (1) * ny: Number of pixel rows (1) * filename: Name of file in which to store the detector image (text) * * OUTPUT PARAMETERS: * * PSD_N: Array of neutron counts * PSD_p: Array of neutron weight counts * PSD_p2: Array of second moments * * %E *******************************************************************************/ DEFINE COMPONENT PSD_bidim DEFINITION PARAMETERS (xmin, xmax, ymin, ymax, nx, ny, filename) SETTING PARAMETERS () OUTPUT PARAMETERS (PSD_N, PSD_p, PSD_p2) STATE PARAMETERS (x,y,z,vx,vy,vz,t,s1,s2,p) DECLARE %{ int PSD_N[nx][ny]; double PSD_p[nx][ny]; double PSD_p2[nx][ny]; %} INITIALIZE %{ int i,j; for (i=0; ixmin && xymin && y