Logo ROOT  
Reference Guide
TEntryListArray.h
Go to the documentation of this file.
1// @(#)root/tree:$Id$
2// Author: Bruno Lenzi 12/07/2011
3
4/*************************************************************************
5 * Copyright (C) 1995-2006, Rene Brun and Fons Rademakers. *
6 * All rights reserved. *
7 * *
8 * For the licensing terms see $ROOTSYS/LICENSE. *
9 * For the list of contributors see $ROOTSYS/README/CREDITS. *
10 *************************************************************************/
11
12#ifndef ROOT_TEntryListArray
13#define ROOT_TEntryListArray
14
15#include "TEntryList.h"
16
17class TTree;
18class TDirectory;
19class TObjArray;
20class TString;
21
22class TList;
23class TCollection;
24class TIter;
25
27
28private:
29 TEntryListArray& operator=(const TEntryListArray&); // Not implemented
30
31protected:
32 TList *fSubLists; ///< a list of underlying entry lists for each event of a TEntryList
33 Long64_t fEntry; ///< the entry number, when the list is used for subentries
34 TEntryListArray *fLastSubListQueried; ///<! last sublist checked by GetSubListForEntry
35 TIter *fSubListIter; ///<! to iterate over fSubLists and keep last one checked
36
37 void Init();
38 virtual void AddEntriesAndSubLists(const TEntryList *elist);
40// virtual TList* GetSubLists() const {
41// return fSubLists;
42// };
44 virtual Bool_t RemoveSubListForEntry(Long64_t entry, TTree *tree = 0);
45 virtual TEntryListArray* SetEntry(Long64_t entry, TTree *tree = 0);
46
47
48public:
50 TEntryListArray(const char *name, const char *title);
51 TEntryListArray(const char *name, const char *title, const TTree *tree);
52 TEntryListArray(const char *name, const char *title, const char *treename, const char *filename);
54 TEntryListArray(const TEntryListArray& elist);
55 TEntryListArray(const TEntryList& elist); // to convert TEL to TELA
56 virtual ~TEntryListArray();
57
58 virtual void Add(const TEntryList *elist);
59 virtual Int_t Contains(Long64_t entry, TTree *tree, Long64_t subentry);
60 virtual Int_t Contains(Long64_t entry, TTree *tree = 0) {
61 return TEntryList::Contains(entry, tree);
62 };
63 virtual Bool_t Enter(Long64_t entry, TTree *tree, Long64_t subentry);
64 virtual Bool_t Enter(Long64_t entry, TTree *tree = 0) {
65 return Enter(entry, tree, -1);
66 };
67// virtual Bool_t Enter(Long64_t entry, TTree *tree, const TEntryList *e);
69 virtual void Print(const Option_t* option = "") const;
70 virtual Bool_t Remove(Long64_t entry, TTree *tree, Long64_t subentry);
71 virtual Bool_t Remove(Long64_t entry, TTree *tree = 0) {
72 return Remove(entry, tree, -1);
73 };
74 virtual void Reset();
75
76 virtual void SetTree(const char *treename, const char *filename);
77 virtual void SetTree(const TTree *tree) {
78 TEntryList::SetTree(tree); // will take treename and filename from the tree and call the method above
79 }
80 virtual void Subtract(const TEntryList *elist);
81 virtual TList* GetSubLists() const {
82 return fSubLists;
83 };
84
85 ClassDef(TEntryListArray, 1); //A list of entries and subentries in a TTree
86};
87#endif
88// @(#)root/tree:$Id$
89// Author: Bruno Lenzi 12/07/2011
90
91/*************************************************************************
92 * Copyright (C) 1995-2006, Rene Brun and Fons Rademakers. *
93 * All rights reserved. *
94 * *
95 * For the licensing terms see $ROOTSYS/LICENSE. *
96 * For the list of contributors see $ROOTSYS/README/CREDITS. *
97 *************************************************************************/
98
99#ifndef ROOT_TEntryListArray
100#define ROOT_TEntryListArray
101
102#include "TEntryList.h"
103
104class TTree;
105class TDirectory;
106class TObjArray;
107class TString;
108
109class TList;
110class TCollection;
111class TIter;
112
113class TEntryListArray : public TEntryList {
114
115private:
116 TEntryListArray& operator=(const TEntryListArray&); // Not implemented
117
118protected:
119 TList *fSubLists; //a list of underlying entry lists for each event of a TEntryList
120 Long64_t fEntry; // the entry number, when the list is used for subentries
121 TEntryListArray *fLastSubListQueried; //! last sublist checked by GetSubListForEntry
122 TIter *fSubListIter; //! to iterate over fSubLists and keep last one checked
123
124 void Init();
125 virtual void AddEntriesAndSubLists(const TEntryList *elist);
127// virtual TList* GetSubLists() const {
128// return fSubLists;
129// };
133
134
135public:
137 TEntryListArray(const char *name, const char *title);
138 TEntryListArray(const char *name, const char *title, const TTree *tree);
139 TEntryListArray(const char *name, const char *title, const char *treename, const char *filename);
142 TEntryListArray(const TEntryList& elist); // to convert TEL to TELA
144
145 virtual void Add(const TEntryList *elist);
146 virtual Int_t Contains(Long64_t entry, TTree *tree, Long64_t subentry);
147 virtual Int_t Contains(Long64_t entry, TTree *tree = 0) {
148 return TEntryList::Contains(entry, tree);
149 };
150 virtual Bool_t Enter(Long64_t entry, TTree *tree, Long64_t subentry);
151 virtual Bool_t Enter(Long64_t entry, TTree *tree = 0) {
152 return Enter(entry, tree, -1);
153 };
154// virtual Bool_t Enter(Long64_t entry, TTree *tree, const TEntryList *e);
156 virtual void Print(const Option_t* option = "") const;
157 virtual Bool_t Remove(Long64_t entry, TTree *tree, Long64_t subentry);
158 virtual Bool_t Remove(Long64_t entry, TTree *tree = 0) {
159 return Remove(entry, tree, -1);
160 };
161 virtual void Reset();
162
163 virtual void SetTree(const char *treename, const char *filename);
164 virtual void SetTree(const TTree *tree) {
165 TEntryList::SetTree(tree); // will take treename and filename from the tree and call the method above
166 }
167 virtual void Subtract(const TEntryList *elist);
168 virtual TList* GetSubLists() const {
169 return fSubLists;
170 };
171
172 ClassDef(TEntryListArray, 1); //A list of entries and subentries in a TTree
173};
174#endif
#define e(i)
Definition: RSha256.hxx:103
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
long long Long64_t
Definition: RtypesCore.h:69
const char Option_t
Definition: RtypesCore.h:62
#define ClassDef(name, id)
Definition: Rtypes.h:326
char name[80]
Definition: TGX11.cxx:109
Collection abstract base class.
Definition: TCollection.h:63
Describe directory structure in memory.
Definition: TDirectory.h:34
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 void Subtract(const TEntryList *elist)
Remove all the entries of this entry list, that are contained in elist.
TEntryListArray(const char *name, const char *title)
virtual void AddEntriesAndSubLists(const TEntryList *elist)
virtual ~TEntryListArray()
d-tor
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 void Reset()
Reset this list.
TEntryListArray(const char *name, const char *title, const char *treename, const char *filename)
virtual Int_t Contains(Long64_t entry, TTree *tree, Long64_t subentry)
virtual Bool_t Enter(Long64_t entry, TTree *tree, Long64_t subentry)
virtual void Reset()
Reset all entries and remove all sublists.
virtual Bool_t Remove(Long64_t entry, TTree *tree, Long64_t subentry)
virtual Bool_t Enter(Long64_t entry, TTree *tree=0)
Add entry #entry to 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,...
void Init()
Initialize data members, called by Reset.
TEntryListArray & operator=(const TEntryListArray &)
virtual TEntryListArray * SetEntry(Long64_t entry, TTree *tree=0)
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 ~TEntryListArray()
virtual void Add(const TEntryList *elist)
Add 2 entry lists.
virtual Int_t Contains(Long64_t entry, TTree *tree=0)
TEntryListArray(const TEntryListArray &elist)
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
TEntryListArray(const char *name, const char *title, const TTree *tree)
virtual Bool_t RemoveSubListForEntry(Long64_t entry, TTree *tree=0)
virtual void ConvertToTEntryListArray(TEntryList *e)
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 !...
TEntryListArray(const TEntryList &elist)
virtual Bool_t Remove(Long64_t entry, TTree *tree=0)
Remove entry #entry from the list.
TIter * fSubListIter
! to iterate over fSubLists and keep last one checked
TEntryListArray(const TTree *tree)
virtual void Print(const Option_t *option="") const
Print this list.
virtual Bool_t RemoveSubList(TEntryListArray *e, TTree *tree=0)
virtual void Add(const TEntryList *elist)
Add 2 entry lists.
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)
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.
Definition: TEntryList.h:26
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)
Definition: TEntryList.cxx:517
A doubly linked list.
Definition: TList.h:44
An array of TObjects.
Definition: TObjArray.h:37
Basic string class.
Definition: TString.h:131
A TTree represents a columnar dataset.
Definition: TTree.h:72
Definition: tree.py:1