Calculating detector efficiency using DETECT card

Dear FLUKA expert,
I am trying to calculate the efficiency of a gas-filled detector using the DETECT card.
The beam is a cold neutron beam(E=3.7 meV).
The detector consists of a 10B layer followed by Ar-CO2 gas.
I am interested in the deposited energy from 4He and 7Li. I studied the post about comscw.f at

My questions are:
1- How can I define 7Li correctly in the comscw.f and in the input file?
2-When I run the input file, the results of the two DETECT cards are the same which means the comscw.f is not activated. How can I activate this logic?

Here are the files.
Any comment is appreciated.

GEM.inp (2.2 KB)

comscw.f (5.4 KB)

Dear @mahdi,

Did you compile the .f file and select it in the run tab? I am asking because when I run your input I can see the difference between the two spectra (see the attached file).

Dear @Mihaela_Parvu,
It was exactly what I did not do. Thank you for your comment. It worked while there is some difference between my results and your plot.

However, I am still not sure:
1- if I defined the 7Li correctly in the files.
2- What is the final unit of these DETECT cards? Because my primary beam is a neutron and now the 4He and 7Li are scored.

3-In other Monte Carlo codes, the efficiency is obtained by simply summing all counts divided per total primary. Is it correct to do so in FLUKA and DETECT cards?

Help from any dear member is really appreciated.

Dear @mahdi,

I modified your comscw.f adding the following lines in order to also check the particle that is scored and it looks ok (maybe somebody else can also check to see if it is correct).

  • alpha
  • Heavy ion
    ELSE IF(TITDET(JSCRNG).EQ."Li7" .and. JTRACK.EQ.-2 .and. ICHRGE(-2).EQ.3) THEN
    WRITE(70,*) 'daugther is Li-7'
    ELSE IF(JTRACK.EQ.-2 .and. ICHRGE(-2).NE.3) THEN
    WRITE(70,*) 'daugther', IBARCH(-2), ICHRGE(-2)

The output of DETECT is a distribution of energy deposited per event in the region(s) making up the detector.


Thank you @Mihaela_Parvu,
could you please upload the modified comscw.f?
Because I face the error undefined reference to `icharge_’
during compilation.


This is because you need to add


Here is the file.
comscw.f (5.6 KB)


Thanks for sharing the file @Mihaela_Parvu.

However, something is weird to me.
I ran the input file using compiled comscw.f, and without using it (just a normal FLUKA run), I see that the results of 4He in the first case and the results from the second case are exactly similar.
I assume that the normal FLUKA run includes the deposited energy from the primary beam plus the secondary particles (indicated All in the figure below).

It seems that my comscw.f does not separate 4He contribution so
4He deposited energy with comscw.f = total deposited energy (without comscw.f)

Here is a plot of the results. That flat line at low energy is also questionable.

Thanks in advance for any help.

This is because you adopt a logarithmic scale for a linear energy binning. Just untick the Log box when you plot in Flair.

With three DETECT cards, labelled ‘He4’, ‘Li7’ and ‘all’, respectively, you will get three different curves. Note that, due to the logic implemented in comscw, the one labelled ‘He4’ will actually exclude the He4 contribution (LSCZER = .TRUE. means ‘do not score’). The same for the Li7 one, actually excluding the Li7 contribution, and keeping the He4 contribution instead.

Your PART-THR card is wrong and ineffective. Look at the transport thresholds printed in the output file: they all stay at the default value of 100 keV. This is because you apply it from particle -2 (HEAVYION, which by the way cannot be used in PART-THR, since in fact HEAVYION take the same threshold as 4-HELIUM, in energy per nucleon) to particle -4 (TRITON), and such an interval is empty (going from -2 to -4 in step of +1 does not include anything). Replace HEAVYION with 4-HELIUM.


Dear @ceruttif
Thank you for your comments I was thinking reverse !

I corrected the plot according to what you mentioned including changing the thresholds.

But what I am confused about is that:
If I do not use the comscw, it means deposited energy from the primary beam as well as secondary particles is scored, is that right? So that deposited energy=energy from the primary beam(neutron)+energy from 4He+energy from 7Li
If so, why when I run FLUKA without comscw, the result is equal to 7Li (using comscw)?
Am I misunderstanding something?

The efficiency then is the integration of counts/all primaries, is that also correct?

Sorry for asking many questions.
I appreciate your comments.

In reality as in the simulation, there is no energy deposition by the neutron itself in the absence of capture and production of 4He and 7Li, which are the particles ionizing the gas.

Apparently you are doing something wrong due to some inconsistencies between your input file and the comscw routine, or at plotting level. With GEM.inp and comscw-rev.f, one gets three different curves, as mentioned above, with the not filtered one (all) matching the sum of the other two (He4 and Li7), due to the fact that for kinematics reasons (momentum conservation) only one of the two fragments reaches the gas, and not both together.

Resulting counts are already divided by the number of primaries. To get the efficiency, you need to sum them (above the detection threshold).

1 Like

Dear @ceruttif ,
Thank you so much for modifying the comscw and input file.
Now the results are similar to what I expected.
I also compared the FLUKA results with the PHITS Monte Carlo code, and now they are much more consistent together.
Some differences appear at low energies, particularly for heavier ion (7Li). It seems that the interactions at low energies might be more complex than at high energies.
However, the total efficiency is almost similar: Eff_FLUKA=12.8% and Eff_PHITS=12.7% for the detection threshold of 20 keV.
Here are the compared results:

Thanks to you all for helping me with this issue.

1 Like