Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

McStas: Fix #1732: Single_crystal powder mode was broken by #1521 #1738

Merged
merged 1 commit into from
Oct 11, 2024

Conversation

farhi
Copy link
Contributor

@farhi farhi commented Oct 11, 2024

All is in the title.
The bug seen for #1521 is not really a bug.
There are two propagation steps in the process:

  1. propagate to the sample surface
  2. rotate the crystal (powder mode)
  3. scatter
  4. propagate in the "rotated" crystallite (as it takes place in reality)
  5. put back the crystal in its initial state

What was seen in the issue #1521 is that the final propagation assume there is enough matter in the crystallite to actually still propagate in the sample volume. In some cases indeed, this propagation can get the neutron outside the sample volume after de-rotating.

A better fix to #1521 would perhaps be to check after exiting the crystal, and potentially propagate back onto the surface. using the final velocity and position.
For the time being, I consider it is better to get a few neutrons outside the volume, than not having a powder mode ;-)

@willend
Copy link
Contributor

willend commented Oct 11, 2024

Hi @farhi,

I ran a few hand-held tests with the comp and instr from the PR and some other key SX-oriented instruments. - Looks OK
https://new-nightly.mcstas.org/mcstas-SX-test/mcstas-test_output.html

Merge

@willend willend merged commit bbf7e8b into McStasMcXtrace:main Oct 11, 2024
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants