Problem 1350

Summary: Bug in G4ErrorRunManagerHelper::InitializePhysics : wrong PhysicsList type check.
Product: Geant4 Reporter: NoneOf YourBusiness <vss>
Component: error_propagationAssignee: Pedro.Arce
Status: RESOLVED FIXED    
Severity: major    
Priority: P5    
Version: other   
Hardware: All   
OS: All   

Description NoneOf YourBusiness 2012-09-11 20:05:45 CEST
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.
Comment 1 Pedro.Arce 2012-10-21 11:02:21 CEST
Corrected, thanks for realizing the bug.