Warning, /geant4/examples/extended/persistency/P03/README.md is written in an unsupported language. File is not indexed.
0001 \page ExampleP03 Example P03
0002
0003 This example illustrates the use of the text geometry.
0004
0005 ## GEOMETRY EXAMPLES
0006
0007 Several examples of text geometries are provided:
0008
0009 g4geom_simple.txt :
0010 - Simple construction of materials and single placements
0011
0012 g4geom_matemixt.txt :
0013 - Isotopes, elements and materials
0014
0015 g4geom_boolean.txt :
0016 - Boolean solids
0017
0018 g4geom_reflections.txt :
0019 - Reflections
0020
0021 g4geom_replicas.txt :
0022 - Replicas
0023
0024 g4geom_divisions.txt :
0025 - Divisions
0026
0027 g4geom_paramLinear.txt :
0028 - Linear parameterisations
0029
0030 g4geom_paramSquare.txt :
0031 - Square parameterisations
0032
0033 g4geom_assembly.txt :
0034 - Assembly placements
0035
0036
0037 ## HOW TO START ?
0038
0039 Execute textGeom in 'batch' mode from macro file
0040 ```
0041 % ./textGeom run.mac
0042 ```
0043
0044 It will read the geometry from a file named 'g4geom.txt', and it will create a
0045 VRML2 file to visualise the geometry.
0046 Therefore if you want to try any of the above-mentioned files, copy it to a
0047 file with this name,
0048
0049
0050 ## DEFINING A SENSITIVE DETECTOR
0051
0052 The detector construction class ExTGDetectorConstructionWithSD shows how to
0053 access a volume of the text geometry and assign to it a sensitive detector.
0054 To use it, replace at exampleTextGeom.cc the line
0055
0056 ```cpp
0057 runManager->SetUserInitialization(new ExTGDetectorConstruction);
0058 ```
0059
0060 by
0061
0062 ```cpp
0063 runManager->SetUserInitialization(new ExTGDetectorConstructionWithSD);
0064 ```
0065
0066 and recompile.
0067
0068 It will use the geometry from the file 'g4geom_SD.txt'
0069
0070
0071 ## MIXING TEXT AND C++ GEOMETRIES
0072
0073 The detector construction class ExTGDetectorConstructionWithCpp shows how to
0074 create a volume with C++ and place it in the world or inside a volume defined
0075 in the text geometry.
0076 To use it, replace at exampleTextGeom.cc the line
0077
0078 ```cpp
0079 runManager->SetUserInitialization(new ExTGDetectorConstruction);
0080 ```
0081
0082 by
0083
0084 ```cpp
0085 runManager->SetUserInitialization(new ExTGDetectorConstructionWithCpp);
0086 ```
0087
0088 and recompile.
0089
0090 It will use the geometry from the file 'g4geom_simple.txt'
0091
0092
0093 ## CREATING NEW TAGS IN THE TEXT GEOMETRY: DEFINING CUTS PER REGION
0094
0095 The detector construction class ExTGDetectorConstructionWithCuts, together with
0096 ExTGRCLineProcessor, ExTGRCDetectorBuilder, ExTGRCRegionCutsMgr and
0097 ExTGRCRegionData show how to add a couple of tags, ':REGION' and ':CUT', that
0098 allow to define cuts per region in your input geometry text file.
0099 To use it, replace at exampleTextGeom.cc the line
0100
0101 ```cpp
0102 runManager->SetUserInitialization(new ExTGDetectorConstruction);
0103 ```
0104
0105 by
0106
0107 ```cpp
0108 runManager->SetUserInitialization(new ExTGDetectorConstructionWithCuts);
0109 ```
0110
0111 and recompile.
0112
0113 It will use the geometry from the file 'g4geom_cutsPerRegion.txt'
0114
0115
0116 ## DUMP THE IN-MEMORY GEOMETRY TO TEXT FILE
0117
0118 The run action, ExTGRunAction, triggers the writing of the in-memory Geant4
0119 geometry to a text file.
0120 To use it you just have to uncomment in exampleTextGeom.cc the line
0121
0122 ```cpp
0123 runManager->SetUserAction(new ExTGRunAction);
0124 ```
0125
0126 and it will read the geometry from the file 'g4geom.txt' and will write the
0127 geometry in a file named 'geom.txt'