Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

rTreeBase.h

Go to the documentation of this file.
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 // JA Hernando, Santa Cruz, CA, 05/15/00
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(); // init with this root file
00044         virtual void clear();
00045 
00047         rCore* core()    {return m_core;}
00048     // returns the name of the top-level object in the tree
00049     char* className()       {return m_class; }
00050 
00051         //operations
00053         void writeEvent();   
00055         void readEvent();    
00057         void skipEvent() {IOfileVI::skipEvent();}
00058 
00059 protected:
00060 
00062         TTree*        m_RTree; //pointer to the analyzed TTree
00063 
00065         rCore* m_core;
00066 
00068     UInt_t bufsize; 
00070     Int_t split;   
00071 
00072     char* m_class;   // name of the top-level class to retrieve 
00073 };
00074 #endif
00075 

Generated at Fri Aug 18 12:57:38 2000 for centella framework by doxygen 1.1.3 written by Dimitri van Heesch, © 1997-2000