Message: Re: Get Pointer to G4Track from TrackID Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Feedback Re: Get Pointer to G4Track from TrackID 

Forum: Event and Track Management
Re: Question Get Pointer to G4Track from TrackID (Ulrich Stiegler)
Date: 06 Sep, 2012
From: Michael H. Kelsey <Michael H. Kelsey>

On Thu, 06 Sep 2012 13:38:05 GMT, Ulrich Stiegler wrote:
> I have a G4int TrackID and would like to get the pointer (G4Track*) to
> this track.
> In more detail: in UserSteppingAction I get the Track from
> fstep->GetTrack(). From there I get the praent ID via
> fstep->GetTrack()->GetParentID(). Now I want the pointer to this parent
> track, so that I can figure out the history of the track.
> Thanks in advance for an answer, Uli

Unfortunately, you cannot. G4Track is a transient entity. Once a track stops (or is killed), it is deleted from the stack and no longer exists. While the track exists, it only contains the corresponding particle's current (instantaneous) kinematics, not the past history.

Inline Depth:
 1 1
 All All
Outline Depth:
 1 1
 2 2
 All All
Add message: (add)

1 More: Re: Get Pointer to G4Track from TrackID   (Gumplinger Peter - 13 Sep, 2012)
 Add Message Add Message
to: "Re: Get Pointer to G4Track from TrackID"

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews

[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]