Message: Re: seperating secondary particles Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Feedback Re: seperating secondary particles 

Forum: Particles
Re: None seperating secondary particles (riazi)
Date: 11 Apr, 2011
From: Gumplinger Peter <Gumplinger Peter>

Hi Riazi,

Every gamma in your simulation has a unique track number (this will in general be a different number from event to event but is unique for each track in an event). You can, for instance, require that the incoming particle is a gamma, that it has a new track # (different from all the others before it):

aStep->GetTrack()->GetTrackID()

You can do this in your SteppingAction or SD::ProcessHit method.

Of course, the gamma itself doesn't deposit any energy (except for sub-range photo electrons) so you'll need to keep book as to what charge particle is a daughter of your incoming gamma track

aStep->GetTrack()->GetParentID()

It can get a bit messy because you can have grand-daughters etc. However, in general, secondaries are tracked immediately after a parent track (the tracking stack is last in first out) and so once you have a gamma enter your detector, all energy deposit in that detector will be from that gamma's progeny until you get the next gamma coming in. Note, 'coming in' is important because showers inside your detector may include more gammas. You can find out if a track enters by:

G4String thePrePVname = theStep->GetPreStepPoint()->GetPhysicalVolume()->GetName();

G4String thePostPVname = " ";

if(theStep->GetPostStepPoint()->GetPhysicalVolume()) thePostPVname = theStep->GetPostStepPoint()->GetPhysicalVolume()->GetName();

if(thePrePVname != "Detector" && thePostPVname == "Detector"

Peter

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

1 None: Re: seperating secondary particles   (riazi - 16 Apr, 2011)
1 None: Re: seperating secondary particles   (michel maire - 16 Apr, 2011)
2 None: Re: seperating secondary particles   (riazi - 16 Apr, 2011)
 Add Message Add Message
to: "Re: seperating 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 ]