58 if (ndim < 3)
fNdim = 3;
60 Error(
"TF3",
"function: %s/%s has dimension %d instead of 3",
name,formula,ndim);
84TF3::TF3(
const char *
name,
Double_t (*
fcn)(
Double_t *,
Double_t *),
Double_t xmin,
Double_t xmax,
Double_t ymin,
Double_t ymax,
Double_t zmin,
Double_t zmax,
Int_t npar,
Int_t ndim)
111TF3::TF3(
const char *
name,
Double_t (*
fcn)(
const Double_t *,
const Double_t *),
Double_t xmin,
Double_t xmax,
Double_t ymin,
Double_t ymax,
Double_t zmin,
Double_t zmax,
Int_t npar,
Int_t ndim)
148 rhs.TF3::Copy(*
this);
236 TF3 & function =
const_cast<TF3&
>(*this);
274 if (
x) {
x[0] =
xx[0];
x[1] =
xx[1];
x[2] =
xx[2];}
300 double xx[3] = { 0,0,0 };
316 double xx[3] = { 0,0,0 };
360 for (k=0;k<
fNpz;k++) {
364 for (i=0;i<
fNpx;i++) {
377 Error(
"GetRandom3",
"Integral of function is zero");
417 if (
fSave.size() < 9)
return 0;
431 if (
dx <= 0)
return 0;
435 if (
dy <= 0)
return 0;
439 if (
dz <= 0)
return 0;
483 Warning(
"Integral",
"failed for %s code=%d, maxpts=%d, epsrel=%g, nfnevl=%d, relerr=%g ",
GetName(),
ifail,
maxpts,
epsrel,
nfnevl,
relerr);
510 h->SetDirectory(
nullptr);
584 for (
Int_t k = 0,
l = 0; k <=
npz; k++) {
626 out<<
" "<<
f3Name.Data()<<
"->SetFillColor(ci);" << std::endl;
632 out<<
" "<<
f3Name.Data()<<
"->SetLineColor(ci);" << std::endl;
638 out<<
" "<<
f3Name.Data()<<
"->SetNpx("<<
GetNpx()<<
");"<<std::endl;
640 out<<
" "<<
f3Name.Data()<<
"->SetNpy("<<
GetNpy()<<
");"<<std::endl;
642 out<<
" "<<
f3Name.Data()<<
"->SetNpz("<<
GetNpz()<<
");"<<std::endl;
650 out<<
" "<<
f3Name.Data()<<
"->SetParError("<<i<<
","<<
GetParError(i)<<
");"<<std::endl;
652 out<<
" "<<
f3Name.Data()<<
"->SetParLimits("<<i<<
","<<
parmin<<
","<<
parmax<<
");"<<std::endl;
659 out<<
" "<<
f3Name.Data()<<
"->Draw("
687 Warning(
"SetNpz",
"Number of points must be >=4 && <= 10000, fNpz set to 4");
689 }
else if(
npz > 10000) {
690 Warning(
"SetNpz",
"Number of points must be >=4 && <= 10000, fNpz set to 10000");
717 if (
R__b.IsReading()) {
743 Error(
"Moment3",
"Integral zero over range");
748 auto integrand = [&](
double *
x,
double *) {
749 return std::pow(
x[0],
nx) * std::pow(
x[1],
ny) * std::pow(
x[2],
nz) * this->
EvalPar(x,
nullptr);
768 Error(
"CentralMoment3",
"Integral zero over range");
801 auto integrand = [&](
double *
x,
double *) {
802 double xxx = (
nx != 0) ? std::pow(
x[0] -
xbar,
nx) : 1.;
803 double yyy = (
ny != 0) ? std::pow(
x[1] -
ybar,
ny) : 1.;
804 double zzz = (
nz != 0) ? std::pow(
x[2] -
zbar,
nz) : 1.;
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t r
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t result
R__EXTERN TRandom * gRandom
static unsigned int DefaultNCalls()
Param Functor class for Multidimensional functions.
virtual Color_t GetFillColor() const
Return the fill area color.
virtual Color_t GetLineColor() const
Return the line color.
void SaveAttributes(std::ostream &out, const char *name, const char *subname) override
Save axis attributes as C++ statement(s) on output stream out.
Buffer base class used for serializing objects.
static Bool_t SaveColor(std::ostream &out, Int_t ci)
Save a color with index > 228 as a C++ statement(s) on output stream out.
Int_t fNdim
Function dimension.
virtual void GetParLimits(Int_t ipar, Double_t &parmin, Double_t &parmax) const
Return limits for parameter ipar.
TAxis * GetYaxis() const
Get y axis of the function.
virtual Double_t GetParError(Int_t ipar) const
Return value of parameter number ipar.
Double_t GetChisquare() const
Return the Chisquare after fitting. See ROOT::Fit::FitResult::Chi2()
Double_t fXmin
Lower bounds for the range.
std::unique_ptr< TMethodCall > fMethodCall
! Pointer to MethodCall in case of interpreted function
virtual void Update()
Called by functions such as SetRange, SetNpx, SetParameters to force the deletion of the associated h...
TAxis * GetZaxis() const
Get z axis of the function. (In case this object is a TF2 or TF3)
virtual Int_t GetNpar() const
TH1 * fHistogram
! Pointer to histogram used for visualisation
virtual Double_t * GetParameters() const
virtual void InitArgs(const Double_t *x, const Double_t *params)
Initialize parameters addresses.
virtual Double_t IntegralMultiple(Int_t n, const Double_t *a, const Double_t *b, Int_t maxpts, Double_t epsrel, Double_t epsabs, Double_t &relerr, Int_t &nfnevl, Int_t &ifail)
This function computes, to an attempted specified accuracy, the value of the integral.
Int_t DistancetoPrimitive(Int_t px, Int_t py) override
Compute distance from point px,py to a function.
virtual Double_t EvalPar(const Double_t *x, const Double_t *params=nullptr)
Evaluate function with given coordinates and parameters.
Int_t fNpx
Number of points used for the graphical representation.
void ExecuteEvent(Int_t event, Int_t px, Int_t py) override
Execute action corresponding to one event.
std::vector< Double_t > fSave
Array of fNsave function values.
virtual Double_t GetMinMaxNDim(Double_t *x, Bool_t findmax, Double_t epsilon=0, Int_t maxiter=0) const
Find the minimum of a function of whatever dimension.
std::vector< Double_t > fIntegral
! Integral of function binned on fNpx bins
@ kFormula
Formula functions which can be stored,.
virtual Int_t GetNpx() const
Double_t fXmax
Upper bounds for the range.
virtual Int_t GetNdim() const
virtual Double_t GetParameter(Int_t ipar) const
TAxis * GetXaxis() const
Get x axis of the function.
A 2-Dim function with parameters.
void Copy(TObject &f2) const override
Copy this F2 to a new F2.
Int_t fNpy
Number of points along y used for the graphical representation.
Double_t fYmax
Upper bound for the range in y.
Double_t fYmin
Lower bound for the range in y.
A 3-Dim function with parameters.
void GetRange(Double_t &xmin, Double_t &xmax) const override
Return range of a 1-D function.
TF3()
F3 default constructor.
void Paint(Option_t *option="") override
Paint this 3-D function with its current attributes.
virtual void GetRandom3(Double_t &xrandom, Double_t &yrandom, Double_t &zrandom, TRandom *rng=nullptr)
Return 3 random numbers following this function shape.
Bool_t IsInside(const Double_t *x) const override
Return kTRUE is the point is inside the function range.
void ExecuteEvent(Int_t event, Int_t px, Int_t py) override
Execute action corresponding to one event.
Double_t fZmin
Lower bound for the range in z.
TF3 & operator=(const TF3 &rhs)
Operator =.
virtual void SetNpz(Int_t npz=30)
Set the number of points used to draw the function.
virtual Double_t GetMaximumXYZ(Double_t &x, Double_t &y, Double_t &z)
Compute the X, Y and Z values corresponding to the maximum value of the function on its range.
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)
Return x^nx * y^ny * z^nz central moment of a 3d function in range [ax,bx],[ay,by],...
void Copy(TObject &f3) const override
Copy this F3 to a new F3.
Double_t FindMinMax(Double_t *x, bool findmax) const override
Return minimum/maximum value of the function.
~TF3() override
F3 default destructor.
Bool_t fClipBoxOn
! Is clip box on
virtual Double_t GetMinimumXYZ(Double_t &x, Double_t &y, Double_t &z)
Compute the X, Y and Z values corresponding to the minimum value of the function on its range.
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)
Return x^nx * y^ny * z^nz moment of a 3d function in range [ax,bx],[ay,by],[az,bz].
Int_t fNpz
Number of points along z used for the graphical representation.
void Draw(Option_t *option="") override
Draw this function with its current attributes.
virtual void SetClippingBoxOn(Double_t xclip=0, Double_t yclip=0, Double_t zclip=0)
Set the function clipping box (for drawing) "on" and define the clipping box.
virtual void SetClippingBoxOff()
Set the function clipping box (for drawing) "off".
Double_t fZmax
Upper bound for the range in z.
Int_t DistancetoPrimitive(Int_t px, Int_t py) override
Compute distance from point px,py to a function.
virtual Double_t Integral(Double_t ax, Double_t bx, Double_t ay, Double_t by, Double_t az, Double_t bz, Double_t epsrel=1.e-6)
Return Integral of a 3d function in range [ax,bx],[ay,by],[az,bz] with a desired relative accuracy.
void Streamer(TBuffer &) override
Stream an object of class TF3.
TH1 * CreateHistogram() override
Create a histogram for axis range.
void Save(Double_t xmin, Double_t xmax, Double_t ymin, Double_t ymax, Double_t zmin, Double_t zmax) override
Save values of function in array fSave.
Double_t GetSave(const Double_t *x) override
Get value corresponding to X in array of fSave values.
Double_t fClipBox[3]
! Coordinates of clipbox
void SetRange(Double_t xmin, Double_t xmax) override
Initialize the upper and lower bounds to draw the function.
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save primitive as a C++ statement(s) on output stream out.
TH1 is the base class of all histogram classes in ROOT.
virtual void SetDirectory(TDirectory *dir)
By default, when a histogram is created, it is added to the list of histogram objects in the current ...
TVirtualHistPainter * GetPainter(Option_t *option="")
Return pointer to painter.
void Paint(Option_t *option="") override
Control routine to paint any kind of histograms.
3-D histogram with a float per channel (see TH1 documentation)
const char * GetName() const override
Returns name of object.
const char * GetTitle() const override
Returns title of object.
Mother of all ROOT objects.
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
virtual void AppendPad(Option_t *option="")
Append graphics object to current pad.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
This is the base class for the ROOT Random number generators.
void ToLower()
Change string to lower-case.
const char * Data() const
TString & Append(const char *cs)
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
virtual void ProcessMessage(const char *mess, const TObject *obj)=0
Short_t Max(Short_t a, Short_t b)
Returns the largest of a and b.
Double_t QuietNaN()
Returns a quiet NaN as defined by IEEE 754.
Int_t Finite(Double_t x)
Check if it is finite with a mask in order to be consistent in presence of fast math.
Short_t Min(Short_t a, Short_t b)
Returns the smallest of a and b.
Long64_t BinarySearch(Long64_t n, const T *array, T value)
Binary search in an array of n values to locate value.
Double_t Infinity()
Returns an infinity as defined by the IEEE standard.