I currently have a simulation wherein I am interested in counting activation products— a certain range of isotopes in a particular region. Currently, I am able to use mgdraw.f to count neutrons in that region and relate those neutrons to their respective primary (muon). However, I’d like to have a better mode of analysis that could be something like:
For each activation event I score, I save the activation product and I save the associated primary to a file.
It would also be interesting to get the immediate parent of the activated isotope.
Is this possible? If so, how might it be accomplished?
Hello Regan, thank you for your question. I am going to look into it and get back to you shortly.
To clarify, your objective is to save in a file the reaction (activation) products, the primary that initiated the event, and the parent of the product?
If you provide me with your input and mgdraw file, I can try to run it myself and make appropriate modifications (or point to a different solution, if I find one)
Thank you! I apologize for the delay in my response— I only just saw your post. I’ll attach the files here.
The current mgdraw.f file counts neutrons and prints their attributes as well as their parent’s.
The current input file does not have a source— the source is parameterized externally, so you might consider just adding a muon beam into the detector or some such thing. Let me know if you notice any errors as well!
Sorry for the long delay, here is what I found that could be of help.
(1) It appears you have a geometry error in your input, specifically, your ic_con and ocryo region overlap. I suggest fixing that before moving on.
(2) Coming to the main question, here is a way you can get the result you want. The best way to achieve the result you want could go along these lines:
(2A) in your source.f routine, write out (either to .log or to both the .70 and .72 units you already have, depending on how much you care about memory vs post-processing) any property of the nucleus you care about and have sampled.
(2B) there is a user routine that does exactly what you are looking for called USRRNC (link to documentation). You activate this card in your input using USERWEIG and WHAT(5) = 1; in Flair this is achieved by setting the Resnuclei option of the USERWEIGHT card to USRRNC.
(2C) create a new usrrnc.f file just like you did for the mgdraw.f (blank template available in src/user ). In this routine you have access to many variables relating to the isotope produced in your simulation, including mass, charge, isomer state, position, and region number. Using this last variable you can set your region logic to decide whether to print to 70 and 72, and you can print any properties you care about there.
(2D) you can then link the usrrnc.f to your executable and when you run the simulation you will be able to associate primary muons with residual nuclei in your experiment.
I did happen upon a useful post here wherein they deploy usrrnc.f as well. I was not sure how to implement it and which variables from the particle stack I ought to be probing. Thanks as well for catch the geometry error!