| Summary: | G4TripathiLightCrossSection "LowEnergyCheck" | ||
|---|---|---|---|
| Product: | Geant4 | Reporter: | tkoi |
| Component: | processes/hadronic/cross_sections | Assignee: | dennis.herbert.wright |
| Status: | RESOLVED FIXED | ||
| Severity: | trivial | CC: | kelsey |
| Priority: | P5 | ||
| Version: | 9.3 | ||
| Hardware: | All | ||
| OS: | All | ||
Hi, Tatsumi. It looks to me as though the "result" assignment ought to be moved to be inside the "if (!lowEnergyCheck)" block. Any chance you can test that in whatever code you discovered this bug? It'd be cool to get this fixed in time for the 9.4 build. Problem report withdrawn by Tatsumi Koi. |
Hi G4TripathiLightCrossSection::GetIsoZACrossSection (const G4DynamicParticle* theProjectile, G4double ZZ, G4double AA, G4double /*theTemperature*/) { ************************************************ 286 result = pi * r_0*r_0 * 287 std::pow((std::pow(AT,third) + std::pow(AP,third) + deltaE),2.0) * 288 (1.0 - R_c*B/E_cm) * X_m; 289 if (!lowEnergyCheck) 290 { 291 if (result < 0.0) 292 result = 0.0; 293 else if (E < 6.0*MeV) 294 { 295 G4double f = 0.95; 296 G4DynamicParticle slowerProjectile = *theProjectile; 297 slowerProjectile.SetKineticEnergy(f * EA * MeV); 298 // G4TripathiLightCrossSection theTripathiLightCrossSection; // MHM 20090824 Not needed 299 // theTripathiLightCrossSection.SetLowEnergyCheck(true); 300 G4bool savelowenergy=lowEnergyCheck; 301 SetLowEnergyCheck(true); 302 G4double resultp = 303 GetIsoZACrossSection(&slowerProjectile, ZZ, AA, 0.0); 304 SetLowEnergyCheck(savelowenergy); 305 if (resultp >result) result = 0.0; 306 } ************************************************ } Function GetIsoZACrossSection at 303th is called the function recursively, then "result" will overwrite at 286th. As the result, “resultp “always has same value of "result". Therefore 305th line becomes meaningless. Tatsumi