.mac is not running as i expected. pc can't hold it

Hello everybody. I am trying to run a .mac file at geant4, but the problem is that, after running about 3 minutes, the computer screen just freeze, the terminal didn’t change and i can’t even to move the mouse, forcing me to turn the computer off. So, in my point of view, there are no problems in the .mac, neither in the installation of the geant4. I will talk more about this below:

# test01
#
/run/initialize
#
/gps/particle gamma

# position

/gps/pos/type Point
/gps/pos/centre 0 0 0 cm

# angular

/gps/ang/type iso

# energy

/gps/ene/type Gauss
/gps/ene/mono 0.0062 MeV
/gps/ene/sigma 0.0003 MeV

# commands below are independent of gps
#
/analysis/setFileName test02
/analysis/h1/set 1 100 0.0001 0.007 MeV

#
/run/beamOn 300

Above is my .mac. As i said, it starts running but after some time it just freeze the PC screen. If, for example, i run the same .mac above, but changing the final part to:

/analysis/h1/set 1 3 0.0001 0.007 MeV

#
/run/beamOn 3

It runs normally, but as you can guess, it is to little information that i got returned to me. I would like to compute something larger, to be able to analyse the data.

Is there a way to modify the .mac above such that it runs much more particles/data, and, of course, does not freeze my pc?

Hello,
I don’t think it is the macro-file, which freezes your pc. It looks very simple.

You can put “/run/printProgress 1” before your " /run/beamOn 300" to see at which number of particles your pc freezes.

Otherwise more information would be nice:
-Does your simulation take 100% of your PCs ressources (Processor/RAM)?
-Can you run a simulation from the examples for a few minutes and see if it freezes your PC too?
-What do you try to do in your simulation? How much stuff is happening in the analysis?

Maybe your PC freezes when it is at 100% for a few minutes because it is getting too hot.

Regards

Yes, maybe the problem isn’t the .mac

The geometry in my simulation is not so complex, in fact, it is a little trivial, so i am not sure why the program does not run when we use a big number of simulation.

-Does your simulation take 100% of your PCs ressources (Processor/RAM)?
I am not sure, is there a way to know it?

-Can you run a simulation from the examples for a few minutes and see if it freezes your PC too?
Yes, the majority of the programs in the examples folder run normally.

-What do you try to do in your simulation? How much stuff is happening in the analysis?
Basically i want to generate a histogram of the number of particles gamma that arive at a detector.

I realized that, when i take off the /analysis part, the program crashs automatically with a segmentation fault error. What could it be?

Depends on your Operating System…
Easiest way: On windows you open the Task Manager, on Ubuntu it’s called System Monitor…

Do you specify the parameters (#bins, range) of the histogram with ID=1 somewhere outside of your macro file? If it is never set in your code (just in the macro file) then Geant does not know what to do.