Problem 1773

Summary: Segmentation Fault from GetOriginTouchable
Product: Geant4 Reporter: Steve Quillin <steve.quillin>
Component: eventAssignee: Andrea Dotti <andrea.dotti>
Status: RESOLVED FIXED    
Severity: trivial CC: asai
Priority: P5    
Version: 10.1   
Hardware: PC   
OS: Linux   

Description Steve Quillin 2015-08-07 16:28:49 CEST
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
Comment 1 kurasige 2015-08-09 07:32:52 CEST
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.
Comment 2 asai 2016-01-28 00:29:15 CET
Sorry for the belated response.
Fix will be included in the next patch release.
Kind regards,
Makoto Asai