00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef ROOT_TTreePlayer
00013 #define ROOT_TTreePlayer
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #ifndef ROOT_TTree
00031 #include "TTree.h"
00032 #endif
00033 #ifndef ROOT_TSelectorDraw
00034 #include "TSelectorDraw.h"
00035 #endif
00036 #ifndef ROOT_TVirtualTreePlayer
00037 #include "TVirtualTreePlayer.h"
00038 #endif
00039
00040
00041 class TVirtualIndex;
00042
00043 class TTreePlayer : public TVirtualTreePlayer {
00044
00045 private:
00046 TTreePlayer(const TTreePlayer &);
00047 TTreePlayer& operator=(const TTreePlayer &);
00048
00049 protected:
00050 TTree *fTree;
00051 Bool_t fScanRedirect;
00052 const char *fScanFileName;
00053 Int_t fDimension;
00054 Long64_t fSelectedRows;
00055 TH1 *fHistogram;
00056 TSelectorDraw *fSelector;
00057 TSelector *fSelectorFromFile;
00058 TClass *fSelectorClass;
00059 TList *fInput;
00060 TList *fFormulaList;
00061 TSelector *fSelectorUpdate;
00062
00063 protected:
00064 const char *GetNameByIndex(TString &varexp, Int_t *index,Int_t colindex);
00065 void TakeAction(Int_t nfill, Int_t &npoints, Int_t &action, TObject *obj, Option_t *option);
00066 void TakeEstimate(Int_t nfill, Int_t &npoints, Int_t action, TObject *obj, Option_t *option);
00067 void DeleteSelectorFromFile();
00068
00069 public:
00070 TTreePlayer();
00071 virtual ~TTreePlayer();
00072 virtual TVirtualIndex *BuildIndex(const TTree *T, const char *majorname, const char *minorname);
00073 virtual TTree *CopyTree(const char *selection, Option_t *option
00074 ,Long64_t nentries, Long64_t firstentry);
00075 virtual Long64_t DrawScript(const char* wrapperPrefix,
00076 const char *macrofilename, const char *cutfilename,
00077 Option_t *option, Long64_t nentries, Long64_t firstentry);
00078 virtual Long64_t DrawSelect(const char *varexp, const char *selection, Option_t *option
00079 ,Long64_t nentries, Long64_t firstentry);
00080 virtual Int_t Fit(const char *formula ,const char *varexp, const char *selection,Option_t *option ,
00081 Option_t *goption ,Long64_t nentries, Long64_t firstentry);
00082 virtual Int_t GetDimension() const {return fDimension;}
00083 TH1 *GetHistogram() const {return fHistogram;}
00084 virtual Long64_t GetEntries(const char *selection);
00085 virtual Long64_t GetEntriesToProcess(Long64_t firstentry, Long64_t nentries) const;
00086 virtual Int_t GetNfill() const {return fSelector->GetNfill();}
00087 const char *GetScanFileName() const {return fScanFileName;}
00088 TTreeFormula *GetSelect() const {return fSelector->GetSelect();}
00089 virtual Long64_t GetSelectedRows() const {return fSelectedRows;}
00090 TSelector *GetSelector() const {return fSelector;}
00091 TSelector *GetSelectorFromFile() const {return fSelectorFromFile;}
00092 TTreeFormula *GetVar(Int_t i) const {return fSelector->GetVar(i);};
00093 TTreeFormula *GetVar1() const {return fSelector->GetVar1();}
00094 TTreeFormula *GetVar2() const {return fSelector->GetVar2();}
00095 TTreeFormula *GetVar3() const {return fSelector->GetVar3();}
00096 TTreeFormula *GetVar4() const {return fSelector->GetVar4();}
00097 virtual Double_t *GetVal(Int_t i) const {return fSelector->GetVal(i);};
00098 virtual Double_t *GetV1() const {return fSelector->GetV1();}
00099 virtual Double_t *GetV2() const {return fSelector->GetV2();}
00100 virtual Double_t *GetV3() const {return fSelector->GetV3();}
00101 virtual Double_t *GetV4() const {return fSelector->GetV4();}
00102 virtual Double_t *GetW() const {return fSelector->GetW();}
00103 virtual Int_t MakeClass(const char *classname, Option_t *option);
00104 virtual Int_t MakeCode(const char *filename);
00105 virtual Int_t MakeProxy(const char *classname,
00106 const char *macrofilename = 0, const char *cutfilename = 0,
00107 const char *option = 0, Int_t maxUnrolling = 3);
00108 TPrincipal *Principal(const char *varexp, const char *selection, Option_t *option
00109 ,Long64_t nentries, Long64_t firstentry);
00110 virtual Long64_t Process(const char *filename,Option_t *option, Long64_t nentries, Long64_t firstentry);
00111 virtual Long64_t Process(TSelector *selector,Option_t *option, Long64_t nentries, Long64_t firstentry);
00112 virtual void RecursiveRemove(TObject *obj);
00113 virtual Long64_t Scan(const char *varexp, const char *selection, Option_t *option
00114 ,Long64_t nentries, Long64_t firstentry);
00115 Bool_t ScanRedirected() {return fScanRedirect;}
00116 virtual TSQLResult *Query(const char *varexp, const char *selection, Option_t *option
00117 ,Long64_t nentries, Long64_t firstentry);
00118 virtual void SetEstimate(Long64_t n);
00119 void SetScanRedirect(Bool_t on=kFALSE) {fScanRedirect = on;}
00120 void SetScanFileName(const char *name) {fScanFileName=name;}
00121 virtual void SetTree(TTree *t) {fTree = t;}
00122 virtual void StartViewer(Int_t ww, Int_t wh);
00123 virtual Int_t UnbinnedFit(const char *formula ,const char *varexp, const char *selection,Option_t *option
00124 ,Long64_t nentries, Long64_t firstentry);
00125 virtual void UpdateFormulaLeaves();
00126
00127 ClassDef(TTreePlayer,3);
00128 };
00129
00130 #endif