I have built Geant4 successfully. But the following code does not work. Are there any python examples? Thanks!
from Geant4 import *
class DetectorConstruction(G4VUserDetectorConstruction):
def init(self):
super(DetectorConstruction, self).init()
class ActionInitialization(G4VUserPrimaryGeneratorAction):
def init(self):
super(ActionInitialization, self).init()
detector = DetectorConstruction()
gRunManager.SetUserInitialization(detector)
physicsList = FTFP_BERT()
gRunManager.SetUserInitialization(physicsList)
gRunManager.SetUserAction(ActionInitialization())
gRunManager.Initialize()
The errors are:
Traceback (most recent call last):
File “/home/test/PycharmProjects/pythonProject/B1/test.py”, line 20, in
gRunManager.Initialize()
TypeError: ‘NoneType’ object is not callable