Problem 1350 - Bug in G4ErrorRunManagerHelper::InitializePhysics : wrong PhysicsList type check.
Summary: Bug in G4ErrorRunManagerHelper::InitializePhysics : wrong PhysicsList type ch...
Status: RESOLVED FIXED
Alias: None
Product: Geant4
Classification: Unclassified
Component: error_propagation (show other problems)
Version: other
Hardware: All All
: P5 major
Assignee: Pedro.Arce
URL:
Depends on:
Blocks:
 
Reported: 2012-09-11 20:05 CEST by NoneOf YourBusiness
Modified: 2012-10-21 11:02 CEST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this problem.
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.