BaBar Graphics: An Architecture to Ride on Other Visualization Systems
David N. Brown
Department of Physics, University of Louisville, Louisville, KY, USA 40292
Serge Du
Laboratoire de L'accelerateur Lineaire, Universite
Paris-Sud, 91405 Orsay, France
Joseph Perl
Stanford Linear Accelerator Center, Stanford, CA 94309
Abstract
We discuss the development history, current status, and future
plans of the BaBar Graphics system. The system has evolved through
specific immediate needs-based goals and response to user feedback.
At all stages the design has been aimed at producing a system which
allows flexible interaction with BaBar data simultaneously with
flexible choice of underlying graphics - allowing us to use freely
available graphics libraries to this point in the development. We
support the development of a global standard for HEP display models
and offer some thoughts on incorporating this standard into various
graphics delivery modes.
1. Introduction to BaBar Graphics, Terminology, and the Physics at
BaBar
BaBar Graphics refers to a collection of software packages which
allow users to produce interactive 3D graphical representations of
data and detector elements. The packages produce default Event
Display executables based on a basic set of data reconstruction
modules with each BaBar software release (approximately every 2
weeks). The graphics modules can also be incorporated by users into
their own event-driven programs, to serve as a display for events
before and/or after modification. It is also possible to build
standalone graphical programs which are not event-related.
All module names in the BaBar Graphics packages include the
three-letter code Gra. Many module names also refer to
specific BaBar detector elements. These elements also receive
3-letter abbreviations, which are often referred to in a group as Xxx.
These elements are introduced here along with a brief discussion of
the physics at BaBar to produce a backdrop for the discussion of
goals, design, and development.
Dch is the 40-layer cylindrical Drift Chamber operating
with Helium-Isobutane in a 1.5 T magnetic field.
Drc is the Detector for Internally Reflected Cerenkov light
(DIRC),
a barrel-like array of quartz tubes extending the length of the
detector and
providing particle identification through measurement of Cerenkov angle.
Emc is the Electromagnetic Calorimeter, an array of Cesium
Iodide
crystals doped with Thallium.
Ifr is the Instrumented Flux Return, used for muon detection.
Svt is the Silicon Vertex Tracker, a near-vertex silicon
strip
array for precise vertex detection.
Trk refers to the Tracking system, which is not actually a
detector
system, but rather the collected software for building tracks,
especially from the Dch and Svt.
The detector and associated software are still in the construction
stage,
preparing for data-taking beginning in early 1999. The PEP-II ring at
SLAC
will provide high-luminosity beams of 9 GeV electrons colliding
head-on with
3.1 GeV positrons at the BaBar Interaction Region. BaBar will seek
mainly
CP-violation physics in the
system. The
asymmetric beams present a novel experimental technique for directly
measuring the time dependence of mixing of the lowest mass open beauty
mesons, thus making precise determinations of Standard Model
CP-violation parameters. The beam asymmetry makes no intrinsic
difference for graphics - the lab system asymmetry can be represented
easily in a three-dimensional display. Potential trouble arises as
physicists begin to perform analyses and wish to view event topology
in the Center-of-Momentum frame or the reference frame of one of the
mother particles in the event. This is not serious trouble, however,
as one easily introduces transforms on data elements and eliminates
detector elements from such pictures.
2. A Brief History of BaBar Graphics
BaBar Graphics received an official launch in December 1995 when
David Quarrie set up packages which paralleled OpenInventor structure.
The packages were:
- GraAbs, containing the abstract base classes of graphics.
These
are not intended for use by end-users.
- GraKits, presenting the classes for physics-independent
user
graphics needs. It depends on GraAbs and/or GraOpa.
- GraModel, containing the BaBar physics (reconstruction)
interface
to graphics. Depends on GraKits, but is not depended on by GraKits.
- GraOpa, which is the interface from the Gra... modules to
the
underlying visualization system, opacs. The design is intended to be
flexible enough to allow replacement of GraOpa quickly with an
interface to
another underlying visualization system.
The parallels between OpenInventor and the BaBar Graphics packages
were designed to allow easy adaptation to OpenInventor by those who
chose to support this expensive visualization system, while the
independence of the Gra packages assured the ability to adapt to other
visualization systems.
2.1 Initial Goals and the Effects Upon Development
The initial goals for the BaBar Graphics system were simple and
heavily coupled to the needs of offline (reconstruction) software
developers. Though it has always been clear that the system should be
extensible to a variety of uses, the reconstruction needs have
continuously driven the implementation. The initial goals and
guidlines for BaBar Graphics include the following:
- Create a debugging tool for offline code developers ("experts")!
Allow them to check changes to their code by seeing the affect on an
event. Let them test software "knowledge" of the detector systems.
Because of the stage of detector development, this need for a
debugging tool has driven fast development of a functioning, if not
beautiful, tool.
- The graphics packages should be built on an Object-Oriented
design. A version of the "Model-View-Control" structure was
chosen for BaBar Graphics. The GraModel package held the model - the
data and potential representations - while the other packages held
much of the view equipment. A new package, GraDisplay, was added in
January 1997 to
handle much of the controller function. The default,
all-encompassing, Graphics application is still GraDisplayApp, though
much of the function has been moved to another package.
- Code the interface to data and reconstruction objects in
C++. The BaBar coding standard language is C++. All of the Gra
packages are written in C++. The underlying visualization, opacs, is
written in C.
2.2 The BaBar Graphics Timeline
Here is a brief rundown of the timeline of developments in BaBar
Graphics to date:
- December 1995: David Quarrie sets up the initial packages:
GraAbs, GraKits, GraModel, GraOpa, and GraOpi with many parallels to
the OpenInventor architecture.
- 1996: Serge Du brings the packages to working condition,
implemented with the opacs visualization system.
- December 1996: David N. Brown joins the group. GraDisplay
package is created. GraDisplayApp becomes the official event display
executable, the Gra... packages hit official BaBar Software
Releases.
- March 1997: BaBar Software Package Coordinators are given
a graphics survey (see below).
- Mid and Late 1997: Improvements to modularity are
introduced. The detector-specific packages are introduced. Joseph
Perl joins the group.
(1)
2.3 User Survey and What was Learned
In March of 1997, BaBar software package coordinators were surveyed
for feedback and input on the BaBar Graphics Event Display. The
survey is listed here:
Graphics Survey for Package Coordinators.
Name: ______________________________
Package/System: _____________________________________
1. Do you have a visual display system/visual debugging tool which is
already used by you/your group?
IF YES:
Is it located in the standard BaBar release structure, and if so,
where?
Who has been most responsible for its development?
IF NO:
Would such a tool be helpful to you? (If your answer is no,
please consider the rest of the survey optional, but please
DO return the survey so that we know. Thanks!!)
2. Is it helpful to provide a set of graphical tools so that your
group can build a graphical display to its own liking?
3. Is it preferable to have a single "canvas" onto which pictures
can be pasted, moved, labeled, such as in a MacDraw drawing,...
or to maintain single picture per window ability as currently
exists.
4. Would you like to be able to save a display in a format such
that you can call it back later for manipulation?
5. Please list graphics features which you would find
particularly useful for your group. (i.e. what do you want
to be able to do with it?)
6. The present Graphics package allows for a debugging mode,
when the graphics module is called at user-defined breakpoints
in other modules (eg, reconstruction) code. Will you use
this facility ? In what context ?
7. The present display represents detectors and events in space
coordinates. Will you need/wish/suggest other
representations, like
- lego plots (which coordinates ?),
- non-linear space representations,
- momentum space representations,
- special 2-D projections
- any other ?
(Please, be accurate in the description of your needs,
and in their degree of urgency)
8. Will you need to represent errors ? Which kind :
spatial ? energy ?
9. Which geometrical shapes will you need to represent ?
10. The present display uses the physicalOutline method
of DetectorModel.
Is the geometry of your detector already described in
that framework ?
If NOT, will it be soon ?
If NOT, is it a feature ?
11. Is it preferable to have volumes represented as
- outlines
- surfaces
- opaque surfaces ?
We were fortunate to receive a large number of very specific
replys which suggested various desirable features, particularly in
terms of useful representations and projections. The two biggest
lessons from the survey were not graphics-specific but more
general:
- Provide clear, simple, easily available documentation, including a
tutorial. The impetus for this is that a surprisingly large number of
the suggestions on the survey were for features already existing in
the display, such as "make a 3D display," and "give users the ability to
rotate and zoom." It has taken a long time, but a web-based tutorial
and reference has been established on the web at
http://www.physics.louisville.edu/public/faculty/hep/GraTutorial/tutorial.html
This lesson has carried through to a goal of providing better user
feedback within our executable, mentioned in the last section, on
"future directions" for BaBar Graphics.
- There are many different ways users want to display data. We
don't want to have to rebuild all of graphics ourselves every time a
user wants a new view. Thus we need to make it easy for users to
extend the system themselves.
3. Current Design of BaBar Graphics
The BaBar Graphics goals list has changed from its original form,
reflecting a move away from the idea of Just producing a quick offline
debugging tool to a more global idea of creating a general BaBar
graphics system. Here is the number one goal which drove
the current design of the system:
Modularity! In moving toward a more global system, we have
aimed at making the system more modular, separating packages by more
well-defined tasks. We have separated code by:
- Function. Visualization modules should be independent of modeling
modules, etc. This makes our system more flexible and portable. Were
we to switch to a new underlying visualization system, the task is
considerably easier with this independence. It also becomes easier to
track down bugs.
- Detector. We have created separate packages for each detector
subsystem and one specific to particle-tracking issues. In addition
to the modularity of function mentioned above, this allows system
experts an easier job adding functionality to the display of their own
system. It also reduces risks of bad links by removing
interdependence of code in different packages. Furthermore, the
detector-specific executables are smaller and run faster than the
all-encompassing event display, GraDisplayApp.
The structure of the packages are represented in the two following
diagrams. Figure (2) shows the layering of functioning, with lines
indicating approximate layers of dependency, the top (GraDisplay and the detector-specific
XxxGra packages) being most dependent. Figure (3) shows the Specific
dependencies, for the detector-specific packages and their link into
the more general GraDisplayApp.
(2)
(3)
This system functions on multiple platforms and displays both
locally and via network. Users are capable of using the system and
adding their own class representations to it. We are currently
addressing performance issues and issues of user interface.
4. Future Directions of BaBar Graphics
Rather than a statement of what will be done, we proceed as we
have in the past, with a list of goals, but we present here a much
more detailed list than we have included in the history and current
status sections.
This list is intended to include everything we would like to have in
the new BaBar Event Display. We
include items here whether or not we absolutely must have it early in
the detector checkout. Note that some of our current goals carry over
into the future goals list.
With the exception of the first few items, most of these
requirements seem as though they might
apply to any HEP Event Display. BaBar can therefore make wonderful
use of this HEPVis 98 to ask all
of you assembled experts three questions:
- Are there other requirements that BaBar should include in its
document?
- Does a system exist that can meet all of these requirements?
- If not, are there components we can share with others to meet
these requirements?
The following list is too long to discuss in the talk accompanying
this paper, so I will just
hit on a few points in the talk; all the points are listed here for
completeness.
But we would very much appreciate feedback from any of you in the coming few days or weeks.
The New BaBar Event Display System Must Be Able To:
BABAR COMPATIBLE:
- Interact with analysis code running on any of the four BaBar-supported
Unix platforms through a C++ API.
This API should operate in both directions:
the event display should be able to get data from the analysis code.
the analysis code should be able to control the event display
(including doing anything that is normally done through the user interface).
- Allow the user to work from any of the desktops common in BaBar
(including desktops in users homes)
such as Unix workstations, Windows NT, Macintosh, Windows 95, X-Terminal
- Display all domains known to Geant 4
- Display all domains known to BaBar Detector Model (BOGUS)
- Restrict public access to specific event data if so required by the BaBar collaboration
- Perform error handling in a manner well integrated into overall BaBar framework
- Provide a successful environment for many developers to work in parallel
consistent with BaBars CVS and SRT
- Have acceptable developer and run-time license costs
(with the understanding that higher license costs may be acceptable to offset high salary costs)
- Achieve major goals early in the life of BaBar, being ready for
Drift Chamber cosmic rays in July 1998
INTERACTIVE:
- Support low, medium and high level interactivity
- Low level interactivity: transform the display
(zoom, translate, rotate, change coordinate system, control visibility of pieces,
change reference frame)
- Medium level interactivity: interrogate the display
(tell the user about the thing on which they clicked).
- High level interactivity: drive analysis from the display
(perform an arbitrary analysis callback based on some action the user takes in the display)
- Allow the user to reassign mouse actions on-the-fly.
- Allow the user to change display properties of objects (color, line thickness, etc).
- Allow the user to have displayed objects labeled with
user-selected non-display information.
- Allow the user to graphically represent simple structures that
were not present at initialization
time (such as displaying a particular space point calculated by them
during the session).
- Help with the limitations of the human brain by providing tools to
remove clutter on-the--fly
such as:
- isolate: show only specified objects of a given class.
- highlight: apply different drawing characteristics to specified
objects of a given class.
- cut: only show tracks above a certain momentum, etc.
- Allow the user to perform operations on groups of display objects
as well as on single display objects.
FAST:
- Minimize network traffic.
- Perform low level interactivity without additional network traffic.
- Avoid retransmission over the network of data which does not
change from one event to the next
(such as detector geometry).
- Update the display progressively as data arrives.
- Pre-load the next event in background while the user studies the
current event.
- Transmit data that lies on the screen before data that lies off the screen
(allow option to entirely skip transmitting data that lies off the screen)
USER FRIENDLY:
- Include a Graphical User Interface.
- Include keyboard equivalents for all GUI commands.
- Allow keyboard commands to be assembled into macros
(to simplify user input and to allow groups of users to develop their
own standard displays).
- Maintain a history file of keyboard equivalent commands
(so that one can store, edit and replay sessions or parts of sessions).
- Have keyboard command language be hierarchical
(to conserve name space and keep things easy to remember as the
system scales up).
- Avoid defining an entirely new keyboard language
(start from an existing language such as tcl, java, etc).
- Avoid providing too many ways to do the same thing
(generally allow no more than one keyboard way plus one GUI way to
do each action).
- Have the user able to discern basic functionality without reading a manual.
- Include easily-accessible, detailed online help.
- Provide lots of feedback for the user, giving every user
action some visible result
(either a change to what is displayed, or an informational or error
message).
- Provide appropriate notice, such as progress bars, for any actions
that are expected to take significant time.
- Allow the user to control verboseness of feedback.
- Support simple and expert user levels
(so that non-expert users do not need to be distracted by expert-level options).
- Provide defaults to allow users to accomplish standard tasks with
minimal input.
- Optimize mouse actions.
- Be easy for users to install and maintain.
- Make efficient use of screen space.
SCALABLE, EXTENSIBLE, MAINTAINABLE:
- Scale well to hundreds of detector system specific modules.
- Be prepared to take advantage of new software developments
(maintain hooks to allow change of underlying graphics package).
- Be prepared to quickly adopt new features developed by other collaborations
(such as new kinds of representations).
- Be prepared to take advantage of improvements in desktop hardware
(such as new graphics hardware accelerators).
- Run on both low and high end machines.
- Survive failure of any particular detector system module to
link, load or run
- Maintain separation between detector hardware description and
physics data.
- Minimize the user's need to recompile and/or re-link
(through such means as shared libraries, dynamic linking, dynamic loading).
- Pipe all input through a consistent single interface.
- Have consistent handling of everything in the display window
(no special handling for axes, or detector geometry, or collaboration
logo, etc.).
- Give detector system experts high level tools to write their own modules
rather than having central event display developers do all the work.
These tools should include high level graphics objects such as boxes
and tracks.
The detector system experts should be responsible for implementing
details specific to their
subsystems (e.g., the drift chamber experts need to worry about the
Lorentz angle)
but should not need to know the event display's internals.
MANY VIEWS:
- Support many different kinds of representations
(such as 3D, 2D, fish eye, vee plot, tabular display, decay chain, etc.).
Treat the real-world 3D view as just one option among many.
- Support multiple, well correlated views of one or more different events
(show which feature in one view matches which feature in another view
through such means as correlated highlighting).
- Show overall event information (such as event number, time stamp, etc.).
- Let the user annotate views with text, lines, arrows, circles, etc.
- Let the user select different reference frames on-the-fly
(such as laboratory, experiment Center of Momentum, other COMs).
- Support drawing of wire frames and area fills on any output device.
- Allow future inclusion of more elaborate drawing systems
(such as hidden line removal, transparent volumes, lighting models).
- Display magnetic and electric fields in addition to detector
data and detector geometry?
DIFFERENT KINDS OF USERS:
- Be useful for the BaBar online as well as the offline.
- Support web distribution of interesting events for education
and public relations.
- Support kiosk-mode displays
(e.g., a display at a museum of "the latest events from your local
accelerator")
providing at least low level interactivity while insulating against
malicious activity.
- Provide high quality hard copy for papers, posters, etc.
with the hard copy match the online image as closely as possible.
Output formats must at least include PostScript plus one of either GIF or JPEG.
Perhaps support PDF output.
Also provide one of the 3D output formats (such as VRML WRL)
The BaBar Graphics group looks forward to providing a system which
meets most or all of these goals and proves a useful tool for BaBar's
software AND hardware groups and for those doing Physics analyses with
BaBar. Furthermore, we look forward to a useful interchange of ideas
with the global High Energy Physics community.
Acknowledgements
The authors must acknowledge the many contributors who have helped
bring the system to its feet. David Quarrie of Lawrence Berkely Lab
(LBL) wrote the original design and coded the skeletons of many of the
base classes used in the BaBar Graphics packages. Anne-Marie Lutz of
Orsay has managed the detector-specific package for the DIRC detector,
has helped with the User Survey, and has taken a strong role in
defining goals for the system. Annalina Vitelli of Frascati/LBL added
a monumental amount of code in helping to create and develop the
detector-specific graphics packages. Zhitang YU of Frascati has taken
charge of the detector-specific package for the IFR detector and
continues to manage that package admirably. Gerry Lynch of LBL and
Stephen Schaffner of SLAC/Princeton have provided helpful feedback.
Guy Barrand of Orsay has been very helpful in our implementation of
opacs as a base visualization package. Without Bob Jacobsen, BaBar
reconstruction software would not be in as good shape as it is today.
References
- E. Gamma et al., "Design Patterns: Elements of Reusable
Object-Oriented Software,"
Addison-Wesley Professional Computing Series (1995).
- J. Wernecke, "The Inventor Mentor,"
Addison-Wesley Publishing Co. (1994).
- BaBar Collaboration, D. Boutigny et. al., "Letter of Intent for the Study of CP Violation and Heavy Flavor
Physics at PEP-II," SLAC-443 (1994).
- BaBar Collaboration, D. Boutigny et. al.,"BaBar Technical Design Report," SLAC-R-95-457 (1995)
- J.Hrivnac, "ATLAS Event Display Requirements"
http://www.cern.ch/Atlas/GROUPS/GRAPHICS/Texts/EventDisplay/Requirements/
(1997)
- David Brown, Serge Du, Anne-Marie Lutz, David Quarrie,
"BaBar OPACS Early Design Notes"
http://www.physics.louisville.edu/www/public/faculty/hep/evtdisp1.html
and http://babar-hn.slac.stanford.edu:5090/HyperNews/get/graphics/10.html
(1996)
- C.D. Jones, P.R. Avery and D.D. Roscigno, "The Cleo3D Event Display"
http://www.phys.ufl.edu/~hepvis/version0_4/cleo3dHelp/cleo3d_help_overview.html,
http://www.phys.ufl.edu/~hepvis/cleo3d.html, and
http://www.phys.ufl.edu/~hepvis/Spectator.html (1996)
- Hans Drevermann, "Event Display, Can We See What We Want to
See?"
http://fnpspa.fnal.gov/workshop/talks/drevermann1/page1.html (1995)
- Hans Drevermann, "Is There a Future for Event Displays"
http://fnpspa.fnal.gov/workshop/talks/drevermann2/index.html (1995)
- Lucas Taylor, "Event Display for the CMS Experiment"
http://preprints.cern.ch/yellowrep/1997/97-01/Chapter10.pdf (1996)
- Howard Stone, "Event Visualization in High Energy Physics (LHC)"
http://preprints.cern.ch/yellowrep/1997/97-01/Chapter04.pdf (1996)
- David McNally, "Event Visualisation Tools at LEP"
http://preprints.cern.ch/yellowrep/1997/97-01/Chapter05.pdf (1996)
- George Alverson, Amber Boehnlein, Josehp Boudreau,
Xiaoling Fan, Lucas Taylor and Jeff Kallenbach, "The Hepvis Class Library for Event Visualization"
http://cactus.phyast.pitt.edu/~joe/hepvis/hepvis.ps (1997)
- Joseph Perl, "Towards Future HEP Event Displays"
http://www-sld.slac.stanford.edu/sldwww/hepvis95/hepvis.html (1995)
- M. Donszelmann and P. Gunnarsson, "WIRED Event Display Requirements"
http://iptnt.cern.ch/public/WIRED/design/URD/html/URD_1.html (1996)
- Minato Kawaguti and Satoshi Tanaka, "3D Graphics Module for
Modeling, Visualization and Analysis for GEANT4 and other applications"
http://www.hep.net/conferences/chep95/html/abstract/abs_52.htm (1995)