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.

Detector Definition and ResponseSampleNestedParameterisation::ComputeMaterial(G4VPhysicalVolume *currentVol,const G4int no_lev,const G4VTouchable *parentTouchable){G4Material *material=0;}// Get the in<strong>for</strong>mation about the parent volumeG4int no_parent= parentTouchable->GetReplicaNumber();G4int no_total= no_parent + no_lev;// A simple 'checkerboard' pattern of two materialsif( no_total / 2 == 1 ) material= material1;else material= material2;// Set the material to the current logical volumeG4LogicalVolume* currentLogVol= currentVol->GetLogicalVolume();currentLogVol->SetMaterial( material );return material;Nested parameterisations are suitable <strong>for</strong> the case of regular, 'voxel' geometries in which a large number of 'equal'volumes are required, and their only difference is in their material. By creating two (or more) levels of parameterisedphysical volumes it is possible to divide space, while requiring only limited additional memory <strong>for</strong> veryfine-level optimisation. This provides fast navigation. Alternative implementations, taking into account the regularstructure of such geometries in navigation are under study.Divisions of VolumesDivisions in <strong>Geant4</strong> are implemented as a specialized type of parameterised volumes.They serve to divide a volume into identical copies along one of its axes, providing the possibility to define anoffset, and without the limitation that the daugthers have to fill the mother volume as it is the case <strong>for</strong> the replicas.In the case, <strong>for</strong> example, of a tube divided along its radial axis, the copies are not strictly identical, but haveincreasing radii, although their widths are constant.To divide a volume it will be necessary to provide:1. the axis of division, and2. either• the number of divisions (so that the width of each division will be automatically calculated), or• the division width (so that the number of divisions will be automatically calculated to fill as much of themother as possible), or• both the number of divisions and the division width (this is especially designed <strong>for</strong> the case where the copiesdo not fully fill the mother).An offset can be defined so that the first copy will start at some distance from the mother wall. The dividing copieswill be then distributed to occupy the rest of the volume.There are three constructors, corresponding to the three input possibilities described above:• Giving only the number of divisions:G4PVDivision( const G4String& pName,G4LogicalVolume* pCurrentLogical,G4LogicalVolume* pMotherLogical,const EAxis pAxis,const G4int nDivisions,const G4double offset )• Giving only the division width:G4PVDivision( const G4String& pName,G4LogicalVolume* pCurrentLogical,G4LogicalVolume* pMotherLogical,const EAxis pAxis,const G4double width,const G4double offset )91

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

Saved successfully!

Ooh no, something went wrong!