00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #ifndef ROOT_TEventIter
00014 #define ROOT_TEventIter
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef ROOT_TNamed
00026 #include "TNamed.h"
00027 #endif
00028 #ifndef ROOT_TString
00029 #include "TString.h"
00030 #endif
00031
00032 class TDSet;
00033 class TDSetElement;
00034 class TFile;
00035 class TDirectory;
00036 class TSelector;
00037 class TList;
00038 class TIter;
00039 class TTree;
00040 class TTreeCache;
00041 class TEventList;
00042 class TEntryList;
00043
00044
00045
00046 class TEventIter : public TObject {
00047
00048 protected:
00049 TDSet *fDSet;
00050
00051 TDSetElement *fElem;
00052
00053 TString fFilename;
00054 TFile *fFile;
00055 Long64_t fOldBytesRead;
00056 TString fPath;
00057 TDirectory *fDir;
00058 Long64_t fElemFirst;
00059 Long64_t fElemNum;
00060 Long64_t fElemCur;
00061
00062 TSelector *fSel;
00063 Long64_t fFirst;
00064 Long64_t fNum;
00065 Long64_t fCur;
00066 Bool_t fStop;
00067 TEventList *fEventList;
00068 Int_t fEventListPos;
00069 TEntryList *fEntryList;
00070 Long64_t fEntryListPos;
00071
00072 Int_t LoadDir();
00073
00074 public:
00075 TEventIter();
00076 TEventIter(TDSet *dset, TSelector *sel, Long64_t first, Long64_t num);
00077 virtual ~TEventIter();
00078
00079 virtual Long64_t GetCacheSize() = 0;
00080 virtual Int_t GetLearnEntries() = 0;
00081 virtual Long64_t GetNextEvent() = 0;
00082 virtual void StopProcess(Bool_t abort);
00083
00084 static TEventIter *Create(TDSet *dset, TSelector *sel, Long64_t first, Long64_t num);
00085
00086 ClassDef(TEventIter,0)
00087 };
00088
00089
00090
00091
00092 class TEventIterUnit : public TEventIter {
00093
00094 private:
00095 Long64_t fNum;
00096 Long64_t fCurrent;
00097
00098
00099 public:
00100 TEventIterUnit();
00101 TEventIterUnit(TDSet *dset, TSelector *sel, Long64_t num);
00102 ~TEventIterUnit() { }
00103
00104 Long64_t GetCacheSize() {return -1;}
00105 Int_t GetLearnEntries() {return -1;}
00106 Long64_t GetNextEvent();
00107
00108 ClassDef(TEventIterUnit,0)
00109 };
00110
00111
00112
00113
00114 class TEventIterObj : public TEventIter {
00115
00116 private:
00117 TString fClassName;
00118 TList *fKeys;
00119 TIter *fNextKey;
00120 TObject *fObj;
00121
00122 public:
00123 TEventIterObj();
00124 TEventIterObj(TDSet *dset, TSelector *sel, Long64_t first, Long64_t num);
00125 ~TEventIterObj();
00126
00127 Long64_t GetCacheSize() {return -1;}
00128 Int_t GetLearnEntries() {return -1;}
00129 Long64_t GetNextEvent();
00130
00131 ClassDef(TEventIterObj,0)
00132 };
00133
00134
00135
00136 class TEventIterTree : public TEventIter {
00137
00138 private:
00139 TString fTreeName;
00140 TTree *fTree;
00141 TTreeCache *fTreeCache;
00142 Bool_t fTreeCacheIsLearning;
00143 Bool_t fUseTreeCache;
00144 Long64_t fCacheSize;
00145 Bool_t fUseParallelUnzip;
00146 TList *fFileTrees;
00147
00148
00149 class TFileTree : public TNamed {
00150 public:
00151 Bool_t fUsed;
00152 Bool_t fIsLocal;
00153 TFile *fFile;
00154 TList *fTrees;
00155 TFileTree(const char *name, TFile *f, Bool_t islocal);
00156 virtual ~TFileTree();
00157 };
00158
00159 TTree* Load(TDSetElement *elem, Bool_t &localfile);
00160 TTree* GetTrees(TDSetElement *elem);
00161 public:
00162 TEventIterTree();
00163 TEventIterTree(TDSet *dset, TSelector *sel, Long64_t first, Long64_t num);
00164 ~TEventIterTree();
00165
00166 Long64_t GetCacheSize();
00167 Int_t GetLearnEntries();
00168 Long64_t GetNextEvent();
00169
00170 ClassDef(TEventIterTree,0)
00171 };
00172
00173 #endif