Message: Re: scoring particles traversing a plane Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Re: scoring particles traversing a plane 

Forum: Biasing and Scoring
Re: Question scoring particles traversing a plane (Balder)
Date: Apr 23, 15:26
From: Tom Roberts <Tom Roberts>

There are several ways to do this.

1) The simplest is to partition your cube of water into two boxes such that there is a boundary where you want to sample. Then you can use G4UserSteppingAction to handle scoring whenever a track stops at the desired boundary.

2) In principle you could place a volume into a secondary world such that there is a boundary where you want to sample. This can make the sample plane be independent of the volumes in the mass (default) world. I was not able to get this to work, however (but that was many releases ago and it may well work now).

3) Do it yourself: represent the plane as a point and a 3-vector normal to the plane. In UserSteppingAction determine whether the step crosses the plane by examining step->GetPreStepPoint() and step->GetPostStepPoint(); for steps that cross the plane, linearly interpolate to the plane and do the sampling. For better accuracy (smaller interpolation distance), you could couple this with a process that limits the step size near the plane, or simply limit the step size globally or within the enclosing volume. NOTE: if the sampling plane happens to coincide with a volume boundary, then you must handle the case where both points are on the plane (ignore such steps); you must also handle the case where one of the points is on the plane, taking care to not double count.

G4beamline is an open-source program based on Geant4 that has code for (3) in its 'zntuple' command. It can be downloaded from . But be aware it is a large and non-trivial program.

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

1 Agree: Re: scoring particles traversing a plane   (Balder - Apr 25, 09:48)
 Add Message Add Message
to: "Re: scoring particles traversing a plane"

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews