Geant4 Cross Reference |
1 Example GB07 : leading particl 1 Example GB07 : leading particle biasing 2 ------------------------------ 2 ---------------------------------------- 3 3 4 This example illustrates how to use the le 4 This example illustrates how to use the leading particle biasing option. 5 5 6 It uses the G4BOptnLeadingParticle biasing 6 It uses the G4BOptnLeadingParticle biasing operation located in: 7 7 8 source/processes/biasing/ 8 source/processes/biasing/generic , 9 9 10 and defines the following biasing operation to 10 and defines the following biasing operation to handle it: 11 11 12 GB07OptrLeadingParticl 12 GB07OptrLeadingParticle. 13 13 14 As a reminder, the generic biasing scheme 14 As a reminder, the generic biasing scheme consists of a G4VBiasingOperator 15 that takes decisions on what sort of biasing t 15 that takes decisions on what sort of biasing technique to be applied. The 16 techniques are called biasing operations, repr 16 techniques are called biasing operations, represented by the G4VBiasingOperation 17 class. The operator is attached to a logical v 17 class. The operator is attached to a logical volume in which the biasing must 18 happen. Decisions are made on requests of the 18 happen. Decisions are made on requests of the G4BiasingProcessInterface process 19 that messages the operator when the track is t 19 that messages the operator when the track is travelling in the volume. To equip 20 the phyics list with this process, the G4Gener 20 the phyics list with this process, the G4GenericBiasingPhysics physics 21 constructor is used. In this example, several 21 constructor is used. In this example, several processes -to which the technique 22 is applied- are wrapped by this process to con 22 is applied- are wrapped by this process to control their final state production 23 for applying the biasing technique. 23 for applying the biasing technique. 24 24 25 25 26 Geometry: 26 Geometry: 27 --------- 27 --------- 28 28 29 The geometry is simply : 29 The geometry is simply : 30 - a volume in which the biasing occurs and 30 - a volume in which the biasing occurs and to which an instance of 31 GB07OptrLeadingParticle is attached, 31 GB07OptrLeadingParticle is attached, 32 - a thin volume placed after the above vol 32 - a thin volume placed after the above volume, that is used to tally the 33 particles exiting biasing volume. 33 particles exiting biasing volume. 34 - a sensitive detector is attached to the 34 - a sensitive detector is attached to the thin volume to simply print the 35 particles entering here. In particular t 35 particles entering here. In particular the statistical weight is printed, 36 this one is obtained by: 36 this one is obtained by: 37 37 38 w = track->GetWeight() 38 w = track->GetWeight() ; 39 39 40 40 41 Biasing configuration: 41 Biasing configuration: 42 ---------------------- 42 ---------------------- 43 43 44 The particle types and processes under the 44 The particle types and processes under the leading particle biasing are 45 visible in the main program exampleGB07.cc, th 45 visible in the main program exampleGB07.cc, these are: 46 46 47 pi+ and pi-, inelastic proc 47 pi+ and pi-, inelastic process, 48 proton and anti-proton, inelastic process, 48 proton and anti-proton, inelastic process, 49 neutron, inelastic and captur 49 neutron, inelastic and capture processes, 50 anti-neutron, inelastic process, 50 anti-neutron, inelastic process, 51 51 52 gamma, conversion and photo 52 gamma, conversion and photonNuclear processes, 53 electron, electronNuclear proc 53 electron, electronNuclear process, 54 positron, annihilation and pos 54 positron, annihilation and positronNuceal processes, 55 55 56 pi0, decay process. 56 pi0, decay process. 57 57 58 For the inelastic and lepto/gamma-nuclear 58 For the inelastic and lepto/gamma-nuclear processes, leading particle is applied in a rather 59 classical way: 59 classical way: 60 - keep the leading particle, 60 - keep the leading particle, 61 - keep one particle of each species (particl 61 - keep one particle of each species (particles and anti-particles are considered a one 62 species, and all hadrons with Z>=2 are counted 62 species, and all hadrons with Z>=2 are counted as one species too). 63 For e+, e-, gamma and pi0 processes (which 63 For e+, e-, gamma and pi0 processes (which means in practice main conversion, annihililation 64 and pi0 decay processes), the leading particle 64 and pi0 decay processes), the leading particle is kept, and the companion track(s) is(are) randomly 65 kept/killed under a Russian roulette, with a 2 65 kept/killed under a Russian roulette, with a 2/3 killing probabilty. See 66 GB07BOptrLeadingParticle::StartTracking( ... ) 66 GB07BOptrLeadingParticle::StartTracking( ... ) for this killing probability setting. 67 67 68 68 69 Running the program: 69 Running the program: 70 -------------------- 70 -------------------- 71 71 72 The program can be run in batch or interac 72 The program can be run in batch or interactive mode and has the following options: 73 73 74 in batch: 74 in batch: 75 ./exampleGB07 [-m macro ] [-b bia 75 ./exampleGB07 [-m macro ] [-b biasing {'on' = default,'off'}] 76 or 76 or 77 ./exampleGB07 [macro.mac] 77 ./exampleGB07 [macro.mac] 78 interactive: 78 interactive: 79 ./exampleGB07 [-b biasing 79 ./exampleGB07 [-b biasing {'on' = default,'off'}] 80 80 81 81 82 82 83 83 84 84