Message: Re: Calculate deposit from child track with condition Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Idea Re: Calculate deposit from child track with condition 

Forum: Event and Track Management
Re: Question Calculate deposit from child track with condition (Alexey Solovyev)
Date: 14 Nov, 2017
From: Michael H. Kelsey <Michael H. Kelsey>

On Tue, 14 Nov 2017 20:57:44 GMT, Alexey Solovyev wrote:
> I need to score dose deposit from all particles, which born from certain
> ancestor particle which had some condition. To be more precise, I need
> to explicitly calculate the deposit from secondary protons and
> electrons, which born from neutron with < 10 keV, and that neutrons are
> born somewhere inside my volumes (collimators) or moderated (filters),
> while particle source is 14 MeV neutrons.
> With scoring part I'm pretty certain that I should score deposit in my
> SD for all particles which have some condition in my class inherited
> from G4UserTrackInformation.

To do this, you need to have code which runs when both the parent track and the new secondaries exist. The place for that is in a G4SteppingAction subclass. This class gets called on every G4Step, so you'll want to put in short and simple if-blocks to bail out quickly if the track or step doesn't meet your criteria (not a neutron, too much energy, etc.). Do volume checking towards the end of those tests.

Once you have a good step, you have access to the parent particle, as well as the list of secondaries created by that parent. Those secondaries are G4Track objects, so at this point you can attach user track info to them to identify them as being "interesting." Then later, when your SD sees them deposit energy, it will see the user-info flag and can do what you want.

  -- Michael Kelsey

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

1 Agree: Re: Calculate deposit from child track with condition   (Alexey Solovyev - 15 Nov, 2017)
 Add Message Add Message
to: "Re: Calculate deposit from child track with condition"

 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 ]