692 if (
gPad->GetLogx()) {
693 for (
Int_t i = 0; i < npoints; i++) {
697 for (
Int_t i = 0; i < npoints; i++)
700 if (!opt &&
gPad->GetLogy()) {
701 for (
Int_t i = 0; i < npoints; i++) {
705 for (
Int_t i = 0; i < npoints; i++)
724 if (distance <= 5)
return distance;
728 const Int_t big = 9999;
729 const Int_t kMaxDiff = 10;
739 theX = theGraphPolar->
GetXpol();
740 theY = theGraphPolar->
GetYpol();
742 theX = theGraph->
GetX();
743 theY = theGraph->
GetY();
747 for (i=0;i<theNpoints;i++) {
748 pxp =
gPad->XtoAbsPixel(
gPad->XtoPad(theX[i]));
749 pyp =
gPad->YtoAbsPixel(
gPad->YtoPad(theY[i]));
759 if (distance < kMaxDiff)
return distance;
761 for (i=0;i<theNpoints-1;i++) {
764 if (
d < distance) distance =
d;
779 TIter next(functions);
781 if (
f->InheritsFrom(
TF1::Class())) distance =
f->DistancetoPrimitive(-px,py);
782 else distance =
f->DistancetoPrimitive(px,py);
783 if (distance < kMaxDiff) {
784 gPad->SetSelected(
f);
800 Error(
"DrawPanel",
"need to draw graph first");
805 gROOT->ProcessLine(
TString::Format(
"((TCanvas*)0x%zx)->Selected((TVirtualPad*)0x%zx,(TObject*)0x%zx,1)",
806 (
size_t)
gPad->GetCanvas(), (
size_t)
gPad, (
size_t)theGraph));
823 drawX.resize(sz, 0.);
824 drawY.resize(sz, 0.);
835 const Int_t kMaxDiff = 10;
837 Int_t best_diff2 = kMaxDiff * kMaxDiff, best_pnt = -1;
838 for (
Int_t i = 0; i < theNpoints; i++) {
846 Int_t d2 = (pxp - px) * (pxp - px) + (pyp - py) * (pyp - py);
847 if (d2 < best_diff2) {
875 if (
ipoint == (
int)
dx.size() - 1) {
881 for (std::size_t i = 0; i <
dx.size(); ++i) {
932 if (!
gPad || !theGraph)
return;
934 auto &parent = *
gPad;
937 parent.SetCursor(
kHand);
940 if (!parent.IsEditable())
943 Bool_t opaque = parent.OpaqueMoving();
953 inter = parent.MakeInteractive<
TGraphInteractive>(theGraph, theNpoints, opaque, theGraph->InheritsFrom(
"TCutG"));
957 inter->PaintInteractive(parent, px, py);
958 parent.UpdateAsync();
965 if (dummy.
FindPoint(parent, theGraph, px, py) >= 0)
966 parent.SetCursor(
kHand);
968 parent.SetCursor(
kMove);
976 inter->PaintInteractive(parent, px, py);
977 parent.UpdateAsync();
980 inter->AdjustRange(parent);
981 inter->RecalculatePoints(parent, px, py, theX, theY);
988 if (
gROOT->IsEscaped()) {
995 inter->AdjustRange(parent);
996 inter->RecalculatePoints(parent, px, py, theX, theY);
1000 parent.FreeInteractive(theGraph);
1046 const Int_t kHighlightRange = 50;
1047 static Int_t distanceOld = kHighlightRange;
1050 if ((distance < kHighlightRange) && (distance < distanceOld)) {
1088 if (
gPad->GetLogx()) {
1092 if (
gPad->GetLogy()) {
1096 if ((hx < uxmin) || (hx > uxmax))
return;
1097 if ((hy < uymin) || (hy > uymax))
return;
1121 strlcpy(chopt,
option,80);
1124 char *l1 = strstr(chopt,
"pfc");
1125 char *l2 = strstr(chopt,
"plc");
1126 char *l3 = strstr(chopt,
"pmc");
1127 if (l1 || l2 || l3) {
1136 char *l4 = strstr(chopt,
"rx");
1137 char *l5 = strstr(chopt,
"ry");
1171 TIter next(functions);
1179 if (palette) palette->
Paint();
1193 gPad->PushSelectableObject(theGraph);
1195 Int_t optionLine , optionAxis , optionCurve , optionStar , optionMark;
1196 Int_t optionBar , optionR , optionOne , optionE;
1197 Int_t optionFill , optionZ , optionCurveFill, optionIAxis;
1198 Int_t i, npt, nloop;
1201 Double_t barxmin, barxmax, barymin, barymax;
1208 Error(
"PaintGraph",
"illegal number of points (%d)", npoints);
1215 if (opt.
Contains(
"L")) optionLine = 1;
else optionLine = 0;
1216 if (opt.
Contains(
"A")) optionAxis = 1;
else optionAxis = 0;
1217 if (opt.
Contains(
"C")) optionCurve = 1;
else optionCurve = 0;
1218 if (opt.
Contains(
"*")) optionStar = 1;
else optionStar = 0;
1219 if (opt.
Contains(
"P")) optionMark = 1;
else optionMark = 0;
1220 if (opt.
Contains(
"B")) optionBar = 1;
else optionBar = 0;
1221 if (opt.
Contains(
"R")) optionR = 1;
else optionR = 0;
1222 if (opt.
Contains(
"1")) optionOne = 1;
else optionOne = 0;
1223 if (opt.
Contains(
"F")) optionFill = 1;
else optionFill = 0;
1224 if (opt.
Contains(
"I")) optionIAxis = 1;
else optionIAxis = 0;
1230 if (optionLine+optionFill+optionCurve+optionStar+optionMark+optionBar+optionE == 0) {
1231 if (!chopt[0]) optionLine=1;
1237 optionCurveFill = 0;
1238 if (optionCurve && optionFill) {
1239 optionCurveFill = 1;
1244 Double_t rwxmin,rwxmax, rwymin, rwymax, maximum, minimum, dx, dy;
1246 TH1F *histogram =
nullptr;
1250 rwxmin =
gPad->GetUxmin();
1251 rwxmax =
gPad->GetUxmax();
1252 rwymin =
gPad->GetUymin();
1253 rwymax =
gPad->GetUymax();
1256 if (minimum == -1111) {
1260 if (maximum == -1111) {
1264 uxmin =
gPad->PadtoX(rwxmin);
1265 uxmax =
gPad->PadtoX(rwxmax);
1268 theGraph->
ComputeRange(rwxmin, rwymin, rwxmax, rwymax);
1270 if (rwxmin == rwxmax) rwxmax += 1.;
1271 if (rwymin == rwymax) rwymax += 1.;
1272 dx = 0.1*(rwxmax-rwxmin);
1273 dy = 0.1*(rwymax-rwymin);
1274 uxmin = rwxmin - dx;
1275 uxmax = rwxmax + dx;
1276 minimum = rwymin - dy;
1277 maximum = rwymax + dy;
1283 if (uxmin < 0 && rwxmin >= 0)
1285 if (uxmax > 0 && rwxmax <= 0) {
1286 if (
gPad->GetLogx()) uxmax = 1.1*rwxmax;
1289 if (minimum < 0 && rwymin >= 0) minimum = 0.9*rwymin;
1290 if (maximum > 0 && rwymax <= 0) {
1294 if (minimum <= 0 && gPad->GetLogy()) minimum = 0.001*maximum;
1295 if (uxmin <= 0 && gPad->GetLogx()) {
1296 if (uxmax > 1000) uxmin = 1;
1297 else uxmin = 0.001*uxmax;
1304 char chopth[8] =
" ";
1305 if (strstr(chopt,
"x+")) strncat(chopth,
"x+",3);
1306 if (strstr(chopt,
"y+")) strncat(chopth,
"y+",3);
1307 if (optionIAxis) strncat(chopth,
"A",2);
1314 if (theNpoints > npt) npt = theNpoints;
1318 if (!histogram)
return;
1325 histogram->
Paint(chopth);
1327 if (
gPad->GetLogy()) {
1333 histogram->
Paint(chopth);
1340 rwxmin =
gPad->GetUxmin();
1341 rwxmax =
gPad->GetUxmax();
1342 rwymin =
gPad->GetUymin();
1343 rwymax =
gPad->GetUymax();
1344 uxmin =
gPad->PadtoX(rwxmin);
1345 uxmax =
gPad->PadtoX(rwxmax);
1347 if (histogram && !theGraph->
InheritsFrom(
"TGraphPolar")) {
1351 maximum =
gPad->PadtoY(rwymax);
1352 minimum =
gPad->PadtoY(rwymin);
1356 theGraph->TAttLine::Modify();
1357 theGraph->TAttFill::Modify();
1358 theGraph->TAttMarker::Modify();
1361 gxwork.resize(2*npoints+10);
1362 gywork.resize(2*npoints+10);
1366 if (optionLine || optionFill) {
1372 if (optionFill && (xn !=
x1 || yn !=
y1)) nloop++;
1374 for (i=1;i<=nloop;i++) {
1418 if (optionCurveFill) {
1420 if (xn !=
x1 || yn !=
y1) nloop++;
1424 for (i=1;i<=nloop;i++) {
1449 for (i=1;i<=nloop;i++) {
1453 if (
y[i-1] < minimum ||
y[i-1] > maximum)
continue;
1454 if (
x[i-1] < uxmin ||
x[i-1] > uxmax)
continue;
1480 for (i=1;i<=npoints;i++) {
1495 for (i=1;i<=npoints;i++) {
1510 if(FillSave ==
gPad->GetFrameFillColor()) {
1512 if (
gPad->GetFrameFillColor()==1) {
1514 theGraph->TAttFill::Modify();
1517 theGraph->TAttFill::Modify();
1523 for (i=1;i<npoints;i++) {
1524 if (
x[i] < barxmin) barxmin =
x[i];
1525 if (
x[i] > barxmax) barxmax =
x[i];
1527 bdelta = (barxmax-barxmin)/
Double_t(npoints);
1531 for (i=1;i<npoints;i++) {
1532 if (
y[i] < barymin) barymin =
y[i];
1533 if (
y[i] > barymax) barymax =
y[i];
1535 bdelta = (barymax-barymin)/
Double_t(npoints);
1539 for (i=1;i<=npoints;i++) {
1540 xlow =
x[i-1] - dbar;
1541 xhigh =
x[i-1] + dbar;
1543 if (xlow < uxmin && xhigh < uxmin)
continue;
1544 if (xhigh > uxmax && xlow > uxmax)
continue;
1545 if (xlow < uxmin) xlow = uxmin;
1546 if (xhigh > uxmax) xhigh = uxmax;
1548 else ylow =
gPad->GetUymin();
1562 for (i=1;i<=npoints;i++) {
1564 ylow =
y[i-1] - dbar;
1565 yhigh =
y[i-1] + dbar;
1576 theGraph->TAttFill::Modify();
1620 const char *where =
"PaintGrapHist";
1622 Int_t optionLine , optionAxis , optionCurve, optionStar, optionMark;
1623 Int_t optionBar , optionRot , optionOne , optionOff ;
1624 Int_t optionFill , optionZ;
1625 Int_t optionHist , optionBins , optionMarker;
1627 Int_t drawtype=0, drawborder, drawbordersav;
1633 Double_t xi, xi1, xj, xj1, yi1, yi, yj, yj1, xwmin, ywmin;
1634 Int_t first, last, nbins;
1637 char choptaxis[10] =
" ";
1640 Error(where,
"illegal number of points (%d)", npoints);
1645 if (opt.
Contains(
"H")) optionHist = 1;
else optionHist = 0;
1646 if (opt.
Contains(
"F")) optionFill = 1;
else optionFill = 0;
1647 if (opt.
Contains(
"C")) optionCurve= 1;
else optionCurve= 0;
1648 if (opt.
Contains(
"*")) optionStar = 1;
else optionStar = 0;
1649 if (opt.
Contains(
"R")) optionRot = 1;
else optionRot = 0;
1650 if (opt.
Contains(
"1")) optionOne = 1;
else optionOne = 0;
1651 if (opt.
Contains(
"B")) optionBar = 1;
else optionBar = 0;
1652 if (opt.
Contains(
"N")) optionBins = 1;
else optionBins = 0;
1653 if (opt.
Contains(
"L")) optionLine = 1;
else optionLine = 0;
1654 if (opt.
Contains(
"P")) optionMark = 1;
else optionMark = 0;
1655 if (opt.
Contains(
"A")) optionAxis = 1;
else optionAxis = 0;
1656 if (opt.
Contains(
"][")) optionOff = 1;
else optionOff = 0;
1657 if (opt.
Contains(
"P0")) optionMark = 10;
1659 Int_t optionFill2 = 0;
1661 optionFill = 0; optionFill2 = 1;
1676 nbins = last - first + 1;
1688 Double_t rounding = (uxmax-uxmin)*1.e-5;
1691 Int_t nx1, nx2, ndivx, ndivy, ndiv;
1704 if (ndivx < 0) strlcat(choptaxis,
"N",10);
1705 if (
gPad->GetGridx()) {
1707 strlcat(choptaxis,
"W",10);
1709 if (
gPad->GetLogx()) {
1713 strlcat(choptaxis,
"G",10);
1723 axis.
PaintAxis(rwxmin,rwymin,rwxmax,rwymin,rwmin,rwmax,ndiv,choptaxis);
1733 strlcat(choptaxis,
"N",10);
1736 if (
gPad->GetGridy()) {
1738 strlcat(choptaxis,
"W",10);
1740 if (
gPad->GetLogy()) {
1744 strlcat(choptaxis,
"G",10);
1753 axis.
PaintAxis(rwxmin,rwymin,rwxmin,rwymax,rwmin,rwmax,ndiv,choptaxis);
1758 theGraph->TAttLine::Modify();
1759 theGraph->TAttFill::Modify();
1760 theGraph->TAttMarker::Modify();
1769 Int_t fwidth =
gPad->GetFrameLineWidth();
1772 if (optionOff) fwidth = 1;
1783 gxwork.resize(2*npoints+10);
1784 gywork.resize(2*npoints+10);
1788 if (optionFill && !optionCurve) {
1796 for (j=first; j<=last;j++) {
1803 xj1 =
x[j]; xj =
x[j-1];
1805 if (j != last)
Error(where,
"X must be in increasing order");
1806 else Error(where,
"X must have N+1 values with option N");
1814 if ((
gxwork[npt-1] >= uxmin-rounding &&
gxwork[npt-1] <= uxmax+rounding) ||
1815 (
gxwork[npt] >= uxmin-rounding &&
gxwork[npt] <= uxmax+rounding)) npt += 2;
1828 if (!fillarea)
gyworkl[0] = ylast;
1839 for (j=first; j<=last;j++) {
1844 yj1 =
y[j]; yj =
y[j-1];
1846 if (j != last)
Error(where,
"Y must be in increasing order");
1847 else Error(where,
"Y must have N+1 values with option N");
1853 if ((
gxwork[npt-1] >= uxmin-rounding &&
gxwork[npt-1] <= uxmax+rounding) ||
1854 (
gxwork[npt] >= uxmin-rounding &&
gxwork[npt] <= uxmax+rounding)) npt += 2;
1861 if (!fillarea)
gyworkl[0] = ylast;
1868 theGraph->TAttLine::Modify();
1869 theGraph->TAttFill::Modify();
1874 if ((optionHist) || !chopt[0]) {
1882 for (i=first; i<=last;i++) {
1887 xi1 =
x[i]; xi =
x[i-1];
1889 if (i != last)
Error(where,
"X must be in increasing order");
1890 else Error(where,
"X must have N+1 values with option N");
1898 if ((
gxwork[npt-1] >= uxmin-rounding &&
gxwork[npt-1] <= uxmax+rounding) ||
1899 (
gxwork[npt] >= uxmin-rounding &&
gxwork[npt] <= uxmax+rounding)) npt += 2;
1911 Int_t nbpoints = npt-2;
1917 for (ip=point1; ip<=nbpoints; ip++) {
1924 Int_t point2 = nbpoints;
1925 for (ip=point2; ip>=point1; ip--) {
1931 nbpoints = point2-point1+1;
1935 if (
gxwork[0] >
gPad->GetUxmin()) { nbpoints++; point1 = 0; }
1936 if (
gxwork[nbpoints] <
gPad->GetUxmax()) nbpoints++;
1939 gPad->PaintPolyLine(nbpoints,
gxworkl.data() + point1,
gyworkl.data() + point1, noClip);
1949 for (i=first; i<=last;i++) {
1954 yi1 =
y[i]; yi =
y[i-1];
1956 if (i != last)
Error(where,
"Y must be in increasing order");
1957 else Error(where,
"Y must have N+1 values with option N");
1963 if ((
gxwork[npt-1] >= uxmin-rounding &&
gxwork[npt-1] <= uxmax+rounding) ||
1964 (
gxwork[npt] >= uxmin-rounding &&
gxwork[npt] <= uxmax+rounding)) npt += 2;
1983 if (!optionOne) drawtype = 2;
1988 for (i=first; i<=last;i++) {
1991 gxwork[npt-1] =
wmin+(i-first)*delta+0.5*delta;
1993 xi1 =
x[i]; xi =
x[i-1];
1995 if (i != last)
Error(where,
"X must be in increasing order");
1996 else Error(where,
"X must have N+1 values with option N");
1999 gxwork[npt-1] =
x[i-1] + 0.5*(
x[i]-
x[i-1]);
2030 drawtype = drawtype+10;
2032 for (i=first; i<=last;i++) {
2035 gywork[npt-1] =
wmin+(i-first)*delta+0.5*delta;
2037 yi1 =
y[i]; yi =
y[i-1];
2039 if (i != last)
Error(where,
"Y must be in increasing order");
2040 else Error(where,
"Y must have N+1 values with option N");
2043 gywork[npt-1] =
y[i-1] + 0.5*(
y[i]-
y[i-1]);
2076 wminstep =
wmin + 0.5*delta;
2078 gPad->GetRangeAxis(ax1,ay1,ax2,ay2);
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]);
2095 if (
gxwork[npt-1] < uxmin ||
gxwork[npt-1] > uxmax) { npt--;
continue;}
2098 if ((
gywork[npt-1] < rwymin) || ((
gywork[npt-1] > rwymax) && !optionFill2)) {
2135 for (i=first; i<=last;i++) {
2138 gywork[npt-1] = wminstep+(i-first)*delta+0.5*delta;
2140 yi1 =
y[i]; yi =
y[i-1];
2142 if (i != last)
Error(where,
"Y must be in increasing order");
2143 else Error(where,
"Y must have N+1 values with option N");
2146 gywork[npt-1] =
y[i-1] + 0.5*(
y[i]-
y[i-1]);
2149 if ((
gxwork[npt-1] < uxmin) || (
gxwork[npt-1] > uxmax)) {
2171 if (optionLine != 0 && npt > 1) {
2182 offset = delta*baroffset; dbar = delta*barwidth;
2186 dbar = (
x[1]-
x[0])*barwidth;
2189 dbar = (
y[1]-
y[0])*barwidth;
2192 drawbordersav = drawborder;
2199 else ylow =
gPad->GetUymin();
2201 for (i=first; i<=last;i++) {
2208 if (xlow < uxmax && xhigh > uxmin)
2212 xhigh = xhigh+delta;
2215 xi1 =
x[i]; xi =
x[i-1];
2217 Error(where,
"X must be in increasing order");
2221 dbar = (
x[i+1]-
x[i])*barwidth;
2231 else xlow =
gPad->GetUxmin();
2232 for (i=first; i<=last;i++) {
2240 gPad->PaintBox(xlow,ylow,xhigh,yhigh);
2242 ylow = ylow + delta;
2243 yhigh = yhigh + delta;
2246 yi1 =
y[i]; yi =
y[i-1];
2248 Error(where,
"Y must be in increasing order");
2252 dbar = (
y[i+1]-
y[i])*barwidth;
2265 if ((optionStar) || (optionMark)) optionMarker=1;
2271 for (i=first; i<=last;i++) {
2272 if (!optionBins) xm =
wmin+(i-first)*delta+0.5*delta;
2273 else xm =
x[i-1] + 0.5*(
x[i]-
x[i-1]);
2275 if (optionMark != 10) {
2276 if (ym<rwymax && ym > rwymin) {
2282 if (ym<rwymax && ym >= rwymin) {
2299 wminstep =
wmin + 0.5*delta;
2300 for (i=first; i<=last;i++) {
2301 if (!optionBins) ym = wminstep+(i-first)*delta+0.5*delta;
2302 else ym =
y[i-1] + 0.5*(
y[i]-
y[i-1]);
2304 if (optionMark != 10) {
2305 if (xm<rwxmax && xm > rwxmin) {
2311 if (xm<rwxmax && xm >= rwxmin) {
2346 std::vector<Double_t> xline, yline;
2351 const Int_t kBASEMARKER=8;
2352 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};
2353 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};
2372 const char *arrowOpt =
nullptr;
2373 if (strchr(
option,
'>')) arrowOpt =
">";
2374 if (strstr(
option,
"|>")) arrowOpt =
"|>";
2399 xline.resize(2*theNpoints);
2400 yline.resize(2*theNpoints);
2401 if (xline.empty() || yline.empty()) {
2402 Error(
"PaintGraphAsymmErrors",
"too many points, out of memory");
2409 theGraph->TAttLine::Modify();
2424 Double_t sbase = symbolsize*kBASEMARKER;
2428 if (mark >= 20 && mark <= 49) {
2439 Float_t asize = 0.6*symbolsize*kBASEMARKER/
gPad->GetWh();
2444 Bool_t DrawXLeft, DrawXRight, DrawYUp, DrawYLow;
2446 Double_t x,
y, exl, exh, eyl, eyh, xl1, xl2, xr1, xr2, yup, yup1, yup2, ylow, ylow1, ylow2;
2447 for (
Int_t i=0;i<theNpoints;i++) {
2452 x =
gPad->XtoPad(theX[i]);
2453 y =
gPad->YtoPad(theY[i]);
2457 if (x < gPad->GetUxmin())
x =
gPad->GetUxmin();
2458 if (
x >
gPad->GetUxmax())
x =
gPad->GetUxmax();
2459 if (y < gPad->GetUymin())
y =
gPad->GetUymin();
2460 if (
y >
gPad->GetUymax())
y =
gPad->GetUymax();
2462 if (x < gPad->GetUxmin())
continue;
2463 if (
x >
gPad->GetUxmax())
continue;
2464 if (y < gPad->GetUymin())
continue;
2465 if (
y >
gPad->GetUymax())
continue;
2485 xl2 =
gPad->XtoPad(theX[i] - exl);
2487 xr2 =
gPad->XtoPad(theX[i] + exh);
2488 if (xl1 < xl2) DrawXLeft =
kFALSE;
2489 if (xr1 > xr2) DrawXRight =
kFALSE;
2503 yup2 =
gPad->YtoPad(theY[i] + eyh);
2505 ylow2 =
gPad->YtoPad(theY[i] - eyl);
2506 if (yup2 < yup1) DrawYUp =
kFALSE;
2507 if (ylow2 > ylow1) DrawYLow =
kFALSE;
2511 if (yup2 >
gPad->GetUymax()) yup2 =
gPad->GetUymax();
2512 if (ylow2 < gPad->GetUymin()) ylow2 =
gPad->GetUymin();
2520 if (x1b < gPad->GetUxmin()) x1b =
gPad->GetUxmin();
2521 if (x1b >
gPad->GetUxmax()) x1b =
gPad->GetUxmax();
2522 if (y1b < gPad->GetUymin()) y1b =
gPad->GetUymin();
2523 if (y1b >
gPad->GetUymax()) y1b =
gPad->GetUymax();
2524 if (x2b < gPad->GetUxmin()) x2b =
gPad->GetUxmin();
2525 if (x2b >
gPad->GetUxmax()) x2b =
gPad->GetUxmax();
2526 if (y2b < gPad->GetUymin()) y2b =
gPad->GetUymin();
2527 if (y2b >
gPad->GetUymax()) y2b =
gPad->GetUymax();
2528 if (option5)
box.PaintBox(x1b, y1b, x2b, y2b,
"l");
2529 else box.PaintBox(x1b, y1b, x2b, y2b);
2537 yline[if1-1] = yup2;
2538 yline[if2-1] = ylow2;
2544 if (exl != 0. || exh != 0.) {
2546 if (exl != 0. && DrawXLeft)
arrow.PaintArrow(xl1,
y,xl2,
y,asize,arrowOpt);
2547 if (exh != 0. && DrawXRight)
arrow.PaintArrow(xr1,
y,xr2,
y,asize,arrowOpt);
2550 if (exl != 0. && DrawXLeft)
gPad->PaintLine(xl1,
y,xl2,
y);
2551 if (exh != 0. && DrawXRight)
gPad->PaintLine(xr1,
y,xr2,
y);
2555 if (exl != 0. && DrawXLeft) {
2556 xb[0] = xl2+tx; yb[0] =
y-ty;
2557 xb[1] = xl2; yb[1] =
y-ty;
2558 xb[2] = xl2; yb[2] =
y+ty;
2559 xb[3] = xl2+tx; yb[3] =
y+ty;
2560 gPad->PaintPolyLine(4, xb, yb);
2562 if (exh != 0. && DrawXRight) {
2563 xb[0] = xr2-tx; yb[0] =
y-ty;
2564 xb[1] = xr2; yb[1] =
y-ty;
2565 xb[2] = xr2; yb[2] =
y+ty;
2566 xb[3] = xr2-tx; yb[3] =
y+ty;
2567 gPad->PaintPolyLine(4, xb, yb);
2570 if (DrawXLeft)
gPad->PaintLine(xl2,
y-ty,xl2,
y+ty);
2571 if (DrawXRight)
gPad->PaintLine(xr2,
y-ty,xr2,
y+ty);
2577 if (eyl != 0. || eyh != 0.) {
2579 if (eyh != 0. && DrawYUp) {
2580 if (yup2 == yup)
arrow.PaintArrow(
x,yup1,
x,yup2,asize,arrowOpt);
2581 else gPad->PaintLine(
x,yup1,
x,yup2);
2583 if (eyl != 0. && DrawYLow) {
2584 if (ylow2 == ylow)
arrow.PaintArrow(
x,ylow1,
x,ylow2,asize,arrowOpt);
2585 else gPad->PaintLine(
x,ylow1,
x,ylow2);
2589 if (eyh != 0. && DrawYUp)
gPad->PaintLine(
x,yup1,
x,yup2);
2590 if (eyl != 0. && DrawYLow)
gPad->PaintLine(
x,ylow1,
x,ylow2);
2594 if (eyh != 0. && yup2 == yup && DrawYUp) {
2595 xb[0] =
x-tx; yb[0] = yup2-ty;
2596 xb[1] =
x-tx; yb[1] = yup2;
2597 xb[2] =
x+tx; yb[2] = yup2;
2598 xb[3] =
x+tx; yb[3] = yup2-ty;
2599 gPad->PaintPolyLine(4, xb, yb);
2601 if (eyl != 0. && ylow2 == ylow && DrawYLow) {
2602 xb[0] =
x-tx; yb[0] = ylow2+ty;
2603 xb[1] =
x-tx; yb[1] = ylow2;
2604 xb[2] =
x+tx; yb[2] = ylow2;
2605 xb[3] =
x+tx; yb[3] = ylow2+ty;
2606 gPad->PaintPolyLine(4, xb, yb);
2609 if (eyh != 0. && yup2 == yup && DrawYUp)
gPad->PaintLine(
x-tx,yup2,
x+tx,yup2);
2610 if (eyl != 0. && ylow2 == ylow && DrawYLow)
gPad->PaintLine(
x-tx,ylow2,
x+tx,ylow2);
2624 if (option4)
PaintGraph(theGraph, 2*theNpoints, xline.data(), yline.data(),
"FC");
2625 else PaintGraph(theGraph, 2*theNpoints, xline.data(), yline.data(),
"F");
2626 gPad->SetLogx(logx);
2627 gPad->SetLogy(logy);
2643 Int_t NYErrors = tg->GetNYErrors();
2644 if (NYErrors <= 0) {
2652 std::vector<TString> options(NYErrors + 1);
2661 while ((firstSemicolon = tsOpt.
First(
';')) !=
kNPOS && filled <= NYErrors) {
2662 options[filled] = tsOpt(0, firstSemicolon);
2663 tsOpt = tsOpt(firstSemicolon + 1, tsOpt.
Length());
2667 if (filled <= NYErrors) {
2668 options[filled] = tsOpt.
Copy();
2672 for (
Int_t i = filled; i <= NYErrors; i++)
2675 std::vector<Double_t> xline;
2676 std::vector<std::vector<Double_t>> yline(NYErrors);
2681 const Int_t kBASEMARKER = 8;
2682 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};
2683 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};
2684 Int_t theNpoints = tg->GetN();
2688 Double_t *theExH = tg->GetEXhigh();
2689 std::vector<Double_t *> theEyL(NYErrors);
2690 std::vector<Double_t *> theEyH(NYErrors);
2693 for (
Int_t j = 0; j < NYErrors; j++) {
2694 theEyL[j] = tg->GetEYlow(j);
2695 theEyH[j] = tg->GetEYhigh(j);
2696 theEyExists &= (theEyL[j] && theEyH[j]);
2699 if (!theX || !theY || !theExL || !theExH || !theEyExists)
2702 std::vector<Bool_t> DrawErrors(NYErrors);
2707 std::vector<Bool_t> Braticks(NYErrors);
2708 std::vector<Bool_t> Brackets(NYErrors);
2709 std::vector<Bool_t> EndLines(NYErrors);
2710 std::vector<Char_t *> ArrowOpt(NYErrors);
2711 std::vector<Bool_t> Option5(NYErrors);
2712 std::vector<Bool_t> Option4(NYErrors);
2713 std::vector<Bool_t> Option3(NYErrors);
2715 std::vector<Bool_t> Option2(NYErrors);
2716 std::vector<Bool_t> Option0(NYErrors);
2718 std::vector<Double_t> Scale(NYErrors);
2720 const TRegexp ScaleRegExp(
"s=*[0-9]\\.*[0-9]");
2722 for (
Int_t j = 0; j < NYErrors; j++) {
2723 if (options[j + 1].Contains(
"s=")) {
2724 sscanf(strstr(options[j + 1].Data(),
"s="),
"s=%lf", &Scale[j]);
2725 options[j + 1].ReplaceAll(options[j + 1](ScaleRegExp),
"");
2729 DrawErrors[j] = !options[j + 1].Contains(
"x");
2730 AnyErrors |= DrawErrors[j];
2731 Braticks[j] = options[j + 1].Contains(
"[]");
2732 Brackets[j] = options[j + 1].Contains(
"||") || Braticks[j];
2733 EndLines[j] = !options[j + 1].Contains(
"z");
2735 if (options[j + 1].Contains(
"|>"))
2736 ArrowOpt[j] = (
Char_t *)
"|>";
2737 else if (options[j + 1].Contains(
">"))
2738 ArrowOpt[j] = (
Char_t *)
">";
2740 ArrowOpt[j] =
nullptr;
2742 Option5[j] = options[j + 1].Contains(
"5");
2743 Option4[j] = options[j + 1].Contains(
"4");
2744 Option3[j] = options[j + 1].Contains(
"3") || Option4[j];
2745 AnyOption3 |= Option3[j];
2746 Option2[j] = options[j + 1].Contains(
"2") || Option5[j];
2747 Option0[j] = options[j + 1].Contains(
"0");
2748 AnyOption0 |= Option0[j];
2750 NoErrorsX &= (Option3[j] || Option2[j]);
2751 Option0X |= !(Option3[j] || Option2[j]) && Option0[j];
2752 DrawMarker |= !(Brackets[j] || Option3[j] || Option2[j]);
2755 Bool_t Draw0PointsX = !options[0].Contains(
"x0") && (
gPad->GetLogx() == 0);
2756 Bool_t Draw0PointsY = !options[0].Contains(
"y0") && (
gPad->GetLogy() == 0);
2757 options[0].ReplaceAll(
"x0",
"");
2758 options[0].ReplaceAll(
"y0",
"");
2760 Bool_t DrawErrorsX = !options[0].Contains(
"x");
2761 Bool_t BraticksX = options[0].Contains(
"[]");
2762 Bool_t BracketsX = options[0].Contains(
"||") || BraticksX;
2763 Bool_t EndLinesX = !options[0].Contains(
"z");
2765 Char_t *ArrowOptX =
nullptr;
2766 if (options[0].Contains(
"|>"))
2767 ArrowOptX = (
Char_t *)
"|>";
2768 else if (options[0].Contains(
">"))
2769 ArrowOptX = (
Char_t *)
">";
2772 if (options[0].Contains(
"s=")) {
2773 sscanf(strstr(options[0].Data(),
"s="),
"s=%lf", &ScaleX);
2774 options[0].ReplaceAll(options[0](ScaleRegExp),
"");
2777 if (!AnyErrors && !DrawErrorsX) {
2782 Bool_t DrawAxis = options[0].Contains(
"a");
2783 Bool_t IndividualStyles = options[0].Contains(
"s");
2788 Int_t NPointsInside = AnyOption0 ? theNpoints : 0;
2791 for (
Int_t i = 0; i < theNpoints && !AnyOption0; i++) {
2792 x =
gPad->XtoPad(theX[i]);
2793 y =
gPad->YtoPad(theY[i]);
2795 if ((
x >=
gPad->GetUxmin()) && (x <= gPad->GetUxmax()) && (
y >=
gPad->GetUymin()) && (y <= gPad->GetUymax()) &&
2796 (Draw0PointsX || theX[i] != 0.) && (Draw0PointsY || theY[i] != 0.))
2801 xline.resize(2 * NPointsInside);
2803 if (xline.empty()) {
2804 Error(
"PaintGraphMultiErrors",
"too many points, out of memory");
2809 if2 = 2 * NPointsInside;
2812 for (
Int_t j = 0; j < NYErrors; j++) {
2813 if (Option3[j] && DrawErrors[j]) {
2814 yline[j].resize(2 * NPointsInside);
2816 if (yline[j].empty()) {
2817 Error(
"PaintGraphMultiErrors",
"too many points, out of memory");
2823 tg->TAttLine::Modify();
2826 arrow.SetLineWidth(tg->GetLineWidth());
2827 arrow.SetLineColor(tg->GetLineColor());
2828 arrow.SetFillColor(tg->GetFillColor());
2832 box.SetLineWidth(tg->GetLineWidth());
2833 box.SetLineColor(tg->GetLineColor());
2834 box.SetFillColor(tg->GetFillColor());
2835 box.SetFillStyle(tg->GetFillStyle());
2837 Double_t symbolsize = tg->GetMarkerSize();
2838 Double_t sbase = symbolsize * kBASEMARKER;
2843 if (mark >= 20 && mark <= 49) {
2844 cx = cxx[mark - 20];
2845 cy = cyy[mark - 20];
2854 Float_t asize = 0.6 * symbolsize * kBASEMARKER /
gPad->GetWh();
2859 Double_t xl1, xl2, xr1, xr2, yup1, yup2, ylow1, ylow2;
2860 for (
Int_t i = 0; i < theNpoints; i++) {
2861 x =
gPad->XtoPad(theX[i]);
2862 y =
gPad->YtoPad(theY[i]);
2865 (
x <
gPad->GetUxmin()) || (
x >
gPad->GetUxmax()) || (y < gPad->GetUymin()) || (
y >
gPad->GetUymax());
2867 if ((isOutside && !AnyOption0) || (!Draw0PointsX && theX[i] == 0.) || (!Draw0PointsY && theY[i] == 0.))
2872 if (x < gPad->GetUxmin())
2873 x =
gPad->GetUxmin();
2874 if (
x >
gPad->GetUxmax())
2875 x =
gPad->GetUxmax();
2876 if (y < gPad->GetUymin())
2877 y =
gPad->GetUymin();
2878 if (
y >
gPad->GetUymax())
2879 y =
gPad->GetUymax();
2889 for (
Int_t j = 0; j < NYErrors; j++) {
2894 if (Option2[j] && (!isOutside || Option0[j])) {
2895 if (IndividualStyles) {
2896 box.SetLineWidth(tg->GetLineWidth(j));
2897 box.SetLineColor(tg->GetLineColor(j));
2898 box.SetFillColor(tg->GetFillColor(j));
2899 box.SetFillStyle(tg->GetFillStyle(j));
2902 x1b =
gPad->XtoPad(theX[i] - Scale[j] * theExL[i]);
2903 y1b =
gPad->YtoPad(theY[i] - theEyL[j][i]);
2904 x2b =
gPad->XtoPad(theX[i] + Scale[j] * theExH[i]);
2905 y2b =
gPad->YtoPad(theY[i] + theEyH[j][i]);
2906 if (x1b < gPad->GetUxmin())
2907 x1b =
gPad->GetUxmin();
2908 if (x1b >
gPad->GetUxmax())
2909 x1b =
gPad->GetUxmax();
2910 if (y1b < gPad->GetUymin())
2911 y1b =
gPad->GetUymin();
2912 if (y1b >
gPad->GetUymax())
2913 y1b =
gPad->GetUymax();
2914 if (x2b < gPad->GetUxmin())
2915 x2b =
gPad->GetUxmin();
2916 if (x2b >
gPad->GetUxmax())
2917 x2b =
gPad->GetUxmax();
2918 if (y2b < gPad->GetUymin())
2919 y2b =
gPad->GetUymin();
2920 if (y2b >
gPad->GetUymax())
2921 y2b =
gPad->GetUymax();
2923 box.PaintBox(x1b, y1b, x2b, y2b,
"l");
2925 box.PaintBox(x1b, y1b, x2b, y2b);
2930 if (!isOutside || Option0[j]) {
2931 yline[j][if1 - 2] =
gPad->YtoPad(theY[i] + theEyH[j][i]);
2932 yline[j][if2] =
gPad->YtoPad(theY[i] - theEyL[j][i]);
2934 yline[j][if1 - 2] =
gPad->GetUymin();
2935 yline[j][if2] =
gPad->GetUymin();
2939 if (IndividualStyles) {
2940 tg->GetAttLine(j)->Modify();
2942 arrow.SetLineWidth(tg->GetLineWidth(j));
2943 arrow.SetLineColor(tg->GetLineColor(j));
2944 arrow.SetFillColor(tg->GetFillColor(j));
2947 ylow1 =
y - s2y * cy;
2948 ylow2 =
gPad->YtoPad(theY[i] - theEyL[j][i]);
2949 if (ylow2 < gPad->GetUymin())
2950 ylow2 =
gPad->GetUymin();
2951 if (ylow2 < ylow1 && DrawErrors[j] && !Option2[j] && !Option3[j] && (!isOutside || Option0[j])) {
2953 arrow.PaintArrow(
x, ylow1,
x, ylow2, asize, ArrowOpt[j]);
2956 gPad->PaintLine(
x, ylow1,
x, ylow2);
2967 gPad->PaintPolyLine(4, xb, yb);
2969 gPad->PaintLine(
x - tx, ylow2,
x + tx, ylow2);
2974 yup1 =
y + s2y * cy;
2975 yup2 =
gPad->YtoPad(theY[i] + theEyH[j][i]);
2976 if (yup2 >
gPad->GetUymax())
2977 yup2 =
gPad->GetUymax();
2978 if (yup2 > yup1 && DrawErrors[j] && !Option2[j] && !Option3[j] && (!isOutside || Option0[j])) {
2980 arrow.PaintArrow(
x, yup1,
x, yup2, asize, ArrowOpt[j]);
2983 gPad->PaintLine(
x, yup1,
x, yup2);
2994 gPad->PaintPolyLine(4, xb, yb);
2996 gPad->PaintLine(
x - tx, yup2,
x + tx, yup2);
3003 if (IndividualStyles) {
3004 tg->TAttLine::Modify();
3006 arrow.SetLineWidth(tg->GetLineWidth());
3007 arrow.SetLineColor(tg->GetLineColor());
3008 arrow.SetFillColor(tg->GetFillColor());
3012 xl2 =
gPad->XtoPad(theX[i] - ScaleX * theExL[i]);
3013 if (xl1 > xl2 && !NoErrorsX && (!isOutside || Option0X)) {
3015 arrow.PaintArrow(xl1,
y, xl2,
y, asize, ArrowOptX);
3018 gPad->PaintLine(xl1,
y, xl2,
y);
3029 gPad->PaintPolyLine(4, xb, yb);
3031 gPad->PaintLine(xl2,
y - ty, xl2,
y + ty);
3037 xr2 =
gPad->XtoPad(theX[i] + ScaleX * theExH[i]);
3038 if (xr1 < xr2 && !NoErrorsX && (!isOutside || Option0X)) {
3040 arrow.PaintArrow(xr1,
y, xr2,
y, asize, ArrowOptX);
3043 gPad->PaintLine(xr1,
y, xr2,
y);
3054 gPad->PaintPolyLine(4, xb, yb);
3056 gPad->PaintLine(xr2,
y - ty, xr2,
y + ty);
3068 tg->TAttFill::Copy(tgDummy);
3069 tg->TAttLine::Copy(tgDummy);
3070 tg->TAttMarker::Copy(tgDummy);
3072 for (
Int_t j = 0; j < NYErrors; j++)
3073 if (Option3[j] && DrawErrors[j]) {
3074 if (IndividualStyles) {
3075 tg->GetAttFill(j)->
Copy(tgDummy);
3076 tg->GetAttLine(j)->Copy(tgDummy);
3084 PaintGraph(&tgDummy, 2 * NPointsInside, xline.data(), yline[j].data(),
"FC");
3086 PaintGraph(&tgDummy, 2 * NPointsInside, xline.data(), yline[j].data(),
"F");
3087 gPad->SetLogx(logx);
3088 gPad->SetLogy(logy);
3099 std::vector<Double_t> xline, yline;
3104 const Int_t kBASEMARKER=8;
3105 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};
3106 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};
3129 const char *arrowOpt =
nullptr;
3130 if (strchr(
option,
'>')) arrowOpt =
">";
3131 if (strstr(
option,
"|>")) arrowOpt =
"|>";
3156 xline.resize(2*theNpoints);
3157 yline.resize(2*theNpoints);
3158 if (xline.empty() || yline.empty()) {
3159 Error(
"PaintGraphBentErrors",
"too many points, out of memory");
3166 theGraph->TAttLine::Modify();
3181 Double_t sbase = symbolsize*kBASEMARKER;
3185 if (mark >= 20 && mark <= 49) {
3196 Float_t asize = 0.6*symbolsize*kBASEMARKER/
gPad->GetWh();
3201 Bool_t DrawXLeft, DrawXRight, DrawYUp, DrawYLow;
3203 Double_t x,
y, exl, exh, eyl, eyh, xl1, xl2, xr1, xr2, yup, yup1, yup2, ylow, ylow1, ylow2;
3205 for (
Int_t i=0;i<theNpoints;i++) {
3210 x =
gPad->XtoPad(theX[i]);
3211 y =
gPad->YtoPad(theY[i]);
3212 bxl =
gPad->YtoPad(theY[i]+theEXlowd[i]);
3213 bxh =
gPad->YtoPad(theY[i]+theEXhighd[i]);
3214 byl =
gPad->XtoPad(theX[i]+theEYlowd[i]);
3215 byh =
gPad->XtoPad(theX[i]+theEYhighd[i]);
3219 if (x < gPad->GetUxmin())
x =
gPad->GetUxmin();
3220 if (
x >
gPad->GetUxmax())
x =
gPad->GetUxmax();
3221 if (y < gPad->GetUymin())
y =
gPad->GetUymin();
3222 if (
y >
gPad->GetUymax())
y =
gPad->GetUymax();
3224 if (x < gPad->GetUxmin())
continue;
3225 if (
x >
gPad->GetUxmax())
continue;
3226 if (y < gPad->GetUymin())
continue;
3227 if (
y >
gPad->GetUymax())
continue;
3253 xl2 =
gPad->XtoPad(theX[i] - exl);
3255 xr2 =
gPad->XtoPad(theX[i] + exh);
3256 if (xl1 < xl2) DrawXLeft =
kFALSE;
3257 if (xr1 > xr2) DrawXRight =
kFALSE;
3277 yup2 =
gPad->YtoPad(theY[i] + eyh);
3279 ylow2 =
gPad->YtoPad(theY[i] - eyl);
3280 if (yup2 < yup1) DrawYUp =
kFALSE;
3281 if (ylow2 > ylow1) DrawYLow =
kFALSE;
3285 if (yup2 >
gPad->GetUymax()) yup2 =
gPad->GetUymax();
3286 if (ylow2 < gPad->GetUymin()) ylow2 =
gPad->GetUymin();
3288 if (xrevlog) {bs = bxl; bxl = bxh; bxh = bs;}
3289 if (yrevlog) {bs = byl; byl = byh; byh = bs;}
3297 if (x1b < gPad->GetUxmin()) x1b =
gPad->GetUxmin();
3298 if (x1b >
gPad->GetUxmax()) x1b =
gPad->GetUxmax();
3299 if (y1b < gPad->GetUymin()) y1b =
gPad->GetUymin();
3300 if (y1b >
gPad->GetUymax()) y1b =
gPad->GetUymax();
3301 if (x2b < gPad->GetUxmin()) x2b =
gPad->GetUxmin();
3302 if (x2b >
gPad->GetUxmax()) x2b =
gPad->GetUxmax();
3303 if (y2b < gPad->GetUymin()) y2b =
gPad->GetUymin();
3304 if (y2b >
gPad->GetUymax()) y2b =
gPad->GetUymax();
3305 if (option5)
box.PaintBox(x1b, y1b, x2b, y2b,
"l");
3306 else box.PaintBox(x1b, y1b, x2b, y2b);
3314 yline[if1-1] = yup2;
3315 yline[if2-1] = ylow2;
3321 if (exl != 0. || exh != 0.) {
3323 if (exl != 0. && DrawXLeft)
arrow.PaintArrow(xl1,
y,xl2,bxl,asize,arrowOpt);
3324 if (exh != 0. && DrawXRight)
arrow.PaintArrow(xr1,
y,xr2,bxh,asize,arrowOpt);
3327 if (exl != 0. && DrawXLeft)
gPad->PaintLine(xl1,
y,xl2,bxl);
3328 if (exh != 0. && DrawXRight)
gPad->PaintLine(xr1,
y,xr2,bxh);
3332 if (exl != 0. && DrawXLeft) {
3333 xb[0] = xl2+tx; yb[0] = bxl-ty;
3334 xb[1] = xl2; yb[1] = bxl-ty;
3335 xb[2] = xl2; yb[2] = bxl+ty;
3336 xb[3] = xl2+tx; yb[3] = bxl+ty;
3337 gPad->PaintPolyLine(4, xb, yb);
3339 if (exh != 0. && DrawXRight) {
3340 xb[0] = xr2-tx; yb[0] = bxh-ty;
3341 xb[1] = xr2; yb[1] = bxh-ty;
3342 xb[2] = xr2; yb[2] = bxh+ty;
3343 xb[3] = xr2-tx; yb[3] = bxh+ty;
3344 gPad->PaintPolyLine(4, xb, yb);
3347 if (DrawXLeft)
gPad->PaintLine(xl2,bxl-ty,xl2,bxl+ty);
3348 if (DrawXRight)
gPad->PaintLine(xr2,bxh-ty,xr2,bxh+ty);
3354 if (eyl != 0. || eyh != 0.) {
3356 if (eyh != 0. && DrawYUp) {
3357 if (yup2 == yup)
arrow.PaintArrow(
x,yup1,byh,yup2,asize,arrowOpt);
3358 else gPad->PaintLine(
x,yup1,byh,yup2);
3360 if (eyl != 0. && DrawYLow) {
3361 if (ylow2 == ylow)
arrow.PaintArrow(
x,ylow1,byl,ylow2,asize,arrowOpt);
3362 else gPad->PaintLine(
x,ylow1,byl,ylow2);
3366 if (eyh != 0. && DrawYUp)
gPad->PaintLine(
x,yup1,byh,yup2);
3367 if (eyl != 0. && DrawYLow)
gPad->PaintLine(
x,ylow1,byl,ylow2);
3371 if (eyh != 0. && yup2 == yup && DrawYUp) {
3372 xb[0] = byh-tx; yb[0] = yup2-ty;
3373 xb[1] = byh-tx; yb[1] = yup2;
3374 xb[2] = byh+tx; yb[2] = yup2;
3375 xb[3] = byh+tx; yb[3] = yup2-ty;
3376 gPad->PaintPolyLine(4, xb, yb);
3378 if (eyl != 0. && ylow2 == ylow && DrawYLow) {
3379 xb[0] = byl-tx; yb[0] = ylow2+ty;
3380 xb[1] = byl-tx; yb[1] = ylow2;
3381 xb[2] = byl+tx; yb[2] = ylow2;
3382 xb[3] = byl+tx; yb[3] = ylow2+ty;
3383 gPad->PaintPolyLine(4, xb, yb);
3386 if (eyh != 0. && yup2 == yup && DrawYUp)
gPad->PaintLine(byh-tx,yup2,byh+tx,yup2);
3387 if (eyl != 0. && ylow2 == ylow && DrawYLow)
gPad->PaintLine(byl-tx,ylow2,byl+tx,ylow2);
3402 if (option4)
PaintGraph(theGraph, 2*theNpoints, xline.data(), yline.data(),
"FC");
3403 else PaintGraph(theGraph, 2*theNpoints, xline.data(), yline.data(),
"F");
3404 gPad->SetLogx(logx);
3405 gPad->SetLogy(logy);
3416 std::vector<Double_t> xline, yline;
3421 const Int_t kBASEMARKER=8;
3422 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};
3423 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};
3440 const char *arrowOpt =
nullptr;
3441 if (strchr(
option,
'>')) arrowOpt =
">";
3442 if (strstr(
option,
"|>")) arrowOpt =
"|>";
3467 xline.resize(2*theNpoints);
3468 yline.resize(2*theNpoints);
3469 if (xline.empty() || yline.empty()) {
3470 Error(
"PaintGraphErrors",
"too many points, out of memory");
3477 theGraph->TAttLine::Modify();
3493 Double_t sbase = symbolsize*kBASEMARKER;
3497 if (mark >= 20 && mark <= 49) {
3508 Float_t asize = 0.6*symbolsize*kBASEMARKER/
gPad->GetWh();
3513 Bool_t DrawXLeft, DrawXRight, DrawYUp, DrawYLow;
3515 Double_t x,
y,
ex,
ey, xl1, xl2, xr1, xr2, yup, yup1, yup2, ylow, ylow1, ylow2;
3516 for (
Int_t i=0;i<theNpoints;i++) {
3521 x =
gPad->XtoPad(theX[i]);
3522 y =
gPad->YtoPad(theY[i]);
3529 if (!option0 && !option3) {
3530 if (x < gPad->GetUxmin())
continue;
3531 if (
x >
gPad->GetUxmax())
continue;
3532 if (y < gPad->GetUymin())
continue;
3533 if (
y >
gPad->GetUymax())
continue;
3550 xl2 =
gPad->XtoPad(theX[i] -
ex);
3552 xr2 =
gPad->XtoPad(theX[i] +
ex);
3553 if (xl1 < xl2) DrawXLeft =
kFALSE;
3554 if (xr1 > xr2) DrawXRight =
kFALSE;
3568 yup2 =
gPad->YtoPad(theY[i] +
ey);
3570 ylow2 =
gPad->YtoPad(theY[i] -
ey);
3571 if (yup2 < yup1) DrawYUp =
kFALSE;
3572 if (ylow2 > ylow1) DrawYLow =
kFALSE;
3577 if (yup2 >
gPad->GetUymax()) yup2 =
gPad->GetUymax();
3578 if (ylow2 < gPad->GetUymin()) ylow2 =
gPad->GetUymin();
3587 if (x1b < gPad->GetUxmin()) x1b =
gPad->GetUxmin();
3588 if (x1b >
gPad->GetUxmax()) x1b =
gPad->GetUxmax();
3589 if (y1b < gPad->GetUymin()) y1b =
gPad->GetUymin();
3590 if (y1b >
gPad->GetUymax()) y1b =
gPad->GetUymax();
3591 if (x2b < gPad->GetUxmin()) x2b =
gPad->GetUxmin();
3592 if (x2b >
gPad->GetUxmax()) x2b =
gPad->GetUxmax();
3593 if (y2b < gPad->GetUymin()) y2b =
gPad->GetUymin();
3594 if (y2b >
gPad->GetUymax()) y2b =
gPad->GetUymax();
3595 if (option5)
box.PaintBox(x1b, y1b, x2b, y2b,
"l");
3596 else box.PaintBox(x1b, y1b, x2b, y2b);
3604 yline[if1-1] = yup2;
3605 yline[if2-1] = ylow2;
3613 if (DrawXLeft)
arrow.PaintArrow(xl1,
y,xl2,
y,asize,arrowOpt);
3614 if (DrawXRight)
arrow.PaintArrow(xr1,
y,xr2,
y,asize,arrowOpt);
3617 if (DrawXLeft)
gPad->PaintLine(xl1,
y,xl2,
y);
3618 if (DrawXRight)
gPad->PaintLine(xr1,
y,xr2,
y);
3623 xb[0] = xl2+tx; yb[0] =
y-ty;
3624 xb[1] = xl2; yb[1] =
y-ty;
3625 xb[2] = xl2; yb[2] =
y+ty;
3626 xb[3] = xl2+tx; yb[3] =
y+ty;
3627 gPad->PaintPolyLine(4, xb, yb);
3630 xb[0] = xr2-tx; yb[0] =
y-ty;
3631 xb[1] = xr2; yb[1] =
y-ty;
3632 xb[2] = xr2; yb[2] =
y+ty;
3633 xb[3] = xr2-tx; yb[3] =
y+ty;
3634 gPad->PaintPolyLine(4, xb, yb);
3637 if (DrawXLeft)
gPad->PaintLine(xl2,
y-ty,xl2,
y+ty);
3638 if (DrawXRight)
gPad->PaintLine(xr2,
y-ty,xr2,
y+ty);
3647 if (yup2 == yup)
arrow.PaintArrow(
x,yup1,
x,yup2,asize,arrowOpt);
3648 else gPad->PaintLine(
x,yup1,
x,yup2);
3651 if (ylow2 == ylow)
arrow.PaintArrow(
x,ylow1,
x,ylow2,asize,arrowOpt);
3652 else gPad->PaintLine(
x,ylow1,
x,ylow2);
3656 if (DrawYUp)
gPad->PaintLine(
x,yup1,
x,yup2);
3657 if (DrawYLow)
gPad->PaintLine(
x,ylow1,
x,ylow2);
3661 if (yup2 == yup && DrawYUp) {
3662 xb[0] =
x-tx; yb[0] = yup2-ty;
3663 xb[1] =
x-tx; yb[1] = yup2;
3664 xb[2] =
x+tx; yb[2] = yup2;
3665 xb[3] =
x+tx; yb[3] = yup2-ty;
3666 gPad->PaintPolyLine(4, xb, yb);
3668 if (ylow2 == ylow && DrawYLow) {
3669 xb[0] =
x-tx; yb[0] = ylow2+ty;
3670 xb[1] =
x-tx; yb[1] = ylow2;
3671 xb[2] =
x+tx; yb[2] = ylow2;
3672 xb[3] =
x+tx; yb[3] = ylow2+ty;
3673 gPad->PaintPolyLine(4, xb, yb);
3676 if (yup2 == yup && DrawYUp)
gPad->PaintLine(
x-tx,yup2,
x+tx,yup2);
3677 if (ylow2 == ylow && DrawYLow)
gPad->PaintLine(
x-tx,ylow2,
x+tx,ylow2);
3692 if (option4)
PaintGraph(theGraph, 2*theNpoints, xline.data(), yline.data(),
"FC");
3693 else PaintGraph(theGraph, 2*theNpoints, xline.data(), yline.data(),
"F");
3694 gPad->SetLogx(logx);
3695 gPad->SetLogy(logy);
3707 Int_t theNpoints = theGraphPolar->
GetN();
3725 polargram_opt.
Append(
"N");
3730 polargram_opt.
Append(
"O");
3744 thePolargram =
nullptr;
3745 if (!thePolargram) {
3747 TIter padObjIter(
gPad->GetListOfPrimitives());
3748 while (
auto obj = padObjIter()) {
3758 if (!thePolargram) {
3763 thePolargram->
Draw(polargram_opt.
Data());
3767 rwrmax = thePolargram->
GetRMax(),
3768 rwtmin = thePolargram->
GetTMin(),
3769 rwtmax = thePolargram->
GetTMax();
3776 Double_t radiusNDC = rwrmax - rwrmin;
3785 if (thePolargram->
IsGrad())
3788 for (
Int_t i = 0; i < theNpoints; i++) {
3789 Double_t eymin, eymax, exmin,exmax;
3790 exmin = (theY[i]-theEY[i]-rwrmin)/radiusNDC*
3792 eymin = (theY[i]-theEY[i]-rwrmin)/radiusNDC*
3794 exmax = (theY[i]+theEY[i]-rwrmin)/radiusNDC*
3796 eymax = (theY[i]+theEY[i]-rwrmin)/radiusNDC*
3798 theGraphPolar->TAttLine::Modify();
3799 if (exmin != exmax || eymin != eymax)
gPad->PaintLine(exmin,eymin,exmax,eymax);
3803 for (
Int_t i = 0; i < theNpoints; i++) {
3804 Double_t rad = (theY[i]-rwrmin)/radiusNDC;
3807 theGraphPolar->TAttLine::Modify();
3808 if (phimin != phimax) thePolargram->
PaintCircle(0,0,rad,phimin,phimax,0);
3814 if (!
gPad->GetLogx() && !
gPad->GetLogy()) {
3815 Double_t a,
b,
c = 1,
x1,
x2,
y1,
y2, discr, norm1, norm2, xts, yts;
3823 if (thePolargram->
IsGrad())
3825 for (
Int_t i = 0; i < theNpoints; i++) {
3828 xt = (theY[i]-rwrmin)/radiusNDC*
TMath::Cos(
c*(theX[i]-rwtmin)/thetaNDC);
3829 yt = (theY[i]-rwrmin)/radiusNDC*
TMath::Sin(
c*(theX[i]-rwtmin)/thetaNDC);
3830 norm = sqrt(xt*xt+yt*yt);
3835 if (!previouspointin) {
3840 a = (yt-yts)/(xt-xts);
3842 discr = 4*(
a*
a-
b*
b+1);
3843 x1 = (-2*
a*
b+sqrt(discr))/(2*(
a*
a+1));
3844 x2 = (-2*
a*
b-sqrt(discr))/(2*(
a*
a+1));
3847 norm1 = sqrt((
x1-xt)*(
x1-xt)+(
y1-yt)*(
y1-yt));
3848 norm2 = sqrt((
x2-xt)*(
x2-xt)+(
y2-yt)*(
y2-yt));
3849 previouspointin =
kFALSE;
3851 if (norm1 < norm2) {
3861 PaintGraph(theGraphPolar, j+1, theXpol, theYpol, opt);
3866 if (j>=1 && !previouspointin) {
3867 a = (yt-theYpol[j])/(xt-theXpol[j]);
3868 b = theYpol[j]-
a*theXpol[j];
3869 previouspointin =
kTRUE;
3870 discr = 4*(
a*
a-
b*
b+1);
3871 x1 = (-2*
a*
b+sqrt(discr))/(2*(
a*
a+1));
3872 x2 = (-2*
a*
b-sqrt(discr))/(2*(
a*
a+1));
3875 norm1 = sqrt((
x1-xt)*(
x1-xt)+(
y1-yt)*(
y1-yt));
3876 norm2 = sqrt((
x2-xt)*(
x2-xt)+(
y2-yt)*(
y2-yt));
3878 if (norm1 < norm2) {
3885 PaintGraph(theGraphPolar, j+1, theXpol, theYpol, opt);
3892 PaintGraph(theGraphPolar, j+1, theXpol, theYpol, opt);
3895 for (
Int_t i = 0; i < theNpoints; i++) {
3899 PaintGraph(theGraphPolar, theNpoints, theXpol, theYpol, opt);
3907 TIter next(
gPad->GetListOfPrimitives());
3908 while (
auto obj = next()) {
3911 if (obj->GetName() && !strcmp(obj->GetName(),
"title")) {
3917 if (title)
delete title;
3923 if (ht <= 0) ht = 0.05;
3944 if (talh < 1) talh = 1;
else if (talh > 3) talh = 3;
3946 if (talv < 1) talv = 1;
else if (talv > 3) talv = 3;
3971 ptitle->
Paint(
"blNDC");
3988 TF1 *theF = theGraphQQ->
GetF();
3991 Error(
"TGraphQQ::Paint",
"2nd dataset or theoretical function not specified");
4006 Double_t yxmin, xymin, yxmax, xymax;
4012 TLine line1, line2, line3;
4015 yxmin = (theYq2-theYq1)*(
xmin-theXq1)/(theXq2-theXq1) + theYq1;
4017 xymin = (theXq2-theXq1)*(
ymin-theYq1)/(theYq2-theYq1) + theXq1;
4023 line2.
PaintLine(xqmin, yqmin, xqmax, yqmax);
4025 yxmax = (theYq2-theYq1)*(
xmax-theXq1)/(theXq2-theXq1) + theYq1;
4027 xymax = (theXq2-theXq1)*(
ymax-theYq1)/(theYq2-theYq1) + theXq1;
4077 if (lxp) opth.
Append(
"x+");
4078 if (lyp) opth.
Append(
"y+");
4103 XA1 =
gPad->GetUxmin();
4104 XA2 =
gPad->GetUxmax();
4105 YA1 =
gPad->GetUymin();
4106 YA2 =
gPad->GetUymax();
4140 if (
gPad->GetGridx()) {
4141 if (
gPad->GetLogy()) {
4144 GL = (YA2 - YA1) / (
gPad->GetY2() -
gPad->GetY1());
4152 TGaxis *theReversedXaxis;
4153 if (
gPad->GetLogx()) {
4166 theReversedXaxis =
new TGaxis(
gPad->GetUxmax(),
4180 theReversedXaxis->
Paint();
4181 delete theReversedXaxis;
4185 if (
gPad->GetLogx()) {
4189 for (i=0; i<
N; i++) rX[i] = dX-
X[i];
4193 if (rEXhigh && EXlow)
for (i=0; i<
N; i++) rEXhigh[i] = EXlow[i];
4194 if (rEXlow && EXhigh)
for (i=0; i<
N; i++) rEXlow[i] = EXhigh[i];
4197 if (rEXhighd && EXlowd)
for (i=0; i<
N; i++) rEXhighd[i] = EXlowd[i];
4198 if (rEXlowd && EXhighd)
for (i=0; i<
N; i++) rEXlowd[i] = EXhighd[i];
4208 if (
gPad->GetGridy()) {
4209 if (
gPad->GetLogx()) {
4212 GL = (XA2 - XA1) / (
gPad->GetX2() -
gPad->GetX1());
4220 TGaxis *theReversedYaxis;
4228 if (
gPad->GetLogy()) {
4254 theReversedYaxis->
Paint();
4255 delete theReversedYaxis;
4259 if (
gPad->GetLogy()) {
4263 for (i=0; i<
N; i++) rY[i] = dY-Y[i];
4267 if (rEYhigh && EYlow)
for (i=0; i<
N; i++) rEYhigh[i] = EYlow[i];
4268 if (rEYlow && EYhigh)
for (i=0; i<
N; i++) rEYlow[i] = EYhigh[i];
4271 if (rEYhighd && EYlowd)
for (i=0; i<
N; i++) rEYhighd[i] = EYlowd[i];
4272 if (rEYlowd && EYhighd)
for (i=0; i<
N; i++) rEYlowd[i] = EYhighd[i];
4276 if (rEYlowd)
for (i=0; i<
N; i++) rEYlowd[i] = -rEYlowd[i];
4277 if (rEYhighd)
for (i=0; i<
N; i++) rEYhighd[i] = -rEYhighd[i];
4280 if (rEXlowd)
for (i=0; i<
N; i++) rEXlowd[i] = -rEXlowd[i];
4281 if (rEXhighd)
for (i=0; i<
N; i++) rEXhighd[i] = -rEXhighd[i];
4286 delete theReversedGraph;
4305 Int_t optionAxis, optionSkipCol;
4310 if (opt.
Contains(
"A")) optionAxis = 1;
else optionAxis = 0;
4311 if (opt.
Contains(
"SKIPCOL")) optionSkipCol = 1;
else optionSkipCol = 0;
4313 double *theX = theGraph->
GetX();
4314 double *theY = theGraph->
GetY();
4315 int n = theGraph->
GetN();
4316 double *theColor = theScatter->
GetColor();
4317 double *theSize = theScatter->
GetSize();
4325 double minc = 0, maxc = 0., mins = 0., maxs = 0.;
4338 if (theX[0] == 0.) {
4348 if (theY[0] == 0.) {
4359 if (theColor[0] == 0.) {
4364 minc = theColor[0] -
d;
4365 maxc = theColor[0] +
d;
4371 if (theSize[0] == 0.) {
4376 mins = theSize[0] -
d;
4377 maxs = theSize[0] +
d;
4386 if (
h->GetMinimum() <
h->GetMaximum()) {
4387 if (minc<h->GetMinimum()) minc =
h->GetMinimum();
4388 if (maxc>
h->GetMaximum()) maxc =
h->GetMaximum();
4390 Error(
"PaintScatter",
"Minimal (%g) and Maximal (%g) values of the internal histogram are not valid",
h->GetMinimum(),
h->GetMaximum());
4402 functions->
Remove(palette);
4403 delete palette; palette =
nullptr;
4407 functions->
Remove(palette);
4408 delete palette; palette =
nullptr;
4429 palette->
SetTitle(
h->GetZaxis()->GetTitle());
4435 if (palette) palette->
Paint();
4439 TIter next(
gPad->GetListOfPrimitives());
4443 double *ColorInPad = s->
GetColor();
4450 double *SizeInPad = s->
GetSize();
4462 int logx =
gPad->GetLogx();
4463 int logy =
gPad->GetLogy();
4464 int logz =
gPad->GetLogz();
4465 if (theColor && logz) {
4466 if (minc>0) minc = log10(minc);
4467 if (maxc>0) maxc = log10(maxc);
4470 theScatter->TAttMarker::Modify();
4473 for (
int i=0; i<
n; i++) {
4476 if (theColor[i]>0)
c = log10(theColor[i]);
4482 if (optionSkipCol)
continue;
4486 if (optionSkipCol)
continue;
4490 if (nc > nbcol-1) nc = nbcol-1;
4494 ms = (MaxMarkerSize-MinMarkerSize)*((theSize[i]-mins)/(maxs-mins))+MinMarkerSize;
4497 if (theColor || theSize) theScatter->TAttMarker::Modify();
4499 if (theX[i]>0)
x = log10(theX[i]);
4505 if (theY[i]>0)
y = log10(theY[i]);
4510 gPad->PaintPolyMarker(1,&
x,&
y);
4523 Int_t optionSAME = 0, optionSkipCol = 0, optionLOGC = 1, optionLOGS = 0, optionP = 0;
4551 double *theX = theGraph->
GetX();
4552 double *theY = theGraph->
GetY();
4553 double *theZ = theGraph->
GetZ();
4554 int n = theGraph->
GetN();
4555 double *theColor = theScatter->
GetColor();
4556 double *theSize = theScatter->
GetSize();
4560 double minc = 0, maxc = 0., mins = 0., maxs = 0.;
4574 if (theColor[0] == 0.) {
4579 minc = theColor[0] -
d;
4580 maxc = theColor[0] +
d;
4586 if (theSize[0] == 0.) {
4591 mins = theSize[0] -
d;
4592 maxs = theSize[0] +
d;
4611 functions->
Remove(palette);
4612 delete palette; palette =
nullptr;
4616 functions->
Remove(palette);
4617 delete palette; palette =
nullptr;
4631 palette->
SetLog(optionLOGC);
4646 if (palette && scTitle.
CountChar(
';') == 4) {
4647 auto pos = scTitle.
Last(
';') + 1;
4648 auto cTitle = scTitle(pos, scTitle.
Length() - pos);
4651 if (palette && !optionP) palette->
Paint();
4655 TIter next(
gPad->GetListOfPrimitives());
4659 if (opt2.
Contains(
"LOGC")) optionLOGC = 2;
4660 else optionLOGC = 1;
4661 if (opt2.
Contains(
"LOGS")) optionLOGS = 1;
4662 else optionLOGS = 0;
4664 double *ColorInPad = s2->
GetColor();
4671 double *SizeInPad = s2->
GetSize();
4683 int logx =
gPad->GetLogx();
4684 int logy =
gPad->GetLogy();
4685 int logz =
gPad->GetLogz();
4687 if (optionLOGC == 2) logc =1;
4688 if (theColor && logc) {
4689 if (minc>0) minc = log10(minc);
4690 if (maxc>0) maxc = log10(maxc);
4692 if (theSize && optionLOGS) {
4693 if (mins>0) mins = log10(mins);
4694 if (maxs>0) maxs = log10(maxs);
4697 theScatter->TAttMarker::Modify();
4698 double x,
y,z,
c,s,ms;
4700 for (
Int_t i = 0; i <
n; i++) {
4704 if (theColor[i]>0)
c = log10(theColor[i]);
4710 if (optionSkipCol)
continue;
4714 if (optionSkipCol)
continue;
4718 if (nc > nbcol-1) nc = nbcol-1;
4723 if (theSize[i]>0) s = log10(theSize[i]);
4728 ms = (MaxMarkerSize-MinMarkerSize)*((s-mins)/(maxs-mins))+MinMarkerSize;
4731 theScatter->TAttMarker::Modify();
4733 if (theX[i]>0)
x = log10(theX[i]);
4739 if (theY[i]>0)
y = log10(theY[i]);
4745 if (theZ[i]>0) z = log10(theZ[i]);
4750 gPad->PaintMarker3D(
x,
y, z);
4771 if (!functions)
return;
4780 obj->Paint(lnk->GetOption());
4800 std::vector<Double_t> xf(2*
n);
4801 std::vector<Double_t> yf(2*
n);
4802 std::vector<Double_t> xt(
n);
4803 std::vector<Double_t> yt(
n);
4804 Double_t x1,
x2,
y1,
y2, x3, y3, xm, ym,
a, a1, a2, a3;
4807 Int_t ix1,iy1,ix2,iy2;
4811 gPad->GetPadPar(x1p,y1p,x2p,y2p);
4812 ix1 = (
Int_t)(iw*x1p);
4813 iy1 = (
Int_t)(ih*y1p);
4814 ix2 = (
Int_t)(iw*x2p);
4815 iy2 = (
Int_t)(ih*y2p);
4827 gPad->GetRange(rx1,ry1,rx2,ry2);
4828 Double_t rx = (x2ndc-x1ndc)/(rx2-rx1);
4829 Double_t ry = (y2ndc-y1ndc)/(ry2-ry1);
4833 xf[0] = rx*(
x[0]-rx1)+x1ndc;
4834 yf[0] = ry*(
y[0]-ry1)+y1ndc;
4836 for (i=1; i<
n; i++) {
4837 if (
x[i]==
x[i-1] &&
y[i]==
y[i-1])
continue;
4839 xf[nf] = rx*(
x[i]-rx1)+x1ndc;
4840 if (xf[i]==xf[i-1]) xf[i] += 0.000001;
4841 yf[nf] = ry*(
y[i]-ry1)+y1ndc;
4860 if (xf[nf]==xf[nf-1]) {
4865 if (xf[nf]>=xf[nf-1]) {
4874 for (i=1; i<nf; i++) {
4907 if ((xm-xi0)*(x3-xi0)<0 && (ym-yi0)*(y3-yi0)<0) {
4911 if ((xm==
x1) && (ym==
y1)) {
4920 if (xf[nf]==xf[0] && yf[nf]==yf[0]) {
4921 xm = (xt[nf]+xt[0])*0.5;
4922 ym = (yt[nf]+yt[0])*0.5;
4930 if ((xm-xf[0])*(x3-xf[0])<0 && (ym-yf[0])*(y3-yf[0])<0) {
4945 for (i=nf2; i>0; i--) {
4946 for (j=i-1; j>0; j--) {
4948 c1 = (yt[i-1]-yt[i])/(xt[i-1]-xt[i]);
4949 b1 = yt[i]-
c1*xt[i];
4950 c2 = (yt[j-1]-yt[j])/(xt[j-1]-xt[j]);
4951 b2 = yt[j]-
c2*xt[j];
4953 xc = (b2-b1)/(
c1-
c2);
4959 nf++; xf[nf] = xt[i]; yf[nf] = yt[i];
4960 nf++; xf[nf] = xc ; yf[nf] = yc;
4978 nf++; xf[nf] = xt[0]; yf[nf] = yt[0];
4981 for (i=0; i<nf+1; i++) {
4982 xf[i] = (1/rx)*(xf[i]-x1ndc)+rx1;
4983 yf[i] = (1/ry)*(yf[i]-y1ndc)+ry1;
4987 gPad->PaintFillArea(nf+1,xf.data(),yf.data());
4988 theGraph->TAttLine::Modify();
5001 TIter next(functions);
5002 while (
auto obj = next()) {
5012 if (!dofit) fit =
nullptr;
5014 if (dofit == 1) dofit = 111;
5016 Int_t print_fval = dofit%10;
5017 Int_t print_ferrors = (dofit/10)%10;
5018 Int_t print_fchi2 = (dofit/100)%10;
5019 Int_t print_fprob = (dofit/1000)%10;
5020 Int_t nlinesf = print_fval + print_fchi2 + print_fprob;
5023 else nlinesf += fit->
GetNpar();
5060 snprintf(textstats,50,
"#chi^{2} / ndf = %s%s / %d",
"%",stats->
GetFitFormat(),ndf);
5062 if (print_fchi2) stats->
AddText(t);
5064 snprintf(textstats,50,
"Prob = %s%s",
"%",stats->
GetFitFormat());
5068 if (print_fval || print_ferrors) {
5072 if (print_fval < 2 && parmin*parmax != 0 && parmin >= parmax)
continue;
5073 if (print_ferrors) {
5086 if (!done) functions->
Add(stats);
5116 Int_t i, k, kp, km, npointsMax, banksize, n2, npt;
5117 Int_t maxiterations, finished;
5118 Int_t jtype, ktype, closed;
5119 Double_t sxmin, sxmax, symin, symax;
5122 Double_t ratio_signs, xratio, yratio;
5128 Double_t co, so, ct, st, ctu, stu, xnt;
5129 Double_t dx1, dy1, dx2, dy2, dk1, dk2;
5136 c = t = co = so = ct = st = ctu = stu = dx1 = dy1 = dx2 = dy2 = 0;
5137 xt = yt = xa = xb = ya = yb = u1 = u2 = u3 = tj = sb = 0;
5139 npointsMax = npoints*10;
5143 std::vector<Double_t> qlx(npointsMax);
5144 std::vector<Double_t> qly(npointsMax);
5145 if (qlx.empty() || qly.empty()) {
5146 Error(
"Smooth",
"not enough space in memory");
5153 jtype = (drawtype%1000)-10;
5154 if (jtype > 0) { ktype = jtype; loptx =
kTRUE; }
5155 else ktype = drawtype%1000;
5184 for (i=1;i<npoints;i++) {
5186 if ((
x[i]-
x[i-1])*(
x[i-1]-
x[i-2]) < 0) six++;
5187 if ((
y[i]-
y[i-1])*(
y[i-1]-
y[i-2]) < 0) siy++;
5189 if (
x[i] < sxmin) sxmin =
x[i];
5190 if (
x[i] > sxmax) sxmax =
x[i];
5191 if (
y[i] < symin) symin =
y[i];
5192 if (
y[i] > symax) symax =
y[i];
5197 if (dx1n < 0.01*(sxmax-sxmin) && dy1n < 0.01*(symax-symin)) closed = 1;
5198 if (sxmin == sxmax) {
5201 if (six > 1) ratio_signs = siy/six;
5202 else ratio_signs = 20;
5203 xratio = ratio_signs/(sxmax-sxmin);
5205 if (symin == symax) yratio = 1;
5206 else yratio = 1/(symax-symin);
5210 for (i=0;i<npoints;i++) {
5211 x[i] = (
x[i]-sxmin)*xratio;
5212 y[i] = (
y[i]-symin)*yratio;
5231 if (
x[0] !=
x[npoints-1] ||
y[0] !=
y[npoints-1])
goto L40;
5232 if (
x[npoints-2] ==
x[npoints-1] &&
y[npoints-2] ==
y[npoints-1])
goto L40;
5233 if (
x[0] ==
x[1] &&
y[0] ==
y[1])
goto L40;
5256 if (npt > 1)
goto L310;
5260 if (
x[k-1] ==
x[k-2] &&
y[k-1] ==
y[k-2])
goto L50;
5265 if (npt > 1)
goto L310;
5268 if (k < npoints)
goto L90;
5269 if (!flgic) { kp = 2;
goto L130;}
5272 if (flgis)
goto L150;
5282 if (
x[k-1] ==
x[k] &&
y[k-1] ==
y[k])
goto L80;
5290 if (!flgis)
goto L50;
5305 dx1 =
x[k-1] -
x[km-1];
5306 dy1 =
y[k-1] -
y[km-1];
5307 dk1 = dx1*dx1 + dy1*dy1;
5308 dx2 =
x[kp-1] -
x[k-1];
5309 dy2 =
y[kp-1] -
y[k-1];
5310 dk2 = dx2*dx2 + dy2*dy2;
5311 ctu = dx1*dk2 + dx2*dk1;
5312 stu = dy1*dk2 + dy2*dk1;
5313 xnt = ctu*ctu + stu*stu;
5327 if (flgis)
goto L160;
5331 w3 = 2*(dx1*dy2-dx2*dy1);
5343 w3 = 2*(dx1*dy2-dx2*dy1);
5352 if (k <= 1)
goto L120;
5382 xa = (
a*t-2*dx)/tcube;
5383 xb = (3*dx-(co+
a)*t)/tsquare;
5384 ya = (
b*t-2*dy)/tcube;
5385 yb = (3*dy-(so+
b)*t)/tsquare;
5416 p2 = (u1*tj-u3)*3*tj+u2;
5446 z = s*sth*(s-s*sth)*(w1*sth+w1+w2);
5447 z = z*z/((
a*
a+
b*
b)*(delta*delta));
5448 z = (z+2.642937)*z/((.3715652*z+3.063444)*z+.2441889)-cc;
5452 if (iw > 0)
goto L250;
5453 if (z > err)
goto L240;
5458 if (iw+2 == 0)
goto L190;
5459 if (iw+2 > 0)
goto L290;
5477 theGraph->
Zero(kp,0,sb,err,s,z,maxiterations);
5478 if (kp == 2)
goto L210;
5480 Error(
"Smooth",
"Attempt to plot outside plot limits");
5483 if (iw > 0)
goto L200;
5509 qlx[npt] = sxmin + xt/xratio;
5510 qly[npt] = symin + yt/yratio;
5517 if (npt < banksize)
goto L320;
5518 if (drawtype >= 1000 || ktype > 1) {
5519 Int_t newsize = banksize + n2;
5520 std::vector<Double_t> qtemp(banksize);
5521 for (i=0;i<banksize;i++) qtemp[i] = qlx[i];
5522 qlx.resize(newsize);
5523 for (i=0;i<banksize;i++) qlx[i] = qtemp[i];
5524 for (i=0;i<banksize;i++) qtemp[i] = qly[i];
5525 qly.resize(newsize);
5526 for (i=0;i<banksize;i++) qly[i] = qtemp[i];
5534 if (drawtype >= 1000) {
5535 gPad->PaintFillArea(npt,qlx.data(),qly.data(),
"B");
5539 qlx[npt] = qlx[npt-1];
5540 qlx[npt+1] = qlx[0];
5546 qly[npt] = qly[npt-1];
5547 qly[npt+1] = qly[0];
5549 gPad->PaintFillArea(npt+2,qlx.data(),qly.data());
5552 gPad->PaintPolyLine(npt,qlx.data(),qly.data());
5555 qlx[0] = sxmin + xt/xratio;
5556 qly[0] = symin + yt/yratio;
5558 if (finished > 0)
goto L390;
5559 if (finished < 0) { finished = 0;
goto L110;}
5560 if (s > 0)
goto L180;
5566 for (i=0;i<npoints;i++) {
5567 x[i] = sxmin +
x[i]/xratio;
5568 y[i] = symin +
y[i]/yratio;
const Int_t kMaxPixel
Max value for an int.
int Int_t
Signed integer 4 bytes (int)
char Char_t
Character 1 byte (char)
float Float_t
Float 4 bytes (float)
double Double_t
Double 8 bytes.
constexpr Ssiz_t kNPOS
The equivalent of std::string::npos for the ROOT class TString.
const char Option_t
Option string (const char)
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h offset
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t wmin
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t r
Option_t Option_t TPoint TPoint const char x2
Option_t Option_t TPoint TPoint const char x1
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void xpos
Option_t Option_t TPoint TPoint const char y2
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void ypos
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t wmax
Option_t Option_t TPoint TPoint const char y1
static Int_t gHighlightPoint
static TGraph * gHighlightGraph
static std::unique_ptr< TMarker > gHighlightMarker
R__EXTERN TStyle * gStyle
Draw all kinds of Arrows.
virtual Color_t GetLabelColor() const
virtual 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 ModifyOn(TVirtualPad &pad)
Change current line attributes on specified pad.
virtual void SetLineColor(Color_t lcolor)
Set the line color.
virtual Style_t GetLineStyle() const
Return the line style.
Int_t DistancetoLine(Int_t px, Int_t py, Double_t xp1, Double_t yp1, Double_t xp2, Double_t yp2)
Compute distance from point px,py to a line.
virtual Style_t GetMarkerStyle() const
Return the marker style.
virtual Color_t GetMarkerColor() const
Return the marker color.
virtual Size_t GetMarkerSize() const
Return the marker size.
virtual void SetMarkerStyle(Style_t mstyle=1)
Set the marker style.
virtual void SetMarkerSize(Size_t msize=1)
Set the marker size.
virtual void SetMarkerColor(Color_t mcolor=1)
Set the marker color.
static Style_t GetMarkerStyleBase(Style_t style)
Internal helper function that returns the corresponding marker style with line width 1 for the given ...
Float_t GetLeftMargin() const
Float_t GetBottomMargin() const
Float_t GetRightMargin() const
Float_t GetTopMargin() const
virtual void SetTextAlign(Short_t align=11)
Set the text alignment.
virtual void SetTextColor(Color_t tcolor=1)
Set the text color.
virtual void SetTextFont(Font_t tfont=62)
Set the text font.
virtual void SetTextSize(Float_t tsize=1)
Set the text size.
Bool_t GetMoreLogLabels() const
virtual void SetLimits(Double_t xmin, Double_t xmax)
virtual Int_t GetNDF() const
Return the number of degrees of freedom in the fit the fNDF parameter has been previously computed du...
virtual void GetParLimits(Int_t ipar, Double_t &parmin, Double_t &parmax) const
Return limits for parameter ipar.
virtual Double_t GetParError(Int_t ipar) const
Return value of parameter number ipar.
Double_t GetChisquare() const
Return the Chisquare after fitting. See ROOT::Fit::FitResult::Chi2()
virtual Int_t GetNpar() const
virtual Int_t GetNumberFreeParameters() const
Return the number of free parameters.
virtual const char * GetParName(Int_t ipar) const
virtual Double_t GetParameter(Int_t ipar) const
virtual void PaintAxis(Double_t xmin, Double_t ymin, Double_t xmax, Double_t ymax, Double_t &wmin, Double_t &wmax, Int_t &ndiv, Option_t *chopt="", Double_t gridlength=0, Bool_t drawGridOnly=kFALSE)
Control function to draw an axis.
void SetLabelFont(Int_t labelfont)
void SetLabelOffset(Float_t labeloffset)
void SetLabelColor(Int_t labelcolor)
void SetTickLength(Float_t ticklength)
virtual void SetMoreLogLabels(Bool_t more=kTRUE)
Set the kMoreLogLabels bit flag.
void SetTickSize(Float_t ticksize)
void Paint(Option_t *chopt="") override
Draw this axis with its current attributes.
void SetLabelSize(Float_t labelsize)
Graphics object made of three arrays X, Y and Z with the same number of points each.
TAxis * GetZaxis() const
Get z axis of the graph.
void SetTitle(const char *title="") override
Sets the 2D graph title.
TList * GetListOfFunctions() const
void Paint(Option_t *option="") override
Paints this 2D graph with its current attributes.
Double_t * GetEX() const override
Double_t * GetEY() const override
TGraphInteractive(Int_t sz=0, Bool_t opaque=kTRUE, Bool_t cutg=kFALSE)
std::vector< Double_t > drawY
void PaintInteractive(TVirtualPad &parent, Int_t px, Int_t py)
std::vector< Double_t > drawX
void AdjustRange(TVirtualPad &parent)
Int_t FindPoint(TVirtualPad &parent, TGraph *gr, Int_t px, Int_t py, Bool_t set_d=kFALSE)
void RecalculatePoints(TVirtualPad &parent, Int_t px, Int_t py, Double_t *resX, Double_t *resY)
TGraph with asymmetric error bars and multiple y error dimensions.
void PaintGraphPolar(TGraph *theGraph, Option_t *option)
Paint this TGraphPolar with its current attributes.
void PaintGraph(TGraph *theGraph, Int_t npoints, const Double_t *x, const Double_t *y, Option_t *chopt) override
Control function to draw a graph.
void PaintGraphErrors(TGraph *theGraph, Option_t *option)
Paint this TGraphErrors with its current attributes.
void PaintGraphAsymmErrors(TGraph *theGraph, Option_t *option)
Paint this TGraphAsymmErrors with its current attributes.
void PaintGraphMultiErrors(TGraph *theGraph, Option_t *option)
Paint this TGraphMultiErrors with its current attributes.
virtual void PaintHighlightPoint(TGraph *theGraph, Option_t *option)
Paint highlight point as TMarker object (open circle)
void PaintGraphReverse(TGraph *theGraph, Option_t *option)
Paint theGraph reverting values along X and/or Y axis. a new graph is created.
void PaintGrapHist(TGraph *theGraph, Int_t npoints, const Double_t *x, const Double_t *y, Option_t *chopt) override
This is a service method used by THistPainter to paint 1D histograms.
void PaintScatter2D(TScatter2D *theScatter, Option_t *option) override
Paint a scatter plot.
static Int_t fgMaxPointsPerLine
Number of points per chunks' line when drawing a graph.
void PaintStats(TGraph *theGraph, TF1 *fit) override
Paint the statistics box with the fit info.
void PaintPolyLineHatches(TGraph *theGraph, Int_t n, const Double_t *x, const Double_t *y)
Paint a polyline with hatches on one side showing an exclusion zone.
void DrawPanelHelper(TGraph *theGraph) override
Display a panel with all histogram drawing options.
char * GetObjectInfoHelper(TGraph *theGraph, Int_t px, Int_t py) const override
void ExecuteEventHelper(TGraph *theGraph, Int_t event, Int_t px, Int_t py) override
Execute action corresponding to one event.
virtual void HighlightPoint(TGraph *theGraph, Int_t hpoint, Int_t distance)
Check on highlight point.
void ComputeLogs(Int_t npoints, Int_t opt)
Compute the logarithm of variables gxwork and gywork according to the value of Options and put the re...
std::vector< Double_t > gxworkl
Int_t DistancetoPrimitiveHelper(TGraph *theGraph, Int_t px, Int_t py) override
Compute distance from point px,py to a graph.
std::vector< Double_t > gxwork
std::vector< Double_t > gywork
void PaintScatter(TScatter *theScatter, Option_t *option) override
Paint a scatter plot.
void Smooth(TGraph *theGraph, Int_t npoints, Double_t *x, Double_t *y, Int_t drawtype)
Smooth a curve given by N points.
std::vector< Double_t > gyworkl
Internal buffers for coordinates. Used for graphs painting.
void SetHighlight(TGraph *theGraph) override
Set highlight (enable/disable) mode for theGraph.
virtual Int_t GetHighlightPoint(TGraph *theGraph) const
Return the highlighted point for theGraph.
void PaintGraphSimple(TGraph *theGraph, Option_t *option)
Paint a simple graph, without errors bars.
void PaintGraphQQ(TGraph *theGraph, Option_t *option)
Paint this graphQQ. No options for the time being.
~TGraphPainter() override
Destructor.
static void SetMaxPointsPerLine(Int_t maxp=50)
Static function to set fgMaxPointsPerLine for graph painting.
void PaintGraphBentErrors(TGraph *theGraph, Option_t *option)
Paint this TGraphBentErrors with its current attributes.
TGraphPainter()
Default constructor.
void PaintHelper(TGraph *theGraph, Option_t *option) override
Paint a any kind of TGraph.
Double_t * GetYpol()
Return points in polar coordinates.
TGraphPolargram * GetPolargram()
void SetPolargram(TGraphPolargram *p)
Double_t * GetXpol()
Return points in polar coordinates.
TGraphPolargram * CreatePolargram(const char *opt)
Create polargram object for given draw options.
void PaintCircle(Double_t x, Double_t y, Double_t r, Double_t phimin, Double_t phimax, Double_t theta)
This is simplified from TEllipse::PaintEllipse.
void Draw(Option_t *options="") override
Draw Polargram.
This class allows to draw quantile-quantile plots.
A TGraph is an object made of two arrays X and Y with npoints each.
virtual Double_t * GetEXhighd() const
virtual Bool_t IsEditable() const
@ kClipFrame
Clip to the frame boundary.
@ kNoStats
Don't draw stats box.
Double_t GetMinimum() const
virtual Double_t * GetEYlow() const
virtual Double_t * GetEX() const
Double_t GetMaximum() const
virtual Double_t * GetEXlowd() const
virtual void ComputeRange(Double_t &xmin, Double_t &ymin, Double_t &xmax, Double_t &ymax) const
Compute the x/y range of the points in this graph.
virtual Double_t * GetEYlowd() const
void Zero(Int_t &k, Double_t AZ, Double_t BZ, Double_t E2, Double_t &X, Double_t &Y, Int_t maxiterations)
Find zero of a continuous function.
TList * GetListOfFunctions() const
virtual Bool_t IsHighlight() const
virtual Double_t * GetEYhighd() const
TAxis * GetXaxis() const
Get x axis of the graph.
virtual Double_t * GetEXhigh() const
virtual Double_t * GetEYhigh() const
TAxis * GetYaxis() const
Get y axis of the graph.
virtual TH1F * GetHistogram() const
Returns a pointer to the histogram used to draw the axis Takes into account the two following cases.
virtual Double_t * GetEY() const
virtual Double_t * GetEXlow() const
virtual void SetHistogram(TH1F *h)
Set the histogram underlying the TGraph. This transfers the ownership of h to the TGraph....
virtual Int_t GetPoint(Int_t i, Double_t &x, Double_t &y) const
Get x and y values for point number i.
1-D histogram with a float per channel (see TH1 documentation)
virtual void SetDirectory(TDirectory *dir)
By default, when a histogram is created, it is added to the list of histogram objects in the current ...
Int_t DistancetoPrimitive(Int_t px, Int_t py) override
Compute distance from point px,py to a line.
virtual Double_t GetMinimumStored() const
@ kNoTitle
Don't draw the histogram title.
@ kNoStats
Don't draw stats box.
virtual Double_t GetMaximum(Double_t maxval=FLT_MAX) const
Return maximum value smaller than maxval of bins in the range, unless the value has been overridden b...
virtual void SetMaximum(Double_t maximum=-1111)
virtual Int_t GetNdivisions(Option_t *axis="X") const
Return the number of divisions for "axis".
virtual void SetMinimum(Double_t minimum=-1111)
void Paint(Option_t *option="") override
Control routine to paint any kind of histograms.
virtual Double_t GetMaximumStored() const
virtual 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.
2-D histogram with a float per channel (see TH1 documentation)
To draw Mathematical Formula.
Use the TLine constructor to create a simple line.
virtual void PaintLine(Double_t x1, Double_t y1, Double_t x2, Double_t y2)
Draw this line with new coordinates.
TObject * FindObject(const char *name) const override
Find an object in this list using its name.
void Add(TObject *obj) override
TObject * Remove(TObject *obj) override
Remove object from the list.
TObject * First() const override
Return the first object in the list. Returns 0 when list is empty.
virtual TObjLink * FirstLink() const
void AddFirst(TObject *obj) override
Add object at the beginning of the list.
TObject * Clone(const char *newname="") const override
Make a clone of an object using the Streamer facility.
void Copy(TObject &named) const override
Copy this to obj.
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
const char * GetTitle() const override
Returns title of object.
TObject * GetObject() const
Mother of all ROOT objects.
virtual const char * GetName() const
Returns name of object.
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
virtual Option_t * GetDrawOption() const
Get option used by the graphics system to draw this object.
virtual TObject * FindObject(const char *name) const
Must be redefined in derived classes.
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
virtual const char * GetTitle() const
Returns title of object.
@ kCannotPick
if object in a pad cannot be picked
@ kCanDelete
if object in a list can be deleted
@ kMustCleanup
if object destructor must call RecursiveRemove()
The palette painting class.
void Paint(Option_t *option="") override
Paint the palette.
virtual void SetNdivisions(Int_t ndiv=10)
virtual void SetTitle(const char *title="")
virtual void SetTitleColor(Int_t color=1)
virtual void SetLabelFont(Int_t font=42)
virtual void SetLabelOffset(Float_t offset=0.005)
virtual void SetTitleOffset(Float_t offset=1)
virtual void SetLabelColor(Int_t color=1)
virtual void SetTitleFont(Int_t font=42)
virtual void SetTitleSize(Float_t size=0.035)
virtual void SetLabelSize(Float_t size=0.035)
The histogram statistics painter class.
virtual void SetStatFormat(const char *format="6.4g")
Change (i.e. set) the format for printing statistics.
void SetOptStat(Int_t stat=1)
Set the stat option.
virtual const char * GetFitFormat() const
virtual void SetFitFormat(const char *format="5.4g")
Change (i.e. set) the format for printing fit parameters in statistics box.
Int_t GetOptFit() const
Return the fit option.
void SetParent(TObject *obj) override
void SetOptFit(Int_t fit=1)
Set the fit option.
void Paint(Option_t *option="") override
Paint the pave stat.
A Pave (see TPave) with text, lines or/and boxes inside.
virtual TText * AddText(Double_t x1, Double_t y1, const char *label)
Add a new Text line to this pavetext at given coordinates.
void Clear(Option_t *option="") override
Clear all lines in this pavetext.
void Draw(Option_t *option="") override
Draw this pavetext with its current attributes.
void Paint(Option_t *option="") override
Paint this pavetext with its current attributes.
virtual TText * GetLine(Int_t number) const
Get Pointer to line number in this pavetext.
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 GetX1NDC() const
virtual void SetX2NDC(Double_t x2)
Regular expression class.
A TScatter2D is able to draw five variables scatter plot on a single plot.
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.
A TScatter is able to draw four variables scatter plot on a single plot.
TGraph * GetGraph() const
Get the graph holding X and Y positions.
Double_t GetMaxMarkerSize() const
Get the largest marker size used to paint the markers.
Double_t * GetSize() const
Get the array of marker sizes.
TH2F * GetHistogram() const
Get the graph histogram used for drawing axis.
Double_t * GetColor() const
Get the array of colors.
Double_t GetMinMarkerSize() const
Get the smallest marker size used to paint the markers.
TString Copy() const
Copy a string.
void ToLower()
Change string to lower-case.
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)
Ssiz_t Last(char c) const
Find last occurrence of a character c.
void ToUpper()
Change string to upper case.
Int_t CountChar(Int_t c) const
Return number of times character c occurs in the string.
TString & Append(const char *cs)
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Color_t GetLabelColor(Option_t *axis="X") const
Return the label color number in the axis.
Color_t GetStatTextColor() const
Float_t GetTitleX() const
Int_t GetOptTitle() const
Int_t GetNdivisions(Option_t *axis="X") const
Return number of divisions.
Float_t GetStatFontSize() const
Float_t GetBarOffset() const
Float_t GetLabelSize(Option_t *axis="X") const
Return label size.
Float_t GetTickLength(Option_t *axis="X") const
Return tick length.
Style_t GetLabelFont(Option_t *axis="X") const
Return label font.
Float_t GetTitleY() const
Style_t GetTitleFont(Option_t *axis="X") const
Return title font.
Color_t GetTitleFillColor() const
Style_t GetTitleStyle() const
Float_t GetLabelOffset(Option_t *axis="X") const
Return label offset.
Color_t GetStatColor() const
Float_t GetBarWidth() const
void SetDrawBorder(Int_t drawborder=1)
Width_t GetTitleBorderSize() const
Int_t GetColorPalette(Int_t i) const
Return color number i in current palette.
Float_t GetEndErrorSize() const
Int_t GetDrawBorder() const
Width_t GetStatBorderSize() const
Color_t GetTitleTextColor() const
Float_t GetTitleH() const
Style_t GetStatStyle() const
const char * GetFitFormat() const
const char * GetStatFormat() const
Int_t GetNumberOfColors() const
Return number of colors in the color palette.
Style_t GetStatFont() const
Float_t GetTitleFontSize() const
Int_t GetTitleAlign() const
Color_t GetAxisColor(Option_t *axis="X") const
Return the axis color number in the axis.
Float_t GetTitleW() const
Base class for several text objects.
Abstract base class used by ROOT graphics editor.
static TVirtualPadEditor * GetPadEditor(Bool_t load=kTRUE)
Returns the pad editor dialog. Static method.
small helper class to store/restore gPad context in TPad methods
Helper class to store interactive parameters for individual objects Should be used via MakeInteractiv...
TVirtualPad is an abstract base class for the Pad and Canvas classes.
virtual Double_t PadtoX(Double_t x) const =0
virtual Int_t YtoAbsPixel(Double_t y) const =0
virtual Double_t GetUymax() const =0
virtual void PaintPolyMarker(Int_t n, Float_t *x, Float_t *y, Option_t *option="")=0
virtual Double_t AbsPixeltoX(Double_t px)=0
virtual Int_t XtoAbsPixel(Double_t x) const =0
virtual void Range(Double_t x1, Double_t y1, Double_t x2, Double_t y2)=0
virtual Double_t PadtoY(Double_t y) const =0
virtual Double_t GetUxmax() const =0
virtual Double_t YtoPad(Double_t y) const =0
virtual void PaintPolyLine(Int_t n, Float_t *x, Float_t *y, Option_t *option="")=0
virtual void RangeAxis(Double_t xmin, Double_t ymin, Double_t xmax, Double_t ymax)=0
virtual Double_t XtoPad(Double_t x) const =0
virtual Double_t GetUymin() const =0
virtual Double_t GetUxmin() const =0
virtual Double_t AbsPixeltoY(Double_t py)=0
void box(Int_t pat, Double_t x1, Double_t y1, Double_t x2, Double_t y2)
Int_t Nint(T x)
Round to nearest integer. Rounds half integers to the nearest even integer.
Short_t Max(Short_t a, Short_t b)
Returns the largest of a and b.
Double_t Prob(Double_t chi2, Int_t ndf)
Computation of the probability for a certain Chi-squared (chi2) and number of degrees of freedom (ndf...
Bool_t IsInside(T xp, T yp, Int_t np, T *x, T *y)
Function which returns kTRUE if point xp,yp lies inside the polygon defined by the np points in array...
Double_t ATan(Double_t)
Returns the principal value of the arc tangent of x, expressed in radians.
constexpr Double_t PiOver2()
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.