Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
TEventList.h
Go to the documentation of this file.
1 // @(#)root/tree:$Id$
2 // Author: Rene Brun 11/02/97
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2000, 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_TEventList
13 #define ROOT_TEventList
14 
15 
16 //////////////////////////////////////////////////////////////////////////
17 // //
18 // TEventList //
19 // //
20 // A list of selected entries in a TTree. //
21 // //
22 //////////////////////////////////////////////////////////////////////////
23 
24 
25 #include "TNamed.h"
26 
27 class TDirectory;
28 class TCollection;
29 
30 
31 class TEventList : public TNamed {
32 
33 protected:
34  Int_t fN; ///< Number of elements in the list
35  Int_t fSize; ///< Size of array
36  Int_t fDelta; ///< Increment size
37  Bool_t fReapply; ///< If true, TTree::Draw will 'reapply' the original cut
38  Long64_t *fList; ///<[fN]Array of elements
39  TDirectory *fDirectory; ///<! Pointer to directory holding this tree
40 
41 public:
42  TEventList();
43  TEventList(const char *name, const char *title="",Int_t initsize=0, Int_t delta = 0);
44  TEventList(const TEventList &list);
45  virtual ~TEventList();
46  virtual void Add(const TEventList *list);
47  virtual void Clear(Option_t *option="") {Reset(option);}
48  virtual Bool_t Contains(Long64_t entry);
49  virtual Bool_t ContainsRange(Long64_t entrymin, Long64_t entrymax);
50  virtual void DirectoryAutoAdd(TDirectory *);
51  virtual void Enter(Long64_t entry);
52  TDirectory *GetDirectory() const {return fDirectory;}
53  virtual Long64_t GetEntry(Int_t index) const;
54  virtual Int_t GetIndex(Long64_t entry) const;
55  virtual Long64_t *GetList() const { return fList; }
56  virtual Int_t GetN() const { return fN; }
57  virtual Bool_t GetReapplyCut() const { return fReapply; };
58  virtual Int_t GetSize() const { return fSize; }
59  virtual void Intersect(const TEventList *list);
60  virtual Int_t Merge(TCollection *list);
61  virtual void Print(Option_t *option="") const;
62  virtual void Reset(Option_t *option="");
63  virtual void Resize(Int_t delta=0);
64  virtual void SetDelta(Int_t delta=100) {fDelta = delta;}
65  virtual void SetDirectory(TDirectory *dir);
66  virtual void SetName(const char *name); // *MENU*
67  virtual void SetReapplyCut(Bool_t apply = kFALSE) {fReapply = apply;}; // *TOGGLE*
68  virtual void Sort();
69  virtual void Subtract(const TEventList *list);
70 
71  TEventList& operator=(const TEventList &list);
72 
73  friend TEventList operator+(const TEventList &list1, const TEventList &list2);
74  friend TEventList operator-(const TEventList &list1, const TEventList &list2);
75  friend TEventList operator*(const TEventList &list1, const TEventList &list2);
76 
77  ClassDef(TEventList,4); //A list of selected entries in a TTree.
78 };
79 
80 #endif
81