McCode
McCode copied to clipboard
Suppress plotting of list mode data
There is often very little physical meaning in plots of "event data" from Monitor_nD, it also happens very often that the data become very big and hence take long time to load.
I therefore propose to avoid writing a data-section to mccode.sim in such cases, simply by adding an if-statement to the detector_out_2d() function:
/* If this is list mode we suppress the mccode.sim entry*/
if (!strcasestr(detector.format, "list")) {
/* Write data set information to simulation description file. */
siminfo_out("\nbegin data\n"); // detector.filename
mcdatainfo_out(" ", siminfo_file, detector);
siminfo_out("end data\n");
}
Implemented this way, output to Mantid/NeXus is unaffected and we avoid plotting in the ASCII case.
An exception where this solution seems not to work perfectly is when
options="multiple list ..."
- entrypoint to the plotting logic apparently lives elsewhere...
The other solution is to detect the 'list' type in the header/metadata, and not plot it. Removing all the metadata from the generated file brings a raw list of numbers which are not anymore self explanatory.
The solution proposed does in fact not suppress all metadata, it simply removes the corresponding Data section in mccode.sim. The actual event file remains including all content.
Related to #292 and #1150