113TEntryListArray::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)
172 SetTree(
e->GetTreeName(),
e->GetFileName());
201 e->AddEntriesAndSubLists(elist);
232 TIter next2(other_sublists);
236 el1->TEntryList::Add(el2);
239 }
else if (el1 && (!el2 || el1->
fEntry < el2->
fEntry)) {
277 return currentArray->
Contains(localentry,
nullptr, subentry);
286 result = t->TEntryList::Contains(subentry);
352 if ((result = currentArray->
Enter(localentry,
nullptr, subentry)))
360 if (currentArray && (result = currentArray->
Enter(entry,
nullptr, subentry))) {
369 if (subentry != -1) {
370 t->TEntryList::Enter(subentry);
376 if (subentry != -1 && result) {
378 if (t) t->TEntryList::Enter(subentry);
390 if ((result = currentArray->
Enter(localentry,
nullptr, subentry)))
456 bool new_line = !opt.
Contains(
"EOL");
458 if (!opt.
Contains(
"S") && new_line) {
467 std::cout <<
e->fTreeName <<
":" << std::endl;
477 for (
Int_t i = 0; i < tmp->
fN; ++i) {
479 std::cout << entry <<
" ";
483 if (
e &&
e->fEntry == entry) {
488 std::cout << std::endl;
510 if (currentArray && (result = currentArray->
Remove(localentry,
nullptr, subentry))) {
520 if (currentArray && (result = currentArray->
Remove(entry,
nullptr, subentry)) &&
fLists) {
529 if (subentry != -1) {
530 e->TEntryList::Remove(subentry);
532 if (subentry == -1 || !
e->GetN()) {
536 }
else if (subentry == -1) {
547 if (!
e)
return false;
606 if (entry < 0)
return nullptr;
614 return currentArray->
SetEntry(localentry);
681 for (
Int_t i = 0; i < n2; ++i) {
684 while (el1 && el1->
fEntry < entry) {
687 while (el2 && el2->
fEntry < entry) {
691 if (el1 && el2 && entry == el1->
fEntry && entry == el2->
fEntry) {
716 nLists =
fLists->GetEntries();
int Int_t
Signed integer 4 bytes (int).
long long Long64_t
Portable signed long integer 8 bytes.
const char Option_t
Option string (const char).
Collection abstract base class.
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.
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 Enter(Long64_t entry, TTree *tree=nullptr)
virtual bool Remove(Long64_t entry, TTree *tree=nullptr)
virtual Long64_t GetEntry(Long64_t index)
Long64_t fN
number of entries in the list
virtual void SetTree(const TTree *tree)
virtual void Subtract(const TEntryList *elist)
virtual const char * GetTreeName() const
virtual void Add(const TEntryList *elist)
TEntryList * fCurrent
! currently filled entry list
void Print(const Option_t *option="") const override
TList * fLists
a list of underlying entry lists for each tree of a chain
void GetFileName(const char *filename, TString &fn, bool *=nullptr)
TString fTreeName
name of the tree
virtual Long64_t GetN() const
void ToUpper()
Change string to upper case.
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
A TTree represents a columnar dataset.
virtual TTree * GetTree() const
virtual Long64_t LoadTree(Long64_t entry)
Set current entry.