Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion hist/hist/inc/TF2.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ class TF2 : public TF1 {

public:
TF2();
TF2(const char *name, const char *formula, Double_t xmin=0, Double_t xmax=1, Double_t ymin=0, Double_t ymax=1, Option_t * opt = nullptr);
TF2(const char *name, const char *formula, Double_t xmin = 0, Double_t xmax = 1, Double_t ymin = 0,
Double_t ymax = 1, EAddToList addToGlobList = EAddToList::kDefault, bool vectorize = false);
TF2(const char *name, const char *formula, Double_t xmin, Double_t xmax, Double_t ymin, Double_t ymax,
Option_t *opt); // same as above but using a string for option
TF2(const char *name, Double_t xmin, Double_t xmax, Double_t ymin, Double_t ymax, Int_t npar, Int_t ndim = 2, EAddToList addToGlobList = EAddToList::kDefault);
TF2(const char *name, Double_t (*fcn)(Double_t *, Double_t *), Double_t xmin=0, Double_t xmax=1, Double_t ymin=0, Double_t ymax=1, Int_t npar=0,Int_t ndim = 2, EAddToList addToGlobList = EAddToList::kDefault);
TF2(const char *name, Double_t (*fcn)(const Double_t *, const Double_t *), Double_t xmin=0, Double_t xmax=1, Double_t ymin=0, Double_t ymax=1, Int_t npar=0, Int_t ndim = 2, EAddToList addToGlobList = EAddToList::kDefault);
Expand Down
7 changes: 5 additions & 2 deletions hist/hist/inc/TF3.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,11 @@ class TF3 : public TF2 {
Double_t fClipBox[3]; ///<! Coordinates of clipbox
public:
TF3();
TF3(const char *name, const char *formula, Double_t xmin=0, Double_t xmax=1, Double_t ymin=0,
Double_t ymax=1, Double_t zmin=0, Double_t zmax=1, Option_t * opt = nullptr);
TF3(const char *name, const char *formula, Double_t xmin = 0, Double_t xmax = 1, Double_t ymin = 0,
Double_t ymax = 1, Double_t zmin = 0, Double_t zmax = 1, EAddToList addToGlobList = EAddToList::kDefault,
bool vectorize = false);
TF3(const char *name, const char *formula, Double_t xmin, Double_t xmax, Double_t ymin, Double_t ymax, Double_t zmin,
Double_t zmax, Option_t *opt); // same as above but using a string for option
TF3(const char *name, Double_t (*fcn)(Double_t *, Double_t *), 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, Int_t ndim = 3, EAddToList addToGlobList = EAddToList::kDefault);
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,
Expand Down
2 changes: 1 addition & 1 deletion hist/hist/src/TF1.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,7 @@ TF1::TF1(const char *name, const char *formula, Double_t xmin, Double_t xmax, Op
{}

////////////////////////////////////////////////////////////////////////////////
/// F1 constructor using name of an interpreted function.
/// TF1 constructor using name of an interpreted function.
///
/// Creates a function of type C between xmin and xmax.
/// name is the name of an interpreted C++ function.
Expand Down
49 changes: 41 additions & 8 deletions hist/hist/src/TF2.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -83,18 +83,18 @@ TF2::TF2(): fYmin(0),fYmax(0),fNpy(100)
{
}


////////////////////////////////////////////////////////////////////////////////
/// F2 constructor using a formula definition
/// TF2 constructor using a formula definition and string option args
///
/// See TFormula constructor for explanation of the formula syntax.
///
/// If formula has the form "fffffff;xxxx;yyyy", it is assumed that
/// the formula string is "fffffff" and "xxxx" and "yyyy" are the
/// titles for the X and Y axis respectively.

TF2::TF2(const char *name, const char *formula, Double_t xmin, Double_t xmax, Double_t ymin, Double_t ymax, Option_t * opt)
:TF1(name, formula, xmax, xmin, opt)
TF2::TF2(const char *name, const char *formula, Double_t xmin, Double_t xmax, Double_t ymin, Double_t ymax,
Option_t *opt)
: TF1(name, formula, xmax, xmin, opt) // purposely swapped xmax, xmin to signal that TFormula may be 1D or 2D
{
if (ymin < ymax) {
fYmin = ymin;
Expand All @@ -116,9 +116,43 @@ TF2::TF2(const char *name, const char *formula, Double_t xmin, Double_t xmax, Do
}
}

////////////////////////////////////////////////////////////////////////////////
/// TF2 constructor using a formula definition and explicit option args
///
/// See TFormula constructor for explanation of the formula syntax.
///
/// If formula has the form "fffffff;xxxx;yyyy", it is assumed that
/// the formula string is "fffffff" and "xxxx" and "yyyy" are the
/// titles for the X and Y axis respectively.

TF2::TF2(const char *name, const char *formula, Double_t xmin, Double_t xmax, Double_t ymin, Double_t ymax,
EAddToList addToGlobList, bool vectorize)
: TF1(name, formula, xmax, xmin, addToGlobList,
vectorize) // purposely swapped xmax, xmin to signal that TFormula may be 1D or 2D
{
if (ymin < ymax) {
fYmin = ymin;
fYmax = ymax;
} else {
fYmin = ymax;
fYmax = ymin;
}
fNpx = 30;
fNpy = 30;
fContour.Set(0);
// accept 1-d formula
if (GetNdim() < 2)
fNdim = 2;
// dimension is obtained by TFormula
// accept cases where formula dim is less than 2
if (GetNdim() > 2 && xmin < xmax && ymin < ymax) {
Error("TF2", "function: %s/%s has dimension %d instead of 2", name, formula, GetNdim());
MakeZombie();
}
}

////////////////////////////////////////////////////////////////////////////////
/// F2 constructor using a pointer to a compiled function
/// TF2 constructor using a pointer to a compiled function
///
/// npar is the number of free parameters used by the function
///
Expand Down Expand Up @@ -147,9 +181,8 @@ TF2::TF2(const char *name, Double_t xmin, Double_t xmax, Double_t ymin, Double_t
fContour.Set(0);
}


////////////////////////////////////////////////////////////////////////////////
/// F2 constructor using a pointer to a compiled function
/// TF2 constructor using a pointer to a compiled function
///
/// npar is the number of free parameters used by the function
///
Expand All @@ -170,7 +203,7 @@ TF2::TF2(const char *name, Double_t (*fcn)(const Double_t *, const Double_t *),
}

////////////////////////////////////////////////////////////////////////////////
/// F2 constructor using a ParamFunctor,
/// TF2 constructor using a ParamFunctor,
/// a functor class implementing operator() (double *, double *)
///
/// npar is the number of free parameters used by the function
Expand Down
38 changes: 31 additions & 7 deletions hist/hist/src/TF3.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,15 @@ TF3::TF3()
fZmax = 1;
}


////////////////////////////////////////////////////////////////////////////////
/// F3 constructor using a formula definition
/// TF3 constructor using a formula definition and string option args
///
/// See TFormula constructor for explanation of the formula syntax.

TF3::TF3(const char *name,const char *formula, Double_t xmin, Double_t xmax, Double_t ymin, Double_t ymax, Double_t zmin, Double_t zmax, Option_t * opt)
:TF2(name,formula,xmin,xmax,ymax,ymin,opt)
TF3::TF3(const char *name, const char *formula, Double_t xmin, Double_t xmax, Double_t ymin, Double_t ymax,
Double_t zmin, Double_t zmax, Option_t *opt)
: TF2(name, formula, xmin, xmax, ymax, ymin,
opt) // purposely swapped ymax, ymin to signal that TFormula may be 1D or 2D or 3D
{
fZmin = zmin;
fZmax = zmax;
Expand All @@ -81,7 +82,30 @@ TF3::TF3(const char *name,const char *formula, Double_t xmin, Double_t xmax, Dou
}

////////////////////////////////////////////////////////////////////////////////
/// F3 constructor using a pointer to real function
/// TF3 constructor using a formula definition and explicit option args
///
/// See TFormula constructor for explanation of the formula syntax.

TF3::TF3(const char *name, const char *formula, Double_t xmin, Double_t xmax, Double_t ymin, Double_t ymax,
Double_t zmin, Double_t zmax, EAddToList addToGlobList, bool vectorize)
: TF2(name, formula, xmin, xmax, ymax, ymin, addToGlobList,
vectorize) // purposely swapped ymax, ymin to signal that TFormula may be 1D or 2D or 3D
{
fZmin = zmin;
fZmax = zmax;
fNpz = 30;
Int_t ndim = GetNdim();
// accept 1-d or 2-d formula
if (ndim < 3)
fNdim = 3;
if (ndim > 3 && xmin < xmax && ymin < ymax && zmin < zmax) {
Error("TF3", "function: %s/%s has dimension %d instead of 3", name, formula, ndim);
MakeZombie();
}
}

////////////////////////////////////////////////////////////////////////////////
/// TF3 constructor using a pointer to real function
///
/// \param[in] name object name
/// \param[in] fcn pointer to real function
Expand All @@ -108,7 +132,7 @@ TF3::TF3(const char *name,Double_t (*fcn)(Double_t *, Double_t *), Double_t xmin
}

////////////////////////////////////////////////////////////////////////////////
/// F3 constructor using a pointer to real function---
/// TF3 constructor using a pointer to real function---
///
/// \param[in] name object name
/// \param[in] fcn pointer to real function
Expand All @@ -135,7 +159,7 @@ TF3::TF3(const char *name,Double_t (*fcn)(const Double_t *, const Double_t *), D
}

////////////////////////////////////////////////////////////////////////////////
/// F3 constructor using a ParamFunctor
/// TF3 constructor using a ParamFunctor
///
/// a functor class implementing operator() (double *, double *)
///
Expand Down
Loading