00001 // @(#)root/tree:$Id: TSelector.h 20882 2007-11-19 11:31:26Z rdm $ 00002 // Author: Rene Brun 05/02/97 00003 00004 /************************************************************************* 00005 * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. * 00006 * All rights reserved. * 00007 * * 00008 * For the licensing terms see $ROOTSYS/LICENSE. * 00009 * For the list of contributors see $ROOTSYS/README/CREDITS. * 00010 *************************************************************************/ 00011 00012 #ifndef ROOT_TSelector 00013 #define ROOT_TSelector 00014 00015 00016 ////////////////////////////////////////////////////////////////////////// 00017 // // 00018 // TSelector // 00019 // // 00020 // A utility class for Trees selections. // 00021 // // 00022 ////////////////////////////////////////////////////////////////////////// 00023 00024 00025 #ifndef ROOT_TObject 00026 #include "TObject.h" 00027 #endif 00028 #ifndef ROOT_TString 00029 #include "TString.h" 00030 #endif 00031 #ifndef ROOT_TSelectorList 00032 #include "TSelectorList.h" 00033 #endif 00034 00035 00036 class TTree; 00037 00038 00039 class TSelector : public TObject { 00040 00041 public: 00042 enum EAbort { kContinue, kAbortProcess, kAbortFile }; 00043 00044 protected: 00045 Long64_t fStatus; //selector status 00046 EAbort fAbort; //abort status 00047 TString fOption; //option given to TTree::Process 00048 TObject *fObject; //current object if processing object (vs. TTree) 00049 TList *fInput; //list of objects available during processing 00050 TSelectorList *fOutput; //list of objects created during processing 00051 00052 private: 00053 TSelector(const TSelector&); // not implemented 00054 TSelector& operator=(const TSelector&); // not implemented 00055 00056 public: 00057 TSelector(); 00058 virtual ~TSelector(); 00059 00060 virtual int Version() const { return 0; } 00061 virtual void Init(TTree *) { } 00062 virtual void Begin(TTree *) { } 00063 virtual void SlaveBegin(TTree *) { } 00064 virtual Bool_t Notify() { return kTRUE; } 00065 virtual const char *GetOption() const { return fOption; } 00066 virtual Long64_t GetStatus() const { return fStatus; } 00067 virtual Int_t GetEntry(Long64_t /*entry*/, Int_t /*getall*/ = 0) { return 0; } 00068 virtual Bool_t ProcessCut(Long64_t /*entry*/) { return kTRUE; } 00069 virtual void ProcessFill(Long64_t /*entry*/) { } 00070 virtual Bool_t Process(Long64_t /*entry*/) { return kFALSE; } 00071 virtual void SetOption(const char *option) { fOption = option; } 00072 virtual void SetObject(TObject *obj) { fObject = obj; } 00073 virtual void SetInputList(TList *input) { fInput = input; } 00074 virtual void SetStatus(Long64_t status) { fStatus = status; } 00075 virtual TList *GetOutputList() const { return fOutput; } 00076 virtual void SlaveTerminate() { } 00077 virtual void Terminate() { } 00078 virtual void Abort(const char *why, EAbort what = kAbortProcess); 00079 virtual EAbort GetAbort() const { return fAbort; } 00080 00081 static TSelector *GetSelector(const char *filename); 00082 static Bool_t IsStandardDraw(const char *selec); 00083 00084 ClassDef(TSelector,0) //A utility class for tree and object processing 00085 }; 00086 00087 #endif 00088