Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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
27class TDirectory;
28class TCollection;
29
30
31class TEventList : public TNamed {
32
33protected:
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 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
41public:
42 TEventList();
43 TEventList(const char *name, const char *title="",Int_t initsize=0, Int_t delta = 0);
44 TEventList(const TEventList &list);
45 ~TEventList() override;
46 virtual void Add(const TEventList *list);
47 void Clear(Option_t *option="") override {Reset(option);}
48 virtual bool Contains(Long64_t entry);
49 virtual bool ContainsRange(Long64_t entrymin, Long64_t entrymax);
50 virtual void DirectoryAutoAdd(TDirectory *);
51 virtual void Enter(Long64_t entry);
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 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 void Print(Option_t *option="") const override;
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 void SetName(const char *name) override; // *MENU*
67 virtual void SetReapplyCut(bool apply = false) {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 ClassDefOverride(TEventList,4); //A list of selected entries in a TTree.
78};
79
80#endif
81
int Int_t
Definition RtypesCore.h:45
long long Long64_t
Definition RtypesCore.h:69
const char Option_t
Definition RtypesCore.h:66
#define ClassDefOverride(name, id)
Definition Rtypes.h:346
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 index
char name[80]
Definition TGX11.cxx:110
Collection abstract base class.
Definition TCollection.h:65
Describe directory structure in memory.
Definition TDirectory.h:45
<div class="legacybox"><h2>Legacy Code</h2> TEventList is a legacy interface: there will be no bug fi...
Definition TEventList.h:31
virtual void SetReapplyCut(bool apply=false)
Definition TEventList.h:67
Long64_t * fList
[fN]Array of elements
Definition TEventList.h:38
~TEventList() override
Default destructor for a EventList.
bool fReapply
If true, TTree::Draw will 'reapply' the original cut.
Definition TEventList.h:37
TEventList()
Default constructor for a EventList.
virtual void Reset(Option_t *option="")
Reset number of entries in event list.
virtual bool ContainsRange(Long64_t entrymin, Long64_t entrymax)
Return TRUE if list contains entries from entrymin to entrymax included.
friend TEventList operator-(const TEventList &list1, const TEventList &list2)
Subtraction.
TDirectory * fDirectory
! Pointer to directory holding this tree
Definition TEventList.h:39
virtual Long64_t GetEntry(Int_t index) const
Return value of entry at index in the list.
virtual bool GetReapplyCut() const
Definition TEventList.h:57
friend TEventList operator+(const TEventList &list1, const TEventList &list2)
Addition.
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...
virtual Int_t GetSize() const
Definition TEventList.h:58
void Clear(Option_t *option="") override
Definition TEventList.h:47
virtual Int_t GetN() const
Definition TEventList.h:56
TDirectory * GetDirectory() const
Definition TEventList.h:52
virtual Long64_t * GetList() const
Definition TEventList.h:55
virtual Int_t Merge(TCollection *list)
Merge entries in all the TEventList in the collection in this event list.
virtual void DirectoryAutoAdd(TDirectory *)
Called by TKey and others to automatically add us to a directory when we are read from a file.
virtual void Subtract(const TEventList *list)
Remove elements from this list that are present in alist.
void Print(Option_t *option="") const override
Print contents of this list.
virtual void SetDirectory(TDirectory *dir)
Remove reference to this EventList from current directory and add reference to new directory dir.
virtual void Add(const TEventList *list)
Merge contents of alist with this list.
Int_t fN
Number of elements in the list.
Definition TEventList.h:34
virtual void SetDelta(Int_t delta=100)
Definition TEventList.h:64
virtual void Resize(Int_t delta=0)
Resize list by delta entries.
virtual void Enter(Long64_t entry)
Enter element entry into the list.
Int_t fSize
Size of array.
Definition TEventList.h:35
virtual void Sort()
Sort list entries in increasing order.
friend TEventList operator*(const TEventList &list1, const TEventList &list2)
Intersection.
virtual bool Contains(Long64_t entry)
Return TRUE if list contains entry.
TEventList & operator=(const TEventList &list)
Assingment.
virtual void Intersect(const TEventList *list)
Remove elements from this list that are NOT present in alist.
Int_t fDelta
Increment size.
Definition TEventList.h:36
void SetName(const char *name) override
Change the name of this TEventList.
The TNamed class is the base class for all named ROOT classes.
Definition TNamed.h:29