12.07.2015 Views

Geant4 User's Guide for Application Developers - Geant4 - CERN

Geant4 User's Guide for Application Developers - Geant4 - CERN

Geant4 User's Guide for Application Developers - Geant4 - CERN

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 4. Detector Definition and Response4.1. Geometry4.1.1. IntroductionThe detector definition requires the representation of its geometrical elements, their materials and electronicsproperties, together with visualization attributes and user defined properties. The geometrical representation ofdetector elements focuses on the definition of solid models and their spatial position, as well as their logicalrelations to one another, such as in the case of containment.<strong>Geant4</strong> uses the concept of "Logical Volume" to manage the representation of detector element properties. Theconcept of "Physical Volume" is used to manage the representation of the spatial positioning of detector elementsand their logical relations. The concept of "Solid" is used to manage the representation of the detector elementsolid modeling. Volumes and solids must be dynamically allocated in the user program; objects allocated areautomatically registered in dedicated stores which also take care to free the memory at the end of a job.The <strong>Geant4</strong> solid modeler is STEP compliant. STEP is the ISO standard defining the protocol <strong>for</strong> exchanginggeometrical data between CAD systems. This is achieved by standardizing the representation of solid models viathe EXPRESS object definition language, which is part of the STEP ISO standard.4.1.2. SolidsThe STEP standard supports multiple solid representations. Constructive Solid Geometry (CSG) representationsand Boundary Represented Solids (BREPs) are available. Different representations are suitable <strong>for</strong> different purposes,applications, required complexity, and levels of detail. CSG representations are easy to use and normallygive superior per<strong>for</strong>mance, but they cannot reproduce complex solids such as those used in CAD systems. BREPrepresentations can handle more extended topologies and reproduce the most complex solids.All constructed solids can stream out their contents via appropriate methods and streaming operators.For all solids it is possible to estimate the geometrical volume and the surface area by invoking the methods:G4double GetCubicVolume()G4double GetSurfaceArea()which return an estimate of the solid volume and total area in internal units respectively. For elementary solids thefunctions compute the exact geometrical quantities, while <strong>for</strong> composite or complex solids an estimate is madeusing Monte Carlo techniques.For all solids it is also possible to generate pseudo-random points lying on their surfaces, by invoking the methodG4ThreeVector GetPointOnSurface() constwhich returns the generated point in local coordinates relative to the solid.4.1.2.1. Constructed Solid Geometry (CSG) SolidsCSG solids are defined directly as three-dimensional primitives. They are described by a minimal set of parametersnecessary to define the shape and size of the solid. CSG solids are Boxes, Tubes and their sections, Cones andtheir sections, Spheres, Wedges, and Toruses.Box:To create a box one can use the constructor:65

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!