00001
00002 #ifndef rTreeBase_h
00003 #define rTreeBase_h
00004
00005 #include "rTFileBase.h"
00006
00007 #include "TROOT.h"
00008
00009 class TTree;
00010 00012
00013 \e rTreeBase has all the IOfileVI operations defined (open, close, readEvent, writeEvent, etc). <br>
00014 \e rTreeBase class needs the main branch class of the ROOT tree as a template argument.
00015 The name of the class is also needed by ROOT. The template and its name are forced
00016 arguments of the constructor!.
00017 <ul>
00018 <li> The Tree should have only one main branch, the main branch is defined
00019 using the template "rCore".
00020 <li> The operations of \c open() and \c close() are overwriten from rTFileBase,
00021 in order to set the address of the main branch of the tree to the template class rCore.
00022 <li> It provides the method to \c read(), \c write() from/to a ROOT-tree.<br>
00023 <li> the IOfileVI interface cames from rTFileBase.
00024 </ul>
00025 */
00026
00027
00028
00029
00030 template<class rCore> class rTreeBase : public rTFileBase
00031
00032 {
00033 public:
00034
00036 rTreeBase(rCore* r, char* name):m_core(r),m_class(name) {clear();};
00038 virtual ~rTreeBase() {};
00039
00041
00042 virtual void open(); 00044
00045
00047 rCore* core() {return m_core;}
00048
00049 char* className() {return m_class; }
00050
00051 00053 00055 00057
00058
00059 protected:
00060
00062 TTree* m_RTree;
00063
00065 rCore* m_core;
00066
00068 UInt_t bufsize;
00070 Int_t split;
00071
00072 char* m_class;
00073 };
00074 #endif
00075