140 likes | 469 Views
Visualizing the geometry seen by Geant4. Using the visualization of Geant4 interactively through Gauss. Geometry seen by Geant4 may not be quite the same as what in DDDB + SIMCOND Pass a subset of geometry Not all information taken into account
E N D
Visualizing the geometry seen by Geant4 Using the visualization of Geant4 interactively through Gauss
Geometry seen by Geant4 may not be quite the same as what in DDDB + SIMCOND • Pass a subset of geometry • Not all information taken into account • Possible to visualize the geometry passed to Geant4 in a dedicated Gauss session • Extend the environment to include the visualization • Dedicated options in Gauss called GuassVis.opts that can be given as additional argument • “Three” different possibilities • DAWN • OpenGL • ASCIITREE: not really graphic! • https://twiki.cern.ch/twiki/bin/view/LHCb/FAQ/GaussVisualization • Withreferenceto the Geant4 relevantdocumentation Gauss Visualization Geometry as seen by Geant4
The default Gauss environment does not include neither the GEANT4 UI nor its visualization, it is necessary to set it up with the following: To start Gauss and access the interactive GEANT4 visualization examples options are provided The following GEANT4 prompt appears (after some time) Gauss Visualization A Gauss visualization session SetupProject Gauss v41r1 --tag_add=Vis In Gauss HEAD gaudirun.py $DECFILESROOT/options/52210050.py $LBPGUNSROOT/options/PGuns.pyMyOwnOptions.py $GAUSSOPTS/Gauss-Job.py$GAUSSOPTS/GaussVis.py GeomClosed>
Gauss Visualization A closer look to the options Activate the visualization Activate the G4 user interactive control, i.e. have the G4 UI prompt GiGa().VisManager= "GiGaVisManager/GiGaVis” GiGa().UIsession= "GiGaUIsession/GiGaUI” GiGa().GiGaMgr.RunTools+= ["GiGaSetVisAttributes”] Sets the visualization attributes Example of running in batch mode GiGa().EventSeq.Members+= ["GiGaEventActionCommand/VisEvtCmd”] GiGa.EventSeq.VisEvtCmd.EndOfEventCommands = [ "/vis/viewer/update”, … ] GiGa.EventSeq.VisEvtCmd.BeginOfEventCommands = [ "/vis/scene/create", … ] GiGa.EventSeq.Members += ["GiGaEventActionDraw/DrawEvent”] …and drawing an event
To start the DAWN Display at the interactive prompt or in the list of commands • A g4_00.prim file appears • Must run in a subdirectory called job for this to work (the file is writen in ../job/) • The .prim files can be large • Suggest to switch off the calorimeters to reduce the size • The contents of the file can be re-visualized (without running Gauss) by simply running DAWN on it: • And a DAWN GUI windows appears Gauss Visualization DAWNa vectorized 3D PostScript processor /vis/open DAWNFILE /vis/drawVolume /vis/viewer/flush dawn g4_00.prim
Gauss Visualization DAWN GUI Next page Select page Angles Zoom See axis /vis/viewer/set/viewpointThetaPhi 0 90 // X-Y /vis/viewer/set/viewpointThetaPhi 90 90 // X-Z /vis/viewer/set/viewpointThetaPhi 90 180 // Y-Z
Gauss Visualization DAWN GUI (cont.) Save the picture in an EPS file WARNING: These devices don’t work in current version “Interactive” mode It has some problems on some machines
DAWN make True Vector Postscript • when you zoom in with your PostScript browser, the images retain high resolution Gauss Visualization PostScript output WARNING: eps files can be big!
Only runs interactively as part of Gauss Gauss Visualization OpenGL Open Graphics Library /vis/open OGLSXm /vis/viewer/set/viewpointThetaPhi 180 90 /vis/drawVolume /vis/viewer/flush
A visualization driver that is not actually graphical, but that dumps the hierarchy as a simple text tree • List can be very big! Run in batch mode and redirect the output Gauss Visualization ASCIITree /vis/drawTree /vis/ASCIITree/verboseN Select the verbosity n>=10 : Print all the physical volumes n<10 : does not print daughters of repeated placements and does not repeat replicas The level of detail is given by verbosity%10 n>=0 : prints physical volume name n>=1 : prints logical volume name n>=2 : prints solid name and type n>=3 : volume and density n>=5 : daughter-subtracted volume and mass. And in the summary at the end of printing : n>=4 : daughter-included mass of top physical volume(s) in scene to depth specified. "Universe":0 … "/dd/Geometry/BeforeMagnetRegion/Velo/lvVelo#pvVeloLeft#pvModulePU00#pvPUPU00":1000 "/dd/Geometry/BeforeMagnetRegion/Velo/RPhiPairs/lvPUPairPU00#pvDetPu":1000 "/dd/Geometry/BeforeMagnetRegion/Velo/lvVelo#pvVeloLeft#pvModulePU02#pvPUPU02":100
Geant4 does not like overlapping volumes • Any geometry given to Gauss should be thoroughly checked for overlaps • Need to do it in Geant4 in ADDITION to using LHCb tools • The Geant4 DAVID visualizationtool can automaticallydetect the overlapsbetween the volumes and convertedto a graphicalrepresentationforvisualizationpurposes. • input file producedby DAWN • outputs the followingtwofiles • "g4david.log" in whichdetailed information ofintersection are described • "g4david.prim" describes a 3D scene withintersectedshapeshighlighted. Whenintersectionofshapesisdetected, DAVID visualizesautomatically the output file with DAWN. • https://twiki.cern.ch/twiki/bin/view/LHCb/FAQ/GaussCheckOverlap Gauss Visualization Checking overlaps in Geant4
Gauss Visualization Examples Right Edge = -175.0 + 0.455 = -174.545 OVERLAP! Left Edge = -174.4 - 0.15 = -174.550 rmin rmax dz sphi dphi dphi y dz rmax rmin O O x z This is an old example!
Gauss Visualization Example 2 ZOOM IN OVERLAP!