I simulated a radiotherapy using medical linac which require me to simulate 4e9 particles, I used primitive scorer using UI scoring to create box mesh inside a water phantom, then I accumulated dose for each box and write the output in csv format.
I knew that we only able to simulate 2^31 (2147483648) particles at once (I basically got the same problem with this, after trying to run it simultaneously). Let’s say if I split the simulation into two parts, which I run 2e9 for each part, can I add the accumulated dose directly for each box to get the total dose of 4e9 particles inside the water phantom?
to be honest I’m still very new to c++ programming especially using geant4, any help would be appreciated, thanks!
Don’t forget to start each run with a different random number seed (otherwise the runs will be identical and adding will not reduce the statistical fluctuations). In the case of the medical linac example, it looks like the designer has programmed for a seed to be supplied as the second argument on the command line - as it says in the README:
The example needs as input data the macro file (like “ml2.mac”) and a seed number.
Look at ml2.cc, where there is if (arc == 3) ... and the following few lines. It looks like the default is 1, so any other number should give a different random number sequence. I always choose an odd number for good luck.
thanks for the reply!
but can I ask about how to start each run with different random number seed using UI command? Since I also use UI command to run my events, through this code :