TF3.h

Go to the documentation of this file.
00001 // @(#)root/hist:$Id: TF3.h 29895 2009-08-25 09:35:06Z brun $
00002 // Author: Rene Brun   27/10/95
00003 
00004 /*************************************************************************
00005  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
00006  * All rights reserved.                                                  *
00007  *                                                                       *
00008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
00009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
00010  *************************************************************************/
00011 // ---------------------------------- F3.h
00012 
00013 #ifndef ROOT_TF3
00014 #define ROOT_TF3
00015 
00016 
00017 
00018 //////////////////////////////////////////////////////////////////////////
00019 //                                                                      //
00020 // TF3                                                                  //
00021 //                                                                      //
00022 // The Parametric 3-D function                                          //
00023 //                                                                      //
00024 //////////////////////////////////////////////////////////////////////////
00025 
00026 #ifndef ROOT_TF2
00027 #include "TF2.h"
00028 #endif
00029 
00030 class TF3 : public TF2 {
00031 
00032 protected:
00033    Double_t  fZmin;        //Lower bound for the range in z
00034    Double_t  fZmax;        //Upper bound for the range in z
00035    Int_t     fNpz;         //Number of points along z used for the graphical representation
00036 
00037 public:
00038    TF3();
00039    TF3(const char *name, const char *formula, Double_t xmin=0, Double_t xmax=1, Double_t ymin=0,
00040        Double_t ymax=1, Double_t zmin=0, Double_t zmax=1);
00041    TF3(const char *name, void *fcn, Double_t xmin=0, Double_t xmax=1, Double_t ymin=0,
00042        Double_t ymax=1, Double_t zmin=0, Double_t zmax=1, Int_t npar=0);
00043 #ifndef __CINT__
00044    TF3(const char *name, Double_t (*fcn)(Double_t *, Double_t *), Double_t xmin=0, Double_t xmax=1, Double_t ymin=0,
00045        Double_t ymax=1, Double_t zmin=0, Double_t zmax=1, Int_t npar=0);
00046    TF3(const char *name, Double_t (*fcn)(const Double_t *, const Double_t *), Double_t xmin=0, Double_t xmax=1, Double_t ymin=0,
00047        Double_t ymax=1, Double_t zmin=0, Double_t zmax=1, Int_t npar=0);
00048 #endif
00049 
00050    // constructor using a functor
00051    TF3(const char *name, ROOT::Math::ParamFunctor f, Double_t xmin = 0, Double_t xmax = 1, Double_t ymin = 0, Double_t ymax = 1, Double_t zmin=0, Double_t zmax=1, Int_t npar = 0);  
00052 
00053    // Template constructors from a pointer to any C++ class of type PtrObj with a specific member function of type 
00054    // MemFn. 
00055    template <class PtrObj, typename MemFn>
00056    TF3(const char *name, const  PtrObj& p, MemFn memFn, Double_t xmin, Double_t xmax, Double_t ymin, Double_t ymax, Double_t zmin, Double_t zmax, Int_t npar, const char * c1, const char * c2) : 
00057       TF2(name,p,memFn,xmin,xmax,ymin,ymax,npar,c1,c2),
00058       fZmin(zmin), fZmax(zmax), fNpz(30) 
00059    {
00060       fNdim = 3;
00061    } 
00062    // Template constructors from any  C++ callable object,  defining  the operator() (double * , double *) 
00063    // and returning a double.    
00064    template <typename Func> 
00065    TF3(const char *name, Func f, Double_t xmin, Double_t xmax, Double_t ymin, Double_t ymax, Double_t zmin, Double_t zmax, Int_t npar, const char * c1  ) : 
00066       TF2(name,f,xmin,xmax,ymin,ymax,npar,c1),
00067       fZmin(zmin), fZmax(zmax), fNpz(30) 
00068    {
00069       fNdim = 3;
00070    } 
00071 
00072    // constructor used by CINT 
00073    TF3(const char *name, void *ptr,  Double_t xmin, Double_t xmax, Double_t ymin, Double_t ymax, Double_t zmin, Double_t zmax, Int_t npar, const char *className ); 
00074    TF3(const char *name, void *ptr, void *,Double_t xmin, Double_t xmax, Double_t ymin, Double_t ymax, Double_t zmin, Double_t zmax, Int_t npar, const char *className, const char *methodName = 0);
00075 
00076    TF3(const TF3 &f3);
00077    TF3& operator=(const TF3 &rhs);
00078    virtual   ~TF3();
00079    virtual void     Copy(TObject &f3) const;
00080    virtual Int_t    DistancetoPrimitive(Int_t px, Int_t py);
00081    virtual void     Draw(Option_t *option="");
00082    virtual TObject *DrawDerivative(Option_t * ="al") {return 0;}
00083    virtual TObject *DrawIntegral(Option_t * ="al")   {return 0;}
00084    virtual void     ExecuteEvent(Int_t event, Int_t px, Int_t py);
00085    virtual void     GetMinimumXYZ(Double_t &x, Double_t &y, Double_t &z);
00086           Int_t     GetNpz() const {return fNpz;}
00087    virtual void     GetRandom3(Double_t &xrandom, Double_t &yrandom, Double_t &zrandom);
00088    virtual void     GetRange(Double_t &xmin, Double_t &xmax) const;
00089    virtual void     GetRange(Double_t &xmin, Double_t &ymin, Double_t &xmax, Double_t &ymax) const ;
00090    virtual void     GetRange(Double_t &xmin, Double_t &ymin, Double_t &zmin, Double_t &xmax, Double_t &ymax, Double_t &zmax) const;
00091    virtual Double_t GetSave(const Double_t *x);
00092    virtual Double_t GetZmin() const {return fZmin;}
00093    virtual Double_t GetZmax() const {return fZmax;}
00094    virtual Double_t Integral(Double_t a, Double_t b, const Double_t *params=0, Double_t epsilon=0.000001) {return TF1::Integral(a,b,params,epsilon);}
00095    virtual Double_t Integral(Double_t ax, Double_t bx, Double_t ay, Double_t by, Double_t epsilon=0.000001) {return TF1::Integral(ax,bx,ay,by,epsilon);}
00096    virtual Double_t Integral(Double_t ax, Double_t bx, Double_t ay, Double_t by, Double_t az, Double_t bz, Double_t epsilon=0.000001);
00097    virtual Bool_t   IsInside(const Double_t *x) const;
00098    virtual TH1     *CreateHistogram();
00099    virtual void     Paint(Option_t *option="");
00100    virtual void     Save(Double_t xmin, Double_t xmax, Double_t ymin, Double_t ymax, Double_t zmin, Double_t zmax);
00101    virtual void     SavePrimitive(ostream &out, Option_t *option = "");
00102    virtual void     SetClippingBoxOff(); // *MENU*
00103    virtual void     SetClippingBoxOn(Double_t xclip=0, Double_t yclip=0, Double_t zclip=0); // *MENU*
00104    virtual void     SetNpz(Int_t npz=30);
00105    virtual void     SetRange(Double_t xmin, Double_t xmax);
00106    virtual void     SetRange(Double_t xmin, Double_t ymin, Double_t xmax, Double_t ymax);
00107    virtual void     SetRange(Double_t xmin, Double_t ymin, Double_t zmin, Double_t xmax, Double_t ymax, Double_t zmax); // *MENU*
00108 
00109    //Moments
00110    virtual Double_t Moment3(Double_t nx, Double_t ax, Double_t bx, Double_t ny, Double_t ay, Double_t by, Double_t nz, Double_t az, Double_t bz, Double_t epsilon=0.000001);
00111    virtual Double_t CentralMoment3(Double_t nx, Double_t ax, Double_t bx, Double_t ny, Double_t ay, Double_t by, Double_t nz, Double_t az, Double_t bz, Double_t epsilon=0.000001);
00112 
00113    virtual Double_t Mean3X(Double_t ax, Double_t bx, Double_t ay, Double_t by, Double_t az, Double_t bz, Double_t epsilon=0.000001) {return Moment3(1,ax,bx,0,ay,by,0,az,bz,epsilon);}
00114    virtual Double_t Mean3Y(Double_t ax, Double_t bx, Double_t ay, Double_t by, Double_t az, Double_t bz, Double_t epsilon=0.000001) {return Moment3(0,ax,bx,1,ay,by,0,az,bz,epsilon);}
00115    virtual Double_t Mean3Z(Double_t ax, Double_t bx, Double_t ay, Double_t by, Double_t az, Double_t bz, Double_t epsilon=0.000001) {return Moment3(0,ax,bx,0,ay,by,1,az,bz,epsilon);}
00116 
00117    virtual Double_t Variance3X(Double_t ax, Double_t bx, Double_t ay, Double_t by, Double_t az, Double_t bz, Double_t epsilon=0.000001) {return CentralMoment3(2,ax,bx,0,ay,by,0,az,bz,epsilon);}
00118    virtual Double_t Variance3Y(Double_t ax, Double_t bx, Double_t ay, Double_t by, Double_t az, Double_t bz, Double_t epsilon=0.000001) {return CentralMoment3(0,ax,bx,2,ay,by,0,az,bz,epsilon);}
00119    virtual Double_t Variance3Z(Double_t ax, Double_t bx, Double_t ay, Double_t by, Double_t az, Double_t bz, Double_t epsilon=0.000001) {return CentralMoment3(0,ax,bx,0,ay,by,2,az,bz,epsilon);}
00120 
00121    virtual Double_t Covariance3XY(Double_t ax, Double_t bx, Double_t ay, Double_t by, Double_t az, Double_t bz, Double_t epsilon=0.000001) {return CentralMoment3(1,ax,bx,1,ay,by,0,az,bz,epsilon);}
00122    virtual Double_t Covariance3XZ(Double_t ax, Double_t bx, Double_t ay, Double_t by, Double_t az, Double_t bz, Double_t epsilon=0.000001) {return CentralMoment3(1,ax,bx,0,ay,by,1,az,bz,epsilon);}
00123    virtual Double_t Covariance3YZ(Double_t ax, Double_t bx, Double_t ay, Double_t by, Double_t az, Double_t bz, Double_t epsilon=0.000001) {return CentralMoment3(0,ax,bx,1,ay,by,1,az,bz,epsilon);}
00124    
00125    ClassDef(TF3,3)  //The Parametric 3-D function
00126 };
00127 
00128 inline void TF3::GetRange(Double_t &xmin, Double_t &xmax) const
00129    { TF2::GetRange(xmin, xmax); }
00130 inline void TF3::GetRange(Double_t &xmin, Double_t &ymin, Double_t &xmax, Double_t &ymax) const
00131    { TF2::GetRange(xmin, ymin, xmax, ymax); }
00132 inline void TF3::SetRange(Double_t xmin, Double_t xmax)
00133    { TF2::SetRange(xmin, xmax); }
00134 inline void TF3::SetRange(Double_t xmin, Double_t ymin, Double_t xmax, Double_t ymax)
00135    { TF2::SetRange(xmin, ymin, xmax, ymax); }
00136 
00137 #endif

Generated on Tue Jul 5 14:22:49 2011 for ROOT_528-00b_version by  doxygen 1.5.1