00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef ROOT_TGraph2D
00013 #define ROOT_TGraph2D
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef ROOT_TNamed
00025 #include "TNamed.h"
00026 #endif
00027 #ifndef ROOT_TVirtualHistPainter
00028 #include "TVirtualHistPainter.h"
00029 #endif
00030 #ifndef ROOT_TAttLine
00031 #include "TAttLine.h"
00032 #endif
00033 #ifndef ROOT_TAttFill
00034 #include "TAttFill.h"
00035 #endif
00036 #ifndef ROOT_TAttMarker
00037 #include "TAttMarker.h"
00038 #endif
00039
00040 class TAxis;
00041 class TList;
00042 class TF2;
00043 class TH2;
00044 class TH2D;
00045 class TView;
00046 class TDirectory;
00047
00048 #include "TFitResultPtr.h"
00049
00050 class TGraph2D : public TNamed, public TAttLine, public TAttFill, public TAttMarker {
00051
00052 protected:
00053
00054 Int_t fNpoints;
00055 Int_t fNpx;
00056 Int_t fNpy;
00057 Int_t fMaxIter;
00058 Int_t fSize;
00059 Double_t *fX;
00060 Double_t *fY;
00061 Double_t *fZ;
00062 Double_t fMinimum;
00063 Double_t fMaximum;
00064 Double_t fMargin;
00065 Double_t fZout;
00066 TList *fFunctions;
00067 TH2D *fHistogram;
00068 TDirectory *fDirectory;
00069 TVirtualHistPainter *fPainter;
00070
00071 void Build(Int_t n);
00072
00073 private:
00074
00075 Bool_t fUserHisto;
00076
00077 protected:
00078
00079 public:
00080
00081 TGraph2D();
00082 TGraph2D(Int_t n);
00083 TGraph2D(Int_t n, Int_t *x, Int_t *y, Int_t *z);
00084 TGraph2D(Int_t n, Float_t *x, Float_t *y, Float_t *z);
00085 TGraph2D(Int_t n, Double_t *x, Double_t *y, Double_t *z);
00086 TGraph2D(TH2 *h2);
00087 TGraph2D(const char *name, const char *title, Int_t n, Double_t *x, Double_t *y, Double_t *z);
00088 TGraph2D(const char *filename, const char *format="%lg %lg %lg", Option_t *option="");
00089 TGraph2D(const TGraph2D &);
00090
00091 virtual ~TGraph2D();
00092
00093 TGraph2D& operator=(const TGraph2D &);
00094
00095 virtual void Clear(Option_t *option="");
00096 virtual void DirectoryAutoAdd(TDirectory *);
00097 Int_t DistancetoPrimitive(Int_t px, Int_t py);
00098 virtual void Draw(Option_t *option="");
00099 void ExecuteEvent(Int_t event, Int_t px, Int_t py);
00100 virtual TObject *FindObject(const char *name) const;
00101 virtual TObject *FindObject(const TObject *obj) const;
00102 virtual TFitResultPtr Fit(const char *formula ,Option_t *option="" ,Option_t *goption="");
00103 virtual TFitResultPtr Fit(TF2 *f2 ,Option_t *option="" ,Option_t *goption="");
00104 virtual void FitPanel();
00105 TList *GetContourList(Double_t contour);
00106 TDirectory *GetDirectory() const {return fDirectory;}
00107 Int_t GetNpx() const {return fNpx;}
00108 Int_t GetNpy() const {return fNpy;}
00109 TH2D *GetHistogram(Option_t *option="");
00110 TList *GetListOfFunctions() const { return fFunctions; }
00111 virtual Double_t GetErrorX(Int_t bin) const;
00112 virtual Double_t GetErrorY(Int_t bin) const;
00113 virtual Double_t GetErrorZ(Int_t bin) const;
00114 Double_t GetMargin() const {return fMargin;}
00115 TAxis *GetXaxis() const ;
00116 TAxis *GetYaxis() const ;
00117 TAxis *GetZaxis() const ;
00118 Int_t GetN() const {return fNpoints;}
00119 Double_t *GetX() const {return fX;}
00120 Double_t *GetY() const {return fY;}
00121 Double_t *GetZ() const {return fZ;}
00122 virtual Double_t *GetEX() const {return 0;}
00123 virtual Double_t *GetEY() const {return 0;}
00124 virtual Double_t *GetEZ() const {return 0;}
00125 Double_t GetXmax() const;
00126 Double_t GetXmin() const;
00127 Double_t GetYmax() const;
00128 Double_t GetYmin() const;
00129 Double_t GetZmax() const;
00130 Double_t GetZmin() const;
00131 virtual Double_t GetXmaxE() const {return GetXmax();};
00132 virtual Double_t GetXminE() const {return GetXmin();};
00133 virtual Double_t GetYmaxE() const {return GetYmax();};
00134 virtual Double_t GetYminE() const {return GetYmin();};
00135 virtual Double_t GetZmaxE() const {return GetZmax();};
00136 virtual Double_t GetZminE() const {return GetZmin();};
00137 Double_t Interpolate(Double_t x, Double_t y);
00138 void Paint(Option_t *option="");
00139 TH1 *Project(Option_t *option="x") const;
00140 Int_t RemovePoint(Int_t ipoint);
00141 virtual void SavePrimitive(ostream &out, Option_t *option = "");
00142 virtual void Set(Int_t n);
00143 virtual void SetDirectory(TDirectory *dir);
00144 virtual void SetHistogram(TH2 *h);
00145 void SetMargin(Double_t m=0.1);
00146 void SetMarginBinsContent(Double_t z=0.);
00147 void SetMaximum(Double_t maximum=-1111);
00148 void SetMinimum(Double_t minimum=-1111);
00149 void SetMaxIter(Int_t n=100000) {fMaxIter = n;}
00150 virtual void SetName(const char *name);
00151 virtual void SetNameTitle(const char *name, const char *title);
00152 void SetNpx(Int_t npx=40);
00153 void SetNpy(Int_t npx=40);
00154 virtual void SetPoint(Int_t point, Double_t x, Double_t y, Double_t z);
00155 virtual void SetTitle(const char *title="");
00156
00157 ClassDef(TGraph2D,1)
00158 };
00159
00160 #endif