|BaBar Event Display
This page contains practical documentation on the BaBar Event Display. It is meant to be a tutorial and an index to relevant web pages and documents.
The BaBar graphics code is contained in several packages
available within the BaBar software repository. The packages have
been developing and will continue to develop. We will try to keep
you as up-to-date as possible through this web page on changes in
This tutorial is a quick but informed start on viewing event display graphics; it will provide enough information to help you do some advanced things if you so desire, without bogging down the beginner (we hope).
Warning: - Xxx is used throughout these pages to indicate the set of detector-specific packages, with the Xxx itself referring to the three-letter monikers of the various systems: Trk, Svt, Dch, Drc, Emc, Ifr. XxxGra must be read as TrkGra, SvtGra, etc.
The Graphics packages, GraDisplay and XxxGra, define standard Framework modules. Standalone applications can be used or built, or the graphics modules can be included in the path of your application.
The full graphics structure relies on (mostly) abstract classes defined in GraBase and GraModel. Concrete classes are defined in XxxGra packages with minimal interdependancies. GraModel also contains the definitions of concrete classes for global projections.
The basic elements are the following:
Each Observer can drive a display window, or several Observers can work together to create a display window. For example, the GraDisplay application has one display window containing an Observer for each of the subsystems.
Some Observers are of a special "Selection" type (class GraObsSelection): they are meant to display Selected Objects. They are updated, optionally automatically, when the Selected Event Objects change.
The Drawer actions (objects to display) are switched on/off from tcl or from GUI.
See this document for information on creating and adding your own representation.
The projection can be chosen from tcl
See this document for information on creating and adding your own projection.
You should be working on a computer carrying full BaBar
software releases, including the ability to add packages through
Software Release Tools (SRT). The console at which you are
working must be capable of X-window displays.
(Note. Currently, there is free X-server software available for Macs and Windows-based PCs. You can find it at: http://www.microimages.com/)
The environment variable DISPLAY determines where your graphics
will be displayed. It is likely that this variable is already defined
correctly for you, particularly if you use ssh. Type
Here we assume you have already defined BFARCH correctly. Since you will be making a graphical display (requiring at this point an X-windowing system), you need also to have the DISPLAY environment variable set. You must first know the internet or IP address of the machine in front of you. Once you do, type:
setenv DISPLAY myHost.myDomain.topDomain:0
or, if you have bash or ksh, type:
where myHost.myDomain.topDomain represents your display machine's internet or IP address.
Note: if you are working from a public x-terminal at SLAC and running at a different site, you may need to run the mxconns program. Please see its man page at SLAC.
Running the BaBar Event Display is like running any other BaBar Framework application. It requires essentially the same SRT environment and startup procedure as Beta, eg. (see the Beta Tutorial for detailed instructions).
newrel -t 8.1.0 myGra810 (This establishes a main directory for your work and establishes which release you will use (8.1.0 in this example). myGra810 can be whatever name you choose for the directory.) cd myGra810 addpkg workdir cd workdir gmake setup
You must now establish the data file on which you will run. You may run the event display either from a simulation (.xdr) output file, from the Event Store Database, or from online-created XTC files.
You may have either a bbsim.xdr file in your workdir working directory or a link named bbsim.xdr pointing to an actual .xdr file. The graphics applications will also look in the PARENT directory if the requested file is not found in your workdir.
The BaBar Graphics (Event Display) application GraDisplayApp
is built by default with each BaBar software release. It contains
all the various data and detector representations.
The smaller, faster, detector-specific applications , SvtGraApp , DchGraApp , DrcGraApp , EmcGraApp , IfrGraApp and TrkGraApp are no longer included in the releases. They must be locally built using standard SRT tools.
They are available for your use as standalone Framework-based programs or as modules to include in your own application.
Beginning with BaBar Release 6.3.1, there is a script file in the workdir directory which will simplify the running of all of the display applications. The script is called disprun. This script can be used to run either a default version of an application or to run a version that you have built yourself. disprun looks first in RELEASE/bin/$BFARCH/ for your executable and runs the version there if it is available. If you have not built your own executable, disprun runs the default executable in PARENT/bin/$BFARCH.
The disprun command must be executed from your workdir.
To simply get a help listing, issue the following command:
The syntax for using the command is
disprun [-exe exe_app_name] [-in tcl_scriptfile] [help]
disprun This is absolutely equivalent to the following line:
disprun -exe GraDisplayApp -in GraDisplay/script.tcl
disprun -exe XxxGraApp -in ./RELEASE/XxxGra/xxxgra.tcl
For running Graphics Applications with releases prior to 6.3.0, type:
source GraDisplay/setup.csh (or setup.sh if using bash or ksh) ./$BINREL/bin/$BFARCH/GraDisplayApp GraDisplay/script.tcl
with $BINREL defined as RELEASE or PARENT whether you have
built the application locally or
For running detector specific applications, type:
source GraDisplay/setup.csh ./RELEASE/bin/$BFARCH/XxxGraApp RELEASE/XxxGra/xxxgra.tcl
Once the graphics application is launched, several windows will open up on your screen, display windows and control panels. The display windows are the windows of the default Observers, and displayed objects are those set by the initializing tcl script. - see this document for more information.
Full customization of your Event Display is possible either from tcl (from a file or from direct input), or from the Graphical User Interface (GUI).
Like in any Framework application, event processing is specified by the tcl command: ev begin -nev nn where nn is an integer number of events greater than or equal to 1.
From the graphics module, you move through events by clicking the
button of the GraModule panel.
If you process event by event (ev begin -nev 1, repeatedly ), the Continue button makes the application leave the graphics module and return to the Framework.
If you ask for more than one event (nn >1), you must browse through all of the requested events until a tcl prompt appears in the original terminal window.
To skip events, you may use your favorite recipe. An example of a skip (tcl) procedure is given hereTo exit, click on the terminal window at the tcl prompt and type "exit".
The Babar Event Display is a moving project. Feedback is most welcome.
Known weaknesses of the present version are the following:
The Babar Event Display will evolve toward a client-server structure for better functionalities and performance.
Part of the present procedures will become obsolete. This will affect mainly the Graphics interface, but neither the data representations, nor the basic Observer/Drawers structure.