ROOT  6.07/01
Reference Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups 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 #ifndef ROOT_TNamed
26 #include "TNamed.h"
27 #endif
28 
29 class TDirectory;
30 class TCollection;
31 
32 
33 class TEventList : public TNamed {
34 
35 protected:
36  Int_t fN; // Number of elements in the list
37  Int_t fSize; // Size of array
38  Int_t fDelta; // Increment size
39  Bool_t fReapply; // If true, TTree::Draw will 'reapply' the original cut
40  Long64_t *fList; //[fN]Array of elements
41  TDirectory *fDirectory; //! Pointer to directory holding this tree
42 
43 public:
44  TEventList();
45  TEventList(const char *name, const char *title="",Int_t initsize=0, Int_t delta = 0);
46  TEventList(const TEventList &list);
47  virtual ~TEventList();
48  virtual void Add(const TEventList *list);
49  virtual void Clear(Option_t *option="") {Reset(option);}
50  virtual Bool_t Contains(Long64_t entry);
51  virtual Bool_t ContainsRange(Long64_t entrymin, Long64_t entrymax);
52  virtual void DirectoryAutoAdd(TDirectory *);
53  virtual void Enter(Long64_t entry);
54  TDirectory *GetDirectory() const {return fDirectory;}
55  virtual Long64_t GetEntry(Int_t index) const;
56  virtual Int_t GetIndex(Long64_t entry) const;
57  virtual Long64_t *GetList() const { return fList; }
58  virtual Int_t GetN() const { return fN; }
59  virtual Bool_t GetReapplyCut() const { return fReapply; };
60  virtual Int_t GetSize() const { return fSize; }
61  virtual void Intersect(const TEventList *list);
62  virtual Int_t Merge(TCollection *list);
63  virtual void Print(Option_t *option="") const;
64  virtual void Reset(Option_t *option="");
65  virtual void Resize(Int_t delta=0);
66  virtual void SetDelta(Int_t delta=100) {fDelta = delta;}
67  virtual void SetDirectory(TDirectory *dir);
68  virtual void SetName(const char *name); // *MENU*
69  virtual void SetReapplyCut(Bool_t apply = kFALSE) {fReapply = apply;}; // *TOGGLE*
70  virtual void Sort();
71  virtual void Subtract(const TEventList *list);
72 
73  TEventList& operator=(const TEventList &list);
74 
75  friend TEventList operator+(const TEventList &list1, const TEventList &list2);
76  friend TEventList operator-(const TEventList &list1, const TEventList &list2);
77  friend TEventList operator*(const TEventList &list1, const TEventList &list2);
78 
79  ClassDef(TEventList,4); //A list of selected entries in a TTree.
80 };
81 
82 #endif
83 
virtual void Enter(Long64_t entry)
Enter element entry into the list.
Definition: TEventList.cxx:189
virtual Bool_t GetReapplyCut() const
Definition: TEventList.h:59
friend TEventList operator*(const TEventList &list1, const TEventList &list2)
Intersection.
Definition: TEventList.cxx:495
virtual Bool_t Contains(Long64_t entry)
Return TRUE if list contains entry.
Definition: TEventList.cxx:160
virtual void SetDelta(Int_t delta=100)
Definition: TEventList.h:66
long long Long64_t
Definition: RtypesCore.h:69
const char Option_t
Definition: RtypesCore.h:62
virtual void Print(Option_t *option="") const
Print contents of this list.
Definition: TEventList.cxx:300
virtual void Clear(Option_t *option="")
Set name and title to empty strings ("").
Definition: TEventList.h:49
virtual void Intersect(const TEventList *list)
Remove elements from this list that are NOT present in alist.
Definition: TEventList.cxx:250
friend TEventList operator-(const TEventList &list1, const TEventList &list2)
Substraction.
Definition: TEventList.cxx:485
TDirectory * fDirectory
Definition: TEventList.h:41
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
Int_t fDelta
Definition: TEventList.h:38
virtual void DirectoryAutoAdd(TDirectory *)
Called by TKey and others to automatically add us to a directory when we are read from a file...
Definition: TEventList.cxx:181
const Bool_t kFALSE
Definition: Rtypes.h:92
TEventList & operator=(const TEventList &list)
Assingment.
Definition: TEventList.cxx:455
TDirectory * GetDirectory() const
Definition: TEventList.h:54
virtual void Sort()
Sort list entries in increasing order.
Definition: TEventList.cxx:372
Int_t fSize
Definition: TEventList.h:37
virtual void Resize(Int_t delta=0)
Resize list by delta entries.
Definition: TEventList.cxx:334
virtual Int_t GetN() const
Definition: TEventList.h:58
virtual void SetReapplyCut(Bool_t apply=kFALSE)
Definition: TEventList.h:69
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:33
virtual Bool_t ContainsRange(Long64_t entrymin, Long64_t entrymax)
Return TRUE if list contains entries from entrymin to entrymax included.
Definition: TEventList.cxx:169
TEventList()
Pointer to directory holding this tree.
virtual void SetDirectory(TDirectory *dir)
Remove reference to this EventList from current directory and add reference to new directory dir...
Definition: TEventList.cxx:349
virtual Long64_t GetEntry(Int_t index) const
Return value of entry at index in the list.
Definition: TEventList.cxx:220
TPaveLabel title(3, 27.1, 15, 28.7,"ROOT Environment and Tools")
Int_t fN
Definition: TEventList.h:36
Collection abstract base class.
Definition: TCollection.h:48
A TEventList object is a list of selected events (entries) in a TTree.
Definition: TEventList.h:33
virtual ~TEventList()
Default destructor for a EventList.
Definition: TEventList.cxx:102
Long64_t entry
virtual Int_t GetSize() const
Definition: TEventList.h:60
friend TEventList operator+(const TEventList &list1, const TEventList &list2)
Addition.
Definition: TEventList.cxx:475
virtual Int_t Merge(TCollection *list)
Merge entries in all the TEventList in the collection in this event list.
Definition: TEventList.cxx:277
Describe directory structure in memory.
Definition: TDirectory.h:44
void dir(char *path=0)
Definition: rootalias.C:30
virtual void SetName(const char *name)
Change the name of this TEventList.
Definition: TEventList.cxx:360
#define name(a, b)
Definition: linkTestLib0.cpp:5
virtual void Add(const TEventList *list)
Merge contents of alist with this list.
Definition: TEventList.cxx:114
virtual Int_t GetIndex(Long64_t entry) const
Return index in the list of element with value entry array is supposed to be sorted prior to this cal...
Definition: TEventList.cxx:233
Bool_t fReapply
Definition: TEventList.h:39
virtual Long64_t * GetList() const
Definition: TEventList.h:57
virtual void Subtract(const TEventList *list)
Remove elements from this list that are present in alist.
Definition: TEventList.cxx:428
ClassDef(TEventList, 4)
Long64_t * fList
Definition: TEventList.h:40
virtual void Reset(Option_t *option="")
Reset number of entries in event list.
Definition: TEventList.cxx:326