Skip to content
Snippets Groups Projects
Commit 3194cc86 authored by James Beacham's avatar James Beacham
Browse files

Merge branch 'GeantSetupChecker_Fix_21.0' into '21.0'

Fix Coverity Defect Report 115524 in G4DebuggingTools

See merge request atlas/athena!11955

Former-commit-id: 5a10fcb1ad39952cacf0c31c795d8585f64b3755
parents aec8c697 e88bc060
No related branches found
No related tags found
No related merge requests found
...@@ -49,16 +49,19 @@ void Geant4SetupChecker::BeginOfRunAction(const G4Run*){ ...@@ -49,16 +49,19 @@ void Geant4SetupChecker::BeginOfRunAction(const G4Run*){
G4ExceptionDescription ed; G4ExceptionDescription ed;
ed << "ERROR! Reference had " << lvs << " and this setup has " << g4_logical_volume_store->size() << " logical volumes" << G4endl; ed << "ERROR! Reference had " << lvs << " and this setup has " << g4_logical_volume_store->size() << " logical volumes" << G4endl;
G4Exception("Geant4SetupChecker","LogVolMismatch",FatalException,ed); G4Exception("Geant4SetupChecker","LogVolMismatch",FatalException,ed);
abort();
} }
if (pvs!=g4_physical_volume_store->size()){ if (pvs!=g4_physical_volume_store->size()){
G4ExceptionDescription ed; G4ExceptionDescription ed;
ed << "ERROR! Reference had " << pvs << " and this setup has " << g4_physical_volume_store->size() << " physical volumes" << G4endl; ed << "ERROR! Reference had " << pvs << " and this setup has " << g4_physical_volume_store->size() << " physical volumes" << G4endl;
G4Exception("Geant4SetupChecker","PhysVolMismatch",FatalException,ed); G4Exception("Geant4SetupChecker","PhysVolMismatch",FatalException,ed);
abort();
} }
if (regs!=g4_region_store->size()){ if (regs!=g4_region_store->size()){
G4ExceptionDescription ed; G4ExceptionDescription ed;
ed << "ERROR! Reference had " << regs << " and this setup has " << g4_region_store->size() << " regions" << G4endl; ed << "ERROR! Reference had " << regs << " and this setup has " << g4_region_store->size() << " regions" << G4endl;
G4Exception("Geant4SetupChecker","RegionMismatch",FatalException,ed); G4Exception("Geant4SetupChecker","RegionMismatch",FatalException,ed);
abort();
} }
} // This was the basic geometry counting part } // This was the basic geometry counting part
else { // This is a region - check materials and fast sim else { // This is a region - check materials and fast sim
...@@ -67,6 +70,7 @@ void Geant4SetupChecker::BeginOfRunAction(const G4Run*){ ...@@ -67,6 +70,7 @@ void Geant4SetupChecker::BeginOfRunAction(const G4Run*){
G4ExceptionDescription ed; G4ExceptionDescription ed;
ed << "ERROR! Reference had region named " << id << "that is not in this configuration, or has changed name" << G4endl; ed << "ERROR! Reference had region named " << id << "that is not in this configuration, or has changed name" << G4endl;
G4Exception("Geant4SetupChecker","RegionNotFound",FatalException,ed); G4Exception("Geant4SetupChecker","RegionNotFound",FatalException,ed);
abort();
} }
unsigned int nmat=0, nfs=0; unsigned int nmat=0, nfs=0;
in >> nmat >> nfs; in >> nmat >> nfs;
...@@ -74,12 +78,14 @@ void Geant4SetupChecker::BeginOfRunAction(const G4Run*){ ...@@ -74,12 +78,14 @@ void Geant4SetupChecker::BeginOfRunAction(const G4Run*){
G4ExceptionDescription ed; G4ExceptionDescription ed;
ed << "ERROR! Region " << id << " had " << nmat << " materials in ref and " << areg->GetNumberOfMaterials() << " in this setup" << G4endl; ed << "ERROR! Region " << id << " had " << nmat << " materials in ref and " << areg->GetNumberOfMaterials() << " in this setup" << G4endl;
G4Exception("Geant4SetupChecker","MaterialMismatch",FatalException,ed); G4Exception("Geant4SetupChecker","MaterialMismatch",FatalException,ed);
abort();
} }
if ( (!areg->GetFastSimulationManager() && nfs!=0) || if ( (!areg->GetFastSimulationManager() && nfs!=0) ||
( areg->GetFastSimulationManager() && nfs!=areg->GetFastSimulationManager()->GetFastSimulationModelList().size()) ){ ( areg->GetFastSimulationManager() && nfs!=areg->GetFastSimulationManager()->GetFastSimulationModelList().size()) ){
G4ExceptionDescription ed; G4ExceptionDescription ed;
ed << "ERROR! Region " << id << " had " << nfs << " fast sims in ref and " << (areg->GetFastSimulationManager()?areg->GetFastSimulationManager()->GetFastSimulationModelList().size():0) << " in this setup" << G4endl; ed << "ERROR! Region " << id << " had " << nfs << " fast sims in ref and " << (areg->GetFastSimulationManager()?areg->GetFastSimulationManager()->GetFastSimulationModelList().size():0) << " in this setup" << G4endl;
G4Exception("Geant4SetupChecker","FastSimMismatch",FatalException,ed); G4Exception("Geant4SetupChecker","FastSimMismatch",FatalException,ed);
abort();
} }
} // End of region handling } // End of region handling
} // loop over lines } // loop over lines
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment