Geant4 Cross Reference |
1 ------------------------------------------------------------------- 2 3 ========================================================= 4 Geant4 - an Object-Oriented Toolkit for Simulation in HEP 5 ========================================================= 6 7 field03 8 ------- 9 10 Example of tracking in magnetic field where field associated 11 to selected logical volumes varies. 12 13 A global and a local magnetic field are defined in 14 the ConstructSDandField() method in the F03DetectorConstruction class 15 using the G4FieldBuilder class. 16 The local magnetic field is set to the "Radiator" volume. 17 18 The interactive commands, under the /field directory, are created with 19 the instantiation of G4FieldBuilder in the F03DetectorConstruction constructor, 20 21 1- GEOMETRY DEFINITION 22 23 The "Absorber" is a solid made of a given material. 24 25 Three parameters define the absorber : 26 - the material of the absorber, 27 - the thickness of an absorber, 28 - the transverse size of the absorber (the input face is a square). 29 30 The volume "World" contains the "Absorber". 31 In this test the parameters of the "World" can be changed , too. 32 33 A transverse global uniform magnetic field can be applied. 34 In addition, the "Radiator" volume, which is placed in geometry next 35 to the absorber, has a local magnetic field. 36 37 The default geometry is constructed in F03DetectorConstruction class, 38 but all the parameters can be changed via 39 the commands defined in the F03DetectorMessenger class. 40 41 2- AN EVENT : THE PRIMARY GENERATOR 42 43 The primary kinematic consists of a single particle which hits the 44 absorber perpendicular to the input face. The type of the particle 45 and its energy are set in the F03PrimaryGeneratorAction class, and can 46 be changed via the G4 build-in commands of G4ParticleGun class (see 47 the macros provided with this example). 48 49 It is also possible to change the position of the primary particle vertex 50 or activate its randomization via the commands defined in the 51 F01PrimaryGeneratorMessenger class. 52 53 A RUN is a set of events. 54 55 3- DETECTOR RESPONSE 56 57 A HIT is a record, event per event , of all the 58 informations needed to simulate and analyse the detector response. 59 60 In this example a F03CalorHit is defined as a set of 2 informations: 61 - the total energy deposit in the absorber, 62 - the total tracklength of all charged particles in the absorber, 63 64 Therefore the absorber is declared 65 'sensitive detector' (SD), see F03CalorimeterSD, which means they can contribute to the hit. 66 67 4- PHYSICS LIST 68 69 The particle's type and the physic processes which will be available 70 in this example are set in the FTFP_BERT physics list. This physics list 71 requires data files for electromagnetic and hadronic processes. 72 See more on installation of the datasets in Geant4 Installation Guide, 73 74 5- HOW TO START ? 75 76 - Execute field03 in 'batch' mode from macro files e.g. 77 % ./field03 field03.in 78 79 - Execute field03 in 'interactive' mode with visualization e.g. 80 % ./field03 81 .... 82 Idle> /run/beamOn 1 83 ....