ROOT logo
// @(#)root/tree:$Id: TSelector.h 20882 2007-11-19 11:31:26Z rdm $
// Author: Rene Brun   05/02/97

/*************************************************************************
 * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/

#ifndef ROOT_TSelector
#define ROOT_TSelector


//////////////////////////////////////////////////////////////////////////
//                                                                      //
// TSelector                                                            //
//                                                                      //
// A utility class for Trees selections.                                //
//                                                                      //
//////////////////////////////////////////////////////////////////////////


#ifndef ROOT_TObject
#include "TObject.h"
#endif
#ifndef ROOT_TString
#include "TString.h"
#endif
#ifndef ROOT_TSelectorList
#include "TSelectorList.h"
#endif


class TTree;


class TSelector : public TObject {

public:
   enum EAbort { kContinue, kAbortProcess, kAbortFile };

protected:
   Long64_t       fStatus;  //selector status
   EAbort         fAbort;   //abort status
   TString        fOption;  //option given to TTree::Process
   TObject       *fObject;  //current object if processing object (vs. TTree)
   TList         *fInput;   //list of objects available during processing
   TSelectorList *fOutput;  //list of objects created during processing

private:
   TSelector(const TSelector&);            // not implemented
   TSelector& operator=(const TSelector&); // not implemented

public:
   TSelector();
   virtual            ~TSelector();

   virtual int         Version() const { return 0; }
   virtual void        Init(TTree *) { }
   virtual void        Begin(TTree *) { }
   virtual void        SlaveBegin(TTree *) { }
   virtual Bool_t      Notify() { return kTRUE; }
   virtual const char *GetOption() const { return fOption; }
   virtual Long64_t    GetStatus() const { return fStatus; }
   virtual Int_t       GetEntry(Long64_t /*entry*/, Int_t /*getall*/ = 0) { return 0; }
   virtual Bool_t      ProcessCut(Long64_t /*entry*/) { return kTRUE; }
   virtual void        ProcessFill(Long64_t /*entry*/) { }
   virtual Bool_t      Process(Long64_t /*entry*/) { return kFALSE; }
   virtual void        SetOption(const char *option) { fOption = option; }
   virtual void        SetObject(TObject *obj) { fObject = obj; }
   virtual void        SetInputList(TList *input) { fInput = input; }
   virtual void        SetStatus(Long64_t status) { fStatus = status; }
   virtual TList      *GetOutputList() const { return fOutput; }
   virtual void        SlaveTerminate() { }
   virtual void        Terminate() { }
   virtual void        Abort(const char *why, EAbort what = kAbortProcess);
   virtual EAbort      GetAbort() const { return fAbort; }

   static  TSelector  *GetSelector(const char *filename);
   static  Bool_t      IsStandardDraw(const char *selec);

   ClassDef(TSelector,0)  //A utility class for tree and object processing
};

#endif

 TSelector.h:1
 TSelector.h:2
 TSelector.h:3
 TSelector.h:4
 TSelector.h:5
 TSelector.h:6
 TSelector.h:7
 TSelector.h:8
 TSelector.h:9
 TSelector.h:10
 TSelector.h:11
 TSelector.h:12
 TSelector.h:13
 TSelector.h:14
 TSelector.h:15
 TSelector.h:16
 TSelector.h:17
 TSelector.h:18
 TSelector.h:19
 TSelector.h:20
 TSelector.h:21
 TSelector.h:22
 TSelector.h:23
 TSelector.h:24
 TSelector.h:25
 TSelector.h:26
 TSelector.h:27
 TSelector.h:28
 TSelector.h:29
 TSelector.h:30
 TSelector.h:31
 TSelector.h:32
 TSelector.h:33
 TSelector.h:34
 TSelector.h:35
 TSelector.h:36
 TSelector.h:37
 TSelector.h:38
 TSelector.h:39
 TSelector.h:40
 TSelector.h:41
 TSelector.h:42
 TSelector.h:43
 TSelector.h:44
 TSelector.h:45
 TSelector.h:46
 TSelector.h:47
 TSelector.h:48
 TSelector.h:49
 TSelector.h:50
 TSelector.h:51
 TSelector.h:52
 TSelector.h:53
 TSelector.h:54
 TSelector.h:55
 TSelector.h:56
 TSelector.h:57
 TSelector.h:58
 TSelector.h:59
 TSelector.h:60
 TSelector.h:61
 TSelector.h:62
 TSelector.h:63
 TSelector.h:64
 TSelector.h:65
 TSelector.h:66
 TSelector.h:67
 TSelector.h:68
 TSelector.h:69
 TSelector.h:70
 TSelector.h:71
 TSelector.h:72
 TSelector.h:73
 TSelector.h:74
 TSelector.h:75
 TSelector.h:76
 TSelector.h:77
 TSelector.h:78
 TSelector.h:79
 TSelector.h:80
 TSelector.h:81
 TSelector.h:82
 TSelector.h:83
 TSelector.h:84
 TSelector.h:85
 TSelector.h:86
 TSelector.h:87
 TSelector.h:88