90 if (!CtorAllocate())
return;
117 for (
Int_t i = 0; i <
n; i++) {
135 for (
Int_t i = 0; i <
n; i++) {
180 memcpy(
fX, gr.
fX, n);
181 memcpy(
fY, gr.
fY, n);
191 TAttLine::operator=(gr);
192 TAttFill::operator=(gr);
193 TAttMarker::operator=(gr);
223 if (
fX)
delete []
fX;
224 if (
fY)
delete []
fY;
235 memcpy(
fX, gr.
fX, n);
236 memcpy(
fY, gr.
fY, n);
256 fX[i] = vx(i + ivxlow);
257 fY[i] = vy(i + ivylow);
275 fX[i] = vx(i + ivxlow);
276 fY[i] = vy(i + ivylow);
287 Error(
"TGraph",
"Pointer to histogram is null");
300 TAxis *xaxis = ((
TH1*)h)->GetXaxis();
305 h->TAttLine::Copy(*
this);
306 h->TAttFill::Copy(*
this);
307 h->TAttMarker::Copy(*
this);
309 std::string gname =
"Graph_from_" + std::string(h->
GetName());
330 Error(
"TGraph",
"Pointer to function is null");
334 if (option) coption = *option;
335 if (coption ==
'i' || coption ==
'I')
fNpoints++;
345 if (coption ==
'i' || coption ==
'I') {
346 fX[i] = xmin + i * dx;
347 if (i == 0)
fY[i] = 0;
348 else fY[i] = integ + ((
TF1*)f)->Integral(
fX[i] - dx,
fX[i]);
350 }
else if (coption ==
'd' || coption ==
'D') {
351 fX[i] = xmin + (i + 0.5) * dx;
352 fY[i] = ((
TF1*)f)->Derivative(
fX[i]);
354 fX[i] = xmin + (i + 0.5) * dx;
355 fY[i] = ((
TF1*)f)->Eval(
fX[i]);
358 if (integ != 0 && coption ==
'I') {
359 for (i = 1; i <
fNpoints; i++)
fY[i] /= integ;
362 f->TAttLine::Copy(*
this);
363 f->TAttFill::Copy(*
this);
364 f->TAttMarker::Copy(*
this);
391 std::ifstream infile(fname.
Data());
392 if (!infile.good()) {
394 Error(
"TGraph",
"Cannot open file: %s, TGraph is Zombie", filename);
405 if (strcmp(option,
"") == 0) {
407 while (std::getline(infile, line,
'\n')) {
408 if (2 != sscanf(line.c_str(),
format, &
x, &
y)) {
428 Error(
"TGraph",
"Incorrect input format! Allowed formats are {\"%%lg\",\"%%*lg\" or \"%%*s\"}");
433 Error(
"TGraph",
"Incorrect input format! Only %d tag(s) in format whereas 2 \"%%lg\" tags are expected!", ntokens);
436 Int_t ntokensToBeSaved = 0 ;
438 for (
Int_t idx = 0; idx < ntokens; idx++) {
440 if (isTokenToBeSaved[idx] == 1) {
444 if (ntokens >= 2 && ntokensToBeSaved != 2) {
445 Error(
"TGraph",
"Incorrect input format! There are %d \"%%lg\" tag(s) in format whereas 2 and only 2 are expected!", ntokensToBeSaved);
446 delete [] isTokenToBeSaved ;
452 char * token =
NULL ;
454 Int_t token_idx = 0 ;
456 Int_t value_idx = 0 ;
459 while (std::getline(infile, line,
'\n')) {
461 if (line[line.size() - 1] == char(13)) {
462 line.erase(line.end() - 1, line.end()) ;
464 token = strtok(const_cast<char*>(line.c_str()), option) ;
465 while (token !=
NULL && value_idx < 2) {
466 if (isTokenToBeSaved[token_idx]) {
470 isLineToBeSkipped =
kTRUE ;
473 value[value_idx] = token_str.
Atof() ;
477 token = strtok(
NULL, option) ;
480 if (!isLineToBeSkipped && value_idx == 2) {
487 isLineToBeSkipped =
kFALSE ;
495 delete [] isTokenToBeSaved ;
536 for (
Int_t i = 0; i < Narrays; ++i)
539 for (
Int_t i = 0; i < Narrays; ++i)
540 newarrays[i] =
new Double_t[arraySize];
572 opt = (opt ==
"") ?
"alp" : opt.
Data();
596 Error(
"Chisquare",
"Function pointer is Null - return -1");
623 return gr->
fX[left] > gr->
fX[right];
631 return gr->
fY[left] > gr->
fY[right];
640 return gr->
fX[left] * gr->
fX[left] + gr->
fY[left] * gr->
fY[left]
641 > gr->
fX[right] * gr->
fX[right] + gr->
fY[right] * gr->
fY[right];
650 xmin = xmax = ymin = ymax = 0;
660 if (
fX[i] < xmin) xmin =
fX[i];
661 if (
fX[i] > xmax) xmax =
fX[i];
662 if (
fY[i] < ymin) ymin =
fY[i];
663 if (
fY[i] > ymax) ymax =
fY[i];
664 if (ymin>0 && (yminl==0 || ymin<yminl)) yminl =
ymin;
665 if (xmin>0 && (xminl==0 || xmin<xminl)) xminl =
xmin;
668 if (
gPad &&
gPad->GetLogy() && yminl>0) ymin = yminl;
669 if (
gPad &&
gPad->GetLogx() && xminl>0) xmin = xminl;
698 if (ibegin < 0 || iend <= ibegin || obegin < 0) {
701 if (!arrays && ibegin == obegin) {
706 memmove(&arrays[0][obegin], &
fX[ibegin], n);
707 memmove(&arrays[1][obegin], &
fY[ibegin], n);
709 memmove(&
fX[obegin], &
fX[ibegin], n);
710 memmove(&
fY[obegin], &
fY[ibegin], n);
766 if (!strlen(option)) {
768 if (!
gPad->GetListOfPrimitives()->FindObject(
"TFrame")) opt =
"alp";
775 if (!
gPad->IsEditable())
gROOT->MakeDefCanvas();
865 return spline->
Eval(x);
878 std::vector<Double_t> xsort(
fNpoints);
879 std::vector<Double_t> ysort(
fNpoints);
880 std::vector<Int_t> indxsort(
fNpoints);
883 xsort[i] =
fX[ indxsort[i] ];
884 ysort[i] =
fY[ indxsort[i] ];
888 TSpline3 s(
"", &xsort[0], &ysort[0], fNpoints);
906 if (
fX[low] == x)
return fY[low];
921 if (low == -1 ||
fX[i] >
fX[low]) {
924 }
else if (low2 == -1) low2 = i;
925 }
else if (
fX[i] > x) {
926 if (up == -1 ||
fX[i] <
fX[up]) {
929 }
else if (up2 == -1) up2 = i;
945 assert(low != -1 && up != -1);
947 if (
fX[low] ==
fX[up])
return fY[low];
988 Double_t **ps =
Allocate(step * (newsize / step + (newsize % step ? 1 : 0)));
1013 memset(
fX + begin, 0, (end - begin)*
sizeof(
Double_t));
1014 memset(
fY + begin, 0, (end - begin)*
sizeof(
Double_t));
1050 linear = (
char*) strstr(fname,
"++");
1053 f1 =
new TF1(fname, fname, xmin, xmax);
1055 f1 = (
TF1*)
gROOT->GetFunction(fname);
1057 Printf(
"Unknown function: %s", fname);
1061 return Fit(f1, option,
"", xmin, xmax);
1309 gROOT->MakeDefCanvas();
1312 Error(
"FitPanel",
"Unable to create a default canvas");
1318 if (handler && handler->
LoadPlugin() != -1) {
1320 Error(
"FitPanel",
"Unable to crate the FitPanel");
1322 Error(
"FitPanel",
"Unable to find the FitPanel plug-in");
1331 if (rms1 == 0)
return 0;
1333 if (rms2 == 0)
return 0;
1348 sumxy +=
fX[i] *
fY[i];
1350 return sumxy / sum - sumx / sum * sumy /
sum;
1358 if (axis < 1 || axis > 2)
return 0;
1362 if (axis == 1) sumx +=
fX[i];
1373 if (axis < 1 || axis > 2)
return 0;
1379 sumx2 +=
fX[i] *
fX[i];
1382 sumx2 +=
fY[i] *
fY[i];
1468 Double_t rwxmin, rwxmax, rwymin, rwymax, maximum, minimum, dx, dy;
1483 }
else if (
gPad &&
gPad->GetLogy()) {
1491 if (rwxmin == rwxmax) rwxmax += 1.;
1492 if (rwymin == rwymax) rwymax += 1.;
1493 dx = 0.1 * (rwxmax - rwxmin);
1494 dy = 0.1 * (rwymax - rwymin);
1495 uxmin = rwxmin - dx;
1496 uxmax = rwxmax + dx;
1497 minimum = rwymin - dy;
1498 maximum = rwymax + dy;
1505 if (uxmin < 0 && rwxmin >= 0) {
1506 if (
gPad &&
gPad->GetLogx()) uxmin = 0.9 * rwxmin;
1509 if (uxmax > 0 && rwxmax <= 0) {
1510 if (
gPad &&
gPad->GetLogx()) uxmax = 1.1 * rwxmax;
1513 if (minimum < 0 && rwymin >= 0) {
1514 if (
gPad &&
gPad->GetLogy()) minimum = 0.9 * rwymin;
1517 if (minimum <= 0 && gPad && gPad->GetLogy()) minimum = 0.001 * maximum;
1518 if (uxmin <= 0 && gPad && gPad->GetLogx()) {
1519 if (uxmax > 1000) uxmin = 1;
1520 else uxmin = 0.001 * uxmax;
1527 const char *gname =
GetName();
1528 if (!gname[0]) gname =
"Graph";
1576 if (i < 0 || i >=
fNpoints)
return -1;
1577 if (!
fX || !
fY)
return -1;
1608 Double_t allcha, sumx, sumx2,
x, val, rms, mean;
1618 allcha = sumx = sumx2 = 0;
1619 for (bin = 0; bin <
fNpoints; bin++) {
1621 if (x < xmin || x > xmax)
continue;
1625 sumx2 += val * x *
x;
1628 if (np == 0 || allcha == 0)
return;
1629 mean = sumx / allcha;
1632 if (rms == 0) rms = 1;
1635 f1->
SetParameter(0, binwidx * allcha / (sqrtpi * rms));
1694 for (i = 0; i <
fNpoints - 1; i++) {
1703 for (i = 0; i < fNpoints - 1; i++) {
1715 if (dpx * dpx + dpy * dpy < 25) ipoint = 0;
1724 fX[ipoint] =
gPad->PadtoX(
gPad->AbsPixeltoX(px));
1725 fY[ipoint] =
gPad->PadtoY(
gPad->AbsPixeltoY(py));
1763 if (first < 0) first = 0;
1766 if (first >= last)
return 0;
1767 Int_t np = last - first + 1;
1774 for (
Int_t i = first; i <= last; i++) {
1775 Int_t j = first + (i - first + 1) % np;
1776 sum += (
fY[i] +
fY[j]) * (
fX[j] -
fX[i]);
1813 const Int_t idim = 20;
1829 if (m > idim || m > n)
return;
1831 for (l = 2; l <=
m; ++
l) {
1833 b[m + l*20 - 21] = zero;
1839 if (xk < xmin || xk > xmax)
continue;
1844 for (l = 2; l <=
m; ++
l) {
1847 da[l-1] += power * yk;
1849 for (l = 2; l <=
m; ++
l) {
1851 b[m + l*20 - 21] += power;
1855 for (i = 3; i <=
m; ++i) {
1856 for (k = i; k <=
m; ++k) {
1857 b[k - 1 + (i-1)*20 - 21] = b[k + (i-2)*20 - 21];
1864 for (i = 1; i <
m; ++i) a[i] = 0;
1867 for (i = 0; i <
m; ++i) a[i] = da[i];
1897 xbar = ybar = x2bar = xybar = 0;
1901 if (xk < xmin || xk > xmax)
continue;
1905 if (yk <= 0) yk = 1
e-9;
1914 det = fn * x2bar - xbar * xbar;
1917 if (fn > 0) a0 = ybar / fn;
1923 a0 = (x2bar * ybar - xbar * xybar) / det;
1924 a1 = (fn * xybar - xbar * ybar) / det;
1942 if (painter) painter->
PaintGraph(
this, npoints, x, y, chopt);
1951 if (painter) painter->
PaintGrapHist(
this, npoints, x, y, chopt);
1969 printf(
"x[%d]=%g, y[%d]=%g\n", i,
fX[i], i,
fY[i]);
1999 if (dpx * dpx + dpy * dpy < 100) {
2012 if (ipoint < 0)
return -1;
2027 out <<
" " << std::endl;
2028 static Int_t frameNumber = 0;
2035 out <<
" Double_t " << fXName <<
"[" <<
fNpoints <<
"] = {" << std::endl;
2036 for (i = 0; i <
fNpoints-1; i++) out <<
" " <<
fX[i] <<
"," << std::endl;
2037 out <<
" " <<
fX[fNpoints-1] <<
"};" << std::endl;
2038 out <<
" Double_t " << fYName <<
"[" << fNpoints <<
"] = {" << std::endl;
2039 for (i = 0; i < fNpoints-1; i++) out <<
" " <<
fY[i] <<
"," << std::endl;
2040 out <<
" " <<
fY[fNpoints-1] <<
"};" << std::endl;
2042 else out <<
" TGraph *";
2043 out <<
"graph = new TGraph(" << fNpoints <<
"," << fXName <<
"," << fYName <<
");" << std::endl;
2046 else out <<
" TGraph *";
2047 out <<
"graph = new TGraph();" << std::endl;
2050 out <<
" graph->SetName(" << quote <<
GetName() << quote <<
");" << std::endl;
2051 out <<
" graph->SetTitle(" << quote <<
GetTitle() << quote <<
");" << std::endl;
2059 hname += frameNumber;
2063 out <<
" " << std::endl;
2069 while ((obj = next())) {
2072 out <<
" graph->GetListOfFunctions()->Add(ptstats);" << std::endl;
2073 out <<
" ptstats->SetParent(graph->GetListOfFunctions());" << std::endl;
2075 out <<
" graph->GetListOfFunctions()->Add(" 2076 <<
Form(
"%s%d",obj->
GetName(),frameNumber) <<
");" << std::endl;
2081 l = strstr(option,
"multigraph");
2083 out <<
" multigraph->Add(graph," << quote << l + 10 << quote <<
");" << std::endl;
2086 l = strstr(option,
"th2poly");
2088 out <<
" " << l + 7 <<
"->AddBin(graph);" << std::endl;
2091 out <<
" graph->Draw(" << quote << option << quote <<
");" << std::endl;
2226 if (greaterfunc ==
TGraph::CompareX && ascending && low == 0 && high == -1111)
2229 if (high == -1111) high =
GetN() - 1;
2231 if (high <= low)
return;
2236 while (left < right) {
2238 while (left <= high && greaterfunc(
this, left, low) != ascending)
2241 while (right > low && greaterfunc(
this, right, low) == ascending)
2243 if (left < right && left < high && right > low)
2249 Sort(greaterfunc, ascending, low, right - 1);
2250 Sort(greaterfunc, ascending, right + 1, high);
2266 while ((obj = next())) {
2276 TNamed::Streamer(b);
2277 TAttLine::Streamer(b);
2278 TAttFill::Streamer(b);
2279 TAttMarker::Streamer(b);
2335 arr[pos1] = arr[pos2];
2370 while ((obj = next())) {
2386 "Cannot merge - an object which doesn't inherit from TGraph found in the list");
2399 for (
Int_t i = 0 ; i < g->
GetN(); i++) {
2412 ,
Int_t maxiterations)
2415 static Int_t j1, it, j3, j2;
2448 if (j1 != 2)
goto L100;
2449 if (ya * Y < 0)
goto L120;
2458 if (it >= maxiterations) k = j1;
2466 if (j1 > 3)
goto L170;
2482 if (it >= maxiterations) k = j1;
2511 x2 = X - Y * (X -
x1) / (Y - y1);
2515 if ((x2 - a)*(x2 - b) < 0) {
2517 if (it >= maxiterations) k = j1;
2528 if ((x2 - a)*(x2 -
b) >= 0) {
2533 if (it >= maxiterations) k = j1;
2541 if (j1 != 4)
return;
2552 if (ytest <= 0)
goto L130;
virtual TFitResultPtr Fit(const char *formula, Option_t *option="", Option_t *goption="", Axis_t xmin=0, Axis_t xmax=0)
Fit this graph with function with name fname.
void PaintGrapHist(Int_t npoints, const Double_t *x, const Double_t *y, Option_t *chopt)
Draw the (x,y) as a histogram.
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save primitive as a C++ statement(s) on output stream out.
virtual void SetTitleOffset(Float_t offset=1)
Set distance between the axis and the axis title Offset is a correction factor with respect to the "s...
Int_t fNpoints
Current dimension of arrays fX and fY.
virtual const char * GetName() const
Returns name of object.
virtual void PaintHelper(TGraph *theGraph, Option_t *option)=0
virtual void SetLineWidth(Width_t lwidth)
Set the line width.
virtual Double_t GetErrorYhigh(Int_t bin) const
This function is called by GraphFitChisquare.
Abstract interface to a histogram painter.
static long int sum(long int i)
virtual Int_t WriteClassBuffer(const TClass *cl, void *pointer)=0
virtual Int_t GetNpx() const
virtual void FitPanel()
Display a GUI panel with all graph fit options.
virtual Double_t GetErrorY(Int_t bin) const
This function is called by GraphFitChisquare.
virtual void SetMaximum(Double_t maximum=-1111)
double Chisquare(const TH1 &h1, TF1 &f1, bool useRange, bool usePL=false)
compute the chi2 value for an histogram given a function (see TH1::Chisquare for the documentation) ...
static Bool_t CompareRadius(const TGraph *gr, Int_t left, Int_t right)
Return kTRUE if point number "left"'s distance to origin is bigger than that of point number "right"...
void UseCurrentStyle()
Copy current attributes from/to current style.
TGraph()
Graph default constructor.
TF1 * GetFunction(const char *name) const
Return pointer to function with name.
virtual void SetLimits(Double_t xmin, Double_t xmax)
virtual Double_t ** Allocate(Int_t newsize)
virtual void SetTimeFormat(const char *format="")
Change the format used for time plotting.
void PaintGraph(Int_t npoints, const Double_t *x, const Double_t *y, Option_t *chopt)
Draw the (x,y) as a graph.
virtual void DrawPanelHelper(TGraph *theGraph)=0
virtual void SetDirectory(TDirectory *dir)
By default when an histogram is created, it is added to the list of histogram objects in the current ...
virtual Float_t GetLabelOffset() const
virtual void InitPolynom(Double_t xmin=0, Double_t xmax=0)
Compute Initial values of parameters for a polynom.
TString & ReplaceAll(const TString &s1, const TString &s2)
virtual void SetMinimum(Double_t minimum=-1111)
Set the minimum of the graph.
R__EXTERN TStyle * gStyle
void SetHistLineWidth(Width_t width=1)
Bool_t TestBit(UInt_t f) const
virtual void SetName(const char *name)
Set the name of the TNamed.
THist< 1, float, THistStatContent, THistStatUncertainty > TH1F
static Bool_t CompareX(const TGraph *gr, Int_t left, Int_t right)
Return kTRUE if fX[left] > fX[right]. Can be used by Sort.
Base class for spline implementation containing the Draw/Paint methods //.
Bool_t IsFloat() const
Returns kTRUE if string contains a floating point or integer number.
virtual Double_t GetBinContent(Int_t bin) const
Return content of bin number bin.
virtual void SetNdivisions(Int_t n=510, Bool_t optim=kTRUE)
Set the number of divisions for this axis.
void H1LeastSquareSeqnd(Int_t n, Double_t *a, Int_t idim, Int_t &ifail, Int_t k, Double_t *b)
Extracted from CERN Program library routine DSEQN.
TList * GetListOfFunctions() const
TAxis * GetYaxis() const
Get y axis of the graph.
void ToUpper()
Change string to upper case.
Buffer base class used for serializing objects.
virtual void SetMinimum(Double_t minimum=-1111)
virtual Int_t CheckByteCount(UInt_t startpos, UInt_t bcnt, const TClass *clss)=0
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
Int_t LoadPlugin()
Load the plugin library for this handler.
virtual TObject * FindObject(const char *name) const
Search object named name in the list of functions.
tomato 1-D histogram with a float per channel (see TH1 documentation)}
virtual void DrawPanel()
Display a panel with all graph drawing options.
virtual void LeastSquareFit(Int_t m, Double_t *a, Double_t xmin=0, Double_t xmax=0)
Least squares polynomial fitting without weights.
virtual void SetTitleFont(Style_t font=62)
Set the title font.
Short_t Min(Short_t a, Short_t b)
void ToLower()
Change string to lower-case.
virtual Double_t GetCovariance() const
Return covariance of vectors x,y.
void Copy(TAttMarker &attmarker) const
Copy this marker attributes to a new TAttMarker.
virtual void SetFillStyle(Style_t fstyle)
Set the fill area style.
virtual void SetTitle(const char *title="")
Set graph title.
virtual void UseCurrentStyle()
Set current style settings in this object This function is called when either TCanvas::UseCurrentStyl...
virtual Float_t GetLabelSize() const
static std::string format(double x, double y, int digits, int width)
virtual void RecursiveRemove(TObject *obj)
Recursively remove object from the list of functions.
virtual Double_t Integral(Int_t first=0, Int_t last=-1) const
Integrate the TGraph data within a given (index) range.
void CenterTitle(Bool_t center=kTRUE)
Center axis title.
virtual Double_t GetErrorYlow(Int_t bin) const
This function is called by GraphFitChisquare.
virtual TObject * Clone(const char *newname="") const
Make a clone of an collection using the Streamer facility.
virtual void Apply(TF1 *f)
Apply function f to all the data points f may be a 1-D function TF1 or 2-d function TF2 The Y values ...
virtual void SetLabelOffset(Float_t offset=0.005)
Set distance between the axis and the labels The distance is expressed in per cent of the pad width...
virtual void Draw(Option_t *chopt="")
Draw this graph with its current attributes.
virtual Width_t GetLineWidth() const
Return the line width.
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
virtual TObject * FindObject(const char *name) const
Find an object in this list using its name.
Width_t GetHistLineWidth() const
if object in a list can be deleted
TString & Replace(Ssiz_t pos, Ssiz_t n, const char *s)
virtual void SetLabelFont(Style_t font=62)
Set labels' font.
virtual void AppendPad(Option_t *option="")
Append graphics object to current pad.
virtual Int_t Merge(TCollection *list)
Adds all graphs from the collection to this graph.
virtual Style_t GetMarkerStyle() const
Return the marker style.
virtual Style_t GetTitleFont() const
virtual Bool_t CopyPoints(Double_t **newarrays, Int_t ibegin, Int_t iend, Int_t obegin)
Copy points from fX and fY to arrays[0] and arrays[1] or to fX and fY if arrays == 0 and ibegin != ie...
virtual Style_t GetLineStyle() const
Return the line style.
virtual Int_t GetDimension() const
Double_t ** ShrinkAndCopy(Int_t size, Int_t iend)
if size*2 <= fMaxSize allocate new arrays of size points, copy points [0,oend).
virtual void SetParent(TObject *p=0)
static const double x2[5]
Fill Area Attributes class.
virtual void Paint(Option_t *chopt="")
Draw this graph with its current attributes.
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString...
virtual Double_t Chisquare(TF1 *f1, Option_t *option="") const
Return the chisquare of this graph with respect to f1.
TGraph & operator=(const TGraph &)
Equal operator for this graph.
void SetHistFillColor(Color_t color=1)
virtual Bool_t GetTimeDisplay() const
void Copy(TAttLine &attline) const
Copy this line attributes to a new TAttLine.
virtual void SaveLineAttributes(std::ostream &out, const char *name, Int_t coldef=1, Int_t stydef=1, Int_t widdef=1)
Save line attributes as C++ statement(s) on output stream out.
The TNamed class is the base class for all named ROOT classes.
virtual void Sort(Bool_t(*greater)(const TGraph *, Int_t, Int_t)=&TGraph::CompareX, Bool_t ascending=kTRUE, Int_t low=0, Int_t high=-1111)
Sorts the points of this TGraph using in-place quicksort (see e.g.
virtual void Print(Option_t *chopt="") const
Print graph values.
virtual void SetMaximum(Double_t maximum=-1111)
Set the maximum of the graph.
void Zero(Int_t &k, Double_t AZ, Double_t BZ, Double_t E2, Double_t &X, Double_t &Y, Int_t maxiterations)
Find zero of a continuous function.
virtual Double_t GetErrorX(Int_t bin) const
This function is called by GraphFitChisquare.
virtual Double_t GetBinCenter(Int_t bin) const
Return center of bin.
virtual Double_t Eval(Double_t x, TSpline *spline=0, Option_t *option="") const
Interpolate points in this graph at x using a TSpline -if spline==0 and option="" a linear interpolat...
virtual void SetMarkerColor(Color_t mcolor=1)
Set the marker color.
Style_t GetHistFillStyle() const
void Sort(Index n, const Element *a, Index *index, Bool_t down=kTRUE)
virtual Size_t GetMarkerSize() const
Return the marker size.
Double_t ATan2(Double_t, Double_t)
virtual void SaveMarkerAttributes(std::ostream &out, const char *name, Int_t coldef=1, Int_t stydef=1, Int_t sizdef=1)
Save line attributes as C++ statement(s) on output stream out.
Bool_t IsInside(T xp, T yp, Int_t np, T *x, T *y)
virtual Int_t RemovePoint()
Delete point close to the mouse position.
virtual const char * GetTimeFormat() const
virtual void SetTimeDisplay(Int_t value)
Bool_t GetRotateTitle() const
virtual Int_t GetNdivisions() const
virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py)
Execute action corresponding to one event.
virtual void Expand(Int_t newsize)
If array sizes <= newsize, expand storage to 2*newsize.
Bool_t CtorAllocate()
In constructors set fNpoints than call this method.
virtual void SetLineColor(Color_t lcolor)
Set the line color.
Using a TBrowser one can browse all ROOT objects.
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save primitive as a C++ statement(s) on output stream out.
virtual void SetParLimits(Int_t ipar, Double_t parmin, Double_t parmax)
Set limits for parameter ipar.
virtual Double_t GetErrorXlow(Int_t bin) const
This function is called by GraphFitChisquare.
TNamed & operator=(const TNamed &rhs)
TNamed assignment operator.
virtual Int_t GetPoint(Int_t i, Double_t &x, Double_t &y) const
Get x and y values for point number i.
virtual TObject * First() const
Return the first object in the list. Returns 0 when list is empty.
virtual void SwapPoints(Int_t pos1, Int_t pos2)
Swap points.
void SetHistFillStyle(Style_t styl=0)
const char * GetTitle() const
Returns title of object.
Class to manage histogram axis.
R__EXTERN TSystem * gSystem
if object ctor succeeded but object should not be used
virtual void SetFillColor(Color_t fcolor)
Set the fill area color.
Long_t ExecPlugin(int nargs, const T &... params)
virtual Int_t GetValue(const char *name, Int_t dflt)
Returns the integer value for a resource.
virtual TObject * Remove(TObject *obj)
Remove object from the list.
Provides an indirection to the TFitResult class and with a semantics identical to a TFitResult pointe...
static void SwapValues(Double_t *arr, Int_t pos1, Int_t pos2)
Swap values.
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
virtual Int_t DistancetoPrimitiveHelper(TGraph *theGraph, Int_t px, Int_t py)=0
Collection abstract base class.
virtual Bool_t DoMerge(const TGraph *g)
protected function to perform the merge operation of a graph
virtual void SaveFillAttributes(std::ostream &out, const char *name, Int_t coldef=1, Int_t stydef=1001)
Save fill attributes as C++ statement(s) on output stream out.
virtual Float_t GetTitleOffset() const
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
char * Form(const char *fmt,...)
virtual Int_t InsertPoint()
Insert a new point at the mouse position.
static TVirtualFitter * GetFitter()
static: return the current Fitter
virtual void SetMarkerStyle(Style_t mstyle=1)
Set the marker style.
virtual Double_t Eval(Double_t x) const =0
Bool_t GetEditable() const
Return kTRUE if kNotEditable bit is not set, kFALSE otherwise.
virtual Double_t GetXmin() const
virtual Double_t GetRMS(Int_t axis=1) const
Return RMS of X (axis=1) or Y (axis=2)
virtual void ReadFastArray(Bool_t *b, Int_t n)=0
virtual void SetLabelSize(Float_t size=0.04)
Set size of axis labels The size is expressed in per cent of the pad width.
virtual void SetMarkerSize(Size_t msize=1)
Set the marker size.
virtual void SetTitleSize(Float_t size=0.04)
Set size of axis title The size is expressed in per cent of the pad width.
TAxis * GetXaxis() const
Get x axis of the graph.
virtual Color_t GetLineColor() const
Return the line color.
virtual void SetName(const char *name)
Change the name of this histogram.
virtual Int_t ReadClassBuffer(const TClass *cl, void *pointer, const TClass *onfile_class=0)=0
virtual void InitGaus(Double_t xmin=0, Double_t xmax=0)
Compute Initial values of parameters for a gaussian.
Color_t GetHistFillColor() const
virtual Double_t Eval(Double_t x, Double_t y=0, Double_t z=0, Double_t t=0) const
Evaluate this function.
virtual Double_t GetMean(Int_t axis=1) const
Return mean value of X (axis=1) or Y (axis=2)
virtual Bool_t IsEmpty() const
void SetNoExponent(Bool_t noExponent=kTRUE)
Set the NoExponent flag By default, an exponent of the form 10^N is used when the label value are eit...
static const double x1[5]
static TVirtualGraphPainter * GetPainter()
Static function returning a pointer to the current graph painter.
class describing the range in the coordinates it supports multiple range in a coordinate.
TH1F * GetHistogram() const
Returns a pointer to the histogram used to draw the axis Takes into account the two following cases...
void SetHistLineStyle(Style_t styl=0)
Bool_t GetCenterTitle() const
virtual void PaintStats(TF1 *fit)
Draw the stats.
Color_t GetHistLineColor() const
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
Compute distance from point px,py to a graph.
double func(double *x, double *p)
virtual Color_t GetFillColor() const
Return the fill area color.
virtual Double_t GetXmax() const
Int_t DistancetoLine(Int_t px, Int_t py, Double_t xp1, Double_t yp1, Double_t xp2, Double_t yp2)
Compute distance from point px,py to a line.
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
you should not use this method at all Int_t Int_t Double_t Double_t Double_t e
virtual ~TGraph()
Graph default destructor.
virtual Float_t GetTitleSize() const
virtual void SetLineStyle(Style_t lstyle)
Set the line style.
Double_t ** ExpandAndCopy(Int_t size, Int_t iend)
if size > fMaxSize allocate new arrays of 2*size points and copy iend first points.
void FitOptionsMake(EFitObjectType type, const char *option, Foption_t &fitOption)
Decode list of options into fitOption.
Abstract Base Class for Fitting.
Mother of all ROOT objects.
virtual void UseCurrentStyle()
Set current style settings in this graph This function is called when either TCanvas::UseCurrentStyle...
virtual void Browse(TBrowser *b)
Browse.
virtual Int_t GetNpar() const
Style_t GetHistLineStyle() const
virtual void FillZero(Int_t begin, Int_t end, Bool_t from_ctor=kTRUE)
Set zero values for point arrays in the range [begin, end) Should be redefined in descendant classes...
virtual void SetPoint(Int_t i, Double_t x, Double_t y)
Set x and y values for point number i.
virtual void InitExpo(Double_t xmin=0, Double_t xmax=0)
Compute Initial values of parameters for an exponential.
void RotateTitle(Bool_t rotate=kTRUE)
Rotate title by 180 degrees.
virtual void RecursiveRemove(TObject *obj)
Remove object from this collection and recursively remove the object from all other objects (and coll...
virtual void LeastSquareLinearFit(Int_t n, Double_t &a0, Double_t &a1, Int_t &ifail, Double_t xmin=0, Double_t xmax=0)
Least square linear fit without weights.
static Bool_t CompareArg(const TGraph *gr, Int_t left, Int_t right)
Return kTRUE if point number "left"'s argument (angle with respect to positive x-axis) is bigger than...
Bool_t GetNoExponent() const
A Graph is a graphics object made of two arrays X and Y with npoints each.
you should not use this method at all Int_t Int_t Double_t Double_t Double_t Int_t Double_t Double_t Double_t Double_t b
Int_t Atoi() const
Return integer value of string.
virtual void CopyAndRelease(Double_t **newarrays, Int_t ibegin, Int_t iend, Int_t obegin)
Copy points from fX and fY to arrays[0] and arrays[1] or to fX and fY if arrays == 0 and ibegin != ie...
Double_t Atof() const
Return floating-point value contained in string.
Bool_t IsDigit() const
Returns true if all characters in string are digits (0-9) or white spaces, i.e.
virtual void DrawGraph(Int_t n, const Int_t *x, const Int_t *y, Option_t *option="")
Draw this graph with new attributes.
virtual void SetParameter(Int_t param, Double_t value)
virtual void SetTitle(const char *title)
Change (i.e.
TFitResultPtr FitObject(TH1 *h1, TF1 *f1, Foption_t &option, const ROOT::Math::MinimizerOptions &moption, const char *goption, ROOT::Fit::DataRange &range)
fitting function for a TH1 (called from TH1::Fit)
virtual Double_t GetCorrelationFactor() const
Return graph correlation factor.
virtual Bool_t ExpandPathName(TString &path)
Expand a pathname getting rid of special shell characters like ~.
virtual Color_t GetMarkerColor() const
Return the marker color.
Option_t * GetDrawOption() const
Get option used by the graphics system to draw this object.
virtual Int_t IsInside(Double_t x, Double_t y) const
Return 1 if the point (x,y) is inside the polygon defined by the graph vertices 0 otherwise...
virtual Style_t GetFillStyle() const
Return the fill area style.
Double_t Sqrt(Double_t x)
virtual void ExecuteEventHelper(TGraph *theGraph, Int_t event, Int_t px, Int_t py)=0
virtual void ComputeRange(Double_t &xmin, Double_t &ymin, Double_t &xmax, Double_t &ymax) const
Compute the x/y range of the points in this graph.
virtual void PaintStats(TGraph *theGraph, TF1 *fit)=0
virtual const char * GetName() const
Returns name of object.
virtual void Set(Int_t n)
Set number of points in the graph Existing coordinates are preserved New coordinates above fNpoints a...
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
void SetHistLineColor(Color_t color=1)
virtual TObject * GetUserFunc() const
Double_t GetMinimum() const
virtual void SetEditable(Bool_t editable=kTRUE)
if editable=kFALSE, the graph cannot be modified with the mouse by default a TGraph is editable ...
Double_t Eval(Double_t x) const
Eval this spline at x.
Double_t ** AllocateArrays(Int_t Narrays, Int_t arraySize)
Allocate arrays.
virtual Double_t GetErrorXhigh(Int_t bin) const
This function is called by GraphFitChisquare.
virtual void PaintGrapHist(TGraph *theGraph, Int_t npoints, const Double_t *x, const Double_t *y, Option_t *chopt)=0
Long64_t BinarySearch(Long64_t n, const T *array, T value)
virtual void PaintGraph(TGraph *theGraph, Int_t npoints, const Double_t *x, const Double_t *y, Option_t *chopt)=0
virtual Style_t GetLabelFont() const
virtual Version_t ReadVersion(UInt_t *start=0, UInt_t *bcnt=0, const TClass *cl=0)=0
virtual const char * GetTitle() const
Returns title of object.
void Copy(TAttFill &attfill) const
Copy this fill attributes to a new TAttFill.
static Bool_t CompareY(const TGraph *gr, Int_t left, Int_t right)
Return kTRUE if fY[left] > fY[right]. Can be used by Sort.
const char * Data() const
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a primitive as a C++ statement(s) on output stream "out".