// @(#)root/tree:$Id$
// Author: Bruno Lenzi 12/07/2011

/*************************************************************************
 * Copyright (C) 1995-2006, Rene Brun and Fons Rademakers.               *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/

#ifndef ROOT_TEntryListArray
#define ROOT_TEntryListArray

#ifndef ROOT_TEntryList
#include "TEntryList.h"
#endif

class TTree;
class TDirectory;
class TObjArray;
class TString;

class TList;
class TCollection;
class TIter;

class TEntryListArray : public TEntryList {

private:
   TEntryListArray& operator=(const TEntryListArray&); // Not implemented

protected:
   TList *fSubLists; //a list of underlying entry lists for each event of a TEntryList
   Long64_t         fEntry; // the entry number, when the list is used for subentries
   TEntryListArray *fLastSubListQueried; //! last sublist checked by GetSubListForEntry
   TIter *fSubListIter; //! to iterate over fSubLists and keep last one checked

   void Init();
   virtual void AddEntriesAndSubLists(const TEntryList *elist);
   virtual void ConvertToTEntryListArray(TEntryList *e);
//    virtual TList* GetSubLists() const {
//       return fSubLists;
//    };
   virtual Bool_t      RemoveSubList(TEntryListArray *e, TTree *tree = 0);
   virtual Bool_t      RemoveSubListForEntry(Long64_t entry, TTree *tree = 0);
   virtual TEntryListArray* SetEntry(Long64_t entry, TTree *tree = 0);


public:
   TEntryListArray();
   TEntryListArray(const char *name, const char *title);
   TEntryListArray(const char *name, const char *title, const TTree *tree);
   TEntryListArray(const char *name, const char *title, const char *treename, const char *filename);
   TEntryListArray(const TTree *tree);
   TEntryListArray(const TEntryListArray& elist);
   TEntryListArray(const TEntryList& elist); // to convert TEL to TELA
   virtual ~TEntryListArray();

   virtual void        Add(const TEntryList *elist);
   virtual Int_t       Contains(Long64_t entry, TTree *tree, Long64_t subentry);
   virtual Int_t       Contains(Long64_t entry, TTree *tree = 0) {
      return TEntryList::Contains(entry, tree);
   };
   virtual Bool_t      Enter(Long64_t entry, TTree *tree, Long64_t subentry);
   virtual Bool_t      Enter(Long64_t entry, TTree *tree = 0) {
      return Enter(entry, tree, -1);
   };
//    virtual Bool_t      Enter(Long64_t entry, TTree *tree, const TEntryList *e);
   virtual TEntryListArray* GetSubListForEntry(Long64_t entry, TTree *tree = 0);
   virtual void        Print(const Option_t* option = "") const;
   virtual Bool_t      Remove(Long64_t entry, TTree *tree, Long64_t subentry);
   virtual Bool_t      Remove(Long64_t entry, TTree *tree = 0) {
      return Remove(entry, tree, -1);
   };
   virtual void        Reset();

   virtual void        SetTree(const char *treename, const char *filename);
   virtual void        SetTree(const TTree *tree) {
      TEntryList::SetTree(tree);   // will take treename and filename from the tree and call the method above
   }
   virtual void        Subtract(const TEntryList *elist);
   virtual TList* GetSubLists() const {
      return fSubLists;
   };

   ClassDef(TEntryListArray, 1);  //A list of entries and subentries in a TTree
};
#endif
// @(#)root/tree:$Id$
// Author: Bruno Lenzi 12/07/2011

/*************************************************************************
 * Copyright (C) 1995-2006, Rene Brun and Fons Rademakers.               *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/

#ifndef ROOT_TEntryListArray
#define ROOT_TEntryListArray

#ifndef ROOT_TEntryList
#include "TEntryList.h"
#endif

class TTree;
class TDirectory;
class TObjArray;
class TString;

class TList;
class TCollection;
class TIter;

class TEntryListArray : public TEntryList {

private:
   TEntryListArray& operator=(const TEntryListArray&); // Not implemented

protected:
   TList *fSubLists; //a list of underlying entry lists for each event of a TEntryList
   Long64_t         fEntry; // the entry number, when the list is used for subentries
   TEntryListArray *fLastSubListQueried; //! last sublist checked by GetSubListForEntry
   TIter *fSubListIter; //! to iterate over fSubLists and keep last one checked

   void Init();
   virtual void AddEntriesAndSubLists(const TEntryList *elist);
   virtual void ConvertToTEntryListArray(TEntryList *e);
//    virtual TList* GetSubLists() const {
//       return fSubLists;
//    };
   virtual Bool_t      RemoveSubList(TEntryListArray *e, TTree *tree = 0);
   virtual Bool_t      RemoveSubListForEntry(Long64_t entry, TTree *tree = 0);
   virtual TEntryListArray* SetEntry(Long64_t entry, TTree *tree = 0);


public:
   TEntryListArray();
   TEntryListArray(const char *name, const char *title);
   TEntryListArray(const char *name, const char *title, const TTree *tree);
   TEntryListArray(const char *name, const char *title, const char *treename, const char *filename);
   TEntryListArray(const TTree *tree);
   TEntryListArray(const TEntryListArray& elist);
   TEntryListArray(const TEntryList& elist); // to convert TEL to TELA
   virtual ~TEntryListArray();

   virtual void        Add(const TEntryList *elist);
   virtual Int_t       Contains(Long64_t entry, TTree *tree, Long64_t subentry);
   virtual Int_t       Contains(Long64_t entry, TTree *tree = 0) {
      return TEntryList::Contains(entry, tree);
   };
   virtual Bool_t      Enter(Long64_t entry, TTree *tree, Long64_t subentry);
   virtual Bool_t      Enter(Long64_t entry, TTree *tree = 0) {
      return Enter(entry, tree, -1);
   };
//    virtual Bool_t      Enter(Long64_t entry, TTree *tree, const TEntryList *e);
   virtual TEntryListArray* GetSubListForEntry(Long64_t entry, TTree *tree = 0);
   virtual void        Print(const Option_t* option = "") const;
   virtual Bool_t      Remove(Long64_t entry, TTree *tree, Long64_t subentry);
   virtual Bool_t      Remove(Long64_t entry, TTree *tree = 0) {
      return Remove(entry, tree, -1);
   };
   virtual void        Reset();

   virtual void        SetTree(const char *treename, const char *filename);
   virtual void        SetTree(const TTree *tree) {
      TEntryList::SetTree(tree);   // will take treename and filename from the tree and call the method above
   }
   virtual void        Subtract(const TEntryList *elist);
   virtual TList* GetSubLists() const {
      return fSubLists;
   };

   ClassDef(TEntryListArray, 1);  //A list of entries and subentries in a TTree
};
#endif
 TEntryListArray.h:1
 TEntryListArray.h:2
 TEntryListArray.h:3
 TEntryListArray.h:4
 TEntryListArray.h:5
 TEntryListArray.h:6
 TEntryListArray.h:7
 TEntryListArray.h:8
 TEntryListArray.h:9
 TEntryListArray.h:10
 TEntryListArray.h:11
 TEntryListArray.h:12
 TEntryListArray.h:13
 TEntryListArray.h:14
 TEntryListArray.h:15
 TEntryListArray.h:16
 TEntryListArray.h:17
 TEntryListArray.h:18
 TEntryListArray.h:19
 TEntryListArray.h:20
 TEntryListArray.h:21
 TEntryListArray.h:22
 TEntryListArray.h:23
 TEntryListArray.h:24
 TEntryListArray.h:25
 TEntryListArray.h:26
 TEntryListArray.h:27
 TEntryListArray.h:28
 TEntryListArray.h:29
 TEntryListArray.h:30
 TEntryListArray.h:31
 TEntryListArray.h:32
 TEntryListArray.h:33
 TEntryListArray.h:34
 TEntryListArray.h:35
 TEntryListArray.h:36
 TEntryListArray.h:37
 TEntryListArray.h:38
 TEntryListArray.h:39
 TEntryListArray.h:40
 TEntryListArray.h:41
 TEntryListArray.h:42
 TEntryListArray.h:43
 TEntryListArray.h:44
 TEntryListArray.h:45
 TEntryListArray.h:46
 TEntryListArray.h:47
 TEntryListArray.h:48
 TEntryListArray.h:49
 TEntryListArray.h:50
 TEntryListArray.h:51
 TEntryListArray.h:52
 TEntryListArray.h:53
 TEntryListArray.h:54
 TEntryListArray.h:55
 TEntryListArray.h:56
 TEntryListArray.h:57
 TEntryListArray.h:58
 TEntryListArray.h:59
 TEntryListArray.h:60
 TEntryListArray.h:61
 TEntryListArray.h:62
 TEntryListArray.h:63
 TEntryListArray.h:64
 TEntryListArray.h:65
 TEntryListArray.h:66
 TEntryListArray.h:67
 TEntryListArray.h:68
 TEntryListArray.h:69
 TEntryListArray.h:70
 TEntryListArray.h:71
 TEntryListArray.h:72
 TEntryListArray.h:73
 TEntryListArray.h:74
 TEntryListArray.h:75
 TEntryListArray.h:76
 TEntryListArray.h:77
 TEntryListArray.h:78
 TEntryListArray.h:79
 TEntryListArray.h:80
 TEntryListArray.h:81
 TEntryListArray.h:82
 TEntryListArray.h:83
 TEntryListArray.h:84
 TEntryListArray.h:85
 TEntryListArray.h:86
 TEntryListArray.h:87
 TEntryListArray.h:88
 TEntryListArray.h:89
 TEntryListArray.h:90
 TEntryListArray.h:91
 TEntryListArray.h:92
 TEntryListArray.h:93
 TEntryListArray.h:94
 TEntryListArray.h:95
 TEntryListArray.h:96
 TEntryListArray.h:97
 TEntryListArray.h:98
 TEntryListArray.h:99
 TEntryListArray.h:100
 TEntryListArray.h:101
 TEntryListArray.h:102
 TEntryListArray.h:103
 TEntryListArray.h:104
 TEntryListArray.h:105
 TEntryListArray.h:106
 TEntryListArray.h:107
 TEntryListArray.h:108
 TEntryListArray.h:109
 TEntryListArray.h:110
 TEntryListArray.h:111
 TEntryListArray.h:112
 TEntryListArray.h:113
 TEntryListArray.h:114
 TEntryListArray.h:115
 TEntryListArray.h:116
 TEntryListArray.h:117
 TEntryListArray.h:118
 TEntryListArray.h:119
 TEntryListArray.h:120
 TEntryListArray.h:121
 TEntryListArray.h:122
 TEntryListArray.h:123
 TEntryListArray.h:124
 TEntryListArray.h:125
 TEntryListArray.h:126
 TEntryListArray.h:127
 TEntryListArray.h:128
 TEntryListArray.h:129
 TEntryListArray.h:130
 TEntryListArray.h:131
 TEntryListArray.h:132
 TEntryListArray.h:133
 TEntryListArray.h:134
 TEntryListArray.h:135
 TEntryListArray.h:136
 TEntryListArray.h:137
 TEntryListArray.h:138
 TEntryListArray.h:139
 TEntryListArray.h:140
 TEntryListArray.h:141
 TEntryListArray.h:142
 TEntryListArray.h:143
 TEntryListArray.h:144
 TEntryListArray.h:145
 TEntryListArray.h:146
 TEntryListArray.h:147
 TEntryListArray.h:148
 TEntryListArray.h:149
 TEntryListArray.h:150
 TEntryListArray.h:151
 TEntryListArray.h:152
 TEntryListArray.h:153
 TEntryListArray.h:154
 TEntryListArray.h:155
 TEntryListArray.h:156
 TEntryListArray.h:157
 TEntryListArray.h:158
 TEntryListArray.h:159
 TEntryListArray.h:160
 TEntryListArray.h:161
 TEntryListArray.h:162
 TEntryListArray.h:163
 TEntryListArray.h:164
 TEntryListArray.h:165
 TEntryListArray.h:166
 TEntryListArray.h:167
 TEntryListArray.h:168
 TEntryListArray.h:169
 TEntryListArray.h:170
 TEntryListArray.h:171
 TEntryListArray.h:172
 TEntryListArray.h:173
 TEntryListArray.h:174
 TEntryListArray.h:175
 TEntryListArray.h:176
 TEntryListArray.h:177
 TEntryListArray.h:178