source: JEM-EUSO/esaf_lal/tags/v1_r0/esafdoc/DevelopersGuide/ROOT.tex @ 117

Last change on this file since 117 was 117, checked in by moretto, 11 years ago

ESAF version compilable on mac OS

File size: 2.1 KB
Line 
1%------------------------------------------------------------------------------
2\section{\ROOT{} integration}%\ref{ROOT UserGuide, Chap 13, Adding a Class}
3%------------------------------------------------------------------------------
4
5\ESAF{} is deeply connected with \ROOT{}. \ROOT{} classes are used to provide the user with a user friendly Graphical User Interface (GUI), an efficient I/O system and the automatic documentation generation.
6Integration of new classes in ROOT is done with \code{ClassDef}, \code{ClassImp} macros and \code{rootcint} dictionary generator.
7The \code{ClassDef} and \code{ClassImp} macros are necessary to link classes to the dictionary generated by CINT.
8
9\code{rootcint} process class headers and parsing the class structure, builds the streamers needed for I/O.
10\path{LinkDef.hh} file in \code{include} directories tells rootcint for which classes to generate the method interface stubs.
11.
12
13In the class header files the following line must be added to class header files:
14
15\begin{displaycode}
16ClassDef(ClassName,ClassVersionID)
17\end{displaycode}
18
19The \code{ClassVersionID} is used by the \ROOT{} I/O system. This feature is basically reserved to the classes in \path{packages/common/root/} which are used to store data in the rootfile, like \code{EPhoton}, must have \code{ClassVersionID >= 1}.
20Elsewhere standard ESAF classes do not need to be written on file therefore \code{ClassVersionID} must be equal to \code{0}.
21
22\emph{NOTE}: The \code{ClassDef} macro must be the last item before the closing \verb+};+ in a class definition. 
23It contains its own private and public tags so it can be added to either a private or public part of a class definition.
24
25Similarly, in the source file must be added:
26
27\begin{displaycode}
28ClassImp(ClassName)
29\end{displaycode}
30
31which provides the interface needed to generate the documentation.
32
33\code{ClassDef}, \code{ClassImp}, \ROOT{} I/O and RTTI systems are explained extensively in the \hbox{\ROOT{} User's Guide} \cite{bib:rootug}.
34%LinkDef and RootCint
35%The LinkDef.h file tells rootcint for which classes to generate the method interface stubs.
Note: See TracBrowser for help on using the repository browser.