Crash with low energy particles by gps

Please fill out the following information to help in answering your question, and also see tips for posting code snippets. If you don’t provide this information it will take more time to help with your problem!

Geant4 Version:11.3.2
Operating System:windows11
Compiler/Version:Microsoft Visual Studio Commnity 2022
*CMake Version:*3.24.202208181-MSVC_2


My simulation crashes when I use the following command. If I change the unit from keV to MeV, the simulation runs successfully.Some times My simulation crashes even if I set MeV.

/gps/pos/type Volume
/gps/pos/shape Cylinder
/gps/pos/centre 0. 0. 0.015 mm
/gps/pos/radius 5 cm
/gps/pos/halfz 0.015 mm

/gps/particle e-

/gps/ang/type iso

/gps/energy 18.6 keV

/run/beamOn 1

Not enough information. What physics list are you using? What does your geometry look like (_describe_ it, don’t just post code and expect us to figure it out). What exactly goes wrong? What error messages do you get? Do you get a traceback? Did you build Geant4 with debugging information in order to get a usable traceback? Have you tried running in the debugger yourself?

Sorry for My lacking infomation.I wana simulate the model like the picture below and ScT2 is source of e-. I’m using FTFP_BRERT and G4Radio active Decay Phisics. my qt window crashes with no error.

I tried to figure out the cause of this problem and I noticed a condition of crash. If I set electric field to gap,It crashes.Even if voltage is 0. This is the code to set electric field to the gap.Are there obvious mistakes in my code?

auto eField = new G4UniformElectricField(G4ThreeVector(0.,0.,voltage/gap_len));

auto fieldMgr = new G4FieldManager();

fieldMgr->SetDetectorField(eField);

logic_gap->SetFieldManager(fieldMgr, true);

Is this code part of the ConstructSDandField() function in your DetectorConstruction class? If so, is logic_gap a data member of that class, and is it properly set before you use it?

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.