Help with Generating Sum Spectrum Using DETECT Card vs. mgdraw.f

Versions

Please provide the used software versions.

FLUKA:4.5
Flair:3.4

Description

Dear FLUKA experts,

My aim is to generate a summed gamma spectrum by scoring event-by-event energy deposition. The system consists of two LaBr₃ detectors with a Na-22 source placed between them to detect as many gamma events as possible.

I have considered two approaches:

  1. Using the DETECT card, and

  2. Using the mgdraw.f user routine.

Since the second approach seems quite complex and I am struggling to implement it (if possible, please provide a suitable example of mgdraw.f for this purpose), I have currently used the DETECT card.

However, I noticed that the resulting energy spectrum looks quite different from the reference spectrum simulated using GEANT4. Could you please help me understand the possible reasons for this discrepancy?

Additionally, I would like to know how to simulate spectra with different gamma multiplicities in FLUKA.

Thank you for your time and guidance.

Input files

TAG(1).inp (1.8 KB)

TAG(1).flair (1.9 KB)

Hi Shad,

a few comments:

  1. The input and Flair files are not consistent. It looks like the .inp file is the one you actually intend to use.
  2. I cannot reproduce your figure using that input file – I only obtain a single line at 1.27 MeV.

More generally, you are doing event-by-event spectra. The DETECT card has coincidence/anticoincidence capabilities, but it does not measure total photon multiplicities. With your current setup, you are effectively sampling only a subset of events with photon multiplicity M ≥ 2: at least one photon must enter the trigger region, while the others enter the detector region where the deposited energy is scored.

If you want to perform more advanced operations (for example, accessing complete photon multiplicities or implementing more complex selection criteria), you can use the mgdraw.f user routine. There you have access to all the information on continuous and localized energy deposition. However, the corresponding implementation will be more involved.

Thank you Daniele for the reply.

But I don’t understand why my spectrum has more peaks and why does it have peaks different than the desired(like the reference spectrum). Please share the input you have used if any changes had made.

Thank you.

Hi Shad,

I slightly adjusted your input file. With the updated setup, I now measure three quantities:

  1. The pulse height on the left detector
  2. The pulse height on the left + right detectors
  3. The pulse height on the left detector, with the right detector in coincidence

Regarding the lines visible in the spectra:

  • Cases 1 and 3 show three lines: 511 keV, 1.27 MeV, and their sum. This corresponds to detecting one annihilation photon together with the characteristic gamma ray.
  • Case 2 shows essentially only the gamma line. Since the positron is not stopped in a source material, its kinetic energy is fully absorbed in the detectors, and the resulting broad energy distribution smears out the other peaks. As a result, the only clear feature that remains is the 1.27 MeV line.

In general, FLUKA cannot reproduce GEANT4 spectra in terms of photon multiplicity. To obtain something more similar, you should implement a realistic source volume where the positron annihilation and gamma production occur. Right now, decays are happening in vacuum and inside the detectors themselves, which removes some of the expected features.


TAG.flair (3.6 KB)

Hope this helps.

Thank you Daniele. Thank you very much. This one cleared a lot of confusion I had.

1)If I divide the detector volume into more number (instead of just left and right), lets say 4 detectors one side and 4 detectors other side. Can I use this trigger option to score multiplicities? why is it not possible.?

  1. And in the previous post, you mentioned :

Could you please explain this?

3)why mgdraw.f is a better option?

Hi Shan,

1) About splitting the detector into several regions and using the DETECT trigger to obtain multiplicities

You can use the trigger/anti-trigger mechanism to select events based on activity in another region, but DETECT cannot provide a true photon-multiplicity measurement.
DETECT only integrates the total energy deposited in its scoring region during one primary history. It does not track how many photons entered the region, how many separate interactions occurred, or which sub-volume was hit.

Even if you divide the detector into multiple volumes, each DETECT card still produces one energy value per region per event, and the trigger only acts as a yes/no gate.
You cannot reconstruct a distribution such as “M = 1, 2, 3 photons per event” from these quantities. At most, you can implement simple coincidence requirements (region A AND region B), but not a robust multiplicity spectrum across many detector elements.

2) About “implementing a realistic source volume”

For a 22Na source, the decay produces a positron which slows down in the source material, annihilates, and produces the two 511 keV photons (plus the 1.274 MeV gamma).
If the decay occurs in vacuum or directly inside the detector, the positron’s kinetic energy is deposited in the detector and the annihilation occurs too close to the crystal. This strongly alters the spectrum and smears the characteristic peaks.

A realistic setup should therefore include a small source volume (and optionally its capsule) located between the detectors. Decays should originate inside this volume so that the positron loses energy and annihilates in matter before the photons reach the detectors. This brings the simulation much closer to an experimental configuration and produces the expected spectral features (annihilation peaks).

3) Why a user routine such as mgdraw is better for this task

DETECT is convenient but limited. It gives you one accumulated energy value per region per event, with very restricted logic.
With mgdraw you have access to the full event history. This allows you to:

  • accumulate energy depositions per event exactly as you want,
  • distinguish contributions in different detector sub-volumes,
  • implement your own coincidence and multiplicity criteria,
  • build sums such as E_left + E_righ​ for coincident events,
  • output one line per event with all relevant information.

This is not an easy task by any mean. You can find more material in this presentation: https://indico.cern.ch/event/1200922/contributions/5411856/attachments/2662688/4613294/10_MGDRAW_routine_2023_Advanced_ANL.pdf

1 Like

Thank you very much Daniele,

I used mgdraw and I could simulate sum spectra with multiplicity conditions. Your explanations were very helpful.