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 ResponseAt present physical volumes made of the following solids are able to be debugged: G4Box, G4Cons, G4Para,G4Sphere, G4Trd, G4Trap, G4Tubs. (Existence of other solids is harmless.)Visual debugging of physical-volume surfaces is per<strong>for</strong>med with the DAWNFILE driver defined in the visualizationcategory and with the two application packages, i.e. Fukui Renderer "DAWN" and a visual intersectiondebugger "DAVID". DAWN and DAVID can be downloaded from the Web.How to compile <strong>Geant4</strong> with the DAWNFILE driver incorporated is described in Section 8.3.If the DAWNFILE driver, DAWN and DAVID are all working well in your host machine, the visual intersectiondebugging of physical-volume surfaces can be per<strong>for</strong>med as follows:Run your <strong>Geant4</strong> executable, invoke the DAWNFILE driver, and execute visualization commands to visualizeyour detector geometry:Idle> /vis/open DAWNFILE.....(setting camera etc)...Idle> /vis/drawVolumeIdle> /vis/viewer/updateThen a file "g4.prim", which describes the detector geometry, is generated in the current directory and DAVIDis invoked to read it. (The description of the <strong>for</strong>mat of the file g4.prim can be found from the DAWN web sitedocumentation.)If DAVID detects intersection of physical-volume surfaces, it automatically invokes DAWN to visualize the detectorgeometry with the intersected physical volumes highlighted (See the above sample visualization).If no intersection is detected, visualization is skipped and the following message is displayed on the console:------------------------------------------------------!!! Number of intersected volumes : 0 !!!!!! Congratulations ! \(^o^)/ !!!------------------------------------------------------If you always want to skip visualization, set an environmental variable as follows be<strong>for</strong>ehand:% setenv DAVID_NO_VIEW 1To control the precision associated to computation of intersections (default precision is set to 9), it is possible touse the environmental variable <strong>for</strong> the DAWNFILE graphics driver, as follows:% setenv G4DAWNFILE_PRECISION 10If necessary, re-visualize the detector geometry with intersected parts highlighted. The data are saved in a file"g4david.prim" in the current directory. This file can be re-visualized with DAWN as follows:% dawn g4david.primIt is also helpful to convert the generated file g4david.prim into a VRML-<strong>for</strong>matted file and per<strong>for</strong>m interactivevisualization of it with your WWW browser. The file conversion tool prim2wrml can be downloaded from theDAWN web site download pages.For more details, see the document of DAVID mentioned above.4.1.11.4. Using the geometry debugging tool OLAPOLAP is a tool developed in the CMS experiment at <strong>CERN</strong> to help in identifying ovelapping volumes in a detectorgeometry. It is placed in the area <strong>for</strong> specific tools/examples, in geant4/examples/extended/geometry.The technique consists in shooting geantinos particles in one direction and the opposite one, and verifying thatthe boundary crossings are the same.The tool can be used <strong>for</strong> any <strong>Geant4</strong> geometry, provided that the user geometry to be debugged is available as asubclass of G4VUserDetectorConstruction and is used to construct the OlapDetConstr class of thetool. A dummy class RandomDetector is provided <strong>for</strong> this purpose in the tool itself.111

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

Saved successfully!

Ooh no, something went wrong!