692 if (
gPad->GetLogx()) {
693 for (
Int_t i = 0; i < npoints; i++) {
697 for (
Int_t i = 0; i < npoints; i++)
700 if (!opt &&
gPad->GetLogy()) {
701 for (
Int_t i = 0; i < npoints; i++) {
705 for (
Int_t i = 0; i < npoints; i++)
724 if (distance <= 5)
return distance;
728 const Int_t big = 9999;
729 const Int_t kMaxDiff = 10;
739 theX = theGraphPolar->
GetXpol();
740 theY = theGraphPolar->
GetYpol();
742 theX = theGraph->
GetX();
743 theY = theGraph->
GetY();
747 for (i=0;i<theNpoints;i++) {
748 pxp =
gPad->XtoAbsPixel(
gPad->XtoPad(theX[i]));
749 pyp =
gPad->YtoAbsPixel(
gPad->YtoPad(theY[i]));
759 if (distance < kMaxDiff)
return distance;
761 for (i=0;i<theNpoints-1;i++) {
764 if (
d < distance) distance =
d;
779 TIter next(functions);
781 if (
f->InheritsFrom(
TF1::Class())) distance =
f->DistancetoPrimitive(-px,py);
782 else distance =
f->DistancetoPrimitive(px,py);
783 if (distance < kMaxDiff) {
784 gPad->SetSelected(
f);
800 Error(
"DrawPanel",
"need to draw graph first");
805 gROOT->ProcessLine(
TString::Format(
"((TCanvas*)0x%zx)->Selected((TVirtualPad*)0x%zx,(TObject*)0x%zx,1)",
806 (
size_t)
gPad->GetCanvas(), (
size_t)
gPad, (
size_t)theGraph));
828 const Int_t kMaxDiff = 10;
829 static Bool_t middle, badcase;
830 static Int_t ipoint, pxp, pyp;
831 static Int_t px1,px2,py1,py2;
832 static Int_t pxold, pyold, px1old, py1old, px2old, py2old;
833 static Int_t dpx, dpy;
834 static std::vector<Int_t>
x,
y;
841 if (!
gPad->IsEditable())
return;
851 theGraph->TAttLine::Modify();
852 px1 =
gPad->XtoAbsPixel(
gPad->GetX1());
853 py1 =
gPad->YtoAbsPixel(
gPad->GetY1());
854 px2 =
gPad->XtoAbsPixel(
gPad->GetX2());
855 py2 =
gPad->YtoAbsPixel(
gPad->GetY2());
859 if (!
x.empty() || !
y.empty())
break;
860 x.resize(theNpoints+1);
861 y.resize(theNpoints+1);
862 for (i=0;i<theNpoints;i++) {
863 pxp =
gPad->XtoAbsPixel(
gPad->XtoPad(theX[i]));
864 pyp =
gPad->YtoAbsPixel(
gPad->YtoPad(theY[i]));
865 if (pxp < -kMaxPixel || pxp >=
kMaxPixel ||
871 gVirtualX->DrawLine(pxp-4, pyp-4, pxp+4, pyp-4);
872 gVirtualX->DrawLine(pxp+4, pyp-4, pxp+4, pyp+4);
873 gVirtualX->DrawLine(pxp+4, pyp+4, pxp-4, pyp+4);
874 gVirtualX->DrawLine(pxp-4, pyp+4, pxp-4, pyp-4);
879 if (
d < kMaxDiff) ipoint =i;
885 if (ipoint < 0)
return;
889 px2old =
gPad->XtoAbsPixel(theX[1]);
890 py2old =
gPad->YtoAbsPixel(theY[1]);
891 }
else if (ipoint == theNpoints-1) {
892 px1old =
gPad->XtoAbsPixel(
gPad->XtoPad(theX[theNpoints-2]));
893 py1old =
gPad->YtoAbsPixel(
gPad->YtoPad(theY[theNpoints-2]));
897 px1old =
gPad->XtoAbsPixel(
gPad->XtoPad(theX[ipoint-1]));
898 py1old =
gPad->YtoAbsPixel(
gPad->YtoPad(theY[ipoint-1]));
899 px2old =
gPad->XtoAbsPixel(
gPad->XtoPad(theX[ipoint+1]));
900 py2old =
gPad->YtoAbsPixel(
gPad->YtoPad(theY[ipoint+1]));
902 pxold =
gPad->XtoAbsPixel(
gPad->XtoPad(theX[ipoint]));
903 pyold =
gPad->YtoAbsPixel(
gPad->YtoPad(theY[ipoint]));
911 for (i=0;i<theNpoints;i++) {
912 pxp =
gPad->XtoAbsPixel(
gPad->XtoPad(theX[i]));
913 pyp =
gPad->YtoAbsPixel(
gPad->YtoPad(theY[i]));
915 if (
d < kMaxDiff) middle =
kFALSE;
927 for(i=0;i<theNpoints-1;i++) {
928 gVirtualX->DrawLine(
x[i]+dpx,
y[i]+dpy,
x[i+1]+dpx,
y[i+1]+dpy);
931 if (pxp < -kMaxPixel || pxp >=
kMaxPixel ||
932 pyp < -kMaxPixel || pyp >=
kMaxPixel)
continue;
933 gVirtualX->DrawLine(pxp-4, pyp-4, pxp+4, pyp-4);
934 gVirtualX->DrawLine(pxp+4, pyp-4, pxp+4, pyp+4);
935 gVirtualX->DrawLine(pxp+4, pyp+4, pxp-4, pyp+4);
936 gVirtualX->DrawLine(pxp-4, pyp+4, pxp-4, pyp-4);
938 pxp =
x[theNpoints-1]+dpx;
939 pyp =
y[theNpoints-1]+dpy;
940 gVirtualX->DrawLine(pxp-4, pyp-4, pxp+4, pyp-4);
941 gVirtualX->DrawLine(pxp+4, pyp-4, pxp+4, pyp+4);
942 gVirtualX->DrawLine(pxp+4, pyp+4, pxp-4, pyp+4);
943 gVirtualX->DrawLine(pxp-4, pyp+4, pxp-4, pyp-4);
948 for(i=0;i<theNpoints-1;i++) {
949 gVirtualX->DrawLine(
x[i]+dpx,
y[i]+dpy,
x[i+1]+dpx,
y[i+1]+dpy);
952 if (pxp < -kMaxPixel || pxp >=
kMaxPixel ||
953 pyp < -kMaxPixel || pyp >=
kMaxPixel)
continue;
954 gVirtualX->DrawLine(pxp-4, pyp-4, pxp+4, pyp-4);
955 gVirtualX->DrawLine(pxp+4, pyp-4, pxp+4, pyp+4);
956 gVirtualX->DrawLine(pxp+4, pyp+4, pxp-4, pyp+4);
957 gVirtualX->DrawLine(pxp-4, pyp+4, pxp-4, pyp-4);
959 pxp =
x[theNpoints-1]+dpx;
960 pyp =
y[theNpoints-1]+dpy;
961 gVirtualX->DrawLine(pxp-4, pyp-4, pxp+4, pyp-4);
962 gVirtualX->DrawLine(pxp+4, pyp-4, pxp+4, pyp+4);
963 gVirtualX->DrawLine(pxp+4, pyp+4, pxp-4, pyp+4);
964 gVirtualX->DrawLine(pxp-4, pyp+4, pxp-4, pyp-4);
966 if (px1old)
gVirtualX->DrawLine(px1old, py1old, pxold, pyold);
967 if (px2old)
gVirtualX->DrawLine(pxold, pyold, px2old, py2old);
968 gVirtualX->DrawLine(pxold-4, pyold-4, pxold+4, pyold-4);
969 gVirtualX->DrawLine(pxold+4, pyold-4, pxold+4, pyold+4);
970 gVirtualX->DrawLine(pxold+4, pyold+4, pxold-4, pyold+4);
971 gVirtualX->DrawLine(pxold-4, pyold+4, pxold-4, pyold-4);
978 if (px1old)
gVirtualX->DrawLine(px1old, py1old, pxold, pyold);
979 if (px2old)
gVirtualX->DrawLine(pxold, pyold, px2old, py2old);
980 gVirtualX->DrawLine(pxold-4, pyold-4, pxold+4, pyold-4);
981 gVirtualX->DrawLine(pxold+4, pyold-4, pxold+4, pyold+4);
982 gVirtualX->DrawLine(pxold+4, pyold+4, pxold-4, pyold+4);
983 gVirtualX->DrawLine(pxold-4, pyold+4, pxold-4, pyold-4);
992 dxr = dx/(1 -
gPad->GetLeftMargin() -
gPad->GetRightMargin());
993 dyr = dy/(1 -
gPad->GetBottomMargin() -
gPad->GetTopMargin());
1009 for(i=0;i<theNpoints;i++) {
1010 if (badcase)
continue;
1011 if (!
x.empty()) theX[i] =
gPad->PadtoX(
gPad->AbsPixeltoX(
x[i]+dpx));
1012 if (!
y.empty()) theY[i] =
gPad->PadtoY(
gPad->AbsPixeltoY(
y[i]+dpy));
1021 theX[ipoint] =
gPad->PadtoX(
gPad->AbsPixeltoX(pxold));
1022 theY[ipoint] =
gPad->PadtoY(
gPad->AbsPixeltoY(pyold));
1026 theX[theNpoints-1] = theX[0];
1027 theY[theNpoints-1] = theY[0];
1029 if (ipoint == theNpoints-1) {
1030 theX[0] = theX[theNpoints-1];
1031 theY[0] = theY[theNpoints-1];
1043 if (
gROOT->IsEscaped()) {
1057 dxr = dx/(1 -
gPad->GetLeftMargin() -
gPad->GetRightMargin());
1058 dyr = dy/(1 -
gPad->GetBottomMargin() -
gPad->GetTopMargin());
1064 ymin - dyr*
gPad->GetBottomMargin(),
1070 for(i=0;i<theNpoints;i++) {
1071 if (badcase)
continue;
1072 if (!
x.empty()) theX[i] =
gPad->PadtoX(
gPad->AbsPixeltoX(
x[i]+dpx));
1073 if (!
y.empty()) theY[i] =
gPad->PadtoY(
gPad->AbsPixeltoY(
y[i]+dpy));
1076 theX[ipoint] =
gPad->PadtoX(
gPad->AbsPixeltoX(pxold));
1077 theY[ipoint] =
gPad->PadtoY(
gPad->AbsPixeltoY(pyold));
1081 theX[theNpoints-1] = theX[0];
1082 theY[theNpoints-1] = theY[0];
1084 if (ipoint == theNpoints-1) {
1085 theX[0] = theX[theNpoints-1];
1086 theY[0] = theY[theNpoints-1];
1140 const Int_t kHighlightRange = 50;
1141 static Int_t distanceOld = kHighlightRange;
1144 if ((distance < kHighlightRange) && (distance < distanceOld)) {
1182 if (
gPad->GetLogx()) {
1186 if (
gPad->GetLogy()) {
1190 if ((hx < uxmin) || (hx > uxmax))
return;
1191 if ((hy < uymin) || (hy > uymax))
return;
1215 strlcpy(chopt,
option,80);
1218 char *l1 = strstr(chopt,
"pfc");
1219 char *l2 = strstr(chopt,
"plc");
1220 char *l3 = strstr(chopt,
"pmc");
1221 if (l1 || l2 || l3) {
1230 char *l4 = strstr(chopt,
"rx");
1231 char *l5 = strstr(chopt,
"ry");
1265 TIter next(functions);
1273 if (palette) palette->
Paint();
1287 gPad->PushSelectableObject(theGraph);
1289 Int_t optionLine , optionAxis , optionCurve , optionStar , optionMark;
1290 Int_t optionBar , optionR , optionOne , optionE;
1291 Int_t optionFill , optionZ , optionCurveFill, optionIAxis;
1292 Int_t i, npt, nloop;
1295 Double_t barxmin, barxmax, barymin, barymax;
1302 Error(
"PaintGraph",
"illegal number of points (%d)", npoints);
1309 if (opt.
Contains(
"L")) optionLine = 1;
else optionLine = 0;
1310 if (opt.
Contains(
"A")) optionAxis = 1;
else optionAxis = 0;
1311 if (opt.
Contains(
"C")) optionCurve = 1;
else optionCurve = 0;
1312 if (opt.
Contains(
"*")) optionStar = 1;
else optionStar = 0;
1313 if (opt.
Contains(
"P")) optionMark = 1;
else optionMark = 0;
1314 if (opt.
Contains(
"B")) optionBar = 1;
else optionBar = 0;
1315 if (opt.
Contains(
"R")) optionR = 1;
else optionR = 0;
1316 if (opt.
Contains(
"1")) optionOne = 1;
else optionOne = 0;
1317 if (opt.
Contains(
"F")) optionFill = 1;
else optionFill = 0;
1318 if (opt.
Contains(
"I")) optionIAxis = 1;
else optionIAxis = 0;
1324 if (optionLine+optionFill+optionCurve+optionStar+optionMark+optionBar+optionE == 0) {
1325 if (!chopt[0]) optionLine=1;
1331 optionCurveFill = 0;
1332 if (optionCurve && optionFill) {
1333 optionCurveFill = 1;
1338 Double_t rwxmin,rwxmax, rwymin, rwymax, maximum, minimum, dx, dy;
1341 rwxmin =
gPad->GetUxmin();
1342 rwxmax =
gPad->GetUxmax();
1343 rwymin =
gPad->GetUymin();
1344 rwymax =
gPad->GetUymax();
1347 if (minimum == -1111) {
1351 if (maximum == -1111) {
1355 uxmin =
gPad->PadtoX(rwxmin);
1356 uxmax =
gPad->PadtoX(rwxmax);
1359 theGraph->
ComputeRange(rwxmin, rwymin, rwxmax, rwymax);
1361 if (rwxmin == rwxmax) rwxmax += 1.;
1362 if (rwymin == rwymax) rwymax += 1.;
1363 dx = 0.1*(rwxmax-rwxmin);
1364 dy = 0.1*(rwymax-rwymin);
1365 uxmin = rwxmin - dx;
1366 uxmax = rwxmax + dx;
1367 minimum = rwymin - dy;
1368 maximum = rwymax + dy;
1372 if (uxmin < 0 && rwxmin >= 0) uxmin = 0.9*rwxmin;
1373 if (uxmax > 0 && rwxmax <= 0) {
1374 if (
gPad->GetLogx()) uxmax = 1.1*rwxmax;
1377 if (minimum < 0 && rwymin >= 0) minimum = 0.9*rwymin;
1378 if (maximum > 0 && rwymax <= 0) {
1382 if (minimum <= 0 && gPad->GetLogy()) minimum = 0.001*maximum;
1383 if (uxmin <= 0 && gPad->GetLogx()) {
1384 if (uxmax > 1000) uxmin = 1;
1385 else uxmin = 0.001*uxmax;
1392 char chopth[8] =
" ";
1393 if (strstr(chopt,
"x+")) strncat(chopth,
"x+",3);
1394 if (strstr(chopt,
"y+")) strncat(chopth,
"y+",3);
1395 if (optionIAxis) strncat(chopth,
"A",2);
1402 if (theNpoints > npt) npt = theNpoints;
1414 if (
gPad->GetLogy()) {
1427 rwxmin =
gPad->GetUxmin();
1428 rwxmax =
gPad->GetUxmax();
1429 rwymin =
gPad->GetUymin();
1430 rwymax =
gPad->GetUymax();
1431 uxmin =
gPad->PadtoX(rwxmin);
1432 uxmax =
gPad->PadtoX(rwxmax);
1437 maximum =
gPad->PadtoY(rwymax);
1438 minimum =
gPad->PadtoY(rwymin);
1442 theGraph->TAttLine::Modify();
1443 theGraph->TAttFill::Modify();
1444 theGraph->TAttMarker::Modify();
1447 gxwork.resize(2*npoints+10);
1448 gywork.resize(2*npoints+10);
1452 if (optionLine || optionFill) {
1458 if (optionFill && (xn !=
x1 || yn !=
y1)) nloop++;
1460 for (i=1;i<=nloop;i++) {
1504 if (optionCurveFill) {
1506 if (xn !=
x1 || yn !=
y1) nloop++;
1510 for (i=1;i<=nloop;i++) {
1535 for (i=1;i<=nloop;i++) {
1539 if (
y[i-1] < minimum ||
y[i-1] > maximum)
continue;
1540 if (
x[i-1] < uxmin ||
x[i-1] > uxmax)
continue;
1566 for (i=1;i<=npoints;i++) {
1581 for (i=1;i<=npoints;i++) {
1596 if(FillSave ==
gPad->GetFrameFillColor()) {
1598 if (
gPad->GetFrameFillColor()==1) {
1600 theGraph->TAttFill::Modify();
1603 theGraph->TAttFill::Modify();
1609 for (i=1;i<npoints;i++) {
1610 if (
x[i] < barxmin) barxmin =
x[i];
1611 if (
x[i] > barxmax) barxmax =
x[i];
1613 bdelta = (barxmax-barxmin)/
Double_t(npoints);
1617 for (i=1;i<npoints;i++) {
1618 if (
y[i] < barymin) barymin =
y[i];
1619 if (
y[i] > barymax) barymax =
y[i];
1621 bdelta = (barymax-barymin)/
Double_t(npoints);
1625 for (i=1;i<=npoints;i++) {
1626 xlow =
x[i-1] - dbar;
1627 xhigh =
x[i-1] + dbar;
1629 if (xlow < uxmin && xhigh < uxmin)
continue;
1630 if (xhigh > uxmax && xlow > uxmax)
continue;
1631 if (xlow < uxmin) xlow = uxmin;
1632 if (xhigh > uxmax) xhigh = uxmax;
1634 else ylow =
gPad->GetUymin();
1648 for (i=1;i<=npoints;i++) {
1650 ylow =
y[i-1] - dbar;
1651 yhigh =
y[i-1] + dbar;
1662 theGraph->TAttFill::Modify();
1706 const char *where =
"PaintGrapHist";
1708 Int_t optionLine , optionAxis , optionCurve, optionStar, optionMark;
1709 Int_t optionBar , optionRot , optionOne , optionOff ;
1710 Int_t optionFill , optionZ;
1711 Int_t optionHist , optionBins , optionMarker;
1713 Int_t drawtype=0, drawborder, drawbordersav;
1719 Double_t xi, xi1, xj, xj1, yi1, yi, yj, yj1, xwmin, ywmin;
1720 Int_t first, last, nbins;
1723 char choptaxis[10] =
" ";
1726 Error(where,
"illegal number of points (%d)", npoints);
1731 if (opt.
Contains(
"H")) optionHist = 1;
else optionHist = 0;
1732 if (opt.
Contains(
"F")) optionFill = 1;
else optionFill = 0;
1733 if (opt.
Contains(
"C")) optionCurve= 1;
else optionCurve= 0;
1734 if (opt.
Contains(
"*")) optionStar = 1;
else optionStar = 0;
1735 if (opt.
Contains(
"R")) optionRot = 1;
else optionRot = 0;
1736 if (opt.
Contains(
"1")) optionOne = 1;
else optionOne = 0;
1737 if (opt.
Contains(
"B")) optionBar = 1;
else optionBar = 0;
1738 if (opt.
Contains(
"N")) optionBins = 1;
else optionBins = 0;
1739 if (opt.
Contains(
"L")) optionLine = 1;
else optionLine = 0;
1740 if (opt.
Contains(
"P")) optionMark = 1;
else optionMark = 0;
1741 if (opt.
Contains(
"A")) optionAxis = 1;
else optionAxis = 0;
1742 if (opt.
Contains(
"][")) optionOff = 1;
else optionOff = 0;
1743 if (opt.
Contains(
"P0")) optionMark = 10;
1745 Int_t optionFill2 = 0;
1747 optionFill = 0; optionFill2 = 1;
1762 nbins = last - first + 1;
1774 Double_t rounding = (uxmax-uxmin)*1.e-5;
1777 Int_t nx1, nx2, ndivx, ndivy, ndiv;
1790 if (ndivx < 0) strlcat(choptaxis,
"N",10);
1791 if (
gPad->GetGridx()) {
1793 strlcat(choptaxis,
"W",10);
1795 if (
gPad->GetLogx()) {
1799 strlcat(choptaxis,
"G",10);
1809 axis.
PaintAxis(rwxmin,rwymin,rwxmax,rwymin,rwmin,rwmax,ndiv,choptaxis);
1819 strlcat(choptaxis,
"N",10);
1822 if (
gPad->GetGridy()) {
1824 strlcat(choptaxis,
"W",10);
1826 if (
gPad->GetLogy()) {
1830 strlcat(choptaxis,
"G",10);
1839 axis.
PaintAxis(rwxmin,rwymin,rwxmin,rwymax,rwmin,rwmax,ndiv,choptaxis);
1844 theGraph->TAttLine::Modify();
1845 theGraph->TAttFill::Modify();
1846 theGraph->TAttMarker::Modify();
1855 Int_t fwidth =
gPad->GetFrameLineWidth();
1858 if (optionOff) fwidth = 1;
1869 gxwork.resize(2*npoints+10);
1870 gywork.resize(2*npoints+10);
1874 if (optionFill && !optionCurve) {
1882 for (j=first; j<=last;j++) {
1889 xj1 =
x[j]; xj =
x[j-1];
1891 if (j != last)
Error(where,
"X must be in increasing order");
1892 else Error(where,
"X must have N+1 values with option N");
1900 if ((
gxwork[npt-1] >= uxmin-rounding &&
gxwork[npt-1] <= uxmax+rounding) ||
1901 (
gxwork[npt] >= uxmin-rounding &&
gxwork[npt] <= uxmax+rounding)) npt += 2;
1914 if (!fillarea)
gyworkl[0] = ylast;
1925 for (j=first; j<=last;j++) {
1930 yj1 =
y[j]; yj =
y[j-1];
1932 if (j != last)
Error(where,
"Y must be in increasing order");
1933 else Error(where,
"Y must have N+1 values with option N");
1939 if ((
gxwork[npt-1] >= uxmin-rounding &&
gxwork[npt-1] <= uxmax+rounding) ||
1940 (
gxwork[npt] >= uxmin-rounding &&
gxwork[npt] <= uxmax+rounding)) npt += 2;
1947 if (!fillarea)
gyworkl[0] = ylast;
1954 theGraph->TAttLine::Modify();
1955 theGraph->TAttFill::Modify();
1960 if ((optionHist) || !chopt[0]) {
1968 for (i=first; i<=last;i++) {
1973 xi1 =
x[i]; xi =
x[i-1];
1975 if (i != last)
Error(where,
"X must be in increasing order");
1976 else Error(where,
"X must have N+1 values with option N");
1984 if ((
gxwork[npt-1] >= uxmin-rounding &&
gxwork[npt-1] <= uxmax+rounding) ||
1985 (
gxwork[npt] >= uxmin-rounding &&
gxwork[npt] <= uxmax+rounding)) npt += 2;
1997 Int_t nbpoints = npt-2;
2003 for (ip=point1; ip<=nbpoints; ip++) {
2010 Int_t point2 = nbpoints;
2011 for (ip=point2; ip>=point1; ip--) {
2017 nbpoints = point2-point1+1;
2021 if (
gxwork[0] >
gPad->GetUxmin()) { nbpoints++; point1 = 0; }
2022 if (
gxwork[nbpoints] <
gPad->GetUxmax()) nbpoints++;
2025 gPad->PaintPolyLine(nbpoints,
gxworkl.data() + point1,
gyworkl.data() + point1, noClip);
2035 for (i=first; i<=last;i++) {
2040 yi1 =
y[i]; yi =
y[i-1];
2042 if (i != last)
Error(where,
"Y must be in increasing order");
2043 else Error(where,
"Y must have N+1 values with option N");
2049 if ((
gxwork[npt-1] >= uxmin-rounding &&
gxwork[npt-1] <= uxmax+rounding) ||
2050 (
gxwork[npt] >= uxmin-rounding &&
gxwork[npt] <= uxmax+rounding)) npt += 2;
2069 if (!optionOne) drawtype = 2;
2074 for (i=first; i<=last;i++) {
2077 gxwork[npt-1] =
wmin+(i-first)*delta+0.5*delta;
2079 xi1 =
x[i]; xi =
x[i-1];
2081 if (i != last)
Error(where,
"X must be in increasing order");
2082 else Error(where,
"X must have N+1 values with option N");
2085 gxwork[npt-1] =
x[i-1] + 0.5*(
x[i]-
x[i-1]);
2116 drawtype = drawtype+10;
2118 for (i=first; i<=last;i++) {
2121 gywork[npt-1] =
wmin+(i-first)*delta+0.5*delta;
2123 yi1 =
y[i]; yi =
y[i-1];
2125 if (i != last)
Error(where,
"Y must be in increasing order");
2126 else Error(where,
"Y must have N+1 values with option N");
2129 gywork[npt-1] =
y[i-1] + 0.5*(
y[i]-
y[i-1]);
2162 wminstep =
wmin + 0.5*delta;
2164 gPad->GetRangeAxis(ax1,ay1,ax2,ay2);
2168 for (i=first; i<=last;i++) {
2171 gxwork[npt-1] =
wmin+(i-first)*delta+0.5*delta;
2173 xi1 =
x[i]; xi =
x[i-1];
2175 if (i != last)
Error(where,
"X must be in increasing order");
2176 else Error(where,
"X must have N+1 values with option N");
2179 gxwork[npt-1] =
x[i-1] + 0.5*(
x[i]-
x[i-1]);
2181 if (
gxwork[npt-1] < uxmin ||
gxwork[npt-1] > uxmax) { npt--;
continue;}
2184 if ((
gywork[npt-1] < rwymin) || ((
gywork[npt-1] > rwymax) && !optionFill2)) {
2221 for (i=first; i<=last;i++) {
2224 gywork[npt-1] = wminstep+(i-first)*delta+0.5*delta;
2226 yi1 =
y[i]; yi =
y[i-1];
2228 if (i != last)
Error(where,
"Y must be in increasing order");
2229 else Error(where,
"Y must have N+1 values with option N");
2232 gywork[npt-1] =
y[i-1] + 0.5*(
y[i]-
y[i-1]);
2235 if ((
gxwork[npt-1] < uxmin) || (
gxwork[npt-1] > uxmax)) {
2257 if (optionLine != 0 && npt > 1) {
2268 offset = delta*baroffset; dbar = delta*barwidth;
2272 dbar = (
x[1]-
x[0])*barwidth;
2275 dbar = (
y[1]-
y[0])*barwidth;
2278 drawbordersav = drawborder;
2285 else ylow =
gPad->GetUymin();
2287 for (i=first; i<=last;i++) {
2294 if (xlow < rwxmax && xhigh > rwxmin)
2298 xhigh = xhigh+delta;
2301 xi1 =
x[i]; xi =
x[i-1];
2303 Error(where,
"X must be in increasing order");
2307 dbar = (
x[i+1]-
x[i])*barwidth;
2317 else xlow =
gPad->GetUxmin();
2318 for (i=first; i<=last;i++) {
2326 gPad->PaintBox(xlow,ylow,xhigh,yhigh);
2328 ylow = ylow + delta;
2329 yhigh = yhigh + delta;
2332 yi1 =
y[i]; yi =
y[i-1];
2334 Error(where,
"Y must be in increasing order");
2338 dbar = (
y[i+1]-
y[i])*barwidth;
2351 if ((optionStar) || (optionMark)) optionMarker=1;
2357 for (i=first; i<=last;i++) {
2358 if (!optionBins) xm =
wmin+(i-first)*delta+0.5*delta;
2359 else xm =
x[i-1] + 0.5*(
x[i]-
x[i-1]);
2361 if (optionMark != 10) {
2362 if (ym<rwymax && ym > rwymin) {
2368 if (ym<rwymax && ym >= rwymin) {
2385 wminstep =
wmin + 0.5*delta;
2386 for (i=first; i<=last;i++) {
2387 if (!optionBins) ym = wminstep+(i-first)*delta+0.5*delta;
2388 else ym =
y[i-1] + 0.5*(
y[i]-
y[i-1]);
2390 if (optionMark != 10) {
2391 if (xm<rwxmax && xm > rwxmin) {
2397 if (xm<rwxmax && xm >= rwxmin) {
2432 std::vector<Double_t> xline, yline;
2437 const Int_t kBASEMARKER=8;
2438 static Float_t cxx[30] = {1.0,1.0,0.5,0.5,1.0,1.0,0.5,0.6,1.0,0.5,0.5,1.0,0.5,0.6,1.0,1.0,1.0,1.0,1.0,1.0,0.0,0.0,1.0,1.0,1.0,1.0,0.5,0.5,0.5,1.0};
2439 static Float_t cyy[30] = {1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.5,0.5,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,0.0,1.0,1.0,1.0,1.0,0.5,0.5,0.5,1.0};
2458 const char *arrowOpt =
nullptr;
2459 if (strchr(
option,
'>')) arrowOpt =
">";
2460 if (strstr(
option,
"|>")) arrowOpt =
"|>";
2485 xline.resize(2*theNpoints);
2486 yline.resize(2*theNpoints);
2487 if (xline.empty() || yline.empty()) {
2488 Error(
"PaintGraphAsymmErrors",
"too many points, out of memory");
2495 theGraph->TAttLine::Modify();
2510 Double_t sbase = symbolsize*kBASEMARKER;
2514 if (mark >= 20 && mark <= 49) {
2525 Float_t asize = 0.6*symbolsize*kBASEMARKER/
gPad->GetWh();
2530 Bool_t DrawXLeft, DrawXRight, DrawYUp, DrawYLow;
2532 Double_t x,
y, exl, exh, eyl, eyh, xl1, xl2, xr1, xr2, yup, yup1, yup2, ylow, ylow1, ylow2;
2533 for (
Int_t i=0;i<theNpoints;i++) {
2538 x =
gPad->XtoPad(theX[i]);
2539 y =
gPad->YtoPad(theY[i]);
2543 if (x < gPad->GetUxmin())
x =
gPad->GetUxmin();
2544 if (
x >
gPad->GetUxmax())
x =
gPad->GetUxmax();
2545 if (y < gPad->GetUymin())
y =
gPad->GetUymin();
2546 if (
y >
gPad->GetUymax())
y =
gPad->GetUymax();
2548 if (x < gPad->GetUxmin())
continue;
2549 if (
x >
gPad->GetUxmax())
continue;
2550 if (y < gPad->GetUymin())
continue;
2551 if (
y >
gPad->GetUymax())
continue;
2571 xl2 =
gPad->XtoPad(theX[i] - exl);
2573 xr2 =
gPad->XtoPad(theX[i] + exh);
2574 if (xl1 < xl2) DrawXLeft =
kFALSE;
2575 if (xr1 > xr2) DrawXRight =
kFALSE;
2589 yup2 =
gPad->YtoPad(theY[i] + eyh);
2591 ylow2 =
gPad->YtoPad(theY[i] - eyl);
2592 if (yup2 < yup1) DrawYUp =
kFALSE;
2593 if (ylow2 > ylow1) DrawYLow =
kFALSE;
2597 if (yup2 >
gPad->GetUymax()) yup2 =
gPad->GetUymax();
2598 if (ylow2 < gPad->GetUymin()) ylow2 =
gPad->GetUymin();
2606 if (x1b < gPad->GetUxmin()) x1b =
gPad->GetUxmin();
2607 if (x1b >
gPad->GetUxmax()) x1b =
gPad->GetUxmax();
2608 if (y1b < gPad->GetUymin()) y1b =
gPad->GetUymin();
2609 if (y1b >
gPad->GetUymax()) y1b =
gPad->GetUymax();
2610 if (x2b < gPad->GetUxmin()) x2b =
gPad->GetUxmin();
2611 if (x2b >
gPad->GetUxmax()) x2b =
gPad->GetUxmax();
2612 if (y2b < gPad->GetUymin()) y2b =
gPad->GetUymin();
2613 if (y2b >
gPad->GetUymax()) y2b =
gPad->GetUymax();
2614 if (option5)
box.PaintBox(x1b, y1b, x2b, y2b,
"l");
2615 else box.PaintBox(x1b, y1b, x2b, y2b);
2623 yline[if1-1] = yup2;
2624 yline[if2-1] = ylow2;
2630 if (exl != 0. || exh != 0.) {
2632 if (exl != 0. && DrawXLeft)
arrow.PaintArrow(xl1,
y,xl2,
y,asize,arrowOpt);
2633 if (exh != 0. && DrawXRight)
arrow.PaintArrow(xr1,
y,xr2,
y,asize,arrowOpt);
2636 if (exl != 0. && DrawXLeft)
gPad->PaintLine(xl1,
y,xl2,
y);
2637 if (exh != 0. && DrawXRight)
gPad->PaintLine(xr1,
y,xr2,
y);
2641 if (exl != 0. && DrawXLeft) {
2642 xb[0] = xl2+tx; yb[0] =
y-ty;
2643 xb[1] = xl2; yb[1] =
y-ty;
2644 xb[2] = xl2; yb[2] =
y+ty;
2645 xb[3] = xl2+tx; yb[3] =
y+ty;
2646 gPad->PaintPolyLine(4, xb, yb);
2648 if (exh != 0. && DrawXRight) {
2649 xb[0] = xr2-tx; yb[0] =
y-ty;
2650 xb[1] = xr2; yb[1] =
y-ty;
2651 xb[2] = xr2; yb[2] =
y+ty;
2652 xb[3] = xr2-tx; yb[3] =
y+ty;
2653 gPad->PaintPolyLine(4, xb, yb);
2656 if (DrawXLeft)
gPad->PaintLine(xl2,
y-ty,xl2,
y+ty);
2657 if (DrawXRight)
gPad->PaintLine(xr2,
y-ty,xr2,
y+ty);
2663 if (eyl != 0. || eyh != 0.) {
2665 if (eyh != 0. && DrawYUp) {
2666 if (yup2 == yup)
arrow.PaintArrow(
x,yup1,
x,yup2,asize,arrowOpt);
2667 else gPad->PaintLine(
x,yup1,
x,yup2);
2669 if (eyl != 0. && DrawYLow) {
2670 if (ylow2 == ylow)
arrow.PaintArrow(
x,ylow1,
x,ylow2,asize,arrowOpt);
2671 else gPad->PaintLine(
x,ylow1,
x,ylow2);
2675 if (eyh != 0. && DrawYUp)
gPad->PaintLine(
x,yup1,
x,yup2);
2676 if (eyl != 0. && DrawYLow)
gPad->PaintLine(
x,ylow1,
x,ylow2);
2680 if (eyh != 0. && yup2 == yup && DrawYUp) {
2681 xb[0] =
x-tx; yb[0] = yup2-ty;
2682 xb[1] =
x-tx; yb[1] = yup2;
2683 xb[2] =
x+tx; yb[2] = yup2;
2684 xb[3] =
x+tx; yb[3] = yup2-ty;
2685 gPad->PaintPolyLine(4, xb, yb);
2687 if (eyl != 0. && ylow2 == ylow && DrawYLow) {
2688 xb[0] =
x-tx; yb[0] = ylow2+ty;
2689 xb[1] =
x-tx; yb[1] = ylow2;
2690 xb[2] =
x+tx; yb[2] = ylow2;
2691 xb[3] =
x+tx; yb[3] = ylow2+ty;
2692 gPad->PaintPolyLine(4, xb, yb);
2695 if (eyh != 0. && yup2 == yup && DrawYUp)
gPad->PaintLine(
x-tx,yup2,
x+tx,yup2);
2696 if (eyl != 0. && ylow2 == ylow && DrawYLow)
gPad->PaintLine(
x-tx,ylow2,
x+tx,ylow2);
2710 if (option4)
PaintGraph(theGraph, 2*theNpoints, xline.data(), yline.data(),
"FC");
2711 else PaintGraph(theGraph, 2*theNpoints, xline.data(), yline.data(),
"F");
2712 gPad->SetLogx(logx);
2713 gPad->SetLogy(logy);
2729 Int_t NYErrors = tg->GetNYErrors();
2730 if (NYErrors <= 0) {
2738 std::vector<TString> options(NYErrors + 1);
2747 while ((firstSemicolon = tsOpt.
First(
';')) !=
kNPOS && filled <= NYErrors) {
2748 options[filled] = tsOpt(0, firstSemicolon);
2749 tsOpt = tsOpt(firstSemicolon + 1, tsOpt.
Length());
2753 if (filled <= NYErrors) {
2754 options[filled] = tsOpt.
Copy();
2758 for (
Int_t i = filled; i <= NYErrors; i++)
2761 std::vector<Double_t> xline;
2762 std::vector<std::vector<Double_t>> yline(NYErrors);
2767 const Int_t kBASEMARKER = 8;
2768 static Float_t cxx[30] = {1.0,1.0,0.5,0.5,1.0,1.0,0.5,0.6,1.0,0.5,0.5,1.0,0.5,0.6,1.0,1.0,1.0,1.0,1.0,1.0,0.0,0.0,1.0,1.0,1.0,1.0,0.5,0.5,0.5,1.0};
2769 static Float_t cyy[30] = {1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.5,0.5,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,0.0,1.0,1.0,1.0,1.0,0.5,0.5,0.5,1.0};
2770 Int_t theNpoints = tg->GetN();
2774 Double_t *theExH = tg->GetEXhigh();
2775 std::vector<Double_t *> theEyL(NYErrors);
2776 std::vector<Double_t *> theEyH(NYErrors);
2779 for (
Int_t j = 0; j < NYErrors; j++) {
2780 theEyL[j] = tg->GetEYlow(j);
2781 theEyH[j] = tg->GetEYhigh(j);
2782 theEyExists &= (theEyL[j] && theEyH[j]);
2785 if (!theX || !theY || !theExL || !theExH || !theEyExists)
2788 std::vector<Bool_t> DrawErrors(NYErrors);
2793 std::vector<Bool_t> Braticks(NYErrors);
2794 std::vector<Bool_t> Brackets(NYErrors);
2795 std::vector<Bool_t> EndLines(NYErrors);
2796 std::vector<Char_t *> ArrowOpt(NYErrors);
2797 std::vector<Bool_t> Option5(NYErrors);
2798 std::vector<Bool_t> Option4(NYErrors);
2799 std::vector<Bool_t> Option3(NYErrors);
2801 std::vector<Bool_t> Option2(NYErrors);
2802 std::vector<Bool_t> Option0(NYErrors);
2804 std::vector<Double_t> Scale(NYErrors);
2806 const TRegexp ScaleRegExp(
"s=*[0-9]\\.*[0-9]");
2808 for (
Int_t j = 0; j < NYErrors; j++) {
2809 if (options[j + 1].Contains(
"s=")) {
2810 sscanf(strstr(options[j + 1].Data(),
"s="),
"s=%lf", &Scale[j]);
2811 options[j + 1].ReplaceAll(options[j + 1](ScaleRegExp),
"");
2815 DrawErrors[j] = !options[j + 1].Contains(
"x");
2816 AnyErrors |= DrawErrors[j];
2817 Braticks[j] = options[j + 1].Contains(
"[]");
2818 Brackets[j] = options[j + 1].Contains(
"||") || Braticks[j];
2819 EndLines[j] = !options[j + 1].Contains(
"z");
2821 if (options[j + 1].Contains(
"|>"))
2822 ArrowOpt[j] = (
Char_t *)
"|>";
2823 else if (options[j + 1].Contains(
">"))
2824 ArrowOpt[j] = (
Char_t *)
">";
2826 ArrowOpt[j] =
nullptr;
2828 Option5[j] = options[j + 1].Contains(
"5");
2829 Option4[j] = options[j + 1].Contains(
"4");
2830 Option3[j] = options[j + 1].Contains(
"3") || Option4[j];
2831 AnyOption3 |= Option3[j];
2832 Option2[j] = options[j + 1].Contains(
"2") || Option5[j];
2833 Option0[j] = options[j + 1].Contains(
"0");
2834 AnyOption0 |= Option0[j];
2836 NoErrorsX &= (Option3[j] || Option2[j]);
2837 Option0X |= !(Option3[j] || Option2[j]) && Option0[j];
2838 DrawMarker |= !(Brackets[j] || Option3[j] || Option2[j]);
2841 Bool_t Draw0PointsX = !options[0].Contains(
"x0") && (
gPad->GetLogx() == 0);
2842 Bool_t Draw0PointsY = !options[0].Contains(
"y0") && (
gPad->GetLogy() == 0);
2843 options[0].ReplaceAll(
"x0",
"");
2844 options[0].ReplaceAll(
"y0",
"");
2846 Bool_t DrawErrorsX = !options[0].Contains(
"x");
2847 Bool_t BraticksX = options[0].Contains(
"[]");
2848 Bool_t BracketsX = options[0].Contains(
"||") || BraticksX;
2849 Bool_t EndLinesX = !options[0].Contains(
"z");
2851 Char_t *ArrowOptX =
nullptr;
2852 if (options[0].Contains(
"|>"))
2853 ArrowOptX = (
Char_t *)
"|>";
2854 else if (options[0].Contains(
">"))
2855 ArrowOptX = (
Char_t *)
">";
2858 if (options[0].Contains(
"s=")) {
2859 sscanf(strstr(options[0].Data(),
"s="),
"s=%lf", &ScaleX);
2860 options[0].ReplaceAll(options[0](ScaleRegExp),
"");
2863 if (!AnyErrors && !DrawErrorsX) {
2868 Bool_t DrawAxis = options[0].Contains(
"a");
2869 Bool_t IndividualStyles = options[0].Contains(
"s");
2874 Int_t NPointsInside = AnyOption0 ? theNpoints : 0;
2877 for (
Int_t i = 0; i < theNpoints && !AnyOption0; i++) {
2878 x =
gPad->XtoPad(theX[i]);
2879 y =
gPad->YtoPad(theY[i]);
2881 if ((
x >=
gPad->GetUxmin()) && (x <= gPad->GetUxmax()) && (
y >=
gPad->GetUymin()) && (y <= gPad->GetUymax()) &&
2882 (Draw0PointsX || theX[i] != 0.) && (Draw0PointsY || theY[i] != 0.))
2887 xline.resize(2 * NPointsInside);
2889 if (xline.empty()) {
2890 Error(
"PaintGraphMultiErrors",
"too many points, out of memory");
2895 if2 = 2 * NPointsInside;
2898 for (
Int_t j = 0; j < NYErrors; j++) {
2899 if (Option3[j] && DrawErrors[j]) {
2900 yline[j].resize(2 * NPointsInside);
2902 if (yline[j].empty()) {
2903 Error(
"PaintGraphMultiErrors",
"too many points, out of memory");
2909 tg->TAttLine::Modify();
2912 arrow.SetLineWidth(tg->GetLineWidth());
2913 arrow.SetLineColor(tg->GetLineColor());
2914 arrow.SetFillColor(tg->GetFillColor());
2918 box.SetLineWidth(tg->GetLineWidth());
2919 box.SetLineColor(tg->GetLineColor());
2920 box.SetFillColor(tg->GetFillColor());
2921 box.SetFillStyle(tg->GetFillStyle());
2923 Double_t symbolsize = tg->GetMarkerSize();
2924 Double_t sbase = symbolsize * kBASEMARKER;
2929 if (mark >= 20 && mark <= 49) {
2930 cx = cxx[mark - 20];
2931 cy = cyy[mark - 20];
2940 Float_t asize = 0.6 * symbolsize * kBASEMARKER /
gPad->GetWh();
2945 Double_t xl1, xl2, xr1, xr2, yup1, yup2, ylow1, ylow2;
2946 for (
Int_t i = 0; i < theNpoints; i++) {
2947 x =
gPad->XtoPad(theX[i]);
2948 y =
gPad->YtoPad(theY[i]);
2951 (
x <
gPad->GetUxmin()) || (
x >
gPad->GetUxmax()) || (y < gPad->GetUymin()) || (
y >
gPad->GetUymax());
2953 if ((isOutside && !AnyOption0) || (!Draw0PointsX && theX[i] == 0.) || (!Draw0PointsY && theY[i] == 0.))
2958 if (x < gPad->GetUxmin())
2959 x =
gPad->GetUxmin();
2960 if (
x >
gPad->GetUxmax())
2961 x =
gPad->GetUxmax();
2962 if (y < gPad->GetUymin())
2963 y =
gPad->GetUymin();
2964 if (
y >
gPad->GetUymax())
2965 y =
gPad->GetUymax();
2975 for (
Int_t j = 0; j < NYErrors; j++) {
2980 if (Option2[j] && (!isOutside || Option0[j])) {
2981 if (IndividualStyles) {
2982 box.SetLineWidth(tg->GetLineWidth(j));
2983 box.SetLineColor(tg->GetLineColor(j));
2984 box.SetFillColor(tg->GetFillColor(j));
2985 box.SetFillStyle(tg->GetFillStyle(j));
2988 x1b =
gPad->XtoPad(theX[i] - Scale[j] * theExL[i]);
2989 y1b =
gPad->YtoPad(theY[i] - theEyL[j][i]);
2990 x2b =
gPad->XtoPad(theX[i] + Scale[j] * theExH[i]);
2991 y2b =
gPad->YtoPad(theY[i] + theEyH[j][i]);
2992 if (x1b < gPad->GetUxmin())
2993 x1b =
gPad->GetUxmin();
2994 if (x1b >
gPad->GetUxmax())
2995 x1b =
gPad->GetUxmax();
2996 if (y1b < gPad->GetUymin())
2997 y1b =
gPad->GetUymin();
2998 if (y1b >
gPad->GetUymax())
2999 y1b =
gPad->GetUymax();
3000 if (x2b < gPad->GetUxmin())
3001 x2b =
gPad->GetUxmin();
3002 if (x2b >
gPad->GetUxmax())
3003 x2b =
gPad->GetUxmax();
3004 if (y2b < gPad->GetUymin())
3005 y2b =
gPad->GetUymin();
3006 if (y2b >
gPad->GetUymax())
3007 y2b =
gPad->GetUymax();
3009 box.PaintBox(x1b, y1b, x2b, y2b,
"l");
3011 box.PaintBox(x1b, y1b, x2b, y2b);
3016 if (!isOutside || Option0[j]) {
3017 yline[j][if1 - 2] =
gPad->YtoPad(theY[i] + theEyH[j][i]);
3018 yline[j][if2] =
gPad->YtoPad(theY[i] - theEyL[j][i]);
3020 yline[j][if1 - 2] =
gPad->GetUymin();
3021 yline[j][if2] =
gPad->GetUymin();
3025 if (IndividualStyles) {
3026 tg->GetAttLine(j)->Modify();
3028 arrow.SetLineWidth(tg->GetLineWidth(j));
3029 arrow.SetLineColor(tg->GetLineColor(j));
3030 arrow.SetFillColor(tg->GetFillColor(j));
3033 ylow1 =
y - s2y * cy;
3034 ylow2 =
gPad->YtoPad(theY[i] - theEyL[j][i]);
3035 if (ylow2 < gPad->GetUymin())
3036 ylow2 =
gPad->GetUymin();
3037 if (ylow2 < ylow1 && DrawErrors[j] && !Option2[j] && !Option3[j] && (!isOutside || Option0[j])) {
3039 arrow.PaintArrow(
x, ylow1,
x, ylow2, asize, ArrowOpt[j]);
3042 gPad->PaintLine(
x, ylow1,
x, ylow2);
3053 gPad->PaintPolyLine(4, xb, yb);
3055 gPad->PaintLine(
x - tx, ylow2,
x + tx, ylow2);
3060 yup1 =
y + s2y * cy;
3061 yup2 =
gPad->YtoPad(theY[i] + theEyH[j][i]);
3062 if (yup2 >
gPad->GetUymax())
3063 yup2 =
gPad->GetUymax();
3064 if (yup2 > yup1 && DrawErrors[j] && !Option2[j] && !Option3[j] && (!isOutside || Option0[j])) {
3066 arrow.PaintArrow(
x, yup1,
x, yup2, asize, ArrowOpt[j]);
3069 gPad->PaintLine(
x, yup1,
x, yup2);
3080 gPad->PaintPolyLine(4, xb, yb);
3082 gPad->PaintLine(
x - tx, yup2,
x + tx, yup2);
3089 if (IndividualStyles) {
3090 tg->TAttLine::Modify();
3092 arrow.SetLineWidth(tg->GetLineWidth());
3093 arrow.SetLineColor(tg->GetLineColor());
3094 arrow.SetFillColor(tg->GetFillColor());
3098 xl2 =
gPad->XtoPad(theX[i] - ScaleX * theExL[i]);
3099 if (xl1 > xl2 && !NoErrorsX && (!isOutside || Option0X)) {
3101 arrow.PaintArrow(xl1,
y, xl2,
y, asize, ArrowOptX);
3104 gPad->PaintLine(xl1,
y, xl2,
y);
3115 gPad->PaintPolyLine(4, xb, yb);
3117 gPad->PaintLine(xl2,
y - ty, xl2,
y + ty);
3123 xr2 =
gPad->XtoPad(theX[i] + ScaleX * theExH[i]);
3124 if (xr1 < xr2 && !NoErrorsX && (!isOutside || Option0X)) {
3126 arrow.PaintArrow(xr1,
y, xr2,
y, asize, ArrowOptX);
3129 gPad->PaintLine(xr1,
y, xr2,
y);
3140 gPad->PaintPolyLine(4, xb, yb);
3142 gPad->PaintLine(xr2,
y - ty, xr2,
y + ty);
3154 tg->TAttFill::Copy(tgDummy);
3155 tg->TAttLine::Copy(tgDummy);
3156 tg->TAttMarker::Copy(tgDummy);
3158 for (
Int_t j = 0; j < NYErrors; j++)
3159 if (Option3[j] && DrawErrors[j]) {
3160 if (IndividualStyles) {
3161 tg->GetAttFill(j)->
Copy(tgDummy);
3162 tg->GetAttLine(j)->Copy(tgDummy);
3170 PaintGraph(&tgDummy, 2 * NPointsInside, xline.data(), yline[j].data(),
"FC");
3172 PaintGraph(&tgDummy, 2 * NPointsInside, xline.data(), yline[j].data(),
"F");
3173 gPad->SetLogx(logx);
3174 gPad->SetLogy(logy);
3185 std::vector<Double_t> xline, yline;
3190 const Int_t kBASEMARKER=8;
3191 static Float_t cxx[30] = {1.0,1.0,0.5,0.5,1.0,1.0,0.5,0.6,1.0,0.5,0.5,1.0,0.5,0.6,1.0,1.0,1.0,1.0,1.0,1.0,0.0,0.0,1.0,1.0,1.0,1.0,0.5,0.5,0.5,1.0};
3192 static Float_t cyy[30] = {1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.5,0.5,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,0.0,1.0,1.0,1.0,1.0,0.5,0.5,0.5,1.0};
3215 const char *arrowOpt =
nullptr;
3216 if (strchr(
option,
'>')) arrowOpt =
">";
3217 if (strstr(
option,
"|>")) arrowOpt =
"|>";
3242 xline.resize(2*theNpoints);
3243 yline.resize(2*theNpoints);
3244 if (xline.empty() || yline.empty()) {
3245 Error(
"PaintGraphBentErrors",
"too many points, out of memory");
3252 theGraph->TAttLine::Modify();
3267 Double_t sbase = symbolsize*kBASEMARKER;
3271 if (mark >= 20 && mark <= 49) {
3282 Float_t asize = 0.6*symbolsize*kBASEMARKER/
gPad->GetWh();
3287 Bool_t DrawXLeft, DrawXRight, DrawYUp, DrawYLow;
3289 Double_t x,
y, exl, exh, eyl, eyh, xl1, xl2, xr1, xr2, yup, yup1, yup2, ylow, ylow1, ylow2;
3291 for (
Int_t i=0;i<theNpoints;i++) {
3296 x =
gPad->XtoPad(theX[i]);
3297 y =
gPad->YtoPad(theY[i]);
3298 bxl =
gPad->YtoPad(theY[i]+theEXlowd[i]);
3299 bxh =
gPad->YtoPad(theY[i]+theEXhighd[i]);
3300 byl =
gPad->XtoPad(theX[i]+theEYlowd[i]);
3301 byh =
gPad->XtoPad(theX[i]+theEYhighd[i]);
3305 if (x < gPad->GetUxmin())
x =
gPad->GetUxmin();
3306 if (
x >
gPad->GetUxmax())
x =
gPad->GetUxmax();
3307 if (y < gPad->GetUymin())
y =
gPad->GetUymin();
3308 if (
y >
gPad->GetUymax())
y =
gPad->GetUymax();
3310 if (x < gPad->GetUxmin())
continue;
3311 if (
x >
gPad->GetUxmax())
continue;
3312 if (y < gPad->GetUymin())
continue;
3313 if (
y >
gPad->GetUymax())
continue;
3339 xl2 =
gPad->XtoPad(theX[i] - exl);
3341 xr2 =
gPad->XtoPad(theX[i] + exh);
3342 if (xl1 < xl2) DrawXLeft =
kFALSE;
3343 if (xr1 > xr2) DrawXRight =
kFALSE;
3363 yup2 =
gPad->YtoPad(theY[i] + eyh);
3365 ylow2 =
gPad->YtoPad(theY[i] - eyl);
3366 if (yup2 < yup1) DrawYUp =
kFALSE;
3367 if (ylow2 > ylow1) DrawYLow =
kFALSE;
3371 if (yup2 >
gPad->GetUymax()) yup2 =
gPad->GetUymax();
3372 if (ylow2 < gPad->GetUymin()) ylow2 =
gPad->GetUymin();
3374 if (xrevlog) {bs = bxl; bxl = bxh; bxh = bs;}
3375 if (yrevlog) {bs = byl; byl = byh; byh = bs;}
3383 if (x1b < gPad->GetUxmin()) x1b =
gPad->GetUxmin();
3384 if (x1b >
gPad->GetUxmax()) x1b =
gPad->GetUxmax();
3385 if (y1b < gPad->GetUymin()) y1b =
gPad->GetUymin();
3386 if (y1b >
gPad->GetUymax()) y1b =
gPad->GetUymax();
3387 if (x2b < gPad->GetUxmin()) x2b =
gPad->GetUxmin();
3388 if (x2b >
gPad->GetUxmax()) x2b =
gPad->GetUxmax();
3389 if (y2b < gPad->GetUymin()) y2b =
gPad->GetUymin();
3390 if (y2b >
gPad->GetUymax()) y2b =
gPad->GetUymax();
3391 if (option5)
box.PaintBox(x1b, y1b, x2b, y2b,
"l");
3392 else box.PaintBox(x1b, y1b, x2b, y2b);
3400 yline[if1-1] = yup2;
3401 yline[if2-1] = ylow2;
3407 if (exl != 0. || exh != 0.) {
3409 if (exl != 0. && DrawXLeft)
arrow.PaintArrow(xl1,
y,xl2,bxl,asize,arrowOpt);
3410 if (exh != 0. && DrawXRight)
arrow.PaintArrow(xr1,
y,xr2,bxh,asize,arrowOpt);
3413 if (exl != 0. && DrawXLeft)
gPad->PaintLine(xl1,
y,xl2,bxl);
3414 if (exh != 0. && DrawXRight)
gPad->PaintLine(xr1,
y,xr2,bxh);
3418 if (exl != 0. && DrawXLeft) {
3419 xb[0] = xl2+tx; yb[0] = bxl-ty;
3420 xb[1] = xl2; yb[1] = bxl-ty;
3421 xb[2] = xl2; yb[2] = bxl+ty;
3422 xb[3] = xl2+tx; yb[3] = bxl+ty;
3423 gPad->PaintPolyLine(4, xb, yb);
3425 if (exh != 0. && DrawXRight) {
3426 xb[0] = xr2-tx; yb[0] = bxh-ty;
3427 xb[1] = xr2; yb[1] = bxh-ty;
3428 xb[2] = xr2; yb[2] = bxh+ty;
3429 xb[3] = xr2-tx; yb[3] = bxh+ty;
3430 gPad->PaintPolyLine(4, xb, yb);
3433 if (DrawXLeft)
gPad->PaintLine(xl2,bxl-ty,xl2,bxl+ty);
3434 if (DrawXRight)
gPad->PaintLine(xr2,bxh-ty,xr2,bxh+ty);
3440 if (eyl != 0. || eyh != 0.) {
3442 if (eyh != 0. && DrawYUp) {
3443 if (yup2 == yup)
arrow.PaintArrow(
x,yup1,byh,yup2,asize,arrowOpt);
3444 else gPad->PaintLine(
x,yup1,byh,yup2);
3446 if (eyl != 0. && DrawYLow) {
3447 if (ylow2 == ylow)
arrow.PaintArrow(
x,ylow1,byl,ylow2,asize,arrowOpt);
3448 else gPad->PaintLine(
x,ylow1,byl,ylow2);
3452 if (eyh != 0. && DrawYUp)
gPad->PaintLine(
x,yup1,byh,yup2);
3453 if (eyl != 0. && DrawYLow)
gPad->PaintLine(
x,ylow1,byl,ylow2);
3457 if (eyh != 0. && yup2 == yup && DrawYUp) {
3458 xb[0] = byh-tx; yb[0] = yup2-ty;
3459 xb[1] = byh-tx; yb[1] = yup2;
3460 xb[2] = byh+tx; yb[2] = yup2;
3461 xb[3] = byh+tx; yb[3] = yup2-ty;
3462 gPad->PaintPolyLine(4, xb, yb);
3464 if (eyl != 0. && ylow2 == ylow && DrawYLow) {
3465 xb[0] = byl-tx; yb[0] = ylow2+ty;
3466 xb[1] = byl-tx; yb[1] = ylow2;
3467 xb[2] = byl+tx; yb[2] = ylow2;
3468 xb[3] = byl+tx; yb[3] = ylow2+ty;
3469 gPad->PaintPolyLine(4, xb, yb);
3472 if (eyh != 0. && yup2 == yup && DrawYUp)
gPad->PaintLine(byh-tx,yup2,byh+tx,yup2);
3473 if (eyl != 0. && ylow2 == ylow && DrawYLow)
gPad->PaintLine(byl-tx,ylow2,byl+tx,ylow2);
3488 if (option4)
PaintGraph(theGraph, 2*theNpoints, xline.data(), yline.data(),
"FC");
3489 else PaintGraph(theGraph, 2*theNpoints, xline.data(), yline.data(),
"F");
3490 gPad->SetLogx(logx);
3491 gPad->SetLogy(logy);
3502 std::vector<Double_t> xline, yline;
3507 const Int_t kBASEMARKER=8;
3508 static Float_t cxx[30] = {1.0,1.0,0.5,0.5,1.0,1.0,0.5,0.6,1.0,0.5,0.5,1.0,0.5,0.6,1.0,1.0,1.0,1.0,1.0,1.0,0.0,0.0,1.0,1.0,1.0,1.0,0.5,0.5,0.5,1.0};
3509 static Float_t cyy[30] = {1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.5,0.5,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,0.0,1.0,1.0,1.0,1.0,0.5,0.5,0.5,1.0};
3526 const char *arrowOpt =
nullptr;
3527 if (strchr(
option,
'>')) arrowOpt =
">";
3528 if (strstr(
option,
"|>")) arrowOpt =
"|>";
3553 xline.resize(2*theNpoints);
3554 yline.resize(2*theNpoints);
3555 if (xline.empty() || yline.empty()) {
3556 Error(
"PaintGraphErrors",
"too many points, out of memory");
3563 theGraph->TAttLine::Modify();
3579 Double_t sbase = symbolsize*kBASEMARKER;
3583 if (mark >= 20 && mark <= 49) {
3594 Float_t asize = 0.6*symbolsize*kBASEMARKER/
gPad->GetWh();
3599 Bool_t DrawXLeft, DrawXRight, DrawYUp, DrawYLow;
3601 Double_t x,
y,
ex,
ey, xl1, xl2, xr1, xr2, yup, yup1, yup2, ylow, ylow1, ylow2;
3602 for (
Int_t i=0;i<theNpoints;i++) {
3607 x =
gPad->XtoPad(theX[i]);
3608 y =
gPad->YtoPad(theY[i]);
3612 if (x < gPad->GetUxmin())
x =
gPad->GetUxmin();
3613 if (
x >
gPad->GetUxmax())
x =
gPad->GetUxmax();
3614 if (y < gPad->GetUymin())
y =
gPad->GetUymin();
3615 if (
y >
gPad->GetUymax())
y =
gPad->GetUymax();
3617 if (x < gPad->GetUxmin())
continue;
3618 if (
x >
gPad->GetUxmax())
continue;
3619 if (y < gPad->GetUymin())
continue;
3620 if (
y >
gPad->GetUymax())
continue;
3638 xl2 =
gPad->XtoPad(theX[i] -
ex);
3640 xr2 =
gPad->XtoPad(theX[i] +
ex);
3641 if (xl1 < xl2) DrawXLeft =
kFALSE;
3642 if (xr1 > xr2) DrawXRight =
kFALSE;
3656 yup2 =
gPad->YtoPad(theY[i] +
ey);
3658 ylow2 =
gPad->YtoPad(theY[i] -
ey);
3659 if (yup2 < yup1) DrawYUp =
kFALSE;
3660 if (ylow2 > ylow1) DrawYLow =
kFALSE;
3664 if (yup2 >
gPad->GetUymax()) yup2 =
gPad->GetUymax();
3665 if (ylow2 < gPad->GetUymin()) ylow2 =
gPad->GetUymin();
3673 if (x1b < gPad->GetUxmin()) x1b =
gPad->GetUxmin();
3674 if (x1b >
gPad->GetUxmax()) x1b =
gPad->GetUxmax();
3675 if (y1b < gPad->GetUymin()) y1b =
gPad->GetUymin();
3676 if (y1b >
gPad->GetUymax()) y1b =
gPad->GetUymax();
3677 if (x2b < gPad->GetUxmin()) x2b =
gPad->GetUxmin();
3678 if (x2b >
gPad->GetUxmax()) x2b =
gPad->GetUxmax();
3679 if (y2b < gPad->GetUymin()) y2b =
gPad->GetUymin();
3680 if (y2b >
gPad->GetUymax()) y2b =
gPad->GetUymax();
3681 if (option5)
box.PaintBox(x1b, y1b, x2b, y2b,
"l");
3682 else box.PaintBox(x1b, y1b, x2b, y2b);
3690 yline[if1-1] = yup2;
3691 yline[if2-1] = ylow2;
3699 if (DrawXLeft)
arrow.PaintArrow(xl1,
y,xl2,
y,asize,arrowOpt);
3700 if (DrawXRight)
arrow.PaintArrow(xr1,
y,xr2,
y,asize,arrowOpt);
3703 if (DrawXLeft)
gPad->PaintLine(xl1,
y,xl2,
y);
3704 if (DrawXRight)
gPad->PaintLine(xr1,
y,xr2,
y);
3709 xb[0] = xl2+tx; yb[0] =
y-ty;
3710 xb[1] = xl2; yb[1] =
y-ty;
3711 xb[2] = xl2; yb[2] =
y+ty;
3712 xb[3] = xl2+tx; yb[3] =
y+ty;
3713 gPad->PaintPolyLine(4, xb, yb);
3716 xb[0] = xr2-tx; yb[0] =
y-ty;
3717 xb[1] = xr2; yb[1] =
y-ty;
3718 xb[2] = xr2; yb[2] =
y+ty;
3719 xb[3] = xr2-tx; yb[3] =
y+ty;
3720 gPad->PaintPolyLine(4, xb, yb);
3723 if (DrawXLeft)
gPad->PaintLine(xl2,
y-ty,xl2,
y+ty);
3724 if (DrawXRight)
gPad->PaintLine(xr2,
y-ty,xr2,
y+ty);
3733 if (yup2 == yup)
arrow.PaintArrow(
x,yup1,
x,yup2,asize,arrowOpt);
3734 else gPad->PaintLine(
x,yup1,
x,yup2);
3737 if (ylow2 == ylow)
arrow.PaintArrow(
x,ylow1,
x,ylow2,asize,arrowOpt);
3738 else gPad->PaintLine(
x,ylow1,
x,ylow2);
3742 if (DrawYUp)
gPad->PaintLine(
x,yup1,
x,yup2);
3743 if (DrawYLow)
gPad->PaintLine(
x,ylow1,
x,ylow2);
3747 if (yup2 == yup && DrawYUp) {
3748 xb[0] =
x-tx; yb[0] = yup2-ty;
3749 xb[1] =
x-tx; yb[1] = yup2;
3750 xb[2] =
x+tx; yb[2] = yup2;
3751 xb[3] =
x+tx; yb[3] = yup2-ty;
3752 gPad->PaintPolyLine(4, xb, yb);
3754 if (ylow2 == ylow && DrawYLow) {
3755 xb[0] =
x-tx; yb[0] = ylow2+ty;
3756 xb[1] =
x-tx; yb[1] = ylow2;
3757 xb[2] =
x+tx; yb[2] = ylow2;
3758 xb[3] =
x+tx; yb[3] = ylow2+ty;
3759 gPad->PaintPolyLine(4, xb, yb);
3762 if (yup2 == yup && DrawYUp)
gPad->PaintLine(
x-tx,yup2,
x+tx,yup2);
3763 if (ylow2 == ylow && DrawYLow)
gPad->PaintLine(
x-tx,ylow2,
x+tx,ylow2);
3778 if (option4)
PaintGraph(theGraph, 2*theNpoints, xline.data(), yline.data(),
"FC");
3779 else PaintGraph(theGraph, 2*theNpoints, xline.data(), yline.data(),
"F");
3780 gPad->SetLogx(logx);
3781 gPad->SetLogy(logy);
3793 Double_t rwrmin, rwrmax, rwtmin, rwtmax;
3797 Int_t theNpoints = theGraphPolar->
GetN();
3803 if (theNpoints<1)
return;
3818 if (thePolargram)
if (!
gPad->FindObject(thePolargram->
GetName())) thePolargram=
nullptr;
3819 if (!thePolargram) {
3832 if (!thePolargram) {
3834 rwrmin = theY[0]; rwrmax = theY[theNpoints-1];
3835 rwtmin = theX[0]; rwtmax = theX[theNpoints-1];
3837 for (ipt = 0; ipt < theNpoints; ipt++) {
3840 if (theX[ipt] -theEX[ipt] < rwtmin) rwtmin = theX[ipt]-theEX[ipt];
3841 if (theX[ipt] +theEX[ipt] > rwtmax) rwtmax = theX[ipt]+theEX[ipt];
3843 if (theX[ipt] < rwtmin) rwtmin=theX[ipt];
3844 if (theX[ipt] > rwtmax) rwtmax=theX[ipt];
3847 if (theY[ipt] -theEY[ipt] < rwrmin) rwrmin = theY[ipt]-theEY[ipt];
3848 if (theY[ipt] +theEY[ipt] > rwrmax) rwrmax = theY[ipt]+theEY[ipt];
3850 if (theY[ipt] < rwrmin) rwrmin=theY[ipt];
3851 if (theY[ipt] > rwrmax) rwrmax=theY[ipt];
3855 if (rwrmin == rwrmax) rwrmax += 1.;
3856 if (rwtmin == rwtmax) rwtmax += 1.;
3863 rwtmax += dt/theNpoints;
3865 rwrmin = thePolargram->
GetRMin();
3866 rwrmax = thePolargram->
GetRMax();
3867 rwtmin = thePolargram->
GetTMin();
3868 rwtmax = thePolargram->
GetTMax();
3873 thePolargram =
new TGraphPolargram(
"Polargram",rwrmin,rwrmax,rwtmin,rwtmax);
3877 if (nolabel) thePolargram->
Draw(
"N");
3878 else thePolargram->
Draw(
"");
3887 Double_t radiusNDC = rwrmax-rwrmin;
3897 for (i=0; i<theNpoints; i++) {
3898 Double_t eymin, eymax, exmin,exmax;
3899 exmin = (theY[i]-theEY[i]-rwrmin)/radiusNDC*
3901 eymin = (theY[i]-theEY[i]-rwrmin)/radiusNDC*
3903 exmax = (theY[i]+theEY[i]-rwrmin)/radiusNDC*
3905 eymax = (theY[i]+theEY[i]-rwrmin)/radiusNDC*
3907 theGraphPolar->TAttLine::Modify();
3908 if (exmin != exmax || eymin != eymax)
gPad->PaintLine(exmin,eymin,exmax,eymax);
3912 for (i=0; i<theNpoints; i++) {
3913 Double_t rad = (theY[i]-rwrmin)/radiusNDC;
3916 theGraphPolar->TAttLine::Modify();
3917 if (phimin != phimax) thePolargram->
PaintCircle(0,0,rad,phimin,phimax,0);
3923 if (!(
gPad->GetLogx()) && !(
gPad->GetLogy())) {
3924 Double_t a,
b,
c=1,
x1,
x2,
y1,
y2, discr, norm1, norm2, xts, yts;
3932 for (i=0; i<theNpoints; i++) {
3935 xt = (theY[i]-rwrmin)/radiusNDC*
TMath::Cos(
c*(theX[i]-rwtmin)/thetaNDC);
3936 yt = (theY[i]-rwrmin)/radiusNDC*
TMath::Sin(
c*(theX[i]-rwtmin)/thetaNDC);
3937 norm = sqrt(xt*xt+yt*yt);
3942 if (!previouspointin) {
3947 a = (yt-yts)/(xt-xts);
3949 discr = 4*(
a*
a-
b*
b+1);
3950 x1 = (-2*
a*
b+sqrt(discr))/(2*(
a*
a+1));
3951 x2 = (-2*
a*
b-sqrt(discr))/(2*(
a*
a+1));
3954 norm1 = sqrt((
x1-xt)*(
x1-xt)+(
y1-yt)*(
y1-yt));
3955 norm2 = sqrt((
x2-xt)*(
x2-xt)+(
y2-yt)*(
y2-yt));
3956 previouspointin =
kFALSE;
3958 if (norm1 < norm2) {
3968 PaintGraph(theGraphPolar, j+1, theXpol, theYpol, opt);
3973 if (j>=1 && !previouspointin) {
3974 a = (yt-theYpol[j])/(xt-theXpol[j]);
3975 b = theYpol[j]-
a*theXpol[j];
3976 previouspointin =
kTRUE;
3977 discr = 4*(
a*
a-
b*
b+1);
3978 x1 = (-2*
a*
b+sqrt(discr))/(2*(
a*
a+1));
3979 x2 = (-2*
a*
b-sqrt(discr))/(2*(
a*
a+1));
3982 norm1 = sqrt((
x1-xt)*(
x1-xt)+(
y1-yt)*(
y1-yt));
3983 norm2 = sqrt((
x2-xt)*(
x2-xt)+(
y2-yt)*(
y2-yt));
3985 if (norm1 < norm2) {
3992 PaintGraph(theGraphPolar, j+1, theXpol, theYpol, opt);
3999 PaintGraph(theGraphPolar, j+1, theXpol, theYpol, opt);
4002 for (i=0; i<theNpoints; i++) {
4006 PaintGraph(theGraphPolar, theNpoints, theXpol, theYpol,opt);
4014 TIter next(
gPad->GetListOfPrimitives());
4015 while (
auto obj = next()) {
4019 if (strcmp(title->
GetName(),
"title")) {title =
nullptr;
continue;}
4023 if (title)
delete title;
4029 if (ht <= 0) ht = 0.05;
4050 if (talh < 1) talh = 1;
else if (talh > 3) talh = 3;
4052 if (talv < 1) talv = 1;
else if (talv > 3) talv = 3;
4094 TF1 *theF = theGraphQQ->
GetF();
4097 Error(
"TGraphQQ::Paint",
"2nd dataset or theoretical function not specified");
4112 Double_t yxmin, xymin, yxmax, xymax;
4118 TLine line1, line2, line3;
4121 yxmin = (theYq2-theYq1)*(
xmin-theXq1)/(theXq2-theXq1) + theYq1;
4123 xymin = (theXq2-theXq1)*(
ymin-theYq1)/(theYq2-theYq1) + theXq1;
4129 line2.
PaintLine(xqmin, yqmin, xqmax, yqmax);
4131 yxmax = (theYq2-theYq1)*(
xmax-theXq1)/(theXq2-theXq1) + theYq1;
4133 xymax = (theXq2-theXq1)*(
ymax-theYq1)/(theYq2-theYq1) + theXq1;
4176 if (lxp) opth.
Append(
"x+");
4177 if (lyp) opth.
Append(
"y+");
4202 XA1 =
gPad->GetUxmin();
4203 XA2 =
gPad->GetUxmax();
4204 YA1 =
gPad->GetUymin();
4205 YA2 =
gPad->GetUymax();
4242 if (
gPad->GetGridx()) {
4243 if (
gPad->GetLogy()) {
4246 GL = (YA2 - YA1) / (
gPad->GetY2() -
gPad->GetY1());
4254 TGaxis *theReversedXaxis;
4255 if (
gPad->GetLogx()) {
4268 theReversedXaxis =
new TGaxis(
gPad->GetUxmax(),
4282 theReversedXaxis->
Paint();
4286 if (
gPad->GetLogx()) {
4290 for (i=0; i<
N; i++) rX[i] = dX-
X[i];
4294 if (rEXhigh && EXlow)
for (i=0; i<
N; i++) rEXhigh[i] = EXlow[i];
4295 if (rEXlow && EXhigh)
for (i=0; i<
N; i++) rEXlow[i] = EXhigh[i];
4298 if (rEXhighd && EXlowd)
for (i=0; i<
N; i++) rEXhighd[i] = EXlowd[i];
4299 if (rEXlowd && EXhighd)
for (i=0; i<
N; i++) rEXlowd[i] = EXhighd[i];
4310 if (
gPad->GetGridy()) {
4311 if (
gPad->GetLogx()) {
4314 GL = (XA2 - XA1) / (
gPad->GetX2() -
gPad->GetX1());
4322 TGaxis *theReversedYaxis;
4323 if (
gPad->GetLogy()) {
4349 theReversedYaxis->
Paint();
4353 if (
gPad->GetLogy()) {
4357 for (i=0; i<
N; i++) rY[i] = dY-Y[i];
4361 if (rEYhigh && EYlow)
for (i=0; i<
N; i++) rEYhigh[i] = EYlow[i];
4362 if (rEYlow && EYhigh)
for (i=0; i<
N; i++) rEYlow[i] = EYhigh[i];
4365 if (rEYhighd && EYlowd)
for (i=0; i<
N; i++) rEYhighd[i] = EYlowd[i];
4366 if (rEYlowd && EYhighd)
for (i=0; i<
N; i++) rEYlowd[i] = EYhighd[i];
4370 if (rEYlowd)
for (i=0; i<
N; i++) rEYlowd[i] = -rEYlowd[i];
4371 if (rEYhighd)
for (i=0; i<
N; i++) rEYhighd[i] = -rEYhighd[i];
4374 if (rEXlowd)
for (i=0; i<
N; i++) rEXlowd[i] = -rEXlowd[i];
4375 if (rEXhighd)
for (i=0; i<
N; i++) rEXhighd[i] = -rEXhighd[i];
4400 if (opt.
Contains(
"A")) optionAxis = 1;
else optionAxis = 0;
4405 double *theColor = theScatter->
GetColor();
4406 double *theSize = theScatter->
GetSize();
4410 double minx = DBL_MAX;
4411 double maxx = -DBL_MAX;
4412 double miny = DBL_MAX;
4413 double maxy = -DBL_MAX;
4414 double minc = DBL_MAX;
4415 double maxc = -DBL_MAX;
4416 double mins = DBL_MAX;
4417 double maxs = -DBL_MAX;
4418 for (
int i=0; i<
n; i++) {
4436 if (theX[0] == 0.) {
4446 if (theY[0] == 0.) {
4457 if (theColor[0] == 0.) {
4462 minc = theColor[0] -
d;
4463 maxc = theColor[0] +
d;
4469 if (theSize[0] == 0.) {
4474 mins = theSize[0] -
d;
4475 maxs = theSize[0] +
d;
4481 if (optionAxis)
h->
Paint(
" ");
4482 if (
h->GetMinimum() !=
h->GetMaximum()) {
4483 if (minc<h->GetMinimum()) minc =
h->GetMinimum();
4484 if (maxc>
h->GetMaximum()) maxc =
h->GetMaximum();
4496 functions->
Remove(palette);
4497 delete palette; palette =
nullptr;
4501 functions->
Remove(palette);
4502 delete palette; palette =
nullptr;
4523 palette->
SetTitle(
h->GetZaxis()->GetTitle());
4529 if (palette) palette->
Paint();
4534 int logx =
gPad->GetLogx();
4535 int logy =
gPad->GetLogy();
4536 int logz =
gPad->GetLogz();
4537 if (theColor && logz) {
4538 if (minc>0) minc = log10(minc);
4539 if (maxc>0) maxc = log10(maxc);
4542 theScatter->TAttMarker::Modify();
4545 for (
int i=0; i<
n; i++) {
4548 if (theColor[i]>0)
c = log10(theColor[i]);
4553 if (
c<minc)
continue;
4554 if (
c>maxc)
continue;
4556 if (nc > nbcol-1) nc = nbcol-1;
4560 ms = (MaxMarkerSize-MinMarkerSize)*((theSize[i]-mins)/(maxs-mins))+MinMarkerSize;
4563 if (theColor || theSize) theScatter->TAttMarker::Modify();
4565 if (theX[i]>0)
x = log10(theX[i]);
4571 if (theY[i]>0)
y = log10(theY[i]);
4576 gPad->PaintPolyMarker(1,&
x,&
y);
4597 if (!functions)
return;
4606 obj->Paint(lnk->GetOption());
4626 std::vector<Double_t> xf(2*
n);
4627 std::vector<Double_t> yf(2*
n);
4628 std::vector<Double_t> xt(
n);
4629 std::vector<Double_t> yt(
n);
4630 Double_t x1,
x2,
y1,
y2, x3, y3, xm, ym,
a, a1, a2, a3;
4633 Int_t ix1,iy1,ix2,iy2;
4637 gPad->GetPadPar(x1p,y1p,x2p,y2p);
4638 ix1 = (
Int_t)(iw*x1p);
4639 iy1 = (
Int_t)(ih*y1p);
4640 ix2 = (
Int_t)(iw*x2p);
4641 iy2 = (
Int_t)(ih*y2p);
4653 gPad->GetRange(rx1,ry1,rx2,ry2);
4654 Double_t rx = (x2ndc-x1ndc)/(rx2-rx1);
4655 Double_t ry = (y2ndc-y1ndc)/(ry2-ry1);
4659 xf[0] = rx*(
x[0]-rx1)+x1ndc;
4660 yf[0] = ry*(
y[0]-ry1)+y1ndc;
4662 for (i=1; i<
n; i++) {
4663 if (
x[i]==
x[i-1] &&
y[i]==
y[i-1])
continue;
4665 xf[nf] = rx*(
x[i]-rx1)+x1ndc;
4666 if (xf[i]==xf[i-1]) xf[i] += 0.000001;
4667 yf[nf] = ry*(
y[i]-ry1)+y1ndc;
4686 if (xf[nf]==xf[nf-1]) {
4691 if (xf[nf]>=xf[nf-1]) {
4700 for (i=1; i<nf; i++) {
4712 if (xi1<xi0) a1 = a1+3.14159;
4718 if (xi0<xi2) a2 = a2+3.14159;
4733 if ((xm-xi0)*(x3-xi0)<0 && (ym-yi0)*(y3-yi0)<0) {
4737 if ((xm==
x1) && (ym==
y1)) {
4746 if (xf[nf]==xf[0] && yf[nf]==yf[0]) {
4747 xm = (xt[nf]+xt[0])*0.5;
4748 ym = (yt[nf]+yt[0])*0.5;
4756 if ((xm-xf[0])*(x3-xf[0])<0 && (ym-yf[0])*(y3-yf[0])<0) {
4770 for (i=nf2; i>0; i--) {
4771 for (j=i-1; j>0; j--) {
4772 if (xt[i-1]==xt[i] || xt[j-1]==xt[j])
continue;
4773 c1 = (yt[i-1]-yt[i])/(xt[i-1]-xt[i]);
4774 b1 = yt[i]-
c1*xt[i];
4775 c2 = (yt[j-1]-yt[j])/(xt[j-1]-xt[j]);
4776 b2 = yt[j]-
c2*xt[j];
4778 xc = (b2-b1)/(
c1-
c2);
4784 nf++; xf[nf] = xt[i]; yf[nf] = yt[i];
4785 nf++; xf[nf] = xc ; yf[nf] = yc;
4803 nf++; xf[nf] = xt[0]; yf[nf] = yt[0];
4806 for (i=0; i<nf+1; i++) {
4807 xf[i] = (1/rx)*(xf[i]-x1ndc)+rx1;
4808 yf[i] = (1/ry)*(yf[i]-y1ndc)+ry1;
4812 gPad->PaintFillArea(nf+1,xf.data(),yf.data());
4813 theGraph->TAttLine::Modify();
4826 TIter next(functions);
4827 while (
auto obj = next()) {
4837 if (!dofit) fit =
nullptr;
4839 if (dofit == 1) dofit = 111;
4841 Int_t print_fval = dofit%10;
4842 Int_t print_ferrors = (dofit/10)%10;
4843 Int_t print_fchi2 = (dofit/100)%10;
4844 Int_t print_fprob = (dofit/1000)%10;
4845 Int_t nlinesf = print_fval + print_fchi2 + print_fprob;
4847 if (print_fval < 2) nlinesf += fit->GetNumberFreeParameters();
4848 else nlinesf += fit->GetNpar();
4884 Int_t ndf = fit->GetNDF();
4886 snprintf(t,64,textstats,fit->GetChisquare());
4887 if (print_fchi2) stats->
AddText(t);
4893 if (print_fval || print_ferrors) {
4895 for (
Int_t ipar=0;ipar<fit->GetNpar();ipar++) {
4896 fit->GetParLimits(ipar,parmin,parmax);
4897 if (print_fval < 2 && parmin*parmax != 0 && parmin >= parmax)
continue;
4898 if (print_ferrors) {
4900 snprintf(t,64,textstats,fit->GetParameter(ipar)
4901 ,fit->GetParError(ipar));
4904 snprintf(t,64,textstats,fit->GetParameter(ipar));
4911 if (!done) functions->
Add(stats);
4941 Int_t i, k, kp, km, npointsMax, banksize, n2, npt;
4942 Int_t maxiterations, finished;
4943 Int_t jtype, ktype, closed;
4944 Double_t sxmin, sxmax, symin, symax;
4947 Double_t ratio_signs, xratio, yratio;
4953 Double_t co, so, ct, st, ctu, stu, xnt;
4954 Double_t dx1, dy1, dx2, dy2, dk1, dk2;
4961 c = t = co = so = ct = st = ctu = stu = dx1 = dy1 = dx2 = dy2 = 0;
4962 xt = yt = xa = xb = ya = yb = u1 = u2 = u3 = tj = sb = 0;
4964 npointsMax = npoints*10;
4968 std::vector<Double_t> qlx(npointsMax);
4969 std::vector<Double_t> qly(npointsMax);
4970 if (qlx.empty() || qly.empty()) {
4971 Error(
"Smooth",
"not enough space in memory");
4978 jtype = (drawtype%1000)-10;
4979 if (jtype > 0) { ktype = jtype; loptx =
kTRUE; }
4980 else ktype = drawtype%1000;
5009 for (i=1;i<npoints;i++) {
5011 if ((
x[i]-
x[i-1])*(
x[i-1]-
x[i-2]) < 0) six++;
5012 if ((
y[i]-
y[i-1])*(
y[i-1]-
y[i-2]) < 0) siy++;
5014 if (
x[i] < sxmin) sxmin =
x[i];
5015 if (
x[i] > sxmax) sxmax =
x[i];
5016 if (
y[i] < symin) symin =
y[i];
5017 if (
y[i] > symax) symax =
y[i];
5022 if (dx1n < 0.01*(sxmax-sxmin) && dy1n < 0.01*(symax-symin)) closed = 1;
5023 if (sxmin == sxmax) {
5026 if (six > 1) ratio_signs = siy/six;
5027 else ratio_signs = 20;
5028 xratio = ratio_signs/(sxmax-sxmin);
5030 if (symin == symax) yratio = 1;
5031 else yratio = 1/(symax-symin);
5035 for (i=0;i<npoints;i++) {
5036 x[i] = (
x[i]-sxmin)*xratio;
5037 y[i] = (
y[i]-symin)*yratio;
5056 if (
x[0] !=
x[npoints-1] ||
y[0] !=
y[npoints-1])
goto L40;
5057 if (
x[npoints-2] ==
x[npoints-1] &&
y[npoints-2] ==
y[npoints-1])
goto L40;
5058 if (
x[0] ==
x[1] &&
y[0] ==
y[1])
goto L40;
5081 if (npt > 1)
goto L310;
5085 if (
x[k-1] ==
x[k-2] &&
y[k-1] ==
y[k-2])
goto L50;
5090 if (npt > 1)
goto L310;
5093 if (k < npoints)
goto L90;
5094 if (!flgic) { kp = 2;
goto L130;}
5097 if (flgis)
goto L150;
5107 if (
x[k-1] ==
x[k] &&
y[k-1] ==
y[k])
goto L80;
5115 if (!flgis)
goto L50;
5130 dx1 =
x[k-1] -
x[km-1];
5131 dy1 =
y[k-1] -
y[km-1];
5132 dk1 = dx1*dx1 + dy1*dy1;
5133 dx2 =
x[kp-1] -
x[k-1];
5134 dy2 =
y[kp-1] -
y[k-1];
5135 dk2 = dx2*dx2 + dy2*dy2;
5136 ctu = dx1*dk2 + dx2*dk1;
5137 stu = dy1*dk2 + dy2*dk1;
5138 xnt = ctu*ctu + stu*stu;
5152 if (flgis)
goto L160;
5156 w3 = 2*(dx1*dy2-dx2*dy1);
5168 w3 = 2*(dx1*dy2-dx2*dy1);
5177 if (k <= 1)
goto L120;
5207 xa = (
a*t-2*dx)/tcube;
5208 xb = (3*dx-(co+
a)*t)/tsquare;
5209 ya = (
b*t-2*dy)/tcube;
5210 yb = (3*dy-(so+
b)*t)/tsquare;
5241 p2 = (u1*tj-u3)*3*tj+u2;
5271 z = s*sth*(s-s*sth)*(w1*sth+w1+w2);
5272 z = z*z/((
a*
a+
b*
b)*(delta*delta));
5273 z = (z+2.642937)*z/((.3715652*z+3.063444)*z+.2441889)-cc;
5277 if (iw > 0)
goto L250;
5278 if (z > err)
goto L240;
5283 if (iw+2 == 0)
goto L190;
5284 if (iw+2 > 0)
goto L290;
5302 theGraph->
Zero(kp,0,sb,err,s,z,maxiterations);
5303 if (kp == 2)
goto L210;
5305 Error(
"Smooth",
"Attempt to plot outside plot limits");
5308 if (iw > 0)
goto L200;
5334 qlx[npt] = sxmin + xt/xratio;
5335 qly[npt] = symin + yt/yratio;
5342 if (npt < banksize)
goto L320;
5343 if (drawtype >= 1000 || ktype > 1) {
5344 Int_t newsize = banksize + n2;
5345 std::vector<Double_t> qtemp(banksize);
5346 for (i=0;i<banksize;i++) qtemp[i] = qlx[i];
5347 qlx.resize(newsize);
5348 for (i=0;i<banksize;i++) qlx[i] = qtemp[i];
5349 for (i=0;i<banksize;i++) qtemp[i] = qly[i];
5350 qly.resize(newsize);
5351 for (i=0;i<banksize;i++) qly[i] = qtemp[i];
5359 if (drawtype >= 1000) {
5360 gPad->PaintFillArea(npt,qlx.data(),qly.data(),
"B");
5364 qlx[npt] = qlx[npt-1];
5365 qlx[npt+1] = qlx[0];
5371 qly[npt] = qly[npt-1];
5372 qly[npt+1] = qly[0];
5374 gPad->PaintFillArea(npt+2,qlx.data(),qly.data());
5377 gPad->PaintPolyLine(npt,qlx.data(),qly.data());
5380 qlx[0] = sxmin + xt/xratio;
5381 qly[0] = symin + yt/yratio;
5383 if (finished > 0)
goto L390;
5384 if (finished < 0) { finished = 0;
goto L110;}
5385 if (s > 0)
goto L180;
5391 for (i=0;i<npoints;i++) {
5392 x[i] = sxmin +
x[i]/xratio;
5393 y[i] = symin +
y[i]/yratio;
const Int_t kMaxPixel
Max value for an int.
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 Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h offset
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t wmin
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 x2
Option_t Option_t TPoint TPoint const char x1
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void xpos
Option_t Option_t TPoint TPoint const char y2
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void ypos
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t wmax
Option_t Option_t TPoint TPoint const char y1
static Int_t gHighlightPoint
static TGraph * gHighlightGraph
static std::unique_ptr< TMarker > gHighlightMarker
R__EXTERN TStyle * gStyle
Draw all kinds of Arrows.
virtual Color_t GetLabelColor() const
virtual Color_t GetAxisColor() const
virtual Float_t GetLabelOffset() const
virtual void SetAxisColor(Color_t color=1, Float_t alpha=1.)
Set color of the line axis and tick marks.
virtual Style_t GetLabelFont() const
virtual void SetLabelOffset(Float_t offset=0.005)
Set distance between the axis and the labels.
virtual Float_t GetLabelSize() const
virtual Float_t GetTickLength() const
virtual void SetTickLength(Float_t length=0.03)
Set tick mark length.
virtual Color_t GetFillColor() const
Return the fill area color.
virtual Style_t GetFillStyle() const
Return the fill area style.
virtual void SetFillColor(Color_t fcolor)
Set the fill area color.
virtual void SetFillStyle(Style_t fstyle)
Set the fill area style.
virtual Color_t GetLineColor() const
Return the line color.
virtual void SetLineStyle(Style_t lstyle)
Set the line style.
virtual Width_t GetLineWidth() const
Return the line width.
virtual void SetLineColor(Color_t lcolor)
Set the line color.
virtual Style_t GetLineStyle() const
Return the line style.
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.
virtual Style_t GetMarkerStyle() const
Return the marker style.
virtual void SetMarkerColor(Color_t mcolor=1)
Set the marker color.
virtual Color_t GetMarkerColor() const
Return the marker color.
virtual Size_t GetMarkerSize() const
Return the marker size.
virtual void SetMarkerStyle(Style_t mstyle=1)
Set the marker style.
virtual void SetMarkerSize(Size_t msize=1)
Set the marker size.
static Style_t GetMarkerStyleBase(Style_t style)
Internal helper function that returns the corresponding marker style with line width 1 for the given ...
virtual void SetTextAlign(Short_t align=11)
Set the text alignment.
virtual void SetTextColor(Color_t tcolor=1)
Set the text color.
virtual void SetTextFont(Font_t tfont=62)
Set the text font.
virtual void SetTextSize(Float_t tsize=1)
Set the text size.
Bool_t GetMoreLogLabels() const
virtual void SetLimits(Double_t xmin, Double_t xmax)
virtual void PaintAxis(Double_t xmin, Double_t ymin, Double_t xmax, Double_t ymax, Double_t &wmin, Double_t &wmax, Int_t &ndiv, Option_t *chopt="", Double_t gridlength=0, Bool_t drawGridOnly=kFALSE)
Control function to draw an axis.
void SetLabelFont(Int_t labelfont)
void SetLabelOffset(Float_t labeloffset)
void SetLabelColor(Int_t labelcolor)
void SetTickLength(Float_t ticklength)
virtual void SetMoreLogLabels(Bool_t more=kTRUE)
Set the kMoreLogLabels bit flag.
void SetTickSize(Float_t ticksize)
void Paint(Option_t *chopt="") override
Draw this axis with its current attributes.
void SetLabelSize(Float_t labelsize)
Double_t * GetEX() const override
Double_t * GetEY() const override
TGraph with asymmetric error bars and multiple y error dimensions.
void PaintGraphPolar(TGraph *theGraph, Option_t *option)
Paint this TGraphPolar with its current attributes.
void PaintGraph(TGraph *theGraph, Int_t npoints, const Double_t *x, const Double_t *y, Option_t *chopt) override
Control function to draw a graph.
void PaintGraphErrors(TGraph *theGraph, Option_t *option)
Paint this TGraphErrors with its current attributes.
void PaintGraphAsymmErrors(TGraph *theGraph, Option_t *option)
Paint this TGraphAsymmErrors with its current attributes.
void PaintGraphMultiErrors(TGraph *theGraph, Option_t *option)
Paint this TGraphMultiErrors with its current attributes.
virtual void PaintHighlightPoint(TGraph *theGraph, Option_t *option)
Paint highlight point as TMarker object (open circle)
void PaintGraphReverse(TGraph *theGraph, Option_t *option)
Paint theGraph reverting values along X and/or Y axis. a new graph is created.
void PaintGrapHist(TGraph *theGraph, Int_t npoints, const Double_t *x, const Double_t *y, Option_t *chopt) override
This is a service method used by THistPainter to paint 1D histograms.
static Int_t fgMaxPointsPerLine
Number of points per chunks' line when drawing a graph.
void PaintStats(TGraph *theGraph, TF1 *fit) override
Paint the statistics box with the fit info.
void PaintPolyLineHatches(TGraph *theGraph, Int_t n, const Double_t *x, const Double_t *y)
Paint a polyline with hatches on one side showing an exclusion zone.
void DrawPanelHelper(TGraph *theGraph) override
Display a panel with all histogram drawing options.
char * GetObjectInfoHelper(TGraph *theGraph, Int_t px, Int_t py) const override
void ExecuteEventHelper(TGraph *theGraph, Int_t event, Int_t px, Int_t py) override
Execute action corresponding to one event.
virtual void HighlightPoint(TGraph *theGraph, Int_t hpoint, Int_t distance)
Check on highlight point.
void ComputeLogs(Int_t npoints, Int_t opt)
Compute the logarithm of variables gxwork and gywork according to the value of Options and put the re...
std::vector< Double_t > gxworkl
Int_t DistancetoPrimitiveHelper(TGraph *theGraph, Int_t px, Int_t py) override
Compute distance from point px,py to a graph.
std::vector< Double_t > gxwork
std::vector< Double_t > gywork
void PaintScatter(TScatter *theScatter, Option_t *option) override
Paint a scatter plot.
void Smooth(TGraph *theGraph, Int_t npoints, Double_t *x, Double_t *y, Int_t drawtype)
Smooth a curve given by N points.
std::vector< Double_t > gyworkl
Internal buffers for coordinates. Used for graphs painting.
void SetHighlight(TGraph *theGraph) override
Set highlight (enable/disable) mode for theGraph.
virtual Int_t GetHighlightPoint(TGraph *theGraph) const
Return the highlighted point for theGraph.
void PaintGraphSimple(TGraph *theGraph, Option_t *option)
Paint a simple graph, without errors bars.
void PaintGraphQQ(TGraph *theGraph, Option_t *option)
Paint this graphQQ. No options for the time being.
~TGraphPainter() override
Destructor.
static void SetMaxPointsPerLine(Int_t maxp=50)
Static function to set fgMaxPointsPerLine for graph painting.
void PaintGraphBentErrors(TGraph *theGraph, Option_t *option)
Paint this TGraphBentErrors with its current attributes.
TGraphPainter()
Default constructor.
void PaintHelper(TGraph *theGraph, Option_t *option) override
Paint a any kind of TGraph.
Double_t * GetYpol()
Return points in polar coordinates.
TGraphPolargram * GetPolargram()
void SetPolargram(TGraphPolargram *p)
void SetOptionAxis(Bool_t opt)
Double_t * GetXpol()
Return points in polar coordinates.
void PaintCircle(Double_t x, Double_t y, Double_t r, Double_t phimin, Double_t phimax, Double_t theta)
This is simplified from TEllipse::PaintEllipse.
void Draw(Option_t *options="") override
Draw Polargram.
This class allows to draw quantile-quantile plots.
A TGraph is an object made of two arrays X and Y with npoints each.
virtual Double_t * GetEXhighd() const
virtual Bool_t IsEditable() const
@ kClipFrame
Clip to the frame boundary.
@ kNoStats
Don't draw stats box.
Double_t GetMinimum() const
virtual Double_t * GetEYlow() const
virtual Double_t * GetEX() const
Double_t GetMaximum() const
virtual Double_t * GetEXlowd() const
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 Double_t * GetEYlowd() const
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.
TList * GetListOfFunctions() const
virtual Bool_t IsHighlight() const
virtual Double_t * GetEYhighd() const
TAxis * GetXaxis() const
Get x axis of the graph.
virtual Double_t * GetEXhigh() const
virtual Double_t * GetEYhigh() const
TAxis * GetYaxis() const
Get y axis of the graph.
virtual TH1F * GetHistogram() const
Returns a pointer to the histogram used to draw the axis Takes into account the two following cases.
virtual Double_t * GetEY() const
virtual void SetHistogram(TH1F *h)
virtual Double_t * GetEXlow() const
virtual Int_t GetPoint(Int_t i, Double_t &x, Double_t &y) const
Get x and y values for point number i.
1-D histogram with a float per channel (see TH1 documentation)
virtual void SetDirectory(TDirectory *dir)
By default, when a histogram is created, it is added to the list of histogram objects in the current ...
Int_t DistancetoPrimitive(Int_t px, Int_t py) override
Compute distance from point px,py to a line.
virtual Double_t GetMinimumStored() const
@ kNoTitle
Don't draw the histogram title.
@ kNoStats
Don't draw stats box.
virtual Double_t GetMaximum(Double_t maxval=FLT_MAX) const
Return maximum value smaller than maxval of bins in the range, unless the value has been overridden b...
virtual void SetMaximum(Double_t maximum=-1111)
virtual Int_t GetNdivisions(Option_t *axis="X") const
Return the number of divisions for "axis".
virtual void SetMinimum(Double_t minimum=-1111)
void Paint(Option_t *option="") override
Control routine to paint any kind of histograms.
virtual Double_t GetMaximumStored() const
virtual Double_t GetMinimum(Double_t minval=-FLT_MAX) const
Return minimum value larger than minval of bins in the range, unless the value has been overridden by...
virtual void Sumw2(Bool_t flag=kTRUE)
Create structure to store sum of squares of weights.
2-D histogram with a float per channel (see TH1 documentation)
To draw Mathematical Formula.
Use the TLine constructor to create a simple line.
virtual void PaintLine(Double_t x1, Double_t y1, Double_t x2, Double_t y2)
Draw this line with new coordinates.
TObject * Next() override
Return next object in the list. Returns 0 when no more objects in list.
TObject * FindObject(const char *name) const override
Find an object in this list using its name.
void Add(TObject *obj) override
TObject * Remove(TObject *obj) override
Remove object from the list.
TObject * First() const override
Return the first object in the list. Returns 0 when list is empty.
virtual TObjLink * FirstLink() const
void AddFirst(TObject *obj) override
Add object at the beginning of the list.
TObject * Clone(const char *newname="") const override
Make a clone of an object using the Streamer facility.
void Copy(TObject &named) const override
Copy this to obj.
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
const char * GetName() const override
Returns name of object.
const char * GetTitle() const override
Returns title of object.
TObject * GetObject() const
Mother of all ROOT objects.
virtual const char * GetName() const
Returns name of object.
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
virtual Option_t * GetDrawOption() const
Get option used by the graphics system to draw this object.
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
virtual const char * GetTitle() const
Returns title of object.
@ kCannotPick
if object in a pad cannot be picked
@ kCanDelete
if object in a list can be deleted
@ kMustCleanup
if object destructor must call RecursiveRemove()
The palette painting class.
void Paint(Option_t *option="") override
Paint the palette.
virtual void SetNdivisions(Int_t ndiv=10)
virtual void SetTitle(const char *title="")
virtual void SetTitleColor(Int_t color=1)
virtual void SetLabelFont(Int_t font=42)
virtual void SetLabelOffset(Float_t offset=0.005)
virtual void SetTitleOffset(Float_t offset=1)
virtual void SetLabelColor(Int_t color=1)
virtual void SetTitleFont(Int_t font=42)
virtual void SetTitleSize(Float_t size=0.035)
virtual void SetLabelSize(Float_t size=0.035)
The histogram statistics painter class.
virtual void SetStatFormat(const char *format="6.4g")
Change (i.e. set) the format for printing statistics.
void SetOptStat(Int_t stat=1)
Set the stat option.
virtual const char * GetFitFormat() const
virtual void SetFitFormat(const char *format="5.4g")
Change (i.e. set) the format for printing fit parameters in statistics box.
Int_t GetOptFit() const
Return the fit option.
void SetParent(TObject *obj) override
void SetOptFit(Int_t fit=1)
Set the fit option.
void Paint(Option_t *option="") override
Paint the pave stat.
A Pave (see TPave) with text, lines or/and boxes inside.
virtual TText * AddText(Double_t x1, Double_t y1, const char *label)
Add a new Text line to this pavetext at given coordinates.
void Clear(Option_t *option="") override
Clear all lines in this pavetext.
void Draw(Option_t *option="") override
Draw this pavetext with its current attributes.
void Paint(Option_t *option="") override
Paint this pavetext with its current attributes.
virtual TText * GetLine(Int_t number) const
Get Pointer to line number in this pavetext.
const char * GetName() const override
Returns name of object.
virtual void SetName(const char *name="")
virtual void SetBorderSize(Int_t bordersize=4)
Sets the border size of the TPave box and shadow.
Double_t GetX1NDC() const
virtual void SetX2NDC(Double_t x2)
Regular expression class.
A TScatter is able to draw four variables scatter plot on a single plot.
TGraph * GetGraph() const
Get the graph holding X and Y positions.
Double_t GetMaxMarkerSize() const
Get the largest marker size used to paint the markers.
Double_t * GetSize() const
Get the array of marker sizes.
TH2F * GetHistogram() const
Get the graph histogram used for drawing axis.
Double_t * GetColor() const
Get the array of colors.
Double_t GetMinMarkerSize() const
Get the smallest marker size used to paint the markers.
TString Copy() const
Copy a string.
void ToLower()
Change string to lower-case.
int CompareTo(const char *cs, ECaseCompare cmp=kExact) const
Compare a string to char *cs2.
Ssiz_t First(char c) const
Find first occurrence of a character c.
const char * Data() const
TString & ReplaceAll(const TString &s1, const TString &s2)
void ToUpper()
Change string to upper case.
Int_t CountChar(Int_t c) const
Return number of times character c occurs in the string.
TString & Append(const char *cs)
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Color_t GetLabelColor(Option_t *axis="X") const
Return the label color number in the axis.
Color_t GetStatTextColor() const
Float_t GetTitleX() const
Int_t GetOptTitle() const
Int_t GetNdivisions(Option_t *axis="X") const
Return number of divisions.
Float_t GetStatFontSize() const
Float_t GetBarOffset() const
Float_t GetLabelSize(Option_t *axis="X") const
Return label size.
Float_t GetTickLength(Option_t *axis="X") const
Return tick length.
Style_t GetLabelFont(Option_t *axis="X") const
Return label font.
Float_t GetTitleY() const
Style_t GetTitleFont(Option_t *axis="X") const
Return title font.
Color_t GetTitleFillColor() const
Style_t GetTitleStyle() const
Float_t GetLabelOffset(Option_t *axis="X") const
Return label offset.
Color_t GetStatColor() const
Float_t GetBarWidth() const
void SetDrawBorder(Int_t drawborder=1)
Width_t GetTitleBorderSize() const
Int_t GetColorPalette(Int_t i) const
Return color number i in current palette.
Float_t GetEndErrorSize() const
Int_t GetDrawBorder() const
Width_t GetStatBorderSize() const
Color_t GetTitleTextColor() const
Float_t GetTitleH() const
Style_t GetStatStyle() const
const char * GetFitFormat() const
const char * GetStatFormat() const
Int_t GetNumberOfColors() const
Return number of colors in the color palette.
Style_t GetStatFont() const
Float_t GetTitleFontSize() const
Int_t GetTitleAlign() const
Color_t GetAxisColor(Option_t *axis="X") const
Return the axis color number in the axis.
Float_t GetTitleW() const
Base class for several text objects.
Abstract base class used by ROOT graphics editor.
static TVirtualPadEditor * GetPadEditor(Bool_t load=kTRUE)
Returns the pad editor dialog. Static method.
small helper class to store/restore gPad context in TPad methods
void box(Int_t pat, Double_t x1, Double_t y1, Double_t x2, Double_t y2)
Int_t Nint(T x)
Round to nearest integer. Rounds half integers to the nearest even integer.
Short_t Max(Short_t a, Short_t b)
Returns the largest of a and b.
Double_t Prob(Double_t chi2, Int_t ndf)
Computation of the probability for a certain Chi-squared (chi2) and number of degrees of freedom (ndf...
Bool_t IsInside(T xp, T yp, Int_t np, T *x, T *y)
Function which returns kTRUE if point xp,yp lies inside the polygon defined by the np points in array...
Double_t ATan(Double_t)
Returns the principal value of the arc tangent of x, expressed in radians.
constexpr Double_t PiOver2()
Double_t Sqrt(Double_t x)
Returns the square root of x.
LongDouble_t Power(LongDouble_t x, LongDouble_t y)
Returns x raised to the power y.
Short_t Min(Short_t a, Short_t b)
Returns the smallest of a and b.
Double_t Cos(Double_t)
Returns the cosine of an angle of x radians.
Double_t Sin(Double_t)
Returns the sine of an angle of x radians.
Double_t Log10(Double_t x)
Returns the common (base-10) logarithm of x.
Short_t Abs(Short_t d)
Returns the absolute value of parameter Short_t d.