TF2


class description - source file - inheritance tree

class TF2 : public TF1


    public:
TF2 TF2() TF2 TF2(char* name, char* formula, Float_t xmin = 0, Float_t xmax = 1, Float_t ymin = 0, Float_t ymax = 1) TF2 TF2(char* name, void* fcn, Float_t xmin = 0, Float_t xmax = 1, Float_t ymin = 0, Float_t ymax = 1, Int_t npar = 0) TF2 TF2(char* name, Double_t (*)(Double_t*, Double_t*) fcn, Float_t xmin = 0, Float_t xmax = 1, Float_t ymin = 0, Float_t ymax = 1, Int_t npar = 0) TF2 TF2(TF2& f2) virtual void ~TF2() TClass* Class() virtual void Copy(TObject& f2) virtual Int_t DistancetoPrimitive(Int_t px, Int_t py) virtual void Draw(Option_t* option) virtual TF1* DrawCopy(Option_t* option) virtual void DrawF2(char* formula, Float_t xmin, Float_t xmax, Float_t ymin, Float_t ymax, Option_t* option) virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py) virtual Int_t GetContour(Float_t* levels = 0) virtual Float_t GetContourLevel(Int_t level) Int_t GetNpy() virtual Text_t* GetObjectInfo(Int_t px, Int_t py) virtual Double_t GetRandom() virtual void GetRandom2(Float_t& xrandom, Float_t& yrandom) virtual void GetRange(Float_t& xmin, Float_t& xmax) virtual void GetRange(Float_t& xmin, Float_t& ymin, Float_t& xmax, Float_t& ymax) virtual void GetRange(Float_t& xmin, Float_t& ymin, Float_t& zmin, Float_t& xmax, Float_t& ymax, Float_t& zmax) virtual Float_t GetYmax() virtual Float_t GetYmin() virtual Double_t Integral(Float_t a, Float_t b, Double_t* params = 0, Float_t epsil = 0.000001) virtual Double_t Integral(Float_t ax, Float_t bx, Float_t ay, Float_t by, Float_t epsil = 0.000001) virtual Double_t Integral(Float_t ax, Float_t bx, Float_t ay, Float_t by, Float_t az, Float_t bz, Float_t epsil = 0.000001) virtual TClass* IsA() virtual void Paint(Option_t* option) virtual void SetContour(Int_t nlevels = 20, Float_t* levels = 0) virtual void SetContourLevel(Int_t level, Float_t value) virtual void SetNpy(Int_t npy = 100) virtual void SetRange(Float_t xmin, Float_t xmax) virtual void SetRange(Float_t xmin, Float_t ymin, Float_t xmax, Float_t ymax) virtual void SetRange(Float_t xmin, Float_t ymin, Float_t zmin, Float_t xmax, Float_t ymax, Float_t zmax) virtual void ShowMembers(TMemberInspector& insp, char* parent) virtual void Streamer(TBuffer& b)

Data Members

protected:
Float_t fYmin Lower bound for the range in y Float_t fYmax Upper bound for the range in y Int_t fNpy Number of points along y used for the graphical representation TArrayF fContour Array to display contour levels


See also

TF3

Class Description

 a 2-Dim function with parameters
 TF2 graphics function is via the TH1 drawing functions.

      Example of a function

   TF2 *f2 = new TF2("f2","sin(x)*sin(y)/(x*y)",0,5,0,5);
   f2->Draw();

/*

*/


      See TF1 class for the list of functions formats


TF2(): TF1()
*-*-*-*-*-*-*-*-*-*-*F2 default constructor*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
*-*                  ======================

TF2(const char *name,const char *formula, Float_t xmin, Float_t xmax, Float_t ymin, Float_t ymax) :TF1(name,formula,xmin,xmax)
*-*-*-*-*-*-*F2 constructor using a formula definition*-*-*-*-*-*-*-*-*-*-*
*-*          =========================================
*-*
*-*  See TFormula constructor for explanation of the formula syntax.
*-*
*-*
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

TF2(const char *name, void *fcn, Float_t xmin, Float_t xmax, Float_t ymin, Float_t ymax, Int_t npar) : TF1(name, fcn, xmin, xmax, npar)
*-*-*-*-*-*-*F2 constructor using a pointer to an interpreted function*-*-*
*-*          =========================================================
*-*
*-*   npar is the number of free parameters used by the function
*-*
*-*  Creates a function of type C between xmin and xmax and ymin,ymax.
*-*  The function is defined with npar parameters
*-*  fcn must be a function of type:
*-*     Double_t fcn(Double_t *x, Double_t *params)
*-*
*-*  This constructor is called for functions of type C by CINT.
*-*
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

TF2(const char *name, Double_t (*fcn)(Double_t *, Double_t *), Float_t xmin, Float_t xmax, Float_t ymin, Float_t ymax, Int_t npar) : TF1(name, fcn, xmin, xmax, npar)
*-*-*-*-*-*-*F2 constructor using a pointer to a compiled function*-*-*-*-*
*-*          =====================================================
*-*
*-*   npar is the number of free parameters used by the function
*-*
*-*   This constructor creates a function of type C when invoked
*-*   with the normal C++ compiler.
*-*
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

~TF2()
*-*-*-*-*-*-*-*-*-*-*F2 default destructor*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
*-*                  =====================

TF2(const TF2 &f2)

void Copy(TObject &obj)
*-*-*-*-*-*-*-*-*-*-*Copy this F2 to a new F2*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
*-*                  ========================

Int_t DistancetoPrimitive(Int_t px, Int_t py)
*-*-*-*-*-*-*-*-*-*-*Compute distance from point px,py to a function*-*-*-*-*
*-*                  ===============================================
*-*  Compute the closest distance of approach from point px,py to this function.
*-*  The distance is computed in pixels units.
*-*
*-*  Algorithm:
*-*
*-*
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

void Draw(Option_t *option)
*-*-*-*-*-*-*-*-*-*-*Draw this function with its current attributes*-*-*-*-*
*-*                  ==============================================
*-* NB. You must use DrawCopy if you want to draw several times the same
*-*     function in the current canvas.
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

TF1* DrawCopy(Option_t *option)
*-*-*-*-*-*-*-*Draw a copy of this function with its current attributes*-*-*
*-*            ========================================================
*-*
*-*  This function MUST be used instead of Draw when you want to draw
*-*  the same function with different parameters settings in the same canvas.
*-*
*-* Possible option values are:
*-*   "SAME"  superimpose on top of existing picture
*-*   "L"     connect all computed points with a straight line
*-*   "C"     connect all computed points with a smooth curve.
*-*
*-* Note that the default value is "F". Therefore to draw on top
*-* of an existing picture, specify option "SL"
*-*
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

void DrawF2(const char *formula, Float_t xmin, Float_t ymin, Float_t xmax, Float_t ymax, Option_t *option)
*-*-*-*-*-*-*-*-*-*Draw formula between xmin,ymin and xmax,ymax*-*-*-*-*-*-*-*
*-*                ============================================
*-*

void ExecuteEvent(Int_t event, Int_t px, Int_t py)
*-*-*-*-*-*-*-*-*-*-*Execute action corresponding to one event*-*-*-*
*-*                  =========================================
*-*  This member function is called when a F2 is clicked with the locator
*-*
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

Int_t GetContour(Float_t *levels)
*-*-*-*-*-*-*-*Return contour values into array levels*-*-*-*-*-*-*-*-*-*
*-*            =======================================
*-*
*-*  The number of contour levels can be returned by getContourLevel
*-*
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

Float_t GetContourLevel(Int_t level)
*-*-*-*-*-*-*-*Return the number of contour levels*-*-*-*-*-*-*-*-*-*-*-*-*
*-*            ===================================

Text_t* GetObjectInfo(Int_t px, Int_t py)
   Redefines TObject::GetObjectInfo.
   Displays the function value
   corresponding to cursor position px,py


Double_t GetRandom()
*-*-*-*-*-*Return a random number following this function shape*-*-*-*-*-*-*
*-*        ====================================================
*-*

void GetRandom2(Float_t &xrandom, Float_t &yrandom)
*-*-*-*-*-*Return 2 random numbers following this function shape*-*-*-*-*-*
*-*        =====================================================
*-*
*-*   The distribution contained in this TF2 function is integrated
*-*   over the cell contents.
*-*   It is normalized to 1.
*-*   Getting the two random numbers implies:
*-*     - Generating a random number between 0 and 1 (say r1)
*-*     - Look in which cell in the normalized integral r1 corresponds to
*-*     - make a linear interpolation in the returned cell
*-*

void GetRange(Float_t &xmin, Float_t &ymin, Float_t &xmax, Float_t &ymax)
*-*-*-*-*-*-*-*-*-*-*Return range of a 2-D function*-*-*-*-*-*-*-*-*-*-*-*-*
*-*                  ==============================

void GetRange(Float_t &xmin, Float_t &ymin, Float_t &zmin, Float_t &xmax, Float_t &ymax, Float_t &zmax)
*-*-*-*-*-*-*-*-*-*-*Return range of function*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
*-*                  ========================

Double_t Integral(Float_t ax, Float_t bx, Float_t ay, Float_t by, Float_t epsilon)
 Return Integral of a 2d function in range [ax,bx],[ay,by]


void Paint(Option_t *option)
*-*-*-*-*-*-*-*-*Paint this 2-D function with its current attributes*-*-*-*-*
*-*              ===================================================

void SetContour(Int_t nlevels, Float_t *levels)
*-*-*-*-*-*-*-*Set the number and values of contour levels*-*-*-*-*-*-*-*-*
*-*            ===========================================

  By default the number of contour levels is set to 20.

  if argument levels = 0 or missing, equidistant contours are computed


void SetContourLevel(Int_t level, Float_t value)
*-*-*-*-*-*-*-*-*-*-*Set value for one contour level*-*-*-*-*-*-*-*-*-*-*-*
*-*                  ===============================

void SetNpy(Int_t npy)
*-*-*-*-*-*-*-*Set the number of points used to draw the function*-*-*-*-*-*
*-*            ==================================================

void SetRange(Float_t xmin, Float_t ymin, Float_t xmax, Float_t ymax)
*-*-*-*-*-*Initialize the upper and lower bounds to draw the function*-*-*-*
*-*        ==========================================================

void Streamer(TBuffer &R__b)
 Stream an object of class TF2.



Inline Functions


              Int_t GetNpy()
               void GetRange(Float_t& xmin, Float_t& ymin, Float_t& zmin, Float_t& xmax, Float_t& ymax, Float_t& zmax)
            Float_t GetYmin()
            Float_t GetYmax()
           Double_t Integral(Float_t ax, Float_t bx, Float_t ay, Float_t by, Float_t epsil = 0.000001)
           Double_t Integral(Float_t ax, Float_t bx, Float_t ay, Float_t by, Float_t az, Float_t bz, Float_t epsil = 0.000001)
               void SetRange(Float_t xmin, Float_t ymin, Float_t xmax, Float_t ymax)
               void SetRange(Float_t xmin, Float_t ymin, Float_t zmin, Float_t xmax, Float_t ymax, Float_t zmax)
            TClass* Class()
            TClass* IsA()
               void ShowMembers(TMemberInspector& insp, char* parent)


Author: Rene Brun 23/08/95
Last update: 2.22/10 25/07/99 21.42.21 by Rene Brun
Copyright (c) 1995-1999, The ROOT System, All rights reserved. *


ROOT page - Class index - Top of the page

This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.