ROOT  6.06/09
Reference Guide
TSelector.h
Go to the documentation of this file.
1 // @(#)root/tree:$Id$
2 // Author: Rene Brun 05/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_TSelector
13 #define ROOT_TSelector
14 
15 
16 //////////////////////////////////////////////////////////////////////////
17 // //
18 // TSelector //
19 // //
20 // A utility class for Trees selections. //
21 // //
22 //////////////////////////////////////////////////////////////////////////
23 
24 
25 #ifndef ROOT_TObject
26 #include "TObject.h"
27 #endif
28 #ifndef ROOT_TString
29 #include "TString.h"
30 #endif
31 #ifndef ROOT_TSelectorList
32 #include "TSelectorList.h"
33 #endif
34 
35 
36 class TTree;
37 
38 
39 class TSelector : public TObject {
40 
41 public:
43 
44 protected:
45  Long64_t fStatus; // Selector status
46  EAbort fAbort; // Abort status
47  TString fOption; // Option given to TTree::Process
48  TObject *fObject; //!Current object if processing object (vs. TTree)
49  TList *fInput; // List of objects available during processing
50  TSelectorList *fOutput; //!List of objects created during processing
51 
52 private:
53  TSelector(const TSelector&); // not implemented
54  TSelector& operator=(const TSelector&); // not implemented
55 
56 public:
57  TSelector();
58  virtual ~TSelector();
59 
60  virtual int Version() const { return 0; }
61  virtual void Init(TTree *) { }
62  virtual void Begin(TTree *) { }
63  virtual void SlaveBegin(TTree *) { }
64  virtual Bool_t Notify() { return kTRUE; }
65  virtual const char *GetOption() const { return fOption; }
66  virtual Long64_t GetStatus() const { return fStatus; }
67  virtual Int_t GetEntry(Long64_t /*entry*/, Int_t /*getall*/ = 0) { return 0; }
68  virtual Bool_t ProcessCut(Long64_t /*entry*/);
69  virtual void ProcessFill(Long64_t /*entry*/);
70  virtual Bool_t Process(Long64_t /*entry*/);
71  virtual void SetOption(const char *option) { fOption = option; }
72  virtual void SetObject(TObject *obj) { fObject = obj; }
73  virtual void SetInputList(TList *input) { fInput = input; }
74  virtual void SetStatus(Long64_t status) { fStatus = status; }
75  virtual TList *GetInputList() const { return fInput; }
76  virtual TList *GetOutputList() const { return fOutput; }
77  virtual void SlaveTerminate() { }
78  virtual void Terminate() { }
79  virtual void Abort(const char *why, EAbort what = kAbortProcess);
80  virtual EAbort GetAbort() const { return fAbort; }
81  virtual void ResetAbort() { fAbort = kContinue; }
82 
83  static TSelector *GetSelector(const char *filename);
84  static Bool_t IsStandardDraw(const char *selec);
85 
86  ClassDef(TSelector,2) //A utility class for tree and object processing
87 };
88 
89 #endif
90 
virtual const char * GetOption() const
Definition: TSelector.h:65
virtual Int_t GetEntry(Long64_t, Int_t=0)
Definition: TSelector.h:67
virtual int Version() const
Definition: TSelector.h:60
TSelectorList * fOutput
Definition: TSelector.h:50
long long Long64_t
Definition: RtypesCore.h:69
virtual Bool_t Notify()
This method must be overridden to handle object notification.
Definition: TSelector.h:64
virtual TList * GetOutputList() const
Definition: TSelector.h:76
virtual Bool_t ProcessCut(Long64_t)
Definition: TSelector.cxx:260
static const char * filename()
Basic string class.
Definition: TString.h:137
TAlienJobStatus * status
Definition: TAlienJob.cxx:51
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
virtual void SetInputList(TList *input)
Definition: TSelector.h:73
virtual void ProcessFill(Long64_t)
Definition: TSelector.cxx:277
#define ClassDef(name, id)
Definition: Rtypes.h:254
virtual void Begin(TTree *)
Definition: TSelector.h:62
TString fOption
Definition: TSelector.h:47
A doubly linked list.
Definition: TList.h:47
static const char * what
Definition: stlLoader.cc:6
virtual TList * GetInputList() const
Definition: TSelector.h:75
TObject * fObject
Definition: TSelector.h:48
Long64_t fStatus
Definition: TSelector.h:45
virtual void SetStatus(Long64_t status)
Definition: TSelector.h:74
virtual void Abort(const char *why, EAbort what=kAbortProcess)
Abort processing.
Definition: TSelector.cxx:114
static Bool_t IsStandardDraw(const char *selec)
Find out if this is a standard selection used for Draw actions (either TSelectorDraw, TProofDraw or deriving from them).
Definition: TSelector.cxx:235
virtual void SlaveBegin(TTree *)
Definition: TSelector.h:63
TSelector & operator=(const TSelector &)
virtual void Terminate()
Definition: TSelector.h:78
virtual void SlaveTerminate()
Definition: TSelector.h:77
static TSelector * GetSelector(const char *filename)
The code in filename is loaded (interpreted or compiled, see below), filename must contain a valid cl...
Definition: TSelector.cxx:140
virtual void ResetAbort()
Definition: TSelector.h:81
virtual EAbort GetAbort() const
Definition: TSelector.h:80
EAbort fAbort
Definition: TSelector.h:46
virtual ~TSelector()
Selector destructor.
Definition: TSelector.cxx:100
virtual Bool_t Process(Long64_t)
Definition: TSelector.cxx:290
virtual void SetObject(TObject *obj)
Definition: TSelector.h:72
virtual void SetOption(const char *option)
Definition: TSelector.h:71
Mother of all ROOT objects.
Definition: TObject.h:58
TList * fInput
Current object if processing object (vs. TTree)
Definition: TSelector.h:49
A TList derived class that makes sure that objects added to it are not linked to the currently open f...
Definition: TSelectorList.h:33
A TTree object has a header with a name and a title.
Definition: TTree.h:94
A TSelector object is used by the TTree::Draw, TTree::Scan, TTree::Process to navigate in a TTree and...
Definition: TSelector.h:39
const Bool_t kTRUE
Definition: Rtypes.h:91
TObject * obj
virtual Long64_t GetStatus() const
Definition: TSelector.h:66
virtual void Init(TTree *)
Definition: TSelector.h:61