File indexing completed on 2025-01-18 10:11:39
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #ifndef ROOT_TEntryList
0013 #define ROOT_TEntryList
0014
0015 #include "TNamed.h"
0016
0017 class TTree;
0018 class TDirectory;
0019 class TObjArray;
0020 class TString;
0021
0022 class TList;
0023 class TCollection;
0024
0025 class TEntryList: public TNamed
0026 {
0027 private:
0028 TEntryList& operator=(const TEntryList&);
0029
0030 protected:
0031 TList *fLists;
0032 TEntryList *fCurrent;
0033
0034 Int_t fNBlocks;
0035 TObjArray *fBlocks;
0036 Long64_t fN;
0037 Long64_t fEntriesToProcess;
0038 TString fTreeName;
0039 TString fFileName;
0040 ULong_t fStringHash;
0041 Int_t fTreeNumber;
0042
0043
0044 Long64_t fLastIndexQueried;
0045 Long64_t fLastIndexReturned;
0046 bool fShift;
0047
0048 TDirectory *fDirectory;
0049 bool fReapply;
0050
0051 void GetFileName(const char *filename, TString &fn, bool * = nullptr);
0052
0053 public:
0054 enum {kBlockSize = 64000};
0055
0056 TEntryList();
0057 TEntryList(const char *name, const char *title);
0058 TEntryList(const char *name, const char *title, const TTree *tree);
0059 TEntryList(const char *name, const char *title, const char *treename, const char *filename);
0060 TEntryList(const TTree *tree);
0061 TEntryList(const TEntryList& elist);
0062 ~TEntryList() override;
0063
0064 virtual void Add(const TEntryList *elist);
0065 void AddSubList(TEntryList *elist);
0066 virtual Int_t Contains(Long64_t entry, TTree *tree = nullptr);
0067 virtual void DirectoryAutoAdd(TDirectory *);
0068 virtual bool Enter(Long64_t entry, TTree *tree = nullptr);
0069 virtual bool Enter(Long64_t localentry, const char *treename, const char *filename);
0070 void EnterRange(Long64_t start, Long64_t end, TTree *tree = nullptr, UInt_t step = 1U);
0071 virtual TEntryList *GetCurrentList() const { return fCurrent; };
0072 virtual TEntryList *GetEntryList(const char *treename, const char *filename, Option_t *opt="");
0073 virtual Long64_t GetEntry(Long64_t index);
0074 virtual Long64_t GetEntryAndTree(Long64_t index, Int_t &treenum);
0075 virtual Long64_t GetEntriesToProcess() const {return fEntriesToProcess;}
0076 virtual TList *GetLists() const { return fLists; }
0077 virtual TDirectory *GetDirectory() const { return fDirectory; }
0078 virtual Long64_t GetN() const { return fN; }
0079 virtual const char *GetTreeName() const { return fTreeName.Data(); }
0080 virtual const char *GetFileName() const { return fFileName.Data(); }
0081 virtual Int_t GetTreeNumber() const { return fTreeNumber; }
0082 virtual bool GetReapplyCut() const { return fReapply; };
0083
0084 bool IsValid() const
0085 {
0086 if ((fLists || fBlocks)) return true;
0087 return false;
0088 }
0089
0090 virtual Int_t Merge(TCollection *list);
0091
0092 virtual Long64_t Next();
0093 virtual void OptimizeStorage();
0094 virtual Int_t RelocatePaths(const char *newloc, const char *oldloc = nullptr);
0095 virtual bool Remove(Long64_t entry, TTree *tree = nullptr);
0096 virtual void Reset();
0097 virtual Int_t ScanPaths(TList *roots, bool notify = true);
0098
0099 void Print(const Option_t* option = "") const override;
0100 virtual void SetDirectory(TDirectory *dir);
0101 virtual void SetEntriesToProcess(Long64_t nen) { fEntriesToProcess = nen; }
0102 virtual void SetShift(bool shift) { fShift = shift; };
0103 virtual void SetTree(const TTree *tree);
0104 virtual void SetTree(const char *treename, const char *filename);
0105 virtual void SetTreeName(const char *treename){ fTreeName = treename; };
0106 virtual void SetFileName(const char *filename){ fFileName = filename; };
0107 virtual void SetTreeNumber(Int_t index) { fTreeNumber=index; }
0108 virtual void SetReapplyCut(bool apply = false) {fReapply = apply;};
0109 virtual void Subtract(const TEntryList *elist);
0110
0111 static Int_t Relocate(const char *fn,
0112 const char *newroot, const char *oldroot = nullptr, const char *enlnm = nullptr);
0113 static Int_t Scan(const char *fn, TList *roots);
0114
0115
0116 #if (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) >= 40600
0117 #pragma GCC diagnostic push
0118 #pragma GCC diagnostic ignored "-Weffc++"
0119 #endif
0120 friend TEntryList operator||(TEntryList& elist1, TEntryList& elist2);
0121 #if (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) >= 40600
0122 #pragma GCC diagnostic pop
0123 #endif
0124
0125 ClassDefOverride(TEntryList, 2);
0126 };
0127 #endif