Warning, /geant4/examples/extended/biasing/GB06/README.md is written in an unsupported language. File is not indexed.
0001 \page ExampleGB06 Example GB06
0002
0003 ## Parallel geometries with generic biasing
0004
0005
0006 This example demonstrates the use of parallel geometries in generic biasing,
0007 on a classical shield problem, using geometry-based importance biasing.
0008
0009 ### Geometry and activation of navigation in parallel world:
0010
0011
0012 The geometry is made of two parts:
0013 - the mass (standard) geometry, which is made of a single block of
0014 concrete ; this is implemented in GB06DetectorConstuction ;
0015 - a parallel geometry, in which a series of slices is defined, these
0016 slices being created using a replica volume ; this is implemeted in
0017 GB06ParallelGeometryForSlices, which derives from the base class
0018 G4VUserParallelWorld .
0019
0020 The navigation in the parallel geometry is activated for neutrons. This is
0021 done in the main() program. The activation is made using the
0022 facilities of the G4GenericBiasingPhysics class, as:
0023
0024 ```cpp
0025 biasingPhysics->AddParallelGeometry("neutron",
0026 "parallelWorldForSlices");
0027 ```
0028
0029 where the first name is for the particle type to be aware of the parallel word,
0030 the second argument is the name of the parallel world.
0031
0032 When checking the process list of neutrons (`/particle/select neutron` and
0033 then `/particle/process dump` ) a new process, `biasingLimiter`, is visible. This
0034 process handles the step limitation in the parallel geometry. This process can
0035 handle several parallel geometries, these being passed to the process as
0036 ```cpp
0037 biasingPhysics->AddParallelGeometry("neutron", "parallelWorld1") ,
0038 biasingPhysics->AddParallelGeometry("neutron", "parallelWorld2") , etc.
0039 ```
0040
0041 The geometry-based importance technique utilizes only splitting and killing,
0042 hence techniques which are "non-physics biasing" techniques, in the sense they
0043 don't modify the behavior of physics processes. For this reason, only a process
0044 making the interface between the tracking and the biaising is inserted in the
0045 physics list, the physics processes themselves being untouched, this is made as:
0046
0047 ```cpp
0048 biasingPhysics->NonPhysicsBias("neutron");
0049 ```
0050
0051 Finally, the volume (ie the slice) importances are defined in a simple
0052 "importance map" that is created in the GB06ParallelWorldForSlices class, this
0053 map associating a replica number to a volume importance. The map is hold by the
0054 biasing operator.
0055
0056
0057 ### Biasing classes:
0058
0059 As usual, with the generic biasing scheme, a biasing operator and a biasing
0060 operation are defined, these are, respectively the
0061 - GB06BOptrSplitAndKillByImportance and
0062 - GB06BOptnSplitAndKillByImportance
0063
0064 classes. The operator here only handles one particle type. In the StartRun()
0065 method, it configures the biasing operation GB06BOptnSplitAndKillByImportance
0066 passing it the information related to the parallel geometry, and passing it the
0067 importance map.
0068
0069 The biasing operation GB06BOptnSplitAndKillByImportance applies a classical
0070 importance-based geometry technique, with spliting / killing at the slice
0071 bondaries. Splitting is made if the track goes from a smaller importance to a
0072 volume of larger importance, and killing (Russian roulette) is applied in the
0073 other case.
0074
0075 The particularity of this biasing operation is its handling of the parallel
0076 geometry information. It has to get by itself geometry information that, in the
0077 case of information of the mass geometry, are provided in the G4StepPoint objects
0078 (pre step point, post step point) of the G4Step. Here, in the
0079 DistanceToApplyOperation(...), which is called at the beginning of the step, it
0080 gets a "snapshot" of the geometry state keeping a G4TouchableHistoryHandle. Then
0081 in the GenerateBiasingFinalState, which is called at the end of the step, it gets
0082 the new geometry state, with an other G4TouchableHistoryHandle. For a step that
0083 ends on the boundary, this last touchable history will logically point to the
0084 next volume. In this case, the biasing is applied, and the importances are
0085 obtained from the replica numbers taken from the two touchable histories, and
0086 then from the importance map.
0087
0088 ### Output
0089
0090 A simple sensitive detector is defined (GB06SD) and is attached to a thin
0091 volume ("meas.logical") placed after the concrete shield. This sensitive
0092 detector simply prints the information (particle type, kinetic energy, etc,
0093 and weight) of particles leaving the shield.
0094
0095
0096 ### Known problems
0097
0098 In exampleGB06.in the neutron killer process, nKiller, is de-activated
0099 (process that kills neutrons after some time), for two reasons. First, killing
0100 neutrons in a shield problem is not desirable because neutrons may fly for long
0101 time before leaving the shield, and hence must be accounted for. Second, if
0102 nKiller is left active, an exception message about a spurious displacement by
0103 1e-7mm will appear sometimes : this happens when a neutron is killed on a volume
0104 boundary, and the navigation "sees" a (tiny) displacement, that should not exist.