114TEntryListArray::TEntryListArray(
const char *
name,
const char *title,
const char *treename,
const char *
filename):
TEntryList(
name, title, treename,
filename), fSubLists(nullptr), fEntry(-1), fLastSubListQueried(nullptr), fSubListIter(nullptr)
173 SetTree(
e->GetTreeName(),
e->GetFileName());
202 e->AddEntriesAndSubLists(elist);
233 TIter next2(other_sublists);
237 el1->TEntryList::Add(el2);
240 }
else if (el1 && (!el2 || el1->
fEntry < el2->
fEntry)) {
274 Long64_t localentry = tree->LoadTree(entry);
278 return currentArray->
Contains(localentry,
nullptr, subentry);
287 result = t->TEntryList::Contains(subentry);
349 Long64_t localentry = tree->LoadTree(entry);
353 if ((
result = currentArray->
Enter(localentry,
nullptr, subentry)))
361 if (currentArray && (
result = currentArray->
Enter(entry,
nullptr, subentry))) {
370 if (subentry != -1) {
371 t->TEntryList::Enter(subentry);
377 if (subentry != -1 &&
result) {
379 if (t) t->TEntryList::Enter(subentry);
391 if ((
result = currentArray->
Enter(localentry,
nullptr, subentry)))
404 Long64_t localentry = tree->LoadTree(entry);
457 bool new_line = !opt.
Contains(
"EOL");
459 if (!opt.
Contains(
"S") && new_line) {
468 std::cout <<
e->
fTreeName <<
":" << std::endl;
478 for (
Int_t i = 0; i < tmp->fN; ++i) {
480 std::cout << entry <<
" ";
484 if (
e &&
e->fEntry == entry) {
489 std::cout << std::endl;
508 Long64_t localentry = tree->LoadTree(entry);
511 if (currentArray && (
result = currentArray->
Remove(localentry,
nullptr, subentry))) {
521 if (currentArray && (
result = currentArray->
Remove(entry,
nullptr, subentry)) &&
fLists) {
530 if (subentry != -1) {
531 e->TEntryList::Remove(subentry);
533 if (subentry == -1 || !
e->GetN()) {
537 }
else if (subentry == -1) {
548 if (!
e)
return false;
575 Long64_t localentry = tree->LoadTree(entry);
607 if (entry < 0)
return nullptr;
611 Long64_t localentry = tree->LoadTree(entry);
615 return currentArray->
SetEntry(localentry);
682 for (
Int_t i = 0; i < n2; ++i) {
683 entry = (
const_cast<TEntryList*
>(elist))->GetEntry(i);
685 while (el1 && el1->
fEntry < entry) {
688 while (el2 && el2->
fEntry < entry) {
692 if (el1 && el2 && entry == el1->
fEntry && entry == el2->
fEntry) {
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
Collection abstract base class.
virtual Int_t GetEntries() const
A list of entries and subentries in a TTree or TChain.
virtual TEntryListArray * GetSubListForEntry(Long64_t entry, TTree *tree=nullptr)
Return the list holding the subentries for the given entry or 0.
virtual bool RemoveSubList(TEntryListArray *e, TTree *tree=nullptr)
Remove the given sublist and return true if succeeded.
~TEntryListArray() override
d-tor
void Print(const Option_t *option="") const override
Print this list.
void SetTree(const char *treename, const char *filename) override
If a list for a tree with such name and filename exists, sets it as the current sublist If not,...
void Reset() override
Reset all entries and remove all sublists.
void Init()
Initialize data members, called by Reset.
virtual TEntryListArray * SetEntry(Long64_t entry, TTree *tree=nullptr)
Create a sublist for the given entry and returns it --> should be called after calling GetSubListForE...
TEntryListArray * fLastSubListQueried
! last sublist checked by GetSubListForEntry
TList * fSubLists
a list of underlying entry lists for each event of a TEntryList
TEntryListArray()
Default c-tor.
virtual bool RemoveSubListForEntry(Long64_t entry, TTree *tree=nullptr)
Remove the sublists for the given entry --> not being used...
virtual void ConvertToTEntryListArray(TEntryList *e)
Create a TEntryListArray based on the given TEntryList Called by SetTree when the given list is added...
void Subtract(const TEntryList *elist) override
Remove all the entries (and subentries) of this entry list that are contained in elist.
Long64_t fEntry
the entry number, when the list is used for subentries
void Add(const TEntryList *elist) override
Add 2 entry lists.
virtual TList * GetSubLists() const
virtual Int_t Contains(Long64_t entry, TTree *tree, Long64_t subentry)
virtual void AddEntriesAndSubLists(const TEntryList *elist)
The method that really adds two entry lists with sublists If lists are split (fLists !...
virtual bool Enter(Long64_t entry, TTree *tree, Long64_t subentry)
Add entry #entry (, #subentry) to the list.
TIter * fSubListIter
! to iterate over fSubLists and keep last one checked
virtual bool Remove(Long64_t entry, TTree *tree, Long64_t subentry)
Remove entry #entry (, #subentry) from the list.
A List of entry numbers in a TTree or TChain.
virtual bool Enter(Long64_t entry, TTree *tree=nullptr)
Add entry #entry to the list.
TString fFileName
name of the file, where the tree is
virtual TList * GetLists() const
virtual Int_t Contains(Long64_t entry, TTree *tree=nullptr)
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,...
Long64_t fN
number of entries in the list
virtual void Reset()
Reset this list.
virtual const char * GetTreeName() const
TEntryList * fCurrent
! currently filled entry list
void Print(const Option_t *option="") const override
Print this list.
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,...
TString fTreeName
name of the tree
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
void Add(TObject *obj) override
TObject * Remove(TObject *obj) override
Remove object from the list.
void AddLast(TObject *obj) override
Add object at the end of the list.
TObject * Last() const override
Return the last object in the list. Returns 0 when list is empty.
TObject * First() const override
Return the first object in the list. Returns 0 when list is empty.
void AddBefore(const TObject *before, TObject *obj) override
Insert object before object before in the list.
void Delete(Option_t *option="") override
Remove all objects from the list AND delete all heap based objects.
void AddFirst(TObject *obj) override
Add object at the beginning of the list.
const char * Data() const
void ToUpper()
Change string to upper case.
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
A TTree represents a columnar dataset.