Problem 1038 - G4WilsonAbrasionModel::ApplyYourself() loops forever sometimes
Summary: G4WilsonAbrasionModel::ApplyYourself() loops forever sometimes
Status: RESOLVED FIXED
Alias: None
Product: Geant4
Classification: Unclassified
Component: processes/hadronic/models/abrasion (show other problems)
Version: other
Hardware: All All
: P5 critical
Assignee: PRTruscott
URL:
Depends on:
Blocks:
 
Reported: 2009-01-05 20:44 CET by Derek Dolney
Modified: 2011-05-15 18:35 CEST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this problem.
Description Derek Dolney 2009-01-05 20:44:43 CET
There is this code in processes/hadronic/models/abrasion/src/G4WilsonAbrasionModel.cc:

// Sample the impact parameter.  For the moment, this class takes account of
// electrostatic effects on the impact parameter, but (like HZETRN AND NUCFRG2)
// does not make any correction for the effects of nuclear-nuclear repulsion.
//
    G4double rPT   = rP + rT;
    G4double rPTsq = rPT * rPT;
    r              = 1.1 * rPT;
    while (r > rPT)
    {
      G4double bsq = rPTsq * G4UniformRand();
      r            = (rm + std::sqrt(rm*rm + 4.0*bsq)) / 2.0;
    }
    rsq = r * r;

The problem is, it is possible to have initial conditions such that rm > rPT, and so this while loop will never exit. The simulation will never finish this event, and data from previous events may be lost, depending on how the user has arranged to have their data stored.

I am registering G4WilsonAbrasionModel for GenericIons of energy 0--80 MeV. Using primary protons of 100 MeV, tracking through 100 cm of water, I get stuck in G4WilsonAbrasionModel about once every 10 million events.
Comment 1 flei 2010-04-26 12:20:26 CEST
The problem should have been fixed in the newer g4 release. Pete Truscott will check to confirm this.
Comment 2 dennis.herbert.wright 2011-05-15 18:35:29 CEST
D.H. Wright: confirmed that problem was fixed by P.R. Truscott before release 9.4