Entire information for isotopes

Dear professors,
Following the discussion in Spallation isotope decays and How to explain the discrepancy between RESNUCLEi and User Routine, I am still not clear how to record all the relative information when involved with isotopes. In the first thread above, I find the IZ and IA in usrrnc.f coincide with ICRES and IBRES respectively, which gives no more information. In the second thread, the problems will occur when the reaction type is not limited to 101(inelastic scattering) because 110(radiative decay), 102(particle decay) and 300(low-energy neutron capture) will also produce new isotopes.
I want to make myself clearer this time. Let’s say I’m interested in all isotopes recorded in usrrnc.f, is there any ways to complement the reaction information like the reaction type or other productions along with this isotope? I’ve tried in mgdraw.f in previous thread and failed because I find there’s no one to one correspondence. It is usually the case that a isotope is recorded in usrrnc,f, but no counterpart in mgdraw.f no matter I used any of the following selections: ABS(KPART(IP))>10000, ICRES and IBRES, IARDPR(IP) and IZRDPR(IP). I have also tried to include “genstk.inc” in usrrnc.f, hoping to record other productions but it turns out that usrrnc.f simply ignores this instruction. So I’m really wondering if it’s possible to reach my purpose.
Thank you for your help!
mgdraw.f (8.4 KB)
newsource.f (7.3 KB)
Te-LS.inp (3.4 KB)
usrrnc.f (1.6 KB)
muon.txt (166.4 KB)
Best regards,
Hechong Han

Dear @hanhechong,

as discussed in the previous thread, I think a combination of mgdraw and usrrnc would do the job.
I tried to isolate the problem (and limit the output to the necessary) and work out a possible solution for you: you can adapt it according to your needs and integrate the parts of the code with what you already have.

With mgdraw I write out the reaction code and the possible residuals generated (IBRES and ICRES or looping NPHEAV): this information is matched by usrrnc as you have already established. The same is done for radioactive decay (ICODE 110) only that I also print out the decay secondaries sampled by FLUKA.

As a result, in the output you will have lines such as:

MGDRAW
Reaction with ICODE 101 in region   6
Primary history:              88
JTRACK, LTRACK:               8              2
Generated     2 particles of ID:   8  8
Generated     0 fragments with 
     A = 
     Z = 
Generated a residual with A =  11 , Z =   6
USRRNC
Scored residual in region   6 with A =  11 Z =   6 IS =   0

MGDRAW
Reaction with ICODE 110 (radioactive decay products) in region   6
Primary history:              88
Decay of nucleus with A =  11 , Z =   6
Decay products: 
  4    
  5    
USRRNC
Scored residual in region   6 with A =  11 Z =   5 IS =   0

Hopefully this solution will be helpful.

Best,
Davide

mgdraw.f (12.3 KB)
Te-LS.flair (2.3 KB)
usrrnc.f (1.5 KB)

Dear @dbozzato ,
I really appreciate your patient explanation and thank you very much! The examples you showed are indeed consistent and I have checked that after our first discussion. I apologize for not demonstrating the exact problems which occur either when there is an isomer, or there is a continuous decay. I have uploaded a previous result. The code are not exact what you gave me but it is almost the same. Please take a look at event 2484 with the following lines in usrrnc.log.

129 52 1 -4.354E+01 -7.924E+02 1.453E+03 1.041E-05
129 52 0 -4.354E+01 -7.924E+02 1.453E+03 1.041E-05
129 53 0 -4.354E+01 -7.924E+02 1.453E+03 1.041E-05
129 54 0 -4.354E+01 -7.924E+02 1.453E+03 1.041E-05

Both scenarios mentioned appear and the mgdraw.log act as this,

nuclei 52 129 0
type 300
location -4.354E+01 -7.924E+02 1.453E+03
parent 8

and

nuclei 52 129 0
type 110
location -4.354E+01 -7.924E+02 1.453E+03

Obviously the isomer 52 129 1 and the second decay of 53 129 0 are missing. In addition, the real process seems to first generate an isomer 52 129 1 and the it deexcite to 52 129 0 which then continuously decays. (I am not sure I interpret it correctly). But the parent of 52 129 0 is 8 according to mgdraw, which I think is actually the parent of 52 129 1.
Honestly to say, I have never encountered an isomer in mgdraw.f even if I always involve the corresponding codes. However the information of isomer production and reaction is significant to my study. So I am really looking forward to your reply and thank you for your help!
Best regard,
Hechong Han
Te-LS001_mgdraw.log (3.1 MB)
Te-LS001_usrrnc.log (2.0 MB)

Dear @hanhechong,
I will have a look into this. Can you please upload the updated simulation files (input, flair project, routines)?
Many thanks,
Davide

Dear @dbozzato ,
Thank you! I have uploaded the relative files. The initials are only ten thousand muons limited by the upload size but it should work.
Best regard
Hechong Han
mdstck.f (3.4 KB)
mgdraw.f (8.7 KB)
newsource.f (7.3 KB)
usrrnc.f (1.4 KB)
muon.txt (832.1 KB)
Te-LS.inp (3.4 KB)

Dear @hanhechong,

I had a look at your problem but I am afraid I cannot help you much further. You may already have found some workarounds or answers in another post.
What I can say is that what you refer to as “parent” is the particle undergoing the reaction that produces the isotope (JTRACK variable in mgdraw), and with no surprise is a neutron in the particular case you mentioned.
As far as the isomers is concerned, you correctly have activated in RADDECAY the patch for isomer production to see the isomers generated. What it means in practice is that, at present, FLUKA roughly assumes a 50-50 branching between ground and isomer state and, as you already found out, you will catch the isomers in usrrnc.

Best,
Davide

Dear @dbozzato
Thank you all the same!
Best regards,
Hechong Han