299 fLists = new TList();
300 TEntryList *el1 = nullptr;
301 TEntryList *el2 = nullptr;
302 TIter next(elist.fLists);
303 while((el1 = (TEntryList*)next())){
304 el2 = new TEntryList(*el1);
305 if (el1==elist.fCurrent)
315 for (
Int_t i=0; i<fNBlocks; i++){
318 fBlocks->Add(block2);
323 fDirectory =
nullptr;
434 for (i=0; i<nmin; i++){
438 nnew = block1->
Merge(block2);
439 fN =
fN - nold + nnew;
443 for (i=nmin; i<nmax; i++){
611 return fCurrent->Contains(localEntry);
642 if (!block)
return false;
706 for (
auto entry = start; entry < end; entry += step) {
707 this->
Enter(entry, tree);
728 if (!block)
return false;
730 if (block->
Remove(blockindex)){
789 if (blockindex < 0)
return -1;
812 ntotal += templist->
GetN();
815 ntotal += templist->
GetN();
874 if (local) *local = (!strcmp(u.
GetProtocol(),
"file")) ?
true :
false;
893 Info(
"GetEntryList",
"tree: %s, file: %s",
896 if (!treename || !
filename)
return nullptr;
899 bool nexp =
option.Contains(
"NE");
904 if (nexp) local =
false;
907 Info(
"GetEntryList",
"file: %s, local? %d",
filename, local);
917 if (!
gSystem->IsAbsoluteFileName(fn))
919 fn =
gSystem->UnixPathName(fn);
939 Info(
"GetEntryList",
"file: %s (fn: %s), hash: %lu, element hash: %lu",
951 gSystem->ExpandPathName(longname);
952 if (!
gSystem->IsAbsoluteFileName(longname))
954 longname =
gSystem->UnixPathName(longname);
957 newhash = stotal.
Hash();
965 Info(
"GetEntryList",
"file: %s (longname: %s), hash: %lu, element hash: %lu",
982 if (!list)
return -1;
987 Error(
"Add",
"Attempt to add object of class: %s to a %s",elist->
ClassName(),this->ClassName());
1037 while (
fCurrent->GetTreeNumber()<0) {
1072 if (
fCurrent->GetTreeNumber() >= 0)
1203 if (newhash ==
fCurrent->fStringHash){
1300 auto thisTree = tree->
GetTree();
1301 if (!thisTree)
return;
1305 treename = thisTree->GetName();
1347 for (
Int_t i=0; i<n2; i++){
1377 oldn = templist->
GetN();
1392 eresult.
Print(
"all");
1393 eresult.
Add(&elist2);
1395 eresult.
Print(
"all");
1411 if (!newroot || (newroot && strlen(newroot) <= 0)) {
1412 Warning(
"RelocatePaths",
"the new location must be given!");
1417 Info(
"RelocatePaths",
"'%s': relocating paths '%s' to '%s'",
1418 GetName(), oldroot ? oldroot :
"*", newroot);
1420 Int_t nrl = 0, xnrl = 0;
1427 Warning(
"RelocatePaths",
"problems relocating '%s'", enl->
GetName());
1436 if (oldroot && (lo = strlen(oldroot)) > 0) {
1443 if (ilst !=
kNPOS) {
1468 const char *newroot,
const char *oldroot,
const char *enlnm)
1472 if (!fl || (fl&& fl->
IsZombie())) {
1473 ::Error(
"TEntryList::Relocate",
"file '%s' cannot be open for updating", fn);
1480 if (nm.
IsNull()) nm =
"*";
1483 TKey *key =
nullptr;
1484 while ((key = (
TKey *) nxk())) {
1495 ::Error(
"TEntryList::Relocate",
"problems relocating '%s' ...", enl->
GetName());
1532 bool ashort = (
a.Length() >
b.Length()) ? false :
true;
1536 if (
a[i] !=
b[i])
break;
1541 return ashort ? 1 : 2;
1566 bool newobjs =
true;
1586 Printf(
" * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ *");
1588 Printf(
" * %d common root paths found", nrl);
1593 Printf(
" * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ *");
1614 if (!fl || (fl&& fl->
IsZombie())) {
1615 ::Error(
"TEntryList::Relocate",
"file '%s' cannot be open for reading", fn);
1622 TKey *key =
nullptr;
1623 while ((key = (
TKey *) nxk())) {
1629 ::Error(
"TEntryList::Scan",
"object entry-list '%s' not found or not loadable!", key->
GetName());
1647 if (
b.IsReading()) {
1649 Version_t R__v =
b.ReadVersion(&R__s, &R__c);
int Int_t
Signed integer 4 bytes (int)
short Version_t
Class version identifier (short)
int Ssiz_t
String size (currently int)
unsigned long ULong_t
Unsigned long integer 4 bytes (unsigned long). Size depends on architecture.
unsigned int UInt_t
Unsigned integer 4 bytes (unsigned int)
constexpr Ssiz_t kNPOS
The equivalent of std::string::npos for the ROOT class TString.
long long Long64_t
Portable signed long integer 8 bytes.
const char Option_t
Option string (const char)
static Int_t GetCommonString(TString a, TString b, TString &c)
Get in 'c' the string in common at the beginning of 'a' and 'b'.
TEntryList operator||(TEntryList &elist1, TEntryList &elist2)
#define R__ASSERT(e)
Checks condition e and reports a fatal error if it's false.
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char filename
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t result
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t index
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t UChar_t len
void Printf(const char *fmt,...)
Formats a string in a circular formatting buffer and prints the string.
R__EXTERN TSystem * gSystem
Buffer base class used for serializing objects.
Collection abstract base class.
virtual void SetOwner(Bool_t enable=kTRUE)
Set whether this collection is the owner (enable==true) of its content.
virtual Int_t GetSize() const
Return the capacity of the collection, i.e.
TList * GetListOfKeys() const override
TObject * Get(const char *namecycle) override
Return pointer to object identified by namecycle.
Describe directory structure in memory.
virtual TObject * Remove(TObject *)
Used by TEntryList to store the entry numbers.
void OptimizeStorage()
If there are < kBlockSize or >kBlockSize*15 entries, change to an array representation.
bool Remove(Int_t entry)
Remove entry #entry If the block has already been optimized and the entries are stored as a list and ...
Int_t Next()
Return the next non-zero entry Faster than GetEntry() function.
bool Enter(Int_t entry)
If the block has already been optimized and the entries are stored as a list and not as bits,...
Int_t GetNPassed()
Returns the number of entries, passing the selection.
void PrintWithShift(Int_t shift) const
Print the indices of this block + shift (used from TEntryList::Print()) to print the current values.
Int_t Contains(Int_t entry)
True if the block contains entry #entry.
Int_t GetEntry(Int_t entry)
Return entry #entry.
Int_t Merge(TEntryListBlock *block)
Merge with the other block Returns the resulting number of entries in the block.
virtual bool Enter(Long64_t entry, TTree *tree=nullptr)
Add entry #entry to the list.
bool fReapply
If true, TTree::Draw will 'reapply' the original cut.
Long64_t fLastIndexQueried
! used to optimize GetEntry() function from a loop
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...
Long64_t fEntriesToProcess
used on proof to set the number of entries to process in a packet
virtual Int_t GetTreeNumber() const
TString fFileName
name of the file, where the tree is
virtual void OptimizeStorage()
Checks if the array representation is more economical and if so, switches to it.
virtual TList * GetLists() const
virtual Int_t Contains(Long64_t entry, TTree *tree=nullptr)
virtual Int_t ScanPaths(TList *roots, bool notify=true)
Scan the paths to find the common roots.
virtual bool Remove(Long64_t entry, TTree *tree=nullptr)
Remove entry #entry from the list.
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,...
TDirectory * fDirectory
! Pointer to directory holding this tree
virtual TDirectory * GetDirectory() const
TObjArray * fBlocks
blocks with indices of passing events (TEntryListBlocks)
virtual Long64_t GetEntryAndTree(Long64_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...
virtual const char * GetFileName() const
static Int_t Scan(const char *fn, TList *roots)
Scan TEntryList in 'fn' to find the common parts of paths.
virtual void DirectoryAutoAdd(TDirectory *)
Called by TKey and others to automatically add us to a directory when we are read from a file.
Long64_t fN
number of entries in the list
Long64_t fLastIndexReturned
! used to optimize GetEntry() function from a loop
virtual Long64_t Next()
Return the next non-zero entry index (next after fLastIndexQueried) this function is faster than GetE...
virtual void SetDirectory(TDirectory *dir)
Add reference to directory dir. dir can be 0.
void EnterRange(Long64_t start, Long64_t end, TTree *tree=nullptr, UInt_t step=1U)
Enter all entries in a range in the TEntryList.
virtual void Reset()
Reset this list.
Int_t fNBlocks
number of TEntryListBlocks
virtual Long64_t GetEntry(Long64_t index)
Return the number of the entry #index of this TEntryList in the TTree or TChain See also Next().
void Streamer(TBuffer &) override
Custom streamer for class TEntryList to handle the different interpretation of fFileName between vers...
virtual Int_t RelocatePaths(const char *newloc, const char *oldloc=nullptr)
virtual const char * GetTreeName() const
virtual Int_t Merge(TCollection *list)
Merge this list with the lists from the collection.
TEntryList * fCurrent
! currently filled entry list
void Print(const Option_t *option="") const override
Print this list.
ULong_t fStringHash
! Hash value of a string of treename and filename
static Int_t Relocate(const char *fn, const char *newroot, const char *oldroot=nullptr, const char *enlnm=nullptr)
Relocate entry list 'enlnm' in file 'fn' replacing 'oldroot' with 'newroot' in filenames.
TList * fLists
a list of underlying entry lists for each tree of a chain
void GetFileName(const char *filename, TString &fn, bool *=nullptr)
To be able to re-localize the entry-list we identify the file by just the name and the anchor,...
~TEntryList() override
Destructor.
TString fTreeName
name of the tree
void AddSubList(TEntryList *elist)
Add a sub entry list to the current list.
TEntryList()
default c-tor
virtual void Subtract(const TEntryList *elist)
Remove all the entries of this entry list, that are contained in elist.
virtual void Add(const TEntryList *elist)
Add 2 entry lists.
virtual Long64_t GetN() const
A file, usually with extension .root, that stores data and code in the form of serialized objects in ...
static TFile * Open(const char *name, Option_t *option="", const char *ftitle="", Int_t compress=ROOT::RCompressionSetting::EDefaults::kUseCompiledDefault, Int_t netopt=0)
Create / open a file.
void Close(Option_t *option="") override
Close a file.
Book space in a file, create I/O buffers, to fill them, (un)compress them.
virtual const char * GetClassName() const
void Add(TObject *obj) override
const char * GetName() const override
Returns name of object.
TObject * UncheckedAt(Int_t i) const
Collectable string class.
const TString & GetString() const
void SetString(const char *s)
const char * GetName() const override
Returns name of object.
virtual const char * ClassName() const
Returns name of class to which the object belongs.
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
R__ALWAYS_INLINE Bool_t IsZombie() const
virtual Int_t Write(const char *name=nullptr, Int_t option=0, Int_t bufsize=0)
Write this object to the current directory.
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
@ kOverwrite
overwrite existing object with same name
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
Regular expression class.
const char * Data() const
void ToUpper()
Change string to upper case.
UInt_t Hash(ECaseCompare cmp=kExact) const
Return hash value.
TString & Append(const char *cs)
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
A TTree represents a columnar dataset.
TFile * GetCurrentFile() const
Return pointer to the current file.
TDirectory * GetDirectory() const
virtual TTree * GetTree() const
virtual Long64_t LoadTree(Long64_t entry)
Set current entry.
This class represents a WWW compatible URL.
const char * GetAnchor() const
const char * GetUrl(Bool_t withDeflt=kFALSE) const
Return full URL.
const char * GetFile() const
const char * GetProtocol() const
void SetFile(const char *file)