Dear Fluka Team,
I am trying to flag secondary particles based on a specific logic. My objective is for the flag to be TRUE when a secondary particle is the same type as the particle that initiated the collision.
From various forum discussions, I gathered that STUPRE/STUPRF, MDSTCK, and MGDRAW>USRDRAW could be utilized for this purpose. However, I’ve faced challenges in implementing this, primarily due to uncertainty about the correct parameters to employ (e.g., from EMFTSK or GENTSK or …).
Below are the details of my attempts:
- STUPRE:
- Encountered an issue with the values stored in KPART(NPNW - NPSTRT + 1) or KPART(NPNW) that does not return the correct particle. I guess I do not consider the correct stack here.
DO 500 NPNW = NPSTRT,NPEMF
DO 51 ISPR = 1, MKBMX1
ESPARK (ISPR,NPNW) = SPAUSR (ISPR)
51 CONTINUE
DO 52 ISPR = 1, MKBMX2
IESPAK (ISPR,NPNW) = ISPUSR (ISPR)
52 CONTINUE
IP = NPNW - NPSTRT + 1
NP = NPEMF - NPSTRT + 1
WRITE(99,*) 'STUPRE ',REACTION,NP,JTRACK,KPART(IP)
& ,TKI(IP),WEI(IP)
IF ( JTRACK .NE. KPART(IP)) THEN
LOUEMF (NPNW) = TRUE
ELSE
LOUEMF (NPNW) = FALSE
ENDIF
500 CONTINUE
- MDSTCK:
- Encountered a similar problem when accessing KPART(NPSECN).
DO IP=1, NPSECN !* SPECN is linked to genstk
WRITE(99,*) 'MDSTCK ',REACTION,NPSECN,JTRACK,KPART(IP)
& ,TKI(IP),WEI(IP)
IF ( JTRACK .NE. KPART(IP)) THEN
LOUEMF (IP) = TRUE
ELSE
LOUEMF (IP) = FALSE
ENDIF
END DO
- MGDRAW:
- While I seem to capture the right secondary, accessing its flag is problematic.
- LOUEMF might not be the right choice as MGDRAW is invoked post-STUPRE. LLOUSE doesn’t seem effective either.
DO IP=1, NP
WRITE(99,*) 'MGDRAW ',REACTION,NP,JTRACK,KPART(IP)
& ,TKI(IP),WEI(IP)
IF ( JTRACK .NE. KPART(IP)) THEN
* LLOUSE(IP) = TRUE
ELSE
* LLOUSE(IP) = FALSE
ENDIF
END DO
In comparing the WRITE function outputs across these routines, I found consistent results for Moller and Bremstrahlung interactions. However, discrepancies arose for other interactions. Interestingly, MGDRAW appears to yield correct results in such cases.
> ROUTINE INTERA NSEC JTRACK JSEC KINE
> MGDRAW Moller 2 3 3 2.3284173093807126E-005
> MGDRAW Moller 2 3 3 1.9751929487762943E-006
> STUPRE Moller 2 3 3 2.3284173093807126E-005
> STUPRE Moller 2 3 3 1.9751929487762943E-006
> MDSTCK Moller 2 3 3 2.3284173093807126E-005
> MDSTCK Moller 2 3 3 1.9751929487762943E-006
>
> STUPRE PhotoElectric 2 7 3 2.3284173093807126E-005
> STUPRE PhotoElectric 2 7 3 1.9751929487762943E-006
> MDSTCK PhotoElectric 2 7 3 2.3284173093807126E-005
> MDSTCK PhotoElectric 2 7 3 1.9751929487762943E-006
> MGDRAW PhotoElectric 2 7 3 1.2797920875950585E-004
> MGDRAW PhotoElectric 2 7 3 1.5254000000000786E-006
>
> STUPRE Rayleigh 1 7 3 1.9361811555252762E-006
> MDSTCK Rayleigh 1 7 3 1.9361811555252762E-006
> MGDRAW Rayleigh 1 7 7 6.6306973014815596E-005
I would greatly appreciate your help about this and advices to flag the secondary as a function of its type compared to the initial particle.
In addition, I do not know which of those routines is the most suitable for my purpose and maybe you could guide me about it.
Thanks for your help.
Best regards.