Gaussian broadening is not working

Thank you @horvathd for the explanation. In my simulation, I am not able to get the gaussian broadening even after using the code sent by you. May be I am doing something wrong. My BaF2 detector is having a resolution of 160 keV. I am sending you the input file and the code made by you with the values of “a” changed. detect.inp (2.2 KB) usreou.f (2.3 KB)

Hi, @horvathd, I find this problem too. Thanks for your explanation, I wrongly thought that I got the full-energy-peak spectrum successfully half a month ago. In my simulation, the usreou.f can be compiled successfully. But the results don’t have any change, whether I compile the usreou.f or not.
the first picture(which don’t use gaussian broadening) as follow:


the second picture(which use gaussian broadening) as follow:

Dear Sujoy and Qinqing,

thank you very much for reporting this.

It turns out that setting the scoring region of the dummy DETECT card to a BLCKHOLE region is not enough. The energies deposited in the that region interferes with the user routine applying the Gaussian broadening.

To make it work, no particle should ever reach the dummy scoring region. The simplest would be to add a second outer BLCKHOLE region surrounding the whole geometry, and use that for scoring.

Cheers,
David


Thanks @horvathd, now it is working nicely. Adding the second Blackhole region, as suggested by you solved the problem.


Dear Horvathd,
Thanks for your reply ! I made some mistakes but I didn’t know where the mistakes places, and I find the topic has been closed.This is the example and I make a slight modification.detect.inp (2.3 KB) . I can’t get correct spectrum by simulating this input file. Can you help me check the input file and give me some suggestions?
Thanks in advance

Dear Qinqing,

the input file you attached works for me without any problem. Please make sure that the executable with the user routine compiles successfully on the Compile tab, and it is selected on the Run tab as well.

Cheers,
David

Dear David @horvathd ,

I also tried to run the input as posted by Dr. Sujoy, after modifying it (i.e. adding an extra black body region). I got the similar pattern (as posted by Dr. Sujoy) after plotting the output of detect card. I have two quires regarding that.

  1. Why is there a peak in the lower energy part (please see the marked portion of the attached image)?

  2. I guess the Gaussian broadening part is an extra mathematical step to readjust the distribution of spectrum counts (for example if we use the detect card only without using the userou.f.). Then why do we need the extra blackbody region in the present case ? In other words, if we simply want to generate counts (pulse height spectra) , do we have to add this dummy detect card also? or this requirement is valid for only when we intend to get Gaussian broadened spectra ?

I am attaching the inputs, output and the plot for your convenience.

usreou.f (2.3 KB) detect_17_tab.lis (90.2 KB) detect.inp (2.3 KB)

Thanks and regards,
Riya

Dear horvathd,
When I compile usreou.f, the name of executable I save can be any string except usreou.o and it will generate two executable files, such as usreou1.o and usreou.o(in the run interface, usreou1.o can be used and usreou.o can’t be used ). When I build usreou.f and save as usreou.o, then I click run tab, the status will remind that:finished with errors. But my colleague told me that, the name must be save as usreou.o. I am a little confused about this.

Dear Horvathd,
Thank you very much!

Dear Riya,

  1. For an isotope source FLUKA simulates not only the gammas from the specified isotopes, but the electrons as well. (Plus the decay of the daughter elements too, if the are not stable.) Co-60 beta decays producing a 0.31 MeV (99.88%) or a 1.48 MeV (0.12%) electron. The gammas are produced by the daughter Ni-60 to reach ground state.

    In your plot you see these electros dominating the lower energy range. They reach the detector due to the scattering in air. If you change the AIR material to VACUUM, that peak disappears.

  2. The need of the dummy card comes from the internal works of FLUKA. As far as I understand the energy deposited in a event is not recorded until there is a new energy deposition in the detector. In case between the original energy deposition and the next one there are events without energy deposition, then the Gaussian broadening would be applied to the original deposition multiple times.

    Using the dummy card we can store the information whether we applied the broadening already or not. But if energy is deposited in the region of the dummy card, this information is lost. That’s why we must be sure no energy is deposited there, thus a region covered by BLCKHOLE material must be used.

    If you are using the DETECT card without using the usreou.f user routine to apply the Gaussian broadening, then there is no need for the dummy card.

I hope I explained it clearly enough for you.

Cheers,
David

1 Like

Dear Qinqing,

Based on your post I assume you managed to get the Gaussian broadening working in your simulation.

On minor comment:

You don’t need to use the user routine’s name as the executable. The .o file is a compiled object file containing only the user routine, which is linked to the FLUKA library to create the executable you can use.

My suggestion would be to use an executable name like: myfluka or myfluka.exe. Or, you can use a name related to the input file’s or the project’s name.

Cheers,
David

Thank you David @horvathd, for the nice and elaborate explanation. It is clear to me now.

Regards,
Riya

Dear All,

I updated the user routine for Gaussian broadening. It still requires the dummy DETECT card, but there is no need the second BLCKHOLE region any more, any region should work.

usreou.f (2.4 KB)

Cheers,
David

Hi David @horvathd,

I downloaded your recent userou.f and gave a run with the previous input. I deactivated the second blackbody region since it is not necessary now. But while plotting the output, I am unable to get the the gaussian broadening. Can you please verify that ?

detect.inp (2.4 KB)
usreou.f (2.4 KB)

Thanks and regards,
Riya

Dear Riya,

your input and user routine worked without any problem for me.

Did you recompile the executable after you replaced the user routine?

Cheers,
David

Thank you David @horvathd,

yes, it is working. Thank you for the modified source file. I made a mistake while copying data since these PH and PH1 outputs are printed on same file. Is there any way we can save them in different .tab.lis file ? Like we can do for other type of scoring where we can manually choose the unit number.

Regards,
Riya

Dear Riya,

unfortunately there is not option to change the output file or separate the results of the DETECT scorings.

Cheers,
David

1 Like

Thank you David @horvathd.

Regards,
Riya

Dear Horvathd,
Thank you very much.Your reply helped me a lot!