Message: Re: How to GetKineticEnergy of secondary particles??? Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Disagree Re: How to GetKineticEnergy of secondary particles??? 

Forum: Event and Track Management
Re: None How to GetKineticEnergy of secondary particles??? (Mary Spears)
Date: 28 Feb, 2014
From: Gumplinger Peter <Gumplinger Peter>

Hi Mary,

Sorry, to your dismay you've run into a Geant4 quirk! The method:

const G4TrackVector* secondary = fpSteppingManager->GetSecondary();

which is essentially:


returns ALL secondaries that have been created by the current track since its inception! Please note:

In more recent versions of Geant4, you are much better off if you used:



and see how the implementation differs from GetSecondary():

You can also see how other examples use this method:

This is if you access secondaries from SteppingAction. It is also possible and perhaps more intuitive to collect information about all secondaries at the time they are put on the tracking stack. For this, the user-hook, G4UserStackingAction exists; in particular: ClassifyNewTrack

For an example, see:

> eventaction->GetSecondaryenergy(energy);

Strange that you call a method 'Get' when it sets something.


 Add Message Add Message
to: "Re: How to GetKineticEnergy of secondary particles???"

 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 ]