The tally results get from C++ API mismatch from the tally.out

Hi all,
I am using the openmc C++ API openmc_tally_results() to get the tally results. However, I find that the tally results I get in C++ is different from the results in the file named tally.out. The result in C++ seems to always be 8 times the results in the tally.out file.
I would like to know if I am using this C++ API wrong, or if there is anything I need to pay attention to when using it?

Any suggestions would be appreciated!

@Zhiying The tallies.out gives you the mean and standard deviation of each tally bin. The openmc_tally_results function gives you the “sum of realizations” and the “sum of squared realizations”. To see the relationship between them, please have a look at our theory/methodology guide. You can also look at how the Python bindings to the C/C++ API turn the raw sum/sum-squared values into a mean and standard deviation:

1 Like

Thank you so much for your suggestion. I’ll try to solve the problem I’m having as soon as you suggest.