Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/root/TEntryListArray.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 // @(#)root/tree:$Id$
0002 // Author: Bruno Lenzi 12/07/2011
0003 
0004 /*************************************************************************
0005  * Copyright (C) 1995-2006, Rene Brun and Fons Rademakers.               *
0006  * All rights reserved.                                                  *
0007  *                                                                       *
0008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
0009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
0010  *************************************************************************/
0011 
0012 #ifndef ROOT_TEntryListArray
0013 #define ROOT_TEntryListArray
0014 
0015 #include "TEntryList.h"
0016 
0017 class TTree;
0018 class TDirectory;
0019 class TObjArray;
0020 class TString;
0021 
0022 class TList;
0023 class TCollection;
0024 class TIter;
0025 
0026 class TEntryListArray : public TEntryList {
0027 
0028 private:
0029    TEntryListArray& operator=(const TEntryListArray&); // Not implemented
0030 
0031 protected:
0032    TList *fSubLists;                     ///<  a list of underlying entry lists for each event of a TEntryList
0033    Long64_t         fEntry;              ///<  the entry number, when the list is used for subentries
0034    TEntryListArray *fLastSubListQueried; ///<! last sublist checked by GetSubListForEntry
0035    TIter *fSubListIter;                  ///<! to iterate over fSubLists and keep last one checked
0036 
0037    void Init();
0038    virtual void AddEntriesAndSubLists(const TEntryList *elist);
0039    virtual void ConvertToTEntryListArray(TEntryList *e);
0040 //    virtual TList* GetSubLists() const {
0041 //       return fSubLists;
0042 //    };
0043    virtual bool        RemoveSubList(TEntryListArray *e, TTree *tree = nullptr);
0044    virtual bool        RemoveSubListForEntry(Long64_t entry, TTree *tree = nullptr);
0045    virtual TEntryListArray* SetEntry(Long64_t entry, TTree *tree = nullptr);
0046 
0047 
0048 public:
0049    TEntryListArray();
0050    TEntryListArray(const char *name, const char *title);
0051    TEntryListArray(const char *name, const char *title, const TTree *tree);
0052    TEntryListArray(const char *name, const char *title, const char *treename, const char *filename);
0053    TEntryListArray(const TTree *tree);
0054    TEntryListArray(const TEntryListArray& elist);
0055    TEntryListArray(const TEntryList& elist); // to convert TEL to TELA
0056    ~TEntryListArray() override;
0057 
0058    void                Add(const TEntryList *elist) override;
0059    virtual Int_t       Contains(Long64_t entry, TTree *tree, Long64_t subentry);
0060    Int_t       Contains(Long64_t entry, TTree *tree = nullptr) override {
0061       return TEntryList::Contains(entry, tree);
0062    };
0063    virtual bool        Enter(Long64_t entry, TTree *tree, Long64_t subentry);
0064    virtual bool        Enter(Long64_t entry, const char *treename, const char *filename, Long64_t subentry);
0065    bool                Enter(Long64_t entry, TTree *tree = nullptr) override {
0066       return Enter(entry, tree, -1);
0067    };
0068    bool                Enter(Long64_t entry, const char *treename, const char *filename) override
0069    {
0070       return Enter(entry, treename, filename, -1);
0071    };
0072 //    virtual bool        Enter(Long64_t entry, TTree *tree, const TEntryList *e);
0073    virtual TEntryListArray* GetSubListForEntry(Long64_t entry, TTree *tree = nullptr);
0074    void        Print(const Option_t* option = "") const override;
0075    virtual bool        Remove(Long64_t entry, TTree *tree, Long64_t subentry);
0076    bool        Remove(Long64_t entry, TTree *tree = nullptr) override {
0077       return Remove(entry, tree, -1);
0078    };
0079    void        Reset() override;
0080 
0081    void        SetTree(const char *treename, const char *filename) override;
0082    void        SetTree(const TTree *tree) override {
0083       TEntryList::SetTree(tree);   // will take treename and filename from the tree and call the method above
0084    }
0085    void        Subtract(const TEntryList *elist) override;
0086    virtual TList* GetSubLists() const {
0087       return fSubLists;
0088    };
0089 
0090    ClassDefOverride(TEntryListArray, 1);  //A list of entries and subentries in a TTree
0091 };
0092 #endif