Problems for analysisManager and csv files


So this might be a simple problem (I hope) but it is in consistent which is why I’m having an issue tackling it.

I’m using the analysis manager to build 1D, 2D and 3D histograms, which I output in the form of a csv.

Run Action example:
G4String H2_0 = “2D hist”;

Sensitive Detector example:

Sometimes my output cuts early. So the length of my output is not the same as the length of the two bin parameters multiplied together.

Sometimes I get random binary symbols that fill a row in my csv

And sometimes the row does not fully output, for example it may look like this:

I’m not sure as to why this happens. There doesn’t seem to be any pattern to when it will error like the above exmaples.

I hope you can help.