This example illustrates the use of the text geometry.
Several examples of text geometries are provided:
g4geom_simple.txt :
g4geom_matemixt.txt :
g4geom_boolean.txt :
g4geom_reflections.txt :
g4geom_replicas.txt :
g4geom_divisions.txt :
g4geom_paramLinear.txt :
g4geom_paramSquare.txt :
g4geom_assembly.txt :
Execute textGeom in 'batch' mode from macro file
% textGeom run.mac
It will read the geometry from a file named 'g4geom.txt', and it will create a VRML2 file to visualise the geometry. Therefore if you want to try any of the above-mentioned files, copy it to a file with this name,
The detector construction class ExTGDetectorConstructionWithSD shows how to access a volume of the text geometry and assign to it a sensitive detector. To use it, replace at exampleTextGeom.cc the line
runManager->SetUserInitialization(new ExTGDetectorConstruction);
by
runManager->SetUserInitialization(new ExTGDetectorConstructionWithSD);
and recompile.
It will use the geometry from the file 'g4geom_SD.txt'
The detector construction class ExTGDetectorConstructionWithCpp shows how to create a volume with C++ and place it in the world or inside a volume defined in the text geometry. To use it, replace at exampleTextGeom.cc the line
runManager->SetUserInitialization(new ExTGDetectorConstruction);
by
runManager->SetUserInitialization(new ExTGDetectorConstructionWithCpp);
and recompile.
It will use the geometry from the file 'g4geom_simple.txt'
The detector construction class ExTGDetectorConstructionWithCuts, together with ExTGRCLineProcessor, ExTGRCDetectorBuilder, ExTGRCRegionCutsMgr and ExTGRCRegionData show how to add a couple of tags, ':REGION' and ':CUT', that allow to define cuts per region in your input geometry text file. To use it, replace at exampleTextGeom.cc the line
runManager->SetUserInitialization(new ExTGDetectorConstruction);
by
runManager->SetUserInitialization(new ExTGDetectorConstructionWithCuts);
and recompile.
It will use the geometry from the file 'g4geom_cutsPerRegion.txt'
The run action, ExTGRunAction, triggers the writing of the in-memory Geant4 geometry to a text file. To use it you just have to uncomment in exampleTextGeom.cc the line
runManager->SetUserAction(new ExTGRunAction);
and it will read the geometry from the file 'g4geom.txt' and will write the geometry in a file named 'geom.txt'