Inter-component transformations
Kristian Nielsen
kristian.nielsen at risoe.dk
Thu Feb 4 14:41:10 CET 1999
> I tried to change the the compiler optimation,
> but there was no change in the results. I will run the simulation on
> another computer this weekend.
Don't bother, I found the problem. It turns out you ran into a nasty
"off-by-one" bug in the TOF_monitor component. Any neutrons with
time-of-flight beyond the upper detector limit would be placed in the
position just after the last array element of the detector output,
overwriting whatever value was there. Ouch.
To fix it, download a new version of the TOF_monitor from
http://neutron.risoe.dk/mcstas/support/philipp/TOF_monitor.comp
or to do the fix manually: change the line in TOF_monitor.comp (usually
found in "/usr/local/lib/mcstas/TOF_monitor.comp") that reads
if(i >= nchan) i = nchan;
to read
if(i >= nchan) i = nchan - 1;
I verified that this fixes the problem you saw. I will put this
information in the "known bugs" list on the web page on Monday.
It also seems to me that the TOF monitor in your instrument has a little
too few bins for the 2AA wavelength you ran in the example, but perhaps
that was intentional.
Thanks for your effort in finding this bug!
- Kristian.
More information about the mcstas-users
mailing list