Skip to content

WHEN and GROUP interaction in 3.x #1807

@nicriz

Description

@nicriz

Hi @willend,

I am trying to rerun some old simulations with McStas 3.x and I have noticed a weird behavior when WHEN and GROUP are combined.
I have a simulation where a neutron hit the sample and there are monitors all around. If the neutron goes forward, it can interact with a slit, then the variable hithole is set to 1 and the neutron is recorded by the monitor at 0 deg in the GROUP detectors. Otherwise, if hithole=0 the other detectors of the group are tested.
I followed the guide in here and converted my DECLARE var hithole in USERVAR, but after missing the slit, the neutron is lost and the other detectors are not tested.

If I remove the condition from the first Monitor WHEN (hithole), the group seems to work fine.

McStas Version: 3.5.16 (clean from conda channel)
Linux version 4.18.0-553.5.1.el8_10.x86_64
Working file without WHEN: ND_Reflector.instr.txt
Not working file with WHEN: ND_Reflector_wHit.instr.txt

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions