#ifndef ROOT_TEventIter
#define ROOT_TEventIter
#ifndef ROOT_TNamed
#include "TNamed.h"
#endif
#ifndef ROOT_TString
#include "TString.h"
#endif
class TDSet;
class TDSetElement;
class TFile;
class TDirectory;
class TSelector;
class TList;
class TIter;
class TTree;
class TTreeCache;
class TEventList;
class TEntryList;
class TEventIter : public TObject {
public:
enum EIterType { kData = 15};
protected:
TDSet *fDSet;
TDSetElement *fElem;
TString fFilename;
TFile *fFile;
Long64_t fOldBytesRead;
TString fPath;
TDirectory *fDir;
Long64_t fElemFirst;
Long64_t fElemNum;
Long64_t fElemCur;
TSelector *fSel;
Long64_t fFirst;
Long64_t fNum;
Long64_t fCur;
Bool_t fStop;
TEventList *fEventList;
Int_t fEventListPos;
TEntryList *fEntryList;
Long64_t fEntryListPos;
TList *fPackets;
Int_t LoadDir();
public:
TEventIter();
TEventIter(TDSet *dset, TSelector *sel, Long64_t first, Long64_t num);
virtual ~TEventIter();
virtual Long64_t GetCacheSize() = 0;
virtual Int_t GetLearnEntries() = 0;
virtual Long64_t GetNextEvent() = 0;
virtual Int_t GetNextPacket(Long64_t &first, Long64_t &num,
TEntryList **enl = 0, TEventList **evl = 0) = 0;
virtual void InvalidatePacket();
virtual void PreProcessEvent(Long64_t) = 0;
virtual void StopProcess(Bool_t abort);
TList *GetPackets() { return fPackets; }
static TEventIter *Create(TDSet *dset, TSelector *sel, Long64_t first, Long64_t num);
ClassDef(TEventIter,0)
};
class TEventIterUnit : public TEventIter {
private:
Long64_t fNum;
Long64_t fCurrent;
public:
TEventIterUnit();
TEventIterUnit(TDSet *dset, TSelector *sel, Long64_t num);
~TEventIterUnit() { }
Long64_t GetCacheSize() {return -1;}
Int_t GetLearnEntries() {return -1;}
Long64_t GetNextEvent();
Int_t GetNextPacket(Long64_t &first, Long64_t &num,
TEntryList **enl = 0, TEventList **evl = 0);
inline void PreProcessEvent(Long64_t) { };
ClassDef(TEventIterUnit,0)
};
class TEventIterObj : public TEventIter {
private:
TString fClassName;
TList *fKeys;
TIter *fNextKey;
TObject *fObj;
public:
TEventIterObj();
TEventIterObj(TDSet *dset, TSelector *sel, Long64_t first, Long64_t num);
~TEventIterObj();
Long64_t GetCacheSize() {return -1;}
Int_t GetLearnEntries() {return -1;}
Long64_t GetNextEvent();
Int_t GetNextPacket(Long64_t &first, Long64_t &num,
TEntryList **enl = 0, TEventList **evl = 0);
void PreProcessEvent(Long64_t);
ClassDef(TEventIterObj,0)
};
class TEventIterTree : public TEventIter {
private:
TString fTreeName;
TTree *fTree;
TTreeCache *fTreeCache;
Bool_t fTreeCacheIsLearning;
Bool_t fUseTreeCache;
Long64_t fCacheSize;
Bool_t fUseParallelUnzip;
Bool_t fDontCacheFiles;
TList *fFileTrees;
class TFileTree : public TNamed {
public:
Bool_t fUsed;
Bool_t fIsLocal;
TFile *fFile;
TList *fTrees;
TFileTree(const char *name, TFile *f, Bool_t islocal);
virtual ~TFileTree();
};
TTree* Load(TDSetElement *elem, Bool_t &localfile, const char *objname = 0);
TTree* GetTrees(TDSetElement *elem);
public:
TEventIterTree();
TEventIterTree(TDSet *dset, TSelector *sel, Long64_t first, Long64_t num);
~TEventIterTree();
Long64_t GetCacheSize();
Int_t GetLearnEntries();
Long64_t GetNextEvent();
Int_t GetNextPacket(Long64_t &first, Long64_t &num,
TEntryList **enl = 0, TEventList **evl = 0);
void PreProcessEvent(Long64_t ent);
ClassDef(TEventIterTree,0)
};
#endif