Message: Re: Track Status doesn't work Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Re: Track Status doesn't work 

Forum: Event and Track Management
Re: Question Track Status doesn't work (Soman)
Date: 26 Jul, 2017
From: Marc Verderi <Marc Verderi>


Your code is correct, but it may be ineffective if not put at a proper 
place : in what class + method do you have this code ?

Your code should work in the stepping action (in the 
UserSteppingAction(..) method), it should work in a sensitive detector 
code (ProcessHit(...) method) if the track dies in the sensitive volume, 
and should work in a tracking action (in the PostUserTrackingAction(...) 
method). Note that it will not work in the tracking action 
PreUserTrackingAction(..) for example as, at this level ony "alive" 
tracks can appear.



On 25/07/2017 21:50, Soman wrote:
> *** Discussion title: Event and Track Management
> Hi,
> I need to know the track information just before the track is dead
> (particle is dead). I tried below codes but it didn't work, i.e. it
> didn't enter the if.
> ===========================================================================
> G4bool track_status = (aTrack.GetTrackStatus()== fStopAndKill);
>   if (track_status == true){
>    num = num+1; // counter
>    cout << num << endl; // to check if it enters the if
>    trackLength = aTrack.GetTrackLength();
>    globalTime = aTrack.GetGlobalTime();
> }
> ===========================================================================
> Also I tried (fStopButAlive) and even (fAlive), but none holded the
> "if". Could everyone please tell me what could be wrong?
> Many thanks.
> Best, Somayeh
> -------------------------------------------------------------
> Visit this GEANT4 at message (to reply or unsubscribe) at:

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

1 Note: Re: Track Status doesn't work   (Soman - 26 Jul, 2017)
 Add Message Add Message
to: "Re: Track Status doesn't work"

 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 ]