Accessing information from a touchable obtained from track->GetOriginTouchable() gives a segmentation fault if the track is a source (primary) particle. Examples from steppingaction :- G4Track* aTrack = theStep->GetTrack(); const G4VTouchable * t1= aTrack->GetOriginTouchable() ; // ok G4VPhysicalVolume *p1 = t1->GetVolume() ; // Instant segfault if aTrack->GetParentID()==0 But:- if(aTrack->GetParentID()>0) G4cout<<t1->GetVolume()->GetName() << G4endl; // ok It's a trivial issue to work around I know. I just thought I'd report it as it caught me out for a while and may do so others also. Please request further information if required. Thanks Steve Quillin
OriginTouchable is set in G4EventManager::StackTracks. It seems that the OriginTouchable is set to primary tracks as well as secondary tracks. I have no idea on this problem.
Sorry for the belated response. Fix will be included in the next patch release. Kind regards, Makoto Asai