
Book For Application Developers Release 10.3 Geant4 Collaboration Nov 08, 2017 CONTENTS: 1 Introduction 1 1.1 Scope of this manual...........................................1 1.2 How to use this manual.........................................1 2 Getting Started with Geant4 - Running a Simple Example3 2.1 How to Define the main() Program...................................3 2.1.1 A Sample main() Method..................................3 2.1.2 G4RunManager ........................................4 2.1.3 User Initialization and Action Classes.............................5 2.1.4 G4UImanager and UI CommandSubmission........................6 2.1.5 G4cout and G4cerr .....................................7 2.2 How to Define a Detector Geometry...................................7 2.2.1 Basic Concepts.........................................7 2.2.2 Create a Simple Volume....................................8 2.2.3 Choose a Solid.........................................8 2.2.4 Create a Logical Volume....................................8 2.2.5 Place a Volume.........................................9 2.2.6 Create a Physical Volume....................................9 2.2.7 Coordinate Systems and Rotations...............................9 2.3 How to Specify Materials in the Detector................................ 10 2.3.1 General Considerations..................................... 10 2.3.2 Define a Simple Material.................................... 10 2.3.3 Define a Molecule........................................ 10 2.3.4 Define a Mixture by Fractional Mass.............................. 11 2.3.5 Define a Material from the Geant4 Material Database..................... 11 2.3.6 Define a Material from the Base Material........................... 11 2.3.7 Print Material Information................................... 12 2.3.8 Access to Geant4 material database.............................. 12 2.4 How to Specify Particles......................................... 12 2.4.1 Particle Definition........................................ 12 2.4.2 Range Cuts........................................... 14 2.5 How to Specify Physics Processes.................................... 15 2.5.1 Physics Processes........................................ 15 2.5.2 Managing Processes...................................... 16 2.5.3 Specifying Physics Processes.................................. 16 2.6 How to Generate a Primary Event.................................... 17 2.6.1 Generating Primary Events................................... 17 2.6.2 G4VPrimaryGenerator..................................... 19 2.7 Geant4 General Particle Source..................................... 20 2.7.1 Introduction........................................... 20 i 2.7.2 Configuration.......................................... 20 2.7.3 Macro Commands....................................... 24 2.7.4 Example Macro File...................................... 29 2.8 How to Make an Executable Program.................................. 31 2.8.1 Using CMake to build Applications: Geant4Config.cmake.................. 31 2.8.2 Using Geant4Make to build Applications: binmake.gmk................... 38 2.9 How to Set Up an Interactive Session.................................. 40 2.9.1 Introduction........................................... 40 2.9.2 A Short Description of Available Interfaces.......................... 41 2.9.3 How to Select Interface in Your Applications......................... 42 2.10 How to Execute a Program........................................ 43 2.10.1 Introduction........................................... 43 2.10.2 ‘Hard-coded’ Batch Mode................................... 44 2.10.3 Batch Mode with Macro File.................................. 44 2.10.4 Interactive Mode Driven by Command Lines......................... 45 2.10.5 General Case.......................................... 47 2.11 How to Visualize the Detector and Events................................ 49 2.11.1 Introduction........................................... 49 2.11.2 Visualization Drivers...................................... 49 2.11.3 How to Incorporate Visualization Drivers into an Executable................. 49 2.11.4 Writing the main() Method to Include Visualization..................... 50 2.11.5 Sample Visualization Sessions................................. 51 2.11.6 For More Information on Geant4 Visualization........................ 51 3 Toolkit Fundamentals 53 3.1 Class Categories and Domains...................................... 53 3.1.1 What is a class category?.................................... 53 3.1.2 Class categories in Geant4................................... 53 3.2 Global Usage Classes.......................................... 55 3.2.1 Signature of Geant4 classes................................... 55 3.2.2 The HEPRandom module in CLHEP.............................. 56 3.2.3 The HEPNumerics module................................... 59 3.2.4 General management classes.................................. 59 3.3 System of units.............................................. 61 3.3.1 Basic units........................................... 61 3.3.2 Input your data......................................... 61 3.3.3 Output your data........................................ 62 3.3.4 Introduce new units....................................... 62 3.3.5 Print the list of units...................................... 62 3.4 Run.................................................... 63 3.4.1 Basic concept of Run ...................................... 63 3.4.2 Geant4 as a state machine.................................... 65 3.4.3 User’s hook for state change.................................. 65 3.4.4 Customizing the Run Manager................................. 66 3.4.5 Managing worker thread.................................... 68 3.5 Event................................................... 68 3.5.1 Representation of an event................................... 68 3.5.2 Structure of an event...................................... 68 3.5.3 Mandates of G4EventManager ............................... 68 3.5.4 Stacking mechanism...................................... 69 3.6 Event Generator Interface........................................ 69 3.6.1 Structure of a primary event.................................. 69 3.6.2 Interface to a primary generator................................ 70 3.6.3 Event overlap using multiple generators............................ 72 ii 3.7 Event Biasing Techniques........................................ 72 3.7.1 Scoring, Geometrical Importance Sampling and Weight Roulette............... 72 3.7.2 Physics Based Biasing..................................... 79 3.7.3 Adjoint/Reverse Monte Carlo.................................. 83 3.7.4 Generic Biasing......................................... 88 4 Detector Definition and Response 95 4.1 Geometry................................................. 95 4.1.1 Introduction........................................... 95 4.1.2 Solids.............................................. 95 4.1.3 Logical Volumes........................................ 117 4.1.4 Physical Volumes........................................ 119 4.1.5 Touchables: Uniquely Identifying a Volume.......................... 129 4.1.6 Creating an Assembly of Volumes............................... 131 4.1.7 Reflecting Hierarchies of Volumes............................... 133 4.1.8 The Geometry Navigator.................................... 135 4.1.9 A Simple Geometry Editor................................... 141 4.1.10 Converting Geometries from Geant3.21............................ 143 4.1.11 Detecting Overlapping Volumes................................ 144 4.1.12 Dynamic Geometry Setups................................... 147 4.1.13 Importing XML Models Using GDML............................. 148 4.1.14 Importing ASCII Text Models................................. 148 4.1.15 Saving geometry tree objects in binary format......................... 149 4.2 Material.................................................. 149 4.2.1 General considerations..................................... 149 4.2.2 Introduction to the Classes................................... 149 4.2.3 Recipes for Building Elements and Materials......................... 151 4.2.4 The Tables............................................ 154 4.3 Electromagnetic Field.......................................... 154 4.3.1 An Overview of Propagation in a Field............................. 154 4.3.2 Practical Aspects........................................ 155 4.3.3 Spin Tracking.......................................... 161 4.4 Hits.................................................... 162 4.4.1 Hit................................................ 162 4.4.2 Sensitive detector........................................ 164 4.4.3 G4SDManager......................................... 164 4.4.4 G4MultiFunctionalDetector and G4VPrimitiveScorer ............ 165 4.4.5 Concrete classes of G4VPrimitiveScorer ........................ 168 4.4.6 G4VSDFilter and its derived classes............................ 169 4.4.7 Muiltiple sensitive detectors associated to a single logical-volume.............. 170 4.5 Digitization................................................ 170 4.5.1 Digi............................................... 170 4.5.2 Digitizer module........................................ 171 4.6 Object Persistency............................................ 172 4.6.1 Persistency in Geant4...................................... 172 4.6.2 Using Root-I/O for persistency of Geant4 objects......................
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages415 Page
-
File Size-