|Message: Re: scoring particles traversing a plane||Not Logged In (login)|
Click on the Forum title, e.g. on the "Forums by Category" page, to read a sequence of postings to the Forum and its threads all in one page. If you are only interested in one thread or the thread following a specific posting, click the thread or the posting, which takes you to a smaller page, which contains only the part you are interested in and may be easier to navigate.
Messages are "chained" if there are only replies at the first level, i.e. 1/1.html, 1/1/1.html etc. In case of "chained" messages the message number is replaced by the icon and there is no indentation.
Inline: Display the subject line only or also the text of the posting(s); for the choice "All" the "Outline" choices are switched off.
|1||0||1||no text / full text of posting|
|2||1||All||text for level 1 only / text for All postings|
Outline: Choose the depth of the posting thread, successive toggle controls provide increasing detail.
|1||2||1||2 levels / 1 level (original posting)|
|2||3||2||3 levels / 2 levels|
|3||3||All||3 levels / all levels (all postings)|
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 http://g4beamline.muonsinc.com . But be aware it is a large and non-trivial program.
|Inline Depth:||Outline Depth:||Add message:|