Skip to content

Commit ce12d8b

Browse files
authored
Merge pull request #2387 from willend/Monitor_nD_nexusbins_only_listmode
McStas Monitor_nD “nexusbins” only in listmode
2 parents b8733bc + 1cab719 commit ce12d8b

13 files changed

Lines changed: 461 additions & 350 deletions

mcstas-comps/contrib/PSD_Detector.comp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -741,7 +741,7 @@ INITIALIZE
741741
strcpy (Vars.option, "list all");
742742
strcat (Vars.option, ", borders, x y z vx vy vz t sx sy sz");
743743

744-
Monitor_nD_Init (&DEFS, &Vars, 0.1, 0.1, 0, 0, 0, 0, 0, 0, 0, 0); /* dims for mcdisplay */
744+
Monitor_nD_Init (&DEFS, &Vars, 0.1, 0.1, 0, 0, 0, 0, 0, 0, 0, 0, 0); /* dims for mcdisplay */
745745
if (filename && strlen (filename) && strcmp (filename, "0") && strcmp (filename, "NULL"))
746746
strncpy (Vars.Mon_File, filename, 128);
747747

mcstas-comps/contrib/StatisticalChopper_Monitor.comp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ INITIALIZE INHERIT Monitor_nD EXTEND
7373
strcpy (Vars.option, op);
7474

7575
/* re-initialize Monitor_nD */
76-
Monitor_nD_Init (&DEFS, &Vars, xwidth, yheight, zdepth, xmin, xmax, ymin, ymax, zmin, zmax, 0);
76+
Monitor_nD_Init (&DEFS, &Vars, xwidth, yheight, zdepth, xmin, xmax, ymin, ymax, zmin, zmax, 0, 0);
7777
%}
7878

7979
TRACE INHERIT Monitor_nD

mcstas-comps/monitors/Monitor_nD.comp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,8 @@
216216
* username3: [str] Name assigned to User3
217217
* restore_neutron: [0|1] If set, the monitor does not influence the neutron state. Equivalent to setting the 'parallel' option.
218218
* geometry: [str] Name of an OFF file to specify a complex geometry detector
219-
* nowritefile: [1] If set, monitor will skip writing to disk
219+
* nowritefile: [1] If set, monitor will skip writing to disk
220+
* nexus_bins: [1] NeXus mode only: store component BIN information <br>(-1 disable, 0 enable for list mode monitor, 1 enable for any montor)
220221
*
221222
* CALCULATED PARAMETERS:
222223
*
@@ -235,7 +236,7 @@ SETTING PARAMETERS (
235236
xwidth=0, yheight=0, zdepth=0,
236237
xmin=0, xmax=0, ymin=0, ymax=0, zmin=0, zmax=0,
237238
int bins=0, min=-1e40, max=1e40, int restore_neutron=0, radius=0,
238-
string options="NULL", string filename="NULL",string geometry="NULL", int nowritefile=0,
239+
string options="NULL", string filename="NULL",string geometry="NULL", int nowritefile=0, int nexus_bins=0,
239240
string username1="NULL", string username2="NULL", string username3="NULL"
240241
)
241242
/* these are protected C variables */
@@ -369,7 +370,7 @@ INITIALIZE
369370
if (!radius && !xwidth && !yheight && !zdepth && !xmin && !xmax && !ymin && !ymax && !strstr (Vars.option, "previous") && (!geometry || !strlen (geometry)))
370371
exit (printf ("Monitor_nD: %s has no dimension specified. Aborting (radius, xwidth, yheight, zdepth, previous, geometry).\n", NAME_CURRENT_COMP));
371372

372-
Monitor_nD_Init (&DEFS, &Vars, xwidth, yheight, zdepth, xmin, xmax, ymin, ymax, zmin, zmax, offflag);
373+
Monitor_nD_Init (&DEFS, &Vars, xwidth, yheight, zdepth, xmin, xmax, ymin, ymax, zmin, zmax, offflag, nexus_bins);
373374

374375
if (Vars.Flag_OFF) {
375376
offdata.mantidflag = Vars.Flag_mantid;

mcstas-comps/monitors/Monitor_nD_noacc.comp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,7 @@
217217
* restore_neutron: [0|1] If set, the monitor does not influence the neutron state. Equivalent to setting the 'parallel' option.
218218
* geometry: [str] Name of an OFF file to specify a complex geometry detector
219219
* nowritefile: [1] If set, monitor will skip writing to disk
220+
* nexus_bins: [1] NeXus mode only: store component BIN information <br>(-1 disable, 0 enable for list mode monitor, 1 enable for any montor)
220221
*
221222
* CALCULATED PARAMETERS:
222223
*
@@ -235,7 +236,7 @@ SETTING PARAMETERS (
235236
xwidth=0, yheight=0, zdepth=0,
236237
xmin=0, xmax=0, ymin=0, ymax=0, zmin=0, zmax=0,
237238
int bins=0, min=-1e40, max=1e40, int restore_neutron=0, radius=0,
238-
string options="NULL", string filename="NULL",string geometry="NULL", int nowritefile=0,
239+
string options="NULL", string filename="NULL",string geometry="NULL", int nowritefile=0, int nexus_bins=0,
239240
string username1="NULL", string username2="NULL", string username3="NULL"
240241
)
241242
/* these are protected C variables */
@@ -370,7 +371,7 @@ INITIALIZE
370371
if (!radius && !xwidth && !yheight && !zdepth && !xmin && !xmax && !ymin && !ymax && !strstr (Vars.option, "previous") && (!geometry || !strlen (geometry)))
371372
exit (printf ("Monitor_nD: %s has no dimension specified. Aborting (radius, xwidth, yheight, zdepth, previous, geometry).\n", NAME_CURRENT_COMP));
372373

373-
Monitor_nd_noaccInit (&DEFS, &Vars, xwidth, yheight, zdepth, xmin, xmax, ymin, ymax, zmin, zmax, offflag);
374+
Monitor_nD_Init (&DEFS, &Vars, xwidth, yheight, zdepth, xmin, xmax, ymin, ymax, zmin, zmax, offflag, nexus_bins);
374375

375376
if (Vars.Flag_OFF) {
376377
offdata.mantidflag = Vars.Flag_mantid;

mcstas-comps/monitors/Res_monitor.comp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ INITIALIZE %{
147147
if (radius)
148148
xwidth = 2*radius;
149149

150-
Monitor_nD_Init(&DEFS, &Vars, xwidth, yheight, zdepth, xmin, xmax, ymin, ymax, zmin, zmax, 0);
150+
Monitor_nD_Init(&DEFS, &Vars, xwidth, yheight, zdepth, xmin, xmax, ymin, ymax, zmin, zmax, 0, 0);
151151
Vars.Coord_Type[0] = DEFS.COORD_USERDOUBLE0; /* otherwise p is always the first variable */
152152

153153
if (Vars.Coord_Number != 11)

mcstas-comps/monitors/TOFRes_monitor.comp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ INITIALIZE %{
147147
if (radius)
148148
xwidth = 2*radius;
149149

150-
Monitor_nD_Init(&DEFS, &Vars, xwidth, yheight, zdepth, xmin, xmax, ymin, ymax, zmin, zmax, 0);
150+
Monitor_nD_Init(&DEFS, &Vars, xwidth, yheight, zdepth, xmin, xmax, ymin, ymax, zmin, zmax, 0, 0);
151151
Vars.Coord_Type[0] = DEFS.COORD_USERDOUBLE0; /* otherwise p is always the first variable */
152152

153153
if (Vars.Coord_Number != 11)

mcstas-comps/obsolete/Virtual_output.comp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ INITIALIZE
8585
else strcpy(Vars.option, "list all borders");
8686

8787
strcat(Vars.option,", x y z vx vy vz t sx sy sz");
88-
Monitor_nD_Init(&DEFS, &Vars, 0.1, 0.1, 0, 0,0,0,0,0,0,0); /* dims for mcdisplay */
88+
Monitor_nD_Init(&DEFS, &Vars, 0.1, 0.1, 0, 0,0,0,0,0,0,0,0); /* dims for mcdisplay */
8989
Vars.compcurpos = POS_A_CURRENT_COMP;
9090

9191
if (filename && strlen(filename) && strcmp(filename,"NULL") && strcmp(filename,"0"))

0 commit comments

Comments
 (0)