00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef ROOT_TSpider
00013 #define ROOT_TSpider
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef ROOT_Object
00025 #include "TObject.h"
00026 #endif
00027
00028 #ifndef ROOT_TAttFill
00029 #include "TAttFill.h"
00030 #endif
00031
00032 #ifndef ROOT_TAttLine
00033 #include "TAttLine.h"
00034 #endif
00035
00036 #ifndef ROOT_TAttText
00037 #include "TAttText.h"
00038 #endif
00039
00040 class TTree;
00041 class TGraphPolargram;
00042 class TPolyLine;
00043 class TTreeFormula;
00044 class TTreeFormulaManager;
00045 class TList;
00046 class TSelectorDraw;
00047 class TString;
00048 class TLatex;
00049 class TCanvas;
00050 class TArc;
00051
00052 class TSpider : public TObject, public TAttFill, public TAttLine {
00053 private:
00054 UInt_t fNx;
00055 UInt_t fNy;
00056 UInt_t fNcols;
00057 Int_t fArraySize;
00058 Long64_t fEntry;
00059 Long64_t fNentries;
00060 Long64_t fFirstEntry;
00061 Long64_t* fCurrentEntries;
00062 Double_t* fAve;
00063 Double_t* fMax;
00064 Double_t* fMin;
00065 TList* fSuperposed;
00066 TTree* fTree;
00067 TPolyLine* fAveragePoly;
00068 TArc** fAverageSlices;
00069 TCanvas* fCanvas;
00070 TList* fFormulas;
00071 TList* fInput;
00072 TTreeFormulaManager* fManager;
00073 TGraphPolargram* fPolargram;
00074 TList* fPolyList;
00075 TTreeFormula* fSelect;
00076 TSelectorDraw* fSelector;
00077 Bool_t fAngularLabels;
00078 Bool_t fDisplayAverage;
00079 Bool_t fForceDim;
00080 Bool_t fSegmentDisplay;
00081 Bool_t fShowRange;
00082
00083 Int_t FindTextAlign(Double_t theta);
00084 Double_t FindTextAngle(Double_t theta);
00085 void InitVariables(Long64_t firstentry, Long64_t nentries);
00086 void DrawPoly(Option_t* options);
00087 void DrawPolyAverage(Option_t* options);
00088 void DrawSlices(Option_t* options);
00089 void DrawSlicesAverage(Option_t* options);
00090 void SyncFormulas();
00091 void InitArrays(Int_t newsize);
00092 void SetCurrentEntries();
00093 void UpdateView();
00094
00095 public:
00096 TSpider();
00097 TSpider(TTree* tree, const char *varexp, const char *selection, Option_t *option="",
00098 Long64_t nentries=0, Long64_t firstentry=0);
00099 ~TSpider();
00100 void AddSuperposed(TSpider* sp);
00101 void AddVariable(const char* varexp);
00102 void DeleteVariable(const char* varexp);
00103 virtual void Draw(Option_t *options="");
00104 virtual Int_t DistancetoPrimitive(Int_t px, Int_t py);
00105 virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py);
00106 Style_t GetAverageLineStyle() const;
00107 Color_t GetAverageLineColor() const;
00108 Width_t GetAverageLineWidth() const;
00109 Color_t GetAverageFillColor() const;
00110 Style_t GetAverageFillStyle() const;
00111 Bool_t GetDisplayAverage() const {return fDisplayAverage;}
00112 Long64_t GetCurrentEntry() const {return fEntry;}
00113 Long64_t GetEntriesToProcess(Long64_t firstentry, Long64_t nentries) const;
00114 Int_t GetNx() const {return fNx;}
00115 Int_t GetNy() const {return fNy;}
00116 Bool_t GetSegmentDisplay() const {return fSegmentDisplay;}
00117 void GotoEntry(Long64_t e);
00118 void GotoNext();
00119 void GotoPrevious();
00120 void GotoFollowing();
00121 void GotoPreceding();
00122 virtual void Paint(Option_t *options);
00123 void SetAverageLineStyle(Style_t sty);
00124 void SetAverageLineColor(Color_t col);
00125 void SetAverageLineWidth(Width_t wid);
00126 void SetAverageFillColor(Color_t col);
00127 void SetAverageFillStyle(Style_t sty);
00128 virtual void SetLineStyle(Style_t sty);
00129 virtual void SetLineColor(Color_t col);
00130 virtual void SetLineWidth(Width_t wid);
00131 virtual void SetFillColor(Color_t col);
00132 virtual void SetFillStyle(Style_t sty);
00133 void SetDisplayAverage(Bool_t disp);
00134 void SetVariablesExpression(const char* varexp);
00135 void SetNdivRadial(Int_t div);
00136 void SetNx(UInt_t nx);
00137 void SetNy(UInt_t ny);
00138 void SetSelectionExpression(const char* selexp);
00139 void SetSegmentDisplay(Bool_t seg);
00140 void SetShowRange(Bool_t showrange) {fShowRange = showrange;}
00141 void SuperposeTo(TSpider* sp) {sp->AddSuperposed(this);}
00142
00143 ClassDef(TSpider,0)
00144 };
00145
00146 #endif