GeometryBrowserTutorial
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
- 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.
- 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. - 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. - 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.