| Summary: | Bug in G4ErrorRunManagerHelper::InitializePhysics : wrong PhysicsList type check. | ||
|---|---|---|---|
| Product: | Geant4 | Reporter: | NoneOf YourBusiness <vss> |
| Component: | error_propagation | Assignee: | Pedro.Arce |
| Status: | RESOLVED FIXED | ||
| Severity: | major | ||
| Priority: | P5 | ||
| Version: | other | ||
| Hardware: | All | ||
| OS: | All | ||
Corrected, thanks for realizing the bug. |
Hello, You check if the PhysicsList is of correct type the following way: if( static_cast<const G4ErrorPhysicsList*>(G4RunManager::GetRunManager()->GetUserPhysicsList()) != 0 ) { G4cerr << " WARNING G4ErrorRunManagerHelper::InitializePhysics() physics list is not G4ErrorPhysicsList. Are you sure? " << G4endl; } which is obviously wrong - the check has to be "==0". To convice yourself that it is a bug, just put the following code into your program: const G4ErrorPhysicsList * testPhysicsList = new G4ErrorPhysicsList; if( static_cast<const G4ErrorPhysicsList*>(testPhysicsList) != 0 ) G4cerr << "TEST WARNING G4ErrorRunManagerHelper::InitializePhysics() physics list is not G4ErrorPhysicsList. Are you sure? " << G4endl; and you will get the error message!!! Thank you.