174 fLastIndexQueried = -1;
175 fLastIndexReturned = 0;
198 if (fDirectory) fDirectory->Append(
this);
200 fLastIndexQueried = -1;
201 fLastIndexReturned = 0;
220 if (fDirectory) fDirectory->Append(
this);
222 fLastIndexQueried = -1;
223 fLastIndexReturned = 0;
413 for (i=0; i<nmin; i++){
417 nnew = block1->
Merge(block2);
418 fN =
fN - nold + nnew;
422 for (i=nmin; i<nmax; i++){
570 if (!block)
return 0;
623 if (!block)
return 0;
625 if (block->
Remove(blockindex)){
669 while (total_passed<=index && i<
fNBlocks){
682 Long64_t localindex = index - total_passed;
684 if (blockindex < 0)
return -1;
707 ntotal += templist->
GetN();
710 ntotal += templist->
GetN();
747 if (treenum<0)
return -1;
763 if (local) *local = (!strcmp(u.GetProtocol(),
"file")) ?
kTRUE :
kFALSE;
764 if (strlen(u.GetAnchor()) > 0) {
765 fn.
Form(
"%s#%s", u.GetFile(), u.GetAnchor());
782 Info(
"GetEntryList",
"tree: %s, file: %s",
783 (treename ? treename :
"-"), (filename ? filename :
"-"));
785 if (!treename || !filename)
return 0;
796 Info(
"GetEntryList",
"file: %s, local? %d", filename, local);
828 Info(
"GetEntryList",
"file: %s (fn: %s), hash: %lu, element hash: %lu",
846 newhash = stotal.
Hash();
854 Info(
"GetEntryList",
"file: %s (longname: %s), hash: %lu, element hash: %lu",
871 if (!list)
return -1;
897 result = current_block->
Next();
904 while (result<0 && iblock<
fNBlocks-1) {
909 result = current_block->
Next();
1011 elist->
Print(option);
1189 auto thisTree = tree->
GetTree();
1190 if (!thisTree)
return;
1194 treename = thisTree->GetName();
1203 if (!strcmp(url.GetProtocol(),
"file")){
1208 url.SetFile(filename);
1210 filename = url.GetUrl();
1235 for (
Int_t i=0; i<n2; i++){
1236 entry = (
const_cast<TEntryList*
>(elist))->GetEntry(i);
1250 !strcmp(templist->fFileName.Data(),fFileName.Data())){
1265 oldn = templist->
GetN();
1280 eresult.
Print(
"all");
1281 eresult.
Add(&elist2);
1283 eresult.
Print(
"all");
1299 if (!newroot || (newroot && strlen(newroot) <= 0)) {
1300 Warning(
"RelocatePaths",
"the new location must be given!");
1305 Info(
"RelocatePaths",
"'%s': relocating paths '%s' to '%s'",
1306 GetName(), oldroot ? oldroot :
"*", newroot);
1308 Int_t nrl = 0, xnrl = 0;
1315 Warning(
"RelocatePaths",
"problems relocating '%s'", enl->
GetName());
1324 if (oldroot && (lo = strlen(oldroot)) > 0) {
1325 if (fFileName.BeginsWith(oldroot)) {
1326 fFileName.
Replace(0, lo, newroot);
1331 if (ilst !=
kNPOS) {
1332 fFileName.Replace(0, ilst, newroot);
1356 const char *newroot,
const char *oldroot,
const char *enlnm)
1360 if (!fl || (fl&& fl->
IsZombie())) {
1361 ::Error(
"TEntryList::Relocate",
"file '%s' cannot be open for updating", fn);
1368 if (nm.
IsNull()) nm =
"*";
1372 while ((key = (
TKey *) nxk())) {
1373 if (!strcmp(key->GetClassName(),
"TEntryList")) {
1375 if (knm.Index(nmrg) !=
kNPOS) {
1383 ::Error(
"TEntryList::Relocate",
"problems relocating '%s' ...", enl->
GetName());
1423 for (
Int_t i = 0; i < len; i++) {
1424 if (a[i] != b[i])
break;
1429 return ashort ? 1 : 2;
1474 Printf(
" * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ *");
1476 Printf(
" * %d common root paths found", nrl);
1481 Printf(
" * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ *");
1502 if (!fl || (fl&& fl->
IsZombie())) {
1503 ::Error(
"TEntryList::Relocate",
"file '%s' cannot be open for reading", fn);
1511 while ((key = (
TKey *) nxk())) {
1512 if (!strcmp(key->GetClassName(),
"TEntryList")) {
1517 ::Error(
"TEntryList::Scan",
"object entry-list '%s' not found or not loadable!", key->GetName());
1533 void TEntryList::Streamer(
TBuffer &b)
virtual const char * GetName() const
Returns name of object.
virtual Int_t Write(const char *name=0, Int_t option=0, Int_t bufsize=0)
Write this object to the current directory.
Long64_t fEntriesToProcess
used on proof to set the number of entries to process in a packet
virtual Bool_t IsAbsoluteFileName(const char *dir)
Return true if dir is an absolute pathname.
virtual Long64_t Next()
Return the next non-zero entry index (next after fLastIndexQueried) this function is faster than GetE...
virtual TDirectory * GetDirectory() const
virtual Int_t WriteClassBuffer(const TClass *cl, void *pointer)=0
virtual void Delete(Option_t *option="")
Remove all objects from the list AND delete all heap based objects.
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
virtual Long64_t GetN() const
Collectable string class.
virtual const char * GetFileName() const
virtual void Delete(Option_t *option="")
Remove all objects from the array AND delete all heap based objects.
virtual Int_t GetTreeNumber() const
void OptimizeStorage()
If there are < kBlockSize or >kBlockSize*15 entries, change to an array representation.
This class represents a WWW compatible URL.
virtual void SetOwner(Bool_t enable=kTRUE)
Set whether this collection is the owner (enable==true) of its content.
virtual TList * GetLists() const
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format...
virtual TObject * Last() const
Return the last object in the list. Returns 0 when list is empty.
void ToUpper()
Change string to upper case.
Buffer base class used for serializing objects.
Regular expression class.
virtual TObject * Get(const char *namecycle)
Return pointer to object identified by namecycle.
Int_t Merge(TEntryListBlock *block)
Merge with the other block Returns the resulting number of entries in the block.
virtual ~TEntryList()
Destructor.
Short_t Min(Short_t a, Short_t b)
virtual void OptimizeStorage()
Checks if the array representation is more economical and if so, switches to it.
virtual const char * DirName(const char *pathname)
Return the directory name in pathname.
Int_t fNBlocks
number of TEntryListBlocks
TList * fLists
a list of underlying entry lists for each tree of a chain
static Int_t Scan(const char *fn, TList *roots)
Scan TEntryList in 'fn' to find the common parts of paths.
Long64_t fLastIndexQueried
! used to optimize GetEntry() function from a loop
ULong_t fStringHash
! Hash value of a string of treename and filename
virtual void SetTree(const TTree *tree)
If a list for a tree with such name and filename exists, sets it as the current sublist If not...
UInt_t Hash(ECaseCompare cmp=kExact) const
Return hash value.
Bool_t fShift
! true when some sub-lists don't correspond to trees (when the entry list is used as input in TChain)...
overwrite existing object with same name
virtual const char * UnixPathName(const char *unixpathname)
Convert from a Unix pathname to a local pathname.
TString & Replace(Ssiz_t pos, Ssiz_t n, const char *s)
static TFile * Open(const char *name, Option_t *option="", const char *ftitle="", Int_t compress=1, Int_t netopt=0)
Create / open a file.
virtual void SetDirectory(TDirectory *dir)
Add reference to directory dir. dir can be 0.
const char * GetFile() const
Bool_t Enter(Int_t entry)
If the block has already been optimized and the entries are stored as a list and not as bits...
virtual const char * ClassName() const
Returns name of class to which the object belongs.
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString...
The TNamed class is the base class for all named ROOT classes.
static Int_t GetCommonString(TString a, TString b, TString &c)
Get in 'c' the string in common at the beginning of 'a' and 'b'.
virtual Long64_t LoadTree(Long64_t entry)
Set current entry.
TString & Append(const char *cs)
virtual const char * PrependPathName(const char *dir, TString &name)
Concatenate a directory and a file name.
Int_t GetEntry(Int_t entry)
Return entry #entry.
void PrintWithShift(Int_t shift) const
Print the indices of this block + shift (used from TEntryList::Print()) to print the current values...
Book space in a file, create I/O buffers, to fill them, (un)compress them.
TDirectory * fDirectory
! Pointer to directory holding this tree
virtual TTree * GetTree() const
Bool_t fReapply
If true, TTree::Draw will 'reapply' the original cut.
const char * GetName() const
Returns name of object.
virtual void Add(const TEntryList *elist)
Add 2 entry lists.
TString fTreeName
name of the tree
friend TEntryList operator||(TEntryList &elist1, TEntryList &elist2)
const TString & GetString() const
virtual TObject * First() const
Return the first object in the list. Returns 0 when list is empty.
R__EXTERN TSystem * gSystem
TEntryList * fCurrent
! currently filled entry list
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
Collection abstract base class.
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
TFile * GetCurrentFile() const
Return pointer to the current file.
virtual Long64_t GetEntry(Int_t index)
Return the number of the entry #index of this TEntryList in the TTree or TChain See also Next()...
virtual void Append(TObject *obj, Bool_t replace=kFALSE)
Append object to this directory.
Int_t Contains(Int_t entry)
True if the block contains entry #entry.
virtual TObject * After(const TObject *obj) const
Returns the object after object obj.
Int_t GetNPassed()
Returns the number of entries, passing the selection.
virtual Int_t Contains(Long64_t entry, TTree *tree=0)
virtual void DirectoryAutoAdd(TDirectory *)
Called by TKey and others to automatically add us to a directory when we are read from a file...
void GetFileName(const char *filename, TString &fn, Bool_t *=0)
To be able to re-localize the entry-list we identify the file by just the name and the anchor...
virtual Int_t ScanPaths(TList *roots, Bool_t notify=kTRUE)
Scan the paths to find the common roots.
Long64_t fN
number of entries in the list
virtual Int_t ReadClassBuffer(const TClass *cl, void *pointer, const TClass *onfile_class=0)=0
Int_t Next()
Return the next non-zero entry Faster than GetEntry() function.
TObject * UncheckedAt(Int_t i) const
virtual TObject * Remove(TObject *)
Remove an object from the in-memory list.
virtual Long64_t GetEntryAndTree(Int_t index, Int_t &treenum)
Return the index of "index"-th non-zero entry in the TTree or TChain and the # of the corresponding t...
Ssiz_t Last(char c) const
Find last occurrence of a character c.
virtual Int_t Merge(TCollection *list)
Merge this list with the lists from the collection.
Long64_t fLastIndexReturned
! used to optimize GetEntry() function from a loop
Describe directory structure in memory.
TDirectory * GetDirectory() const
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
TEntryList()
default c-tor
virtual Bool_t Enter(Long64_t entry, TTree *tree=0)
Add entry #entry to the list.
TObjArray * fBlocks
blocks with indices of passing events (TEntryListBlocks)
Int_t fTreeNumber
! the index of the tree in the chain (used when the entry list is used as input (TTree::SetEntryList(...
virtual void Print(const Option_t *option="") const
Print this list.
virtual void Add(TObject *obj)
Bool_t Remove(Int_t entry)
Remove entry #entry If the block has already been optimized and the entries are stored as a list and ...
virtual void Reset()
Reset this list.
virtual const char * GetTreeName() const
virtual Bool_t Remove(Long64_t entry, TTree *tree=0)
Remove entry #entry from the list.
virtual TList * GetListOfKeys() const
virtual TEntryList * GetEntryList(const char *treename, const char *filename, Option_t *opt="")
Return the entry list, corresponding to treename and filename By default, the filename is first tried...
you should not use this method at all Int_t Int_t Double_t Double_t Double_t Int_t Double_t Double_t Double_t Double_t b
A TTree object has a header with a name and a title.
Used by TEntryList to store the entry numbers.
virtual Bool_t ExpandPathName(TString &path)
Expand a pathname getting rid of special shell characters like ~.
TString fFileName
name of the file, where the tree is
static Int_t Relocate(const char *fn, const char *newroot, const char *oldroot=0, const char *enlnm=0)
Relocate entry list 'enlnm' in file 'fn' replacing 'oldroot' with 'newroot' in filenames.
virtual Int_t GetSize() const
void SetString(const char *s)
A List of entry numbers in a TTree or TChain.
virtual void Subtract(const TEntryList *elist)
Remove all the entries of this entry list, that are contained in elist.
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
virtual Int_t RelocatePaths(const char *newloc, const char *oldloc=0)
Relocate the file paths.
virtual Version_t ReadVersion(UInt_t *start=0, UInt_t *bcnt=0, const TClass *cl=0)=0
virtual void Close(Option_t *option="")
Close a file.
const char * Data() const