Skip to content
Snippets Groups Projects
Commit 18cc84dd authored by Markus Frank's avatar Markus Frank
Browse files

Remove bug reported by P.Kostka

parent a889f3a0
No related branches found
No related tags found
No related merge requests found
......@@ -71,29 +71,38 @@ void SteppingAction::UserSteppingAction(const G4Step* aStep) {
}
Geant4VolumeManager volMgr = Geant4Mapping::instance().volumeManager();
const G4VPhysicalVolume* pv = step.volume(step.post);
Geometry::PlacedVolume place = volMgr.placement(pv);
if ( !place.isValid() ) {
::printf(" --> Severe ERROR: incomplete placement map from Geant4 conversion.\n");
}
else {
VolumeID id = volMgr.volumeID(step.postTouchable());
if ( id == Geant4VolumeManager::InvalidPath ) {
::printf(" --> Severe ERROR: Invalid placement path: touchable corrupted?\n");
}
else if ( id == Geant4VolumeManager::Insensitive ) {
::printf(" --> WARNING: Only sensitive volumes may be decoded.\n");
}
else if ( id == Geant4VolumeManager::NonExisting ) {
::printf(" --> WARNING: non existing placement path.\n");
if ( pv ) {
// If the post step is no longer connected to a physical volume it does not make sense to follow
// it's properties!
Geometry::PlacedVolume place = volMgr.placement(pv);
if ( !place.isValid() ) {
::printf(" --> Severe ERROR: incomplete placement map from Geant4 conversion.\n");
}
else {
std::stringstream str;
Geant4VolumeManager::VolIDDescriptor dsc;
Geant4VolumeManager::VolIDFields& fields = dsc.second;
volMgr.volumeDescriptor(step.postTouchable(),dsc);
for(Geant4VolumeManager::VolIDFields::iterator i=fields.begin(); i!=fields.end();++i)
str << (*i).first->name() << "=" << (*i).second << " ";
::printf(" --> CellID: %X [%X] -> %s\n",id,dsc.first,str.str().c_str());
VolumeID id = volMgr.volumeID(step.postTouchable());
if ( id == Geant4VolumeManager::InvalidPath ) {
::printf(" --> Severe ERROR: Invalid placement path: touchable corrupted?\n");
}
else if ( id == Geant4VolumeManager::Insensitive ) {
::printf(" --> WARNING: Only sensitive volumes may be decoded.\n");
}
else if ( id == Geant4VolumeManager::NonExisting ) {
::printf(" --> WARNING: non existing placement path.\n");
}
else {
std::stringstream str;
Geant4VolumeManager::VolIDDescriptor dsc;
Geant4VolumeManager::VolIDFields& fields = dsc.second;
volMgr.volumeDescriptor(step.postTouchable(),dsc);
for(Geant4VolumeManager::VolIDFields::iterator i=fields.begin(); i!=fields.end();++i)
str << (*i).first->name() << "=" << (*i).second << " ";
::printf(" --> CellID: %X [%X] -> %s\n",id,dsc.first,str.str().c_str());
}
}
}
else {
Position pos = step.postPos();
::printf(" --> Geant4 post-step point is not connected to a physical volume. "
"Last position: x=%.3f y=%.3f z=%.3f\n",pos.X(), pos.Y(), pos.Z());
}
}
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