CERN Accelerating science

This website is no longer maintained. Its content may be obsolete. Please visit http://home.cern/ for current CERN information.

CERN home pageCERN home pageDocuments by ReferenceDocuments by ReferenceCNLsCNLsYear 2002Year 2002Help, Info about this page

Contents
Index

Editorial Information
Editorial
If you need help
Announcements Physics Computing Desktop Computing Internet Services and Network Scientific Applications and Software Engineering The Learning Zone User Documentation
Previous:Scientific Applications and Software Engineering
Next:2002 CERNLIB Release
 (If you want to print this article)



Anaphe -- OO Software for HEP in C++ and Python

Andreas Pfeiffer , IT / API


Abstract

The Anaphe project provides an Object Oriented software environment for HEP experiments. Based on public domain, HEP specific and commercial software a suite of C++ class libraries implementing the components of the AIDA Abstract Interfaces have been developed. A thin layer allows to access this functionality from the Python interpreted language providing a powerful tool for interactive data analysis.


Introduction

The Anaphe project provides an Object Oriented software environment for HEP experiments. Public domain libraries cover the basic functionalities; on top of these libraries a set of HEP-specific C++ class libraries for histogram management, fitting and ntuple-like data analysis has been developed. In addition to the license free public domain version, the functionality can be extended by using commercial libraries such as NAG-C.

In close collaboration with the experiments a new modular data analysis tool/toolkit is being developed. Based on AIDA compliant Abstract Interfaces, a set of libraries has been developed to implement these interfaces, making use of already existing software (e.g., from public domain and commercial libraries) wherever possible. In order to comply with the user requirements for a command-line driven tool, a "mapping" of the Interfaces to a scripting language (Python) is provided.

The loose coupling provided by the consequent use of Abstract Interfaces for each component in combination with the use of shared libraries for their implementation allows the integration into modern scripting languages. This integration is simplified even further by using a specialised toolkit (SWIG) to create "shadow classes" for the Python language, which map to the definitions of the Abstract Interfaces almost at a one-to-one level.

AIDA -- Abstract Interfaces for Data Analysis

The goals of the AIDA project are to define abstract interfaces for common physics analysis objects, such as histograms, ntuples, fitters, I/O, etc. The adoption of these interfaces should make it easier for physicists to use different tools without having to learn new interfaces. Additional benefits will be the interoperability of AIDA compliant applications, for example by exchanging analysis objects via XML between applications. The use of the AIDA interfaces in the user's code also eliminates the need for changes in the user's code when changing from one implementation of the AIDA interfaces to another. Within AIDA bindings to AIDA for both C++ and Java have been developed.

Finally by bringing together the authors of a number of different applications we expect to gain deeper insight into the strengths and weaknesses of different applications, and to improve collaboration between different authors.

Several implementations of the AIDA interfaces exist today and are used by a growing community of active users.

Anaphe and Lizard

Anaphe -- the toolkit

The package consists of a set of foundation libraries and a set of libraries which implement the AIDA interfaces using functionality from the foundation libraries. In turn, some of the foundation libraries rely on functionality provided in a lower layer of the software.

This lower layer includes open source software (e.g., Grace, Qt, SWIG, GSL, Python, expat), commercial software libraries (e.g., OpenGL, OpenInventor, NAG-C, Objectivity/DB), older CERN software (e.g., HBOOK, Minuit) and software provided by other projects (e.g., CLHEP).

The next layer is implementing the AIDA interfaces in separate components to allow decoupled development and maintenance. Some of the functionality actually needs alternative implementations: examples are the fitter component where the underlying minimizer engine can be selected to be Minuit or from NAG and the store component where AIDA objects can be stored/retrieved from HBook files, (compressed) files with XML formatted objects, and Objectivity/DB databases.

The component based approach we have chosen allows for an easy extension of any given component without the need to modify the other parts (components) of the system.

Lizard -- the tool

Since July 2001, we have also provided an interactive analysis and visualisation tool called Lizard, which provides a flexible framework which can be fully configured at run-time. This interactive tool is based on Python, a powerful and intuitive open-source OO interpreted language which is very widely used in a variety of domains.

Lizard is actually a very "thin" layer on top of the Anaphe libraries: essentially it is a mapping of the AIDA interfaces to Python classes; the Anaphe libraries implementing the AIDA interfaces are loaded at start-up time dynamically. Thus we profit from the flexibility of selecting the desired specific implementation (e.g., Minuit minimisation engine for the fitter component) at start-up time without the need for re-linking the application.

Adding experiment-specific libraries to Python is surprisingly quick and easy. Lizard may be easily extended with user-defined functionality or any of the growing list of Python modules. Of course, "kumac-style" Python scripts may be written to automate repetitive tasks or build more complex analyses inside the Lizard environment. You can also write your own Python "shortcuts" to compress more complex Python procedures into single commands.

Arbitrary C++ code can be compiled, linked and run on-the fly. Access to the histograms, ntuples and "vectors" (arbitrary data points) inside Lizard from this code is transparent.

Usage and download

The actual release of Anaphe (version 5, which implements the AIDA interfaces version 3.0) is available for RedHat61, RedHat72 (and 73) with compilers gcc-2.95.2 as well as for RedHat73 with gcc-3.2 and Solaris-8 with CC 5.4. Users have reported that it also works well on SuSE 7.2/gcc-2.95.3 (use the redhat61/gcc-2.95.2 version) and SuSE 8.0/gcc-2.95.3 (use the redhat72/gcc-2.95.2 version).

There are basically four scripts provided to use AIDA/Anaphe/Lizard in your environment:

  • lizard : to start the interactive tool Lizard
  • aida-config : a script to return the flags needed in compilation and linking programs with an implementation of AIDA, similar like the cernlib command (aida-config --inc --lib)
  • setupAnaphe (and setupAnaphe.csh) : file to be source'd to prepare the run-time environment (setting environment variables like PATH and LD_LIBRARY_PATH) before running an executable program which uses AIDA through Anaphe.

From a machine which has access to the CERN AFS cell (e.g., on lxplus or lxplus7), simply execute the corresponding script from the following directory: /afs/cern.ch/sw/lhcxx/share/LHCXX/latest/scripts/ (you can replace "latest" by a specific version number if you wish). For a more convenient use, you might want to set a link from your $HOME/bin/ directory to these scripts:
ln -s /afs/cern.ch/sw/lhcxx/share/LHCXX/latest/scripts/* ~/bin/. .
You then can simply call the scripts by their name (no directory prefix needed).

If you want to install Anaphe version 5 locally on your machine, please download the script from our download page and follow the instructions provided there. The download script will create four scripts in your $HOME/bin/ directory allowing you to use lizard, aida-config and setupAnaphe without explicitly specifying their path.

A screenshot of a Lizard sessions is shown in the figure below. The actual implementation of the Plotter component is based on Grace, a very powerful plotting tool which allows direct manipulation of all the elements in the canvas interactively (simply double-click on the part you want to modify or use one of the pull-down menus).

Screenshot Anaphe-5

The Anaphe project is a suite of Object Oriented software covering a wide range of functionalities, from generic basic classes to HEP-specific C++ class libraries for histogram management, fitting and ntuple-like data analysis implementing the AIDA standard interfaces.

The loose coupling provided by the consequent use of Abstract Interfaces for each component in combination with the use of shared libraries for their implementation allows the easy integration into modern scripting languages like Python; a very "thin" layer on top of the AIDA interfaces provides the base for the Lizard analysis tool using the C++ class libraries in Anaphe.

Re-using existing tools and libraries from public domain or commercial providers allows to further reduce the maintenance effort while leveraging some of the resources available outside HEP.

With the start of activities in the LHC Computing Grid (LCG) project, further development work for Anaphe has been suspended (support and maintenance will continue), allowing for an alignment of the activities of the LHC experiments and EP and IT divisions at CERN towards the development of common solutions in the applications area. The architectural blueprint report defines the architecture of such common software to be component based with Abstract Interfaces as the only means of communicating between different components. It further recommends the use of AIDA Interfaces, Python and Qt; so it seems likely that future common analysis components will follow a similar style as presently in Anaphe. It is therefore expected that the users of Anaphe developing their applications based on the AIDA interfaces would also interoperate with components developed in the context of LCG in a fully transparent way.

References



For matters related to this article please contact the author.
Cnl.Editor@cern.ch


CERN-CNL-2002-003
Vol. XXXVII, issue no 3


Last Updated on Tue Dec 10 13:41:47 CET 2002.
Copyright © CERN 2002 -- European Organization for Nuclear Research