TTree.h

Go to the documentation of this file.
00001 // @(#)root/tree:$Id: TTree.h 38060 2011-02-13 21:17:54Z pcanal $
00002 // Author: Rene Brun   12/01/96
00003 
00004 /*************************************************************************
00005  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
00006  * All rights reserved.                                                  *
00007  *                                                                       *
00008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
00009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
00010  *************************************************************************/
00011 
00012 #ifndef ROOT_TTree
00013 #define ROOT_TTree
00014 
00015 //////////////////////////////////////////////////////////////////////////
00016 //                                                                      //
00017 // TTree                                                                //
00018 //                                                                      //
00019 // A TTree object is a list of TBranch.                                 //
00020 //   To Create a TTree object one must:                                 //
00021 //    - Create the TTree header via the TTree constructor               //
00022 //    - Call the TBranch constructor for every branch.                  //
00023 //                                                                      //
00024 //   To Fill this object, use member function Fill with no parameters.  //
00025 //     The Fill function loops on all defined TBranch.                  //
00026 //                                                                      //
00027 //////////////////////////////////////////////////////////////////////////
00028 
00029 #ifndef ROOT_TBranch
00030 #include "TBranch.h"
00031 #endif
00032 
00033 #ifndef ROOT_TObjArray
00034 #include "TObjArray.h"
00035 #endif
00036 
00037 #ifndef ROOT_TAttLine
00038 #include "TAttLine.h"
00039 #endif
00040 
00041 #ifndef ROOT_TAttFill
00042 #include "TAttFill.h"
00043 #endif
00044 
00045 #ifndef ROOT_TAttMarker
00046 #include "TAttMarker.h"
00047 #endif
00048 
00049 #ifndef ROOT_TArrayD
00050 #include "TArrayD.h"
00051 #endif
00052 
00053 #ifndef ROOT_TArrayI
00054 #include "TArrayI.h"
00055 #endif
00056 
00057 #ifndef ROOT_TDataType
00058 #include "TDataType.h"
00059 #endif
00060 
00061 #ifndef ROOT_TClass
00062 #include "TClass.h"
00063 #endif
00064 
00065 #ifndef ROOT_TVirtualTreePlayer
00066 #include "TVirtualTreePlayer.h"
00067 #endif
00068 
00069 class TBranch;
00070 class TBrowser;
00071 class TFile;
00072 class TDirectory;
00073 class TLeaf;
00074 class TH1;
00075 class TTreeFormula;
00076 class TPolyMarker;
00077 class TEventList;
00078 class TEntryList;
00079 class TList;
00080 class TSQLResult;
00081 class TSelector;
00082 class TPrincipal;
00083 class TFriendElement;
00084 class TCut;
00085 class TVirtualIndex;
00086 class TBranchRef;
00087 class TBasket;
00088 class TStreamerInfo;
00089 
00090 
00091 class TTree : public TNamed, public TAttLine, public TAttFill, public TAttMarker {
00092 
00093 protected:
00094    Long64_t       fEntries;           //  Number of entries
00095    Long64_t       fTotBytes;          //  Total number of bytes in all branches before compression
00096    Long64_t       fZipBytes;          //  Total number of bytes in all branches after compression
00097    Long64_t       fSavedBytes;        //  Number of autosaved bytes
00098    Long64_t       fFlushedBytes;      //  Number of autoflushed bytes
00099    Double_t       fWeight;            //  Tree weight (see TTree::SetWeight)
00100    Int_t          fTimerInterval;     //  Timer interval in milliseconds
00101    Int_t          fScanField;         //  Number of runs before prompting in Scan
00102    Int_t          fUpdate;            //  Update frequency for EntryLoop
00103    Int_t          fDefaultEntryOffsetLen;  //  Initial Length of fEntryOffset table in the basket buffers
00104    Long64_t       fMaxEntries;        //  Maximum number of entries in case of circular buffers
00105    Long64_t       fMaxEntryLoop;      //  Maximum number of entries to process
00106    Long64_t       fMaxVirtualSize;    //  Maximum total size of buffers kept in memory
00107    Long64_t       fAutoSave;          //  Autosave tree when fAutoSave bytes produced
00108    Long64_t       fAutoFlush;         //  Autoflush tree when fAutoFlush entries written
00109    Long64_t       fEstimate;          //  Number of entries to estimate histogram limits
00110    Long64_t       fCacheSize;         //! Maximum size of file buffers
00111    Long64_t       fChainOffset;       //! Offset of 1st entry of this Tree in a TChain
00112    Long64_t       fReadEntry;         //! Number of the entry being processed
00113    Long64_t       fTotalBuffers;      //! Total number of bytes in branch buffers
00114    Int_t          fPacketSize;        //! Number of entries in one packet for parallel root
00115    Int_t          fNfill;             //! Local for EntryLoop
00116    Int_t          fDebug;             //! Debug level
00117    Long64_t       fDebugMin;          //! First entry number to debug
00118    Long64_t       fDebugMax;          //! Last entry number to debug
00119    Int_t          fMakeClass;         //! not zero when processing code generated by MakeClass
00120    Int_t          fFileNumber;        //! current file number (if file extensions)
00121    TObject       *fNotify;            //! Object to be notified when loading a Tree
00122    TDirectory    *fDirectory;         //! Pointer to directory holding this tree
00123    TObjArray      fBranches;          //  List of Branches
00124    TObjArray      fLeaves;            //  Direct pointers to individual branch leaves
00125    TList         *fAliases;           //  List of aliases for expressions based on the tree branches.
00126    TEventList    *fEventList;         //! Pointer to event selection list (if one)
00127    TEntryList    *fEntryList;         //! Pointer to event selection list (if one)
00128    TArrayD        fIndexValues;       //  Sorted index values
00129    TArrayI        fIndex;             //  Index of sorted values
00130    TVirtualIndex *fTreeIndex;         //  Pointer to the tree Index (if any)
00131    TList         *fFriends;           //  pointer to list of friend elements
00132    TList         *fUserInfo;          //  pointer to a list of user objects associated to this Tree
00133    TVirtualTreePlayer *fPlayer;       //! Pointer to current Tree player
00134    TList         *fClones;            //! List of cloned trees which share our addresses
00135    TBranchRef    *fBranchRef;         //  Branch supporting the TRefTable (if any)
00136    UInt_t         fFriendLockStatus;  //! Record which method is locking the friend recursion
00137 
00138    static Int_t     fgBranchStyle;      //  Old/New branch style
00139    static Long64_t  fgMaxTreeSize;      //  Maximum size of a file containg a Tree
00140 
00141 private:
00142    TTree(const TTree& tt);              // not implemented
00143    TTree& operator=(const TTree& tt);   // not implemented
00144 
00145 protected:
00146    void             AddClone(TTree*);
00147    virtual void     KeepCircular();
00148    virtual TBranch *BranchImp(const char* branchname, const char* classname, TClass* ptrClass, void* addobj, Int_t bufsize, Int_t splitlevel);
00149    virtual TBranch *BranchImp(const char* branchname, TClass* ptrClass, void* addobj, Int_t bufsize, Int_t splitlevel);
00150    virtual TBranch *BranchImpRef(const char* branchname, const char* classname, TClass* ptrClass, void* addobj, Int_t bufsize, Int_t splitlevel);
00151    virtual TBranch *BranchImpRef(const char* branchname, TClass* ptrClass, EDataType datatype, void* addobj, Int_t bufsize, Int_t splitlevel);
00152    virtual Int_t    CheckBranchAddressType(TBranch* branch, TClass* ptrClass, EDataType datatype, Bool_t ptr);
00153    virtual TBranch *BronchExec(const char* name, const char* classname, void* addobj, Bool_t isptrptr, Int_t bufsize, Int_t splitlevel);
00154    friend  TBranch *TTreeBranchImpRef(TTree *tree, const char* branchname, TClass* ptrClass, EDataType datatype, void* addobj, Int_t bufsize, Int_t splitlevel);
00155    Int_t    SetBranchAddressImp(TBranch *branch, void* addr, TBranch** ptr);
00156 
00157    class TFriendLock {
00158       // Helper class to prevent infinite recursion in the
00159       // usage of TTree Friends. Implemented in TTree.cxx.
00160       TTree  *fTree;      // Pointer to the locked tree
00161       UInt_t  fMethodBit; // BIT for the locked method
00162       Bool_t  fPrevious;  // Previous value of the BIT.
00163 
00164    protected:
00165       TFriendLock(const TFriendLock&);
00166       TFriendLock& operator=(const TFriendLock&);
00167 
00168    public:
00169       TFriendLock(TTree* tree, UInt_t methodbit);
00170       ~TFriendLock();
00171    };
00172    friend class TFriendLock;
00173 
00174    // use to update fFriendLockStatus
00175    enum ELockStatusBits {
00176       kFindBranch        = BIT(0),
00177       kFindLeaf          = BIT(1),
00178       kGetAlias          = BIT(2),
00179       kGetBranch         = BIT(3),
00180       kGetEntry          = BIT(4),
00181       kGetEntryWithIndex = BIT(5),
00182       kGetFriend         = BIT(6),
00183       kGetFriendAlias    = BIT(7),
00184       kGetLeaf           = BIT(8),
00185       kLoadTree          = BIT(9),
00186       kPrint             = BIT(10),
00187       kRemoveFriend      = BIT(11),
00188       kSetBranchStatus   = BIT(12)
00189    };
00190    
00191    enum SetBranchAddressStatus {
00192       kMissingBranch = -5,
00193       kInternalError = -4,
00194       kMissingCompiledCollectionProxy = -3,
00195       kMismatch = -2,
00196       kClassMismatch = -1,
00197       kMatch = 0,
00198       kMatchConversion = 1,
00199       kMatchConversionCollection = 2,
00200       kMakeClass = 3,
00201       kVoidPtr = 4,
00202       kNoCheck = 5
00203    };
00204 
00205 public:
00206    // TTree status bits
00207    enum {
00208       kForceRead   = BIT(11),
00209       kCircular    = BIT(12)
00210    };
00211 
00212    // Split level modifier 
00213    enum {
00214       kSplitCollectionOfPointers = 100
00215    };
00216    
00217    TTree();
00218    TTree(const char* name, const char* title, Int_t splitlevel = 99);
00219    virtual ~TTree();
00220 
00221    virtual void            AddBranchToCache(const char *bname, Bool_t subbranches = kFALSE);
00222    virtual void            AddBranchToCache(TBranch *branch,   Bool_t subbranches = kFALSE);
00223    virtual TFriendElement *AddFriend(const char* treename, const char* filename = "");
00224    virtual TFriendElement *AddFriend(const char* treename, TFile* file);
00225    virtual TFriendElement *AddFriend(TTree* tree, const char* alias = "", Bool_t warn = kFALSE);
00226    virtual void            AddTotBytes(Int_t tot) { fTotBytes += tot; }
00227    virtual void            AddZipBytes(Int_t zip) { fZipBytes += zip; }
00228    virtual Long64_t        AutoSave(Option_t* option = "");
00229    virtual Int_t           Branch(TCollection* list, Int_t bufsize = 32000, Int_t splitlevel = 99, const char* name = "");
00230    virtual Int_t           Branch(TList* list, Int_t bufsize = 32000, Int_t splitlevel = 99);
00231    virtual Int_t           Branch(const char* folder, Int_t bufsize = 32000, Int_t splitlevel = 99);
00232    virtual TBranch        *Branch(const char* name, void* address, const char* leaflist, Int_t bufsize = 32000);
00233            TBranch        *Branch(const char* name, char* address, const char* leaflist, Int_t bufsize = 32000) 
00234    {
00235       // Overload to avoid confusion between this signature and the template instance.
00236       return Branch(name,(void*)address,leaflist,bufsize);
00237    }
00238    TBranch        *Branch(const char* name, long address, const char* leaflist, Int_t bufsize = 32000) 
00239    {
00240       // Overload to avoid confusion between this signature and the template instance.
00241       return Branch(name,(void*)address,leaflist,bufsize);
00242    }
00243    TBranch        *Branch(const char* name, int address, const char* leaflist, Int_t bufsize = 32000) 
00244    {
00245       // Overload to avoid confusion between this signature and the template instance.
00246       return Branch(name,(void*)(long)address,leaflist,bufsize);
00247    }
00248 #if !defined(__CINT__)
00249    virtual TBranch        *Branch(const char* name, const char* classname, void* addobj, Int_t bufsize = 32000, Int_t splitlevel = 99);
00250 #endif
00251    template <class T> TBranch *Branch(const char* name, const char* classname, T* obj, Int_t bufsize = 32000, Int_t splitlevel = 99)
00252    {
00253       // See BranchImpRed for details. Here we __ignore
00254       return BranchImpRef(name, classname, TBuffer::GetClass(typeid(T)), obj, bufsize, splitlevel);
00255    }
00256    template <class T> TBranch *Branch(const char* name, const char* classname, T** addobj, Int_t bufsize = 32000, Int_t splitlevel = 99)
00257    {
00258       // See BranchImp for details
00259       return BranchImp(name, classname, TBuffer::GetClass(typeid(T)), addobj, bufsize, splitlevel);
00260    }
00261    template <class T> TBranch *Branch(const char* name, T** addobj, Int_t bufsize = 32000, Int_t splitlevel = 99)
00262    {
00263       // See BranchImp for details
00264       return BranchImp(name, TBuffer::GetClass(typeid(T)), addobj, bufsize, splitlevel);
00265    }
00266    template <class T> TBranch *Branch(const char* name, T* obj, Int_t bufsize = 32000, Int_t splitlevel = 99)
00267    {
00268       // See BranchImp for details
00269       return BranchImpRef(name, TBuffer::GetClass(typeid(T)), TDataType::GetType(typeid(T)), obj, bufsize, splitlevel);
00270    }
00271    virtual TBranch        *Bronch(const char* name, const char* classname, void* addobj, Int_t bufsize = 32000, Int_t splitlevel = 99);
00272    virtual TBranch        *BranchOld(const char* name, const char* classname, void* addobj, Int_t bufsize = 32000, Int_t splitlevel = 1);
00273    virtual TBranch        *BranchRef();
00274    virtual void            Browse(TBrowser*);
00275    virtual Int_t           BuildIndex(const char* majorname, const char* minorname = "0");
00276    TStreamerInfo          *BuildStreamerInfo(TClass* cl, void* pointer = 0, Bool_t canOptimize = kTRUE);
00277    virtual TFile          *ChangeFile(TFile* file);
00278    virtual TTree          *CloneTree(Long64_t nentries = -1, Option_t* option = "");
00279    virtual void            CopyAddresses(TTree*,Bool_t undo = kFALSE);
00280    virtual Long64_t        CopyEntries(TTree* tree, Long64_t nentries = -1, Option_t *option = "");
00281    virtual TTree          *CopyTree(const char* selection, Option_t* option = "", Long64_t nentries = 1000000000, Long64_t firstentry = 0);
00282    virtual TBasket        *CreateBasket(TBranch*);
00283    virtual void            DirectoryAutoAdd(TDirectory *);
00284    Int_t                   Debug() const { return fDebug; }
00285    virtual void            Delete(Option_t* option = ""); // *MENU*
00286    virtual void            Draw(Option_t* opt) { Draw(opt, "", "", 1000000000, 0); }
00287    virtual Long64_t        Draw(const char* varexp, const TCut& selection, Option_t* option = "", Long64_t nentries = 1000000000, Long64_t firstentry = 0);
00288    virtual Long64_t        Draw(const char* varexp, const char* selection, Option_t* option = "", Long64_t nentries = 1000000000, Long64_t firstentry = 0); // *MENU*
00289    virtual void            DropBaskets();
00290    virtual void            DropBuffers(Int_t nbytes);
00291    virtual Int_t           Fill();
00292    virtual TBranch        *FindBranch(const char* name);
00293    virtual TLeaf          *FindLeaf(const char* name);
00294    virtual Int_t           Fit(const char* funcname, const char* varexp, const char* selection = "", Option_t* option = "", Option_t* goption = "", Long64_t nentries = 1000000000, Long64_t firstentry = 0); // *MENU*
00295    virtual Int_t           FlushBaskets() const;
00296    virtual const char     *GetAlias(const char* aliasName) const;
00297    virtual Long64_t        GetAutoFlush() const {return fAutoFlush;}
00298    virtual Long64_t        GetAutoSave()  const {return fAutoSave;}
00299    virtual TBranch        *GetBranch(const char* name);
00300    virtual TBranchRef     *GetBranchRef() const { return fBranchRef; };
00301    virtual Bool_t          GetBranchStatus(const char* branchname) const;
00302    static  Int_t           GetBranchStyle();
00303    virtual Long64_t        GetCacheSize() const { return fCacheSize; }
00304    virtual Long64_t        GetChainEntryNumber(Long64_t entry) const { return entry; }
00305    virtual Long64_t        GetChainOffset() const { return fChainOffset; }
00306    TFile                  *GetCurrentFile() const;
00307            Int_t           GetDefaultEntryOffsetLen() const {return fDefaultEntryOffsetLen;}
00308            Long64_t        GetDebugMax()  const { return fDebugMax; }
00309            Long64_t        GetDebugMin()  const { return fDebugMin; }
00310    TDirectory             *GetDirectory() const { return fDirectory; }
00311    virtual Long64_t        GetEntries() const   { return fEntries; }
00312    virtual Long64_t        GetEntries(const char *selection);
00313    virtual Long64_t        GetEntriesFast() const   { return fEntries; }
00314    virtual Long64_t        GetEntriesFriend() const;
00315    virtual Long64_t        GetEstimate() const { return fEstimate; }
00316    virtual Int_t           GetEntry(Long64_t entry = 0, Int_t getall = 0);
00317            Int_t           GetEvent(Long64_t entry = 0, Int_t getall = 0) { return GetEntry(entry, getall); }
00318    virtual Int_t           GetEntryWithIndex(Int_t major, Int_t minor = 0);
00319    virtual Long64_t        GetEntryNumberWithBestIndex(Int_t major, Int_t minor = 0) const;
00320    virtual Long64_t        GetEntryNumberWithIndex(Int_t major, Int_t minor = 0) const;
00321    TEventList             *GetEventList() const { return fEventList; }
00322    virtual TEntryList     *GetEntryList();
00323    virtual Long64_t        GetEntryNumber(Long64_t entry) const;
00324    virtual Int_t           GetFileNumber() const { return fFileNumber; }
00325    virtual TTree          *GetFriend(const char*) const;
00326    virtual const char     *GetFriendAlias(TTree*) const;
00327    TH1                    *GetHistogram() { return GetPlayer()->GetHistogram(); }
00328    virtual Int_t          *GetIndex() { return &fIndex.fArray[0]; }
00329    virtual Double_t       *GetIndexValues() { return &fIndexValues.fArray[0]; }
00330    virtual TIterator      *GetIteratorOnAllLeaves(Bool_t dir = kIterForward);
00331    virtual TLeaf          *GetLeaf(const char* name);
00332    virtual TList          *GetListOfClones() { return fClones; }
00333    virtual TObjArray      *GetListOfBranches() { return &fBranches; }
00334    virtual TObjArray      *GetListOfLeaves() { return &fLeaves; }
00335    virtual TList          *GetListOfFriends() const { return fFriends; }
00336    virtual TList          *GetListOfAliases() const { return fAliases; }
00337 
00338    // GetMakeClass is left non-virtual for efficiency reason.
00339    // Making it virtual affects the performance of the I/O
00340            Int_t           GetMakeClass() const { return fMakeClass; }
00341 
00342    virtual Long64_t        GetMaxEntryLoop() const { return fMaxEntryLoop; }
00343    virtual Double_t        GetMaximum(const char* columname);
00344    static  Long64_t        GetMaxTreeSize();
00345    virtual Long64_t        GetMaxVirtualSize() const { return fMaxVirtualSize; }
00346    virtual Double_t        GetMinimum(const char* columname);
00347    virtual Int_t           GetNbranches() { return fBranches.GetEntriesFast(); }
00348    TObject                *GetNotify() const { return fNotify; }
00349    TVirtualTreePlayer     *GetPlayer();
00350    virtual Int_t           GetPacketSize() const { return fPacketSize; }
00351    virtual Long64_t        GetReadEntry()  const { return fReadEntry; }
00352    virtual Long64_t        GetReadEvent()  const { return fReadEntry; }
00353    virtual Int_t           GetScanField()  const { return fScanField; }
00354    TTreeFormula           *GetSelect()    { return GetPlayer()->GetSelect(); }
00355    virtual Long64_t        GetSelectedRows() { return GetPlayer()->GetSelectedRows(); }
00356    virtual Int_t           GetTimerInterval() const { return fTimerInterval; }
00357    virtual Long64_t        GetTotBytes() const { return fTotBytes; }
00358    virtual TTree          *GetTree() const { return const_cast<TTree*>(this); }
00359    virtual TVirtualIndex  *GetTreeIndex() const { return fTreeIndex; }
00360    virtual Int_t           GetTreeNumber() const { return 0; }
00361    virtual Int_t           GetUpdate() const { return fUpdate; }
00362    virtual TList          *GetUserInfo();
00363    TTreeFormula           *GetVar(Int_t i)  { return GetPlayer()->GetVar(i); }
00364    TTreeFormula           *GetVar1() { return GetPlayer()->GetVar1(); }
00365    TTreeFormula           *GetVar2() { return GetPlayer()->GetVar2(); }
00366    TTreeFormula           *GetVar3() { return GetPlayer()->GetVar3(); }
00367    TTreeFormula           *GetVar4() { return GetPlayer()->GetVar4(); }
00368    virtual Double_t       *GetVal(Int_t i)   { return GetPlayer()->GetVal(i); }
00369    virtual Double_t       *GetV1()   { return GetPlayer()->GetV1(); }
00370    virtual Double_t       *GetV2()   { return GetPlayer()->GetV2(); }
00371    virtual Double_t       *GetV3()   { return GetPlayer()->GetV3(); }
00372    virtual Double_t       *GetV4()   { return GetPlayer()->GetV4(); }
00373    virtual Double_t       *GetW()    { return GetPlayer()->GetW(); }
00374    virtual Double_t        GetWeight() const   { return fWeight; }
00375    virtual Long64_t        GetZipBytes() const { return fZipBytes; }
00376    virtual void            IncrementTotalBuffers(Int_t nbytes) { fTotalBuffers += nbytes; }
00377    Bool_t                  IsFolder() const { return kTRUE; }
00378    virtual Int_t           LoadBaskets(Long64_t maxmemory = 2000000000);
00379    virtual Long64_t        LoadTree(Long64_t entry);
00380    virtual Long64_t        LoadTreeFriend(Long64_t entry, TTree* T);
00381    virtual Int_t           MakeClass(const char* classname = 0, Option_t* option = "");
00382    virtual Int_t           MakeCode(const char* filename = 0);
00383    virtual Int_t           MakeProxy(const char* classname, const char* macrofilename = 0, const char* cutfilename = 0, const char* option = 0, Int_t maxUnrolling = 3);
00384    virtual Int_t           MakeSelector(const char* selector = 0);
00385    Bool_t                  MemoryFull(Int_t nbytes);
00386    virtual Long64_t        Merge(TCollection* list, Option_t* option = "");
00387    static  TTree          *MergeTrees(TList* list, Option_t* option = "");
00388    virtual Bool_t          Notify();
00389    virtual void            OptimizeBaskets(ULong64_t maxMemory=10000000, Float_t minComp=1.1, Option_t *option=""); 
00390    TPrincipal             *Principal(const char* varexp = "", const char* selection = "", Option_t* option = "np", Long64_t nentries = 1000000000, Long64_t firstentry = 0);
00391    virtual void            Print(Option_t* option = "") const; // *MENU*
00392    virtual void            PrintCacheStats(Option_t* option = "") const;
00393    virtual Long64_t        Process(const char* filename, Option_t* option = "", Long64_t nentries = 1000000000, Long64_t firstentry = 0); // *MENU*
00394 #if defined(__CINT__)
00395 #if defined(R__MANUAL_DICT)
00396    virtual Long64_t        Process(void* selector, Option_t* option = "", Long64_t nentries = 1000000000, Long64_t firstentry = 0);
00397 #endif
00398 #else
00399    virtual Long64_t        Process(TSelector* selector, Option_t* option = "", Long64_t nentries = 1000000000, Long64_t firstentry = 0);
00400 #endif
00401    virtual Long64_t        Project(const char* hname, const char* varexp, const char* selection = "", Option_t* option = "", Long64_t nentries = 1000000000, Long64_t firstentry = 0);
00402    virtual TSQLResult     *Query(const char* varexp = "", const char* selection = "", Option_t* option = "", Long64_t nentries = 1000000000, Long64_t firstentry = 0);
00403    virtual Long64_t        ReadFile(const char* filename, const char* branchDescriptor = "");
00404    virtual Long64_t        ReadStream(istream& inputStream, const char* branchDescriptor = "");
00405    virtual void            Refresh();
00406    virtual void            RecursiveRemove(TObject *obj);
00407    virtual void            RemoveFriend(TTree*);
00408    virtual void            Reset(Option_t* option = "");
00409    virtual void            ResetBranchAddress(TBranch *);
00410    virtual void            ResetBranchAddresses();
00411    virtual Long64_t        Scan(const char* varexp = "", const char* selection = "", Option_t* option = "", Long64_t nentries = 1000000000, Long64_t firstentry = 0); // *MENU*
00412    virtual Bool_t          SetAlias(const char* aliasName, const char* aliasFormula);
00413    virtual void            SetAutoSave(Long64_t autos = 300000000);
00414    virtual void            SetAutoFlush(Long64_t autof = 30000000);
00415    virtual void            SetBasketSize(const char* bname, Int_t buffsize = 16000);
00416 #if !defined(__CINT__)
00417    virtual Int_t           SetBranchAddress(const char *bname,void *add, TBranch **ptr = 0);
00418 #endif
00419    virtual Int_t           SetBranchAddress(const char *bname,void *add, TClass *realClass, EDataType datatype, Bool_t isptr);
00420    virtual Int_t           SetBranchAddress(const char *bname,void *add, TBranch **ptr, TClass *realClass, EDataType datatype, Bool_t isptr);
00421    template <class T> Int_t SetBranchAddress(const char *bname, T **add, TBranch **ptr = 0) {
00422       TClass *cl = TClass::GetClass(typeid(T));
00423       EDataType type = kOther_t;
00424       if (cl==0) type = TDataType::GetType(typeid(T));
00425       return SetBranchAddress(bname,add,ptr,cl,type,true);
00426    }
00427 #ifndef R__NO_CLASS_TEMPLATE_SPECIALIZATION
00428    // This can only be used when the template overload resolution can distringuish between
00429    // T* and T**
00430    template <class T> Int_t SetBranchAddress(const char *bname, T *add, TBranch **ptr = 0) {
00431       TClass *cl = TClass::GetClass(typeid(T));
00432       EDataType type = kOther_t;
00433       if (cl==0) type = TDataType::GetType(typeid(T));
00434       return SetBranchAddress(bname,add,ptr,cl,type,false);
00435    }
00436 #endif
00437    virtual void            SetBranchStatus(const char* bname, Bool_t status = 1, UInt_t* found = 0);
00438    static  void            SetBranchStyle(Int_t style = 1);  //style=0 for old branch, =1 for new branch style
00439    virtual void            SetCacheSize(Long64_t cachesize = -1);
00440    virtual void            SetCacheEntryRange(Long64_t first, Long64_t last);
00441    virtual void            SetCacheLearnEntries(Int_t n=10);
00442    virtual void            SetChainOffset(Long64_t offset = 0) { fChainOffset=offset; }
00443    virtual void            SetCircular(Long64_t maxEntries);
00444    virtual void            SetDebug(Int_t level = 1, Long64_t min = 0, Long64_t max = 9999999); // *MENU*
00445    virtual void            SetDefaultEntryOffsetLen(Int_t newdefault, Bool_t updateExisting = kFALSE);
00446    virtual void            SetDirectory(TDirectory* dir);
00447    virtual Long64_t        SetEntries(Long64_t n = -1);
00448    virtual void            SetEstimate(Long64_t nentries = 10000);
00449    virtual void            SetFileNumber(Int_t number = 0);
00450    virtual void            SetEventList(TEventList* list);
00451    virtual void            SetEntryList(TEntryList* list, Option_t *opt="");
00452    virtual void            SetMakeClass(Int_t make);
00453    virtual void            SetMaxEntryLoop(Long64_t maxev = 1000000000) { fMaxEntryLoop = maxev; } // *MENU*
00454    static  void            SetMaxTreeSize(Long64_t maxsize = 1900000000);
00455    virtual void            SetMaxVirtualSize(Long64_t size = 0) { fMaxVirtualSize = size; } // *MENU*
00456    virtual void            SetName(const char* name); // *MENU*
00457    virtual void            SetNotify(TObject* obj) { fNotify = obj; }
00458    virtual void            SetObject(const char* name, const char* title);
00459    virtual void            SetParallelUnzip(Bool_t opt=kTRUE, Float_t RelSize=-1);
00460    virtual void            SetScanField(Int_t n = 50) { fScanField = n; } // *MENU*
00461    virtual void            SetTimerInterval(Int_t msec = 333) { fTimerInterval=msec; }
00462    virtual void            SetTreeIndex(TVirtualIndex*index);
00463    virtual void            SetWeight(Double_t w = 1, Option_t* option = "");
00464    virtual void            SetUpdate(Int_t freq = 0) { fUpdate = freq; }
00465    virtual void            Show(Long64_t entry = -1, Int_t lenmax = 20);
00466    virtual void            StartViewer(); // *MENU*
00467    virtual void            StopCacheLearningPhase();
00468    virtual Int_t           UnbinnedFit(const char* funcname, const char* varexp, const char* selection = "", Option_t* option = "", Long64_t nentries = 1000000000, Long64_t firstentry = 0);
00469    void                    UseCurrentStyle();
00470    virtual Int_t           Write(const char *name=0, Int_t option=0, Int_t bufsize=0);
00471    virtual Int_t           Write(const char *name=0, Int_t option=0, Int_t bufsize=0) const;
00472 
00473    ClassDef(TTree,18)  //Tree descriptor (the main ROOT I/O class)
00474 };
00475 
00476 //////////////////////////////////////////////////////////////////////////
00477 //                                                                      //
00478 // TTreeFriendLeafIter                                                  //
00479 //                                                                      //
00480 // Iterator on all the leaves in a TTree and its friend                 //
00481 //                                                                      //
00482 //////////////////////////////////////////////////////////////////////////
00483 
00484 class TTreeFriendLeafIter : public TIterator {
00485 
00486 protected:
00487    TTree             *fTree;         //tree being iterated
00488    TIterator         *fLeafIter;     //current leaf sub-iterator.
00489    TIterator         *fTreeIter;     //current tree sub-iterator.
00490    Bool_t             fDirection;    //iteration direction
00491 
00492    TTreeFriendLeafIter() : fTree(0), fLeafIter(0), fTreeIter(0),
00493        fDirection(0) { }
00494 
00495 public:
00496    TTreeFriendLeafIter(const TTree* t, Bool_t dir = kIterForward);
00497    TTreeFriendLeafIter(const TTreeFriendLeafIter &iter);
00498    ~TTreeFriendLeafIter() { SafeDelete(fLeafIter); SafeDelete(fTreeIter); }
00499    TIterator &operator=(const TIterator &rhs);
00500    TTreeFriendLeafIter &operator=(const TTreeFriendLeafIter &rhs);
00501 
00502    const TCollection *GetCollection() const { return 0; }
00503    Option_t          *GetOption() const;
00504    TObject           *Next();
00505    void               Reset() { SafeDelete(fLeafIter); SafeDelete(fTreeIter); }
00506    bool operator !=(const TIterator&) const {
00507       // TODO: Implement me
00508       return false;
00509    }
00510    bool operator !=(const TTreeFriendLeafIter&) const {
00511       // TODO: Implement me
00512       return false;
00513    }
00514    TObject *operator*() const {
00515       // TODO: Implement me
00516       return nullptr;
00517    }
00518    ClassDef(TTreeFriendLeafIter,0)  //Linked list iterator
00519  };
00520 
00521 
00522 #endif

Generated on Tue Jul 5 14:28:16 2011 for ROOT_528-00b_version by  doxygen 1.5.1