Possible bug: uncertainty of dose in region mesh

Versions

Computer 1 (my computer)

FLUKA: 4-5.1
Flair: 3.4-5.2
Operating system: Ubuntu 24.04 via WSL

PHITS: 3.36 on Windows

Computer 2

FLUKA: 4-5.1
Flair: 3.4-5.4
Operating system: Ubuntu 24.04

Computer 3 (also running FLUKA INFN)

FLUKA: 4-5.1
Flair: 3.3-0
Operating system: Ubuntu 20.04

Description

Dear experts,

I am running same input file in three different computers. The input contains proton-beryllium reaction with some moderator materials. Each of them runs at 5 cycles x 1 million primaries. What I score is the neutron current (22, USRBDX), electromagnetic dose (23, USRBIN-DOSE-EM), and total dose (24, USRBIN-DOSE). The dose is scored on the sample by using region mesh. I used only few primaries to make sure no convergence occurs. The input is attached, can be run directly and no need for user routine.

Then I found these discrepancies:

  1. Regarding USRBDX on all three computers, all return the same output. I used the same random number initialization, so nothing is different. Calculation with PHITS also returns more or less the same result.
  2. Computer 1 → no 23: 9.595885717972319e-12 (1.0), no 24: 7.787134131964635e-11 (0.306450754404068)
  3. Computer 2 → no 23: 9.595885717972319e-12 (100), no 24: 7.787134131964635e-11 (30.6450754404068)
  4. Computer 3 → no 23: 9.59589e-12 (1), no 24: 7.78713e-11 (0.306451)
  5. I ran the corresponding program on PHITS using the same settings (I know PHITS better than FLUKA), and the dose uncertainty is indeed high (>40%).

Looking at the numbers, I already know this is the problem with treating decimals and percentages. But what’s interesting is that it manifests itself in how Flair generates the plot on each computer.

From above: plot from computer 1 & 3, computer 2, and PHITS (including the multiplier, but notice the error bar)

Flair interprets the uncertainty as a percentage while in reality the uncertainty is still very high!

I will be really grateful if someone knows how to solve this problem, as computer 3 is really powerful and in high demand.

Regards,

Dian

Input files

r2525.inp (8.6 KB)

r2525-phits.inp (12.0 KB)

Dear Dian,

Thanks for reporting this! I had a look at the merged binary file handling in Flair to create the .dat (it is in Flair’s Plot.py), and there was a bug in the way statistical errors are handled in the case of per-region USRBIN scoring. Errors were wrongly not multiplied by 100, while eventually the results in .dat should be in %. Further down the line, the plot creation process relies on the error to be expressed in % in the .dat (as you can see in output tab with the value*error/100).
Hence errors were 100 smaller than they should, in that specific case. This was fixed from Flair 3.4-5.3 onward. This explains why you were not seeing any discrepancy for USRBDX, and why for the per-region USRBIN, you were getting errors (e.g. for det 23) at 1 “%” with computer 1&3 (first plot), while the correct value is actually 100% (second plot), in consistence with PHITS error estimate (third plot).
The conclusion is simple: please upgrade to the latest Flair version :slight_smile:

Thanks and sorry for the inconvenience,
Gabrielle