| Summary: | (need break;inside for): in method: G4XNNstarTable::CrossSectionTable | ||
|---|---|---|---|
| Product: | Geant4 | Reporter: | a.ramazani |
| Component: | processes/hadronic/models/im_r_matrix | Assignee: | Gunter.Folger |
| Status: | RESOLVED WORKSFORME | ||
| Severity: | normal | ||
| Priority: | P5 | ||
| Version: | 9.6 | ||
| Hardware: | All | ||
| OS: | All | ||
Thanks for this report. This is not a bug, the code searches the complete map, while your code would stop on str == particleName. Likely, the code should use map::find(). |
\processes\hadronic\models\im_r_matrix\G4XNNstarTable.cc const G4PhysicsVector* G4XNNstarTable::CrossSectionTable(const G4String& particleName) const (need break;inside for): G4double* sigmaPointer = 0; for (iter = xMap.begin(); iter != xMap.end(); ++iter) { G4String str = (*iter).first; if (str == particleName) { sigmaPointer = (*iter).second; } } Correct: G4double* sigmaPointer = 0; for (iter = xMap.begin(); iter != xMap.end(); ++iter) { G4String str = (*iter).first; if (str == particleName) { sigmaPointer = (*iter).second; break; } }