HOWTO View Geometry and test volumes with a geantino

From GlueXWiki
Revision as of 10:31, 7 March 2025 by Zihlmann (Talk | contribs)

Jump to: navigation, search

View and Test the Geometry

The purpose of this page is to show how to look at a geometry and use a geantino to test the implemented geometry that helps you to verify that all the volumes defined are actually visible to a particle when passing through the detector. If there are intersections between different volumes it can lead to unexpected behaviors for particles passing through such areas as some of the volumes may not be detected by the tracker depending on the direction the particle passes through this space.

Basic Requirements

The approach taken here is to use "hdgeant4", github repo., and run it with the options "-v", to create a graphics window, "-i" to run interactive and "-V #" to set the tracking verbose level (note, "-V4" does not work but "-V 4" does!). The command line looks something like this:

hdgeant4 -v -V 4 -i

There are two environment variables that define from where to read the geometry. These are:

HDDS_HOME

JANA_GEOMETRY_URL

If the URL is set for the data base then the geometry corresponding the the run number defined in "control.in" will be used. If the URL is set for a file as "xmlfile://main_HDDS.xml" the HDDS_HOME directory will be used to read in the geometry as found in that directory. Note the run number given in control.in can be overwritten on the command line with "-r N" where N is the desired run number.

The program hdgeant4 in such a startup requires two input files "control.in" and vis.mac. When hdgeant4 starts up it will read control.in and later searches to read in the file "vis.mac" by default. If "vis.mac" is not found it will write out a warning, if control.in is not found the code will quite with an error message.

There are two important cards in control.in that need to be defined as desired, KINE and SCAP. These two define the particle type, momentum and direction (KINE) and the event/track starting point (SCAP), respectively. At the time of this writing these parameters seem to be "frozen" in the hdteant4 session and no "/gun/position" and "/gun/momentum" command can overwrite these parameters.

The content of the initial vis.mac file could look something like this:

# file vis.mac
/control/verbose 2
/run/verbose 2
/vis/verbose all
/tracking/verbose 5
/vis/open OGLSX 600x600+10+50
/vis/ogl/set/displayListLimit 150000
/vis/viewer/set/autoRefresh false
/vis/viewer/set/background white