Message: Re: Tracking only one type of particle Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Feedback Re: Tracking only one type of particle 

Forum: Event and Track Management
Re: Question Tracking only one type of particle (Zack Snyder)
Date: 30 May, 2013
From: Gumplinger Peter <Gumplinger Peter>

Hi Zach,

> Simply put, I am shooting neutrons into water.
> I am trying to implement a filter so that my program will only track
> neutrons. Is there a simple way to do this?

The best way to restrict tracking to only neutrons, you'll have to reject all other particles your initial neutron may genertate. This is best done in 'G4UserStackingAction'. Please, see:

For an example of such code, see:

where all primary particles are tracked, but only certain secondaries are tracked, all others get fKill. So, your code would simply read:

if (aTrack->GetParentID() == 0) return fUrgent;

if (particleType != G4Neutron::NeutronDefinition()) return fKill;

return fUrgent;

(or only the last two lines)


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

1 Question: Re: Tracking only one type of particle   (Zack Snyder - 30 May, 2013)
(_ None: "Identifying" particles in inelastic collisions   (Michael H. Kelsey - 30 May, 2013)
 Add Message Add Message
to: "Re: Tracking only one type of particle"

 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 ]