[mcstas-users] McStasScript and COPY and EXTEND keywords

Петр Коник 104pet104 at gmail.com
Tue Apr 15 10:28:44 CEST 2025


Dear colleagues,

I’m writing to report probably undesired behavior of McStasScript we discovered together with Chuyi Huang from JCNS.

In McStas if I make a COPY of a component, which also used EXTEND block, this additional code is not copied as well. I believe this is the correct approach since it allows e.g. to put different SCATTERED flags on each of the copied components separately, which comes handy.

However when McStasScript generates an instrument based on the same code, it will copy EXTEND block as well. In more complex situations where WHEN conditions are used this could lead to unexpected behavior. 

Please find attached two files. Compare lines 255-286 in the native one and lines 268-307 in the generated one.

Best regards,
Peter Konik


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman2.mcstas.org/pipermail/mcstas-users/attachments/20250415/275aeae6/attachment-0003.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: SPHERES_generated_mcstasscript.instr
Type: application/octet-stream
Size: 13443 bytes
Desc: not available
URL: <http://mailman2.mcstas.org/pipermail/mcstas-users/attachments/20250415/275aeae6/attachment-0002.obj>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman2.mcstas.org/pipermail/mcstas-users/attachments/20250415/275aeae6/attachment-0004.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: SPHERES_native_mcstas.instr
Type: application/octet-stream
Size: 16423 bytes
Desc: not available
URL: <http://mailman2.mcstas.org/pipermail/mcstas-users/attachments/20250415/275aeae6/attachment-0003.obj>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman2.mcstas.org/pipermail/mcstas-users/attachments/20250415/275aeae6/attachment-0005.htm>


More information about the mcstas-users mailing list