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;
738 TGraphPolar *theGraphPolar = (TGraphPolar*) theGraph;
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);
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()) {
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");
1261 f = (TF1*)functions->
First();
1265 TIter next(functions);
1272 TPaletteAxis *palette = (TPaletteAxis*)functions->
FindObject(
"palette");
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);
1305 TString opt = chopt;
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;
1340 TH1F *histogram =
nullptr;
1344 rwxmin =
gPad->GetUxmin();
1345 rwxmax =
gPad->GetUxmax();
1346 rwymin =
gPad->GetUymin();
1347 rwymax =
gPad->GetUymax();
1350 if (minimum == -1111) {
1354 if (maximum == -1111) {
1358 uxmin =
gPad->PadtoX(rwxmin);
1359 uxmax =
gPad->PadtoX(rwxmax);
1362 theGraph->
ComputeRange(rwxmin, rwymin, rwxmax, rwymax);
1364 if (rwxmin == rwxmax) rwxmax += 1.;
1365 if (rwymin == rwymax) rwymax += 1.;
1366 dx = 0.1*(rwxmax-rwxmin);
1367 dy = 0.1*(rwymax-rwymin);
1368 uxmin = rwxmin - dx;
1369 uxmax = rwxmax + dx;
1370 minimum = rwymin - dy;
1371 maximum = rwymax + dy;
1377 if (uxmin < 0 && rwxmin >= 0)
1379 if (uxmax > 0 && rwxmax <= 0) {
1380 if (
gPad->GetLogx()) uxmax = 1.1*rwxmax;
1383 if (minimum < 0 && rwymin >= 0) minimum = 0.9*rwymin;
1384 if (maximum > 0 && rwymax <= 0) {
1388 if (minimum <= 0 && gPad->GetLogy()) minimum = 0.001*maximum;
1389 if (uxmin <= 0 && gPad->GetLogx()) {
1390 if (uxmax > 1000) uxmin = 1;
1391 else uxmin = 0.001*uxmax;
1398 char chopth[8] =
" ";
1399 if (strstr(chopt,
"x+")) strncat(chopth,
"x+",3);
1400 if (strstr(chopt,
"y+")) strncat(chopth,
"y+",3);
1401 if (optionIAxis) strncat(chopth,
"A",2);
1408 if (theNpoints > npt) npt = theNpoints;
1412 if (!histogram)
return;
1419 histogram->
Paint(chopth);
1421 if (
gPad->GetLogy()) {
1427 histogram->
Paint(chopth);
1434 rwxmin =
gPad->GetUxmin();
1435 rwxmax =
gPad->GetUxmax();
1436 rwymin =
gPad->GetUymin();
1437 rwymax =
gPad->GetUymax();
1438 uxmin =
gPad->PadtoX(rwxmin);
1439 uxmax =
gPad->PadtoX(rwxmax);
1441 if (histogram && !theGraph->
InheritsFrom(
"TGraphPolar")) {
1445 maximum =
gPad->PadtoY(rwymax);
1446 minimum =
gPad->PadtoY(rwymin);
1450 theGraph->TAttLine::Modify();
1451 theGraph->TAttFill::Modify();
1452 theGraph->TAttMarker::Modify();
1455 gxwork.resize(2*npoints+10);
1456 gywork.resize(2*npoints+10);
1460 if (optionLine || optionFill) {
1466 if (optionFill && (xn != x1 || yn != y1)) nloop++;
1468 for (i=1;i<=nloop;i++) {
1512 if (optionCurveFill) {
1514 if (xn != x1 || yn != y1) nloop++;
1518 for (i=1;i<=nloop;i++) {
1543 for (i=1;i<=nloop;i++) {
1547 if (
y[i-1] < minimum ||
y[i-1] > maximum)
continue;
1548 if (
x[i-1] < uxmin ||
x[i-1] > uxmax)
continue;
1574 for (i=1;i<=npoints;i++) {
1589 for (i=1;i<=npoints;i++) {
1604 if(FillSave ==
gPad->GetFrameFillColor()) {
1606 if (
gPad->GetFrameFillColor()==1) {
1608 theGraph->TAttFill::Modify();
1611 theGraph->TAttFill::Modify();
1617 for (i=1;i<npoints;i++) {
1618 if (
x[i] < barxmin) barxmin =
x[i];
1619 if (
x[i] > barxmax) barxmax =
x[i];
1621 bdelta = (barxmax-barxmin)/
Double_t(npoints);
1625 for (i=1;i<npoints;i++) {
1626 if (
y[i] < barymin) barymin =
y[i];
1627 if (
y[i] > barymax) barymax =
y[i];
1629 bdelta = (barymax-barymin)/
Double_t(npoints);
1631 dbar = 0.5*bdelta*
gStyle->GetBarWidth();
1633 for (i=1;i<=npoints;i++) {
1634 xlow =
x[i-1] - dbar;
1635 xhigh =
x[i-1] + dbar;
1637 if (xlow < uxmin && xhigh < uxmin)
continue;
1638 if (xhigh > uxmax && xlow > uxmax)
continue;
1639 if (xlow < uxmin) xlow = uxmin;
1640 if (xhigh > uxmax) xhigh = uxmax;
1642 else ylow =
gPad->GetUymin();
1656 for (i=1;i<=npoints;i++) {
1658 ylow =
y[i-1] - dbar;
1659 yhigh =
y[i-1] + dbar;
1670 theGraph->TAttFill::Modify();
1714 const char *where =
"PaintGrapHist";
1716 Int_t optionLine , optionAxis , optionCurve, optionStar, optionMark;
1717 Int_t optionBar , optionRot , optionOne , optionOff ;
1718 Int_t optionFill , optionZ;
1719 Int_t optionHist , optionBins , optionMarker;
1721 Int_t drawtype=0, drawborder, drawbordersav;
1727 Double_t xi, xi1, xj, xj1, yi1, yi, yj, yj1, xwmin, ywmin;
1728 Int_t first, last, nbins;
1731 char choptaxis[10] =
" ";
1734 Error(where,
"illegal number of points (%d)", npoints);
1737 TString opt = chopt;
1739 if (opt.
Contains(
"H")) optionHist = 1;
else optionHist = 0;
1740 if (opt.
Contains(
"F")) optionFill = 1;
else optionFill = 0;
1741 if (opt.
Contains(
"C")) optionCurve= 1;
else optionCurve= 0;
1742 if (opt.
Contains(
"*")) optionStar = 1;
else optionStar = 0;
1743 if (opt.
Contains(
"R")) optionRot = 1;
else optionRot = 0;
1744 if (opt.
Contains(
"1")) optionOne = 1;
else optionOne = 0;
1745 if (opt.
Contains(
"B")) optionBar = 1;
else optionBar = 0;
1746 if (opt.
Contains(
"N")) optionBins = 1;
else optionBins = 0;
1747 if (opt.
Contains(
"L")) optionLine = 1;
else optionLine = 0;
1748 if (opt.
Contains(
"P")) optionMark = 1;
else optionMark = 0;
1749 if (opt.
Contains(
"A")) optionAxis = 1;
else optionAxis = 0;
1750 if (opt.
Contains(
"][")) optionOff = 1;
else optionOff = 0;
1751 if (opt.
Contains(
"P0")) optionMark = 10;
1753 Int_t optionFill2 = 0;
1755 optionFill = 0; optionFill2 = 1;
1770 nbins = last - first + 1;
1782 Double_t rounding = (uxmax-uxmin)*1.e-5;
1783 drawborder =
gStyle->GetDrawBorder();
1785 Int_t nx1, nx2, ndivx, ndivy, ndiv;
1789 ndivx =
gStyle->GetNdivisions(
"X");
1790 ndivy =
gStyle->GetNdivisions(
"Y");
1798 if (ndivx < 0) strlcat(choptaxis,
"N",10);
1799 if (
gPad->GetGridx()) {
1801 strlcat(choptaxis,
"W",10);
1803 if (
gPad->GetLogx()) {
1807 strlcat(choptaxis,
"G",10);
1817 axis.
PaintAxis(rwxmin,rwymin,rwxmax,rwymin,rwmin,rwmax,ndiv,choptaxis);
1827 strlcat(choptaxis,
"N",10);
1830 if (
gPad->GetGridy()) {
1832 strlcat(choptaxis,
"W",10);
1834 if (
gPad->GetLogy()) {
1838 strlcat(choptaxis,
"G",10);
1847 axis.
PaintAxis(rwxmin,rwymin,rwxmin,rwymax,rwmin,rwmax,ndiv,choptaxis);
1852 theGraph->TAttLine::Modify();
1853 theGraph->TAttFill::Modify();
1854 theGraph->TAttMarker::Modify();
1858 if (!optionRot) {wmin =
x[0]; wmax =
x[1];}
1859 else {wmin =
y[0]; wmax =
y[1];}
1861 if (!optionBins) delta = (wmax - wmin)/
Double_t(nbins);
1863 Int_t fwidth =
gPad->GetFrameLineWidth();
1864 TFrame *frame =
gPad->GetFrame();
1866 if (optionOff) fwidth = 1;
1877 gxwork.resize(2*npoints+10);
1878 gywork.resize(2*npoints+10);
1882 if (optionFill && !optionCurve) {
1890 for (j=first; j<=last;j++) {
1893 gxwork[npt] = wmin+((j-first+1)*delta);
1897 xj1 =
x[j]; xj =
x[j-1];
1899 if (j != last)
Error(where,
"X must be in increasing order");
1900 else Error(where,
"X must have N+1 values with option N");
1908 if ((
gxwork[npt-1] >= uxmin-rounding &&
gxwork[npt-1] <= uxmax+rounding) ||
1909 (
gxwork[npt] >= uxmin-rounding &&
gxwork[npt] <= uxmax+rounding)) npt += 2;
1922 if (!fillarea)
gyworkl[0] = ylast;
1933 for (j=first; j<=last;j++) {
1936 gywork[npt] = wmin+((j-first+1)*delta);
1938 yj1 =
y[j]; yj =
y[j-1];
1940 if (j != last)
Error(where,
"Y must be in increasing order");
1941 else Error(where,
"Y must have N+1 values with option N");
1947 if ((
gxwork[npt-1] >= uxmin-rounding &&
gxwork[npt-1] <= uxmax+rounding) ||
1948 (
gxwork[npt] >= uxmin-rounding &&
gxwork[npt] <= uxmax+rounding)) npt += 2;
1955 if (!fillarea)
gyworkl[0] = ylast;
1962 theGraph->TAttLine::Modify();
1963 theGraph->TAttFill::Modify();
1968 if ((optionHist) || !chopt[0]) {
1976 for (i=first; i<=last;i++) {
1979 gxwork[npt] = wmin+((i-first+1)*delta);
1981 xi1 =
x[i]; xi =
x[i-1];
1983 if (i != last)
Error(where,
"X must be in increasing order");
1984 else Error(where,
"X must have N+1 values with option N");
1992 if ((
gxwork[npt-1] >= uxmin-rounding &&
gxwork[npt-1] <= uxmax+rounding) ||
1993 (
gxwork[npt] >= uxmin-rounding &&
gxwork[npt] <= uxmax+rounding)) npt += 2;
2005 Int_t nbpoints = npt-2;
2011 for (ip=point1; ip<=nbpoints; ip++) {
2018 Int_t point2 = nbpoints;
2019 for (ip=point2; ip>=point1; ip--) {
2025 nbpoints = point2-point1+1;
2029 if (
gxwork[0] >
gPad->GetUxmin()) { nbpoints++; point1 = 0; }
2030 if (
gxwork[nbpoints] <
gPad->GetUxmax()) nbpoints++;
2033 gPad->PaintPolyLine(nbpoints,
gxworkl.data() + point1,
gyworkl.data() + point1, noClip);
2043 for (i=first; i<=last;i++) {
2046 gywork[npt] = wmin+((i-first+1)*delta);
2048 yi1 =
y[i]; yi =
y[i-1];
2050 if (i != last)
Error(where,
"Y must be in increasing order");
2051 else Error(where,
"Y must have N+1 values with option N");
2057 if ((
gxwork[npt-1] >= uxmin-rounding &&
gxwork[npt-1] <= uxmax+rounding) ||
2058 (
gxwork[npt] >= uxmin-rounding &&
gxwork[npt] <= uxmax+rounding)) npt += 2;
2077 if (!optionOne) drawtype = 2;
2082 for (i=first; i<=last;i++) {
2085 gxwork[npt-1] = wmin+(i-first)*delta+0.5*delta;
2087 xi1 =
x[i]; xi =
x[i-1];
2089 if (i != last)
Error(where,
"X must be in increasing order");
2090 else Error(where,
"X must have N+1 values with option N");
2093 gxwork[npt-1] =
x[i-1] + 0.5*(
x[i]-
x[i-1]);
2124 drawtype = drawtype+10;
2126 for (i=first; i<=last;i++) {
2129 gywork[npt-1] = wmin+(i-first)*delta+0.5*delta;
2131 yi1 =
y[i]; yi =
y[i-1];
2133 if (i != last)
Error(where,
"Y must be in increasing order");
2134 else Error(where,
"Y must have N+1 values with option N");
2137 gywork[npt-1] =
y[i-1] + 0.5*(
y[i]-
y[i-1]);
2170 wminstep = wmin + 0.5*delta;
2172 gPad->GetRangeAxis(ax1,ay1,ax2,ay2);
2176 for (i=first; i<=last;i++) {
2179 gxwork[npt-1] = wmin+(i-first)*delta+0.5*delta;
2181 xi1 =
x[i]; xi =
x[i-1];
2183 if (i != last)
Error(where,
"X must be in increasing order");
2184 else Error(where,
"X must have N+1 values with option N");
2187 gxwork[npt-1] =
x[i-1] + 0.5*(
x[i]-
x[i-1]);
2189 if (
gxwork[npt-1] < uxmin ||
gxwork[npt-1] > uxmax) { npt--;
continue;}
2192 if ((
gywork[npt-1] < rwymin) || ((
gywork[npt-1] > rwymax) && !optionFill2)) {
2229 for (i=first; i<=last;i++) {
2232 gywork[npt-1] = wminstep+(i-first)*delta+0.5*delta;
2234 yi1 =
y[i]; yi =
y[i-1];
2236 if (i != last)
Error(where,
"Y must be in increasing order");
2237 else Error(where,
"Y must have N+1 values with option N");
2240 gywork[npt-1] =
y[i-1] + 0.5*(
y[i]-
y[i-1]);
2243 if ((
gxwork[npt-1] < uxmin) || (
gxwork[npt-1] > uxmax)) {
2265 if (optionLine != 0 && npt > 1) {
2276 offset = delta*baroffset; dbar = delta*barwidth;
2279 offset = (
x[1]-
x[0])*baroffset;
2280 dbar = (
x[1]-
x[0])*barwidth;
2282 offset = (
y[1]-
y[0])*baroffset;
2283 dbar = (
y[1]-
y[0])*barwidth;
2286 drawbordersav = drawborder;
2287 gStyle->SetDrawBorder(1);
2290 xhigh = wmin+offset+dbar;
2293 else ylow =
gPad->GetUymin();
2295 for (i=first; i<=last;i++) {
2302 if (xlow < uxmax && xhigh > uxmin)
2306 xhigh = xhigh+delta;
2309 xi1 =
x[i]; xi =
x[i-1];
2311 Error(where,
"X must be in increasing order");
2314 offset = (
x[i+1]-
x[i])*baroffset;
2315 dbar = (
x[i+1]-
x[i])*barwidth;
2316 xlow =
x[i] + offset;
2317 xhigh =
x[i] + offset + dbar;
2322 ylow = wmin + offset;
2323 yhigh = wmin + offset + dbar;
2325 else xlow =
gPad->GetUxmin();
2326 for (i=first; i<=last;i++) {
2334 gPad->PaintBox(xlow,ylow,xhigh,yhigh);
2336 ylow = ylow + delta;
2337 yhigh = yhigh + delta;
2340 yi1 =
y[i]; yi =
y[i-1];
2342 Error(where,
"Y must be in increasing order");
2345 offset = (
y[i+1]-
y[i])*baroffset;
2346 dbar = (
y[i+1]-
y[i])*barwidth;
2347 ylow =
y[i] + offset;
2348 yhigh =
y[i] + offset + dbar;
2353 gStyle->SetDrawBorder(drawbordersav);
2359 if ((optionStar) || (optionMark)) optionMarker=1;
2365 for (i=first; i<=last;i++) {
2366 if (!optionBins) xm = wmin+(i-first)*delta+0.5*delta;
2367 else xm =
x[i-1] + 0.5*(
x[i]-
x[i-1]);
2369 if (optionMark != 10) {
2370 if (ym<rwymax && ym > rwymin) {
2376 if (ym<rwymax && ym >= rwymin) {
2393 wminstep = wmin + 0.5*delta;
2394 for (i=first; i<=last;i++) {
2395 if (!optionBins) ym = wminstep+(i-first)*delta+0.5*delta;
2396 else ym =
y[i-1] + 0.5*(
y[i]-
y[i-1]);
2398 if (optionMark != 10) {
2399 if (xm<rwxmax && xm > rwxmin) {
2405 if (xm<rwxmax && xm >= rwxmin) {
2440 std::vector<Double_t> xline, yline;
2445 const Int_t kBASEMARKER=8;
2446 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};
2447 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};
2456 if (strchr(option,
'X') || strchr(option,
'x')) {
PaintGraphSimple(theGraph, option);
return;}
2459 if (strstr(option,
"||") || strstr(option,
"[]")) {
2461 if (strstr(option,
"[]")) braticks =
kTRUE;
2464 if (strchr(option,
'z')) endLines =
kFALSE;
2465 if (strchr(option,
'Z')) endLines =
kFALSE;
2466 const char *arrowOpt =
nullptr;
2467 if (strchr(option,
'>')) arrowOpt =
">";
2468 if (strstr(option,
"|>")) arrowOpt =
"|>";
2471 if (strchr(option,
'a')) axis =
kTRUE;
2472 if (strchr(option,
'A')) axis =
kTRUE;
2480 if (strchr(option,
'0')) option0 =
kTRUE;
2481 if (strchr(option,
'2')) option2 =
kTRUE;
2482 if (strchr(option,
'3')) option3 =
kTRUE;
2483 if (strchr(option,
'4')) {option3 =
kTRUE; option4 =
kTRUE;}
2484 if (strchr(option,
'5')) {option2 =
kTRUE; option5 =
kTRUE;}
2489 if (strstr(option,
"-N")) xrevlog =
kTRUE;
2490 if (strstr(option,
"-M")) yrevlog =
kTRUE;
2493 xline.resize(2*theNpoints);
2494 yline.resize(2*theNpoints);
2495 if (xline.empty() || yline.empty()) {
2496 Error(
"PaintGraphAsymmErrors",
"too many points, out of memory");
2503 theGraph->TAttLine::Modify();
2518 Double_t sbase = symbolsize*kBASEMARKER;
2522 if (mark >= 20 && mark <= 49) {
2533 Float_t asize = 0.6*symbolsize*kBASEMARKER/
gPad->GetWh();
2538 Bool_t DrawXLeft, DrawXRight, DrawYUp, DrawYLow;
2540 Double_t x,
y, exl, exh, eyl, eyh, xl1, xl2, xr1, xr2, yup, yup1, yup2, ylow, ylow1, ylow2;
2541 for (
Int_t i=0;i<theNpoints;i++) {
2546 x =
gPad->XtoPad(theX[i]);
2547 y =
gPad->YtoPad(theY[i]);
2552 if (
x >
gPad->GetUxmax())
x =
gPad->GetUxmax();
2554 if (
y >
gPad->GetUymax())
y =
gPad->GetUymax();
2557 if (
x >
gPad->GetUxmax())
continue;
2559 if (
y >
gPad->GetUymax())
continue;
2579 xl2 =
gPad->XtoPad(theX[i] - exl);
2581 xr2 =
gPad->XtoPad(theX[i] + exh);
2582 if (xl1 < xl2) DrawXLeft =
kFALSE;
2583 if (xr1 > xr2) DrawXRight =
kFALSE;
2597 yup2 =
gPad->YtoPad(theY[i] + eyh);
2599 ylow2 =
gPad->YtoPad(theY[i] - eyl);
2600 if (yup2 < yup1) DrawYUp =
kFALSE;
2601 if (ylow2 > ylow1) DrawYLow =
kFALSE;
2605 if (yup2 >
gPad->GetUymax()) yup2 =
gPad->GetUymax();
2606 if (ylow2 < gPad->GetUymin()) ylow2 =
gPad->GetUymin();
2614 if (x1b < gPad->GetUxmin()) x1b =
gPad->GetUxmin();
2615 if (x1b >
gPad->GetUxmax()) x1b =
gPad->GetUxmax();
2616 if (y1b < gPad->GetUymin()) y1b =
gPad->GetUymin();
2617 if (y1b >
gPad->GetUymax()) y1b =
gPad->GetUymax();
2618 if (x2b < gPad->GetUxmin()) x2b =
gPad->GetUxmin();
2619 if (x2b >
gPad->GetUxmax()) x2b =
gPad->GetUxmax();
2620 if (y2b < gPad->GetUymin()) y2b =
gPad->GetUymin();
2621 if (y2b >
gPad->GetUymax()) y2b =
gPad->GetUymax();
2622 if (option5)
box.PaintBox(x1b, y1b, x2b, y2b,
"l");
2623 else box.PaintBox(x1b, y1b, x2b, y2b);
2631 yline[if1-1] = yup2;
2632 yline[if2-1] = ylow2;
2638 if (exl != 0. || exh != 0.) {
2644 if (exl != 0. && DrawXLeft)
gPad->PaintLine(xl1,
y,xl2,
y);
2645 if (exh != 0. && DrawXRight)
gPad->PaintLine(xr1,
y,xr2,
y);
2649 if (exl != 0. && DrawXLeft) {
2650 xb[0] = xl2+tx; yb[0] =
y-ty;
2651 xb[1] = xl2; yb[1] =
y-ty;
2652 xb[2] = xl2; yb[2] =
y+ty;
2653 xb[3] = xl2+tx; yb[3] =
y+ty;
2654 gPad->PaintPolyLine(4, xb, yb);
2656 if (exh != 0. && DrawXRight) {
2657 xb[0] = xr2-tx; yb[0] =
y-ty;
2658 xb[1] = xr2; yb[1] =
y-ty;
2659 xb[2] = xr2; yb[2] =
y+ty;
2660 xb[3] = xr2-tx; yb[3] =
y+ty;
2661 gPad->PaintPolyLine(4, xb, yb);
2664 if (DrawXLeft)
gPad->PaintLine(xl2,
y-ty,xl2,
y+ty);
2665 if (DrawXRight)
gPad->PaintLine(xr2,
y-ty,xr2,
y+ty);
2671 if (eyl != 0. || eyh != 0.) {
2673 if (eyh != 0. && DrawYUp) {
2675 else gPad->PaintLine(
x,yup1,
x,yup2);
2677 if (eyl != 0. && DrawYLow) {
2679 else gPad->PaintLine(
x,ylow1,
x,ylow2);
2683 if (eyh != 0. && DrawYUp)
gPad->PaintLine(
x,yup1,
x,yup2);
2684 if (eyl != 0. && DrawYLow)
gPad->PaintLine(
x,ylow1,
x,ylow2);
2688 if (eyh != 0. && yup2 == yup && DrawYUp) {
2689 xb[0] =
x-tx; yb[0] = yup2-ty;
2690 xb[1] =
x-tx; yb[1] = yup2;
2691 xb[2] =
x+tx; yb[2] = yup2;
2692 xb[3] =
x+tx; yb[3] = yup2-ty;
2693 gPad->PaintPolyLine(4, xb, yb);
2695 if (eyl != 0. && ylow2 == ylow && DrawYLow) {
2696 xb[0] =
x-tx; yb[0] = ylow2+ty;
2697 xb[1] =
x-tx; yb[1] = ylow2;
2698 xb[2] =
x+tx; yb[2] = ylow2;
2699 xb[3] =
x+tx; yb[3] = ylow2+ty;
2700 gPad->PaintPolyLine(4, xb, yb);
2703 if (eyh != 0. && yup2 == yup && DrawYUp)
gPad->PaintLine(
x-tx,yup2,
x+tx,yup2);
2704 if (eyl != 0. && ylow2 == ylow && DrawYLow)
gPad->PaintLine(
x-tx,ylow2,
x+tx,ylow2);
2718 if (option4)
PaintGraph(theGraph, 2*theNpoints, xline.data(), yline.data(),
"FC");
2719 else PaintGraph(theGraph, 2*theNpoints, xline.data(), yline.data(),
"F");
2720 gPad->SetLogx(logx);
2721 gPad->SetLogy(logy);
2735 auto tg = (TGraphMultiErrors *)theGraph;
2737 Int_t NYErrors = tg->GetNYErrors();
2738 if (NYErrors <= 0) {
2743 TString tsOpt = option;
2746 std::vector<TString> options(NYErrors + 1);
2755 while ((firstSemicolon = tsOpt.
First(
';')) !=
kNPOS && filled <= NYErrors) {
2756 options[filled] = tsOpt(0, firstSemicolon);
2757 tsOpt = tsOpt(firstSemicolon + 1, tsOpt.
Length());
2761 if (filled <= NYErrors) {
2762 options[filled] = tsOpt.
Copy();
2766 for (
Int_t i = filled; i <= NYErrors; i++)
2769 std::vector<Double_t> xline;
2770 std::vector<std::vector<Double_t>> yline(NYErrors);
2775 const Int_t kBASEMARKER = 8;
2776 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};
2777 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};
2778 Int_t theNpoints = tg->GetN();
2782 Double_t *theExH = tg->GetEXhigh();
2783 std::vector<Double_t *> theEyL(NYErrors);
2784 std::vector<Double_t *> theEyH(NYErrors);
2787 for (
Int_t j = 0; j < NYErrors; j++) {
2788 theEyL[j] = tg->GetEYlow(j);
2789 theEyH[j] = tg->GetEYhigh(j);
2790 theEyExists &= (theEyL[j] && theEyH[j]);
2793 if (!theX || !theY || !theExL || !theExH || !theEyExists)
2796 std::vector<Bool_t> DrawErrors(NYErrors);
2801 std::vector<Bool_t> Braticks(NYErrors);
2802 std::vector<Bool_t> Brackets(NYErrors);
2803 std::vector<Bool_t> EndLines(NYErrors);
2804 std::vector<Char_t *> ArrowOpt(NYErrors);
2805 std::vector<Bool_t> Option5(NYErrors);
2806 std::vector<Bool_t> Option4(NYErrors);
2807 std::vector<Bool_t> Option3(NYErrors);
2809 std::vector<Bool_t> Option2(NYErrors);
2810 std::vector<Bool_t> Option0(NYErrors);
2812 std::vector<Double_t> Scale(NYErrors);
2814 const TRegexp ScaleRegExp(
"s=*[0-9]\\.*[0-9]");
2816 for (
Int_t j = 0; j < NYErrors; j++) {
2817 if (options[j + 1].Contains(
"s=")) {
2818 sscanf(strstr(options[j + 1].Data(),
"s="),
"s=%lf", &Scale[j]);
2819 options[j + 1].ReplaceAll(options[j + 1](ScaleRegExp),
"");
2823 DrawErrors[j] = !options[j + 1].Contains(
"x");
2824 AnyErrors |= DrawErrors[j];
2825 Braticks[j] = options[j + 1].Contains(
"[]");
2826 Brackets[j] = options[j + 1].Contains(
"||") || Braticks[j];
2827 EndLines[j] = !options[j + 1].Contains(
"z");
2829 if (options[j + 1].Contains(
"|>"))
2830 ArrowOpt[j] = (
Char_t *)
"|>";
2831 else if (options[j + 1].Contains(
">"))
2832 ArrowOpt[j] = (
Char_t *)
">";
2834 ArrowOpt[j] =
nullptr;
2836 Option5[j] = options[j + 1].Contains(
"5");
2837 Option4[j] = options[j + 1].Contains(
"4");
2838 Option3[j] = options[j + 1].Contains(
"3") || Option4[j];
2839 AnyOption3 |= Option3[j];
2840 Option2[j] = options[j + 1].Contains(
"2") || Option5[j];
2841 Option0[j] = options[j + 1].Contains(
"0");
2842 AnyOption0 |= Option0[j];
2844 NoErrorsX &= (Option3[j] || Option2[j]);
2845 Option0X |= !(Option3[j] || Option2[j]) && Option0[j];
2846 DrawMarker |= !(Brackets[j] || Option3[j] || Option2[j]);
2849 Bool_t Draw0PointsX = !options[0].Contains(
"x0") && (
gPad->GetLogx() == 0);
2850 Bool_t Draw0PointsY = !options[0].Contains(
"y0") && (
gPad->GetLogy() == 0);
2851 options[0].ReplaceAll(
"x0",
"");
2852 options[0].ReplaceAll(
"y0",
"");
2854 Bool_t DrawErrorsX = !options[0].Contains(
"x");
2855 Bool_t BraticksX = options[0].Contains(
"[]");
2856 Bool_t BracketsX = options[0].Contains(
"||") || BraticksX;
2857 Bool_t EndLinesX = !options[0].Contains(
"z");
2859 Char_t *ArrowOptX =
nullptr;
2860 if (options[0].Contains(
"|>"))
2861 ArrowOptX = (
Char_t *)
"|>";
2862 else if (options[0].Contains(
">"))
2863 ArrowOptX = (
Char_t *)
">";
2866 if (options[0].Contains(
"s=")) {
2867 sscanf(strstr(options[0].Data(),
"s="),
"s=%lf", &ScaleX);
2868 options[0].ReplaceAll(options[0](ScaleRegExp),
"");
2871 if (!AnyErrors && !DrawErrorsX) {
2876 Bool_t DrawAxis = options[0].Contains(
"a");
2877 Bool_t IndividualStyles = options[0].Contains(
"s");
2882 Int_t NPointsInside = AnyOption0 ? theNpoints : 0;
2885 for (
Int_t i = 0; i < theNpoints && !AnyOption0; i++) {
2886 x =
gPad->XtoPad(theX[i]);
2887 y =
gPad->YtoPad(theY[i]);
2890 (Draw0PointsX || theX[i] != 0.) && (Draw0PointsY || theY[i] != 0.))
2895 xline.resize(2 * NPointsInside);
2897 if (xline.empty()) {
2898 Error(
"PaintGraphMultiErrors",
"too many points, out of memory");
2903 if2 = 2 * NPointsInside;
2906 for (
Int_t j = 0; j < NYErrors; j++) {
2907 if (Option3[j] && DrawErrors[j]) {
2908 yline[j].resize(2 * NPointsInside);
2910 if (yline[j].empty()) {
2911 Error(
"PaintGraphMultiErrors",
"too many points, out of memory");
2917 tg->TAttLine::Modify();
2926 box.SetLineWidth(tg->GetLineWidth());
2927 box.SetLineColor(tg->GetLineColor());
2928 box.SetFillColor(tg->GetFillColor());
2929 box.SetFillStyle(tg->GetFillStyle());
2931 Double_t symbolsize = tg->GetMarkerSize();
2932 Double_t sbase = symbolsize * kBASEMARKER;
2937 if (mark >= 20 && mark <= 49) {
2938 cx = cxx[mark - 20];
2939 cy = cyy[mark - 20];
2948 Float_t asize = 0.6 * symbolsize * kBASEMARKER /
gPad->GetWh();
2953 Double_t xl1, xl2, xr1, xr2, yup1, yup2, ylow1, ylow2;
2954 for (
Int_t i = 0; i < theNpoints; i++) {
2955 x =
gPad->XtoPad(theX[i]);
2956 y =
gPad->YtoPad(theY[i]);
2959 (
x <
gPad->GetUxmin()) || (
x >
gPad->GetUxmax()) || (
y <
gPad->GetUymin()) || (
y >
gPad->GetUymax());
2961 if ((isOutside && !AnyOption0) || (!Draw0PointsX && theX[i] == 0.) || (!Draw0PointsY && theY[i] == 0.))
2967 x =
gPad->GetUxmin();
2968 if (
x >
gPad->GetUxmax())
2969 x =
gPad->GetUxmax();
2971 y =
gPad->GetUymin();
2972 if (
y >
gPad->GetUymax())
2973 y =
gPad->GetUymax();
2983 for (
Int_t j = 0; j < NYErrors; j++) {
2988 if (Option2[j] && (!isOutside || Option0[j])) {
2989 if (IndividualStyles) {
2990 box.SetLineWidth(tg->GetLineWidth(j));
2991 box.SetLineColor(tg->GetLineColor(j));
2992 box.SetFillColor(tg->GetFillColor(j));
2993 box.SetFillStyle(tg->GetFillStyle(j));
2996 x1b =
gPad->XtoPad(theX[i] - Scale[j] * theExL[i]);
2997 y1b =
gPad->YtoPad(theY[i] - theEyL[j][i]);
2998 x2b =
gPad->XtoPad(theX[i] + Scale[j] * theExH[i]);
2999 y2b =
gPad->YtoPad(theY[i] + theEyH[j][i]);
3000 if (x1b < gPad->GetUxmin())
3001 x1b =
gPad->GetUxmin();
3002 if (x1b >
gPad->GetUxmax())
3003 x1b =
gPad->GetUxmax();
3004 if (y1b < gPad->GetUymin())
3005 y1b =
gPad->GetUymin();
3006 if (y1b >
gPad->GetUymax())
3007 y1b =
gPad->GetUymax();
3008 if (x2b < gPad->GetUxmin())
3009 x2b =
gPad->GetUxmin();
3010 if (x2b >
gPad->GetUxmax())
3011 x2b =
gPad->GetUxmax();
3012 if (y2b < gPad->GetUymin())
3013 y2b =
gPad->GetUymin();
3014 if (y2b >
gPad->GetUymax())
3015 y2b =
gPad->GetUymax();
3017 box.PaintBox(x1b, y1b, x2b, y2b,
"l");
3019 box.PaintBox(x1b, y1b, x2b, y2b);
3024 if (!isOutside || Option0[j]) {
3025 yline[j][if1 - 2] =
gPad->YtoPad(theY[i] + theEyH[j][i]);
3026 yline[j][if2] =
gPad->YtoPad(theY[i] - theEyL[j][i]);
3028 yline[j][if1 - 2] =
gPad->GetUymin();
3029 yline[j][if2] =
gPad->GetUymin();
3033 if (IndividualStyles) {
3034 tg->GetAttLine(j)->Modify();
3041 ylow1 =
y - s2y * cy;
3042 ylow2 =
gPad->YtoPad(theY[i] - theEyL[j][i]);
3043 if (ylow2 < gPad->GetUymin())
3044 ylow2 =
gPad->GetUymin();
3045 if (ylow2 < ylow1 && DrawErrors[j] && !Option2[j] && !Option3[j] && (!isOutside || Option0[j])) {
3050 gPad->PaintLine(
x, ylow1,
x, ylow2);
3061 gPad->PaintPolyLine(4, xb, yb);
3063 gPad->PaintLine(
x - tx, ylow2,
x + tx, ylow2);
3068 yup1 =
y + s2y * cy;
3069 yup2 =
gPad->YtoPad(theY[i] + theEyH[j][i]);
3070 if (yup2 >
gPad->GetUymax())
3071 yup2 =
gPad->GetUymax();
3072 if (yup2 > yup1 && DrawErrors[j] && !Option2[j] && !Option3[j] && (!isOutside || Option0[j])) {
3077 gPad->PaintLine(
x, yup1,
x, yup2);
3088 gPad->PaintPolyLine(4, xb, yb);
3090 gPad->PaintLine(
x - tx, yup2,
x + tx, yup2);
3097 if (IndividualStyles) {
3098 tg->TAttLine::Modify();
3106 xl2 =
gPad->XtoPad(theX[i] - ScaleX * theExL[i]);
3107 if (xl1 > xl2 && !NoErrorsX && (!isOutside || Option0X)) {
3112 gPad->PaintLine(xl1,
y, xl2,
y);
3123 gPad->PaintPolyLine(4, xb, yb);
3125 gPad->PaintLine(xl2,
y - ty, xl2,
y + ty);
3131 xr2 =
gPad->XtoPad(theX[i] + ScaleX * theExH[i]);
3132 if (xr1 < xr2 && !NoErrorsX && (!isOutside || Option0X)) {
3137 gPad->PaintLine(xr1,
y, xr2,
y);
3148 gPad->PaintPolyLine(4, xb, yb);
3150 gPad->PaintLine(xr2,
y - ty, xr2,
y + ty);
3162 tg->TAttFill::Copy(tgDummy);
3163 tg->TAttLine::Copy(tgDummy);
3164 tg->TAttMarker::Copy(tgDummy);
3166 for (
Int_t j = 0; j < NYErrors; j++)
3167 if (Option3[j] && DrawErrors[j]) {
3168 if (IndividualStyles) {
3169 tg->GetAttFill(j)->Copy(tgDummy);
3170 tg->GetAttLine(j)->Copy(tgDummy);
3178 PaintGraph(&tgDummy, 2 * NPointsInside, xline.data(), yline[j].data(),
"FC");
3180 PaintGraph(&tgDummy, 2 * NPointsInside, xline.data(), yline[j].data(),
"F");
3181 gPad->SetLogx(logx);
3182 gPad->SetLogy(logy);
3193 std::vector<Double_t> xline, yline;
3198 const Int_t kBASEMARKER=8;
3199 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};
3200 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};
3213 if (strchr(option,
'X') || strchr(option,
'x')) {
PaintGraphSimple(theGraph, option);
return;}
3216 if (strstr(option,
"||") || strstr(option,
"[]")) {
3218 if (strstr(option,
"[]")) braticks =
kTRUE;
3221 if (strchr(option,
'z')) endLines =
kFALSE;
3222 if (strchr(option,
'Z')) endLines =
kFALSE;
3223 const char *arrowOpt =
nullptr;
3224 if (strchr(option,
'>')) arrowOpt =
">";
3225 if (strstr(option,
"|>")) arrowOpt =
"|>";
3228 if (strchr(option,
'a')) axis =
kTRUE;
3229 if (strchr(option,
'A')) axis =
kTRUE;
3237 if (strchr(option,
'0')) option0 =
kTRUE;
3238 if (strchr(option,
'2')) option2 =
kTRUE;
3239 if (strchr(option,
'3')) option3 =
kTRUE;
3240 if (strchr(option,
'4')) {option3 =
kTRUE; option4 =
kTRUE;}
3241 if (strchr(option,
'5')) {option2 =
kTRUE; option5 =
kTRUE;}
3246 if (strstr(option,
"-N")) xrevlog =
kTRUE;
3247 if (strstr(option,
"-M")) yrevlog =
kTRUE;
3250 xline.resize(2*theNpoints);
3251 yline.resize(2*theNpoints);
3252 if (xline.empty() || yline.empty()) {
3253 Error(
"PaintGraphBentErrors",
"too many points, out of memory");
3260 theGraph->TAttLine::Modify();
3275 Double_t sbase = symbolsize*kBASEMARKER;
3279 if (mark >= 20 && mark <= 49) {
3290 Float_t asize = 0.6*symbolsize*kBASEMARKER/
gPad->GetWh();
3295 Bool_t DrawXLeft, DrawXRight, DrawYUp, DrawYLow;
3297 Double_t x,
y, exl, exh, eyl, eyh, xl1, xl2, xr1, xr2, yup, yup1, yup2, ylow, ylow1, ylow2;
3299 for (
Int_t i=0;i<theNpoints;i++) {
3304 x =
gPad->XtoPad(theX[i]);
3305 y =
gPad->YtoPad(theY[i]);
3306 bxl =
gPad->YtoPad(theY[i]+theEXlowd[i]);
3307 bxh =
gPad->YtoPad(theY[i]+theEXhighd[i]);
3308 byl =
gPad->XtoPad(theX[i]+theEYlowd[i]);
3309 byh =
gPad->XtoPad(theX[i]+theEYhighd[i]);
3314 if (
x >
gPad->GetUxmax())
x =
gPad->GetUxmax();
3316 if (
y >
gPad->GetUymax())
y =
gPad->GetUymax();
3319 if (
x >
gPad->GetUxmax())
continue;
3321 if (
y >
gPad->GetUymax())
continue;
3347 xl2 =
gPad->XtoPad(theX[i] - exl);
3349 xr2 =
gPad->XtoPad(theX[i] + exh);
3350 if (xl1 < xl2) DrawXLeft =
kFALSE;
3351 if (xr1 > xr2) DrawXRight =
kFALSE;
3371 yup2 =
gPad->YtoPad(theY[i] + eyh);
3373 ylow2 =
gPad->YtoPad(theY[i] - eyl);
3374 if (yup2 < yup1) DrawYUp =
kFALSE;
3375 if (ylow2 > ylow1) DrawYLow =
kFALSE;
3379 if (yup2 >
gPad->GetUymax()) yup2 =
gPad->GetUymax();
3380 if (ylow2 < gPad->GetUymin()) ylow2 =
gPad->GetUymin();
3382 if (xrevlog) {bs = bxl; bxl = bxh; bxh = bs;}
3383 if (yrevlog) {bs = byl; byl = byh; byh = bs;}
3391 if (x1b < gPad->GetUxmin()) x1b =
gPad->GetUxmin();
3392 if (x1b >
gPad->GetUxmax()) x1b =
gPad->GetUxmax();
3393 if (y1b < gPad->GetUymin()) y1b =
gPad->GetUymin();
3394 if (y1b >
gPad->GetUymax()) y1b =
gPad->GetUymax();
3395 if (x2b < gPad->GetUxmin()) x2b =
gPad->GetUxmin();
3396 if (x2b >
gPad->GetUxmax()) x2b =
gPad->GetUxmax();
3397 if (y2b < gPad->GetUymin()) y2b =
gPad->GetUymin();
3398 if (y2b >
gPad->GetUymax()) y2b =
gPad->GetUymax();
3399 if (option5)
box.PaintBox(x1b, y1b, x2b, y2b,
"l");
3400 else box.PaintBox(x1b, y1b, x2b, y2b);
3408 yline[if1-1] = yup2;
3409 yline[if2-1] = ylow2;
3415 if (exl != 0. || exh != 0.) {
3417 if (exl != 0. && DrawXLeft)
arrow.
PaintArrow(xl1,
y,xl2,bxl,asize,arrowOpt);
3418 if (exh != 0. && DrawXRight)
arrow.
PaintArrow(xr1,
y,xr2,bxh,asize,arrowOpt);
3421 if (exl != 0. && DrawXLeft)
gPad->PaintLine(xl1,
y,xl2,bxl);
3422 if (exh != 0. && DrawXRight)
gPad->PaintLine(xr1,
y,xr2,bxh);
3426 if (exl != 0. && DrawXLeft) {
3427 xb[0] = xl2+tx; yb[0] = bxl-ty;
3428 xb[1] = xl2; yb[1] = bxl-ty;
3429 xb[2] = xl2; yb[2] = bxl+ty;
3430 xb[3] = xl2+tx; yb[3] = bxl+ty;
3431 gPad->PaintPolyLine(4, xb, yb);
3433 if (exh != 0. && DrawXRight) {
3434 xb[0] = xr2-tx; yb[0] = bxh-ty;
3435 xb[1] = xr2; yb[1] = bxh-ty;
3436 xb[2] = xr2; yb[2] = bxh+ty;
3437 xb[3] = xr2-tx; yb[3] = bxh+ty;
3438 gPad->PaintPolyLine(4, xb, yb);
3441 if (DrawXLeft)
gPad->PaintLine(xl2,bxl-ty,xl2,bxl+ty);
3442 if (DrawXRight)
gPad->PaintLine(xr2,bxh-ty,xr2,bxh+ty);
3448 if (eyl != 0. || eyh != 0.) {
3450 if (eyh != 0. && DrawYUp) {
3452 else gPad->PaintLine(
x,yup1,byh,yup2);
3454 if (eyl != 0. && DrawYLow) {
3456 else gPad->PaintLine(
x,ylow1,byl,ylow2);
3460 if (eyh != 0. && DrawYUp)
gPad->PaintLine(
x,yup1,byh,yup2);
3461 if (eyl != 0. && DrawYLow)
gPad->PaintLine(
x,ylow1,byl,ylow2);
3465 if (eyh != 0. && yup2 == yup && DrawYUp) {
3466 xb[0] = byh-tx; yb[0] = yup2-ty;
3467 xb[1] = byh-tx; yb[1] = yup2;
3468 xb[2] = byh+tx; yb[2] = yup2;
3469 xb[3] = byh+tx; yb[3] = yup2-ty;
3470 gPad->PaintPolyLine(4, xb, yb);
3472 if (eyl != 0. && ylow2 == ylow && DrawYLow) {
3473 xb[0] = byl-tx; yb[0] = ylow2+ty;
3474 xb[1] = byl-tx; yb[1] = ylow2;
3475 xb[2] = byl+tx; yb[2] = ylow2;
3476 xb[3] = byl+tx; yb[3] = ylow2+ty;
3477 gPad->PaintPolyLine(4, xb, yb);
3480 if (eyh != 0. && yup2 == yup && DrawYUp)
gPad->PaintLine(byh-tx,yup2,byh+tx,yup2);
3481 if (eyl != 0. && ylow2 == ylow && DrawYLow)
gPad->PaintLine(byl-tx,ylow2,byl+tx,ylow2);
3496 if (option4)
PaintGraph(theGraph, 2*theNpoints, xline.data(), yline.data(),
"FC");
3497 else PaintGraph(theGraph, 2*theNpoints, xline.data(), yline.data(),
"F");
3498 gPad->SetLogx(logx);
3499 gPad->SetLogy(logy);
3510 std::vector<Double_t> xline, yline;
3515 const Int_t kBASEMARKER=8;
3516 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};
3517 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};
3524 if (strchr(option,
'X') || strchr(option,
'x')) {
PaintGraphSimple(theGraph, option);
return;}
3527 if (strstr(option,
"||") || strstr(option,
"[]")) {
3529 if (strstr(option,
"[]")) braticks =
kTRUE;
3532 if (strchr(option,
'z')) endLines =
kFALSE;
3533 if (strchr(option,
'Z')) endLines =
kFALSE;
3534 const char *arrowOpt =
nullptr;
3535 if (strchr(option,
'>')) arrowOpt =
">";
3536 if (strstr(option,
"|>")) arrowOpt =
"|>";
3539 if (strchr(option,
'a')) axis =
kTRUE;
3540 if (strchr(option,
'A')) axis =
kTRUE;
3548 if (strchr(option,
'0')) option0 =
kTRUE;
3549 if (strchr(option,
'2')) option2 =
kTRUE;
3550 if (strchr(option,
'3')) option3 =
kTRUE;
3551 if (strchr(option,
'4')) {option3 =
kTRUE; option4 =
kTRUE;}
3552 if (strchr(option,
'5')) {option2 =
kTRUE; option5 =
kTRUE;}
3557 if (strstr(option,
"-N")) xrevlog =
kTRUE;
3558 if (strstr(option,
"-M")) yrevlog =
kTRUE;
3561 xline.resize(2*theNpoints);
3562 yline.resize(2*theNpoints);
3563 if (xline.empty() || yline.empty()) {
3564 Error(
"PaintGraphErrors",
"too many points, out of memory");
3571 theGraph->TAttLine::Modify();
3587 Double_t sbase = symbolsize*kBASEMARKER;
3591 if (mark >= 20 && mark <= 49) {
3602 Float_t asize = 0.6*symbolsize*kBASEMARKER/
gPad->GetWh();
3607 Bool_t DrawXLeft, DrawXRight, DrawYUp, DrawYLow;
3609 Double_t x,
y,
ex,
ey, xl1, xl2, xr1, xr2, yup, yup1, yup2, ylow, ylow1, ylow2;
3610 for (
Int_t i=0;i<theNpoints;i++) {
3615 x =
gPad->XtoPad(theX[i]);
3616 y =
gPad->YtoPad(theY[i]);
3621 if (
x >
gPad->GetUxmax())
x =
gPad->GetUxmax();
3623 if (
y >
gPad->GetUymax())
y =
gPad->GetUymax();
3626 if (
x >
gPad->GetUxmax())
continue;
3628 if (
y >
gPad->GetUymax())
continue;
3646 xl2 =
gPad->XtoPad(theX[i] -
ex);
3648 xr2 =
gPad->XtoPad(theX[i] +
ex);
3649 if (xl1 < xl2) DrawXLeft =
kFALSE;
3650 if (xr1 > xr2) DrawXRight =
kFALSE;
3664 yup2 =
gPad->YtoPad(theY[i] +
ey);
3666 ylow2 =
gPad->YtoPad(theY[i] -
ey);
3667 if (yup2 < yup1) DrawYUp =
kFALSE;
3668 if (ylow2 > ylow1) DrawYLow =
kFALSE;
3672 if (yup2 >
gPad->GetUymax()) yup2 =
gPad->GetUymax();
3673 if (ylow2 < gPad->GetUymin()) ylow2 =
gPad->GetUymin();
3681 if (x1b < gPad->GetUxmin()) x1b =
gPad->GetUxmin();
3682 if (x1b >
gPad->GetUxmax()) x1b =
gPad->GetUxmax();
3683 if (y1b < gPad->GetUymin()) y1b =
gPad->GetUymin();
3684 if (y1b >
gPad->GetUymax()) y1b =
gPad->GetUymax();
3685 if (x2b < gPad->GetUxmin()) x2b =
gPad->GetUxmin();
3686 if (x2b >
gPad->GetUxmax()) x2b =
gPad->GetUxmax();
3687 if (y2b < gPad->GetUymin()) y2b =
gPad->GetUymin();
3688 if (y2b >
gPad->GetUymax()) y2b =
gPad->GetUymax();
3689 if (option5)
box.PaintBox(x1b, y1b, x2b, y2b,
"l");
3690 else box.PaintBox(x1b, y1b, x2b, y2b);
3698 yline[if1-1] = yup2;
3699 yline[if2-1] = ylow2;
3711 if (DrawXLeft)
gPad->PaintLine(xl1,
y,xl2,
y);
3712 if (DrawXRight)
gPad->PaintLine(xr1,
y,xr2,
y);
3717 xb[0] = xl2+tx; yb[0] =
y-ty;
3718 xb[1] = xl2; yb[1] =
y-ty;
3719 xb[2] = xl2; yb[2] =
y+ty;
3720 xb[3] = xl2+tx; yb[3] =
y+ty;
3721 gPad->PaintPolyLine(4, xb, yb);
3724 xb[0] = xr2-tx; yb[0] =
y-ty;
3725 xb[1] = xr2; yb[1] =
y-ty;
3726 xb[2] = xr2; yb[2] =
y+ty;
3727 xb[3] = xr2-tx; yb[3] =
y+ty;
3728 gPad->PaintPolyLine(4, xb, yb);
3731 if (DrawXLeft)
gPad->PaintLine(xl2,
y-ty,xl2,
y+ty);
3732 if (DrawXRight)
gPad->PaintLine(xr2,
y-ty,xr2,
y+ty);
3742 else gPad->PaintLine(
x,yup1,
x,yup2);
3746 else gPad->PaintLine(
x,ylow1,
x,ylow2);
3750 if (DrawYUp)
gPad->PaintLine(
x,yup1,
x,yup2);
3751 if (DrawYLow)
gPad->PaintLine(
x,ylow1,
x,ylow2);
3755 if (yup2 == yup && DrawYUp) {
3756 xb[0] =
x-tx; yb[0] = yup2-ty;
3757 xb[1] =
x-tx; yb[1] = yup2;
3758 xb[2] =
x+tx; yb[2] = yup2;
3759 xb[3] =
x+tx; yb[3] = yup2-ty;
3760 gPad->PaintPolyLine(4, xb, yb);
3762 if (ylow2 == ylow && DrawYLow) {
3763 xb[0] =
x-tx; yb[0] = ylow2+ty;
3764 xb[1] =
x-tx; yb[1] = ylow2;
3765 xb[2] =
x+tx; yb[2] = ylow2;
3766 xb[3] =
x+tx; yb[3] = ylow2+ty;
3767 gPad->PaintPolyLine(4, xb, yb);
3770 if (yup2 == yup && DrawYUp)
gPad->PaintLine(
x-tx,yup2,
x+tx,yup2);
3771 if (ylow2 == ylow && DrawYLow)
gPad->PaintLine(
x-tx,ylow2,
x+tx,ylow2);
3786 if (option4)
PaintGraph(theGraph, 2*theNpoints, xline.data(), yline.data(),
"FC");
3787 else PaintGraph(theGraph, 2*theNpoints, xline.data(), yline.data(),
"F");
3788 gPad->SetLogx(logx);
3789 gPad->SetLogy(logy);
3799 TGraphPolar *theGraphPolar = (TGraphPolar*) theGraph;
3801 Int_t theNpoints = theGraphPolar->
GetN();
3810 TString opt = options;
3816 TString polargram_opt;
3819 polargram_opt.
Append(
"N");
3824 polargram_opt.
Append(
"O");
3832 TGraphPolargram *thePolargram = theGraphPolar->
GetPolargram();
3837 if (thePolargram && !
gPad->FindObject(thePolargram))
3838 thePolargram =
nullptr;
3839 if (!thePolargram) {
3841 TIter padObjIter(
gPad->GetListOfPrimitives());
3842 while (
auto obj = padObjIter()) {
3844 thePolargram =
static_cast<TGraphPolargram*
>(obj);
3852 if (!thePolargram) {
3857 thePolargram->
Draw(polargram_opt.
Data());
3861 rwrmax = thePolargram->
GetRMax(),
3862 rwtmin = thePolargram->
GetTMin(),
3863 rwtmax = thePolargram->
GetTMax();
3870 Double_t radiusNDC = rwrmax - rwrmin;
3879 if (thePolargram->
IsGrad())
3882 for (
Int_t i = 0; i < theNpoints; i++) {
3883 Double_t eymin, eymax, exmin,exmax;
3884 exmin = (theY[i]-theEY[i]-rwrmin)/radiusNDC*
3886 eymin = (theY[i]-theEY[i]-rwrmin)/radiusNDC*
3888 exmax = (theY[i]+theEY[i]-rwrmin)/radiusNDC*
3890 eymax = (theY[i]+theEY[i]-rwrmin)/radiusNDC*
3892 theGraphPolar->TAttLine::Modify();
3893 if (exmin != exmax || eymin != eymax)
gPad->PaintLine(exmin,eymin,exmax,eymax);
3897 for (
Int_t i = 0; i < theNpoints; i++) {
3898 Double_t rad = (theY[i]-rwrmin)/radiusNDC;
3901 theGraphPolar->TAttLine::Modify();
3902 if (phimin != phimax) thePolargram->
PaintCircle(0,0,rad,phimin,phimax,0);
3908 if (!
gPad->GetLogx() && !
gPad->GetLogy()) {
3909 Double_t a,
b,
c = 1, x1, x2, y1, y2, discr, norm1, norm2, xts, yts;
3917 if (thePolargram->
IsGrad())
3919 for (
Int_t i = 0; i < theNpoints; i++) {
3922 xt = (theY[i]-rwrmin)/radiusNDC*
TMath::Cos(
c*(theX[i]-rwtmin)/thetaNDC);
3923 yt = (theY[i]-rwrmin)/radiusNDC*
TMath::Sin(
c*(theX[i]-rwtmin)/thetaNDC);
3924 norm =
sqrt(xt*xt+yt*yt);
3929 if (!previouspointin) {
3934 a = (yt-yts)/(xt-xts);
3936 discr = 4*(
a*
a-
b*
b+1);
3937 x1 = (-2*
a*
b+
sqrt(discr))/(2*(
a*
a+1));
3938 x2 = (-2*
a*
b-
sqrt(discr))/(2*(
a*
a+1));
3941 norm1 =
sqrt((x1-xt)*(x1-xt)+(y1-yt)*(y1-yt));
3942 norm2 =
sqrt((x2-xt)*(x2-xt)+(y2-yt)*(y2-yt));
3943 previouspointin =
kFALSE;
3945 if (norm1 < norm2) {
3955 PaintGraph(theGraphPolar, j+1, theXpol, theYpol, opt);
3960 if (j>=1 && !previouspointin) {
3961 a = (yt-theYpol[j])/(xt-theXpol[j]);
3962 b = theYpol[j]-
a*theXpol[j];
3963 previouspointin =
kTRUE;
3964 discr = 4*(
a*
a-
b*
b+1);
3965 x1 = (-2*
a*
b+
sqrt(discr))/(2*(
a*
a+1));
3966 x2 = (-2*
a*
b-
sqrt(discr))/(2*(
a*
a+1));
3969 norm1 =
sqrt((x1-xt)*(x1-xt)+(y1-yt)*(y1-yt));
3970 norm2 =
sqrt((x2-xt)*(x2-xt)+(y2-yt)*(y2-yt));
3972 if (norm1 < norm2) {
3979 PaintGraph(theGraphPolar, j+1, theXpol, theYpol, opt);
3986 PaintGraph(theGraphPolar, j+1, theXpol, theYpol, opt);
3989 for (
Int_t i = 0; i < theNpoints; i++) {
3993 PaintGraph(theGraphPolar, theNpoints, theXpol, theYpol, opt);
4000 TPaveText *title =
nullptr;
4001 TIter next(
gPad->GetListOfPrimitives());
4002 while (
auto obj = next()) {
4005 if (obj->GetName() && !strcmp(obj->GetName(),
"title")) {
4006 title =
static_cast<TPaveText *
>(obj);
4010 if (nt == 0 ||
gStyle->GetOptTitle() <= 0) {
4011 if (title)
delete title;
4016 if (ht <= 0) ht = 1.1*
gStyle->GetTitleFontSize();
4017 if (ht <= 0) ht = 0.05;
4028 TText *t0 = (TText*)title->GetLine(0);
4038 if (talh < 1) talh = 1;
else if (talh > 3) talh = 3;
4040 if (talv < 1) talv = 1;
else if (talv > 3) talv = 3;
4043 xpos =
gStyle->GetTitleX();
4044 ypos =
gStyle->GetTitleY();
4046 if (talh == 2) xpos = xpos-wt/2.;
4047 if (talh == 3) xpos = xpos-wt;
4048 if (talv == 2) ypos = ypos+ht/2.;
4049 if (talv == 1) ypos = ypos+ht;
4051 TPaveText *ptitle =
new TPaveText(xpos, ypos-ht, xpos+wt, ypos,
"blNDC");
4060 if (
gStyle->GetTitleFont(
"")%10 > 2)
4065 ptitle->
Paint(
"blNDC");
4075 TGraphQQ *theGraphQQ = (TGraphQQ*) theGraph;
4082 TF1 *theF = theGraphQQ->
GetF();
4085 Error(
"TGraphQQ::Paint",
"2nd dataset or theoretical function not specified");
4100 Double_t yxmin, xymin, yxmax, xymax;
4106 TLine line1, line2, line3;
4109 yxmin = (theYq2-theYq1)*(
xmin-theXq1)/(theXq2-theXq1) + theYq1;
4111 xymin = (theXq2-theXq1)*(
ymin-theYq1)/(theYq2-theYq1) + theXq1;
4117 line2.
PaintLine(xqmin, yqmin, xqmax, yqmax);
4119 yxmax = (theYq2-theYq1)*(
xmax-theXq1)/(theXq2-theXq1) + theYq1;
4121 xymax = (theXq2-theXq1)*(
ymax-theYq1)/(theYq2-theYq1) + theXq1;
4134 TString opt = option;
4171 if (lxp) opth.
Append(
"x+");
4172 if (lyp) opth.
Append(
"y+");
4197 XA1 =
gPad->GetUxmin();
4198 XA2 =
gPad->GetUxmax();
4199 YA1 =
gPad->GetUymin();
4200 YA2 =
gPad->GetUymax();
4206 TGraph *theReversedGraph = (TGraph*)theGraph->
Clone();
4233 TString optax =
"-SDH";
4234 if (
gPad->GetGridx()) {
4235 if (
gPad->GetLogy()) {
4238 GL = (YA2 - YA1) / (
gPad->GetY2() -
gPad->GetY1());
4243 if (lxp) ypos =
gPad->GetUymax();
4244 else ypos =
gPad->GetUymin();
4246 TGaxis *theReversedXaxis;
4247 if (
gPad->GetLogx()) {
4260 theReversedXaxis =
new TGaxis(
gPad->GetUxmax(),
4274 theReversedXaxis->
Paint();
4275 delete theReversedXaxis;
4279 if (
gPad->GetLogx()) {
4283 for (i=0; i<
N; i++) rX[i] = dX-
X[i];
4287 if (rEXhigh && EXlow)
for (i=0; i<
N; i++) rEXhigh[i] = EXlow[i];
4288 if (rEXlow && EXhigh)
for (i=0; i<
N; i++) rEXlow[i] = EXhigh[i];
4291 if (rEXhighd && EXlowd)
for (i=0; i<
N; i++) rEXhighd[i] = EXlowd[i];
4292 if (rEXlowd && EXhighd)
for (i=0; i<
N; i++) rEXlowd[i] = EXhighd[i];
4301 TString optax =
"-SDH";
4302 if (
gPad->GetGridy()) {
4303 if (
gPad->GetLogx()) {
4306 GL = (XA2 - XA1) / (
gPad->GetX2() -
gPad->GetX1());
4311 if (lyp) xpos =
gPad->GetUxmax();
4312 else xpos =
gPad->GetUxmin();
4314 TGaxis *theReversedYaxis;
4322 if (
gPad->GetLogy()) {
4324 theReversedYaxis =
new TGaxis(xpos,
4334 theReversedYaxis =
new TGaxis(xpos,
4348 theReversedYaxis->
Paint();
4349 delete theReversedYaxis;
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];
4380 delete theReversedGraph;
4397 TGraph* theGraph = theScatter->
GetGraph();
4399 Int_t optionAxis, optionSkipCol;
4401 TString opt = chopt;
4404 if (opt.
Contains(
"A")) optionAxis = 1;
else optionAxis = 0;
4405 if (opt.
Contains(
"SKIPCOL")) optionSkipCol = 1;
else optionSkipCol = 0;
4407 double *theX = theGraph->
GetX();
4408 double *theY = theGraph->
GetY();
4409 int n = theGraph->
GetN();
4410 double *theColor = theScatter->
GetColor();
4411 double *theSize = theScatter->
GetSize();
4419 double minc = 0, maxc = 0., mins = 0., maxs = 0.;
4432 if (theX[0] == 0.) {
4442 if (theY[0] == 0.) {
4453 if (theColor[0] == 0.) {
4458 minc = theColor[0] -
d;
4459 maxc = theColor[0] +
d;
4465 if (theSize[0] == 0.) {
4470 mins = theSize[0] -
d;
4471 maxs = theSize[0] +
d;
4480 if (
h->GetMinimum() <
h->GetMaximum()) {
4481 if (minc<h->GetMinimum()) minc =
h->GetMinimum();
4482 if (maxc>
h->GetMaximum()) maxc =
h->GetMaximum();
4484 Error(
"PaintScatter",
"Minimal (%g) and Maximal (%g) values of the internal histogram are not valid",
h->GetMinimum(),
h->GetMaximum());
4489 TPaletteAxis *palette;
4491 palette = (TPaletteAxis*)functions->
FindObject(
"palette");
4492 TView *view =
gPad->GetView();
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();
4533 TIter next(
gPad->GetListOfPrimitives());
4534 while ((s = (TScatter *)next())) {
4537 double *ColorInPad = s->
GetColor();
4544 double *SizeInPad = s->
GetSize();
4555 auto nbcol =
gStyle->GetNumberOfColors();
4556 int logx =
gPad->GetLogx();
4557 int logy =
gPad->GetLogy();
4558 int logz =
gPad->GetLogz();
4559 if (theColor && logz) {
4560 if (minc>0) minc =
log10(minc);
4561 if (maxc>0) maxc =
log10(maxc);
4564 theScatter->TAttMarker::Modify();
4567 for (
int i=0; i<
n; i++) {
4570 if (theColor[i]>0)
c =
log10(theColor[i]);
4576 if (optionSkipCol)
continue;
4580 if (optionSkipCol)
continue;
4584 if (nc > nbcol-1) nc = nbcol-1;
4588 ms = (MaxMarkerSize-MinMarkerSize)*((theSize[i]-mins)/(maxs-mins))+MinMarkerSize;
4591 if (theColor || theSize) theScatter->TAttMarker::Modify();
4593 if (theX[i]>0)
x =
log10(theX[i]);
4599 if (theY[i]>0)
y =
log10(theY[i]);
4604 gPad->PaintPolyMarker(1,&
x,&
y);
4615 TGraph2D* theGraph = theScatter->
GetGraph();
4617 Int_t optionSAME = 0, optionSkipCol = 0, optionLOGC = 1, optionLOGS = 0, optionP = 0;
4619 TString opt = chopt;
4645 double *theX = theGraph->
GetX();
4646 double *theY = theGraph->
GetY();
4647 double *theZ = theGraph->
GetZ();
4648 int n = theGraph->
GetN();
4649 double *theColor = theScatter->
GetColor();
4650 double *theSize = theScatter->
GetSize();
4654 double minc = 0, maxc = 0., mins = 0., maxs = 0.;
4668 if (theColor[0] == 0.) {
4673 minc = theColor[0] -
d;
4674 maxc = theColor[0] +
d;
4680 if (theSize[0] == 0.) {
4685 mins = theSize[0] -
d;
4686 maxs = theSize[0] +
d;
4699 TPaletteAxis *palette =
nullptr;
4700 palette = (TPaletteAxis*)functions->
FindObject(
"palette");
4701 TView *view =
gPad->GetView();
4705 functions->
Remove(palette);
4706 delete palette; palette =
nullptr;
4710 functions->
Remove(palette);
4711 delete palette; palette =
nullptr;
4725 palette->
SetLog(optionLOGC);
4739 TString scTitle(theScatter->
GetTitle());
4740 if (palette && scTitle.CountChar(
';') == 4) {
4741 auto pos = scTitle.Last(
';') + 1;
4742 auto cTitle = scTitle(pos, scTitle.Length() - pos);
4745 if (palette && !optionP) palette->
Paint();
4749 TIter next(
gPad->GetListOfPrimitives());
4750 while ((s2 = (TScatter2D *)next())) {
4753 if (opt2.
Contains(
"LOGC")) optionLOGC = 2;
4754 else optionLOGC = 1;
4755 if (opt2.
Contains(
"LOGS")) optionLOGS = 1;
4756 else optionLOGS = 0;
4758 double *ColorInPad = s2->
GetColor();
4765 double *SizeInPad = s2->
GetSize();
4776 auto nbcol =
gStyle->GetNumberOfColors();
4777 int logx =
gPad->GetLogx();
4778 int logy =
gPad->GetLogy();
4779 int logz =
gPad->GetLogz();
4781 if (optionLOGC == 2) logc =1;
4782 if (theColor && logc) {
4783 if (minc>0) minc =
log10(minc);
4784 if (maxc>0) maxc =
log10(maxc);
4786 if (theSize && optionLOGS) {
4787 if (mins>0) mins =
log10(mins);
4788 if (maxs>0) maxs =
log10(maxs);
4791 theScatter->TAttMarker::Modify();
4794 for (
Int_t i = 0; i <
n; i++) {
4798 if (theColor[i]>0)
c =
log10(theColor[i]);
4804 if (optionSkipCol)
continue;
4808 if (optionSkipCol)
continue;
4812 if (nc > nbcol-1) nc = nbcol-1;
4817 if (theSize[i]>0) s =
log10(theSize[i]);
4822 ms = (MaxMarkerSize-MinMarkerSize)*((s-mins)/(maxs-mins))+MinMarkerSize;
4825 theScatter->TAttMarker::Modify();
4827 if (theX[i]>0)
x =
log10(theX[i]);
4833 if (theY[i]>0)
y =
log10(theY[i]);
4844 gPad->PaintMarker3D(
x,
y, z);
4854 if (strstr(option,
"H") || strstr(option,
"h")) {
4865 if (!functions)
return;
4869 auto obj = lnk->GetObject();
4870 TVirtualPad::TContext ctxt(
true);
4874 obj->Paint(lnk->GetOption());
4894 std::vector<Double_t> xf(2*
n);
4895 std::vector<Double_t> yf(2*
n);
4896 std::vector<Double_t> xt(
n);
4897 std::vector<Double_t> yt(
n);
4898 Double_t x1, x2, y1, y2, x3, y3, xm, ym,
a, a1, a2, a3;
4901 Int_t ix1,iy1,ix2,iy2;
4905 gPad->GetPadPar(x1p,y1p,x2p,y2p);
4906 ix1 = (
Int_t)(iw*x1p);
4907 iy1 = (
Int_t)(ih*y1p);
4908 ix2 = (
Int_t)(iw*x2p);
4909 iy2 = (
Int_t)(ih*y2p);
4921 gPad->GetRange(rx1,ry1,rx2,ry2);
4922 Double_t rx = (x2ndc-x1ndc)/(rx2-rx1);
4923 Double_t ry = (y2ndc-y1ndc)/(ry2-ry1);
4927 xf[0] = rx*(
x[0]-rx1)+x1ndc;
4928 yf[0] = ry*(
y[0]-ry1)+y1ndc;
4930 for (i=1; i<
n; i++) {
4931 if (
x[i]==
x[i-1] &&
y[i]==
y[i-1])
continue;
4933 xf[nf] = rx*(
x[i]-rx1)+x1ndc;
4934 if (xf[i]==xf[i-1]) xf[i] += 0.000001;
4935 yf[nf] = ry*(
y[i]-ry1)+y1ndc;
4954 if (xf[nf]==xf[nf-1]) {
4959 if (xf[nf]>=xf[nf-1]) {
4968 for (i=1; i<nf; i++) {
5001 if ((xm-xi0)*(x3-xi0)<0 && (ym-yi0)*(y3-yi0)<0) {
5005 if ((xm==x1) && (ym==y1)) {
5014 if (xf[nf]==xf[0] && yf[nf]==yf[0]) {
5015 xm = (xt[nf]+xt[0])*0.5;
5016 ym = (yt[nf]+yt[0])*0.5;
5024 if ((xm-xf[0])*(x3-xf[0])<0 && (ym-yf[0])*(y3-yf[0])<0) {
5039 for (i=nf2; i>0; i--) {
5040 for (j=i-1; j>0; j--) {
5042 c1 = (yt[i-1]-yt[i])/(xt[i-1]-xt[i]);
5043 b1 = yt[i]-
c1*xt[i];
5044 c2 = (yt[j-1]-yt[j])/(xt[j-1]-xt[j]);
5045 b2 = yt[j]-
c2*xt[j];
5047 xc = (b2-b1)/(
c1-
c2);
5053 nf++; xf[nf] = xt[i]; yf[nf] = yt[i];
5054 nf++; xf[nf] = xc ; yf[nf] = yc;
5072 nf++; xf[nf] = xt[0]; yf[nf] = yt[0];
5075 for (i=0; i<nf+1; i++) {
5076 xf[i] = (1/rx)*(xf[i]-x1ndc)+rx1;
5077 yf[i] = (1/ry)*(yf[i]-y1ndc)+ry1;
5081 gPad->PaintFillArea(nf+1,xf.data(),yf.data());
5082 theGraph->TAttLine::Modify();
5093 TPaveStats *stats =
nullptr;
5095 TIter next(functions);
5096 while (
auto obj = next()) {
5098 stats = (TPaveStats*)obj;
5104 else dofit =
gStyle->GetOptFit();
5106 if (!dofit) fit =
nullptr;
5108 if (dofit == 1) dofit = 111;
5110 Int_t print_fval = dofit%10;
5111 Int_t print_ferrors = (dofit/10)%10;
5112 Int_t print_fchi2 = (dofit/100)%10;
5113 Int_t print_fprob = (dofit/1000)%10;
5114 Int_t nlinesf = print_fval + print_fchi2 + print_fprob;
5117 else nlinesf += fit->
GetNpar();
5126 stats =
new TPaveStats(
5127 gStyle->GetStatX()-statw,
5128 gStyle->GetStatY()-stath,
5130 gStyle->GetStatY(),
"brNDC");
5139 if (
gStyle->GetStatFont()%10 > 2)
5156 if (print_fchi2) stats->
AddText(t);
5162 if (print_fval || print_ferrors) {
5166 if (print_fval < 2 && parmin*parmax != 0 && parmin >= parmax)
continue;
5167 if (print_ferrors) {
5180 if (!done) functions->
Add(stats);
5210 Int_t i, k, kp, km, npointsMax, banksize, n2, npt;
5211 Int_t maxiterations, finished;
5212 Int_t jtype, ktype, closed;
5213 Double_t sxmin, sxmax, symin, symax;
5216 Double_t ratio_signs, xratio, yratio;
5222 Double_t co, so, ct, st, ctu, stu, xnt;
5223 Double_t dx1, dy1, dx2, dy2, dk1, dk2;
5230 c = t = co = so = ct = st = ctu = stu = dx1 = dy1 = dx2 = dy2 = 0;
5231 xt = yt = xa = xb = ya = yb = u1 = u2 = u3 = tj = sb = 0;
5233 npointsMax = npoints*10;
5237 std::vector<Double_t> qlx(npointsMax);
5238 std::vector<Double_t> qly(npointsMax);
5239 if (qlx.empty() || qly.empty()) {
5240 Error(
"Smooth",
"not enough space in memory");
5247 jtype = (drawtype%1000)-10;
5248 if (jtype > 0) { ktype = jtype; loptx =
kTRUE; }
5249 else ktype = drawtype%1000;
5278 for (i=1;i<npoints;i++) {
5280 if ((
x[i]-
x[i-1])*(
x[i-1]-
x[i-2]) < 0) six++;
5281 if ((
y[i]-
y[i-1])*(
y[i-1]-
y[i-2]) < 0) siy++;
5283 if (
x[i] < sxmin) sxmin =
x[i];
5284 if (
x[i] > sxmax) sxmax =
x[i];
5285 if (
y[i] < symin) symin =
y[i];
5286 if (
y[i] > symax) symax =
y[i];
5291 if (dx1n < 0.01*(sxmax-sxmin) && dy1n < 0.01*(symax-symin)) closed = 1;
5292 if (sxmin == sxmax) {
5295 if (six > 1) ratio_signs = siy/six;
5296 else ratio_signs = 20;
5297 xratio = ratio_signs/(sxmax-sxmin);
5299 if (symin == symax) yratio = 1;
5300 else yratio = 1/(symax-symin);
5304 for (i=0;i<npoints;i++) {
5305 x[i] = (
x[i]-sxmin)*xratio;
5306 y[i] = (
y[i]-symin)*yratio;
5325 if (
x[0] !=
x[npoints-1] ||
y[0] !=
y[npoints-1])
goto L40;
5326 if (
x[npoints-2] ==
x[npoints-1] &&
y[npoints-2] ==
y[npoints-1])
goto L40;
5327 if (
x[0] ==
x[1] &&
y[0] ==
y[1])
goto L40;
5350 if (npt > 1)
goto L310;
5354 if (
x[k-1] ==
x[k-2] &&
y[k-1] ==
y[k-2])
goto L50;
5359 if (npt > 1)
goto L310;
5362 if (k < npoints)
goto L90;
5363 if (!flgic) { kp = 2;
goto L130;}
5366 if (flgis)
goto L150;
5376 if (
x[k-1] ==
x[k] &&
y[k-1] ==
y[k])
goto L80;
5384 if (!flgis)
goto L50;
5399 dx1 =
x[k-1] -
x[km-1];
5400 dy1 =
y[k-1] -
y[km-1];
5401 dk1 = dx1*dx1 + dy1*dy1;
5402 dx2 =
x[kp-1] -
x[k-1];
5403 dy2 =
y[kp-1] -
y[k-1];
5404 dk2 = dx2*dx2 + dy2*dy2;
5405 ctu = dx1*dk2 + dx2*dk1;
5406 stu = dy1*dk2 + dy2*dk1;
5407 xnt = ctu*ctu + stu*stu;
5421 if (flgis)
goto L160;
5425 w3 = 2*(dx1*dy2-dx2*dy1);
5437 w3 = 2*(dx1*dy2-dx2*dy1);
5446 if (k <= 1)
goto L120;
5476 xa = (
a*t-2*dx)/tcube;
5478 ya = (
b*t-2*dy)/tcube;
5510 p2 = (u1*tj-u3)*3*tj+u2;
5540 z = s*sth*(s-s*sth)*(w1*sth+w1+w2);
5546 if (iw > 0)
goto L250;
5547 if (z >
err)
goto L240;
5552 if (iw+2 == 0)
goto L190;
5553 if (iw+2 > 0)
goto L290;
5571 theGraph->
Zero(kp,0,sb,
err,s,z,maxiterations);
5572 if (kp == 2)
goto L210;
5574 Error(
"Smooth",
"Attempt to plot outside plot limits");
5577 if (iw > 0)
goto L200;
5603 qlx[npt] = sxmin + xt/xratio;
5604 qly[npt] = symin + yt/yratio;
5611 if (npt < banksize)
goto L320;
5612 if (drawtype >= 1000 || ktype > 1) {
5613 Int_t newsize = banksize + n2;
5614 std::vector<Double_t> qtemp(banksize);
5615 for (i=0;i<banksize;i++) qtemp[i] = qlx[i];
5616 qlx.resize(newsize);
5617 for (i=0;i<banksize;i++) qlx[i] = qtemp[i];
5618 for (i=0;i<banksize;i++) qtemp[i] = qly[i];
5619 qly.resize(newsize);
5620 for (i=0;i<banksize;i++) qly[i] = qtemp[i];
5628 if (drawtype >= 1000) {
5629 gPad->PaintFillArea(npt,qlx.data(),qly.data(),
"B");
5633 qlx[npt] = qlx[npt-1];
5634 qlx[npt+1] = qlx[0];
5640 qly[npt] = qly[npt-1];
5641 qly[npt+1] = qly[0];
5643 gPad->PaintFillArea(npt+2,qlx.data(),qly.data());
5646 gPad->PaintPolyLine(npt,qlx.data(),qly.data());
5649 qlx[0] = sxmin + xt/xratio;
5650 qly[0] = symin + yt/yratio;
5652 if (finished > 0)
goto L390;
5653 if (finished < 0) { finished = 0;
goto L110;}
5654 if (s > 0)
goto L180;
5660 for (i=0;i<npoints;i++) {
5661 x[i] = sxmin +
x[i]/xratio;
5662 y[i] = symin +
y[i]/yratio;
const Int_t kMaxPixel
Max value for an int.
int Int_t
Signed integer 4 bytes (int).
int Ssiz_t
String size (currently int).
char Char_t
Character 1 byte (char).
bool Bool_t
Boolean (0=false, 1=true) (bool).
double Axis_t
Axis values type (double).
double Double_t
Double 8 bytes.
constexpr Ssiz_t kNPOS
The equivalent of std::string::npos for the ROOT class TString.
float Float_t
Float 4 bytes (float).
const char Option_t
Option string (const char).
static Int_t gHighlightPoint
static TGraph * gHighlightGraph
static std::unique_ptr< TMarker > gHighlightMarker
virtual void PaintArrow(Double_t x1, Double_t y1, Double_t x2, Double_t y2, Float_t arrowsize=0.05, Option_t *option=">")
virtual Color_t GetLabelColor() const
virtual Int_t GetNdivisions() 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 GetTitleSize() const
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 SetLineWidth(Width_t lwidth)
Set 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)
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.
static Style_t GetMarkerStyleBase(Style_t style)
virtual void SetMarkerStyle(Style_t mstyle=1)
Set the marker style.
virtual void SetMarkerSize(Size_t msize=1)
Set the marker size.
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)
Double_t GetChisquare() const
Return the Chisquare after fitting. See ROOT::Fit::FitResult::Chi2().
virtual void GetParLimits(Int_t ipar, Double_t &parmin, Double_t &parmax) const
virtual Int_t GetNpar() const
virtual Int_t GetNumberFreeParameters() const
virtual Double_t GetParError(Int_t ipar) const
virtual const char * GetParName(Int_t ipar) const
virtual Int_t GetNDF() const
virtual Double_t GetParameter(Int_t ipar) const
void SetLabelFont(Int_t labelfont)
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)
void SetLabelOffset(Float_t labeloffset)
void SetLabelColor(Int_t labelcolor)
void SetTickLength(Float_t ticklength)
virtual void SetMoreLogLabels(Bool_t more=kTRUE)
void SetTickSize(Float_t ticksize)
void Paint(Option_t *chopt="") override
This method must be overridden if a class wants to paint itself.
void SetLabelSize(Float_t labelsize)
void SetTitle(const char *title="") override
Set the title of the TNamed.
TList * GetListOfFunctions() const
void Paint(Option_t *option="") override
This method must be overridden if a class wants to paint itself.
Double_t * GetEX() const override
Double_t * GetEY() const override
void PaintGraphPolar(TGraph *theGraph, Option_t *option)
void PaintGraph(TGraph *theGraph, Int_t npoints, const Double_t *x, const Double_t *y, Option_t *chopt) override
void PaintGraphErrors(TGraph *theGraph, Option_t *option)
void PaintGraphAsymmErrors(TGraph *theGraph, Option_t *option)
static void SetMaxPointsPerLine(Int_t maxp=50)
void PaintGraphMultiErrors(TGraph *theGraph, Option_t *option)
void PaintGraphReverse(TGraph *theGraph, Option_t *option)
void PaintGrapHist(TGraph *theGraph, Int_t npoints, const Double_t *x, const Double_t *y, Option_t *chopt) override
virtual void HighlightPoint(TGraph *theGraph, Int_t hpoint, Int_t distance)
void PaintScatter2D(TScatter2D *theScatter, Option_t *option) override
static Int_t fgMaxPointsPerLine
Number of points per chunks' line when drawing a graph.
virtual Int_t GetHighlightPoint(TGraph *theGraph) const
void PaintStats(TGraph *theGraph, TF1 *fit) override
void PaintPolyLineHatches(TGraph *theGraph, Int_t n, const Double_t *x, const Double_t *y)
void DrawPanelHelper(TGraph *theGraph) override
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
void ComputeLogs(Int_t npoints, Int_t opt)
std::vector< Double_t > gxworkl
Int_t DistancetoPrimitiveHelper(TGraph *theGraph, Int_t px, Int_t py) override
std::vector< Double_t > gxwork
std::vector< Double_t > gywork
void PaintScatter(TScatter *theScatter, Option_t *option) override
virtual void PaintHighlightPoint(TGraph *theGraph, Option_t *option)
void Smooth(TGraph *theGraph, Int_t npoints, Double_t *x, Double_t *y, Int_t drawtype)
std::vector< Double_t > gyworkl
Internal buffers for coordinates. Used for graphs painting.
void SetHighlight(TGraph *theGraph) override
void PaintGraphSimple(TGraph *theGraph, Option_t *option)
void PaintGraphQQ(TGraph *theGraph, Option_t *option)
~TGraphPainter() override
void PaintGraphBentErrors(TGraph *theGraph, Option_t *option)
void PaintHelper(TGraph *theGraph, Option_t *option) override
TGraphPolargram * GetPolargram()
void SetPolargram(TGraphPolargram *p)
TGraphPolargram * CreatePolargram(const char *opt)
void PaintCircle(Double_t x, Double_t y, Double_t r, Double_t phimin, Double_t phimax, Double_t theta)
void Draw(Option_t *options="") override
Default Draw method for all objects.
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 Double_t * GetEYlowd() const
virtual TH1F * GetHistogram() const
void Zero(Int_t &k, Double_t AZ, Double_t BZ, Double_t E2, Double_t &X, Double_t &Y, Int_t maxiterations)
TList * GetListOfFunctions() const
virtual Bool_t IsHighlight() const
virtual Double_t * GetEYhighd() const
virtual Double_t * GetEXhigh() const
virtual Double_t * GetEYhigh() const
virtual Int_t GetPoint(Int_t i, Double_t &x, Double_t &y) const
virtual Double_t * GetEY() const
virtual void SetHistogram(TH1F *h)
virtual Double_t * GetEXlow() const
virtual void ComputeRange(Double_t &xmin, Double_t &ymin, Double_t &xmax, Double_t &ymax) const
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 void SetContour(Int_t nlevels, const Double_t *levels=nullptr)
Set the number and values of contour levels.
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.
virtual void PaintLine(Double_t x1, Double_t y1, Double_t x2, Double_t y2)
Draw this line with new coordinates.
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.
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
const char * GetTitle() const override
Returns title of object.
Bool_t TestBit(UInt_t f) const
virtual const char * GetName() const
Returns name of object.
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 Copy(TObject &object) const
Copy this to obj.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
virtual const char * GetTitle() const
Returns title of object.
TObject()
TObject constructor.
@ 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()
void Paint(Option_t *option="") override
Paint this box with its current attributes.
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)
void SetOptStat(Int_t stat=1)
virtual void SetStatFormat(const char *format="6.4g")
virtual const char * GetFitFormat() const
void SetParent(TObject *obj) override
void SetOptFit(Int_t fit=1)
void Paint(Option_t *option="") override
Paint this pave with its current attributes.
virtual void SetFitFormat(const char *format="5.4g")
void Clear(Option_t *option="") override
void Draw(Option_t *option="") override
Draw this pave with its current attributes.
void Paint(Option_t *option="") override
Paint this pave with its current attributes.
virtual TText * AddText(Double_t x1, Double_t y1, const char *label)
virtual void SetName(const char *name="")
virtual void SetBorderSize(Int_t bordersize=4)
Sets the border size of the TPave box and shadow.
Option_t * GetOption() const override
Double_t * GetColor() const
Get the array of colors.
Double_t GetMaxMarkerSize() const
Get the largest marker size used to paint the markers.
TGraph2D * GetGraph() const
Get the graph holding X, Y and Z positions.
Double_t GetMinMarkerSize() const
Get the smallest marker size used to paint the markers.
Double_t * GetSize() const
Get the array of marker sizes.
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.
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
static TVirtualPadEditor * GetPadEditor(Bool_t load=kTRUE)
Returns the pad editor dialog. Static method.
void box(Int_t pat, Double_t x1, Double_t y1, Double_t x2, Double_t y2)
RVec< PromoteType< T > > log10(const RVec< T > &v)
VecExpr< UnaryOp< Sqrt< T >, VecExpr< A, T, D >, T >, T, D > sqrt(const VecExpr< A, T, D > &rhs)
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)
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()
T MinElement(Long64_t n, const T *a)
Returns minimum of array a of length n.
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.
T MaxElement(Long64_t n, const T *a)
Returns maximum of array a of length n.
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.
BVH_ALWAYS_INLINE Vec< T, 3 > cross(const Vec< T, 3 > &a, const Vec< T, 3 > &b)