Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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// };
43 virtual Bool_t RemoveSubList(TEntryListArray *e, TTree *tree = nullptr);
44 virtual Bool_t RemoveSubListForEntry(Long64_t entry, TTree *tree = nullptr);
45 virtual TEntryListArray* SetEntry(Long64_t entry, TTree *tree = nullptr);
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 = nullptr) {
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, const char *treename, const char *filename, Long64_t subentry);
65 virtual Bool_t Enter(Long64_t entry, TTree *tree = nullptr) {
66 return Enter(entry, tree, -1);
67 };
68 virtual Bool_t Enter(Long64_t entry, const char *treename, const char *filename)
69 {
70 return Enter(entry, treename, filename, -1);
71 };
72// virtual Bool_t Enter(Long64_t entry, TTree *tree, const TEntryList *e);
73 virtual TEntryListArray* GetSubListForEntry(Long64_t entry, TTree *tree = nullptr);
74 virtual void Print(const Option_t* option = "") const;
75 virtual Bool_t Remove(Long64_t entry, TTree *tree, Long64_t subentry);
76 virtual Bool_t Remove(Long64_t entry, TTree *tree = nullptr) {
77 return Remove(entry, tree, -1);
78 };
79 virtual void Reset();
80
81 virtual void SetTree(const char *treename, const char *filename);
82 virtual void SetTree(const TTree *tree) {
83 TEntryList::SetTree(tree); // will take treename and filename from the tree and call the method above
84 }
85 virtual void Subtract(const TEntryList *elist);
86 virtual TList* GetSubLists() const {
87 return fSubLists;
88 };
89
90 ClassDef(TEntryListArray, 1); //A list of entries and subentries in a TTree
91};
92#endif
#define e(i)
Definition RSha256.hxx:103
bool Bool_t
Definition RtypesCore.h:63
long long Long64_t
Definition RtypesCore.h:80
const char Option_t
Definition RtypesCore.h:66
#define ClassDef(name, id)
Definition Rtypes.h:337
Option_t Option_t option
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
char name[80]
Definition TGX11.cxx:110
Collection abstract base class.
Definition TCollection.h:65
Describe directory structure in memory.
Definition TDirectory.h:45
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_t Remove(Long64_t entry, TTree *tree=nullptr)
Remove entry #entry from the list.
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 Bool_t Enter(Long64_t entry, TTree *tree=nullptr)
Add entry #entry to the list.
virtual Bool_t RemoveSubListForEntry(Long64_t entry, TTree *tree=nullptr)
Remove the sublists for the given entry --> not being used...
virtual Int_t Contains(Long64_t entry, TTree *tree=nullptr)
virtual void Reset()
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
TEntryListArray & operator=(const TEntryListArray &)
virtual Bool_t Remove(Long64_t entry, TTree *tree, Long64_t subentry)
Remove entry #entry (, #subentry) from the list.
TList * fSubLists
a list of underlying entry lists for each event of a TEntryList
virtual Bool_t Enter(Long64_t entry, const char *treename, const char *filename)
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()
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 Bool_t RemoveSubList(TEntryListArray *e, TTree *tree=nullptr)
Remove the given sublist and return true if succeeded.
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.
virtual void AddEntriesAndSubLists(const TEntryList *elist)
The method that really adds two entry lists with sublists If lists are split (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.
A List of entry numbers in a TTree or TChain.
Definition TEntryList.h:26
virtual Int_t Contains(Long64_t entry, TTree *tree=nullptr)
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,...
A doubly linked list.
Definition TList.h:38
An array of TObjects.
Definition TObjArray.h:31
Basic string class.
Definition TString.h:139
A TTree represents a columnar dataset.
Definition TTree.h:79
Definition tree.py:1