Testing G4 Graphics
Geant4 has a facilty for drawing pictures of the detector geometry and for drawing event displays; this facility can use one of several underlying graphics tool kits and Mu2e has chosen to use OPENGL. The design of Geant4 is such that we can only use this facility to draw events immediately after G4 has finished processing an event; it cannot be used to draw events read in from a file.
Depending on the configuration of your video driver and your XWindows system event displays drawn with the Geant4 based event display may not work correctly. The next sections of this web page describe how to run two tests that will verify if your system is working correctly.
There is a separate tool for drawing information found in an event read in from a file. See the Mu2e Event Display Manual (Mu2e-doc-1357) and the Mu2e Event Display Tutorial (Mu2e-doc-1398).
It is also possible to export the Mu2e geometry as a GDML file and to view it as a TGeometry object using ROOT. We will a link to the instructions for that viewer once we write them.
To test that you can run the Geant4 based event display, start a new login session on one of the Fermilab interactive machines and issue the following three commands:
setup mu2e source /mu2e/app/Offline/graphics_test/setup.sh mu2e -c Mu2eG4/fcl/g4test_01.fclFirst line creates the site-specific Mu2e environment. The second line chooses a particular pre-built release of the Mu2e Offline software. The third line runs the Offline software, giving it a run-time configuration that will run Geant4 and create an event display. The first two lines should produce printout to the terminal screen that looks like:
Mu2e external products are rooted at: /grid/fermiapp/products/mu2e MU2E_DATA_PATH is: /mu2e/app/DataFiles Base release directory is: /mu2e/app/Offline/v2_0_1 MU2E_SEACH_PATH: /mu2e/app/Offline/v2_0_1/:/mu2e/app/DataFiles/The last line should produce printout that begins
%MSG-i MF_INIT_OK: mu2e 04-Aug-2012 10:59:40 CDT JobSetup Messagelogger initialization complete. %MSG GlobalConstantsService input file is: /mu2e/app/Offline/v2_0_1/Mu2eG4/fcl/globalConstants_01.txt %MSG-i RANDOM: EventGenerator:generate@Construction 04-Aug-2012 10:59:41 CDT ModuleConstruction Instantiated HepJamesRandom engine "generate:" with seed 0. %MSG %MSG-i RANDOM: G4:g4run@Construction 04-Aug-2012 10:59:43 CDT ModuleConstruction Instantiated G4Engine engine "g4run:" with seed 1. %MSG ************************************************************* Geant4 version Name: geant4-09-05-patch-01 (20-March-2012) Copyright : Geant4 Collaboration Reference : NIM A 506 (2003), 250-303 WWW : http://cern.ch/geant4 *************************************************************and continues for many, many lines. After about 10 to 30 seconds, depending on the speed of your network connection to Fermilab, a new window should pop up on your screen; the event display will appear in this window. After about another 10 seconds, the printout will pause a after printing:
ProtonInelastic Crs sctns: G4CrossSectionPairGG: Emin(GeV)= 0 Emax(GeV)= 100000 G4CrossSectionPairGG: Axen-Wellisch cross sections below 91 GeV, Glauber-Gribov above GheishaInelastic: Emin(GeV)= 0 Emax(GeV)= 100000 ============================================================================================After another 10 seconds to 1 minute, depending on the speed of your network connection to Fermilab, the event display should look like the figure below. Actually, the scene will be drawn once; it will then be cleared and redrawn ( I believe that the scene is drawn once when the construction of the geometry is complete and once after the first event; at some point we may figure out how to suppress the unnecessary operations. ). If you are doing this at Fermilab, the whole process will take about 20 to 25 seconds. If you doing this offsite it may take up to several minutes. The event display should look like:
This is a view of the Mu2e hall looking up from below; the x axis goes down the page; the z axis goes to the left; and the y axis goes into the page. If there is significantly less detail than shown in this picture, then your XWindows system is not working correctly; the usual symptom is that only the solid color objects are drawn but the wire-frame outline objects are not drawn. In most cases the solution is to install the manufacturers custom video card driver to replace the generic video driver supplied by your OS vendor.
When the event display finishes drawing, the printout on the screen should look like:
Begin processing the 1st record. run: 1 subRun: 0 event: 1 at 04-Aug-2012 11:00:25 CDT G4VisManager: Using G4TrajectoryDrawByCharge as default trajectory model. See commands in /vis/modeling/trajectories/ for other options. Enter a character to go to the next event (q quits, v enters G4 interactive session) (Once in G4 interactive session to quit it type exit):To exit the program, type any character, except a "q" or a "v", followed by a carriage return.
You can also run a second test that will show an elevation view of the Mu2e hall.
mu2e -c Mu2eG4/fcl/g4test_02.fcl -n 1This will produce a picture that looks like:
In this picture the y axis is up, the z axis is to the right and the x axis is into the page. If there is significantly less detail than shown in this picture, then your XWindows system is not working correctly; the usual symptom is that only the solid color objects are drawn but the wire-frame outline objects are not drawn. In most cases the solution is to install the manufacturers custom video card driver to replace the generic video driver supplied by your OS vendor. To exit the program, type any key except "q" or "v", followed by a carriage return.
Before proceeding to running the mu2e code, please log out and log in again.
|Security, Privacy, Legal|