Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
3 changes: 2 additions & 1 deletion hist/hist/inc/TF2.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ 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
4 changes: 3 additions & 1 deletion hist/hist/inc/TF3.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ class TF3 : public TF2 {
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);
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
36 changes: 34 additions & 2 deletions hist/hist/src/TF2.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,8 @@ TF2::TF2(): fYmin(0),fYmax(0),fNpy(100)
{
}


////////////////////////////////////////////////////////////////////////////////
/// F2 constructor using a formula definition
/// F2 constructor using a formula definition and string option args
///
/// See TFormula constructor for explanation of the formula syntax.
///
Expand Down Expand Up @@ -116,6 +115,39 @@ TF2::TF2(const char *name, const char *formula, Double_t xmin, Double_t xmax, Do
}
}

////////////////////////////////////////////////////////////////////////////////
/// F2 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)
{
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
Expand Down
25 changes: 23 additions & 2 deletions hist/hist/src/TF3.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,8 @@ TF3::TF3()
fZmax = 1;
}


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

Expand All @@ -80,6 +79,28 @@ TF3::TF3(const char *name,const char *formula, Double_t xmin, Double_t xmax, Dou
}
}

////////////////////////////////////////////////////////////////////////////////
/// F3 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)
{
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();
}
}

////////////////////////////////////////////////////////////////////////////////
/// F3 constructor using a pointer to real function
///
Expand Down
Loading