TChain.h

Go to the documentation of this file.
00001 // @(#)root/tree:$Id: TChain.h 33354 2010-05-03 19:46:03Z pcanal $
00002 // Author: Rene Brun   03/02/97
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_TChain
00013 #define ROOT_TChain
00014 
00015 
00016 //////////////////////////////////////////////////////////////////////////
00017 //                                                                      //
00018 // TChain                                                               //
00019 //                                                                      //
00020 // A chain of TTrees.                                                   //
00021 //                                                                      //
00022 //////////////////////////////////////////////////////////////////////////
00023 
00024 #ifndef ROOT_TTree
00025 #include "TTree.h"
00026 #endif
00027 
00028 class TFile;
00029 class TBrowser;
00030 class TCut;
00031 class TEntryList;
00032 class TEventList;
00033 class TCollection;
00034 
00035 class TChain : public TTree {
00036 
00037 protected:
00038    Int_t        fTreeOffsetLen;    //  Current size of fTreeOffset array
00039    Int_t        fNtrees;           //  Number of trees
00040    Int_t        fTreeNumber;       //! Current Tree number in fTreeOffset table
00041    Long64_t    *fTreeOffset;       //[fTreeOffsetLen] Array of variables
00042    Bool_t       fCanDeleteRefs;    //! If true, TProcessIDs are deleted when closing a file
00043    TTree       *fTree;             //! Pointer to current tree (Note: We do *not* own this tree.)
00044    TFile       *fFile;             //! Pointer to current file (We own the file).
00045    TObjArray   *fFiles;            //-> List of file names containing the trees (TChainElement, owned)
00046    TList       *fStatus;           //-> List of active/inactive branches (TChainElement, owned)
00047    TChain      *fProofChain;       //! chain proxy when going to be processed by PROOF
00048 
00049 private:
00050    TChain(const TChain&);            // not implemented
00051    TChain& operator=(const TChain&); // not implemented
00052 
00053 protected:
00054    void ReleaseChainProof();
00055 
00056 public:
00057    // TChain constants
00058    enum {
00059       kGlobalWeight   = BIT(15),
00060       kAutoDelete     = BIT(16),
00061       kProofUptodate  = BIT(17),
00062       kProofLite      = BIT(18),
00063       kBigNumber      = 1234567890
00064    };
00065 
00066 public:
00067    TChain();
00068    TChain(const char* name, const char* title = "");
00069    virtual ~TChain();
00070 
00071    virtual Int_t     Add(TChain* chain);
00072    virtual Int_t     Add(const char* name, Long64_t nentries = kBigNumber);
00073    virtual Int_t     AddFile(const char* name, Long64_t nentries = kBigNumber, const char* tname = "");
00074    virtual Int_t     AddFileInfoList(TCollection* list, Long64_t nfiles = kBigNumber);
00075    virtual TFriendElement *AddFriend(const char* chainname, const char* dummy = "");
00076    virtual TFriendElement *AddFriend(const char* chainname, TFile* dummy);
00077    virtual TFriendElement *AddFriend(TTree* chain, const char* alias = "", Bool_t warn = kFALSE);
00078    virtual void      Browse(TBrowser*);
00079    virtual void      CanDeleteRefs(Bool_t flag = kTRUE);
00080    virtual void      CreatePackets();
00081    virtual void      DirectoryAutoAdd(TDirectory *);
00082    virtual Long64_t  Draw(const char* varexp, const TCut& selection, Option_t* option = "", Long64_t nentries = kBigNumber, Long64_t firstentry = 0);
00083    virtual Long64_t  Draw(const char* varexp, const char* selection, Option_t* option = "", Long64_t nentries = kBigNumber, Long64_t firstentry = 0); // *MENU*
00084    virtual void      Draw(Option_t* opt) { Draw(opt, "", "", 1000000000, 0); }
00085    virtual Int_t     Fill() { MayNotUse("Fill()"); return -1; }
00086    virtual TBranch  *FindBranch(const char* name);
00087    virtual TLeaf    *FindLeaf(const char* name);
00088    virtual TBranch  *GetBranch(const char* name);
00089    virtual Bool_t    GetBranchStatus(const char* branchname) const;
00090    virtual Long64_t  GetChainEntryNumber(Long64_t entry) const;
00091            Int_t     GetNtrees() const { return fNtrees; }
00092    virtual Long64_t  GetEntries() const;
00093    virtual Long64_t  GetEntries(const char *sel) { return TTree::GetEntries(sel); }
00094    virtual Int_t     GetEntry(Long64_t entry=0, Int_t getall=0);
00095    virtual Long64_t  GetEntryNumber(Long64_t entry) const;
00096    virtual Int_t     GetEntryWithIndex(Int_t major, Int_t minor=0);
00097    TFile            *GetFile() const;
00098    virtual TLeaf    *GetLeaf(const char* name);
00099    virtual TObjArray *GetListOfBranches();
00100    //                Warning, GetListOfFiles returns the list of TChainElements (not the list of files)
00101    //                see TChain::AddFile to see how to get the corresponding TFile objects
00102    TObjArray        *GetListOfFiles() const {return fFiles;}
00103    virtual TObjArray *GetListOfLeaves();
00104    virtual const char *GetAlias(const char *aliasName) const;
00105    virtual Double_t  GetMaximum(const char *columname);
00106    virtual Double_t  GetMinimum(const char *columname);
00107    virtual Int_t     GetNbranches();
00108    virtual Long64_t  GetReadEntry() const;
00109    TList            *GetStatus() const { return fStatus; }
00110    virtual TTree    *GetTree() const { return fTree; }
00111    virtual Int_t     GetTreeNumber() const { return fTreeNumber; }
00112            Long64_t *GetTreeOffset() const { return fTreeOffset; }
00113            Int_t     GetTreeOffsetLen() const { return fTreeOffsetLen; }
00114    virtual Double_t  GetWeight() const;
00115    virtual Int_t     LoadBaskets(Long64_t maxmemory);
00116    virtual Long64_t  LoadTree(Long64_t entry);
00117            void      Lookup(Bool_t force = kFALSE);
00118    virtual void      Loop(Option_t *option="", Long64_t nentries=kBigNumber, Long64_t firstentry=0); // *MENU*
00119    virtual void      ls(Option_t *option="") const;
00120    virtual Long64_t  Merge(const char *name, Option_t *option = "");
00121    virtual Long64_t  Merge(TCollection *list, Option_t *option = "");
00122    virtual Long64_t  Merge(TFile *file, Int_t basketsize, Option_t *option="");
00123    virtual void      Print(Option_t *option="") const;
00124    virtual Long64_t  Process(const char *filename, Option_t *option="", Long64_t nentries=kBigNumber, Long64_t firstentry=0); // *MENU*
00125 #ifndef __CINT__
00126    virtual Long64_t  Process(TSelector *selector, Option_t *option="",  Long64_t nentries=kBigNumber, Long64_t firstentry=0);
00127 #endif
00128    virtual void      RecursiveRemove(TObject *obj);
00129    virtual void      Reset(Option_t *option="");
00130    virtual void      ResetBranchAddress(TBranch *);
00131    virtual void      ResetBranchAddresses();
00132    virtual Long64_t  Scan(const char *varexp="", const char *selection="", Option_t *option="", Long64_t nentries=1000000000, Long64_t firstentry=0); // *MENU*
00133    virtual void      SetAutoDelete(Bool_t autodel=kTRUE);
00134    virtual Int_t     SetBranchAddress(const char *bname,void *add, TBranch **ptr = 0);
00135    virtual Int_t     SetBranchAddress(const char *bname,void *add, TBranch **ptr, TClass *realClass, EDataType datatype, Bool_t isptr);
00136    virtual Int_t     SetBranchAddress(const char *bname,void *add, TClass *realClass, EDataType datatype, Bool_t isptr);
00137 
00138    virtual void      SetBranchStatus(const char *bname, Bool_t status=1, UInt_t *found=0);
00139    virtual void      SetDirectory(TDirectory *dir);
00140    virtual void      SetEntryList(TEntryList *elist, Option_t *opt="");
00141    virtual void      SetEntryListFile(const char *filename="", Option_t *opt="");
00142    virtual void      SetEventList(TEventList *evlist);
00143    virtual void      SetMakeClass(Int_t make) { TTree::SetMakeClass(make); if (fTree) fTree->SetMakeClass(make);}
00144    virtual void      SetPacketSize(Int_t size = 100);
00145    virtual void      SetProof(Bool_t on = kTRUE, Bool_t refresh = kFALSE, Bool_t gettreeheader = kFALSE);
00146    virtual void      SetWeight(Double_t w=1, Option_t *option="");
00147    virtual void      UseCache(Int_t maxCacheSize = 10, Int_t pageSize = 0);
00148 
00149    ClassDef(TChain,5)  //A chain of TTrees
00150 };
00151 
00152 #endif // ROOT_TChain

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