#ifndef ROOT_TTreePlayer
#define ROOT_TTreePlayer
#ifndef ROOT_TTree
#include "TTree.h"
#endif
#ifndef ROOT_TSelectorDraw
#include "TSelectorDraw.h"
#endif
#ifndef ROOT_TVirtualTreePlayer
#include "TVirtualTreePlayer.h"
#endif
class TVirtualIndex;
class TTreePlayer : public TVirtualTreePlayer {
private:
TTreePlayer(const TTreePlayer &);
TTreePlayer& operator=(const TTreePlayer &);
protected:
TTree *fTree;
Bool_t fScanRedirect;
const char *fScanFileName;
Int_t fDimension;
Long64_t fSelectedRows;
TH1 *fHistogram;
TSelectorDraw *fSelector;
TSelector *fSelectorFromFile;
TClass *fSelectorClass;
TList *fInput;
TList *fFormulaList;
TSelector *fSelectorUpdate;
protected:
const char *GetNameByIndex(TString &varexp, Int_t *index,Int_t colindex);
void TakeAction(Int_t nfill, Int_t &npoints, Int_t &action, TObject *obj, Option_t *option);
void TakeEstimate(Int_t nfill, Int_t &npoints, Int_t action, TObject *obj, Option_t *option);
void DeleteSelectorFromFile();
public:
TTreePlayer();
virtual ~TTreePlayer();
virtual TVirtualIndex *BuildIndex(const TTree *T, const char *majorname, const char *minorname);
virtual TTree *CopyTree(const char *selection, Option_t *option
,Long64_t nentries, Long64_t firstentry);
virtual Long64_t DrawScript(const char* wrapperPrefix,
const char *macrofilename, const char *cutfilename,
Option_t *option, Long64_t nentries, Long64_t firstentry);
virtual Long64_t DrawSelect(const char *varexp, const char *selection, Option_t *option
,Long64_t nentries, Long64_t firstentry);
virtual Int_t Fit(const char *formula ,const char *varexp, const char *selection,Option_t *option ,
Option_t *goption ,Long64_t nentries, Long64_t firstentry);
virtual Int_t GetDimension() const {return fDimension;}
TH1 *GetHistogram() const {return fHistogram;}
virtual Long64_t GetEntries(const char *selection);
virtual Long64_t GetEntriesToProcess(Long64_t firstentry, Long64_t nentries) const;
virtual Int_t GetNfill() const {return fSelector->GetNfill();}
const char *GetScanFileName() const {return fScanFileName;}
TTreeFormula *GetSelect() const {return fSelector->GetSelect();}
virtual Long64_t GetSelectedRows() const {return fSelectedRows;}
TSelector *GetSelector() const {return fSelector;}
TSelector *GetSelectorFromFile() const {return fSelectorFromFile;}
TTreeFormula *GetVar(Int_t i) const {return fSelector->GetVar(i);};
TTreeFormula *GetVar1() const {return fSelector->GetVar1();}
TTreeFormula *GetVar2() const {return fSelector->GetVar2();}
TTreeFormula *GetVar3() const {return fSelector->GetVar3();}
TTreeFormula *GetVar4() const {return fSelector->GetVar4();}
virtual Double_t *GetVal(Int_t i) const {return fSelector->GetVal(i);};
virtual Double_t *GetV1() const {return fSelector->GetV1();}
virtual Double_t *GetV2() const {return fSelector->GetV2();}
virtual Double_t *GetV3() const {return fSelector->GetV3();}
virtual Double_t *GetV4() const {return fSelector->GetV4();}
virtual Double_t *GetW() const {return fSelector->GetW();}
virtual Int_t MakeClass(const char *classname, Option_t *option);
virtual Int_t MakeCode(const char *filename);
virtual Int_t MakeProxy(const char *classname,
const char *macrofilename = 0, const char *cutfilename = 0,
const char *option = 0, Int_t maxUnrolling = 3);
TPrincipal *Principal(const char *varexp, const char *selection, Option_t *option
,Long64_t nentries, Long64_t firstentry);
virtual Long64_t Process(const char *filename,Option_t *option, Long64_t nentries, Long64_t firstentry);
virtual Long64_t Process(TSelector *selector,Option_t *option, Long64_t nentries, Long64_t firstentry);
virtual void RecursiveRemove(TObject *obj);
virtual Long64_t Scan(const char *varexp, const char *selection, Option_t *option
,Long64_t nentries, Long64_t firstentry);
Bool_t ScanRedirected() {return fScanRedirect;}
virtual TSQLResult *Query(const char *varexp, const char *selection, Option_t *option
,Long64_t nentries, Long64_t firstentry);
virtual void SetEstimate(Long64_t n);
void SetScanRedirect(Bool_t on=kFALSE) {fScanRedirect = on;}
void SetScanFileName(const char *name) {fScanFileName=name;}
virtual void SetTree(TTree *t) {fTree = t;}
virtual void StartViewer(Int_t ww, Int_t wh);
virtual Int_t UnbinnedFit(const char *formula ,const char *varexp, const char *selection,Option_t *option
,Long64_t nentries, Long64_t firstentry);
virtual void UpdateFormulaLeaves();
ClassDef(TTreePlayer,3);
};
#endif