Geant4 Cross Reference |
1 1 2 Examples for event biasing: B01 << 2 Examples for event biasing 3 ------------------------------- << 3 -------------------------- >> 4 >> 5 This directory includes example applications to demonstrate the usage of >> 6 different variance reduction techniques supported in Geant4, or possible >> 7 from the user applications. 4 8 5 B01, B02 and B03 applications demonstrate the << 6 reduction techniques supported in Geant4, or p << 7 applications. << 8 9 9 General remark to variance reduction 10 General remark to variance reduction 10 ------------------------------------ 11 ------------------------------------ 11 The tools provided for importance sampling (or 12 The tools provided for importance sampling (or geometrical splitting and 12 Russian roulette) and for the weight window te 13 Russian roulette) and for the weight window technique require the user to 13 have a good understanding of the physics in th 14 have a good understanding of the physics in the problem. This is because 14 the user has to decide which particle types ha 15 the user has to decide which particle types have to be biased, define the 15 cells (physical volumes, replicas) and assign 16 cells (physical volumes, replicas) and assign importances or weight 16 windows to that cells. If this is not done pro 17 windows to that cells. If this is not done properly it can not be 17 expected that the results describe a real expe 18 expected that the results describe a real experiment. The examples given 18 here only demonstrate how to use the tools tec 19 here only demonstrate how to use the tools technically. They don't intend 19 to produce physical correct results. 20 to produce physical correct results. 20 21 21 General remark to scoring 22 General remark to scoring 22 ------------------------- 23 ------------------------- 23 Scoring is carried out using the built-in Mult << 24 A interface G4VScorer is provided for the user. The user may create his 24 parallel geometries this requires a special sc << 25 own class to perform the desired scoring. The user defined class 25 See examples/extended/runAndEvent (especailly << 26 therefore should inherit from the interface G4VScorer. >> 27 An example of an implementation of a scorer is G4Scorer >> 28 which may be found in source/event. >> 29 The scoring in these examples is done with a G4Scorer. >> 30 The variance reduction techniques and scoring do not support all options >> 31 of the Geant4 geometry. It only supports physical volumes and simple >> 32 replicas. >> 33 To identify a physical volume (or replica) objects of the class >> 34 G4GeometryCell are used. Scoring is done according to these >> 35 cells and importance values or the weight windows may be assigned to >> 36 them. >> 37 When scoring is done in a parallel geometry special action has to be taken >> 38 to prevent counting of "collisions" with boundaries of the mass geometry >> 39 as interactions. This is differently handled when scoring is done in the >> 40 mass geometry. >> 41 >> 42 --> G4GeometryCell of the parallel geometry must not share boundaries with >> 43 the world volume! <-- 26 44 27 Known problems - should not happen << 45 Known problems 28 ---------------------------------- << 46 -------------- 29 In the following scenario it can happen that a 47 In the following scenario it can happen that a particle is not 30 biased and it's weight is therefore not change 48 biased and it's weight is therefore not changed even if it crosses 31 a boundary where biasing should happen. 49 a boundary where biasing should happen. 32 Importance and weight window sampling create p 50 Importance and weight window sampling create particles on boundaries 33 between volumes. If the GPIL method of a physi 51 between volumes. If the GPIL method of a physical process returns 34 0 as step length for a particle on a boundary 52 0 as step length for a particle on a boundary and if the PostStepDoIt of 35 that process changes the direction of the part 53 that process changes the direction of the particle to go back in the 36 former volume the biasing won't be invoked. 54 former volume the biasing won't be invoked. 37 This will produce particles with weights that 55 This will produce particles with weights that do not correspondent to the 38 importance of the current volumes. 56 importance of the current volumes. 39 57 40 Further information: 58 Further information: 41 -------------------- 59 -------------------- 42 Short description of importance sampling and s 60 Short description of importance sampling and scoring: 43 https://geant4.web.cern.ch/collaboration/worki << 61 http://cern.ch/geant4/working_groups/geometry/biasing/Sampling.html 44 62 45 Example B01 63 Example B01 46 =========== 64 =========== 47 65 48 The example uses importance sampling or the we 66 The example uses importance sampling or the weight window technique 49 according to an input parameter. It uses scori 67 according to an input parameter. It uses scoring in both cases. 50 Importance values or weight windows are define 68 Importance values or weight windows are defined according to the mass 51 geometry. In this example the weight window te 69 geometry. In this example the weight window technique is configured such 52 that it behaves equivalent to importance sampl 70 that it behaves equivalent to importance sampling: The window is actually 53 not a window but simply the inverse of the imp 71 not a window but simply the inverse of the importance value and only 54 one energy region is used that covers all ener 72 one energy region is used that covers all energies in the problem. 55 The user may change the weight window configur 73 The user may change the weight window configuration by changing the 56 initialization of the weight window algorithm 74 initialization of the weight window algorithm in example,cc. 57 Different energy bounds for the weight window 75 Different energy bounds for the weight window technique may be specified 58 in B01DetectorConstruction. 76 in B01DetectorConstruction. 59 77 60 The executable takes one optional argument: 0 78 The executable takes one optional argument: 0 or 1. Without argument or 61 with argument: 0, the importance sampling is a 79 with argument: 0, the importance sampling is applied with argument: 1, 62 the weight window technique is applied. 80 the weight window technique is applied. 63 81 64 A modular approach is applied to the physicsli << 65 82 66 Example B02 83 Example B02 67 =========== 84 =========== 68 85 69 This example uses a parallel geometry to defin 86 This example uses a parallel geometry to define G4GeometryCell objects 70 for scoring and importance sampling. The outpu << 87 for scoring and importance sampling. In addition it customizes 71 << 88 the scoring. In this example one scorer creates a histogram. 72 A modular approach is applied to the physicsli << 73 The parallel geometry is included in this exte << 74 << 75 Example B03 << 76 =========== << 77 << 78 This example uses a parallel geometry to defin << 79 for scoring and importance sampling. The outpu << 80 equivalent to B02 (and B01). << 81 << 82 This demonstrates a customised "flat" physics << 83 of biasing. Complementary approach to the modu << 84 << 85 << 86 _____________________________________________ << 87 << 88 << 89 Generic biasing examples GB0 << 90 ---------------------------- << 91 << 92 These examples illustrate the usage of a biasi << 93 version Geant4 10.0. << 94 The scheme is meant to be extensible, not limi << 95 << 96 Example GB01: << 97 ============= << 98 << 99 This example illustrates how to bias process c << 100 << 101 << 102 Example GB02: << 103 ============= << 104 << 105 Illustrates a force collision scheme similar t << 106 << 107 << 108 Example GB03: << 109 ============= << 110 << 111 Illustrates geometry based biasing. << 112 << 113 << 114 Example GB04: << 115 ============= << 116 << 117 Illustrates a bremsstrahlung splitting. << 118 << 119 << 120 Example GB05: << 121 ============= << 122 << 123 Illustrates a "splitting by cross-section" tec << 124 technique using absorption cross-section to co << 125 << 126 << 127 Example GB06: << 128 ============= << 129 << 130 Illustrates the usage of parallel geometries w << 131 << 132 Example GB07: << 133 ============= << 134 << 135 Illustrates the usage of leading particle bias << 136 << 137 << 138 _____________________________________________ << 139 << 140 << 141 Reverse MonteCarlo Technique exam << 142 --------------------------------- << 143 << 144 Example ReverseMC01 << 145 =================== << 146 << 147 Example illustrating the use of the Reverse Mo << 148 application. See details in ReverseMC01/README << 149 89 >> 90 Compiling and running >> 91 --------------------- >> 92 To compile this example you need AIDA installed. To link >> 93 and run it you need a AIDA compliant analysis package. >> 94 Histograms are saved in HBOOK format. >> 95 You need to set the following variable in your environment: >> 96 "G4ANALYSIS_USE" >> 97 The example stores the plot in the file b02.hbook.