<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <br>
    Hi All,<br>
    <br>
      As I mentioned at the Offline Software meeting today, I have
    written a new<br>
    utility for examining the geometry. Specifically, if one gives it an
    X,Y,Z coordinate<br>
    in the lab frame, it will print the volume and material properties
    for the<br>
    volume at that point. It will also list the entire volume hierarchy
    of that volume<br>
    outwards to the outermost Mother volume. Here is an example querying
    the center<br>
    of the target.<br>
    <div class="moz-forward-container"><br>
      <tt>>hd_geom_query 0 0 65</tt><br>
      <br>
      <tt>   Location: (X, Y, Z) = (0, 0, 65)</tt><tt><br>
      </tt><tt>===============================================</tt><tt><br>
      </tt><tt>     Volume: LIH2</tt><tt><br>
      </tt><tt>   material: LiqHydrogen</tt><tt><br>
      </tt><tt>    density: 0.0708 g/cm^3</tt><tt><br>
      </tt><tt>rad. length: 816.933 cm</tt><tt><br>
      </tt><tt>          A: 1.00797</tt><tt><br>
      </tt><tt>          Z: 1</tt><tt><br>
      </tt><tt>  ancestory: LIH2 -> TGTV -> TARG -> HALL ->
        SITE</tt><br>
      <br>
      One can also have it generate the geometry from the XML at
      run-time<br>
      using external HDDS tools similar to what was recently done with
      hdgeant.<br>
      <br>
      If the program is run with no arguments, a Usage statement is
      printed:<br>
      <br>
      <tt>>hd_geom_query<br>
        <br>
        Usage:<br>
            hd_geom_query [options] X Y Z<br>
        <br>
        Print the material properties for the specified point in lab<br>
         coordinates. Units of X,Y, and Z are cm.<br>
        <br>
        By default, this uses the geometry built into the file
        libHDGEOMETRY.a<br>
        that was used to link this executable. The -xml switch may be
        used<br>
        to dynamically compile and link code generated from the XML at
        run<br>
        time. If an equals sign "=" follows the -xml switch then the<br>
        main_HDDS.xml file is taken from the remainder of that argument.<br>
        <br>
        If the -xml switch is specified, then a file named
        "tmp_hddsroot.so"<br>
        is searched for in the current directory. If found, it is opened
        and<br>
        the geometry checksum is read from it and compared to that of
        the XML<br>
        specified (which may be the default of
        $HDDS_HOME/main_HDDS.xml).<br>
        If the two match, then that shared object is used, bypassing the<br>
        (expensive) compilation phase. If the file is not present, is
        unreadable,<br>
        or the checksums don't match, then the shared object is
        automatically<br>
        (re)generated.<br>
        <br>
         options:<br>
            -h or --help          Print this usage statement<br>
            -xml[=main_HDDS.xml]  Dynamically generate geometry<br>
            -checksum             Print the MD5 checksum of the <br>
                                  geometry and exit<br>
        <br>
        If the -xml option is given and no file is specified,<br>
        then a value of: $HDDS_HOME/main_HDDS.xml<br>
        is used.<br>
      </tt><br>
      The source for this is now in the sim-recon tree and can be found
      here:<br>
      <br>
<a class="moz-txt-link-freetext" href="https://halldsvn.jlab.org/repos/trunk/sim-recon/src/programs/Utilities/hd_geom_query">https://halldsvn.jlab.org/repos/trunk/sim-recon/src/programs/Utilities/hd_geom_query</a><br>
      <br>
      <br>
      Regards,<br>
      -David<br>
      <br>
      <br>
      -------- Original Message --------
      <table class="moz-email-headers-table" border="0" cellpadding="0"
        cellspacing="0">
        <tbody>
          <tr>
            <th nowrap="nowrap" align="RIGHT" valign="BASELINE">Subject:
            </th>
            <td>r10030 - in trunk/sim-recon/src/programs/Utilities: .
              hd_geom_query</td>
          </tr>
          <tr>
            <th nowrap="nowrap" align="RIGHT" valign="BASELINE">Date: </th>
            <td>Wed, 28 Nov 2012 10:37:40 -0500</td>
          </tr>
          <tr>
            <th nowrap="nowrap" align="RIGHT" valign="BASELINE">From: </th>
            <td><a class="moz-txt-link-abbreviated" href="mailto:Hall-D.SVN.Repository@jlab.org">Hall-D.SVN.Repository@jlab.org</a></td>
          </tr>
          <tr>
            <th nowrap="nowrap" align="RIGHT" valign="BASELINE">To: </th>
            <td><a class="moz-txt-link-abbreviated" href="mailto:davidl@jlab.org">davidl@jlab.org</a>, <a class="moz-txt-link-abbreviated" href="mailto:brash@pcs.cnu.edu">brash@pcs.cnu.edu</a>, <a class="moz-txt-link-abbreviated" href="mailto:wolin@jlab.org">wolin@jlab.org</a>,
              <a class="moz-txt-link-abbreviated" href="mailto:zisis@uregina.ca">zisis@uregina.ca</a>, <a class="moz-txt-link-abbreviated" href="mailto:mashephe@indiana.edu">mashephe@indiana.edu</a>,
              <a class="moz-txt-link-abbreviated" href="mailto:remitche@indiana.edu">remitche@indiana.edu</a>, <a class="moz-txt-link-abbreviated" href="mailto:zihlmann@jlab.org">zihlmann@jlab.org</a>, <a class="moz-txt-link-abbreviated" href="mailto:somov@jlab.org">somov@jlab.org</a>,
              <a class="moz-txt-link-abbreviated" href="mailto:staylor@jlab.org">staylor@jlab.org</a>, <a class="moz-txt-link-abbreviated" href="mailto:kmoriya@indiana.edu">kmoriya@indiana.edu</a>, <a class="moz-txt-link-abbreviated" href="mailto:pmatt@jlab.org">pmatt@jlab.org</a>,
              <a class="moz-txt-link-abbreviated" href="mailto:leckey@jlab.org">leckey@jlab.org</a></td>
          </tr>
        </tbody>
      </table>
      <br>
      <br>
      <pre>Author: davidl
Date: 2012-11-28 10:37:40 -0500 (Wed, 28 Nov 2012)
New Revision: 10030

Added:
   trunk/sim-recon/src/programs/Utilities/hd_geom_query/
   trunk/sim-recon/src/programs/Utilities/hd_geom_query/Makefile
   trunk/sim-recon/src/programs/Utilities/hd_geom_query/hd_geom_query.cc
Log:
A new utility to get info on the volume located at a
specific location in lab coordinates. This uses the
ROOT TGeo facility. The hddsroot.h file generated by
HDDS is compiled in and used by default. An option
exists to regenerate this file and compile and link 
it dynamically similar to what is now done in hdgeant.


</pre>
      <br>
    </div>
    <br>
  </body>
</html>