Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/root/TSelector.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 // @(#)root/tree:$Id$
0002 // Author: Rene Brun   05/02/97
0003 
0004 /*************************************************************************
0005  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
0006  * All rights reserved.                                                  *
0007  *                                                                       *
0008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
0009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
0010  *************************************************************************/
0011 
0012 #ifndef ROOT_TSelector
0013 #define ROOT_TSelector
0014 
0015 
0016 //////////////////////////////////////////////////////////////////////////
0017 //                                                                      //
0018 // TSelector                                                            //
0019 //                                                                      //
0020 // A utility class for Trees selections.                                //
0021 //                                                                      //
0022 //////////////////////////////////////////////////////////////////////////
0023 
0024 
0025 #include "TObject.h"
0026 #include "TString.h"
0027 #include "TSelectorList.h"
0028 
0029 class TTree;
0030 
0031 class TSelector : public TObject {
0032 
0033 public:
0034    enum EAbort { kContinue, kAbortProcess, kAbortFile };
0035 
0036 protected:
0037    Long64_t       fStatus;  ///<  Selector status
0038    EAbort         fAbort;   ///<  Abort status
0039    TString        fOption;  ///<  Option given to TTree::Process
0040    TObject       *fObject;  ///<! Current object if processing object (vs. TTree)
0041    TList         *fInput;   ///<  List of objects available during processing
0042    TSelectorList *fOutput;  ///<! List of objects created during processing
0043 
0044 private:
0045    TSelector(const TSelector&);            // not implemented
0046    TSelector& operator=(const TSelector&); // not implemented
0047 
0048 public:
0049    TSelector();
0050               ~TSelector() override;
0051 
0052    virtual int         Version() const { return 0; }
0053    virtual void        Init(TTree *) { }
0054    virtual void        Begin(TTree *) { }
0055    virtual void        SlaveBegin(TTree *) { }
0056            bool        Notify() override { return true; }
0057            const char *GetOption() const override { return fOption.Data(); }
0058    virtual Long64_t    GetStatus() const { return fStatus; }
0059    virtual Int_t       GetEntry(Long64_t /*entry*/, Int_t /*getall*/ = 0) { return 0; }
0060    virtual bool        ProcessCut(Long64_t /*entry*/);
0061    virtual void        ProcessFill(Long64_t /*entry*/);
0062    virtual bool        Process(Long64_t /*entry*/);
0063    virtual void        ImportOutput(TList *output);
0064    virtual void        SetOption(const char *option) { fOption = option; }
0065    virtual void        SetObject(TObject *obj) { fObject = obj; }
0066    virtual void        SetInputList(TList *input) { fInput = input; }
0067    virtual void        SetStatus(Long64_t status) { fStatus = status; }
0068    virtual TList      *GetInputList() const { return fInput; }
0069    virtual TList      *GetOutputList() const { return fOutput; }
0070    virtual void        SlaveTerminate() { }
0071    virtual void        Terminate() { }
0072    virtual void        Abort(const char *why, EAbort what = kAbortProcess);
0073    virtual EAbort      GetAbort() const { return fAbort; }
0074    virtual void        ResetAbort() { fAbort = kContinue; }
0075 
0076    static  TSelector  *GetSelector(const char *filename);
0077    static  bool        IsStandardDraw(const char *selec);
0078 
0079    ClassDefOverride(TSelector,2)  //A utility class for tree and object processing
0080 };
0081 
0082 #endif
0083