Created attachment 342 [details] Test program to reproduce the issue I'm simulating Fe56 @ 10 GeV/n with FTFP_BERT and Geant4 10.00.p02. The simulation gets stuck inside G4FTFModel::PutOnMassShell. More specifically, the do-while loop starting at line 1145 of G4FTFModel.cc never ends for some events. The check at the end of the loop (while ( SqrtS < std::sqrt( M2proj ) + std::sqrt( M2target ) ) fails many times, triggering a rescale of the scale factor (line 1151). This happens many times until the scale factor becomes 0 so that subsequent iterations are equivalent and the loop never ends. I attach a simple example program, showing the block when shooting one Fe56 ion on a cube made of light materials. Shooting C12 @ 10GeV/n instead of iron the issue seems to disappear (I've gone trough a couple of long runs without problems). Some colleagues reported the same issue with Geant4 10.01.p01, although I had no chance to investigate it as deeply as I did wit 10.00.p02.
I am not able to reproduce the problem by using the latest public version G4 10.1.p04. I have run 10'000 interactions of Fe56 @ GeV/n on the following light materials: G4_Be, G4_C, G4_Al, G4_Ar. Could you please try out this version?
Sorry, I made a mistake in my previous post: I mean "G4 10.0.p04" not "10.1.p04".
I tried the attached test program with 10.00.04 and it gets blocked on my system as with 10.00.p02. Did you try my test program or another program written by yourself? At which energy (it is missing in your post)? If you tried a different program then it's no surprise that it didn't block. It happens quite seldom, that's why I put together a test program to showcase it.
The energy I have tried out is the same you have specified: 10 GeV per nucleon. I have used my own test, because I would like to debug real problems of Geant4, not user-specific applications. Could you please tell me which target material you are considering, and how many interactions (more or less) you run in order to see the problem? Unfortunately, I don't have enough time to debug your program, so I need to reproduce the problem with my own test...
The target of my original program is a complicated cosmic ray detector, not easy to describe it. That's why I prepared a test program with a very simple geometry. In this program the target is a (50 cm)^3 cube made of PVT defined in this way: a = 1.01 * g / mole; G4Element *H = new G4Element(name = "Hydrogen", symbol = "H", z = 1., a); a = 12.01 * g / mole; G4Element * C = new G4Element(name = "Carbon", symbol = "C", z = 6., a); density = 1.032 * g / cm3; // PVT G4Material *PVT = new G4Material(name = "PVTMaterial", density, ncomponents = 2); PVT->AddElement(C, natoms = 9); PVT->AddElement(H, natoms = 10); The generation parameters have been chosen in order to trigger the block at the first event. In my original cosmic ray simulation I see the block every few hundreds - few thousands of events. I understand your point of not wanting to debug user's programs but only G4 problems, but I assure you that my test program is absolutely minimal (a cube and a gun generator). Please give a look at tit and possibly run it, just to confirm that the block is reproduced on your machine. Thanks
I managed to reproduce the problem using the test included in attachment. And I confirm that there is an infinite loop in the method G4FTFModel::PutOnMassShell. We are testing now a fix, which will be included in the coming patch G4 10.1.p02 (which we recommend to use), and also in the development beta release G4 10.2.beta. Both of them are expected by the end of June. I am going to post a message here as soon as they are ready, and then I wait for the confirmation that the bug is fixed before closing this ticket. Many thanks for reporting this bug - not easy to reproduce - and for providing the test which allowed to investigate the problem!
The second patch of the G4 10.1 series, 10.1.p02 (recommended for production), and the beta release 10.2.beta, have been released last week. Both of them should not have the problem reported. Could you please give a try and let us know, so that we can close the ticket? Thanks!
One of my colleagues tried 10.01.p02 to simulate Fe56 @ 10 Gev/n, and he reported that no simulation job got stuck. He simulated 30k events with no problem, so it seems that the patch fixed the problem. We didn't try 10.02.beta. I think that the bug report can be closed. We plan to simulate higher energies and if the problem will rise up again I will ask for reopening. Thanks Alberto for your support.