Skip to content

X: McXtrace: Mirror_curved - follow-up after #3137 - #3151

Merged
willend merged 4 commits into
mainfrom
2026-11-farhi-mirror-curved-2
Nov 21, 2026
Merged

willend merged 4 commits into
mainfrom
2026-11-farhi-mirror-curved-2

Conversation

@farhi

@farhi farhi commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

X: McXtrace: Mirror_curved - follow-up after #3137

This is a follow-up after #3137.

Fixes:

  1. MAXII_811 exits when run with defaults: Fixed
  2. A fprintf argument is missing in Test_KB , MAXII_811 and JJ_SAXS. Fixed
  3. mctest won't pick up the new Test_KB line. Fixed
  4. Possible hit on the back side (not verified). Won't fix/ this is certainly an error in the model. Such a small radius is un-physical.
  5. Instruments not in this PR that change behaviour. The mctest run passes all without error. The curved mirrors are using length and width, which put the mirror in a compatible orientation.
  6. Suggestion: small doc touch-ups. Done.
  7. Suggestion: optional tidy-ups. Done.

Suggestion: one quadric instead of four branches Not done, as this would again change things. Perhaps in a future PR 😄

On the PR size
The change of the Mirror_curved did trigger other updates, which were unavoidable - and thus attached to #3137:

  • MAXII_811 DCM was non-functional, and let the beam pass through, just as the curved mirrors in the KB. The alignment of the beam had to be fixed. In the past model, the non reflected beam would go through (after DCM and mirrors), causing a much higher flux indeed (white - direct). This was clearly an error.
  • JJ_SAXS was completely broken and unusable. This model with the curved mirror could not be used for testing. It had to be fixed, or removed. It was written in the header to be a "sketchy" model, indeed, but not a SAXS for sure.
  • Test_KB required to demonstrate the focusing, for a thorough validation.
  • SOLEIL_PUMA had a broken KB arrangement, that appeared after mirror upgrade.

I have run the mctest, and all is fine. The mcdoc for component reports OK.


Declaration of use of AI-tools

  • Please add a checkmark here if you used AI-tools during the work for this contribution NO
  • Further, please describe how / where and for what the tools were used:

Development OS / boundary conditions

Please describe what OS you developed and tested your additions on, and if any special dependencies are required:

  • debian/arm64
  • McXtrace 3.10.2

PR Checklist for contributing to McStas/McXtrace

For a coherent and useful contribution to McStas/McXtrace, please fill in relevant parts of the checklist:

  • My contribution includes patches to an existing component file

    • I have used the mcdoc utility and rendered a reasonable documentation page for the component (please attach as screenshot in comments!)
    • I have ensured that basic use of the component is OK (e.g. an instrument using it compiles?)
    • I have used the mctest utility to test one or more instruments making use of the component (please attach mcviewtest report as screenshot in comments)
    • I have used the mccode-clangformat tool to apply the standard McCode component indentation scheme
    • I have used the mcrun --c-lint "linter" and followed advice to remove most / all warnings that are raised
  • My contribution includes patches to an existing instrument file

    • I have used the mcdoc utility and rendered a reasonable documentation page for the instrument (please attach as screenshot in comments!)
    • I have used the mctest utility to test the instrument (please attach mcviewtest report as screenshot in comments)
    • I have used the mcrun --c-lint "linter" and followed advice to remove most / all warnings that are raised

@farhi farhi mentioned this pull request Nov 20, 2026
5 of 32 tasks
@farhi

farhi commented Nov 20, 2026

Copy link
Copy Markdown
Contributor Author

debian/arm64 test

mxtest --comp Mirror_curved --noplots --mpi auto
loading system configuration
Output of test will be placed in: .
ncount is: 1e6
mpi count is: auto
No plots of the test output will be generated
Testing: 3.10.3-0

Finding instruments in: /usr/share/mcxtrace/resources/examples
(Instrument list includes those using component(s) Mirror_curved )
Copying instruments to: ./mcxtrace-3.10.3-0_mpi_x_auto_Mirror_curved_1e6_Linux_20261120_2235_16

Compiling instruments [seconds]...
MAXII_711                :   3.69
MAXII_811                :   5.09
MAXIV_Bloch              :   5.04
MAXIV_FemtoMAX           :   4.70
NECSA_Brucker_D8_Advance :   3.37
JJ_SAXS                  :   2.45
SOLEIL_CASSIOPEE         :   4.01
SOLEIL_CRISTAL           :   4.89
SOLEIL_DIFFABS           :   4.92
SOLEIL_DISCO             :   5.50
SOLEIL_GALAXIES          :   5.87
SOLEIL_MARS              :   5.21
SOLEIL_NANOSCOPIUM       :   3.39
SOLEIL_PUMA              :   3.71
SOLEIL_PX1               :   4.91
SOLEIL_PX2a              :   4.94
SOLEIL_ROCK              :   5.26
SOLEIL_SIXS              :   5.02
SOLEIL_SWING             :   4.75
Test_KB                  :   2.58
Test_Mirrors             :   3.29
XFEL_SPB                 :   5.10

Running tests / getting status...
MAXII_711                 :   Display OK (0s)
MAXII_711                 :   1.11    [val: 5.24748e-06 / 5.1609e-06 = 102 %]
MAXII_811                 :   Display OK (0s)
MAXII_811                 :   7.75    [val: 5130440.0 / 5130440.0 = 100 %]
MAXII_811_2               :   1.43    [val: 207812000000.0 / 226610000000.0 = 92 %]
MAXIV_Bloch               :   Display OK (0s)
MAXIV_Bloch               :   2.17    [val: 5.75412e-20 / 5.64942e-20 = 102 %]
MAXIV_Bloch_2             :   2.27    [val: 4.42682e-21 / 4.42682e-21 = 100 %]
MAXIV_FemtoMAX            :   Display OK (0s)
MAXIV_FemtoMAX            :   1.37    [val: 6.32396e-15 / 6.32396e-15 = 100 %]
NECSA_Brucker_D8_Advance  :   Display OK (0s)
NECSA_Brucker_D8_Advance  :   NO TEST
JJ_SAXS                   :   Display OK (0s)
JJ_SAXS                   :   0.61    [val: 3.38898e-05 / 3.39862e-05 = 100 %]
SOLEIL_CASSIOPEE          :   Display OK (0s)
SOLEIL_CASSIOPEE          :   1.95    [val: 2742720000000000.0 / 2743090000000000.0 = 100 %]
SOLEIL_CRISTAL            :   Display OK (0s)
SOLEIL_CRISTAL            :  23.88    [val: 345211.0 / 347217.0 = 99 %]
SOLEIL_DIFFABS            :   Display OK (0s)
SOLEIL_DIFFABS            :   NO TEST
SOLEIL_DISCO              :   Display OK (1s)
SOLEIL_DISCO              :   1.67    [val: 1.10214e+16 / 1.104e+16 = 100 %]
SOLEIL_DISCO_2            :  53.47    [scan: 21/21 points within 20%, worst 99 %, 21/21 points run]
SOLEIL_GALAXIES           :   Display OK (0s)
SOLEIL_GALAXIES           :   3.34    [val: 1.15323e+19 / 1.1407e+19 = 101 %]
SOLEIL_MARS               :   Display OK (0s)
SOLEIL_MARS               :   5.35    [val: 56123700.0 / 56123700.0 = 100 %]
SOLEIL_NANOSCOPIUM        :   Display OK (0s)
SOLEIL_NANOSCOPIUM        :  14.95    [val: 96469100000.0 / 98902000000.0 = 98 %]
SOLEIL_PUMA               :   Display OK (0s)
SOLEIL_PUMA               :   4.27    [val: 128326000000.0 / 125503000000.0 = 102 %]
SOLEIL_PX1                :   Display OK (1s)
SOLEIL_PX1                :  24.24    [val: 1.87445e+21 / 1.8992e+21 = 99 %]
SOLEIL_PX2a               :   Display OK (1s)
SOLEIL_PX2a               :  17.27    [val: 3.3197e+20 / 3.7789e+20 = 88 %]
SOLEIL_ROCK               :   Display OK (1s)
SOLEIL_ROCK               :   6.92    [val: 8300000000.0 / 8200000000.0 = 101 %]
SOLEIL_SAMBA              :   Display FAILED (0s)
SOLEIL_SAMBA              :   5.20    [val: 3120020000000.0 / 3463700000000.0 = 90 %]
SOLEIL_SIRIUS             :   Display FAILED (0s)
SOLEIL_SIRIUS             :   5.47    [val: 1370670000000.0 / 1390500000000.0 = 99 %]
SOLEIL_SIXS               :   Display OK (2s)
SOLEIL_SIXS               :   NO TEST
SOLEIL_SWING              :   Display OK (8s)
SOLEIL_SWING              :  17.95    [val: 1500680000000.0 / 1539300000000.0 = 97 %]
Test_KB                   :   Display OK (0s)
Test_KB                   :   NO TEST
Test_Mirrors              :   Display OK (0s)
Test_Mirrors              :   0.70    [val: 1.98944e-08 / 2e-08 = 99 %]
Test_Mirrors_2            :   0.71    [val: 1.98944e-08 / 2e-08 = 99 %]
Test_Mirrors_3            :   0.68    [val: 1.98944e-08 / 2e-08 = 99 %]
Test_Mirrors_4            :   0.72    [val: 1.98944e-08 / 2e-08 = 99 %]
Test_Mirrors_5            :   0.75    [val: 1.98944e-08 / 2e-08 = 99 %]
Test_Mirrors_6            :   0.72    [val: 1.98944e-08 / 2e-08 = 99 %]
Test_Mirrors_7            :   0.72    [val: 1.98944e-08 / 2e-08 = 99 %]
Test_Mirrors_8            :   0.86    [val: 1.94367e-08 / 2e-08 = 97 %]
Test_Mirrors_9            :   0.87    [val: 1.98944e-08 / 2e-08 = 99 %]
Test_Mirrors_10           :   0.86    [val: 1.98944e-08 / 2e-08 = 99 %]
Test_Mirrors_11           :   0.83    [val: 1.94332e-08 / 2e-08 = 97 %]
Test_Mirrors_12           :   0.87    [val: 1.98944e-08 / 2e-08 = 99 %]
Test_Mirrors_13           :   0.83    [val: 1.98591e-08 / 2e-08 = 99 %]
Test_Mirrors_14           :   0.73    [val: 1.9453e-08 / 2e-08 = 97 %]
Test_Mirrors_15           :   0.76    [val: 1.98944e-08 / 2e-08 = 99 %]
Test_Mirrors_16           :   0.78    [val: 1.98944e-08 / 2e-08 = 99 %]
Test_Mirrors_17           :   0.77    [val: 1.94493e-08 / 2e-08 = 97 %]
Test_Mirrors_18           :   0.72    [val: 1.98944e-08 / 2e-08 = 99 %]
Test_Mirrors_19           :   0.71    [val: 1.98604e-08 / 2e-08 = 99 %]
XFEL_SPB                  :   Display OK (0s)
XFEL_SPB                  :   1.38    [val: 0.000965151 / 0.00099303 = 97 %]
======================================
Compilation time: 0:02:04
Simulation time: 0:03:39
Total runtime: 0:05:44
Overall test result:
SUCCESS

@farhi

farhi commented Nov 20, 2026

Copy link
Copy Markdown
Contributor Author

All is fine to me...

@willend
willend merged commit 2d6d990 into main Nov 21, 2026
31 of 32 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