MGDRAW file combining USRDRAW and BXDRAW

Dear Jordi,

the SAVE statement is used at variable declaration not when the value is assigned. (See variable LFCOPE)

However there are some algorithmic problems with your code:

  • Once bdxcode is set to 19, it will remain 19 and the test in the USDRAW entry becomes meaningless.

  • The USDRAW entry is called when an interaction is happening (in region MREG, at the position XSCO, YSCO, ZSCO), it is not related at all to boundary crossings.

  • Also there is no guarantee that the interaction scored with USDRAW and the muon which crossed the region are related at all.

If I understood you correctly you want to dump all secondaries created by muons, which previously crossed a region boundary. If this is true, you may use the LLOUSE, ISPUSR, or SPAUSR user variables in the trackr.inc common to mark the muons passing the boundary in BXDRAW, and use this information to filter the secondaries generated in USDRAW.

See: 13.2.21} stupre.f: SeT User PRoperties for EMF particles | FLUKA and Information about particle ancestors - #2 by a.lechner

Cheers,
David