Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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
29class TTree;
30
31class TSelector : public TObject {
32
33public:
35
36protected:
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
44private:
45 TSelector(const TSelector&); // not implemented
46 TSelector& operator=(const TSelector&); // not implemented
47
48public:
49 TSelector();
50 ~TSelector() override;
51
52 virtual int Version() const { return 0; }
53 virtual void Init(TTree *) { }
54 virtual void Begin(TTree *) { }
55 virtual void SlaveBegin(TTree *) { }
56 bool Notify() override { return true; }
57 const char *GetOption() const override { return fOption.Data(); }
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 ProcessCut(Long64_t /*entry*/);
61 virtual void ProcessFill(Long64_t /*entry*/);
62 virtual bool 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 IsStandardDraw(const char *selec);
78
79 ClassDefOverride(TSelector,2) //A utility class for tree and object processing
80};
81
82#endif
83
long long Long64_t
Definition RtypesCore.h:69
#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 input
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char filename
A doubly linked list.
Definition TList.h:38
Mother of all ROOT objects.
Definition TObject.h:41
A TList derived class that makes sure that objects added to it are not linked to the currently open f...
A TSelector object is used by the TTree::Draw, TTree::Scan, TTree::Process to navigate in a TTree and...
Definition TSelector.h:31
virtual void SetObject(TObject *obj)
Definition TSelector.h:65
virtual EAbort GetAbort() const
Definition TSelector.h:73
virtual void SetStatus(Long64_t status)
Definition TSelector.h:67
static bool IsStandardDraw(const char *selec)
Find out if this is a standard selection used for Draw actions (either TSelectorDraw,...
TSelector(const TSelector &)
TSelector & operator=(const TSelector &)
TList * fInput
List of objects available during processing.
Definition TSelector.h:41
virtual void ProcessFill(Long64_t)
This method is called for all selected entries.
@ kAbortProcess
Definition TSelector.h:34
virtual void Init(TTree *)
Definition TSelector.h:53
virtual int Version() const
Definition TSelector.h:52
TString fOption
Option given to TTree::Process.
Definition TSelector.h:39
virtual bool ProcessCut(Long64_t)
This method is called before processing entry.
virtual bool Process(Long64_t)
The Process() function is called for each entry in the tree (or possibly keyed object in the case of ...
virtual void ImportOutput(TList *output)
Imports the content of 'output' in the internal output list.
virtual TList * GetInputList() const
Definition TSelector.h:68
TSelectorList * fOutput
! List of objects created during processing
Definition TSelector.h:42
Long64_t fStatus
Selector status.
Definition TSelector.h:37
virtual void SlaveBegin(TTree *)
Definition TSelector.h:55
virtual Int_t GetEntry(Long64_t, Int_t=0)
Definition TSelector.h:59
bool Notify() override
This method must be overridden to handle object notification (the base implementation is no-op).
Definition TSelector.h:56
virtual void SetOption(const char *option)
Definition TSelector.h:64
virtual Long64_t GetStatus() const
Definition TSelector.h:58
virtual void SetInputList(TList *input)
Definition TSelector.h:66
virtual void Abort(const char *why, EAbort what=kAbortProcess)
Abort processing.
const char * GetOption() const override
Definition TSelector.h:57
TObject * fObject
! Current object if processing object (vs. TTree)
Definition TSelector.h:40
virtual TList * GetOutputList() const
Definition TSelector.h:69
virtual void SlaveTerminate()
Definition TSelector.h:70
~TSelector() override
Selector destructor.
EAbort fAbort
Abort status.
Definition TSelector.h:38
virtual void ResetAbort()
Definition TSelector.h:74
virtual void Begin(TTree *)
Definition TSelector.h:54
virtual void Terminate()
Definition TSelector.h:71
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...
Basic string class.
Definition TString.h:139
const char * Data() const
Definition TString.h:376
A TTree represents a columnar dataset.
Definition TTree.h:79
static const char * what
Definition stlLoader.cc:5
static void output()