BaBar Event Display

Building Graphics Applications


Under modification for releases 7.12.x on.
Last modified: Mon May 25 18:44:59 MET DST

This document explains how to build your own graphics applications. This is needed if the default GraDisplayApp executable built with each release is not available or if you wish to use a detector specific graphics application XxxGraApp.

Warning: throughout this tutorial, XxxGra has to be replaced by TrkGra, SvtGra, etc according to your wish.

You also may want to include graphics as a module in your own application. A use case is including a graphics module in BetaUser to display events from a Beast tape (or, eventually, the EventStore).

You may even wish to make changes to the display packages (such as defining new Observer types, adding a representation or adding a projection).


Contents

Status of existing executables on various releases and platforms on disk in SRT at SLAC.


General Build Procedure


(Please read the Glossary first to get familiar with the BaBar Event Display basic structure).

You may want to build your own Graphics Application at several users levels:


Building the Graphics Applications from standard releases

GraDisplay and each XxxGra package contains the standard Framework and SRT files:

and

necessary to build the GraDisplayApp or xxxGraApp applications with the BaBar standard tools.

From your RELEASE directory, type, eg.:

addpkg XxxGra
gmake XxxGra.all

Then you run the application from your workdir.


Including GraDisplay or Xxxgra as a module in your application

Since GraDisplay and any XxxGra are standard Framework modules, you may want to insert them in your application. Normally, one will append the graphics module after one's own module(s), in order to see an event after processing.It is, in fact, possible to add GraDisplay both before and after one's module(s) such that one can directly see the effects of one's own module(s) on an event.

If you read an xdr file, you should place the graphics module after the reco modules since most Drawers display reconstructed data.

You have to edit <your application>/AppUserBuild.cc:

#include XxxGra/XxxGraAppModule.hh
add (new XxxGraAppModule ("XxxGra", "XxxGra Graphics Module"));

edit <your application>/GNUmakefile:

  override LINK_XxxGra          +=  <Your>GNUmakefile 

then the usual gmake. You have also to edit your tcl script file:

append <YourPath>  XxxGra
You should now be ready to run.


Reading Beast tapes or EventStore data from Graphics Applications

A special case of the above procedure is pre-built in BetaUser. Using BetaUser with the GraDisplay option set is the easiest way to display events stored on Beast tapes (releases up to 6.0.2) or from the EventStore (releases later than 6.5.2):

If you want to include XxxGra instead of GraDisplay, it is no more pre-built in BetaUser. You have to follow the above procedure to include XxxGra into BetaUser instead of GraDisplay.

Warning: not all Representation of data may be available from Beast tapes
(eg., reconstructed tracks are presently missing)


Designing new Observers


The objects an Observer can display depend on the Drawers registered. GraDisplay and each XxxGra define some Observers released with the packages. Other types of Observers may well be designed, depending on the (existing) XxxGraDetDrawers and XxxGraEvtDrawers you register into the ObsFactory.

Observers can be of two categories: standard or "Selection". The latter is designed for displaying selected objects and is built from XxxGraSelDrawers (and possibly other Drawers). They are (optionally) automatically updated whenever the selected object to display changes. Presently, only DrcGra has designed such Observers.

Examples of Observer design are found in GraDisplay/src/GraAppLoop.cc or any XxxGra/XxxGraAppLoop.cc.
A walkthrough of DrcGra/DrcGraAppLoop can be found here.


Designing new Representations


The objects the Drawers act on are displayed using Representations defined in the XxxGraModellers and XxxGra...Rep.

As long as Detector objects are displayed through the standard DetectorModel representation, nothing is to be done beyond providing the physicalOutline() method of the constituing DetElems. The following thus addresses new representations of event data.

Adding a new Representation can be simply changing the 3D graphical shapes depicting an object. It can be a drastic change, eg.: the Representation of the energy deposit in a Emc crystal can be a "porcupine" Representation or a lego (teta,phi) plot or a color (teta,phi) plot. Once designed, the new Representation can be chosen setting the drawing Mode appropriately.

Introducing a Representation of a new object requires more than defining the Representation in XxxGraModeller. Data access must be provided in XxxGraDataReader, and the new Drawing Action must be declared in XxxGraEvtDrawer.

Still more to come if needed


Designing new Projections


A projection is a mapping from one set of xyz points to another set of xyz points. All drawn objects are made up of individual points or line segments connecting points - it is the individual points which get "projected." Toggles are available to turn the projection on/off for tracks and other things.

Projections which are to be made available for GraDisplayApp and all of the XxxGraApp's should be put in the GraModel package. Projections specific to a particular XxxGraApp should be put in the XxxGra package. Some existing projections include: