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(
Form(
"((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++) {
1503 if (optionCurveFill) {
1505 if (xn !=
x1 || yn !=
y1) nloop++;
1509 for (i=1;i<=nloop;i++) {
1534 for (i=1;i<=nloop;i++) {
1538 if (
y[i-1] < minimum ||
y[i-1] > maximum)
continue;
1539 if (
x[i-1] < uxmin ||
x[i-1] > uxmax)
continue;
1565 for (i=1;i<=npoints;i++) {
1580 for (i=1;i<=npoints;i++) {
1595 if(FillSave ==
gPad->GetFrameFillColor()) {
1597 if (
gPad->GetFrameFillColor()==1) {
1599 theGraph->TAttFill::Modify();
1602 theGraph->TAttFill::Modify();
1608 for (i=1;i<npoints;i++) {
1609 if (
x[i] < barxmin) barxmin =
x[i];
1610 if (
x[i] > barxmax) barxmax =
x[i];
1612 bdelta = (barxmax-barxmin)/
Double_t(npoints);
1616 for (i=1;i<npoints;i++) {
1617 if (
y[i] < barymin) barymin =
y[i];
1618 if (
y[i] > barymax) barymax =
y[i];
1620 bdelta = (barymax-barymin)/
Double_t(npoints);
1624 for (i=1;i<=npoints;i++) {
1625 xlow =
x[i-1] - dbar;
1626 xhigh =
x[i-1] + dbar;
1628 if (xlow < uxmin && xhigh < uxmin)
continue;
1629 if (xhigh > uxmax && xlow > uxmax)
continue;
1630 if (xlow < uxmin) xlow = uxmin;
1631 if (xhigh > uxmax) xhigh = uxmax;
1633 else ylow =
gPad->GetUymin();
1647 for (i=1;i<=npoints;i++) {
1649 ylow =
y[i-1] - dbar;
1650 yhigh =
y[i-1] + dbar;
1661 theGraph->TAttFill::Modify();
1705 const char *where =
"PaintGrapHist";
1707 Int_t optionLine , optionAxis , optionCurve, optionStar, optionMark;
1708 Int_t optionBar , optionRot , optionOne , optionOff ;
1709 Int_t optionFill , optionZ;
1710 Int_t optionHist , optionBins , optionMarker;
1712 Int_t drawtype=0, drawborder, drawbordersav;
1718 Double_t xi, xi1, xj, xj1, yi1, yi, yj, yj1, xwmin, ywmin;
1722 char choptaxis[10] =
" ";
1725 Error(where,
"illegal number of points (%d)", npoints);
1730 if (opt.
Contains(
"H")) optionHist = 1;
else optionHist = 0;
1731 if (opt.
Contains(
"F")) optionFill = 1;
else optionFill = 0;
1732 if (opt.
Contains(
"C")) optionCurve= 1;
else optionCurve= 0;
1733 if (opt.
Contains(
"*")) optionStar = 1;
else optionStar = 0;
1734 if (opt.
Contains(
"R")) optionRot = 1;
else optionRot = 0;
1735 if (opt.
Contains(
"1")) optionOne = 1;
else optionOne = 0;
1736 if (opt.
Contains(
"B")) optionBar = 1;
else optionBar = 0;
1737 if (opt.
Contains(
"N")) optionBins = 1;
else optionBins = 0;
1738 if (opt.
Contains(
"L")) optionLine = 1;
else optionLine = 0;
1739 if (opt.
Contains(
"P")) optionMark = 1;
else optionMark = 0;
1740 if (opt.
Contains(
"A")) optionAxis = 1;
else optionAxis = 0;
1741 if (opt.
Contains(
"][")) optionOff = 1;
else optionOff = 0;
1742 if (opt.
Contains(
"P0")) optionMark = 10;
1744 Int_t optionFill2 = 0;
1746 optionFill = 0; optionFill2 = 1;
1761 nbins = last -
first + 1;
1773 Double_t rounding = (uxmax-uxmin)*1.e-5;
1776 Int_t nx1, nx2, ndivx, ndivy, ndiv;
1789 if (ndivx < 0) strlcat(choptaxis,
"N",10);
1790 if (
gPad->GetGridx()) {
1792 strlcat(choptaxis,
"W",10);
1794 if (
gPad->GetLogx()) {
1798 strlcat(choptaxis,
"G",10);
1808 axis.
PaintAxis(rwxmin,rwymin,rwxmax,rwymin,rwmin,rwmax,ndiv,choptaxis);
1818 strlcat(choptaxis,
"N",10);
1821 if (
gPad->GetGridy()) {
1823 strlcat(choptaxis,
"W",10);
1825 if (
gPad->GetLogy()) {
1829 strlcat(choptaxis,
"G",10);
1838 axis.
PaintAxis(rwxmin,rwymin,rwxmin,rwymax,rwmin,rwmax,ndiv,choptaxis);
1843 theGraph->TAttLine::Modify();
1844 theGraph->TAttFill::Modify();
1845 theGraph->TAttMarker::Modify();
1854 Int_t fwidth =
gPad->GetFrameLineWidth();
1857 if (optionOff) fwidth = 1;
1868 gxwork.resize(2*npoints+10);
1869 gywork.resize(2*npoints+10);
1873 if (optionFill && !optionCurve) {
1881 for (j=
first; j<=last;j++) {
1888 xj1 =
x[j]; xj =
x[j-1];
1890 if (j != last)
Error(where,
"X must be in increasing order");
1891 else Error(where,
"X must have N+1 values with option N");
1899 if ((
gxwork[npt-1] >= uxmin-rounding &&
gxwork[npt-1] <= uxmax+rounding) ||
1900 (
gxwork[npt] >= uxmin-rounding &&
gxwork[npt] <= uxmax+rounding)) npt += 2;
1913 if (!fillarea)
gyworkl[0] = ylast;
1924 for (j=
first; j<=last;j++) {
1929 yj1 =
y[j]; yj =
y[j-1];
1931 if (j != last)
Error(where,
"Y must be in increasing order");
1932 else Error(where,
"Y must have N+1 values with option N");
1938 if ((
gxwork[npt-1] >= uxmin-rounding &&
gxwork[npt-1] <= uxmax+rounding) ||
1939 (
gxwork[npt] >= uxmin-rounding &&
gxwork[npt] <= uxmax+rounding)) npt += 2;
1946 if (!fillarea)
gyworkl[0] = ylast;
1953 theGraph->TAttLine::Modify();
1954 theGraph->TAttFill::Modify();
1959 if ((optionHist) || !chopt[0]) {
1967 for (i=
first; i<=last;i++) {
1972 xi1 =
x[i]; xi =
x[i-1];
1974 if (i != last)
Error(where,
"X must be in increasing order");
1975 else Error(where,
"X must have N+1 values with option N");
1983 if ((
gxwork[npt-1] >= uxmin-rounding &&
gxwork[npt-1] <= uxmax+rounding) ||
1984 (
gxwork[npt] >= uxmin-rounding &&
gxwork[npt] <= uxmax+rounding)) npt += 2;
1996 Int_t nbpoints = npt-2;
2002 for (ip=point1; ip<=nbpoints; ip++) {
2009 Int_t point2 = nbpoints;
2010 for (ip=point2; ip>=point1; ip--) {
2016 nbpoints = point2-point1+1;
2020 if (
gxwork[0] >
gPad->GetUxmin()) { nbpoints++; point1 = 0; }
2021 if (
gxwork[nbpoints] <
gPad->GetUxmax()) nbpoints++;
2024 gPad->PaintPolyLine(nbpoints,
gxworkl.data() + point1,
gyworkl.data() + point1, noClip);
2034 for (i=
first; i<=last;i++) {
2039 yi1 =
y[i]; yi =
y[i-1];
2041 if (i != last)
Error(where,
"Y must be in increasing order");
2042 else Error(where,
"Y must have N+1 values with option N");
2048 if ((
gxwork[npt-1] >= uxmin-rounding &&
gxwork[npt-1] <= uxmax+rounding) ||
2049 (
gxwork[npt] >= uxmin-rounding &&
gxwork[npt] <= uxmax+rounding)) npt += 2;
2068 if (!optionOne) drawtype = 2;
2073 for (i=
first; i<=last;i++) {
2078 xi1 =
x[i]; xi =
x[i-1];
2080 if (i != last)
Error(where,
"X must be in increasing order");
2081 else Error(where,
"X must have N+1 values with option N");
2084 gxwork[npt-1] =
x[i-1] + 0.5*(
x[i]-
x[i-1]);
2115 drawtype = drawtype+10;
2117 for (i=
first; i<=last;i++) {
2122 yi1 =
y[i]; yi =
y[i-1];
2124 if (i != last)
Error(where,
"Y must be in increasing order");
2125 else Error(where,
"Y must have N+1 values with option N");
2128 gywork[npt-1] =
y[i-1] + 0.5*(
y[i]-
y[i-1]);
2161 wminstep =
wmin + 0.5*delta;
2163 gPad->GetRangeAxis(ax1,ay1,ax2,ay2);
2167 for (i=
first; i<=last;i++) {
2172 xi1 =
x[i]; xi =
x[i-1];
2174 if (i != last)
Error(where,
"X must be in increasing order");
2175 else Error(where,
"X must have N+1 values with option N");
2178 gxwork[npt-1] =
x[i-1] + 0.5*(
x[i]-
x[i-1]);
2180 if (
gxwork[npt-1] < uxmin ||
gxwork[npt-1] > uxmax) { npt--;
continue;}
2183 if ((
gywork[npt-1] < rwymin) || ((
gywork[npt-1] > rwymax) && !optionFill2)) {
2220 for (i=
first; i<=last;i++) {
2223 gywork[npt-1] = wminstep+(i-
first)*delta+0.5*delta;
2225 yi1 =
y[i]; yi =
y[i-1];
2227 if (i != last)
Error(where,
"Y must be in increasing order");
2228 else Error(where,
"Y must have N+1 values with option N");
2231 gywork[npt-1] =
y[i-1] + 0.5*(
y[i]-
y[i-1]);
2234 if ((
gxwork[npt-1] < uxmin) || (
gxwork[npt-1] > uxmax)) {
2256 if (optionLine != 0 && npt > 1) {
2267 offset = delta*baroffset; dbar = delta*barwidth;
2271 dbar = (
x[1]-
x[0])*barwidth;
2274 dbar = (
y[1]-
y[0])*barwidth;
2277 drawbordersav = drawborder;
2284 else ylow =
gPad->GetUymin();
2286 for (i=
first; i<=last;i++) {
2293 if (xlow < rwxmax && xhigh > rwxmin)
2297 xhigh = xhigh+delta;
2300 xi1 =
x[i]; xi =
x[i-1];
2302 Error(where,
"X must be in increasing order");
2306 dbar = (
x[i+1]-
x[i])*barwidth;
2316 else xlow =
gPad->GetUxmin();
2317 for (i=
first; i<=last;i++) {
2325 gPad->PaintBox(xlow,ylow,xhigh,yhigh);
2327 ylow = ylow + delta;
2328 yhigh = yhigh + delta;
2331 yi1 =
y[i]; yi =
y[i-1];
2333 Error(where,
"Y must be in increasing order");
2337 dbar = (
y[i+1]-
y[i])*barwidth;
2350 if ((optionStar) || (optionMark)) optionMarker=1;
2356 for (i=
first; i<=last;i++) {
2357 if (!optionBins) xm =
wmin+(i-
first)*delta+0.5*delta;
2358 else xm =
x[i-1] + 0.5*(
x[i]-
x[i-1]);
2360 if (optionMark != 10) {
2361 if (ym<rwymax && ym > rwymin) {
2367 if (ym<rwymax && ym >= rwymin) {
2384 wminstep =
wmin + 0.5*delta;
2385 for (i=
first; i<=last;i++) {
2386 if (!optionBins) ym = wminstep+(i-
first)*delta+0.5*delta;
2387 else ym =
y[i-1] + 0.5*(
y[i]-
y[i-1]);
2389 if (optionMark != 10) {
2390 if (xm<rwxmax && xm > rwxmin) {
2396 if (xm<rwxmax && xm >= rwxmin) {
2431 std::vector<Double_t> xline, yline;
2436 const Int_t kBASEMARKER=8;
2437 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};
2438 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};
2457 const char *arrowOpt =
nullptr;
2458 if (strchr(
option,
'>')) arrowOpt =
">";
2459 if (strstr(
option,
"|>")) arrowOpt =
"|>";
2484 xline.resize(2*theNpoints);
2485 yline.resize(2*theNpoints);
2486 if (xline.empty() || yline.empty()) {
2487 Error(
"PaintGraphAsymmErrors",
"too many points, out of memory");
2494 theGraph->TAttLine::Modify();
2509 Double_t sbase = symbolsize*kBASEMARKER;
2524 Float_t asize = 0.6*symbolsize*kBASEMARKER/
gPad->GetWh();
2529 Double_t x,
y, exl, exh, eyl, eyh, xl1, xl2, xr1, xr2, yup1, yup2, ylow1, ylow2;
2530 for (
Int_t i=0;i<theNpoints;i++) {
2531 x =
gPad->XtoPad(theX[i]);
2532 y =
gPad->YtoPad(theY[i]);
2536 if (x < gPad->GetUxmin())
x =
gPad->GetUxmin();
2537 if (
x >
gPad->GetUxmax())
x =
gPad->GetUxmax();
2538 if (y < gPad->GetUymin())
y =
gPad->GetUymin();
2539 if (
y >
gPad->GetUymax())
y =
gPad->GetUymax();
2541 if (x < gPad->GetUxmin())
continue;
2542 if (
x >
gPad->GetUxmax())
continue;
2543 if (y < gPad->GetUymin())
continue;
2544 if (
y >
gPad->GetUymax())
continue;
2564 xl2 =
gPad->XtoPad(theX[i] - exl);
2566 xr2 =
gPad->XtoPad(theX[i] + exh);
2580 yup2 =
gPad->YtoPad(theY[i] + eyh);
2582 ylow2 =
gPad->YtoPad(theY[i] - eyl);
2584 if (yup2 >
gPad->GetUymax()) yup2 =
gPad->GetUymax();
2585 if (ylow2 < gPad->GetUymin()) ylow2 =
gPad->GetUymin();
2593 if (x1b < gPad->GetUxmin()) x1b =
gPad->GetUxmin();
2594 if (x1b >
gPad->GetUxmax()) x1b =
gPad->GetUxmax();
2595 if (y1b < gPad->GetUymin()) y1b =
gPad->GetUymin();
2596 if (y1b >
gPad->GetUymax()) y1b =
gPad->GetUymax();
2597 if (x2b < gPad->GetUxmin()) x2b =
gPad->GetUxmin();
2598 if (x2b >
gPad->GetUxmax()) x2b =
gPad->GetUxmax();
2599 if (y2b < gPad->GetUymin()) y2b =
gPad->GetUymin();
2600 if (y2b >
gPad->GetUymax()) y2b =
gPad->GetUymax();
2601 if (option5)
box.PaintBox(x1b, y1b, x2b, y2b,
"l");
2602 else box.PaintBox(x1b, y1b, x2b, y2b);
2610 yline[if1-1] = yup2;
2611 yline[if2-1] = ylow2;
2617 if (exl != 0. || exh != 0.) {
2619 if (exl != 0.)
arrow.PaintArrow(xl1,
y,xl2,
y,asize,arrowOpt);
2620 if (exh != 0.)
arrow.PaintArrow(xr1,
y,xr2,
y,asize,arrowOpt);
2623 if (exl != 0.)
gPad->PaintLine(xl1,
y,xl2,
y);
2624 if (exh != 0.)
gPad->PaintLine(xr1,
y,xr2,
y);
2629 xb[0] = xl2+tx; yb[0] =
y-ty;
2630 xb[1] = xl2; yb[1] =
y-ty;
2631 xb[2] = xl2; yb[2] =
y+ty;
2632 xb[3] = xl2+tx; yb[3] =
y+ty;
2633 gPad->PaintPolyLine(4, xb, yb);
2636 xb[0] = xr2-tx; yb[0] =
y-ty;
2637 xb[1] = xr2; yb[1] =
y-ty;
2638 xb[2] = xr2; yb[2] =
y+ty;
2639 xb[3] = xr2-tx; yb[3] =
y+ty;
2640 gPad->PaintPolyLine(4, xb, yb);
2643 gPad->PaintLine(xl2,
y-ty,xl2,
y+ty);
2644 gPad->PaintLine(xr2,
y-ty,xr2,
y+ty);
2650 if (eyl != 0. || eyh != 0.) {
2652 if (eyh != 0.)
arrow.PaintArrow(
x,yup1,
x,yup2,asize,arrowOpt);
2653 if (eyl != 0.)
arrow.PaintArrow(
x,ylow1,
x,ylow2,asize,arrowOpt);
2656 if (eyh != 0.)
gPad->PaintLine(
x,yup1,
x,yup2);
2657 if (eyl != 0.)
gPad->PaintLine(
x,ylow1,
x,ylow2);
2662 xb[0] =
x-tx; yb[0] = yup2-ty;
2663 xb[1] =
x-tx; yb[1] = yup2;
2664 xb[2] =
x+tx; yb[2] = yup2;
2665 xb[3] =
x+tx; yb[3] = yup2-ty;
2666 gPad->PaintPolyLine(4, xb, yb);
2669 xb[0] =
x-tx; yb[0] = ylow2+ty;
2670 xb[1] =
x-tx; yb[1] = ylow2;
2671 xb[2] =
x+tx; yb[2] = ylow2;
2672 xb[3] =
x+tx; yb[3] = ylow2+ty;
2673 gPad->PaintPolyLine(4, xb, yb);
2676 if (eyh != 0.)
gPad->PaintLine(
x-tx,yup2,
x+tx,yup2);
2677 if (eyl != 0.)
gPad->PaintLine(
x-tx,ylow2,
x+tx,ylow2);
2691 if (option4)
PaintGraph(theGraph, 2*theNpoints, xline.data(), yline.data(),
"FC");
2692 else PaintGraph(theGraph, 2*theNpoints, xline.data(), yline.data(),
"F");
2693 gPad->SetLogx(logx);
2694 gPad->SetLogy(logy);
2710 Int_t NYErrors = tg->GetNYErrors();
2711 if (NYErrors <= 0) {
2719 std::vector<TString> options(NYErrors + 1);
2728 while ((firstSemicolon = tsOpt.
First(
';')) !=
kNPOS && filled <= NYErrors) {
2729 options[filled] = tsOpt(0, firstSemicolon);
2730 tsOpt = tsOpt(firstSemicolon + 1, tsOpt.
Length());
2734 if (filled <= NYErrors) {
2735 options[filled] = tsOpt.
Copy();
2739 for (
Int_t i = filled; i <= NYErrors; i++)
2742 std::vector<Double_t> xline;
2743 std::vector<std::vector<Double_t>> yline(NYErrors);
2748 const Int_t kBASEMARKER = 8;
2749 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};
2750 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};
2751 Int_t theNpoints = tg->GetN();
2755 Double_t *theExH = tg->GetEXhigh();
2756 std::vector<Double_t *> theEyL(NYErrors);
2757 std::vector<Double_t *> theEyH(NYErrors);
2760 for (
Int_t j = 0; j < NYErrors; j++) {
2761 theEyL[j] = tg->GetEYlow(j);
2762 theEyH[j] = tg->GetEYhigh(j);
2763 theEyExists &= (theEyL[j] && theEyH[j]);
2766 if (!theX || !theY || !theExL || !theExH || !theEyExists)
2769 std::vector<Bool_t> DrawErrors(NYErrors);
2774 std::vector<Bool_t> Braticks(NYErrors);
2775 std::vector<Bool_t> Brackets(NYErrors);
2776 std::vector<Bool_t> EndLines(NYErrors);
2777 std::vector<Char_t *> ArrowOpt(NYErrors);
2778 std::vector<Bool_t> Option5(NYErrors);
2779 std::vector<Bool_t> Option4(NYErrors);
2780 std::vector<Bool_t> Option3(NYErrors);
2782 std::vector<Bool_t> Option2(NYErrors);
2783 std::vector<Bool_t> Option0(NYErrors);
2785 std::vector<Double_t> Scale(NYErrors);
2787 const TRegexp ScaleRegExp(
"s=*[0-9]\\.*[0-9]");
2789 for (
Int_t j = 0; j < NYErrors; j++) {
2790 if (options[j + 1].Contains(
"s=")) {
2791 sscanf(strstr(options[j + 1].Data(),
"s="),
"s=%lf", &Scale[j]);
2792 options[j + 1].ReplaceAll(options[j + 1](ScaleRegExp),
"");
2796 DrawErrors[j] = !options[j + 1].Contains(
"x");
2797 AnyErrors |= DrawErrors[j];
2798 Braticks[j] = options[j + 1].Contains(
"[]");
2799 Brackets[j] = options[j + 1].Contains(
"||") || Braticks[j];
2800 EndLines[j] = !options[j + 1].Contains(
"z");
2802 if (options[j + 1].Contains(
"|>"))
2803 ArrowOpt[j] = (
Char_t *)
"|>";
2804 else if (options[j + 1].Contains(
">"))
2805 ArrowOpt[j] = (
Char_t *)
">";
2807 ArrowOpt[j] =
nullptr;
2809 Option5[j] = options[j + 1].Contains(
"5");
2810 Option4[j] = options[j + 1].Contains(
"4");
2811 Option3[j] = options[j + 1].Contains(
"3") || Option4[j];
2812 AnyOption3 |= Option3[j];
2813 Option2[j] = options[j + 1].Contains(
"2") || Option5[j];
2814 Option0[j] = options[j + 1].Contains(
"0");
2815 AnyOption0 |= Option0[j];
2817 NoErrorsX &= (Option3[j] || Option2[j]);
2818 Option0X |= !(Option3[j] || Option2[j]) && Option0[j];
2819 DrawMarker |= !(Brackets[j] || Option3[j] || Option2[j]);
2822 Bool_t Draw0PointsX = !options[0].Contains(
"x0") && (
gPad->GetLogx() == 0);
2823 Bool_t Draw0PointsY = !options[0].Contains(
"y0") && (
gPad->GetLogy() == 0);
2824 options[0].ReplaceAll(
"x0",
"");
2825 options[0].ReplaceAll(
"y0",
"");
2827 Bool_t DrawErrorsX = !options[0].Contains(
"x");
2828 Bool_t BraticksX = options[0].Contains(
"[]");
2829 Bool_t BracketsX = options[0].Contains(
"||") || BraticksX;
2830 Bool_t EndLinesX = !options[0].Contains(
"z");
2832 Char_t *ArrowOptX =
nullptr;
2833 if (options[0].Contains(
"|>"))
2834 ArrowOptX = (
Char_t *)
"|>";
2835 else if (options[0].Contains(
">"))
2836 ArrowOptX = (
Char_t *)
">";
2839 if (options[0].Contains(
"s=")) {
2840 sscanf(strstr(options[0].Data(),
"s="),
"s=%lf", &ScaleX);
2841 options[0].ReplaceAll(options[0](ScaleRegExp),
"");
2844 if (!AnyErrors && !DrawErrorsX) {
2849 Bool_t DrawAxis = options[0].Contains(
"a");
2850 Bool_t IndividualStyles = options[0].Contains(
"s");
2855 Int_t NPointsInside = AnyOption0 ? theNpoints : 0;
2858 for (
Int_t i = 0; i < theNpoints && !AnyOption0; i++) {
2859 x =
gPad->XtoPad(theX[i]);
2860 y =
gPad->YtoPad(theY[i]);
2862 if ((
x >=
gPad->GetUxmin()) && (x <= gPad->GetUxmax()) && (
y >=
gPad->GetUymin()) && (y <= gPad->GetUymax()) &&
2863 (Draw0PointsX || theX[i] != 0.) && (Draw0PointsY || theY[i] != 0.))
2868 xline.resize(2 * NPointsInside);
2870 if (xline.empty()) {
2871 Error(
"PaintGraphMultiErrors",
"too many points, out of memory");
2876 if2 = 2 * NPointsInside;
2879 for (
Int_t j = 0; j < NYErrors; j++) {
2880 if (Option3[j] && DrawErrors[j]) {
2881 yline[j].resize(2 * NPointsInside);
2883 if (yline[j].empty()) {
2884 Error(
"PaintGraphMultiErrors",
"too many points, out of memory");
2890 tg->TAttLine::Modify();
2893 arrow.SetLineWidth(tg->GetLineWidth());
2894 arrow.SetLineColor(tg->GetLineColor());
2895 arrow.SetFillColor(tg->GetFillColor());
2899 box.SetLineWidth(tg->GetLineWidth());
2900 box.SetLineColor(tg->GetLineColor());
2901 box.SetFillColor(tg->GetFillColor());
2902 box.SetFillStyle(tg->GetFillStyle());
2904 Double_t symbolsize = tg->GetMarkerSize();
2905 Double_t sbase = symbolsize * kBASEMARKER;
2911 cx = cxx[
mark - 20];
2912 cy = cyy[
mark - 20];
2921 Float_t asize = 0.6 * symbolsize * kBASEMARKER /
gPad->GetWh();
2926 Double_t xl1, xl2, xr1, xr2, yup1, yup2, ylow1, ylow2;
2927 for (
Int_t i = 0; i < theNpoints; i++) {
2928 x =
gPad->XtoPad(theX[i]);
2929 y =
gPad->YtoPad(theY[i]);
2932 (
x <
gPad->GetUxmin()) || (
x >
gPad->GetUxmax()) || (y < gPad->GetUymin()) || (
y >
gPad->GetUymax());
2934 if ((isOutside && !AnyOption0) || (!Draw0PointsX && theX[i] == 0.) || (!Draw0PointsY && theY[i] == 0.))
2939 if (x < gPad->GetUxmin())
2940 x =
gPad->GetUxmin();
2941 if (
x >
gPad->GetUxmax())
2942 x =
gPad->GetUxmax();
2943 if (y < gPad->GetUymin())
2944 y =
gPad->GetUymin();
2945 if (
y >
gPad->GetUymax())
2946 y =
gPad->GetUymax();
2956 for (
Int_t j = 0; j < NYErrors; j++) {
2961 if (Option2[j] && (!isOutside || Option0[j])) {
2962 if (IndividualStyles) {
2963 box.SetLineWidth(tg->GetLineWidth(j));
2964 box.SetLineColor(tg->GetLineColor(j));
2965 box.SetFillColor(tg->GetFillColor(j));
2966 box.SetFillStyle(tg->GetFillStyle(j));
2969 x1b =
gPad->XtoPad(theX[i] - Scale[j] * theExL[i]);
2970 y1b =
gPad->YtoPad(theY[i] - theEyL[j][i]);
2971 x2b =
gPad->XtoPad(theX[i] + Scale[j] * theExH[i]);
2972 y2b =
gPad->YtoPad(theY[i] + theEyH[j][i]);
2973 if (x1b < gPad->GetUxmin())
2974 x1b =
gPad->GetUxmin();
2975 if (x1b >
gPad->GetUxmax())
2976 x1b =
gPad->GetUxmax();
2977 if (y1b < gPad->GetUymin())
2978 y1b =
gPad->GetUymin();
2979 if (y1b >
gPad->GetUymax())
2980 y1b =
gPad->GetUymax();
2981 if (x2b < gPad->GetUxmin())
2982 x2b =
gPad->GetUxmin();
2983 if (x2b >
gPad->GetUxmax())
2984 x2b =
gPad->GetUxmax();
2985 if (y2b < gPad->GetUymin())
2986 y2b =
gPad->GetUymin();
2987 if (y2b >
gPad->GetUymax())
2988 y2b =
gPad->GetUymax();
2990 box.PaintBox(x1b, y1b, x2b, y2b,
"l");
2992 box.PaintBox(x1b, y1b, x2b, y2b);
2997 if (!isOutside || Option0[j]) {
2998 yline[j][if1 - 2] =
gPad->YtoPad(theY[i] + theEyH[j][i]);
2999 yline[j][if2] =
gPad->YtoPad(theY[i] - theEyL[j][i]);
3001 yline[j][if1 - 2] =
gPad->GetUymin();
3002 yline[j][if2] =
gPad->GetUymin();
3006 if (IndividualStyles) {
3007 tg->GetAttLine(j)->Modify();
3009 arrow.SetLineWidth(tg->GetLineWidth(j));
3010 arrow.SetLineColor(tg->GetLineColor(j));
3011 arrow.SetFillColor(tg->GetFillColor(j));
3014 ylow1 =
y - s2y * cy;
3015 ylow2 =
gPad->YtoPad(theY[i] - theEyL[j][i]);
3016 if (ylow2 < gPad->GetUymin())
3017 ylow2 =
gPad->GetUymin();
3018 if (ylow2 < ylow1 && DrawErrors[j] && !Option2[j] && !Option3[j] && (!isOutside || Option0[j])) {
3020 arrow.PaintArrow(
x, ylow1,
x, ylow2, asize, ArrowOpt[j]);
3023 gPad->PaintLine(
x, ylow1,
x, ylow2);
3034 gPad->PaintPolyLine(4, xb, yb);
3036 gPad->PaintLine(
x - tx, ylow2,
x + tx, ylow2);
3041 yup1 =
y + s2y * cy;
3042 yup2 =
gPad->YtoPad(theY[i] + theEyH[j][i]);
3043 if (yup2 >
gPad->GetUymax())
3044 yup2 =
gPad->GetUymax();
3045 if (yup2 > yup1 && DrawErrors[j] && !Option2[j] && !Option3[j] && (!isOutside || Option0[j])) {
3047 arrow.PaintArrow(
x, yup1,
x, yup2, asize, ArrowOpt[j]);
3050 gPad->PaintLine(
x, yup1,
x, yup2);
3061 gPad->PaintPolyLine(4, xb, yb);
3063 gPad->PaintLine(
x - tx, yup2,
x + tx, yup2);
3070 if (IndividualStyles) {
3071 tg->TAttLine::Modify();
3073 arrow.SetLineWidth(tg->GetLineWidth());
3074 arrow.SetLineColor(tg->GetLineColor());
3075 arrow.SetFillColor(tg->GetFillColor());
3079 xl2 =
gPad->XtoPad(theX[i] - ScaleX * theExL[i]);
3080 if (xl1 > xl2 && !NoErrorsX && (!isOutside || Option0X)) {
3082 arrow.PaintArrow(xl1,
y, xl2,
y, asize, ArrowOptX);
3085 gPad->PaintLine(xl1,
y, xl2,
y);
3096 gPad->PaintPolyLine(4, xb, yb);
3098 gPad->PaintLine(xl2,
y - ty, xl2,
y + ty);
3104 xr2 =
gPad->XtoPad(theX[i] + ScaleX * theExH[i]);
3105 if (xr1 < xr2 && !NoErrorsX && (!isOutside || Option0X)) {
3107 arrow.PaintArrow(xr1,
y, xr2,
y, asize, ArrowOptX);
3110 gPad->PaintLine(xr1,
y, xr2,
y);
3121 gPad->PaintPolyLine(4, xb, yb);
3123 gPad->PaintLine(xr2,
y - ty, xr2,
y + ty);
3135 tg->TAttFill::Copy(tgDummy);
3136 tg->TAttLine::Copy(tgDummy);
3137 tg->TAttMarker::Copy(tgDummy);
3139 for (
Int_t j = 0; j < NYErrors; j++)
3140 if (Option3[j] && DrawErrors[j]) {
3141 if (IndividualStyles) {
3142 tg->GetAttFill(j)->
Copy(tgDummy);
3143 tg->GetAttLine(j)->Copy(tgDummy);
3151 PaintGraph(&tgDummy, 2 * NPointsInside, xline.data(), yline[j].data(),
"FC");
3153 PaintGraph(&tgDummy, 2 * NPointsInside, xline.data(), yline[j].data(),
"F");
3154 gPad->SetLogx(logx);
3155 gPad->SetLogy(logy);
3166 std::vector<Double_t> xline, yline;
3171 const Int_t kBASEMARKER=8;
3172 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};
3173 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};
3196 const char *arrowOpt =
nullptr;
3197 if (strchr(
option,
'>')) arrowOpt =
">";
3198 if (strstr(
option,
"|>")) arrowOpt =
"|>";
3223 xline.resize(2*theNpoints);
3224 yline.resize(2*theNpoints);
3225 if (xline.empty() || yline.empty()) {
3226 Error(
"PaintGraphBentErrors",
"too many points, out of memory");
3233 theGraph->TAttLine::Modify();
3248 Double_t sbase = symbolsize*kBASEMARKER;
3263 Float_t asize = 0.6*symbolsize*kBASEMARKER/
gPad->GetWh();
3268 Double_t x,
y, exl, exh, eyl, eyh, xl1, xl2, xr1, xr2, yup1, yup2, ylow1, ylow2;
3270 for (
Int_t i=0;i<theNpoints;i++) {
3271 x =
gPad->XtoPad(theX[i]);
3272 y =
gPad->YtoPad(theY[i]);
3273 bxl =
gPad->YtoPad(theY[i]+theEXlowd[i]);
3274 bxh =
gPad->YtoPad(theY[i]+theEXhighd[i]);
3275 byl =
gPad->XtoPad(theX[i]+theEYlowd[i]);
3276 byh =
gPad->XtoPad(theX[i]+theEYhighd[i]);
3280 if (x < gPad->GetUxmin())
x =
gPad->GetUxmin();
3281 if (
x >
gPad->GetUxmax())
x =
gPad->GetUxmax();
3282 if (y < gPad->GetUymin())
y =
gPad->GetUymin();
3283 if (
y >
gPad->GetUymax())
y =
gPad->GetUymax();
3285 if (x < gPad->GetUxmin())
continue;
3286 if (
x >
gPad->GetUxmax())
continue;
3287 if (y < gPad->GetUymin())
continue;
3288 if (
y >
gPad->GetUymax())
continue;
3314 xl2 =
gPad->XtoPad(theX[i] - exl);
3316 xr2 =
gPad->XtoPad(theX[i] + exh);
3336 yup2 =
gPad->YtoPad(theY[i] + eyh);
3338 ylow2 =
gPad->YtoPad(theY[i] - eyl);
3340 if (yup2 >
gPad->GetUymax()) yup2 =
gPad->GetUymax();
3341 if (ylow2 < gPad->GetUymin()) ylow2 =
gPad->GetUymin();
3343 if (xrevlog) {bs = bxl; bxl = bxh; bxh = bs;}
3344 if (yrevlog) {bs = byl; byl = byh; byh = bs;}
3352 if (x1b < gPad->GetUxmin()) x1b =
gPad->GetUxmin();
3353 if (x1b >
gPad->GetUxmax()) x1b =
gPad->GetUxmax();
3354 if (y1b < gPad->GetUymin()) y1b =
gPad->GetUymin();
3355 if (y1b >
gPad->GetUymax()) y1b =
gPad->GetUymax();
3356 if (x2b < gPad->GetUxmin()) x2b =
gPad->GetUxmin();
3357 if (x2b >
gPad->GetUxmax()) x2b =
gPad->GetUxmax();
3358 if (y2b < gPad->GetUymin()) y2b =
gPad->GetUymin();
3359 if (y2b >
gPad->GetUymax()) y2b =
gPad->GetUymax();
3360 if (option5)
box.PaintBox(x1b, y1b, x2b, y2b,
"l");
3361 else box.PaintBox(x1b, y1b, x2b, y2b);
3369 yline[if1-1] = yup2;
3370 yline[if2-1] = ylow2;
3376 if (exl != 0. || exh != 0.) {
3378 if (exl != 0.)
arrow.PaintArrow(xl1,
y,xl2,bxl,asize,arrowOpt);
3379 if (exh != 0.)
arrow.PaintArrow(xr1,
y,xr2,bxh,asize,arrowOpt);
3382 if (exl != 0.)
gPad->PaintLine(xl1,
y,xl2,bxl);
3383 if (exh != 0.)
gPad->PaintLine(xr1,
y,xr2,bxh);
3388 xb[0] = xl2+tx; yb[0] = bxl-ty;
3389 xb[1] = xl2; yb[1] = bxl-ty;
3390 xb[2] = xl2; yb[2] = bxl+ty;
3391 xb[3] = xl2+tx; yb[3] = bxl+ty;
3392 gPad->PaintPolyLine(4, xb, yb);
3395 xb[0] = xr2-tx; yb[0] = bxh-ty;
3396 xb[1] = xr2; yb[1] = bxh-ty;
3397 xb[2] = xr2; yb[2] = bxh+ty;
3398 xb[3] = xr2-tx; yb[3] = bxh+ty;
3399 gPad->PaintPolyLine(4, xb, yb);
3402 gPad->PaintLine(xl2,bxl-ty,xl2,bxl+ty);
3403 gPad->PaintLine(xr2,bxh-ty,xr2,bxh+ty);
3409 if (eyl != 0. || eyh != 0.) {
3411 if (eyh != 0.)
arrow.PaintArrow(
x,yup1,byh,yup2,asize,arrowOpt);
3412 if (eyl != 0.)
arrow.PaintArrow(
x,ylow1,byl,ylow2,asize,arrowOpt);
3415 if (eyh != 0.)
gPad->PaintLine(
x,yup1,byh,yup2);
3416 if (eyl != 0.)
gPad->PaintLine(
x,ylow1,byl,ylow2);
3421 xb[0] = byh-tx; yb[0] = yup2-ty;
3422 xb[1] = byh-tx; yb[1] = yup2;
3423 xb[2] = byh+tx; yb[2] = yup2;
3424 xb[3] = byh+tx; yb[3] = yup2-ty;
3425 gPad->PaintPolyLine(4, xb, yb);
3428 xb[0] = byl-tx; yb[0] = ylow2+ty;
3429 xb[1] = byl-tx; yb[1] = ylow2;
3430 xb[2] = byl+tx; yb[2] = ylow2;
3431 xb[3] = byl+tx; yb[3] = ylow2+ty;
3432 gPad->PaintPolyLine(4, xb, yb);
3435 if (eyh != 0.)
gPad->PaintLine(byh-tx,yup2,byh+tx,yup2);
3436 if (eyl != 0.)
gPad->PaintLine(byl-tx,ylow2,byl+tx,ylow2);
3451 if (option4)
PaintGraph(theGraph, 2*theNpoints, xline.data(), yline.data(),
"FC");
3452 else PaintGraph(theGraph, 2*theNpoints, xline.data(), yline.data(),
"F");
3453 gPad->SetLogx(logx);
3454 gPad->SetLogy(logy);
3465 std::vector<Double_t> xline, yline;
3470 const Int_t kBASEMARKER=8;
3471 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};
3472 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};
3489 const char *arrowOpt =
nullptr;
3490 if (strchr(
option,
'>')) arrowOpt =
">";
3491 if (strstr(
option,
"|>")) arrowOpt =
"|>";
3516 xline.resize(2*theNpoints);
3517 yline.resize(2*theNpoints);
3518 if (xline.empty() || yline.empty()) {
3519 Error(
"PaintGraphErrors",
"too many points, out of memory");
3526 theGraph->TAttLine::Modify();
3541 Double_t sbase = symbolsize*kBASEMARKER;
3556 Float_t asize = 0.6*symbolsize*kBASEMARKER/
gPad->GetWh();
3561 Double_t x,
y,
ex,
ey, xl1, xl2, xr1, xr2, yup1, yup2, ylow1, ylow2;
3562 for (
Int_t i=0;i<theNpoints;i++) {
3563 x =
gPad->XtoPad(theX[i]);
3564 y =
gPad->YtoPad(theY[i]);
3568 if (x < gPad->GetUxmin())
x =
gPad->GetUxmin();
3569 if (
x >
gPad->GetUxmax())
x =
gPad->GetUxmax();
3570 if (y < gPad->GetUymin())
y =
gPad->GetUymin();
3571 if (
y >
gPad->GetUymax())
y =
gPad->GetUymax();
3573 if (x < gPad->GetUxmin())
continue;
3574 if (
x >
gPad->GetUxmax())
continue;
3575 if (y < gPad->GetUymin())
continue;
3576 if (
y >
gPad->GetUymax())
continue;
3594 xl2 =
gPad->XtoPad(theX[i] -
ex);
3596 xr2 =
gPad->XtoPad(theX[i] +
ex);
3610 yup2 =
gPad->YtoPad(theY[i] +
ey);
3612 ylow2 =
gPad->YtoPad(theY[i] -
ey);
3614 if (yup2 >
gPad->GetUymax()) yup2 =
gPad->GetUymax();
3615 if (ylow2 < gPad->GetUymin()) ylow2 =
gPad->GetUymin();
3623 if (x1b < gPad->GetUxmin()) x1b =
gPad->GetUxmin();
3624 if (x1b >
gPad->GetUxmax()) x1b =
gPad->GetUxmax();
3625 if (y1b < gPad->GetUymin()) y1b =
gPad->GetUymin();
3626 if (y1b >
gPad->GetUymax()) y1b =
gPad->GetUymax();
3627 if (x2b < gPad->GetUxmin()) x2b =
gPad->GetUxmin();
3628 if (x2b >
gPad->GetUxmax()) x2b =
gPad->GetUxmax();
3629 if (y2b < gPad->GetUymin()) y2b =
gPad->GetUymin();
3630 if (y2b >
gPad->GetUymax()) y2b =
gPad->GetUymax();
3631 if (option5)
box.PaintBox(x1b, y1b, x2b, y2b,
"l");
3632 else box.PaintBox(x1b, y1b, x2b, y2b);
3640 yline[if1-1] = yup2;
3641 yline[if2-1] = ylow2;
3649 arrow.PaintArrow(xl1,
y,xl2,
y,asize,arrowOpt);
3650 arrow.PaintArrow(xr1,
y,xr2,
y,asize,arrowOpt);
3653 gPad->PaintLine(xl1,
y,xl2,
y);
3654 gPad->PaintLine(xr1,
y,xr2,
y);
3658 xb[0] = xl2+tx; yb[0] =
y-ty;
3659 xb[1] = xl2; yb[1] =
y-ty;
3660 xb[2] = xl2; yb[2] =
y+ty;
3661 xb[3] = xl2+tx; yb[3] =
y+ty;
3662 gPad->PaintPolyLine(4, xb, yb);
3663 xb[0] = xr2-tx; yb[0] =
y-ty;
3664 xb[1] = xr2; yb[1] =
y-ty;
3665 xb[2] = xr2; yb[2] =
y+ty;
3666 xb[3] = xr2-tx; yb[3] =
y+ty;
3667 gPad->PaintPolyLine(4, xb, yb);
3669 gPad->PaintLine(xl2,
y-ty,xl2,
y+ty);
3670 gPad->PaintLine(xr2,
y-ty,xr2,
y+ty);
3678 arrow.PaintArrow(
x,yup1,
x,yup2,asize,arrowOpt);
3679 arrow.PaintArrow(
x,ylow1,
x,ylow2,asize,arrowOpt);
3682 gPad->PaintLine(
x,yup1,
x,yup2);
3683 gPad->PaintLine(
x,ylow1,
x,ylow2);
3687 xb[0] =
x-tx; yb[0] = yup2-ty;
3688 xb[1] =
x-tx; yb[1] = yup2;
3689 xb[2] =
x+tx; yb[2] = yup2;
3690 xb[3] =
x+tx; yb[3] = yup2-ty;
3691 gPad->PaintPolyLine(4, xb, yb);
3692 xb[0] =
x-tx; yb[0] = ylow2+ty;
3693 xb[1] =
x-tx; yb[1] = ylow2;
3694 xb[2] =
x+tx; yb[2] = ylow2;
3695 xb[3] =
x+tx; yb[3] = ylow2+ty;
3696 gPad->PaintPolyLine(4, xb, yb);
3698 gPad->PaintLine(
x-tx,yup2,
x+tx,yup2);
3699 gPad->PaintLine(
x-tx,ylow2,
x+tx,ylow2);
3714 if (option4)
PaintGraph(theGraph, 2*theNpoints, xline.data(), yline.data(),
"FC");
3715 else PaintGraph(theGraph, 2*theNpoints, xline.data(), yline.data(),
"F");
3716 gPad->SetLogx(logx);
3717 gPad->SetLogy(logy);
3729 Double_t rwrmin, rwrmax, rwtmin, rwtmax;
3733 Int_t theNpoints = theGraphPolar->
GetN();
3739 if (theNpoints<1)
return;
3754 if (thePolargram)
if (!
gPad->FindObject(thePolargram->
GetName())) thePolargram=0;
3755 if (!thePolargram) {
3768 if (!thePolargram) {
3770 rwrmin = theY[0]; rwrmax = theY[theNpoints-1];
3771 rwtmin = theX[0]; rwtmax = theX[theNpoints-1];
3773 for (ipt = 0; ipt < theNpoints; ipt++) {
3776 if (theX[ipt] -theEX[ipt] < rwtmin) rwtmin = theX[ipt]-theEX[ipt];
3777 if (theX[ipt] +theEX[ipt] > rwtmax) rwtmax = theX[ipt]+theEX[ipt];
3779 if (theX[ipt] < rwtmin) rwtmin=theX[ipt];
3780 if (theX[ipt] > rwtmax) rwtmax=theX[ipt];
3783 if (theY[ipt] -theEY[ipt] < rwrmin) rwrmin = theY[ipt]-theEY[ipt];
3784 if (theY[ipt] +theEY[ipt] > rwrmax) rwrmax = theY[ipt]+theEY[ipt];
3786 if (theY[ipt] < rwrmin) rwrmin=theY[ipt];
3787 if (theY[ipt] > rwrmax) rwrmax=theY[ipt];
3791 if (rwrmin == rwrmax) rwrmax += 1.;
3792 if (rwtmin == rwtmax) rwtmax += 1.;
3799 rwtmax += dt/theNpoints;
3801 rwrmin = thePolargram->
GetRMin();
3802 rwrmax = thePolargram->
GetRMax();
3803 rwtmin = thePolargram->
GetTMin();
3804 rwtmax = thePolargram->
GetTMax();
3809 thePolargram =
new TGraphPolargram(
"Polargram",rwrmin,rwrmax,rwtmin,rwtmax);
3813 if (nolabel) thePolargram->
Draw(
"N");
3814 else thePolargram->
Draw(
"");
3823 Double_t radiusNDC = rwrmax-rwrmin;
3833 for (i=0; i<theNpoints; i++) {
3834 Double_t eymin, eymax, exmin,exmax;
3835 exmin = (theY[i]-theEY[i]-rwrmin)/radiusNDC*
3837 eymin = (theY[i]-theEY[i]-rwrmin)/radiusNDC*
3839 exmax = (theY[i]+theEY[i]-rwrmin)/radiusNDC*
3841 eymax = (theY[i]+theEY[i]-rwrmin)/radiusNDC*
3843 theGraphPolar->TAttLine::Modify();
3844 if (exmin != exmax || eymin != eymax)
gPad->PaintLine(exmin,eymin,exmax,eymax);
3848 for (i=0; i<theNpoints; i++) {
3849 Double_t rad = (theY[i]-rwrmin)/radiusNDC;
3852 theGraphPolar->TAttLine::Modify();
3853 if (phimin != phimax) thePolargram->
PaintCircle(0,0,rad,phimin,phimax,0);
3859 if (!(
gPad->GetLogx()) && !(
gPad->GetLogy())) {
3860 Double_t a,
b,
c=1,
x1,
x2,
y1,
y2, discr, norm1, norm2, xts, yts;
3868 for (i=0; i<theNpoints; i++) {
3871 xt = (theY[i]-rwrmin)/radiusNDC*
TMath::Cos(
c*(theX[i]-rwtmin)/thetaNDC);
3872 yt = (theY[i]-rwrmin)/radiusNDC*
TMath::Sin(
c*(theX[i]-rwtmin)/thetaNDC);
3873 norm = sqrt(xt*xt+yt*yt);
3878 if (!previouspointin) {
3883 a = (yt-yts)/(xt-xts);
3885 discr = 4*(
a*
a-
b*
b+1);
3886 x1 = (-2*
a*
b+sqrt(discr))/(2*(
a*
a+1));
3887 x2 = (-2*
a*
b-sqrt(discr))/(2*(
a*
a+1));
3890 norm1 = sqrt((
x1-xt)*(
x1-xt)+(
y1-yt)*(
y1-yt));
3891 norm2 = sqrt((
x2-xt)*(
x2-xt)+(
y2-yt)*(
y2-yt));
3892 previouspointin =
kFALSE;
3894 if (norm1 < norm2) {
3904 PaintGraph(theGraphPolar, j+1, theXpol, theYpol, opt);
3909 if (j>=1 && !previouspointin) {
3910 a = (yt-theYpol[j])/(xt-theXpol[j]);
3911 b = theYpol[j]-
a*theXpol[j];
3912 previouspointin =
kTRUE;
3913 discr = 4*(
a*
a-
b*
b+1);
3914 x1 = (-2*
a*
b+sqrt(discr))/(2*(
a*
a+1));
3915 x2 = (-2*
a*
b-sqrt(discr))/(2*(
a*
a+1));
3918 norm1 = sqrt((
x1-xt)*(
x1-xt)+(
y1-yt)*(
y1-yt));
3919 norm2 = sqrt((
x2-xt)*(
x2-xt)+(
y2-yt)*(
y2-yt));
3921 if (norm1 < norm2) {
3928 PaintGraph(theGraphPolar, j+1, theXpol, theYpol, opt);
3935 PaintGraph(theGraphPolar, j+1, theXpol, theYpol, opt);
3938 for (i=0; i<theNpoints; i++) {
3942 PaintGraph(theGraphPolar, theNpoints, theXpol, theYpol,opt);
3950 TIter next(
gPad->GetListOfPrimitives());
3951 while (
auto obj = next()) {
3955 if (strcmp(title->
GetName(),
"title")) {title =
nullptr;
continue;}
3959 if (title)
delete title;
3965 if (ht <= 0) ht = 0.05;
3986 if (talh < 1) talh = 1;
else if (talh > 3) talh = 3;
3988 if (talv < 1) talv = 1;
else if (talv > 3) talv = 3;
4030 TF1 *theF = theGraphQQ->
GetF();
4033 Error(
"TGraphQQ::Paint",
"2nd dataset or theoretical function not specified");
4048 Double_t yxmin, xymin, yxmax, xymax;
4054 TLine line1, line2, line3;
4057 yxmin = (theYq2-theYq1)*(
xmin-theXq1)/(theXq2-theXq1) + theYq1;
4059 xymin = (theXq2-theXq1)*(
ymin-theYq1)/(theYq2-theYq1) + theXq1;
4065 line2.
PaintLine(xqmin, yqmin, xqmax, yqmax);
4067 yxmax = (theYq2-theYq1)*(
xmax-theXq1)/(theXq2-theXq1) + theYq1;
4069 xymax = (theXq2-theXq1)*(
ymax-theYq1)/(theYq2-theYq1) + theXq1;
4112 if (lxp) opth.
Append(
"x+");
4113 if (lyp) opth.
Append(
"y+");
4138 XA1 =
gPad->GetUxmin();
4139 XA2 =
gPad->GetUxmax();
4140 YA1 =
gPad->GetUymin();
4141 YA2 =
gPad->GetUymax();
4178 if (
gPad->GetGridx()) {
4179 if (
gPad->GetLogy()) {
4182 GL = (YA2 - YA1) / (
gPad->GetY2() -
gPad->GetY1());
4190 TGaxis *theReversedXaxis;
4191 if (
gPad->GetLogx()) {
4204 theReversedXaxis =
new TGaxis(
gPad->GetUxmax(),
4218 theReversedXaxis->
Paint();
4222 if (
gPad->GetLogx()) {
4226 for (i=0; i<
N; i++) rX[i] = dX-X[i];
4230 if (rEXhigh && EXlow)
for (i=0; i<
N; i++) rEXhigh[i] = EXlow[i];
4231 if (rEXlow && EXhigh)
for (i=0; i<
N; i++) rEXlow[i] = EXhigh[i];
4234 if (rEXhighd && EXlowd)
for (i=0; i<
N; i++) rEXhighd[i] = EXlowd[i];
4235 if (rEXlowd && EXhighd)
for (i=0; i<
N; i++) rEXlowd[i] = EXhighd[i];
4246 if (
gPad->GetGridy()) {
4247 if (
gPad->GetLogx()) {
4250 GL = (XA2 - XA1) / (
gPad->GetX2() -
gPad->GetX1());
4258 TGaxis *theReversedYaxis;
4259 if (
gPad->GetLogy()) {
4285 theReversedYaxis->
Paint();
4289 if (
gPad->GetLogy()) {
4293 for (i=0; i<
N; i++) rY[i] = dY-Y[i];
4297 if (rEYhigh && EYlow)
for (i=0; i<
N; i++) rEYhigh[i] = EYlow[i];
4298 if (rEYlow && EYhigh)
for (i=0; i<
N; i++) rEYlow[i] = EYhigh[i];
4301 if (rEYhighd && EYlowd)
for (i=0; i<
N; i++) rEYhighd[i] = EYlowd[i];
4302 if (rEYlowd && EYhighd)
for (i=0; i<
N; i++) rEYlowd[i] = EYhighd[i];
4306 if (rEYlowd)
for (i=0; i<
N; i++) rEYlowd[i] = -rEYlowd[i];
4307 if (rEYhighd)
for (i=0; i<
N; i++) rEYhighd[i] = -rEYhighd[i];
4310 if (rEXlowd)
for (i=0; i<
N; i++) rEXlowd[i] = -rEXlowd[i];
4311 if (rEXhighd)
for (i=0; i<
N; i++) rEXhighd[i] = -rEXhighd[i];
4336 if (opt.
Contains(
"A")) optionAxis = 1;
else optionAxis = 0;
4341 double *theColor = theScatter->
GetColor();
4342 double *theSize = theScatter->
GetSize();
4343 double scale = theScatter->
GetScale();
4345 double minx = DBL_MAX;
4346 double maxx = -DBL_MAX;
4347 double miny = DBL_MAX;
4348 double maxy = -DBL_MAX;
4349 double minc = DBL_MAX;
4350 double maxc = -DBL_MAX;
4351 double mins = DBL_MAX;
4352 double maxs = -DBL_MAX;
4353 for (
int i=0; i<
n; i++) {
4369 if (optionAxis)
h->Paint(
" ");
4380 functions->
Remove(palette);
4381 delete palette; palette = 0;
4385 functions->
Remove(palette);
4386 delete palette; palette = 0;
4409 if (palette) palette->
Paint();
4414 int logx =
gPad->GetLogx();
4415 int logy =
gPad->GetLogy();
4416 int logz =
gPad->GetLogz();
4417 if (theColor && logz) {
4418 if (minc>0) minc = log10(minc);
4419 if (maxc>0) maxc = log10(maxc);
4422 theScatter->TAttMarker::Modify();
4424 for (
int i=0; i<
n; i++) {
4427 if (theColor[i]>0)
c = log10(theColor[i]);
4434 if (theSize) theScatter->
SetMarkerSize(scale*((theSize[i]-mins)/(maxs-mins)));
4435 if (theColor || theSize) theScatter->TAttMarker::Modify();
4437 if (theX[i]>0)
x = log10(theX[i]);
4443 if (theY[i]>0)
y = log10(theY[i]);
4448 gPad->PaintPolyMarker(1,&
x,&
y);
4469 if (!functions)
return;
4478 obj->Paint(lnk->GetOption());
4498 std::vector<Double_t> xf(2*
n);
4499 std::vector<Double_t> yf(2*
n);
4500 std::vector<Double_t> xt(
n);
4501 std::vector<Double_t> yt(
n);
4502 Double_t x1,
x2,
y1,
y2,
x3, y3, xm, ym,
a, a1, a2, a3;
4505 Int_t ix1,iy1,ix2,iy2;
4509 gPad->GetPadPar(x1p,y1p,x2p,y2p);
4510 ix1 = (
Int_t)(iw*x1p);
4511 iy1 = (
Int_t)(ih*y1p);
4512 ix2 = (
Int_t)(iw*x2p);
4513 iy2 = (
Int_t)(ih*y2p);
4525 gPad->GetRange(rx1,ry1,rx2,ry2);
4526 Double_t rx = (x2ndc-x1ndc)/(rx2-rx1);
4527 Double_t ry = (y2ndc-y1ndc)/(ry2-ry1);
4531 xf[0] = rx*(
x[0]-rx1)+x1ndc;
4532 yf[0] = ry*(
y[0]-ry1)+y1ndc;
4534 for (i=1; i<
n; i++) {
4535 if (
x[i]==
x[i-1] &&
y[i]==
y[i-1])
continue;
4537 xf[nf] = rx*(
x[i]-rx1)+x1ndc;
4538 if (xf[i]==xf[i-1]) xf[i] += 0.000001;
4539 yf[nf] = ry*(
y[i]-ry1)+y1ndc;
4558 if (xf[nf]==xf[nf-1]) {
4563 if (xf[nf]>=xf[nf-1]) {
4572 for (i=1; i<nf; i++) {
4584 if (xi1<xi0) a1 = a1+3.14159;
4590 if (xi0<xi2) a2 = a2+3.14159;
4605 if ((xm-xi0)*(
x3-xi0)<0 && (ym-yi0)*(y3-yi0)<0) {
4609 if ((xm==
x1) && (ym==
y1)) {
4618 if (xf[nf]==xf[0] && yf[nf]==yf[0]) {
4619 xm = (xt[nf]+xt[0])*0.5;
4620 ym = (yt[nf]+yt[0])*0.5;
4628 if ((xm-xf[0])*(
x3-xf[0])<0 && (ym-yf[0])*(y3-yf[0])<0) {
4642 for (i=nf2; i>0; i--) {
4643 for (j=i-1; j>0; j--) {
4644 if (xt[i-1]==xt[i] || xt[j-1]==xt[j])
continue;
4645 c1 = (yt[i-1]-yt[i])/(xt[i-1]-xt[i]);
4646 b1 = yt[i]-
c1*xt[i];
4647 c2 = (yt[j-1]-yt[j])/(xt[j-1]-xt[j]);
4648 b2 = yt[j]-
c2*xt[j];
4650 xc = (b2-b1)/(
c1-
c2);
4656 nf++; xf[nf] = xt[i]; yf[nf] = yt[i];
4657 nf++; xf[nf] = xc ; yf[nf] = yc;
4675 nf++; xf[nf] = xt[0]; yf[nf] = yt[0];
4678 for (i=0; i<nf+1; i++) {
4679 xf[i] = (1/rx)*(xf[i]-x1ndc)+rx1;
4680 yf[i] = (1/ry)*(yf[i]-y1ndc)+ry1;
4684 gPad->PaintFillArea(nf+1,xf.data(),yf.data());
4685 theGraph->TAttLine::Modify();
4698 TIter next(functions);
4699 while (
auto obj = next()) {
4709 if (!dofit) fit = 0;
4711 if (dofit == 1) dofit = 111;
4713 Int_t print_fval = dofit%10;
4714 Int_t print_ferrors = (dofit/10)%10;
4715 Int_t print_fchi2 = (dofit/100)%10;
4716 Int_t print_fprob = (dofit/1000)%10;
4717 Int_t nlinesf = print_fval + print_fchi2 + print_fprob;
4719 if (print_fval < 2) nlinesf += fit->GetNumberFreeParameters();
4720 else nlinesf += fit->GetNpar();
4756 Int_t ndf = fit->GetNDF();
4758 snprintf(t,64,textstats,fit->GetChisquare());
4759 if (print_fchi2) stats->
AddText(t);
4765 if (print_fval || print_ferrors) {
4767 for (
Int_t ipar=0;ipar<fit->GetNpar();ipar++) {
4768 fit->GetParLimits(ipar,parmin,parmax);
4769 if (print_fval < 2 && parmin*parmax != 0 && parmin >= parmax)
continue;
4770 if (print_ferrors) {
4772 snprintf(t,64,textstats,fit->GetParameter(ipar)
4773 ,fit->GetParError(ipar));
4776 snprintf(t,64,textstats,fit->GetParameter(ipar));
4783 if (!done) functions->
Add(stats);
4813 Int_t i, k, kp, km, npointsMax, banksize, n2, npt;
4814 Int_t maxiterations, finished;
4815 Int_t jtype, ktype, closed;
4816 Double_t sxmin, sxmax, symin, symax;
4819 Double_t ratio_signs, xratio, yratio;
4825 Double_t co, so, ct, st, ctu, stu, xnt;
4826 Double_t dx1, dy1, dx2, dy2, dk1, dk2;
4833 c = t = co = so = ct = st = ctu = stu = dx1 = dy1 = dx2 = dy2 = 0;
4834 xt = yt = xa = xb = ya = yb = u1 = u2 = u3 = tj = sb = 0;
4836 npointsMax = npoints*10;
4840 std::vector<Double_t> qlx(npointsMax);