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. |
---|
6 | Integration of new classes in ROOT is done with \code{ClassDef}, \code{ClassImp} macros and \code{rootcint} dictionary generator. |
---|
7 | The \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 | |
---|
13 | In the class header files the following line must be added to class header files: |
---|
14 | |
---|
15 | \begin{displaycode} |
---|
16 | ClassDef(ClassName,ClassVersionID) |
---|
17 | \end{displaycode} |
---|
18 | |
---|
19 | The \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}. |
---|
20 | Elsewhere 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. |
---|
23 | It contains its own private and public tags so it can be added to either a private or public part of a class definition. |
---|
24 | |
---|
25 | Similarly, in the source file must be added: |
---|
26 | |
---|
27 | \begin{displaycode} |
---|
28 | ClassImp(ClassName) |
---|
29 | \end{displaycode} |
---|
30 | |
---|
31 | which 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. |
---|