How to visualize a detector setup using IGUANACMS

(Stefan Piperov, Nov 2004)

1.  Introduction

The IGUANACMS is a package developed at CERN with the aim of visualizing CMS detector setup. Its source code and documentation is available from the IGUANACMS website.

2.  Purpose of this How-To

This How-To is intended to show how to run IGUANACMS locally at FermiLab, or even standalone.

Instructions found here apply for running IGUANACMS on CMSUAF, and I suggest that one first experiments with the package there, because this is a well defined environment and help/advise is available. After some experienece is accumulated, one can try IGUANACMS on a local machine. The benefit of the later is the dramatically improved graphical performance, especially if local machine has decent OpenGL acceleration.

Naturally, an account on CMSUAF is necessary for this exercise. Instructions on how to get one are available elsewhere.

3.  Location of files

Throughout this document I will be giving examples with my account (piperov) on CMSUAF.  I use my AFS home directory (/afs/fnal.gov/files/home/room1/piperov/) for storing small inportant files, and storage area (/storage/data4/piperov/) for bulky and not critically important files (remember - /storage/ is not backed up, so don't put there files which you don't know how to recreate!).

Your home directory and storage area will be deferent - substitute accordingly.

4.  A note on versions

At the time of writing, the latest version of IGUANACMS available at FermiLab is IGUANACMS_1_10_0. This version is not capable of displaying geometries which employ DDD algorithms, as is the case of HCAL TestBeam geometry, and therefore cannot be used for this tutorial. Temporarily, until a more recent version is installed
at FermiLab, we will have to use the newer versions available at CERN. For the purpose of the tutorial we will use IGUANACMS_1_11_0_pre2 - a pre-release of IGUANACMS_1_11_0.

5.  Getting the IGUANACMS source

       
ssh cmsuaf
Log into the CMSUAF cluster. You might need to initialize your
Kerberos principal beforehand, by doing  kinit <yourloginname>@FNAL.GOV
source /afs/fnal.gov/files/code/cms/setup/cshrc cern This script sets CMS environment for  users at Fermilab.
The 'cern' modifier sets environment for software releases installed
at CERN and accessible via AFS: CMS_PATH=/afs/cern.ch/cms
cd /storage/data4/piperov/
Go to your storage directory.
scram project IGUANACMS IGUANACMS_1_11_0_pre2
Creates your IGUANACMS developers area.

The SCRAM tool is documented at:
http://cmsdoc.cern.ch/Releases/SCRAM/current/cgi/scrampage.cgi  http://savannah.cern.ch/projects/scram
cd IGUANACMS_1_11_0_pre2/src/
Go to the source files directory.
cmscvsroot IGUANACMS
Setup the CVS repository.
cvs login
Login into the CVS repository. (you will need the following password: "98passwd")
cvs co -r IGUANACMS_1_11_0_pre2 IGUANACMS
Check Out (extract) the source code from the CVS repository.
cd IGUANACMS/VisDocumentation/VisTutorial
Go to the working directory for this tutorial.

6. Getting your Geometry files

Next, we need the XML files that describe the geometry of the setup you want to visualize. Normally this is a set of files organized in a hierarchical tree, with one file being the tree's root and referencing the other files.

For our tutorial I will use the HCAL Test Beam geometry, as defined in the OSCAR MonteCarlo simulation package.

cp /afs/fnal.gov/exp/cms/l/Releases/OSCAR/OSCAR_3_4_0/src/OscarApplication/TBHcal02/test/*.xml .

The root of the geometrical tree for this setup is called testConfiguration.xml

7.  Modifying geometryrc

We will use the geometryrc file as a steering script for running IGUANACMS. We need to edit it, in order to point it to the root file of our geometry.
The line starting with DDDConfigFile should read:
DDDConfigFile = testConfiguration.xml

Also, we need to add an extra package. So add the following line:
ExtraPackages = MantisDefaultExceptionHandler: TBHcal02

Save the file, and we are ready to run.

8.  Running IGUANACMS

First, setup the runtime environment (paths to executables, dynamically loadable libraries etc.)
eval  scram runtime -csh 

Then we need to setup the license files fo several software packages:
setenv TGS_LICENSE_FILE  \ /afs/fnal.gov/files/code/cms/l/external/gcc-3.2/CMS_SOFT/external/tgsinventor/3.1.1/rh73_gcc32/license/password.dat

And then we can run:
iguana -c geometryrc

Since we are loading all the libraries from CERN, it will take quite a while before the application really shows up on your screen. But be patient this first time, and wait.
(I will discuss tricks for speeding things up later.) It will take several minutes (depending on the network load) before you see the first screen:

Iguana Logo



Then, in the following Setup window select "OSCAR" configuration

select OSCAR


After a while the main OSCAR visualization window will show up:
Main window
(Click image for a larger version)


Resize the Object menu such that the Visibility tag is seen:
Resize Object Menu
(Click image for a larger version)


Check the Visibility tag on several objects, and see them displayed on the right:
Select several Objects
(Click image for a larger version)


Now, using the mouse you can rotate the setup around the X and Y axis. Click and hold the left button inside the main window, and move the mouse up-down for rotations around the X-axis, and left-right for rotations around the Y-axis.
Rotations
(Click image for a larger version)


Using the zoom buttons or the wheel of your mouse (if you have one) you can zoom in and out of the picture.
Pressing and holding the  Ctrl key changes the mouse behaviour from rotation to translation. You can move the hole setup around.

Right-clicking on a volume in the Object menu opens a menu with many display options. For example we can select to display all levels of volumes logically positioned inside HB:
All levels of HB
(Click image for a larger version)


Go ahead and experiment with various options.

9. Optimization hints

Our biggest friend concerning optimization of IGUANACMS performance is AFS. After the first execution of iguana all the libraries which we had to download from CERN, and which slowed us down so much, are cached by AFS, so during the next execution of iguana they will load much faster.

Further degree of optimization is achieved by explicitly copying all the shared libraries in a directory which is in the $LD_LIBRARY_PATH. In our case we can use the /storage/data4/piperov/IGUANACMS_1_11_0_pre2/lib/ directory and copy there all the shared libraries.
Webmaster | Last modified: Wednesday, 09-Jan-2008 12:04:04 CST