Difference between revisions of "HOWTO visually inspect the simulation geometry"

From GlueXWiki
Jump to: navigation, search
Line 6: Line 6:
 
  1) generate the geometry fortran file in the hdds directory by "make hddsGeant3.F"
 
  1) generate the geometry fortran file in the hdds directory by "make hddsGeant3.F"
 
  2) copy hddsGeant3.F into the HDGeant directory and recompile hdgeant++ by "make clean; make"
 
  2) copy hddsGeant3.F into the HDGeant directory and recompile hdgeant++ by "make clean; make"
 +
    important link option needed "-Wl,-export-dynamic" to link hdgeant++! (see Makefile.orig)
 
  3) make sure you have "wc.kumac" and "wc.f" in your working directory
 
  3) make sure you have "wc.kumac" and "wc.f" in your working directory
 
  4) start "hdgeant++" in your working directory
 
  4) start "hdgeant++" in your working directory

Revision as of 13:52, 29 July 2008

This page shows how to use geant++ and root to check if the detector geometry has been done right.


Using hdgeant++

  • hdgeant++ is based on GEANT3 and uses also paw. So being familiar with kumac is usefull. To check if some modification in an xml file has been done correctly you do the followoing:
1) generate the geometry fortran file in the hdds directory by "make hddsGeant3.F"
2) copy hddsGeant3.F into the HDGeant directory and recompile hdgeant++ by "make clean; make"
   important link option needed "-Wl,-export-dynamic" to link hdgeant++! (see Makefile.orig)
3) make sure you have "wc.kumac" and "wc.f" in your working directory
4) start "hdgeant++" in your working directory
  • wc#modules in hdgeant++: in the command window of hdgeant++ you can type in paw and geant commands or execute a kumac script.
1) exec wc#setorigin x y z           : this will set the point x,y,z to be in the center of the display window. 
2) exec wc#dcut cdc z 0 10 10 1 1    : this will plot the "cdc" geometry with a cut at showing the x-y plane at z=0 with the
                                       viewpoint horizontal 10 and vertical 10 and horizontal and vertical scale 1 1
3) exec wc#dcut site x 0 2 10 0.4 0.4: example using volume "site"
4) exec wc#pick                      : show a cross-hair in the window. using left mouse-button to pick volumes (can be use more than once)
                                       after the last pick us the right mouse-button to finish. At this point all picked coordinate are
                                       printed together with the corresponding volume information.


Using root

  • The program hdds-root in the hdds directory generates hddsroot.C by typing "make hddsroot.C" this file represents an implementation of the geometry unsing the root TGeo package.
1) after generating hddsroot.C start root
2) .L hddsroot.C  : loads the hddsroot.C module
3) hddsroot();    : execute the module hddsroot. A graphics window will pup.
4) select in menu "View" and "View with" OpenGL
5) use the Help menu to learn more.
6) on the root command prompt you can use any root command. Look in the description of the TGeoVolume class what useful functions there are.
7) use TGeoVolume::CheckGeometry() to test if volumes are seen by geant tracks.