when i accord example “extended/hadronic/FisssionFragment” to produce fisssion fragment, it seems no fragment produce, to confirm the particle produced is fragment, the code below used:
In your application, do you have Geant4 production cuts turned on? Often, fission fragments have a very short range, and production cuts will prevent them from being instantiated as tracks. If you turn off production cuts (or at least set the “proton” cut, which includes ion, to a small value), then you should see the fragments as tracks.
the cut value of my application is default, first i want to obtain the kinetic energy of fission fragment as thermal neutron bombing enriched Uranium, it seems not concerning the range of fission fragment, the key code below:
if(step->GetTrack()->GetDefinition()->IsGeneralIon())
G4double ede = step->GetPreStepPoint()->GetKineticEnergy();
Are you doing spontaneous fission or only neutron-induced fission? You could disable the radioactive decay process via macro, /process/inactivate RadioactiveDecay or RadioactiveDecayBase (depending on your G4 version).
i did neutron-induced fission, when using /process/inactivate RadioactiveDecay, the session shows:
command refused (1):"/process/inactivate RadioactiveDecay"
when using /process/inactivate RadioactiveDecayBase, the session shows:
*** Break *** segmentation violation
when using hard code like this:
auto fDecayPhysics = new G4DecayPhysics(1);
physicsList->RemovePhysics(fDecayPhysics);
Sorry, I wasn’t completely clear. In your macro file, after /run/initialize to create all the processes, then use the command /process/list to get a list of all the processes. Look in that list for either “RadioactiveDecay” or “RadioactiveDecayBase”, and then use the /process/inactivate command with whichever name you found.
There are two issues with this. First, G4DecayPhysics isn’t where RadioactiveDecay is found anyway; that builder contains the quite different G4Decay process which handles particle decays.
Second, the RemovePhysics() function with a pointer must be passed the same pointer that was added to the physics list in the first place. Instantiating a new, different instance isn’t going to work. You could use the RemovePhysics("name") signature.
That’s weird. You should not get a segfault from /process/list. If you use it before /run/initialize, it’ll give you an empty list. After /run/initialize, it should print the names of all processes.
If you’re getting a segfault, I suspect that means you have an error in your application, and you’re registering a null pointer as a “process.” That might explain your other seg faults as well.
Run in the debugger, look at the traceback to see where the segfault happens, and then work on your code to eliminate it. If you’re not familiar with how to use the debugger for your compiler, the documentation and the Web are your friends.