670 if (
gPad->GetLogx()) {
671 for (i=0;i<npoints;i++) {
676 if (!opt &&
gPad->GetLogy()) {
677 for (i=0;i<npoints;i++) {
698 if (distance <= 5)
return distance;
702 const Int_t big = 9999;
703 const Int_t kMaxDiff = 10;
710 if (px <= puxmin)
return big;
711 if (py >= puymin)
return big;
712 if (px >= puxmax)
return big;
713 if (py <= puymax)
return big;
723 theX = theGraphPolar->
GetXpol();
724 theY = theGraphPolar->
GetYpol();
726 theX = theGraph->
GetX();
727 theY = theGraph->
GetY();
731 for (i=0;i<theNpoints;i++) {
732 pxp =
gPad->XtoAbsPixel(
gPad->XtoPad(theX[i]));
733 pyp =
gPad->YtoAbsPixel(
gPad->YtoPad(theY[i]));
743 if (distance < kMaxDiff)
return distance;
745 for (i=0;i<theNpoints-1;i++) {
748 if (
d < distance) distance =
d;
763 TIter next(functions);
766 if (
f->InheritsFrom(TF1::Class())) dist =
f->DistancetoPrimitive(-px,py);
767 else dist =
f->DistancetoPrimitive(px,py);
768 if (dist < kMaxDiff) {
769 gPad->SetSelected(
f);
785 Error(
"DrawPanel",
"need to draw graph first");
790 gROOT->ProcessLine(
Form(
"((TCanvas*)0x%lx)->Selected((TVirtualPad*)0x%lx,(TObject*)0x%lx,1)",
813 const Int_t kMaxDiff = 10;
814 static Bool_t middle, badcase;
815 static Int_t ipoint, pxp, pyp;
816 static Int_t px1,px2,py1,py2;
817 static Int_t pxold, pyold, px1old, py1old, px2old, py2old;
818 static Int_t dpx, dpy;
826 if (!
gPad->IsEditable())
return;
836 theGraph->TAttLine::Modify();
837 px1 =
gPad->XtoAbsPixel(
gPad->GetX1());
838 py1 =
gPad->YtoAbsPixel(
gPad->GetY1());
839 px2 =
gPad->XtoAbsPixel(
gPad->GetX2());
840 py2 =
gPad->YtoAbsPixel(
gPad->GetY2());
845 x =
new Int_t[theNpoints+1];
846 y =
new Int_t[theNpoints+1];
847 for (i=0;i<theNpoints;i++) {
848 pxp =
gPad->XtoAbsPixel(
gPad->XtoPad(theX[i]));
849 pyp =
gPad->YtoAbsPixel(
gPad->YtoPad(theY[i]));
850 if (pxp < -kMaxPixel || pxp >=
kMaxPixel ||
856 gVirtualX->DrawLine(pxp-4, pyp-4, pxp+4, pyp-4);
857 gVirtualX->DrawLine(pxp+4, pyp-4, pxp+4, pyp+4);
858 gVirtualX->DrawLine(pxp+4, pyp+4, pxp-4, pyp+4);
859 gVirtualX->DrawLine(pxp-4, pyp+4, pxp-4, pyp-4);
864 if (
d < kMaxDiff) ipoint =i;
870 if (ipoint < 0)
return;
874 px2old =
gPad->XtoAbsPixel(theX[1]);
875 py2old =
gPad->YtoAbsPixel(theY[1]);
876 }
else if (ipoint == theNpoints-1) {
877 px1old =
gPad->XtoAbsPixel(
gPad->XtoPad(theX[theNpoints-2]));
878 py1old =
gPad->YtoAbsPixel(
gPad->YtoPad(theY[theNpoints-2]));
882 px1old =
gPad->XtoAbsPixel(
gPad->XtoPad(theX[ipoint-1]));
883 py1old =
gPad->YtoAbsPixel(
gPad->YtoPad(theY[ipoint-1]));
884 px2old =
gPad->XtoAbsPixel(
gPad->XtoPad(theX[ipoint+1]));
885 py2old =
gPad->YtoAbsPixel(
gPad->YtoPad(theY[ipoint+1]));
887 pxold =
gPad->XtoAbsPixel(
gPad->XtoPad(theX[ipoint]));
888 pyold =
gPad->YtoAbsPixel(
gPad->YtoPad(theY[ipoint]));
896 for (i=0;i<theNpoints;i++) {
897 pxp =
gPad->XtoAbsPixel(
gPad->XtoPad(theX[i]));
898 pyp =
gPad->YtoAbsPixel(
gPad->YtoPad(theY[i]));
900 if (
d < kMaxDiff) middle =
kFALSE;
912 for(i=0;i<theNpoints-1;i++) {
913 gVirtualX->DrawLine(
x[i]+dpx,
y[i]+dpy,
x[i+1]+dpx,
y[i+1]+dpy);
916 if (pxp < -kMaxPixel || pxp >=
kMaxPixel ||
917 pyp < -kMaxPixel || pyp >=
kMaxPixel)
continue;
918 gVirtualX->DrawLine(pxp-4, pyp-4, pxp+4, pyp-4);
919 gVirtualX->DrawLine(pxp+4, pyp-4, pxp+4, pyp+4);
920 gVirtualX->DrawLine(pxp+4, pyp+4, pxp-4, pyp+4);
921 gVirtualX->DrawLine(pxp-4, pyp+4, pxp-4, pyp-4);
923 pxp =
x[theNpoints-1]+dpx;
924 pyp =
y[theNpoints-1]+dpy;
925 gVirtualX->DrawLine(pxp-4, pyp-4, pxp+4, pyp-4);
926 gVirtualX->DrawLine(pxp+4, pyp-4, pxp+4, pyp+4);
927 gVirtualX->DrawLine(pxp+4, pyp+4, pxp-4, pyp+4);
928 gVirtualX->DrawLine(pxp-4, pyp+4, pxp-4, pyp-4);
933 for(i=0;i<theNpoints-1;i++) {
934 gVirtualX->DrawLine(
x[i]+dpx,
y[i]+dpy,
x[i+1]+dpx,
y[i+1]+dpy);
937 if (pxp < -kMaxPixel || pxp >=
kMaxPixel ||
938 pyp < -kMaxPixel || pyp >=
kMaxPixel)
continue;
939 gVirtualX->DrawLine(pxp-4, pyp-4, pxp+4, pyp-4);
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);
944 pxp =
x[theNpoints-1]+dpx;
945 pyp =
y[theNpoints-1]+dpy;
946 gVirtualX->DrawLine(pxp-4, pyp-4, pxp+4, pyp-4);
947 gVirtualX->DrawLine(pxp+4, pyp-4, pxp+4, pyp+4);
948 gVirtualX->DrawLine(pxp+4, pyp+4, pxp-4, pyp+4);
949 gVirtualX->DrawLine(pxp-4, pyp+4, pxp-4, pyp-4);
951 if (px1old)
gVirtualX->DrawLine(px1old, py1old, pxold, pyold);
952 if (px2old)
gVirtualX->DrawLine(pxold, pyold, px2old, py2old);
953 gVirtualX->DrawLine(pxold-4, pyold-4, pxold+4, pyold-4);
954 gVirtualX->DrawLine(pxold+4, pyold-4, pxold+4, pyold+4);
955 gVirtualX->DrawLine(pxold+4, pyold+4, pxold-4, pyold+4);
956 gVirtualX->DrawLine(pxold-4, pyold+4, pxold-4, pyold-4);
963 if (px1old)
gVirtualX->DrawLine(px1old, py1old, pxold, pyold);
964 if (px2old)
gVirtualX->DrawLine(pxold, pyold, px2old, py2old);
965 gVirtualX->DrawLine(pxold-4, pyold-4, pxold+4, pyold-4);
966 gVirtualX->DrawLine(pxold+4, pyold-4, pxold+4, pyold+4);
967 gVirtualX->DrawLine(pxold+4, pyold+4, pxold-4, pyold+4);
968 gVirtualX->DrawLine(pxold-4, pyold+4, pxold-4, pyold-4);
977 dxr = dx/(1 -
gPad->GetLeftMargin() -
gPad->GetRightMargin());
978 dyr = dy/(1 -
gPad->GetBottomMargin() -
gPad->GetTopMargin());
994 for(i=0;i<theNpoints;i++) {
995 if (badcase)
continue;
996 if (
x) theX[i] =
gPad->PadtoX(
gPad->AbsPixeltoX(
x[i]+dpx));
997 if (
y) theY[i] =
gPad->PadtoY(
gPad->AbsPixeltoY(
y[i]+dpy));
1006 theX[ipoint] =
gPad->PadtoX(
gPad->AbsPixeltoX(pxold));
1007 theY[ipoint] =
gPad->PadtoY(
gPad->AbsPixeltoY(pyold));
1011 theX[theNpoints-1] = theX[0];
1012 theY[theNpoints-1] = theY[0];
1014 if (ipoint == theNpoints-1) {
1015 theX[0] = theX[theNpoints-1];
1016 theY[0] = theY[theNpoints-1];
1028 if (
gROOT->IsEscaped()) {
1042 dxr = dx/(1 -
gPad->GetLeftMargin() -
gPad->GetRightMargin());
1043 dyr = dy/(1 -
gPad->GetBottomMargin() -
gPad->GetTopMargin());
1049 ymin - dyr*
gPad->GetBottomMargin(),
1055 for(i=0;i<theNpoints;i++) {
1056 if (badcase)
continue;
1057 if (
x) theX[i] =
gPad->PadtoX(
gPad->AbsPixeltoX(
x[i]+dpx));
1058 if (
y) theY[i] =
gPad->PadtoY(
gPad->AbsPixeltoY(
y[i]+dpy));
1061 theX[ipoint] =
gPad->PadtoX(
gPad->AbsPixeltoX(pxold));
1062 theY[ipoint] =
gPad->PadtoY(
gPad->AbsPixeltoY(pyold));
1066 theX[theNpoints-1] = theX[0];
1067 theY[theNpoints-1] = theY[0];
1069 if (ipoint == theNpoints-1) {
1070 theX[0] = theX[theNpoints-1];
1071 theY[0] = theY[theNpoints-1];
1125 const Int_t kHighlightRange = 50;
1126 static Int_t distanceOld = kHighlightRange;
1129 if ((distance < kHighlightRange) && (distance < distanceOld)) {
1167 if (
gPad->GetLogx()) {
1171 if (
gPad->GetLogy()) {
1175 if ((hx < uxmin) || (hx > uxmax))
return;
1176 if ((hy < uymin) || (hy > uymax))
return;
1200 strlcpy(chopt,option,80);
1203 char *l1 = strstr(chopt,
"pfc");
1204 char *l2 = strstr(chopt,
"plc");
1205 char *l3 = strstr(chopt,
"pmc");
1206 if (l1 || l2 || l3) {
1215 char *l4 = strstr(chopt,
"rx");
1216 char *l5 = strstr(chopt,
"ry");
1223 if (theGraph->
InheritsFrom(TGraphBentErrors::Class())) {
1225 }
else if (theGraph->
InheritsFrom(TGraphQQ::Class())) {
1227 }
else if (theGraph->
InheritsFrom(TGraphAsymmErrors::Class())) {
1229 }
else if (theGraph->
InheritsFrom(TGraphMultiErrors::Class())) {
1231 }
else if (theGraph->
InheritsFrom(TGraphErrors::Class())) {
1248 if (
f->InheritsFrom(TF1::Class())) fit = (
TF1*)
f;
1250 TIter next(functions);
1252 if (
f->InheritsFrom(TF1::Class())) {
1271 gPad->PushSelectableObject(theGraph);
1273 Int_t optionLine , optionAxis , optionCurve , optionStar , optionMark;
1274 Int_t optionBar , optionR , optionOne , optionE;
1275 Int_t optionFill , optionZ , optionCurveFill, optionIAxis;
1276 Int_t i, npt, nloop;
1279 Double_t barxmin, barxmax, barymin, barymax;
1286 Error(
"PaintGraph",
"illegal number of points (%d)", npoints);
1293 if (opt.
Contains(
"L")) optionLine = 1;
else optionLine = 0;
1294 if (opt.
Contains(
"A")) optionAxis = 1;
else optionAxis = 0;
1295 if (opt.
Contains(
"C")) optionCurve = 1;
else optionCurve = 0;
1296 if (opt.
Contains(
"*")) optionStar = 1;
else optionStar = 0;
1297 if (opt.
Contains(
"P")) optionMark = 1;
else optionMark = 0;
1298 if (opt.
Contains(
"B")) optionBar = 1;
else optionBar = 0;
1299 if (opt.
Contains(
"R")) optionR = 1;
else optionR = 0;
1300 if (opt.
Contains(
"1")) optionOne = 1;
else optionOne = 0;
1301 if (opt.
Contains(
"F")) optionFill = 1;
else optionFill = 0;
1302 if (opt.
Contains(
"I")) optionIAxis = 1;
else optionIAxis = 0;
1308 if (optionLine+optionFill+optionCurve+optionStar+optionMark+optionBar+optionE == 0) {
1309 if (!chopt[0]) optionLine=1;
1315 optionCurveFill = 0;
1316 if (optionCurve && optionFill) {
1317 optionCurveFill = 1;
1322 Double_t rwxmin,rwxmax, rwymin, rwymax, maximum, minimum, dx, dy;
1325 rwxmin =
gPad->GetUxmin();
1326 rwxmax =
gPad->GetUxmax();
1327 rwymin =
gPad->GetUymin();
1328 rwymax =
gPad->GetUymax();
1331 if (minimum == -1111) {
1335 if (maximum == -1111) {
1339 uxmin =
gPad->PadtoX(rwxmin);
1340 uxmax =
gPad->PadtoX(rwxmax);
1343 theGraph->
ComputeRange(rwxmin, rwymin, rwxmax, rwymax);
1345 if (rwxmin == rwxmax) rwxmax += 1.;
1346 if (rwymin == rwymax) rwymax += 1.;
1347 dx = 0.1*(rwxmax-rwxmin);
1348 dy = 0.1*(rwymax-rwymin);
1349 uxmin = rwxmin - dx;
1350 uxmax = rwxmax + dx;
1351 minimum = rwymin - dy;
1352 maximum = rwymax + dy;
1356 if (uxmin < 0 && rwxmin >= 0) uxmin = 0.9*rwxmin;
1357 if (uxmax > 0 && rwxmax <= 0) {
1358 if (
gPad->GetLogx()) uxmax = 1.1*rwxmax;
1361 if (minimum < 0 && rwymin >= 0) minimum = 0.9*rwymin;
1362 if (maximum > 0 && rwymax <= 0) {
1366 if (minimum <= 0 && gPad->GetLogy()) minimum = 0.001*maximum;
1367 if (uxmin <= 0 && gPad->GetLogx()) {
1368 if (uxmax > 1000) uxmin = 1;
1369 else uxmin = 0.001*uxmax;
1376 char chopth[8] =
" ";
1377 if (strstr(chopt,
"x+")) strncat(chopth,
"x+",3);
1378 if (strstr(chopt,
"y+")) strncat(chopth,
"y+",3);
1379 if (optionIAxis) strncat(chopth,
"A",2);
1386 if (theNpoints > npt) npt = theNpoints;
1398 if (
gPad->GetLogy()) {
1411 rwxmin =
gPad->GetUxmin();
1412 rwxmax =
gPad->GetUxmax();
1413 rwymin =
gPad->GetUymin();
1414 rwymax =
gPad->GetUymax();
1415 uxmin =
gPad->PadtoX(rwxmin);
1416 uxmax =
gPad->PadtoX(rwxmax);
1421 maximum =
gPad->PadtoY(rwymax);
1422 minimum =
gPad->PadtoY(rwymin);
1426 theGraph->TAttLine::Modify();
1427 theGraph->TAttFill::Modify();
1428 theGraph->TAttMarker::Modify();
1436 if (optionLine || optionFill) {
1442 if (optionFill && (xn !=
x1 || yn != y1)) nloop++;
1444 for (i=1;i<=nloop;i++) {
1487 if (optionCurveFill) {
1489 if (xn !=
x1 || yn != y1) nloop++;
1493 for (i=1;i<=nloop;i++) {
1518 for (i=1;i<=nloop;i++) {
1522 if (
y[i-1] < minimum ||
y[i-1] > maximum)
continue;
1523 if (
x[i-1] < uxmin ||
x[i-1] > uxmax)
continue;
1549 for (i=1;i<=npoints;i++) {
1564 for (i=1;i<=npoints;i++) {
1581 for (i=1;i<npoints;i++) {
1582 if (
x[i] < barxmin) barxmin =
x[i];
1583 if (
x[i] > barxmax) barxmax =
x[i];
1585 bdelta = (barxmax-barxmin)/
Double_t(npoints);
1589 for (i=1;i<npoints;i++) {
1590 if (
y[i] < barymin) barymin =
y[i];
1591 if (
y[i] > barymax) barymax =
y[i];
1593 bdelta = (barymax-barymin)/
Double_t(npoints);
1597 for (i=1;i<=npoints;i++) {
1598 xlow =
x[i-1] - dbar;
1599 xhigh =
x[i-1] + dbar;
1601 if (xlow < uxmin && xhigh < uxmin)
continue;
1602 if (xhigh > uxmax && xlow > uxmax)
continue;
1603 if (xlow < uxmin) xlow = uxmin;
1604 if (xhigh > uxmax) xhigh = uxmax;
1606 else ylow =
gPad->GetUymin();
1620 for (i=1;i<=npoints;i++) {
1622 ylow =
y[i-1] - dbar;
1623 yhigh =
y[i-1] + dbar;
1676 const char *where =
"PaintGrapHist";
1678 Int_t optionLine , optionAxis , optionCurve, optionStar, optionMark;
1679 Int_t optionBar , optionRot , optionOne , optionOff ;
1680 Int_t optionFill , optionZ;
1681 Int_t optionHist , optionBins , optionMarker;
1683 Int_t drawtype=0, drawborder, drawbordersav;
1689 Double_t xi, xi1, xj, xj1, yi1, yi, yj, yj1, xwmin, ywmin;
1693 char choptaxis[10] =
" ";
1696 Error(where,
"illegal number of points (%d)", npoints);
1701 if (opt.
Contains(
"H")) optionHist = 1;
else optionHist = 0;
1702 if (opt.
Contains(
"F")) optionFill = 1;
else optionFill = 0;
1703 if (opt.
Contains(
"C")) optionCurve= 1;
else optionCurve= 0;
1704 if (opt.
Contains(
"*")) optionStar = 1;
else optionStar = 0;
1705 if (opt.
Contains(
"R")) optionRot = 1;
else optionRot = 0;
1706 if (opt.
Contains(
"1")) optionOne = 1;
else optionOne = 0;
1707 if (opt.
Contains(
"B")) optionBar = 1;
else optionBar = 0;
1708 if (opt.
Contains(
"N")) optionBins = 1;
else optionBins = 0;
1709 if (opt.
Contains(
"L")) optionLine = 1;
else optionLine = 0;
1710 if (opt.
Contains(
"P")) optionMark = 1;
else optionMark = 0;
1711 if (opt.
Contains(
"A")) optionAxis = 1;
else optionAxis = 0;
1712 if (opt.
Contains(
"][")) optionOff = 1;
else optionOff = 0;
1713 if (opt.
Contains(
"P0")) optionMark = 10;
1715 Int_t optionFill2 = 0;
1717 optionFill = 0; optionFill2 = 1;
1732 nbins = last -
first + 1;
1744 Double_t rounding = (uxmax-uxmin)*1.e-5;
1747 Int_t nx1, nx2, ndivx, ndivy, ndiv;
1760 if (ndivx < 0) strlcat(choptaxis,
"N",10);
1761 if (
gPad->GetGridx()) {
1763 strlcat(choptaxis,
"W",10);
1765 if (
gPad->GetLogx()) {
1769 strlcat(choptaxis,
"G",10);
1779 axis->
PaintAxis(rwxmin,rwymin,rwxmax,rwymin,rwmin,rwmax,ndiv,choptaxis);
1789 strlcat(choptaxis,
"N",10);
1792 if (
gPad->GetGridy()) {
1794 strlcat(choptaxis,
"W",10);
1796 if (
gPad->GetLogy()) {
1800 strlcat(choptaxis,
"G",10);
1809 axis->
PaintAxis(rwxmin,rwymin,rwxmin,rwymax,rwmin,rwmax,ndiv,choptaxis);
1815 theGraph->TAttLine::Modify();
1816 theGraph->TAttFill::Modify();
1817 theGraph->TAttMarker::Modify();
1821 if (!optionRot) {wmin =
x[0]; wmax =
x[1];}
1822 else {wmin =
y[0]; wmax =
y[1];}
1824 if (!optionBins) delta = (wmax - wmin)/
Double_t(nbins);
1826 Int_t fwidth =
gPad->GetFrameLineWidth();
1829 if (optionOff) fwidth = 1;
1845 if (optionFill && !optionCurve) {
1853 for (j=
first; j<=last;j++) {
1860 xj1 =
x[j]; xj =
x[j-1];
1862 if (j != last)
Error(where,
"X must be in increasing order");
1863 else Error(where,
"X must have N+1 values with option N");
1871 if ((
gxwork[npt-1] >= uxmin-rounding &&
gxwork[npt-1] <= uxmax+rounding) ||
1872 (
gxwork[npt] >= uxmin-rounding &&
gxwork[npt] <= uxmax+rounding)) npt += 2;
1885 if (!fillarea)
gyworkl[0] = ylast;
1896 for (j=
first; j<=last;j++) {
1901 yj1 =
y[j]; yj =
y[j-1];
1903 if (j != last)
Error(where,
"Y must be in increasing order");
1904 else Error(where,
"Y must have N+1 values with option N");
1910 if ((
gxwork[npt-1] >= uxmin-rounding &&
gxwork[npt-1] <= uxmax+rounding) ||
1911 (
gxwork[npt] >= uxmin-rounding &&
gxwork[npt] <= uxmax+rounding)) npt += 2;
1918 if (!fillarea)
gyworkl[0] = ylast;
1925 theGraph->TAttLine::Modify();
1926 theGraph->TAttFill::Modify();
1931 if ((optionHist) || !chopt[0]) {
1938 for (i=
first; i<=last;i++) {
1943 xi1 =
x[i]; xi =
x[i-1];
1945 if (i != last)
Error(where,
"X must be in increasing order");
1946 else Error(where,
"X must have N+1 values with option N");
1954 if ((
gxwork[npt-1] >= uxmin-rounding &&
gxwork[npt-1] <= uxmax+rounding) ||
1955 (
gxwork[npt] >= uxmin-rounding &&
gxwork[npt] <= uxmax+rounding)) npt += 2;
1967 Int_t nbpoints = npt-2;
1973 for (ip=point1; ip<=nbpoints; ip++) {
1980 Int_t point2 = nbpoints;
1981 for (ip=point2; ip>=point1; ip--) {
1987 nbpoints = point2-point1+1;
1991 if (
gxwork[0] >
gPad->GetUxmin()) { nbpoints++; point1 = 0; }
1992 if (
gxwork[nbpoints] <
gPad->GetUxmax()) nbpoints++;
2004 for (i=
first; i<=last;i++) {
2009 yi1 =
y[i]; yi =
y[i-1];
2011 if (i != last)
Error(where,
"Y must be in increasing order");
2012 else Error(where,
"Y must have N+1 values with option N");
2018 if ((
gxwork[npt-1] >= uxmin-rounding &&
gxwork[npt-1] <= uxmax+rounding) ||
2019 (
gxwork[npt] >= uxmin-rounding &&
gxwork[npt] <= uxmax+rounding)) npt += 2;
2038 if (!optionOne) drawtype = 2;
2043 for (i=
first; i<=last;i++) {
2048 xi1 =
x[i]; xi =
x[i-1];
2050 if (i != last)
Error(where,
"X must be in increasing order");
2051 else Error(where,
"X must have N+1 values with option N");
2054 gxwork[npt-1] =
x[i-1] + 0.5*(
x[i]-
x[i-1]);
2085 drawtype = drawtype+10;
2087 for (i=
first; i<=last;i++) {
2092 yi1 =
y[i]; yi =
y[i-1];
2094 if (i != last)
Error(where,
"Y must be in increasing order");
2095 else Error(where,
"Y must have N+1 values with option N");
2098 gywork[npt-1] =
y[i-1] + 0.5*(
y[i]-
y[i-1]);
2131 wminstep = wmin + 0.5*delta;
2133 gPad->GetRangeAxis(ax1,ay1,ax2,ay2);
2137 for (i=
first; i<=last;i++) {
2142 xi1 =
x[i]; xi =
x[i-1];
2144 if (i != last)
Error(where,
"X must be in increasing order");
2145 else Error(where,
"X must have N+1 values with option N");
2148 gxwork[npt-1] =
x[i-1] + 0.5*(
x[i]-
x[i-1]);
2150 if (
gxwork[npt-1] < uxmin ||
gxwork[npt-1] > uxmax) { npt--;
continue;}
2153 if ((
gywork[npt-1] < rwymin) || ((
gywork[npt-1] > rwymax) && !optionFill2)) {
2190 for (i=
first; i<=last;i++) {
2193 gywork[npt-1] = wminstep+(i-
first)*delta+0.5*delta;
2195 yi1 =
y[i]; yi =
y[i-1];
2197 if (i != last)
Error(where,
"Y must be in increasing order");
2198 else Error(where,
"Y must have N+1 values with option N");
2201 gywork[npt-1] =
y[i-1] + 0.5*(
y[i]-
y[i-1]);
2204 if ((
gxwork[npt-1] < uxmin) || (
gxwork[npt-1] > uxmax)) {
2226 if (optionLine != 0 && npt > 1) {
2237 offset = delta*baroffset; dbar = delta*barwidth;
2240 offset = (
x[1]-
x[0])*baroffset;
2241 dbar = (
x[1]-
x[0])*barwidth;
2243 offset = (
y[1]-
y[0])*baroffset;
2244 dbar = (
y[1]-
y[0])*barwidth;
2247 drawbordersav = drawborder;
2251 xhigh = wmin+offset+dbar;
2254 else ylow =
gPad->GetUymin();
2256 for (i=
first; i<=last;i++) {
2263 if (xlow < rwxmax && xhigh > rwxmin)
2267 xhigh = xhigh+delta;
2270 xi1 =
x[i]; xi =
x[i-1];
2272 Error(where,
"X must be in increasing order");
2275 offset = (
x[i+1]-
x[i])*baroffset;
2276 dbar = (
x[i+1]-
x[i])*barwidth;
2277 xlow =
x[i] + offset;
2278 xhigh =
x[i] + offset + dbar;
2283 ylow = wmin + offset;
2284 yhigh = wmin + offset + dbar;
2286 else xlow =
gPad->GetUxmin();
2287 for (i=
first; i<=last;i++) {
2295 gPad->PaintBox(xlow,ylow,xhigh,yhigh);
2297 ylow = ylow + delta;
2298 yhigh = yhigh + delta;
2301 yi1 =
y[i]; yi =
y[i-1];
2303 Error(where,
"Y must be in increasing order");
2306 offset = (
y[i+1]-
y[i])*baroffset;
2307 dbar = (
y[i+1]-
y[i])*barwidth;
2308 ylow =
y[i] + offset;
2309 yhigh =
y[i] + offset + dbar;
2320 if ((optionStar) || (optionMark)) optionMarker=1;
2326 for (i=
first; i<=last;i++) {
2327 if (!optionBins) xm = wmin+(i-
first)*delta+0.5*delta;
2328 else xm =
x[i-1] + 0.5*(
x[i]-
x[i-1]);
2330 if (optionMark != 10) {
2331 if (ym<rwymax && ym > rwymin) {
2337 if (ym<rwymax && ym >= rwymin) {
2354 wminstep = wmin + 0.5*delta;
2355 for (i=
first; i<=last;i++) {
2356 if (!optionBins) ym = wminstep+(i-
first)*delta+0.5*delta;
2357 else ym =
y[i-1] + 0.5*(
y[i]-
y[i-1]);
2359 if (optionMark != 10) {
2360 if (xm<rwxmax && xm > rwxmin) {
2366 if (xm<rwxmax && xm >= rwxmin) {
2407 const Int_t kBASEMARKER=8;
2408 Double_t s2x, s2y, symbolsize, sbase;
2409 Double_t x,
y, xl1, xl2, xr1, xr2, yup1, yup2, ylow1, ylow2, tx, ty;
2410 static Float_t cxx[15] = {1,1,0.6,0.6,1,1,0.6,0.5,1,0.6,0.6,1,0.6,1,1};
2411 static Float_t cyy[15] = {1,1,1,1,1,1,1,1,1,0.5,0.6,1,1,1,1};
2420 if (strchr(option,
'X') || strchr(option,
'x')) {
PaintGraphSimple(theGraph, option);
return;}
2423 if (strstr(option,
"||") || strstr(option,
"[]")) {
2425 if (strstr(option,
"[]")) braticks =
kTRUE;
2428 if (strchr(option,
'z')) endLines =
kFALSE;
2429 if (strchr(option,
'Z')) endLines =
kFALSE;
2430 const char *arrowOpt = 0;
2431 if (strchr(option,
'>')) arrowOpt =
">";
2432 if (strstr(option,
"|>")) arrowOpt =
"|>";
2435 if (strchr(option,
'a')) axis =
kTRUE;
2436 if (strchr(option,
'A')) axis =
kTRUE;
2444 if (strchr(option,
'0')) option0 =
kTRUE;
2445 if (strchr(option,
'2')) option2 =
kTRUE;
2446 if (strchr(option,
'3')) option3 =
kTRUE;
2447 if (strchr(option,
'4')) {option3 =
kTRUE; option4 =
kTRUE;}
2448 if (strchr(option,
'5')) {option2 =
kTRUE; option5 =
kTRUE;}
2451 xline =
new Double_t[2*theNpoints];
2452 yline =
new Double_t[2*theNpoints];
2453 if (!xline || !yline) {
2454 Error(
"Paint",
"too many points, out of memory");
2461 theGraph->TAttLine::Modify();
2476 sbase = symbolsize*kBASEMARKER;
2489 tx =
gPad->PixeltoX(dxend) -
gPad->PixeltoX(0);
2490 ty =-
gPad->PixeltoY(dxend) +
gPad->PixeltoY(0);
2491 Float_t asize = 0.6*symbolsize*kBASEMARKER/
gPad->GetWh();
2494 for (
Int_t i=0;i<theNpoints;i++) {
2495 x =
gPad->XtoPad(theX[i]);
2496 y =
gPad->YtoPad(theY[i]);
2499 if (x < gPad->GetUxmin())
x =
gPad->GetUxmin();
2500 if (
x >
gPad->GetUxmax())
x =
gPad->GetUxmax();
2501 if (y < gPad->GetUymin())
y =
gPad->GetUymin();
2502 if (
y >
gPad->GetUymax())
y =
gPad->GetUymax();
2504 if (x < gPad->GetUxmin())
continue;
2505 if (
x >
gPad->GetUxmax())
continue;
2506 if (y < gPad->GetUymin())
continue;
2507 if (
y >
gPad->GetUymax())
continue;
2511 xl2 =
gPad->XtoPad(theX[i] - theEXlow[i]);
2515 x1b =
gPad->XtoPad(theX[i] - theEXlow[i]);
2516 y1b =
gPad->YtoPad(theY[i] - theEYlow[i]);
2517 x2b =
gPad->XtoPad(theX[i] + theEXhigh[i]);
2518 y2b =
gPad->YtoPad(theY[i] + theEYhigh[i]);
2519 if (x1b < gPad->GetUxmin()) x1b =
gPad->GetUxmin();
2520 if (x1b >
gPad->GetUxmax()) x1b =
gPad->GetUxmax();
2521 if (y1b < gPad->GetUymin()) y1b =
gPad->GetUymin();
2522 if (y1b >
gPad->GetUymax()) y1b =
gPad->GetUymax();
2523 if (x2b < gPad->GetUxmin()) x2b =
gPad->GetUxmin();
2524 if (x2b >
gPad->GetUxmax()) x2b =
gPad->GetUxmax();
2525 if (y2b < gPad->GetUymin()) y2b =
gPad->GetUymin();
2526 if (y2b >
gPad->GetUymax()) y2b =
gPad->GetUymax();
2527 if (option5)
box.PaintBox(x1b, y1b, x2b, y2b,
"l");
2528 else box.PaintBox(x1b, y1b, x2b, y2b);
2536 yline[if1-1] =
gPad->YtoPad(theY[i] + theEYhigh[i]);
2537 yline[if2-1] =
gPad->YtoPad(theY[i] - theEYlow[i]);
2545 arrow.PaintArrow(xl1,
y,xl2,
y,asize,arrowOpt);
2547 if (!brackets)
gPad->PaintLine(xl1,
y,xl2,
y);
2550 xb[0] = xl2+tx; yb[0] =
y-ty;
2551 xb[1] = xl2; yb[1] =
y-ty;
2552 xb[2] = xl2; yb[2] =
y+ty;
2553 xb[3] = xl2+tx; yb[3] =
y+ty;
2554 gPad->PaintPolyLine(4, xb, yb);
2556 gPad->PaintLine(xl2,
y-ty,xl2,
y+ty);
2562 xr2 =
gPad->XtoPad(theX[i] + theEXhigh[i]);
2565 arrow.PaintArrow(xr1,
y,xr2,
y,asize,arrowOpt);
2567 if (!brackets)
gPad->PaintLine(xr1,
y,xr2,
y);
2570 xb[0] = xr2-tx; yb[0] =
y-ty;
2571 xb[1] = xr2; yb[1] =
y-ty;
2572 xb[2] = xr2; yb[2] =
y+ty;
2573 xb[3] = xr2-tx; yb[3] =
y+ty;
2574 gPad->PaintPolyLine(4, xb, yb);
2576 gPad->PaintLine(xr2,
y-ty,xr2,
y+ty);
2582 yup2 =
gPad->YtoPad(theY[i] + theEYhigh[i]);
2583 if (yup2 >
gPad->GetUymax()) yup2 =
gPad->GetUymax();
2586 arrow.PaintArrow(
x,yup1,
x,yup2,asize,arrowOpt);
2588 if (!brackets)
gPad->PaintLine(
x,yup1,
x,yup2);
2591 xb[0] =
x-tx; yb[0] = yup2-ty;
2592 xb[1] =
x-tx; yb[1] = yup2;
2593 xb[2] =
x+tx; yb[2] = yup2;
2594 xb[3] =
x+tx; yb[3] = yup2-ty;
2595 gPad->PaintPolyLine(4, xb, yb);
2597 gPad->PaintLine(
x-tx,yup2,
x+tx,yup2);
2603 ylow2 =
gPad->YtoPad(theY[i] - theEYlow[i]);
2604 if (ylow2 < gPad->GetUymin()) ylow2 =
gPad->GetUymin();
2605 if (ylow2 < ylow1) {
2607 arrow.PaintArrow(
x,ylow1,
x,ylow2,asize,arrowOpt);
2609 if (!brackets)
gPad->PaintLine(
x,ylow1,
x,ylow2);
2612 xb[0] =
x-tx; yb[0] = ylow2+ty;
2613 xb[1] =
x-tx; yb[1] = ylow2;
2614 xb[2] =
x+tx; yb[2] = ylow2;
2615 xb[3] =
x+tx; yb[3] = ylow2+ty;
2616 gPad->PaintPolyLine(4, xb, yb);
2618 gPad->PaintLine(
x-tx,ylow2,
x+tx,ylow2);
2632 if (option4)
PaintGraph(theGraph, 2*theNpoints, xline, yline,
"FC");
2633 else PaintGraph(theGraph, 2*theNpoints, xline, yline,
"F");
2634 gPad->SetLogx(logx);
2635 gPad->SetLogy(logy);
2646 if (!theGraph->
InheritsFrom(TGraphMultiErrors::Class())) {
2653 Int_t NYErrors = tg->GetNYErrors();
2654 if (NYErrors <= 0) {
2662 std::vector<TString> options(NYErrors + 1);
2671 while ((firstSemicolon = tsOpt.
First(
';')) !=
kNPOS && filled <= NYErrors) {
2672 options[filled] = tsOpt(0, firstSemicolon);
2673 tsOpt = tsOpt(firstSemicolon + 1, tsOpt.
Length());
2677 if (filled <= NYErrors) {
2678 options[filled] = tsOpt.
Copy();
2682 for (
Int_t i = filled; i <= NYErrors; i++)
2686 std::vector<Double_t *> yline(NYErrors);
2691 const Int_t kBASEMARKER = 8;
2692 Double_t s2x, s2y, symbolsize, sbase;
2693 Double_t x,
y, xl1, xl2, xr1, xr2, yup1, yup2, ylow1, ylow2, tx, ty;
2694 static Float_t cxx[15] = {1., 1., 0.6, 0.6, 1., 1., 0.6, 0.5, 1., 0.6, 0.6, 1., 0.6, 1., 1.};
2695 static Float_t cyy[15] = {1., 1., 1., 1., 1., 1., 1., 1., 1., 0.5, 0.6, 1., 1., 1., 1.};
2696 Int_t theNpoints = tg->GetN();
2700 Double_t *theExH = tg->GetEXhigh();
2701 std::vector<Double_t *> theEyL(NYErrors);
2702 std::vector<Double_t *> theEyH(NYErrors);
2705 for (
Int_t j = 0; j < NYErrors; j++) {
2706 theEyL[j] = tg->GetEYlow(j);
2707 theEyH[j] = tg->GetEYhigh(j);
2708 theEyExists &= (theEyL[j] && theEyH[j]);
2711 if (!theX || !theY || !theExL || !theExH || !theEyExists)
2714 std::vector<Bool_t> DrawErrors(NYErrors);
2719 std::vector<Bool_t> Braticks(NYErrors);
2720 std::vector<Bool_t> Brackets(NYErrors);
2721 std::vector<Bool_t> EndLines(NYErrors);
2722 std::vector<Char_t *> ArrowOpt(NYErrors);
2723 std::vector<Bool_t> Option5(NYErrors);
2724 std::vector<Bool_t> Option4(NYErrors);
2725 std::vector<Bool_t> Option3(NYErrors);
2727 std::vector<Bool_t> Option2(NYErrors);
2728 std::vector<Bool_t> Option0(NYErrors);
2730 std::vector<Double_t> Scale(NYErrors);
2732 const TRegexp ScaleRegExp(
"s=*[0-9]\\.*[0-9]");
2734 for (
Int_t j = 0; j < NYErrors; j++) {
2735 if (options[j + 1].Contains(
"s=")) {
2736 sscanf(strstr(options[j + 1].Data(),
"s="),
"s=%lf", &Scale[j]);
2737 options[j + 1].ReplaceAll(options[j + 1](ScaleRegExp),
"");
2741 DrawErrors[j] = !options[j + 1].Contains(
"x");
2742 AnyErrors |= DrawErrors[j];
2743 Braticks[j] = options[j + 1].Contains(
"[]");
2744 Brackets[j] = options[j + 1].Contains(
"||") || Braticks[j];
2745 EndLines[j] = !options[j + 1].Contains(
"z");
2747 if (options[j + 1].Contains(
"|>"))
2748 ArrowOpt[j] = (
Char_t *)
"|>";
2749 else if (options[j + 1].Contains(
">"))
2750 ArrowOpt[j] = (
Char_t *)
">";
2752 ArrowOpt[j] =
nullptr;
2754 Option5[j] = options[j + 1].Contains(
"5");
2755 Option4[j] = options[j + 1].Contains(
"4");
2756 Option3[j] = options[j + 1].Contains(
"3") || Option4[j];
2757 AnyOption3 |= Option3[j];
2758 Option2[j] = options[j + 1].Contains(
"2") || Option5[j];
2759 Option0[j] = options[j + 1].Contains(
"0");
2760 AnyOption0 |= Option0[j];
2762 NoErrorsX &= (Option3[j] || Option2[j]);
2763 Option0X |= !(Option3[j] || Option2[j]) && Option0[j];
2764 DrawMarker |= !(Brackets[j] || Option3[j] || Option2[j]);
2767 Bool_t Draw0PointsX = !options[0].Contains(
"x0") && (
gPad->GetLogx() == 0);
2768 Bool_t Draw0PointsY = !options[0].Contains(
"y0") && (
gPad->GetLogy() == 0);
2769 options[0].ReplaceAll(
"x0",
"");
2770 options[0].ReplaceAll(
"y0",
"");
2772 Bool_t DrawErrorsX = !options[0].Contains(
"x");
2773 Bool_t BraticksX = options[0].Contains(
"[]");
2774 Bool_t BracketsX = options[0].Contains(
"||") || BraticksX;
2775 Bool_t EndLinesX = !options[0].Contains(
"z");
2777 Char_t *ArrowOptX =
nullptr;
2778 if (options[0].Contains(
"|>"))
2779 ArrowOptX = (
Char_t *)
"|>";
2780 else if (options[0].Contains(
">"))
2781 ArrowOptX = (
Char_t *)
">";
2784 if (options[0].Contains(
"s=")) {
2785 sscanf(strstr(options[0].Data(),
"s="),
"s=%lf", &ScaleX);
2786 options[0].ReplaceAll(options[0](ScaleRegExp),
"");
2789 if (!AnyErrors && !DrawErrorsX) {
2794 Bool_t DrawAxis = options[0].Contains(
"a");
2795 Bool_t IndividualStyles = options[0].Contains(
"s");
2800 Int_t NPointsInside = AnyOption0 ? theNpoints : 0;
2802 for (
Int_t i = 0; i < theNpoints && !AnyOption0; i++) {
2803 x =
gPad->XtoPad(theX[i]);
2804 y =
gPad->YtoPad(theY[i]);
2806 if ((
x >=
gPad->GetUxmin()) && (x <= gPad->GetUxmax()) && (
y >=
gPad->GetUymin()) && (y <= gPad->GetUymax()) &&
2807 (Draw0PointsX || theX[i] != 0.) && (Draw0PointsY || theY[i] != 0.))
2812 xline =
new Double_t[2 * NPointsInside];
2815 Error(
"Paint",
"too many points, out of memory");
2820 if2 = 2 * NPointsInside;
2823 for (
Int_t j = 0; j < NYErrors; j++) {
2824 if (Option3[j] && DrawErrors[j]) {
2825 yline[j] =
new Double_t[2 * NPointsInside];
2828 Error(
"Paint",
"too many points, out of memory");
2830 for (
Int_t k = 0; k < j; k++)
2838 tg->TAttLine::Modify();
2841 arrow.SetLineWidth(tg->GetLineWidth());
2842 arrow.SetLineColor(tg->GetLineColor());
2843 arrow.SetFillColor(tg->GetFillColor());
2848 box.SetLineColor(tg->GetLineColor());
2849 box.SetFillColor(tg->GetFillColor());
2850 box.SetFillStyle(tg->GetFillStyle());
2852 symbolsize = tg->GetMarkerSize();
2853 sbase = symbolsize * kBASEMARKER;
2859 cx = cxx[
mark - 20];
2860 cy = cyy[
mark - 20];
2864 s2x =
gPad->PixeltoX(
Int_t(0.5 * sbase)) -
gPad->PixeltoX(0);
2865 s2y = -
gPad->PixeltoY(
Int_t(0.5 * sbase)) +
gPad->PixeltoY(0);
2867 tx =
gPad->PixeltoX(dxend) -
gPad->PixeltoX(0);
2868 ty = -
gPad->PixeltoY(dxend) +
gPad->PixeltoY(0);
2869 Float_t asize = 0.6 * symbolsize * kBASEMARKER /
gPad->GetWh();
2873 for (
Int_t i = 0; i < theNpoints; i++) {
2874 x =
gPad->XtoPad(theX[i]);
2875 y =
gPad->YtoPad(theY[i]);
2878 (
x <
gPad->GetUxmin()) || (
x >
gPad->GetUxmax()) || (y < gPad->GetUymin()) || (
y >
gPad->GetUymax());
2880 if ((isOutside && !AnyOption0) || (!Draw0PointsX && theX[i] == 0.) || (!Draw0PointsY && theY[i] == 0.))
2885 if (x < gPad->GetUxmin())
2886 x =
gPad->GetUxmin();
2887 if (
x >
gPad->GetUxmax())
2888 x =
gPad->GetUxmax();
2889 if (y < gPad->GetUymin())
2890 y =
gPad->GetUymin();
2891 if (
y >
gPad->GetUymax())
2892 y =
gPad->GetUymax();
2902 for (
Int_t j = 0; j < NYErrors; j++) {
2907 if (Option2[j] && (!isOutside || Option0[j])) {
2908 if (IndividualStyles) {
2909 box.SetLineWidth(tg->GetLineWidth(j));
2910 box.SetLineColor(tg->GetLineColor(j));
2911 box.SetFillColor(tg->GetFillColor(j));
2912 box.SetFillStyle(tg->GetFillStyle(j));
2915 x1b =
gPad->XtoPad(theX[i] - Scale[j] * theExL[i]);
2916 y1b =
gPad->YtoPad(theY[i] - theEyL[j][i]);
2917 x2b =
gPad->XtoPad(theX[i] + Scale[j] * theExH[i]);
2918 y2b =
gPad->YtoPad(theY[i] + theEyH[j][i]);
2919 if (x1b < gPad->GetUxmin())
2920 x1b =
gPad->GetUxmin();
2921 if (x1b >
gPad->GetUxmax())
2922 x1b =
gPad->GetUxmax();
2923 if (y1b < gPad->GetUymin())
2924 y1b =
gPad->GetUymin();
2925 if (y1b >
gPad->GetUymax())
2926 y1b =
gPad->GetUymax();
2927 if (x2b < gPad->GetUxmin())
2928 x2b =
gPad->GetUxmin();
2929 if (x2b >
gPad->GetUxmax())
2930 x2b =
gPad->GetUxmax();
2931 if (y2b < gPad->GetUymin())
2932 y2b =
gPad->GetUymin();
2933 if (y2b >
gPad->GetUymax())
2934 y2b =
gPad->GetUymax();
2936 box.PaintBox(x1b, y1b, x2b, y2b,
"l");
2938 box.PaintBox(x1b, y1b, x2b, y2b);
2943 if (!isOutside || Option0[j]) {
2944 yline[j][if1 - 2] =
gPad->YtoPad(theY[i] + theEyH[j][i]);
2945 yline[j][if2] =
gPad->YtoPad(theY[i] - theEyL[j][i]);
2947 yline[j][if1 - 2] =
gPad->GetUymin();
2948 yline[j][if2] =
gPad->GetUymin();
2952 if (IndividualStyles) {
2953 tg->GetAttLine(j)->Modify();
2955 arrow.SetLineWidth(tg->GetLineWidth(j));
2956 arrow.SetLineColor(tg->GetLineColor(j));
2957 arrow.SetFillColor(tg->GetFillColor(j));
2960 ylow1 =
y - s2y * cy;
2961 ylow2 =
gPad->YtoPad(theY[i] - theEyL[j][i]);
2962 if (ylow2 < gPad->GetUymin())
2963 ylow2 =
gPad->GetUymin();
2964 if (ylow2 < ylow1 && DrawErrors[j] && !Option2[j] && !Option3[j] && (!isOutside || Option0[j])) {
2966 arrow.PaintArrow(
x, ylow1,
x, ylow2, asize, ArrowOpt[j]);
2969 gPad->PaintLine(
x, ylow1,
x, ylow2);
2980 gPad->PaintPolyLine(4, xb, yb);
2982 gPad->PaintLine(
x - tx, ylow2,
x + tx, ylow2);
2987 yup1 =
y + s2y * cy;
2988 yup2 =
gPad->YtoPad(theY[i] + theEyH[j][i]);
2989 if (yup2 >
gPad->GetUymax())
2990 yup2 =
gPad->GetUymax();
2991 if (yup2 > yup1 && DrawErrors[j] && !Option2[j] && !Option3[j] && (!isOutside || Option0[j])) {
2993 arrow.PaintArrow(
x, yup1,
x, yup2, asize, ArrowOpt[j]);
2996 gPad->PaintLine(
x, yup1,
x, yup2);
3007 gPad->PaintPolyLine(4, xb, yb);
3009 gPad->PaintLine(
x - tx, yup2,
x + tx, yup2);
3016 if (IndividualStyles) {
3017 tg->TAttLine::Modify();
3019 arrow.SetLineWidth(tg->GetLineWidth());
3020 arrow.SetLineColor(tg->GetLineColor());
3021 arrow.SetFillColor(tg->GetFillColor());
3025 xl2 =
gPad->XtoPad(theX[i] - ScaleX * theExL[i]);
3026 if (xl1 > xl2 && !NoErrorsX && (!isOutside || Option0X)) {
3028 arrow.PaintArrow(xl1,
y, xl2,
y, asize, ArrowOptX);
3031 gPad->PaintLine(xl1,
y, xl2,
y);
3042 gPad->PaintPolyLine(4, xb, yb);
3044 gPad->PaintLine(xl2,
y - ty, xl2,
y + ty);
3050 xr2 =
gPad->XtoPad(theX[i] + ScaleX * theExH[i]);
3051 if (xr1 < xr2 && !NoErrorsX && (!isOutside || Option0X)) {
3053 arrow.PaintArrow(xr1,
y, xr2,
y, asize, ArrowOptX);
3056 gPad->PaintLine(xr1,
y, xr2,
y);
3067 gPad->PaintPolyLine(4, xb, yb);
3069 gPad->PaintLine(xr2,
y - ty, xr2,
y + ty);
3080 auto tgDummy =
new TGraph();
3081 tg->TAttFill::Copy(*tgDummy);
3082 tg->TAttLine::Copy(*tgDummy);
3083 tg->TAttMarker::Copy(*tgDummy);
3085 for (
Int_t j = 0; j < NYErrors; j++) {
3086 if (Option3[j] && DrawErrors[j]) {
3087 if (IndividualStyles) {
3088 tg->GetAttFill(j)->Copy(*tgDummy);
3089 tg->GetAttLine(j)->Copy(*tgDummy);
3097 PaintGraph(tgDummy, 2 * NPointsInside, xline, yline[j],
"FC");
3099 PaintGraph(tgDummy, 2 * NPointsInside, xline, yline[j],
"F");
3100 gPad->SetLogx(logx);
3101 gPad->SetLogy(logy);
3124 const Int_t kBASEMARKER=8;
3125 Double_t s2x, s2y, symbolsize, sbase;
3126 Double_t x,
y, xl1, xl2, xr1, xr2, yup1, yup2, ylow1, ylow2, tx, ty;
3128 static Float_t cxx[15] = {1,1,0.6,0.6,1,1,0.6,0.5,1,0.6,0.6,1,0.6,1,1};
3129 static Float_t cyy[15] = {1,1,1,1,1,1,1,1,1,0.5,0.6,1,1,1,1};
3142 if (strchr(option,
'X') || strchr(option,
'x')) {
PaintGraphSimple(theGraph, option);
return;}
3145 if (strstr(option,
"||") || strstr(option,
"[]")) {
3147 if (strstr(option,
"[]")) braticks =
kTRUE;
3150 if (strchr(option,
'z')) endLines =
kFALSE;
3151 if (strchr(option,
'Z')) endLines =
kFALSE;
3152 const char *arrowOpt = 0;
3153 if (strchr(option,
'>')) arrowOpt =
">";
3154 if (strstr(option,
"|>")) arrowOpt =
"|>";
3157 if (strchr(option,
'a')) axis =
kTRUE;
3158 if (strchr(option,
'A')) axis =
kTRUE;
3166 if (strchr(option,
'0')) option0 =
kTRUE;
3167 if (strchr(option,
'2')) option2 =
kTRUE;
3168 if (strchr(option,
'3')) option3 =
kTRUE;
3169 if (strchr(option,
'4')) {option3 =
kTRUE; option4 =
kTRUE;}
3170 if (strchr(option,
'5')) {option2 =
kTRUE; option5 =
kTRUE;}
3173 xline =
new Double_t[2*theNpoints];
3174 yline =
new Double_t[2*theNpoints];
3175 if (!xline || !yline) {
3176 Error(
"Paint",
"too many points, out of memory");
3183 theGraph->TAttLine::Modify();
3198 sbase = symbolsize*kBASEMARKER;
3211 tx =
gPad->PixeltoX(dxend) -
gPad->PixeltoX(0);
3212 ty =-
gPad->PixeltoY(dxend) +
gPad->PixeltoY(0);
3213 Float_t asize = 0.6*symbolsize*kBASEMARKER/
gPad->GetWh();
3216 for (
Int_t i=0;i<theNpoints;i++) {
3217 x =
gPad->XtoPad(theX[i]);
3218 y =
gPad->YtoPad(theY[i]);
3219 bxl =
gPad->YtoPad(theY[i]+theEXlowd[i]);
3220 bxh =
gPad->YtoPad(theY[i]+theEXhighd[i]);
3221 byl =
gPad->XtoPad(theX[i]+theEYlowd[i]);
3222 byh =
gPad->XtoPad(theX[i]+theEYhighd[i]);
3225 if (x < gPad->GetUxmin())
x =
gPad->GetUxmin();
3226 if (
x >
gPad->GetUxmax())
x =
gPad->GetUxmax();
3227 if (y < gPad->GetUymin())
y =
gPad->GetUymin();
3228 if (
y >
gPad->GetUymax())
y =
gPad->GetUymax();
3230 if (x < gPad->GetUxmin())
continue;
3231 if (
x >
gPad->GetUxmax())
continue;
3232 if (y < gPad->GetUymin())
continue;
3233 if (
y >
gPad->GetUymax())
continue;
3239 x1b =
gPad->XtoPad(theX[i] - theEXlow[i]);
3240 y1b =
gPad->YtoPad(theY[i] - theEYlow[i]);
3241 x2b =
gPad->XtoPad(theX[i] + theEXhigh[i]);
3242 y2b =
gPad->YtoPad(theY[i] + theEYhigh[i]);
3243 if (x1b < gPad->GetUxmin()) x1b =
gPad->GetUxmin();
3244 if (x1b >
gPad->GetUxmax()) x1b =
gPad->GetUxmax();
3245 if (y1b < gPad->GetUymin()) y1b =
gPad->GetUymin();
3246 if (y1b >
gPad->GetUymax()) y1b =
gPad->GetUymax();
3247 if (x2b < gPad->GetUxmin()) x2b =
gPad->GetUxmin();
3248 if (x2b >
gPad->GetUxmax()) x2b =
gPad->GetUxmax();
3249 if (y2b < gPad->GetUymin()) y2b =
gPad->GetUymin();
3250 if (y2b >
gPad->GetUymax()) y2b =
gPad->GetUymax();
3251 if (option5)
box.PaintBox(x1b, y1b, x2b, y2b,
"l");
3252 else box.PaintBox(x1b, y1b, x2b, y2b);
3260 yline[if1-1] =
gPad->YtoPad(theY[i] + theEYhigh[i]);
3261 yline[if2-1] =
gPad->YtoPad(theY[i] - theEYlow[i]);
3268 xl2 =
gPad->XtoPad(theX[i] - theEXlow[i]);
3271 arrow.PaintArrow(xl1,
y,xl2,bxl,asize,arrowOpt);
3273 if (!brackets)
gPad->PaintLine(xl1,
y,xl2,bxl);
3276 xb[0] = xl2+tx; yb[0] = bxl-ty;
3277 xb[1] = xl2; yb[1] = bxl-ty;
3278 xb[2] = xl2; yb[2] = bxl+ty;
3279 xb[3] = xl2+tx; yb[3] = bxl+ty;
3280 gPad->PaintPolyLine(4, xb, yb);
3282 gPad->PaintLine(xl2,bxl-ty,xl2,bxl+ty);
3288 xr2 =
gPad->XtoPad(theX[i] + theEXhigh[i]);
3291 arrow.PaintArrow(xr1,
y,xr2,bxh,asize,arrowOpt);
3293 if (!brackets)
gPad->PaintLine(xr1,
y,xr2,bxh);
3296 xb[0] = xr2-tx; yb[0] = bxh-ty;
3297 xb[1] = xr2; yb[1] = bxh-ty;
3298 xb[2] = xr2; yb[2] = bxh+ty;
3299 xb[3] = xr2-tx; yb[3] = bxh+ty;
3300 gPad->PaintPolyLine(4, xb, yb);
3302 gPad->PaintLine(xr2,bxh-ty,xr2,bxh+ty);
3308 yup2 =
gPad->YtoPad(theY[i] + theEYhigh[i]);
3309 if (yup2 >
gPad->GetUymax()) yup2 =
gPad->GetUymax();
3312 arrow.PaintArrow(
x,yup1,byh,yup2,asize,arrowOpt);
3314 if (!brackets)
gPad->PaintLine(
x,yup1,byh,yup2);
3317 xb[0] = byh-tx; yb[0] = yup2-ty;
3318 xb[1] = byh-tx; yb[1] = yup2;
3319 xb[2] = byh+tx; yb[2] = yup2;
3320 xb[3] = byh+tx; yb[3] = yup2-ty;
3321 gPad->PaintPolyLine(4, xb, yb);
3323 gPad->PaintLine(byh-tx,yup2,byh+tx,yup2);
3329 ylow2 =
gPad->YtoPad(theY[i] - theEYlow[i]);
3330 if (ylow2 < gPad->GetUymin()) ylow2 =
gPad->GetUymin();
3331 if (ylow2 < ylow1) {
3333 arrow.PaintArrow(
x,ylow1,byl,ylow2,asize,arrowOpt);
3335 if (!brackets)
gPad->PaintLine(
x,ylow1,byl,ylow2);
3338 xb[0] = byl-tx; yb[0] = ylow2+ty;
3339 xb[1] = byl-tx; yb[1] = ylow2;
3340 xb[2] = byl+tx; yb[2] = ylow2;
3341 xb[3] = byl+tx; yb[3] = ylow2+ty;
3342 gPad->PaintPolyLine(4, xb, yb);
3344 gPad->PaintLine(byl-tx,ylow2,byl+tx,ylow2);
3358 if (option4)
PaintGraph(theGraph, 2*theNpoints, xline, yline,
"FC");
3359 else PaintGraph(theGraph, 2*theNpoints, xline, yline,
"F");
3360 gPad->SetLogx(logx);
3361 gPad->SetLogy(logy);
3380 const Int_t kBASEMARKER=8;
3381 Double_t s2x, s2y, symbolsize, sbase;
3382 Double_t x,
y,
ex,
ey, xl1, xl2, xr1, xr2, yup1, yup2, ylow1, ylow2, tx, ty;
3383 static Float_t cxx[15] = {1,1,0.6,0.6,1,1,0.6,0.5,1,0.6,0.6,1,0.6,1,1};
3384 static Float_t cyy[15] = {1,1,1,1,1,1,1,1,1,0.5,0.6,1,1,1,1};
3391 if (strchr(option,
'X') || strchr(option,
'x')) {
PaintGraphSimple(theGraph, option);
return;}
3394 if (strstr(option,
"||") || strstr(option,
"[]")) {
3396 if (strstr(option,
"[]")) braticks =
kTRUE;
3399 if (strchr(option,
'z')) endLines =
kFALSE;
3400 if (strchr(option,
'Z')) endLines =
kFALSE;
3401 const char *arrowOpt = 0;
3402 if (strchr(option,
'>')) arrowOpt =
">";
3403 if (strstr(option,
"|>")) arrowOpt =
"|>";
3406 if (strchr(option,
'a')) axis =
kTRUE;
3407 if (strchr(option,
'A')) axis =
kTRUE;
3415 if (strchr(option,
'0')) option0 =
kTRUE;
3416 if (strchr(option,
'2')) option2 =
kTRUE;
3417 if (strchr(option,
'3')) option3 =
kTRUE;
3418 if (strchr(option,
'4')) {option3 =
kTRUE; option4 =
kTRUE;}
3419 if (strchr(option,
'5')) {option2 =
kTRUE; option5 =
kTRUE;}
3422 xline =
new Double_t[2*theNpoints];
3423 yline =
new Double_t[2*theNpoints];
3424 if (!xline || !yline) {
3425 Error(
"Paint",
"too many points, out of memory");
3432 theGraph->TAttLine::Modify();
3447 sbase = symbolsize*kBASEMARKER;
3460 tx =
gPad->PixeltoX(dxend) -
gPad->PixeltoX(0);
3461 ty =-
gPad->PixeltoY(dxend) +
gPad->PixeltoY(0);
3462 Float_t asize = 0.6*symbolsize*kBASEMARKER/
gPad->GetWh();
3465 for (
Int_t i=0;i<theNpoints;i++) {
3466 x =
gPad->XtoPad(theX[i]);
3467 y =
gPad->YtoPad(theY[i]);
3470 if (x < gPad->GetUxmin())
x =
gPad->GetUxmin();
3471 if (
x >
gPad->GetUxmax())
x =
gPad->GetUxmax();
3472 if (y < gPad->GetUymin())
y =
gPad->GetUymin();
3473 if (
y >
gPad->GetUymax())
y =
gPad->GetUymax();
3475 if (x < gPad->GetUxmin())
continue;
3476 if (
x >
gPad->GetUxmax())
continue;
3477 if (y < gPad->GetUymin())
continue;
3478 if (
y >
gPad->GetUymax())
continue;
3486 x1b =
gPad->XtoPad(theX[i] -
ex);
3487 y1b =
gPad->YtoPad(theY[i] -
ey);
3488 x2b =
gPad->XtoPad(theX[i] +
ex);
3489 y2b =
gPad->YtoPad(theY[i] +
ey);
3490 if (x1b < gPad->GetUxmin()) x1b =
gPad->GetUxmin();
3491 if (x1b >
gPad->GetUxmax()) x1b =
gPad->GetUxmax();
3492 if (y1b < gPad->GetUymin()) y1b =
gPad->GetUymin();
3493 if (y1b >
gPad->GetUymax()) y1b =
gPad->GetUymax();
3494 if (x2b < gPad->GetUxmin()) x2b =
gPad->GetUxmin();
3495 if (x2b >
gPad->GetUxmax()) x2b =
gPad->GetUxmax();
3496 if (y2b < gPad->GetUymin()) y2b =
gPad->GetUymin();
3497 if (y2b >
gPad->GetUymax()) y2b =
gPad->GetUymax();
3498 if (option5)
box.PaintBox(x1b, y1b, x2b, y2b,
"l");
3499 else box.PaintBox(x1b, y1b, x2b, y2b);
3507 yline[if1-1] =
gPad->YtoPad(theY[i] +
ey);
3508 yline[if2-1] =
gPad->YtoPad(theY[i] -
ey);
3515 xl2 =
gPad->XtoPad(theX[i] -
ex);
3518 arrow.PaintArrow(xl1,
y,xl2,
y,asize,arrowOpt);
3520 if (!brackets)
gPad->PaintLine(xl1,
y,xl2,
y);
3523 xb[0] = xl2+tx; yb[0] =
y-ty;
3524 xb[1] = xl2; yb[1] =
y-ty;
3525 xb[2] = xl2; yb[2] =
y+ty;
3526 xb[3] = xl2+tx; yb[3] =
y+ty;
3527 gPad->PaintPolyLine(4, xb, yb);
3529 gPad->PaintLine(xl2,
y-ty,xl2,
y+ty);
3535 xr2 =
gPad->XtoPad(theX[i] +
ex);
3538 arrow.PaintArrow(xr1,
y,xr2,
y,asize,arrowOpt);
3540 if (!brackets)
gPad->PaintLine(xr1,
y,xr2,
y);
3543 xb[0] = xr2-tx; yb[0] =
y-ty;
3544 xb[1] = xr2; yb[1] =
y-ty;
3545 xb[2] = xr2; yb[2] =
y+ty;
3546 xb[3] = xr2-tx; yb[3] =
y+ty;
3547 gPad->PaintPolyLine(4, xb, yb);
3549 gPad->PaintLine(xr2,
y-ty,xr2,
y+ty);
3555 yup2 =
gPad->YtoPad(theY[i] +
ey);
3556 if (yup2 >
gPad->GetUymax()) yup2 =
gPad->GetUymax();
3559 arrow.PaintArrow(
x,yup1,
x,yup2,asize,arrowOpt);
3561 if (!brackets)
gPad->PaintLine(
x,yup1,
x,yup2);
3564 xb[0] =
x-tx; yb[0] = yup2-ty;
3565 xb[1] =
x-tx; yb[1] = yup2;
3566 xb[2] =
x+tx; yb[2] = yup2;
3567 xb[3] =
x+tx; yb[3] = yup2-ty;
3568 gPad->PaintPolyLine(4, xb, yb);
3570 gPad->PaintLine(
x-tx,yup2,
x+tx,yup2);
3576 ylow2 =
gPad->YtoPad(theY[i] -
ey);
3577 if (ylow2 < gPad->GetUymin()) ylow2 =
gPad->GetUymin();
3578 if (ylow2 < ylow1) {
3580 arrow.PaintArrow(
x,ylow1,
x,ylow2,asize,arrowOpt);
3582 if (!brackets)
gPad->PaintLine(
x,ylow1,
x,ylow2);
3585 xb[0] =
x-tx; yb[0] = ylow2+ty;
3586 xb[1] =
x-tx; yb[1] = ylow2;
3587 xb[2] =
x+tx; yb[2] = ylow2;
3588 xb[3] =
x+tx; yb[3] = ylow2+ty;
3589 gPad->PaintPolyLine(4, xb, yb);
3591 gPad->PaintLine(
x-tx,ylow2,
x+tx,ylow2);
3605 if (option4)
PaintGraph(theGraph, 2*theNpoints, xline, yline,
"FC");
3606 else PaintGraph(theGraph, 2*theNpoints, xline, yline,
"F");
3607 gPad->SetLogx(logx);
3608 gPad->SetLogy(logy);
3622 Double_t rwrmin, rwrmax, rwtmin, rwtmax;
3626 Int_t theNpoints = theGraphPolar->
GetN();
3632 if (theNpoints<1)
return;
3647 if (thePolargram)
if (!
gPad->FindObject(thePolargram->
GetName())) thePolargram=0;
3648 if (!thePolargram) {
3661 if (!thePolargram) {
3663 rwrmin = theY[0]; rwrmax = theY[theNpoints-1];
3664 rwtmin = theX[0]; rwtmax = theX[theNpoints-1];
3666 for (ipt = 0; ipt < theNpoints; ipt++) {
3669 if (theX[ipt] -theEX[ipt] < rwtmin) rwtmin = theX[ipt]-theEX[ipt];
3670 if (theX[ipt] +theEX[ipt] > rwtmax) rwtmax = theX[ipt]+theEX[ipt];
3672 if (theX[ipt] < rwtmin) rwtmin=theX[ipt];
3673 if (theX[ipt] > rwtmax) rwtmax=theX[ipt];
3676 if (theY[ipt] -theEY[ipt] < rwrmin) rwrmin = theY[ipt]-theEY[ipt];
3677 if (theY[ipt] +theEY[ipt] > rwrmax) rwrmax = theY[ipt]+theEY[ipt];
3679 if (theY[ipt] < rwrmin) rwrmin=theY[ipt];
3680 if (theY[ipt] > rwrmax) rwrmax=theY[ipt];
3684 if (rwrmin == rwrmax) rwrmax += 1.;
3685 if (rwtmin == rwtmax) rwtmax += 1.;
3692 rwtmax += dt/theNpoints;
3694 rwrmin = thePolargram->
GetRMin();
3695 rwrmax = thePolargram->
GetRMax();
3696 rwtmin = thePolargram->
GetTMin();
3697 rwtmax = thePolargram->
GetTMax();
3702 thePolargram =
new TGraphPolargram(
"Polargram",rwrmin,rwrmax,rwtmin,rwtmax);
3706 if (nolabel) thePolargram->
Draw(
"N");
3707 else thePolargram->
Draw(
"");
3716 Double_t radiusNDC = rwrmax-rwrmin;
3726 for (i=0; i<theNpoints; i++) {
3727 Double_t eymin, eymax, exmin,exmax;
3728 exmin = (theY[i]-theEY[i]-rwrmin)/radiusNDC*
3730 eymin = (theY[i]-theEY[i]-rwrmin)/radiusNDC*
3732 exmax = (theY[i]+theEY[i]-rwrmin)/radiusNDC*
3734 eymax = (theY[i]+theEY[i]-rwrmin)/radiusNDC*
3736 theGraphPolar->TAttLine::Modify();
3737 if (exmin != exmax || eymin != eymax)
gPad->PaintLine(exmin,eymin,exmax,eymax);
3741 for (i=0; i<theNpoints; i++) {
3742 Double_t rad = (theY[i]-rwrmin)/radiusNDC;
3745 theGraphPolar->TAttLine::Modify();
3746 if (phimin != phimax) thePolargram->
PaintCircle(0,0,rad,phimin,phimax,0);
3752 if (!(
gPad->GetLogx()) && !(
gPad->GetLogy())) {
3753 Double_t a,
b,
c=1,
x1,
x2, y1, y2, discr, norm1, norm2, xts, yts;
3761 for (i=0; i<theNpoints; i++) {
3764 xt = (theY[i]-rwrmin)/radiusNDC*
TMath::Cos(
c*(theX[i]-rwtmin)/thetaNDC);
3765 yt = (theY[i]-rwrmin)/radiusNDC*
TMath::Sin(
c*(theX[i]-rwtmin)/thetaNDC);
3766 norm =
sqrt(xt*xt+yt*yt);
3771 if (!previouspointin) {
3776 a = (yt-yts)/(xt-xts);
3778 discr = 4*(
a*
a-
b*
b+1);
3783 norm1 =
sqrt((
x1-xt)*(
x1-xt)+(y1-yt)*(y1-yt));
3784 norm2 =
sqrt((
x2-xt)*(
x2-xt)+(y2-yt)*(y2-yt));
3785 previouspointin =
kFALSE;
3787 if (norm1 < norm2) {
3797 PaintGraph(theGraphPolar, j+1, theXpol, theYpol, opt);
3802 if (j>=1 && !previouspointin) {
3803 a = (yt-theYpol[j])/(xt-theXpol[j]);
3804 b = theYpol[j]-
a*theXpol[j];
3805 previouspointin =
kTRUE;
3806 discr = 4*(
a*
a-
b*
b+1);
3811 norm1 =
sqrt((
x1-xt)*(
x1-xt)+(y1-yt)*(y1-yt));
3812 norm2 =
sqrt((
x2-xt)*(
x2-xt)+(y2-yt)*(y2-yt));
3814 if (norm1 < norm2) {
3821 PaintGraph(theGraphPolar, j+1, theXpol, theYpol, opt);
3828 PaintGraph(theGraphPolar, j+1, theXpol, theYpol, opt);
3831 for (i=0; i<theNpoints; i++) {
3835 PaintGraph(theGraphPolar, theNpoints, theXpol, theYpol,opt);
3844 TIter next(
gPad->GetListOfPrimitives());
3845 while ((obj = next())) {
3849 if (strcmp(title->
GetName(),
"title")) {title = 0;
continue;}
3853 if (title)
delete title;
3859 if (ht <= 0) ht = 0.05;
3880 if (talh < 1) talh = 1;
else if (talh > 3) talh = 3;
3882 if (talv < 1) talv = 1;
else if (talv > 3) talv = 3;
3888 if (talh == 2) xpos = xpos-wt/2.;
3889 if (talh == 3) xpos = xpos-wt;
3890 if (talv == 2) ypos = ypos+ht/2.;
3891 if (talv == 1) ypos = ypos+ht;
3924 TF1 *theF = theGraphQQ->
GetF();
3927 Error(
"TGraphQQ::Paint",
"2nd dataset or theoretical function not specified");
3942 Double_t yxmin, xymin, yxmax, xymax;
3948 TLine line1, line2, line3;
3951 yxmin = (theYq2-theYq1)*(
xmin-theXq1)/(theXq2-theXq1) + theYq1;
3953 xymin = (theXq2-theXq1)*(
ymin-theYq1)/(theYq2-theYq1) + theXq1;
3959 line2.
PaintLine(xqmin, yqmin, xqmax, yqmax);
3961 yxmax = (theYq2-theYq1)*(
xmax-theXq1)/(theXq2-theXq1) + theYq1;
3963 xymax = (theXq2-theXq1)*(
ymax-theYq1)/(theYq2-theYq1) + theXq1;
4003 theHist->
Paint(
"0");
4016 XA1 =
gPad->GetUxmin();
4017 XA2 =
gPad->GetUxmax();
4018 YA1 =
gPad->GetUymin();
4019 YA2 =
gPad->GetUymax();
4024 std::vector<Double_t> newX(
N);
4025 std::vector<Double_t> newY(
N);
4037 if (
gPad->GetGridx()) {
4038 GL = (YA2 - YA1) / (
gPad->GetY2() -
gPad->GetY1());
4041 auto *theNewAxis =
new TGaxis(
gPad->GetUxmax(),
4052 theNewAxis->SetTickLength(TLX);
4054 theNewAxis->Paint();
4057 for (
Int_t i=0; i<
N; i++) newX[i] = dX-X[i];
4059 for (
Int_t i=0; i<
N; i++) newX[i] = X[i];
4070 if (
gPad->GetGridy()) {
4071 GL = (XA2 - XA1) / (
gPad->GetX2() -
gPad->GetX1());
4074 auto *theNewAxis =
new TGaxis(
gPad->GetUxmin(),
4085 theNewAxis->SetTickLength(-TLY);
4086 theNewAxis->SetLabelOffset(LOY-TLY);
4087 theNewAxis->Paint();
4090 for (
Int_t i=0; i<
N; i++) newY[i] = dY-Y[i];
4092 for (
Int_t i=0; i<
N; i++) newY[i] = Y[i];
4097 for (
Int_t i=0; i<
N; i++) theNewGraph->
SetPoint(i, newX[i], newY[i]);
4120 if (strstr(option,
"H") || strstr(option,
"h")) {
4131 if (!functions)
return;
4167 Double_t x1,
x2, y1, y2,
x3, y3, xm, ym,
a, a1, a2, a3;
4170 Int_t ix1,iy1,ix2,iy2;
4174 gPad->GetPadPar(x1p,y1p,x2p,y2p);
4175 ix1 = (
Int_t)(iw*x1p);
4176 iy1 = (
Int_t)(ih*y1p);
4177 ix2 = (
Int_t)(iw*x2p);
4178 iy2 = (
Int_t)(ih*y2p);
4190 gPad->GetRange(rx1,ry1,rx2,ry2);
4191 Double_t rx = (x2ndc-x1ndc)/(rx2-rx1);
4192 Double_t ry = (y2ndc-y1ndc)/(ry2-ry1);
4196 xf[0] = rx*(
x[0]-rx1)+x1ndc;
4197 yf[0] = ry*(
y[0]-ry1)+y1ndc;
4199 for (i=1; i<
n; i++) {
4200 if (
x[i]==
x[i-1] &&
y[i]==
y[i-1])
continue;
4202 xf[nf] = rx*(
x[i]-rx1)+x1ndc;
4203 if (xf[i]==xf[i-1]) xf[i] += 0.000001;
4204 yf[nf] = ry*(
y[i]-ry1)+y1ndc;
4223 if (xf[nf]==xf[nf-1]) {
4228 if (xf[nf]>=xf[nf-1]) {
4237 for (i=1; i<nf; i++) {
4249 if (xi1<xi0) a1 = a1+3.14159;
4255 if (xi0<xi2) a2 = a2+3.14159;
4270 if ((xm-xi0)*(
x3-xi0)<0 && (ym-yi0)*(y3-yi0)<0) {
4274 if ((xm==
x1) && (ym==y1)) {
4283 if (xf[nf]==xf[0] && yf[nf]==yf[0]) {
4284 xm = (xt[nf]+xt[0])*0.5;
4285 ym = (yt[nf]+yt[0])*0.5;
4293 if ((xm-xf[0])*(
x3-xf[0])<0 && (ym-yf[0])*(y3-yf[0])<0) {
4307 for (i=nf2; i>0; i--) {
4308 for (j=i-1; j>0; j--) {
4309 if (xt[i-1]==xt[i] || xt[j-1]==xt[j])
continue;
4310 c1 = (yt[i-1]-yt[i])/(xt[i-1]-xt[i]);
4311 b1 = yt[i]-
c1*xt[i];
4312 c2 = (yt[j-1]-yt[j])/(xt[j-1]-xt[j]);
4313 b2 = yt[j]-
c2*xt[j];
4315 xc = (b2-b1)/(
c1-
c2);
4321 nf++; xf[nf] = xt[i]; yf[nf] = yt[i];
4322 nf++; xf[nf] = xc ; yf[nf] = yc;
4340 nf++; xf[nf] = xt[0]; yf[nf] = yt[0];
4343 for (i=0; i<nf+1; i++) {
4344 xf[i] = (1/rx)*(xf[i]-x1ndc)+rx1;
4345 yf[i] = (1/ry)*(yf[i]-y1ndc)+ry1;
4349 gPad->PaintFillArea(nf+1,xf,yf);
4350 theGraph->TAttLine::Modify();
4368 TIter next(functions);
4370 while ((obj = next())) {
4380 if (!dofit) fit = 0;
4382 if (dofit == 1) dofit = 111;
4384 Int_t print_fval = dofit%10;
4385 Int_t print_ferrors = (dofit/10)%10;
4386 Int_t print_fchi2 = (dofit/100)%10;
4387 Int_t print_fprob = (dofit/1000)%10;
4388 Int_t nlinesf = print_fval + print_fchi2 + print_fprob;
4389 if (fit) nlinesf += fit->GetNpar();
4424 Int_t ndf = fit->GetNDF();
4427 if (print_fchi2) stats->
AddText(t);
4433 if (print_fval || print_ferrors) {
4434 for (
Int_t ipar=0;ipar<fit->GetNpar();ipar++) {
4435 if (print_ferrors) {
4438 ,(
Float_t)fit->GetParError(ipar));
4448 if (!done) functions->
Add(stats);
4478 Int_t i, k, kp, km, npointsMax, banksize, n2, npt;
4479 Int_t maxiterations, finished;
4480 Int_t jtype, ktype, closed;
4481 Double_t sxmin, sxmax, symin, symax;
4484 Double_t ratio_signs, xratio, yratio;
4490 Double_t co, so, ct, st, ctu, stu, xnt;
4491 Double_t dx1, dy1, dx2, dy2, dk1, dk2;
4498 c = t = co = so = ct = st = ctu = stu = dx1 = dy1 = dx2 = dy2 = 0;
4499 xt = yt = xa = xb = ya = yb = u1 = u2 = u3 = tj = sb = 0;
4501 npointsMax = npoints*10;
4508 Error(
"Smooth",
"not enough space in memory");
4515 jtype = (drawtype%1000)-10;
4516 if (jtype > 0) { ktype = jtype; loptx =
kTRUE; }
4517 else ktype = drawtype%1000;
4546 for (i=1;i<npoints;i++) {
4548 if ((
x[i]-
x[i-1])*(
x[i-1]-
x[i-2]) < 0) six++;
4549 if ((
y[i]-
y[i-1])*(
y[i-1]-
y[i-2]) < 0) siy++;
4551 if (
x[i] < sxmin) sxmin =
x[i];
4552 if (
x[i] > sxmax) sxmax =
x[i];
4553 if (
y[i] < symin) symin =
y[i];
4554 if (
y[i] > symax) symax =
y[i];
4559 if (dx1n < 0.01*(sxmax-sxmin) && dy1n < 0.01*(symax-symin)) closed = 1;
4560 if (sxmin == sxmax) {
4563 if (six > 1) ratio_signs = siy/six;
4564 else ratio_signs = 20;
4565 xratio = ratio_signs/(sxmax-sxmin);
4567 if (symin == symax) yratio = 1;
4568 else yratio = 1/(symax-symin);
4572 for (i=0;i<npoints;i++) {
4573 x[i] = (
x[i]-sxmin)*xratio;
4574 y[i] = (
y[i]-symin)*yratio;
4593 if (
x[0] !=
x[npoints-1] ||
y[0] !=
y[npoints-1])
goto L40;
4594 if (
x[npoints-2] ==
x[npoints-1] &&
y[npoints-2] ==
y[npoints-1])
goto L40;
4595 if (
x[0] ==
x[1] &&
y[0] ==
y[1])
goto L40;
4618 if (npt > 1)
goto L310;
4622 if (
x[k-1] ==
x[k-2] &&
y[k-1] ==
y[k-2])
goto L50;
4627 if (npt > 1)
goto L310;
4630 if (k < npoints)
goto L90;
4631 if (!flgic) { kp = 2;
goto L130;}
4634 if (flgis)
goto L150;
4644 if (
x[k-1] ==
x[k] &&
y[k-1] ==
y[k])
goto L80;
4652 if (!flgis)
goto L50;
4667 dx1 =
x[k-1] -
x[km-1];
4668 dy1 =
y[k-1] -
y[km-1];
4669 dk1 = dx1*dx1 + dy1*dy1;
4670 dx2 =
x[kp-1] -
x[k-1];
4671 dy2 =
y[kp-1] -
y[k-1];
4672 dk2 = dx2*dx2 + dy2*dy2;
4673 ctu = dx1*dk2 + dx2*dk1;
4674 stu = dy1*dk2 + dy2*dk1;
4675 xnt = ctu*ctu + stu*stu;
4689 if (flgis)
goto L160;
4693 w3 = 2*(dx1*dy2-dx2*dy1);
4705 w3 = 2*(dx1*dy2-dx2*dy1);
4714 if (k <= 1)
goto L120;
4744 xa = (
a*t-2*dx)/tcube;
4745 xb = (3*dx-(co+
a)*t)/tsquare;
4746 ya = (
b*t-2*dy)/tcube;
4747 yb = (3*dy-(so+
b)*t)/tsquare;
4778 p2 = (u1*tj-u3)*3*tj+u2;
4808 z = s*sth*(s-s*sth)*(w1*sth+w1+w2);
4809 z = z*z/((
a*
a+
b*
b)*(delta*delta));
4810 z = (z+2.642937)*z/((.3715652*z+3.063444)*z+.2441889)-cc;
4814 if (iw > 0)
goto L250;
4815 if (z > err)
goto L240;
4820 if (iw+2 == 0)
goto L190;
4821 if (iw+2 > 0)
goto L290;
4839 theGraph->
Zero(kp,0,sb,err,s,z,maxiterations);
4840 if (kp == 2)
goto L210;
4842 Error(
"Smooth",
"Attempt to plot outside plot limits");
4845 if (iw > 0)
goto L200;
4871 qlx[npt] = sxmin + xt/xratio;
4872 qly[npt] = symin + yt/yratio;
4879 if (npt < banksize)
goto L320;
4880 if (drawtype >= 1000 || ktype > 1) {
4881 Int_t newsize = banksize + n2;
4883 for (i=0;i<banksize;i++) qtemp[i] = qlx[i];
4886 for (i=0;i<banksize;i++) qlx[i] = qtemp[i];
4887 for (i=0;i<banksize;i++) qtemp[i] = qly[i];
4890 for (i=0;i<banksize;i++) qly[i] = qtemp[i];
4899 if (drawtype >= 1000) {
4900 gPad->PaintFillArea(npt,qlx,qly,
"B");
4904 qlx[npt] = qlx[npt-1];
4905 qlx[npt+1] = qlx[0];
4911 qly[npt] = qly[npt-1];
4912 qly[npt+1] = qly[0];
4914 gPad->PaintFillArea(npt+2,qlx,qly);
4917 gPad->PaintPolyLine(npt,qlx,qly);
4920 qlx[0] = sxmin + xt/xratio;
4921 qly[0] = symin + yt/yratio;
4923 if (finished > 0)
goto L390;
4924 if (finished < 0) { finished = 0;
goto L110;}
4925 if (s > 0)
goto L180;
4931 for (i=0;i<npoints;i++) {
4932 x[i] = sxmin +
x[i]/xratio;
4933 y[i] = symin +
y[i]/yratio;
const Int_t kMaxPixel
Max value for an int.
static const double x2[5]
static const double x1[5]
static const double x3[11]
static TMarker * gHighlightMarker
static Int_t gHighlightPoint
static TGraph * gHighlightGraph
char * Form(const char *fmt,...)
R__EXTERN TStyle * gStyle
Draw all kinds of Arrows.
virtual Color_t GetLabelColor() const
virtual Color_t GetAxisColor() const
virtual Float_t GetLabelOffset() const
virtual void SetAxisColor(Color_t color=1, Float_t alpha=1.)
Set color of the line axis and tick marks.
virtual Style_t GetLabelFont() const
virtual void SetLabelOffset(Float_t offset=0.005)
Set distance between the axis and the labels.
virtual Float_t GetLabelSize() const
virtual Float_t GetTickLength() const
virtual void SetTickLength(Float_t length=0.03)
Set tick mark length.
virtual Color_t GetFillColor() const
Return the fill area color.
virtual Style_t GetFillStyle() const
Return the fill area style.
virtual void SetFillColor(Color_t fcolor)
Set the fill area color.
virtual void SetFillStyle(Style_t fstyle)
Set the fill area style.
virtual Color_t GetLineColor() const
Return the line color.
virtual void SetLineStyle(Style_t lstyle)
Set the line style.
virtual Width_t GetLineWidth() const
Return the line width.
virtual void 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)
Compute distance from point px,py to a line.
virtual Style_t GetMarkerStyle() const
Return the marker style.
virtual void SetMarkerColor(Color_t mcolor=1)
Set the marker color.
virtual Color_t GetMarkerColor() const
Return the marker color.
virtual Size_t GetMarkerSize() const
Return the marker size.
virtual void SetMarkerStyle(Style_t mstyle=1)
Set the marker style.
virtual void SetMarkerSize(Size_t msize=1)
Set the marker size.
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.
virtual void SetLimits(Double_t xmin, Double_t xmax)
virtual void PaintAxis(Double_t xmin, Double_t ymin, Double_t xmax, Double_t ymax, Double_t &wmin, Double_t &wmax, Int_t &ndiv, Option_t *chopt="", Double_t gridlength=0, Bool_t drawGridOnly=kFALSE)
Control function to draw an axis.
void SetLabelOffset(Float_t labeloffset)
void SetTickSize(Float_t ticksize)
void SetLabelSize(Float_t labelsize)
TGraph with asymmetric error bars and multiple y error dimensions.
void PaintGraphPolar(TGraph *theGraph, Option_t *option)
[Paint this TGraphPolar with its current attributes.]($GP04)
virtual char * GetObjectInfoHelper(TGraph *theGraph, Int_t px, Int_t py) const
virtual ~TGraphPainter()
Destructor.
void PaintGraphErrors(TGraph *theGraph, Option_t *option)
[Paint this TGraphErrors with its current attributes.]($GP03)
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.]($GP03)
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.
virtual void PaintGrapHist(TGraph *theGraph, Int_t npoints, const Double_t *x, const Double_t *y, Option_t *chopt)
This is a service method used by THistPainter to paint 1D histograms.
virtual void SetHighlight(TGraph *theGraph)
Set highlight (enable/disable) mode for theGraph.
void PaintStats(TGraph *theGraph, TF1 *fit)
Paint the statistics box with the fit info.
void PaintHelper(TGraph *theGraph, Option_t *option)
Paint a any kind of TGraph.
static Int_t fgMaxPointsPerLine
virtual void PaintGraph(TGraph *theGraph, Int_t npoints, const Double_t *x, const Double_t *y, Option_t *chopt)
[Control function to draw a graph.]($GP01)
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.
virtual void DrawPanelHelper(TGraph *theGraph)
Display a panel with all histogram drawing options.
virtual void HighlightPoint(TGraph *theGraph, Int_t hpoint, Int_t distance)
Check on highlight point.
virtual Int_t DistancetoPrimitiveHelper(TGraph *theGraph, Int_t px, Int_t py)
Compute distance from point px,py to a graph.
void ComputeLogs(Int_t npoints, Int_t opt)
Compute the logarithm of global variables gxwork and gywork according to the value of Options and put...
virtual void ExecuteEventHelper(TGraph *theGraph, Int_t event, Int_t px, Int_t py)
Execute action corresponding to one event.
void Smooth(TGraph *theGraph, Int_t npoints, Double_t *x, Double_t *y, Int_t drawtype)
Smooth a curve given by N points.
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.
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.]($GP03)
TGraphPainter()
Default constructor.
Double_t * GetYpol()
Return points in polar coordinates.
TGraphPolargram * GetPolargram()
void SetPolargram(TGraphPolargram *p)
void SetOptionAxis(Bool_t opt)
Double_t * GetXpol()
Return points in polar coordinates.
void PaintCircle(Double_t x, Double_t y, Double_t r, Double_t phimin, Double_t phimax, Double_t theta)
This is simplified from TEllipse::PaintEllipse.
void Draw(Option_t *options="")
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 void SetPoint(Int_t i, Double_t x, Double_t y)
Set x and y values for point number i.
virtual Double_t * GetEXhighd() const
virtual Bool_t IsEditable() const
@ kClipFrame
clip to the frame boundary
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.
TH1F * GetHistogram() const
Returns a pointer to the histogram used to draw the axis Takes into account the two following cases.
virtual Double_t * GetEY() const
virtual void SetHistogram(TH1F *h)
virtual Double_t * GetEXlow() const
virtual Int_t GetPoint(Int_t i, Double_t &x, Double_t &y) const
Get x and y values for point number i.
1-D histogram with a float per channel (see TH1 documentation)}
virtual void SetDirectory(TDirectory *dir)
By default when an histogram is created, it is added to the list of histogram objects in the current ...
virtual Double_t GetMinimumStored() const
@ kNoTitle
don't draw the histogram title
@ kNoStats
don't draw stats box
TAxis * GetXaxis()
Get the behaviour adopted by the object about the statoverflows. See EStatOverflows for more informat...
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)
virtual Double_t GetMaximumStored() const
virtual void Paint(Option_t *option="")
Control routine to paint any kind of histograms.
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 Int_t DistancetoPrimitive(Int_t px, Int_t py)
Compute distance from point px,py to a line.
To draw Mathematical Formula.
virtual void PaintLine(Double_t x1, Double_t y1, Double_t x2, Double_t y2)
Draw this line with new coordinates.
TObject * Next()
Return next object in the list. Returns 0 when no more objects in list.
virtual void Add(TObject *obj)
virtual TObjLink * FirstLink() const
virtual TObject * First() const
Return the first object in the list. Returns 0 when list is empty.
virtual void SetX(Double_t x)
virtual void Paint(Option_t *option="")
Paint this marker with its current attributes.
virtual void SetY(Double_t y)
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
virtual const char * GetTitle() const
Returns title of object.
virtual TObject * Clone(const char *newname="") const
Make a clone of an object using the Streamer facility.
virtual const char * GetName() const
Returns name of object.
TObject * GetObject() const
Option_t * GetOption() 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 void Delete(Option_t *option="")
Delete this object.
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
virtual const char * GetTitle() const
Returns title of object.
virtual void Paint(Option_t *option="")
This method must be overridden if a class wants to paint itself.
@ 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 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 void SetParent(TObject *obj)
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.
virtual void Paint(Option_t *option="")
Paint the pave stat.
void SetOptFit(Int_t fit=1)
Set the fit option.
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.
virtual void Draw(Option_t *option="")
Draw this pavetext with its current attributes.
virtual void Paint(Option_t *option="")
Paint this pavetext with its current attributes.
virtual TText * GetLine(Int_t number) const
Get Pointer to line number in this pavetext.
virtual void Clear(Option_t *option="")
Clear all lines in this pavetext.
virtual void SetName(const char *name="")
Option_t * GetName() const
Returns name of object.
virtual void SetBorderSize(Int_t bordersize=4)
Double_t GetX1NDC() const
virtual void SetX2NDC(Double_t x2)
Regular expression class.
TString Copy() const
Copy a string.
void ToLower()
Change string to lower-case.
int CompareTo(const char *cs, ECaseCompare cmp=kExact) const
Compare a string to char *cs2.
Ssiz_t First(char c) const
Find first occurrence of a character c.
const char * Data() const
TString & ReplaceAll(const TString &s1, const TString &s2)
void ToUpper()
Change string to upper case.
Int_t CountChar(Int_t c) const
Return number of times character c occurs in the string.
TString & Append(const char *cs)
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
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
Style_t GetStatFont() const
Float_t GetTitleFontSize() 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.
TVirtualPad is an abstract base class for the Pad and Canvas classes.
virtual TVirtualPad * cd(Int_t subpadnumber=0)=0
void box(Int_t pat, Double_t x1, Double_t y1, Double_t x2, Double_t y2)
Short_t Max(Short_t a, Short_t 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...
constexpr Double_t PiOver2()
Double_t Sqrt(Double_t x)
LongDouble_t Power(LongDouble_t x, LongDouble_t y)
Short_t Min(Short_t a, Short_t b)
Double_t Log10(Double_t x)