Message: Re: Problem with TrackingAction::PostUserTrackingAction Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Idea Re: Problem with TrackingAction::PostUserTrackingAction 

Forum: Event and Track Management
Re: Question Problem with TrackingAction::PostUserTrackingAсtion (Mark Chernikov)
Re: Feedback Re: Problem with TrackingAction::PostUserTrackingAсtion (Michael H. Kelsey)
Re: None Re: Problem with TrackingAction::PostUserTrackingAction (Mark Chernikov)
Date: 16 Oct, 2017
From: Michael H. Kelsey <Michael H. Kelsey>

On Mon, 16 Oct 2017 18:22:43 GMT, Mark Chernikov wrote:
> Okey. But how in this case i could count number of secondaries per track
> (if primary particle is electron and secondaries are optical photons)?
> And where i could call method GetVertexPosition() to record my
> coordinates in output file one time per track? I thought that the best
> place to do this is TrackingAction. Thank you.

For counting secondaries, I don't think TrackingAction is appropriate. Secondaries are produced at individual G4Steps, so your SteppingAction (or a generalized SensitiveDetector) is the right place to count secondaries. You'll need to maintain some sort of buffer indexed on TrackID (array, vector, or even std::map<G4int,xxxx>) to accumulate those totals per event.

For GetVertexPosition(), you can use TrackingAction. Since the vertex position doesn't change, you can ensure a single access per track by looking at theTrack->GetCurrentStepNumber(), and only do the one-time-only work on the first step.

  -- Michael Kelsey

 Add Message Add Message
to: "Re: Problem with TrackingAction::PostUserTrackingAction"

 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 ]