Skip to content
Snippets Groups Projects
Commit 52c99807 authored by Markus Frank's avatar Markus Frank Committed by MarkusFrankATcernch
Browse files

Have better validity checks of the Geant4VolumeManager when checking volume id

parent c3398683
No related branches found
No related tags found
No related merge requests found
...@@ -286,8 +286,8 @@ VolumeID Geant4VolumeManager::volumeID(const G4VTouchable* touchable) const { ...@@ -286,8 +286,8 @@ VolumeID Geant4VolumeManager::volumeID(const G4VTouchable* touchable) const {
Geant4TouchableHandler::placementPath(path).c_str()); Geant4TouchableHandler::placementPath(path).c_str());
return NonExisting; return NonExisting;
} }
else if( checkValidity() && !path.empty() ) { else {
auto hash = detail::hash64(&path[0], sizeof(path[0])*path.size()); uint64_t hash = detail::hash64(&path[0], sizeof(path[0])*path.size());
auto i = ptr()->g4Paths.find(hash); auto i = ptr()->g4Paths.find(hash);
if( i != ptr()->g4Paths.end() ) { if( i != ptr()->g4Paths.end() ) {
const auto& e = (*i).second; const auto& e = (*i).second;
...@@ -333,8 +333,8 @@ VolumeID Geant4VolumeManager::volumeID(const G4VTouchable* touchable) const { ...@@ -333,8 +333,8 @@ VolumeID Geant4VolumeManager::volumeID(const G4VTouchable* touchable) const {
else if( !path[0]->GetLogicalVolume()->GetSensitiveDetector() ) else if( !path[0]->GetLogicalVolume()->GetSensitiveDetector() )
return Insensitive; return Insensitive;
} }
printout(INFO, "Geant4VolumeManager", "+++ Bad volume Geant4 Hash:%016X Path: %s", printout(INFO, "Geant4VolumeManager", "+++ Bad Geant4 volume path: \'%s\' Path empty: %s",
Geant4TouchableHandler::placementPath(path).c_str()); Geant4TouchableHandler::placementPath(path).c_str(), yes_no(path.empty()));
return NonExisting; return NonExisting;
} }
......
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