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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Detector Definition and ResponseG4QuadrangularFacet ( const G4ThreeVector Pt0,const G4ThreeVector vt1,const G4ThreeVector vt2,const G4ThreeVector vt3,G4FacetVertexType fType )i.e., it takes 5 parameters to define the four vertices:G4FacetVertexTypeG4FacetVertexTypeABSOLUTE in which case Pt0, vt1, vt2 and vt3 arethe four vertices required in anti-clockwise order whenlooking from the outside.RELATIVE in which case the first vertex is Pt0, thesecond vertex is Pt0+vt, the third vertex is Pt0+vt2and the fourth vertex is Pt0+vt3, in anti-clockwise orderwhen looking from the outside.Importing CAD models as tessellated shapesTessellated solids can also be used to import geometrical models from CAD systems (see Figure 4.1). In order todo this, it is required to convert first the CAD shapes into tessellated surfaces. A way to do this is to save the shapesin the geometrical model as STEP files and convert them to tessellated (faceted surfaces) solids, using a tool whichallows such conversion. At the time of writing, at least two tools are available <strong>for</strong> such purpose: STViewer (part ofthe STEP-Tools development suite) or FASTRAD. This strategy allows to import any shape with some degree ofapproximation; the converted CAD models can then be imported through GDML (Geometry Description MarkupLanguage) into <strong>Geant4</strong> and be represented as G4TessellatedSolid shapes.4.1.3. Logical VolumesThe Logical Volume manages the in<strong>for</strong>mation associated with detector elements represented by a given Solid andMaterial, independently from its physical position in the detector.A Logical Volume knows which physical volumes are contained within it. It is uniquely defined to be their mothervolume. A Logical Volume thus represents a hierarchy of unpositioned volumes whose positions relative to oneanother are well defined. By creating Physical Volumes, which are placed instances of a Logical Volume, thishierarchy or tree can be repeated.A Logical Volume also manages the in<strong>for</strong>mation relative to the Visualization attributes (Section 8.6) and user-definedparameters related to tracking, electro-magnetic field or cuts (through the G4UserLimits interface).By default, tracking optimization of the geometry (voxelization) is applied to the volume hierarchy identified bya logical volume. It is possible to change the default behavior by choosing not to apply geometry optimization<strong>for</strong> a given logical volume. This feature does not apply to the case where the associated physical volume is aparameterised volume; in this case, optimization is always applied.G4LogicalVolume( G4VSolid*pSolid,G4Material*pMaterial,const G4String& Name,G4FieldManager* pFieldMgr=0,G4VSensitiveDetector* pSDetector=0,G4UserLimits*pULimits=0,G4bool Optimise=true )Through the logical volume it is also possible to tune the granularity of the optimisation algorithm to be appliedto the sub-tree of volumes represented. This is possible using the methods:G4double GetSmartless() constvoid SetSmartless(G4double s)The default smartless value is 2 and controls the average number of slices per contained volume which are usedin the optimisation. The smaller the value, the less fine grained optimisation grid is generated; this will translatein a possible reduction of memory consumed <strong>for</strong> the optimisation of that portion of geometry at the price of aslight CPU time increase at tracking time. Manual tuning of the optimisation is in general not required, since the83

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

Saved successfully!

Ooh no, something went wrong!