Message: Re: Track lengths of secondaries and tertiaries Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Re: Track lengths of secondaries and tertiaries 

Forum: Event and Track Management
Re: Question Track lengths of secondaries and tertiaries (Patrick Asenov)
Date: 06 Jul, 2017
From: michel maire <michel maire>

On Tue, 04 Jul 2017 15:39:53 GMT, Patrick Asenov wrote:
> 
> I call the above voids from StackingAction::ClassifyNewTrack(const
> G4Track* track) of StackingAction.cc as follows:
> 
>   length = track->GetTrackLength();
> 
>   if (track->GetTrackID() == 1)  {
>     fEventaction->AddPrimaryTrackLength(length);
>   }
> 
>   if (track->GetParentID() == 1)  {
>     fEventaction->AddSecondaryTrackLength(length);
>   }
> 
>   if (track->GetParentID() > 1)  {
>     fEventaction->AddTertiaryTrackLength(length);
>   }
> 
> The same commands when applied to energies work just fine. I can't
> understand what am I getting wrong down here!
> 

 Particle-tracks are put in the stack in waiting to be tracked. Therefore, at this time, their track length is still zero ...
 Natural way to get track length is in TrackingAction::PostUserTrackingAction() : track->GetTrackLength();
 Another possibility is to sum up step size : in SteppingAction : step->GetStepLength();

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

1 Agree: Re: Track lengths of secondaries and tertiaries   (Patrick Asenov - 06 Jul, 2017)
 Add Message Add Message
to: "Re: Track lengths of secondaries and tertiaries"

 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 ]