GeometryBrowserTutorial: Difference between revisions

From Mu2eWiki
Jump to navigation Jump to search
(Created page with "==Introduction== This page has an introduction to viewing the Mu2e geometry using ROOT's TGeometry browser. The input to this exercise is a GDML file that was created by runn...")
 
No edit summary
Line 8: Line 8:
<li> Download [http://mu2e.fnal.gov/atwork/computing_retired/Tutorials/2016/GeometryBrowsing/GeometryBrowsing.tar.gz this gzipped tar file]
<li> Download [http://mu2e.fnal.gov/atwork/computing_retired/Tutorials/2016/GeometryBrowsing/GeometryBrowsing.tar.gz this gzipped tar file]
       which contains the GDML file plus some scripts for viewing it.
       which contains the GDML file plus some scripts for viewing it.
       The GDML file was created using Offline v5_7_7.<p>
       The GDML file was created using Offline v5_7_7.</li>
  <li> Extract the files:
  <li> Extract the files:
<pre>
<pre>
Line 27: Line 27:
contain some summary information about each volume.
contain some summary information about each volume.
The following items will walk you through using
The following items will walk you through using
these files.<p>
these files.</li>
<li> cd into the new directory and setup a modern release of root:
<li> cd into the new directory and setup a modern release of root:
<pre>
<pre>
Line 38: Line 38:
source /cvmfs/mu2e.opensciencegrid.org/Offline/v7_0_4/SLF6/prof/Offline/setup.sh
source /cvmfs/mu2e.opensciencegrid.org/Offline/v7_0_4/SLF6/prof/Offline/setup.sh
</pre>
</pre>
Among many other things, this will setup a modern version of root.<p>
Among many other things, this will setup a modern version of root.</li>
<li> If you logout and login again, repeat step 3.
<li> If you logout and login again, repeat step 3.</li>
</ol>
</ol>
===Exercises===
<ul>
  <li> Exercise 1: Use the script world.C to get basic familiarity with the
      browser.  This script shows shows the full Mu2e world volume - so most of what
      you see it earth and concrete.  Look at the script world.C.  It has three steps:
      <ul>
          <li> Read the GDML file
          <li> Create a TBrowser window
          <li> Draw the geometry starting from the highest level volume, the
                Mu2e world volume.
      </ul>
      View the introductory video in either [http://mu2e.fnal.gov/atwork/computing_retired/Tutorials/2016/GeometryBrowsing/world.mov (.mov)] or
      [http://mu2e.fnal.gov/atwork/computing_retired/Tutorials/2016/GeometryBrowsing/world.mp4 (.mp4)] format;
      this video illustrates the basics of
      using the TGeometry browser.  Try it yourself:
<pre>
root -l world.C
</pre>
      If you see no display and you see an error message "cannot load swrast driver",
      follow the instructions on the page that discusses the
      [ComputingLogin#Mac_OpenGL_3D_Error|OPEN GL 3D graphics error].
  <li> Exercise 2: In this exercise you will learn how to use the clipping
      features of the TGeometry browser.  This exercise also uses the
      script world.C.  View the video that shows how to use the clipping features
      ( formats:  [http://mu2e.fnal.gov/atwork/computing_retired/Tutorials/2016/GeometryBrowsing/clipping.mov (.mov)] or  [http://mu2e.fnal.gov/atwork/computing_retired/Tutorials/2016/GeometryBrowsing/clipping.mp4 (.mp4)]).
<pre>
root -l world.C
</pre>
After viewing the video, practice clipping yourself.
<li> Exercise 3: The previous two exercises told the browser to start from the
    top of the volume heirarchy; in this exercise you will learn how to tell the
    browser to start from somewhere else in the heirarchy.  Look at the file
    TrackerMother.C; compared to world.C the only difference is the last line,
    which tells the code to start from a particular named volume, the
    mother volume of the tracking system.  To run the exercise:
<pre>
root -l TrackerMother.C
</pre>
Experiment a bit with zooming, rotating and picking volumes; don't spend
too much time because the next exercise will highlight a few of the volumes
with color.
You can read about the tracker geometry in
[http://mu2e-docdb.fnal.gov:8080/cgi-bin/ShowDocument?docid=888 Mu2e-doc-888]
Some facts about the tracker mother volume:
<ul>
  <li> it is the annulus of a tube; that is, the hollow interior is not part of the mother volume.
  <li> the path in the volume hierarchy from the world volume to the TrackerMother is:
<pre>
World->HallAir->DS3Vacuum->TrackerMother
</pre>
</ul>
<p>
<li> Exercise 4: This exercise uses the file TrackerColored.C.  Compare this
    to TrackerMother.C; you will see that it contains extra lines that
    ask that certain volumes be colored.  To run this exercise:
<pre>
root -l TrackerColored.C
</pre>
In this figure the upstream stiffening ring has been colored red; the two
half-rings that form the interface to the rail system have also been colored
red.  And the three longitudinal support beams have been colored green.
The virtual detector at the mid-plane of the track has been colored blue; because
the tracker mother volume is the annulus of a tube, the virtual detector is the
annulus of a disk.  The remaining structures are all tracker planes, arranged
as stations of two planes each.
If you carefully compare the display to
[http://mu2e-docdb.fnal.gov:8080/cgi-bin/ShowDocument?docid=888 Mu2e-doc-888]
you will see that the two downstream stiffening rings are missing
from this drawing; they will be added in a future version of Mu2e Offline.
Next watch the
[http://mu2e.fnal.gov/atwork/computing_retired/Tutorials/2016/GeometryBrowsing/BrowseVolumeHierarchy.mov video] that shows how to navigate the volume heirarchy (.mov)
[http://mu2e.fnal.gov/atwork/computing_retired/Tutorials/2016/GeometryBrowsing/BrowseVolumeHierarchy.mp4 (.mp4)]
using the TBrowser.  To finish this part of exercise, repeat the example shown in the video.
Another way to learn about the volume hierarchy is to look at the two files volumeHierarchy.txt
and volumeDetails.txt  that were included in the gzipped tar file that you unpacked.  These files
were created for Mu2e Offline v5_7_7.

Revision as of 22:24, 2 August 2018

Introduction

This page has an introduction to viewing the Mu2e geometry using ROOT's TGeometry browser. The input to this exercise is a GDML file that was created by running Mu2e Offline and telling it to export the geometry to a GDML file.

Preparation

  1. Download this gzipped tar file which contains the GDML file plus some scripts for viewing it. The GDML file was created using Offline v5_7_7.
  2. Extract the files:
    tar xzf ~/Downloads/GeometryBrowsing.tar.gz
    

    This will create a subdirectory named GeometryBrowsing, with the content:

    ls GeometryBrowsing/
    DS3.C                     InVacuum.cc               NoBuildingOrCRV.C         TrackerColored.C          notes.txt
    InPSVacuum.C              InVacuum.hh               NoBuildingOrCRV.cc        TrackerMother.C           volumeDetails.txt
    InPSVacuum.cc             InsideDS.C                NoBuildingOrCRV.hh        VDs.C                     volumeHierarchy.txt
    InPSVacuum.hh             InsideDS.cc               SelectVirtualDetectors.cc mu2e.gdml                 world.C
    InVacuum.C                InsideDS.hh               SelectVirtualDetectors.hh mu2e_v5_7_7.gdml
    

    The files ending in .C are ROOT CINT scripts to view different parts of the geometry. The files ending in .hh and .cc are C++ code that are used by some of the .C files. The files volumeHierarchy.txt and volumeDetails.txt contain some summary information about each volume. The following items will walk you through using

    these files.
  3. cd into the new directory and setup a modern release of root:
    cd GeometryBrowsing
    setup mu2e
    setup root v6_12_04e -qe15:prof
    

    If you prefer you can setup a base release of the Mu2e Offline software, for example:

    source /cvmfs/mu2e.opensciencegrid.org/Offline/v7_0_4/SLF6/prof/Offline/setup.sh
    
    Among many other things, this will setup a modern version of root.
  4. If you logout and login again, repeat step 3.


Exercises

  • Exercise 1: Use the script world.C to get basic familiarity with the browser. This script shows shows the full Mu2e world volume - so most of what you see it earth and concrete. Look at the script world.C. It has three steps:
    • Read the GDML file
    • Create a TBrowser window
    • Draw the geometry starting from the highest level volume, the Mu2e world volume.
          View the introductory video in either (.mov) or
          (.mp4) format;
          this video illustrates the basics of
          using the TGeometry browser.  Try it yourself:
    
    root -l world.C
    
          If you see no display and you see an error message "cannot load swrast driver",
          follow the instructions on the page that discusses the
          [ComputingLogin#Mac_OpenGL_3D_Error|OPEN GL 3D graphics error].
    
  • Exercise 2: In this exercise you will learn how to use the clipping features of the TGeometry browser. This exercise also uses the script world.C. View the video that shows how to use the clipping features ( formats: (.mov) or (.mp4)).
    root -l world.C
    

    After viewing the video, practice clipping yourself.

  • Exercise 3: The previous two exercises told the browser to start from the top of the volume heirarchy; in this exercise you will learn how to tell the browser to start from somewhere else in the heirarchy. Look at the file TrackerMother.C; compared to world.C the only difference is the last line, which tells the code to start from a particular named volume, the mother volume of the tracking system. To run the exercise:
    root -l TrackerMother.C
    

    Experiment a bit with zooming, rotating and picking volumes; don't spend too much time because the next exercise will highlight a few of the volumes with color. You can read about the tracker geometry in Mu2e-doc-888

    Some facts about the tracker mother volume:

    • it is the annulus of a tube; that is, the hollow interior is not part of the mother volume.
    • the path in the volume hierarchy from the world volume to the TrackerMother is:
      World->HallAir->DS3Vacuum->TrackerMother
      

  • Exercise 4: This exercise uses the file TrackerColored.C. Compare this to TrackerMother.C; you will see that it contains extra lines that ask that certain volumes be colored. To run this exercise:
    root -l TrackerColored.C
    

    In this figure the upstream stiffening ring has been colored red; the two half-rings that form the interface to the rail system have also been colored red. And the three longitudinal support beams have been colored green. The virtual detector at the mid-plane of the track has been colored blue; because the tracker mother volume is the annulus of a tube, the virtual detector is the annulus of a disk. The remaining structures are all tracker planes, arranged as stations of two planes each.

    If you carefully compare the display to Mu2e-doc-888 you will see that the two downstream stiffening rings are missing from this drawing; they will be added in a future version of Mu2e Offline.

    Next watch the video that shows how to navigate the volume heirarchy (.mov) (.mp4) using the TBrowser. To finish this part of exercise, repeat the example shown in the video.

    Another way to learn about the volume hierarchy is to look at the two files volumeHierarchy.txt and volumeDetails.txt that were included in the gzipped tar file that you unpacked. These files were created for Mu2e Offline v5_7_7.