Logo ROOT  
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 class TTree;
30 
31 class TSelector : public TObject {
32 
33 public:
35 
36 protected:
37  Long64_t fStatus; ///< Selector status
38  EAbort fAbort; ///< Abort status
39  TString fOption; ///< Option given to TTree::Process
40  TObject *fObject; ///<! Current object if processing object (vs. TTree)
41  TList *fInput; ///< List of objects available during processing
42  TSelectorList *fOutput; ///<! List of objects created during processing
43 
44 private:
45  TSelector(const TSelector&); // not implemented
46  TSelector& operator=(const TSelector&); // not implemented
47 
48 public:
49  TSelector();
50  virtual ~TSelector();
51 
52  virtual int Version() const { return 0; }
53  virtual void Init(TTree *) { }
54  virtual void Begin(TTree *) { }
55  virtual void SlaveBegin(TTree *) { }
56  virtual Bool_t Notify() { return kTRUE; }
57  virtual const char *GetOption() const { return fOption; }
58  virtual Long64_t GetStatus() const { return fStatus; }
59  virtual Int_t GetEntry(Long64_t /*entry*/, Int_t /*getall*/ = 0) { return 0; }
60  virtual Bool_t ProcessCut(Long64_t /*entry*/);
61  virtual void ProcessFill(Long64_t /*entry*/);
62  virtual Bool_t Process(Long64_t /*entry*/);
63  virtual void ImportOutput(TList *output);
64  virtual void SetOption(const char *option) { fOption = option; }
65  virtual void SetObject(TObject *obj) { fObject = obj; }
66  virtual void SetInputList(TList *input) { fInput = input; }
67  virtual void SetStatus(Long64_t status) { fStatus = status; }
68  virtual TList *GetInputList() const { return fInput; }
69  virtual TList *GetOutputList() const { return fOutput; }
70  virtual void SlaveTerminate() { }
71  virtual void Terminate() { }
72  virtual void Abort(const char *why, EAbort what = kAbortProcess);
73  virtual EAbort GetAbort() const { return fAbort; }
74  virtual void ResetAbort() { fAbort = kContinue; }
75 
76  static TSelector *GetSelector(const char *filename);
77  static Bool_t IsStandardDraw(const char *selec);
78 
79  ClassDef(TSelector,2) //A utility class for tree and object processing
80 };
81 
82 #endif
83 
TSelector::GetStatus
virtual Long64_t GetStatus() const
Definition: TSelector.h:58
kTRUE
const Bool_t kTRUE
Definition: RtypesCore.h:91
TSelector
Definition: TSelector.h:31
TSelector::GetOption
virtual const char * GetOption() const
Definition: TSelector.h:57
TSelector::Init
virtual void Init(TTree *)
Definition: TSelector.h:53
TSelector::EAbort
EAbort
Definition: TSelector.h:34
TSelector::Terminate
virtual void Terminate()
Definition: TSelector.h:71
TSelectorList.h
TSelector::SlaveTerminate
virtual void SlaveTerminate()
Definition: TSelector.h:70
TSelector::GetSelector
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
Long64_t
long long Long64_t
Definition: RtypesCore.h:73
output
static void output(int code)
Definition: gifencode.c:226
TSelector::kContinue
@ kContinue
Definition: TSelector.h:34
TTree
Definition: TTree.h:79
TSelector::fAbort
EAbort fAbort
Abort status.
Definition: TSelector.h:38
TSelector::Abort
virtual void Abort(const char *why, EAbort what=kAbortProcess)
Abort processing.
Definition: TSelector.cxx:116
TSelector::~TSelector
virtual ~TSelector()
Selector destructor.
Definition: TSelector.cxx:102
TSelector::operator=
TSelector & operator=(const TSelector &)
TString
Definition: TString.h:136
Bool_t
bool Bool_t
Definition: RtypesCore.h:63
TSelector::Begin
virtual void Begin(TTree *)
Definition: TSelector.h:54
TString.h
bool
TSelector::ResetAbort
virtual void ResetAbort()
Definition: TSelector.h:74
TSelector::kAbortProcess
@ kAbortProcess
Definition: TSelector.h:34
TSelector::Process
virtual Bool_t Process(Long64_t)
Definition: TSelector.cxx:330
TSelector::kAbortFile
@ kAbortFile
Definition: TSelector.h:34
TSelector::GetAbort
virtual EAbort GetAbort() const
Definition: TSelector.h:73
TSelector::GetEntry
virtual Int_t GetEntry(Long64_t, Int_t=0)
Definition: TSelector.h:59
TSelector::fOption
TString fOption
Option given to TTree::Process.
Definition: TSelector.h:39
TSelector::Notify
virtual Bool_t Notify()
This method must be overridden to handle object notification.
Definition: TSelector.h:56
TSelector::SetInputList
virtual void SetInputList(TList *input)
Definition: TSelector.h:66
what
static const char * what
Definition: stlLoader.cc:6
TSelector::fStatus
Long64_t fStatus
Selector status.
Definition: TSelector.h:37
TSelector::ProcessCut
virtual Bool_t ProcessCut(Long64_t)
Definition: TSelector.cxx:300
TSelector::GetOutputList
virtual TList * GetOutputList() const
Definition: TSelector.h:69
TSelector::ImportOutput
virtual void ImportOutput(TList *output)
Imports the content of 'output' in the internal output list.
Definition: TSelector.cxx:270
TSelector::SlaveBegin
virtual void SlaveBegin(TTree *)
Definition: TSelector.h:55
TSelector::SetOption
virtual void SetOption(const char *option)
Definition: TSelector.h:64
TSelector::fOutput
TSelectorList * fOutput
! List of objects created during processing
Definition: TSelector.h:42
TObject.h
TObject
Definition: TObject.h:37
TSelectorList
Definition: TSelectorList.h:31
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
TSelector::fObject
TObject * fObject
! Current object if processing object (vs. TTree)
Definition: TSelector.h:40
TSelector::ProcessFill
virtual void ProcessFill(Long64_t)
Definition: TSelector.cxx:317
TSelector::Version
virtual int Version() const
Definition: TSelector.h:52
TSelector::SetStatus
virtual void SetStatus(Long64_t status)
Definition: TSelector.h:67
TSelector::IsStandardDraw
static Bool_t IsStandardDraw(const char *selec)
Find out if this is a standard selection used for Draw actions (either TSelectorDraw,...
Definition: TSelector.cxx:237
TSelector::TSelector
TSelector()
Default selector ctor.
Definition: TSelector.cxx:89
TSelector::SetObject
virtual void SetObject(TObject *obj)
Definition: TSelector.h:65
TSelector::fInput
TList * fInput
List of objects available during processing.
Definition: TSelector.h:41
TList
Definition: TList.h:44
TSelector::GetInputList
virtual TList * GetInputList() const
Definition: TSelector.h:68
int