I tried running the radioactivedecay example in the latest geant4 version. I could Run rdecay01 and manage to visualised rdecay01. But for some reason rdecay02 seem fail to work. i tried change part of the code in the main() of decay02 where it define visualization and UI terminal, from { #ifdef G4VIS_USE G4VisManager* visManager = new G4VisExecutive; visManager->Initialize(); #endif #ifdef G4UI_USE G4UIExecutive * ui = new G4UIExecutive(argc,argv); ui->SessionStart(); delete ui; #endif #ifdef G4VIS_USE delete visManager; #endif } to { #ifdef G4UI_USE G4UIExecutive * ui = new G4UIExecutive(argc,argv); #ifdef G4VIS_USE UI->ApplyCommand("/control/execute vis.mac"); #endif ui->SessionStart(); delete ui; #endif }
I could run redcay02 after that, but I figure I should report it so the proper fix can be address to it as I am still new to geant4
Just add another problem i run into is that when I tried run the macro u238.mac I could get a spectrum for the decay emission but as for energy deposited in target\detector, there are zero energy/no spectrum in this case.
The code in the example is correct as it is. Your first problem is due to running in batch mode instead of interactive. To get the visualization, start the run by ./rdecay02 then at the prompt enter /control/execute vis.mac You will then see the geometry. Next, run some events: /run/beamOn 10 and tracks should appear. Your problem with u238.mac is due to poor documentation on our part. All histograms but the decay emission spectrum are turned off initially to save space for our testing routines. To turn them on, put the command /analysis/h1/setActivationToAll true or /analysis/h1/setActivation i true in your copy of u238.mac, or issue it from the Idle> prompt. i is the index of the histogram you want to turn off.