File indexing completed on 2025-01-18 10:12:30
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #ifndef ROOT_TTreePlayer
0013 #define ROOT_TTreePlayer
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030 #include "TVirtualTreePlayer.h"
0031
0032 #include "TSelectorDraw.h"
0033 #include "TTree.h"
0034
0035 class TVirtualIndex;
0036
0037 class TTreePlayer : public TVirtualTreePlayer {
0038
0039 private:
0040 TTreePlayer(const TTreePlayer &) = delete;
0041 TTreePlayer& operator=(const TTreePlayer &) = delete;
0042
0043 protected:
0044 TTree *fTree;
0045 bool fScanRedirect;
0046 const char *fScanFileName;
0047 Int_t fDimension;
0048 Long64_t fSelectedRows;
0049 TH1 *fHistogram;
0050 TSelectorDraw *fSelector;
0051 TSelector *fSelectorFromFile;
0052 TClass *fSelectorClass;
0053 TList *fInput;
0054 TList *fFormulaList;
0055 TSelector *fSelectorUpdate;
0056
0057 protected:
0058 const char *GetNameByIndex(TString &varexp, Int_t *index,Int_t colindex);
0059 void DeleteSelectorFromFile();
0060
0061 public:
0062 TTreePlayer();
0063 ~TTreePlayer() override;
0064 TVirtualIndex *BuildIndex(const TTree *T, const char *majorname, const char *minorname) override;
0065 TTree *CopyTree(const char *selection, Option_t *option
0066 ,Long64_t nentries, Long64_t firstentry) override;
0067 Long64_t DrawScript(const char* wrapperPrefix,
0068 const char *macrofilename, const char *cutfilename,
0069 Option_t *option, Long64_t nentries, Long64_t firstentry) override;
0070 Long64_t DrawSelect(const char *varexp, const char *selection, Option_t *option
0071 ,Long64_t nentries, Long64_t firstentry) override;
0072 Int_t Fit(const char *formula ,const char *varexp, const char *selection,Option_t *option ,
0073 Option_t *goption ,Long64_t nentries, Long64_t firstentry) override;
0074 Int_t GetDimension() const override {return fDimension;}
0075 TH1 *GetHistogram() const override {return fHistogram;}
0076 Long64_t GetEntries(const char *selection) override;
0077 virtual Long64_t GetEntriesToProcess(Long64_t firstentry, Long64_t nentries) const;
0078 Int_t GetNfill() const override {return fSelector->GetNfill();}
0079 const char *GetScanFileName() const {return fScanFileName;}
0080 TTreeFormula *GetSelect() const override {return fSelector->GetSelect();}
0081 Long64_t GetSelectedRows() const override {return fSelectedRows;}
0082 TSelector *GetSelector() const override {return fSelector;}
0083 TSelector *GetSelectorFromFile() const override {return fSelectorFromFile;}
0084
0085 TTreeFormula *GetVar(Int_t i) const override {return fSelector->GetVar(i);};
0086
0087 TTreeFormula *GetVar1() const override {return fSelector->GetVar1();}
0088
0089 TTreeFormula *GetVar2() const override {return fSelector->GetVar2();}
0090
0091 TTreeFormula *GetVar3() const override {return fSelector->GetVar3();}
0092
0093 TTreeFormula *GetVar4() const override {return fSelector->GetVar4();}
0094
0095 Double_t *GetVal(Int_t i) const override {return fSelector->GetVal(i);};
0096
0097 Double_t *GetV1() const override {return fSelector->GetV1();}
0098
0099 Double_t *GetV2() const override {return fSelector->GetV2();}
0100
0101 Double_t *GetV3() const override {return fSelector->GetV3();}
0102
0103 Double_t *GetV4() const override {return fSelector->GetV4();}
0104 Double_t *GetW() const override {return fSelector->GetW();}
0105 Int_t MakeClass(const char *classname, Option_t *option) override;
0106 Int_t MakeCode(const char *filename) override;
0107 Int_t MakeProxy(const char *classname,
0108 const char *macrofilename = nullptr, const char *cutfilename = nullptr,
0109 const char *option = nullptr, Int_t maxUnrolling = 3) override;
0110 Int_t MakeReader(const char *classname, Option_t *option) override;
0111 TPrincipal *Principal(const char *varexp, const char *selection, Option_t *option
0112 ,Long64_t nentries, Long64_t firstentry) override;
0113 Long64_t Process(const char *filename,Option_t *option, Long64_t nentries, Long64_t firstentry) override;
0114 Long64_t Process(TSelector *selector,Option_t *option, Long64_t nentries, Long64_t firstentry) override;
0115 void RecursiveRemove(TObject *obj) override;
0116 Long64_t Scan(const char *varexp, const char *selection, Option_t *option
0117 ,Long64_t nentries, Long64_t firstentry) override;
0118 bool ScanRedirected() {return fScanRedirect;}
0119 TSQLResult *Query(const char *varexp, const char *selection, Option_t *option
0120 ,Long64_t nentries, Long64_t firstentry) override;
0121 void SetEstimate(Long64_t n) override;
0122 void SetScanRedirect(bool on=false) {fScanRedirect = on;}
0123 void SetScanFileName(const char *name) {fScanFileName=name;}
0124 void SetTree(TTree *t) override {fTree = t;}
0125 void StartViewer(Int_t ww, Int_t wh) override;
0126 Int_t UnbinnedFit(const char *formula ,const char *varexp, const char *selection,Option_t *option
0127 ,Long64_t nentries, Long64_t firstentry) override;
0128 void UpdateFormulaLeaves() override;
0129
0130 ClassDefOverride(TTreePlayer,3);
0131 };
0132
0133 #endif