Logo ROOT   6.10/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 #include "TObject.h"
26 #include "TString.h"
27 #include "TSelectorList.h"
28 
29 
30 class TTree;
31 
32 
33 class TSelector : public TObject {
34 
35 public:
37 
38 protected:
39  Long64_t fStatus; ///< Selector status
40  EAbort fAbort; ///< Abort status
41  TString fOption; ///< Option given to TTree::Process
42  TObject *fObject; ///<! Current object if processing object (vs. TTree)
43  TList *fInput; ///< List of objects available during processing
44  TSelectorList *fOutput; ///<! List of objects created during processing
45 
46 private:
47  TSelector(const TSelector&); // not implemented
48  TSelector& operator=(const TSelector&); // not implemented
49 
50 public:
51  TSelector();
52  virtual ~TSelector();
53 
54  virtual int Version() const { return 0; }
55  virtual void Init(TTree *) { }
56  virtual void Begin(TTree *) { }
57  virtual void SlaveBegin(TTree *) { }
58  virtual Bool_t Notify() { return kTRUE; }
59  virtual const char *GetOption() const { return fOption; }
60  virtual Long64_t GetStatus() const { return fStatus; }
61  virtual Int_t GetEntry(Long64_t /*entry*/, Int_t /*getall*/ = 0) { return 0; }
62  virtual Bool_t ProcessCut(Long64_t /*entry*/);
63  virtual void ProcessFill(Long64_t /*entry*/);
64  virtual Bool_t Process(Long64_t /*entry*/);
65  virtual void ImportOutput(TList *output);
66  virtual void SetOption(const char *option) { fOption = option; }
67  virtual void SetObject(TObject *obj) { fObject = obj; }
68  virtual void SetInputList(TList *input) { fInput = input; }
69  virtual void SetStatus(Long64_t status) { fStatus = status; }
70  virtual TList *GetInputList() const { return fInput; }
71  virtual TList *GetOutputList() const { return fOutput; }
72  virtual void SlaveTerminate() { }
73  virtual void Terminate() { }
74  virtual void Abort(const char *why, EAbort what = kAbortProcess);
75  virtual EAbort GetAbort() const { return fAbort; }
76  virtual void ResetAbort() { fAbort = kContinue; }
77 
78  static TSelector *GetSelector(const char *filename);
79  static Bool_t IsStandardDraw(const char *selec);
80 
81  ClassDef(TSelector,2) //A utility class for tree and object processing
82 };
83 
84 #endif
85 
virtual Int_t GetEntry(Long64_t, Int_t=0)
Definition: TSelector.h:61
TSelectorList * fOutput
! List of objects created during processing
Definition: TSelector.h:44
long long Long64_t
Definition: RtypesCore.h:69
virtual Bool_t Notify()
This method must be overridden to handle object notification.
Definition: TSelector.h:58
virtual Bool_t ProcessCut(Long64_t)
Definition: TSelector.cxx:300
virtual void ImportOutput(TList *output)
Imports the content of &#39;output&#39; in the internal output list.
Definition: TSelector.cxx:270
Basic string class.
Definition: TString.h:129
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
virtual void SetInputList(TList *input)
Definition: TSelector.h:68
virtual void ProcessFill(Long64_t)
Definition: TSelector.cxx:317
#define ClassDef(name, id)
Definition: Rtypes.h:297
virtual Long64_t GetStatus() const
Definition: TSelector.h:60
virtual const char * GetOption() const
Definition: TSelector.h:59
virtual void Begin(TTree *)
Definition: TSelector.h:56
TString fOption
Option given to TTree::Process.
Definition: TSelector.h:41
A doubly linked list.
Definition: TList.h:43
TObject * fObject
! Current object if processing object (vs. TTree)
Definition: TSelector.h:42
virtual int Version() const
Definition: TSelector.h:54
Long64_t fStatus
Selector status.
Definition: TSelector.h:39
virtual void SetStatus(Long64_t status)
Definition: TSelector.h:69
virtual void Abort(const char *why, EAbort what=kAbortProcess)
Abort processing.
Definition: TSelector.cxx:116
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:237
virtual void SlaveBegin(TTree *)
Definition: TSelector.h:57
TSelector & operator=(const TSelector &)
virtual void Terminate()
Definition: TSelector.h:73
virtual void SlaveTerminate()
Definition: TSelector.h:72
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:142
virtual void ResetAbort()
Definition: TSelector.h:76
EAbort fAbort
Abort status.
Definition: TSelector.h:40
virtual ~TSelector()
Selector destructor.
Definition: TSelector.cxx:102
virtual Bool_t Process(Long64_t)
Definition: TSelector.cxx:330
virtual void SetObject(TObject *obj)
Definition: TSelector.h:67
virtual void SetOption(const char *option)
Definition: TSelector.h:66
Mother of all ROOT objects.
Definition: TObject.h:37
TSelector()
Default selector ctor.
Definition: TSelector.cxx:89
TList * fInput
List of objects available during processing.
Definition: TSelector.h:43
virtual TList * GetInputList() const
Definition: TSelector.h:70
A TList derived class that makes sure that objects added to it are not linked to the currently open f...
Definition: TSelectorList.h:31
A TTree object has a header with a name and a title.
Definition: TTree.h:78
A TSelector object is used by the TTree::Draw, TTree::Scan, TTree::Process to navigate in a TTree and...
Definition: TSelector.h:33
const Bool_t kTRUE
Definition: RtypesCore.h:91
virtual EAbort GetAbort() const
Definition: TSelector.h:75
virtual TList * GetOutputList() const
Definition: TSelector.h:71
virtual void Init(TTree *)
Definition: TSelector.h:55