Message: Re: Setting Track Info for secondaries Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Re: Setting Track Info for secondaries  

Forum: Event and Track Management
Re: Question Setting Track Info for secondaries (Nigel Hawkes)
Re: Feedback Re: Setting Track Info for secondaries (Gumplinger Peter)
Date: 26 Nov, 2013
From: Hisaya Kurashige <Hisaya Kurashige>

Hello Nigel,

 I add some comments as a developer of Track category.

On Tue, 26 Nov 2013 21:37:00 GMT, Gumplinger Peter wrote:

> Hello Nigel,
> 
> Good points, all! I'll respond to what I can.
> 
> > I thought that the recently-added function
> > G4Step::GetSecondaryInCurrentStep() would be just what I needed, but
> > there are problems.
> > 
> > This function returns a vector of pointers to const G4Track, so it's not
> > easy to add an information object pointer via
> > G4Track::SetUserInformation(). I'd be interested to know why the design
> > was done this way, as the self-same track pointers are available in
> > non-const form via the likes of G4Step::GetSecondary(), if you only knew
> > which ones relate to the current step.
> 
> The idea was so user can't modify secondary tracks or add/remove tracks
> but your issue may have been an oversight. I'll confirm that the
> developer is aware of your posting.

In principle, we do not assume that users modify secondary tracks before passing them to tracking manager (That's way the track ID is not assigned to secondary tracks in the secondary bucket.), because such operations are dangerous potentially. So, GetSecondaryInCurrentStep() gives non-const pointer to the secondary tracks.

However, you can utilize following recipe if you understand the mechanism of Geant4 tracking.

> You could use the GetfSecondary() as in:
> 
> http://www-geant4.kek.jp/lxr/source//examples/extended/optical/LXe/src/LXeSteppingAction.cc#L105
> 
> This also shows you how to extract just the secondaries in the current
> step.
> 

> > (3) Is there a way for the user to intervene at the moment a secondary
> > is created, in order to (for example) implement routine copying of
> > context-dependent information from parent to secondary?
> 
> Well, yes - but not exactly 'at the moment a secondary is created'
> because this happens inside processes.
> 
> You can implement ClassifyNewTrack in your StackingAction:
> 
> http://www-geant4.kek.jp/lxr/source/event/include/G4UserStackingAction.hh#L60
Yes. StackingAction is the proper point for users to modify secondary track information.

Hisaya

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

1 Ok: Re: Setting Track Info for secondaries   (Nigel Hawkes - 27 Nov, 2013)
(_ Feedback: Re: Setting Track Info for secondaries   (Gumplinger Peter - 27 Nov, 2013)
(_ Feedback: Re: Setting Track Info for secondaries   (Nigel Hawkes - 28 Nov, 2013)
 Add Message Add Message
to: "Re: Setting Track Info for secondaries "

 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 ]