DEFINE COMPONENT MyPSD_monitor DEFINITION PARAMETERS (nx=90, ny=90, restore_neutron=0) SETTING PARAMETERS (string filename=0, xmin=-0.05, xmax=0.05, ymin=-0.05, ymax=0.05, xwidth=0, yheight=0) OUTPUT PARAMETERS (PSD_N, PSD_p, PSD_p2) STATE PARAMETERS (x,y,z,vx,vy,vz,t,s1,s2,p,dddd) DECLARE %{ double PSD_N[nx][ny]; double PSD_p[nx][ny]; double PSD_p2[nx][ny]; %} INITIALIZE %{ int i,j; if (xwidth > 0) { xmax = xwidth/2; xmin = -xmax; } if (yheight > 0) { ymax = yheight/2; ymin = -ymax; } if ((xmin >= xmax) || (ymin >= ymax)) { printf("PSD_monitor: %s: Null detection area !\n" "ERROR (xwidth,yheight,xmin,xmax,ymin,ymax). Exiting", NAME_CURRENT_COMP); exit(0); } for (i=0; ixmin && xymin && y