Logo ROOT   6.18/05
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
30class TTree;
31
32
33class TSelector : public TObject {
34
35public:
37
38protected:
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
46private:
47 TSelector(const TSelector&); // not implemented
48 TSelector& operator=(const TSelector&); // not implemented
49
50public:
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
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
long long Long64_t
Definition: RtypesCore.h:69
const Bool_t kTRUE
Definition: RtypesCore.h:87
#define ClassDef(name, id)
Definition: Rtypes.h:326
A doubly linked list.
Definition: TList.h:44
Mother of all ROOT objects.
Definition: TObject.h:37
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 TSelector object is used by the TTree::Draw, TTree::Scan, TTree::Process to navigate in a TTree and...
Definition: TSelector.h:33
virtual void SetObject(TObject *obj)
Definition: TSelector.h:67
virtual EAbort GetAbort() const
Definition: TSelector.h:75
virtual void SetStatus(Long64_t status)
Definition: TSelector.h:69
TSelector(const TSelector &)
TSelector & operator=(const TSelector &)
TList * fInput
List of objects available during processing.
Definition: TSelector.h:43
virtual void ProcessFill(Long64_t)
Definition: TSelector.cxx:317
@ kAbortFile
Definition: TSelector.h:36
@ kAbortProcess
Definition: TSelector.h:36
@ kContinue
Definition: TSelector.h:36
virtual void Init(TTree *)
Definition: TSelector.h:55
virtual int Version() const
Definition: TSelector.h:54
TString fOption
Option given to TTree::Process.
Definition: TSelector.h:41
virtual void ImportOutput(TList *output)
Imports the content of 'output' in the internal output list.
Definition: TSelector.cxx:270
virtual TList * GetInputList() const
Definition: TSelector.h:70
TSelectorList * fOutput
! List of objects created during processing
Definition: TSelector.h:44
virtual Bool_t Process(Long64_t)
Definition: TSelector.cxx:330
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
Long64_t fStatus
Selector status.
Definition: TSelector.h:39
virtual void SlaveBegin(TTree *)
Definition: TSelector.h:57
virtual Int_t GetEntry(Long64_t, Int_t=0)
Definition: TSelector.h:61
virtual Bool_t ProcessCut(Long64_t)
Definition: TSelector.cxx:300
virtual void SetOption(const char *option)
Definition: TSelector.h:66
virtual const char * GetOption() const
Definition: TSelector.h:59
virtual Long64_t GetStatus() const
Definition: TSelector.h:60
virtual void SetInputList(TList *input)
Definition: TSelector.h:68
virtual void Abort(const char *why, EAbort what=kAbortProcess)
Abort processing.
Definition: TSelector.cxx:116
TObject * fObject
! Current object if processing object (vs. TTree)
Definition: TSelector.h:42
virtual TList * GetOutputList() const
Definition: TSelector.h:71
virtual Bool_t Notify()
This method must be overridden to handle object notification.
Definition: TSelector.h:58
virtual void SlaveTerminate()
Definition: TSelector.h:72
EAbort fAbort
Abort status.
Definition: TSelector.h:40
virtual void ResetAbort()
Definition: TSelector.h:76
virtual void Begin(TTree *)
Definition: TSelector.h:56
virtual void Terminate()
Definition: TSelector.h:73
virtual ~TSelector()
Selector destructor.
Definition: TSelector.cxx:102
TSelector()
Default selector ctor.
Definition: TSelector.cxx:89
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
Basic string class.
Definition: TString.h:131
A TTree represents a columnar dataset.
Definition: TTree.h:71
static void output(int code)
Definition: gifencode.c:226