mantidproject / mantid

Main repository for Mantid code
https://www.mantidproject.org
GNU General Public License v3.0
210 stars 120 forks source link

Make DiscusMultipleScatteringCorrection work with hollow\concave shapes #32789

Open DannyHindson opened 2 years ago

DannyHindson commented 2 years ago

The Monte Carlo simulation performed by DiscusMultipleScatteringCorrection doesn't work properly if the sample shape is either concave or hollow. The logic in DiscusMultipleScatteringCorrection::updateWeightAndPosition and DiscusMultipleScatteringCorrection::inc_xyz assumes there's only a single track segment inside the sample

This could be fixed by setting dl using Track::totalDistInsideObject instead of track.front().distInsideObject and then when incrementing the current position, the code could subtract off the track segment lengths until the current segment length is greater than dl

RichardWaiteSTFC commented 6 months ago

@warunawickramasingha and I think this already works actually with the current track generation - but we want to make a plot/simulation to show this and add to the documentation.