I am currently simulating a gamma camera setup to optimize collimator designs for various isotopes. As part of this process, I aim to obtain a 2D spatial map of the energy deposited in the scintillator per event, filtered through a custom energy window. For example, when simulating Ga-68, I would like to generate two separate images: One with an energy window centered around ~93 keV, and the other with an energy window centered around ~185 keV. The scoring should reflect the total energy deposited in the scintillation crystal per event, rather than filtering based on the energy of the primary particle.
From my understanding, the DETECT card can achieve a similar goal but only scores over an entire region rather than producing spatially resolved data. I also considered using the EVENTBIN card; however, due to the high statistics required in my research, I am reluctant to rely on it. As an alternative, I am exploring whether it is feasible to apply this logic to a USRBIN card using a custom USERWEIG routine.
I would greatly appreciate your guidance on the best approach to achieve this in FLUKA. If there is a more efficient or recommended method, I would be grateful for your suggestions.
Based on other topics in this forum I would suggest you to rather use an mgdraw.f routine which you could customize to your problem. If you have a look at this post, the mgdraw routine is used to write out continuous and discrete energy depositions (variable DTRACK(MTRACK) described in the mgdraw documentation). You can adapt the routine to select only the photons (JTRACK=7) within the energy deposition windows you would like to impose. To make one further suggestion: it is probably the best to make a simple case where you then compare your mgdraw output with EVENTBIN results, just to make sure they produce the same thing as described here.
Dear @anwaets,
Thank you kindly for your reply.
If I understand correctly, both EVENTBIN and the mgdraw routine record to file event by event. So what is the main differences between the two approaches?
Additionally, how can one combine the results of multiple cycles to obtain statistical uncertainties? From the forum discussions I saw that such evaluation should not to be done, since the records are event by event (and not per primary).
To clarify, I want to simulate a scintillation camera under the condition that only if the total energy deposition in the camera per primary is within an energy window, the energy depositions are recorded. So I do aim for a primary-based normalization.
The difference between EVENTBIN and mgdraw.f is that EVENTBIN will already impose a scoring mesh (i.e., division of your scoring volume in cells) whereas mgdraw.f does not. However, the mgdraw.f routine allows you to distinguish between continuous and discrete energy depositions as mentioned above. It also allows you to record only the energy deposition events in the energy windows you want to look at.
For both methods, the merging of the results is the responsibility of the user. Each entry you record corresponds to the energy deposition caused by the primary particle and all of its secondaries. You will need to calculate the average and standard deviation of all the entries you record (using either EVENTBIN or mgdraw.f) to get an estimate of the value per primary and error.