%APN3_PROCEEDINGS_FORM%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% TEMPLATE.TEX -- APN3 (2003) ASP Conference Proceedings template.
%
% Derived from ADASS VIII (98) ASP Conference Proceedings template
% Updated by N. Manset for ADASS IX (99), F. Primini for ADASS 2000,
% D.Bohlender for ADASS 2001, and H. Payne for ADASS XII and LaTeX2e.
%
% Use this template to create your proceedings paper in LaTeX format
% by following the instructions given below.  Much of the input will
% be enclosed by braces (i.e., { }).  The percent sign, "%", denotes
% the start of a comment; text after it will be ignored by LaTeX.  
% You might also notice in some of the examples below the use of "\ "
% after a period; this prevents LaTeX from interpreting the period as
% the end of a sentence and putting extra space after it.  
% 
% You should check your paper by processing it with LaTeX.  For
% details about how to run LaTeX as well as how to print out the User
% Guide, consult the README file.  You should also consult the sample
% LaTeX papers, sample1.tex and sample2.tex, for examples of including
% figures, html links, special symbols, and other advanced features.
%
% If you do not have access to the LaTeX software or a laser printer
% at your site, you can still prepare your paper following the
% instructions in the User Guide.  In such cases, the editors will
% process the file and make any necessary editorial adjustments.
% 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 
\documentclass[11pt,twoside]{article}  % Leave intact
\usepackage{adassconf}

% If you have the old LaTeX 2.09, and not the current LaTeX2e, comment
% out the \documentclass and \usepackage lines above and uncomment
% the following:

%\documentstyle[11pt,twoside,adassconf]{article}

\begin{document}   % Leave intact

%-----------------------------------------------------------------------
%			    Paper ID Code
%-----------------------------------------------------------------------
% Enter the proper paper identification code.  The ID code for your
% paper is the session number associated with your presentation as
% published in the official conference proceedings.  You can           
% find this number locating your abstract in the printed proceedings
% that you received at the meeting or on-line at the conference web
% site; the ID code is the letter/number sequence proceeding the title 
% of your presentation. 
%
% This will not appear in your paper; however, it allows different
% papers in the proceedings to cross-reference each other.  Note that
% you should only have one \paperID, and it should not include a
% trailing period.
%
% EXAMPLE: \paperID{O4-1}
% EXAMPLE: \paperID{P7-7}
%

\paperID{P4-3}
%%%% ID=P4-3

%-----------------------------------------------------------------------
%		            Paper Title 
%-----------------------------------------------------------------------
% Enter the title of the paper.
%
% EXAMPLE: \title{A Breakthrough in Astronomical Software Development}
% 
% If your title is so long as to fill the page header when you print it,
% then please supply a short form as a \titlemark.
%
% EXAMPLE: 
%  \title{Rapid Development for Distributed Computing, with Implications
%         for the Virtual Observatory}
%  \titlemark{Rapid Development for Distributed Computing}
%

\title{The ROOT C++ Framework for Astronomy }
%\titlemark{ }

%-----------------------------------------------------------------------
%		          Authors of Paper
%-----------------------------------------------------------------------
% Enter the authors followed by their affiliations.  The \author and
% \affil commands may appear multiple times as necessary (see example
% below).  List each author by giving the first name or initials first
% followed by the last name.  Authors with the same affiliations
% should grouped together. 
%
% EXAMPLE: \author{Raymond Plante, Doug Roberts, 
%                  R.\ M.\ Crutcher\altaffilmark{1}}
%          \affil{National Center for Supercomputing Applications, 
%                 University of Illinois Urbana-Champaign, Urbana, IL
%                 61801}
%          \author{Tom Troland}
%          \affil{University of Kentucky}
%
%          \altaffiltext{1}{Astronomy Department, UIUC}
%
% In this example, the first three authors, "Plante", "Roberts", and
% "Crutcher" are affiliated with "NCSA".  "Crutcher" has an alternate 
% affiliation with the "Astronomy Department".  The fourth author,
% "Troland", is affiliated with "University of Kentucky"

\author{Reiner Rohlfs}
\affil{INTEGRAL  Science  Data  Centre,  Chemin  d'Ecogia  16,  CH-1290 Versoix,
Switzerland, Email: Reiner.Rohlfs@obs.unige.ch}

%-----------------------------------------------------------------------
%			 Contact Information
%-----------------------------------------------------------------------
% This information will not appear in the paper but will be used by
% the editors in case you need to be contacted concerning your
% submission.  Enter your name as the contact along with your email
% address.
% 
% EXAMPLE:  \contact{Dennis Crabtree}
%           \email{crabtree@cfht.hawaii.edu}
%

\contact{Reiner Rohlfs}
\email{Reiner.Rohlfs@obs.unige.ch}

%-----------------------------------------------------------------------
%		      Author Index Specification
%-----------------------------------------------------------------------
% Specify how each author name should appear in the author index.  The 
% \paindex{ } should be used to indicate the primary author, and the
% \aindex for all other co-authors.  You MUST use the following
% syntax: 
%
% SYNTAX:  \aindex{Lastname, F. M.}
% 
% where F is the first initial and M is the second initial (if
% used).  This guarantees that authors that appear in multiple papers
% will appear only once in the author index.  
%
% EXAMPLE: \paindex{Crabtree, D.}
%          \aindex{Manset, N.}        
%          \aindex{Veillet, C.}        
%
% NOTE: this information is also used to build the author list that
% appears in the table of contents.  Authors will be listed in the order
% of the \paindex and \aindex commmands.
%

\paindex{Rohlfs, R.}
%\aindex{ }     % Remove this line if there is only one author

%-----------------------------------------------------------------------
%		      Author list for page header	
%-----------------------------------------------------------------------
% Please supply a list of author last names for the page header. in
% one of these formats:
%
% EXAMPLES:
% \authormark{Lastname}
% \authormark{Lastname1 \& Lastname2}
% \authormark{Lastname1, Lastname2, ... \& LastnameN}
% \authormark{Lastname et al.}
%
% Use the "et al." form in the case of seven or more authors, or if
% the preferred form is too long to fit in the header.

\authormark{Rohlfs}

%-----------------------------------------------------------------------
%			Subject Index keywords
%-----------------------------------------------------------------------
% Enter a comma separated list of up to 6 keywords describing your
% paper.  These will NOT be printed as part of your paper; however,
% they will be used to generate the subject index for the proceedings.
% There is no standard list; however, you can consult the indices
% for past proceedings (http://adass.org/adass/proceedings/).
%
% EXAMPLE:  \keywords{visualization, astronomy: radio, parallel
%                     computing, AIPS++, Galactic Center}
%
% In this example, the author noticed that "radio astronomy" appeared
% in the ADASS VII Index as "astronomy" being the major keyword and
% "radio" as the minor keyword.  The colon is used to introduce another
% level into the index.

\keywords{ROOT, AstroROOT, display, C++: interpreter, C++: library}

%-----------------------------------------------------------------------
%			       Abstract
%-----------------------------------------------------------------------
% Type abstract in the space below.  Consult the User Guide and Latex
% Information file for a list of supported macros (e.g. for typesetting 
% special symbols). Do not leave a blank line between \begin{abstract} 
% and the start of your text.

\begin{abstract}          % Leave intact
% Place the text of your abstract here - NO BLANK LINES
\htmladdnormallinkfoot{ROOT}{http://root.cern.ch/}   is  a  C++
framework  developed  at CERN, Geneva. It was designed for high
energy physics to handle and analyze large amounts of data in a
very  efficient way. Its main features are a C++ - interpreter,
graphical   tools   and   an   object   I/O   -   system.   The
\htmladdnormallinkfoot{INTEGRAL  Science  Data  Centre  (ISDC)}
{http://isdc.unige.ch} is using ROOT as a graphical tool and as
a scripting  language  in  the  off-line analysis. To use the
full  capability  of ROOT for astronomical data analysis a link
is  required.  Therefore we complete this system with a library
called AstroROOT. With AstroROOT we can store astronomical data
organized  in  tables  and  images  in  ROOT  - files using the
efficient  I/O system of ROOT. Furthermore we are developing a
new  astronomical image display for the ROOT framework. Finally
we  can  use the buildin C++ interpreter as a scripting language
in   an   interactive   session   to  analyze  and   display
astronomical data.
\end{abstract}
%-----------------------------------------------------------------------
%			      Main Body
%-----------------------------------------------------------------------
% Place the text for the main body of the paper here.  You should use
% the \section command to label the various sections; use of
% \subsection is optional.  Significant words in section titles should
% be capitalized.  Sections and subsections will be numbered
% automatically. 
%
% EXAMPLE:  \section{Introduction}
%           ...
%           \subsection{Our View of the World}
%           ...
%           \section{A New Approach}
%
% It is recommended that you look at the sample papers, sample1.tex
% and sample2.tex, for examples for formatting references, footnotes,
% figures, equations, html links, lists, and other special features.  
\section{ROOT}
ROOT  (Brun  \&  Rademakers  1997)  can  be downloaded from the
\htmladdnormallinkfoot{ROOT                                 web
page}{http://root.cern.ch/root/Availability.html}   as   binary
files  for more than 20 platforms and compilers. These includes
several Linux versions, HP - systems, IBM AIX, Sun SPARC, MacOS
and  WindowsXP/NT.  And also the source code of the full system
is  available and can be compiled easily. ROOT supports several
features  and  tools  for  high  energy  physics  like an event
generator,  a  detector  simulator and an event reconstruction.
But  the  most  interesting sub - systems for astronomical data
analysis  are the built in C++ Interpreter, the graphical tools
and a powerful I/O system which are described hereafter. In 
total ROOT is a C++ - library with more than 100 classes. 

\subsection{The C++ Interpreter}
The  ROOT  C++  interpreter  is a program by itself. It is also
available  in every compiled user program of ROOT. It is nearly
100  \%  ANSI  C/C++  compatible: All standard C - functions are
available.  Due to differences between compilers supported by
ROOT  it  is  not possible to define in the interpreter a class
derived from a compiled class with virtual functions.

In  an interpreter  session  it is possible to define variables of compiled
ROOT  classes  and  to  call every compiled function of the C++
library  of  ROOT.  With  these features it is easy to read data
from  a  file,  manipulate  them  for example with standard C -
functions, open a window with a ROOT class and display the data
using one of the graphical tools described in the next chapter.
Often  these  steps  have  to  be executed again and again. To
simplify this procedure the C and C++ statements can be written in a
so  called  macro  file  which can be executed by the interpreter.
When these macros grow and become a stable function they can be
compiled  with  a  C++  compiler  because  the  language of the
interpreter and the compiler is identical: C++.

Besides   calling  all  ROOT  classes  and  functions  from  the
interpreter  it  is  also possible to call user defined classes
and  functions  in  the  interpreter.  Within  the ROOT package a
program called rootcint is delivered which generates a  dictionary code from the
header  files of the user source code. The interpreter uses this
dictionary information to be
able  to  call  the user functions. The user code together with
this  dictionary  code  has  to  be  compiled and linked into a
shared  library.  The  interpreter is able to load these shared
libraries,  find the dictionary information and immediately all
exported  user  classes  and functions of the shared library are
available in the interpreter.

At  ISDC  we  use  the  interpreter  as a scripting language for
offline  scientific  analysis. User functions to read and write
FITS  files  (O'Neel et al. 2004) and a user class to call FTOOLS
like programs are available. With these tools we can run within
the interpreter astronomical scientific analysis of the INTEGRAL
data.
 
\subsection{The Graphical Tools}

A set of C++ classes of the ROOT library are available to draw
graphs, histograms and detector elements. Classes for 
basic elements like a line, an ellipse and text are also part of ROOT.
Once a graph is drawn all attributes like color, size, text and
makers can be modified interactively with a few mouse clicks. 
Three dimensional graphs can be rotated with a mouse movement
to be able to visualize the data from different view points.
Several curves with different attributes can be superimposed in
one graph. 

Furthermore fitting of graphs either with pre-defined
or with user defined curves is implemented. Again this can
be done either with a function call or interactively. A range
on the X - axis can be defined before the fit is applied. 

A graph with modified attributes exist only in memory. But with ROOT this modified graph
can be saved as a C++ - source code in a macro file. With the help of the
interpreter this macro can be read and the interactively 
modified graph is present again. 

Besides these graphical tools, classes to build graphical
user interfaces (GUI) are part of the ROOT - package. All widgets,
like buttons, text and number entry, list box and window menus,  are
available. It is possible to combine the graphical tools and these
widgets in one window.  Unfortunately a GUI - builder is missing.

At  ISDC  we  used  these  graphical  and GUI classes to develop applications to
visualize  the  scientific  as  well  as  the  housekeeping data of the INTEGRAL
satellite.  Since  the  launch  of INTEGRAL they are used in near-real time to
monitor  the  satellite  and the instruments of INTEGRAL (Rohlfs \& O'Neel 2000). The user
can  select  the  data  to be displayed and can modify the graphs interactively.
Once a set of graphs in one or several windows are defined the configuration can
be  saved  in  a  file  using the I/O system of ROOT. In a next session the
previously  configured  screen with several windows and displays can be reloaded
by selecting just one ROOT file.

\subsection{The I/O system}

To store and to read efficiently huge amounts of data as they will
be produced with the new experiments of high energy physics, ROOT introduced
a new file structure and a new I/O system. The advantages of this system
are:
\begin{itemize}
\item A high performance because only data required for the analysis are 
accessed.  
\item  Efficient  read  functions with a great number of
selection  criteria.  
\item  Individual  buffers  in  a  file  are
compressed by themselves and can be read without uncompressing the whole file.
\end{itemize}
The  ROOT I/O system can store data of any C++ class in files. A program called
rootcint  automatically generates the relevant source code (streamer functions)
to  store  objects  in  ROOT files. At a write operation this streamer function
converts  all  data  of  a  C++ class into a binary stream and recreates the C++
class  during  a  read operation from this binary stream. For better performance
one  may  store  data  from  one  object  into several buffers that can be read
independently. It is even possible to read data from a ROOT file when the source
code  is  not  available any more. Additional "streamer info" are stored in a ROOT
file to be able to regenerate the source code of a saved C++ class.

\section{AstroROOT}
\htmladdnormallinkfoot{AstroROOT}
{http://isdc.unige.ch/index?Soft+astroroot} is an extension of ROOT 
for astronomical data analysis. It consists of a set of C++ classes and of some 
executables as well as the ROOT interpreter with the capability to
call all the additional classes and functions of AstroROOT. 

First of all it is possible with AstroROOT to call all cfitsio
functions within the extended interpreter. Now it is possible to read, write
and update FITS files within the ROOT framework.  With AstroROOT a set of 
container classes representing tables, columns and images with
header information are available. These classes are more convenient than 
the cfitsio functions, because they have more
powerful functions to access FITS files. As a result the user code
is much shorter and simpler. For example, it is not necessary any more
to allocate a buffer to read data from a FITS file. All this is done
transparently inside the container classes. Another advantage is the possibility to
store astronomical data not only in FITS files but also in ROOT files,
using the I/O system of ROOT.
Storing data in ROOT files is more efficient than to store the data in
FITS files, using tables with many columns or several extensions on one
file.

With a program of AstroROOT, called param\_gui, FTOOLS parameter files can be 
read and a GUI to edit the parameters is automatically created. With a few lines
in the FTOOLS parameter file the GUI can be configured. Frames, tap-widgets and
sub-windows  can  be defined. Comment lines with a special
key are read by this param\_gui program to build the GUI.
With a button on the GUI
the associated program  can  be  started  as  soon  as  the  user  has defined the program
parameters with the GUI. Furthermore an application function is available to open
this GUI within a user executable.

An astronomical image display is in development to visualize 
astronomical images within the ROOT framework. The 
\htmladdnormallinkfoot{wcs - library}{http://tdc-www.harvard.edu/software/wcstools/} is used to 
display the coordinate systems. First successful tests with INTEGRAL images were
performed.


\section{Conclusion}

Although  ROOT  was  designed  and  developed  for  high energy
physics  it includes several features and C++ classes which also can
be  used directly  for astronomical data analysis. The ISDC
system  takes  the  advantages  of  the graphical tools and the
interpreter  and  has demonstrated that ROOT can be efficiently
used  for  astronomical  purpose.  With  AstroROOT we support the missing
features to use ROOT as a complete system for astronomical data
analysis. These are FITS file access in the ROOT interpreter
 and an astronomical image display within
the  ROOT  framework. The second  is still in development but already
available as a beta version.



%-----------------------------------------------------------------------
%			      References
%-----------------------------------------------------------------------
% List your references below within the reference environment
% (i.e. between the \begin{references} and \end{references} tags).
% Each new reference should begin with a \reference command which sets
% up the proper indentation.  Observe the following order when listing
% bibliographical information for each reference:  author name(s),
% publication year, journal name, volume, and page number for
% articles.  Note that many journal names are available as macros; see
% the User Guide listing "macro-ized" journals.   
%
% EXAMPLE:  \reference Hagiwara, K., \& Zeppenfeld, D.\  1986, 
%                Nucl.Phys., 274, 1
%           \reference H\'enon, M.\  1961, Ann.d'Ap., 24, 369
%           \reference King, I.\ R.\  1966, \aj, 71, 276
%           \reference King, I.\ R.\  1975, in Dynamics of Stellar 
%                Systems, ed.\ A.\ Hayli (Dordrecht: Reidel), 99
%           \referenc\referencee Tody, D.\  1998, \adassvii, 146
%           \reference Zacharias, N.\ \& Zacharias, M.\ 2003,
%                \adassxii, \paperref{P7.6}
% 
% Note the following tricks used in the example above:
%
%   o  \& is used to format an ampersand symbol (&).
%   o  \'e puts an accent agu over the letter e.  See the User Guide
%      and the sample files for details on formatting special
%      characters.  
%   o  "\ " after a period prevents LaTeX from interpreting the period 
%      as an end of a sentence.
%   o  \aj is a macro that expands to "Astron. J."  See the User Guide
%      for a full list of journal macros
%   o  \adassvii is a macro that expands to the full title, editor,
%      and publishing information for the ADASS VII conference
%      proceedings.  Such macros are defined for ADASS conferences I
%      through XI.
%   o  When referencing a paper in the current volume, use the
%      \adassxii and \paperref macros.  The argument to \paperref is
%      the paper ID code for the paper you are referencing.  See the 
%      note in the "Paper ID Code" section above for details on how to 
%      determine the paper ID code for the paper you reference.  
%
\begin{references}

\reference Brun, R., \& Rademakers, F.\ 1997, Nucl. Inst. \& Meth. in Phys. Res., A 389, 81-86 
\reference  O'Neel, B., Peachey, J., Lerusse, L., Beck, M., Paltani, S., 
    Walter, R.\ 2004, \adassxiii, \paperref{P2-23}
\reference Rohlfs, R., O'Neel, B.\ 2000, \adassix , 687 - 690, The ROOT ObjectOriented
Framework to Analyze INTEGRAL Data


\end{references}

% Do not place any material after the references section

\end{document}  % Leave intact
