/usr/include/root/TEventIter.h is in libroot-proof-proofplayer-dev 5.34.14-1build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 | // @(#)root/proofplayer:$Id$
// Author: Maarten Ballintijn 07/01/02
// Modified: Long Tran-Thanh 04/09/07 (Addition of TEventIterUnit)
/*************************************************************************
* Copyright (C) 1995-2001, Rene Brun and Fons Rademakers. *
* All rights reserved. *
* *
* For the licensing terms see $ROOTSYS/LICENSE. *
* For the list of contributors see $ROOTSYS/README/CREDITS. *
*************************************************************************/
#ifndef ROOT_TEventIter
#define ROOT_TEventIter
//////////////////////////////////////////////////////////////////////////
// //
// TEventIter //
// //
// Special iterator class used in TProofPlayer to iterate over events //
// or objects in the packets. //
// //
//////////////////////////////////////////////////////////////////////////
#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}; // True if iterating over data
protected:
TDSet *fDSet; // data set over which to iterate
TDSetElement *fElem; // Current Element
TString fFilename; // Name of the current file
TFile *fFile; // Current file
Long64_t fOldBytesRead; // last reported number of bytes read
TString fPath; // Path to current TDirectory
TDirectory *fDir; // directory containing the objects or the TTree
Long64_t fElemFirst; // first entry to process for this element
Long64_t fElemNum; // number of entries to process for this element
Long64_t fElemCur; // current entry for this element
TSelector *fSel; // selector to be used
Long64_t fFirst; // first entry to process
Long64_t fNum; // number of entries to process
Long64_t fCur; // current entry
Bool_t fStop; // termination of run requested
TEventList *fEventList; //! eventList for processing
Int_t fEventListPos; //! current position in the eventList
TEntryList *fEntryList; //! entry list for processing
Long64_t fEntryListPos; //! current position in the entrylist
TList *fPackets; // list of packets processed packets
Int_t LoadDir(); // Load the directory pointed to by fElem
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) // Event iterator used by TProofPlayer's
};
//------------------------------------------------------------------------
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) // Event iterator for objects
};
//------------------------------------------------------------------------
class TEventIterObj : public TEventIter {
private:
TString fClassName; // class name of objects to iterate over
TList *fKeys; // list of keys
TIter *fNextKey; // next key in directory
TObject *fObj; // object found
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) // Event iterator for objects
};
//------------------------------------------------------------------------
class TEventIterTree : public TEventIter {
private:
TString fTreeName; // name of the tree object to iterate over
TTree *fTree; // tree we are iterating over
TTreeCache *fTreeCache; // instance of the tree cache for the tree
Bool_t fTreeCacheIsLearning; // Whether cache is in learning phase
Bool_t fUseTreeCache; // Control usage of the tree cache
Long64_t fCacheSize; // Cache size
Bool_t fUseParallelUnzip; // Control usage of parallel unzip
Bool_t fDontCacheFiles; // Control OS caching of read files (Mac Os X only)
TList *fFileTrees; // Files && Trees currently open
// Auxilliary class to keep track open files and loaded trees
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);
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) // Event iterator for Trees
};
#endif
|