Message: Re: Recording information about secondary particles at generation Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Re: Recording information about secondary particles at generation 

Forum: Hits, Digitization and Pileup
Re: None Recording information about secondary particles at generation (Andre Dalcher)
Date: 25 Sep, 2012
From: Marc Verderi <Marc Verderi>

Hi Andre,

     You can make use of the user's stepping action, it is called at the 
end of each step, at the post step point position.

     There is a full vector of secondaries, that a track is creating 
along its path, and which is  augmented at each step with the 
secondaries created in this step. This secondary vector can be obtained by:

           const G4TrackVector* secondaries = step->GetSecondary ();

and this G4TrackVector is indeed a std::vector< G4Track*> vector.

     To collect the secondaries created in this step, you should 
remember the length this vector had at the end of the previous step. 
Just have a data member "size_t _previousStepVectorLength", that you set 
to zero if you are on the first step (check step number == 1).
     Then the secondaries created in this finishing step are "for 
(size_t i = _previousStepVectorLength ; i < step->size() ; i++) {do 
whatever}".
     Do not forget then to update _previousStepVectorLength = 
secondaries->size(); before returning.

Hope this helps.

Marc




On 09/25/2012 01:05 PM, Andre Dalcher wrote:
> *** Discussion title: Hits, Digitization and Pileup
>
> Hi
>
> I would like to be able to record the properties (position, momentum,
> energy) of secondary particles at the moment they are generated within a
> volume. For these purposes the paths of the secondary particle after
> this do not matter. I have tried to record this information at step
> points but have not been able to make it record at only the first point
> and no later ones.
>
> Many Thanks
>
> Andre Dalcher
>
> -------------------------------------------------------------
> Visit this GEANT4 at hypernews.slac.stanford.edu message (to reply or unsubscribe) at:
> http://hypernews.slac.stanford.edu/HyperNews/geant4/get/hitsdigits/280.html

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

1 None: Re: Recording information about secondary particles at generation   (michel maire - 25 Sep, 2012)
 Add Message Add Message
to: "Re: Recording information about secondary particles at generation"

 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 ]