115TEntryListArray::TEntryListArray(
const char *
name,
const char *title,
const char *treename,
const char *filename):
TEntryList(
name, title, treename, filename), fSubLists(0), fEntry(-1), fLastSubListQueried(0), fSubListIter(0)
174 SetTree(
e->GetTreeName(),
e->GetFileName());
203 e->AddEntriesAndSubLists(elist);
234 TIter next2(other_sublists);
238 el1->TEntryList::Add(el2);
241 }
else if (el1 && (!el2 || el1->
fEntry < el2->
fEntry)) {
279 return currentArray->
Contains(localentry, 0, subentry);
288 result = t->TEntryList::Contains(subentry);
354 if ((result = currentArray->
Enter(localentry, 0, subentry)))
362 if (currentArray && (result = currentArray->
Enter(entry, 0, subentry))) {
371 if (subentry != -1) {
372 t->TEntryList::Enter(subentry);
378 if (subentry != -1 && result) {
380 if (t) t->TEntryList::Enter(subentry);
447 if (!opt.
Contains(
"S") && new_line) {
456 std::cout <<
e->fTreeName <<
":" << std::endl;
466 for (
Int_t i = 0; i < tmp->
fN; ++i) {
468 std::cout << entry <<
" ";
472 if (
e &&
e->fEntry == entry) {
477 std::cout << std::endl;
499 if (currentArray && (result = currentArray->
Remove(localentry, 0, subentry))) {
509 if (currentArray && (result = currentArray->
Remove(entry, 0, subentry)) &&
fLists) {
518 if (subentry != -1) {
519 e->TEntryList::Remove(subentry);
521 if (subentry == -1 || !
e->GetN()) {
525 }
else if (subentry == -1) {
596 if (entry < 0)
return 0;
604 return currentArray->
SetEntry(localentry);
671 for (
Int_t i = 0; i < n2; ++i) {
672 entry = (
const_cast<TEntryList*
>(elist))->GetEntry(i);
674 while (el1 && el1->
fEntry < entry) {
677 while (el2 && el2->
fEntry < entry) {
681 if (el1 && el2 && entry == el1->
fEntry && entry == el2->
fEntry) {
Collection abstract base class.
virtual Int_t GetEntries() const
A list of entries and subentries in a TTree or TChain.
virtual Bool_t RemoveSubListForEntry(Long64_t entry, TTree *tree=0)
Remove the sublists for the given entry --> not being used...
virtual ~TEntryListArray()
d-tor
virtual void Reset()
Reset all entries and remove all sublists.
void Init()
Initialize data members, called by Reset.
virtual Bool_t Remove(Long64_t entry, TTree *tree, Long64_t subentry)
Remove entry #entry (, #subentry) from the list.
virtual void SetTree(const char *treename, const char *filename)
If a list for a tree with such name and filename exists, sets it as the current sublist If not,...
TEntryListArray * fLastSubListQueried
! last sublist checked by GetSubListForEntry
virtual TEntryListArray * SetEntry(Long64_t entry, TTree *tree=0)
Create a sublist for the given entry and returns it --> should be called after calling GetSubListForE...
virtual Bool_t RemoveSubList(TEntryListArray *e, TTree *tree=0)
Remove the given sublist and return true if succeeded.
TEntryListArray()
Default c-tor.
virtual void Add(const TEntryList *elist)
Add 2 entry lists.
virtual void ConvertToTEntryListArray(TEntryList *e)
Create a TEntryListArray based on the given TEntryList Called by SetTree when the given list is added...
virtual void Print(const Option_t *option="") const
Print this list.
Long64_t fEntry
the entry number, when the list is used for subentries
virtual TList * GetSubLists() const
virtual Int_t Contains(Long64_t entry, TTree *tree, Long64_t subentry)
virtual Bool_t Enter(Long64_t entry, TTree *tree, Long64_t subentry)
Add entry #entry (, #subentry) to the list.
TList * fSubLists
a list of underlying entry lists for each event of a TEntryList
virtual void AddEntriesAndSubLists(const TEntryList *elist)
The method that really adds two entry lists with sublists If lists are splitted (fLists !...
TIter * fSubListIter
! to iterate over fSubLists and keep last one checked
virtual void Subtract(const TEntryList *elist)
Remove all the entries (and subentries) of this entry list that are contained in elist.
virtual TEntryListArray * GetSubListForEntry(Long64_t entry, TTree *tree=0)
Return the list holding the subentries for the given entry or 0.
A List of entry numbers in a TTree or TChain.
TString fFileName
name of the file, where the tree is
virtual TList * GetLists() const
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,...
virtual Int_t Contains(Long64_t entry, TTree *tree=0)
Long64_t fN
number of entries in the list
virtual void Reset()
Reset this list.
virtual Bool_t Enter(Long64_t entry, TTree *tree=0)
Add entry #entry to the list.
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 const char * GetTreeName() const
TEntryList * fCurrent
! currently filled entry list
virtual void Print(const Option_t *option="") const
Print this list.
virtual Bool_t Remove(Long64_t entry, TTree *tree=0)
Remove entry #entry from the list.
TList * fLists
a list of underlying entry lists for each tree of a chain
TString fTreeName
name of the tree
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 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
virtual void Add(TObject *obj)
virtual TObject * Remove(TObject *obj)
Remove object from the list.
virtual void AddFirst(TObject *obj)
Add object at the beginning of the list.
virtual TObject * Last() const
Return the last object in the list. Returns 0 when list is empty.
virtual void AddBefore(const TObject *before, TObject *obj)
Insert object before object before in the list.
virtual void Delete(Option_t *option="")
Remove all objects from the list AND delete all heap based objects.
virtual TObject * First() const
Return the first object in the list. Returns 0 when list is empty.
virtual void AddLast(TObject *obj)
Add object at the end 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.