613 if (
gPad->GetLogx()) {
614 for (i=0;i<npoints;i++) {
619 if (!opt &&
gPad->GetLogy()) {
620 for (i=0;i<npoints;i++) {
641 if (distance <= 5)
return distance;
645 const Int_t big = 9999;
646 const Int_t kMaxDiff = 10;
653 if (px <= puxmin)
return big;
654 if (py >= puymin)
return big;
655 if (px >= puxmax)
return big;
656 if (py <= puymax)
return big;
666 theX = theGraphPolar->
GetXpol();
667 theY = theGraphPolar->
GetYpol();
669 theX = theGraph->
GetX();
670 theY = theGraph->
GetY();
674 for (i=0;i<theNpoints;i++) {
675 pxp =
gPad->XtoAbsPixel(
gPad->XtoPad(theX[i]));
676 pyp =
gPad->YtoAbsPixel(
gPad->YtoPad(theY[i]));
686 if (distance < kMaxDiff)
return distance;
688 for (i=0;i<theNpoints-1;i++) {
690 d =
l.DistancetoLine(px, py,
gPad->XtoPad(theX[i]),
gPad->YtoPad(theY[i]),
gPad->XtoPad(theX[i+1]),
gPad->YtoPad(theY[i+1]));
691 if (
d < distance) distance =
d;
706 TIter next(functions);
710 else dist =
f->DistancetoPrimitive(px,py);
711 if (
dist < kMaxDiff) {
712 gPad->SetSelected(
f);
728 Error(
"DrawPanel",
"need to draw graph first");
733 gROOT->ProcessLine(
Form(
"((TCanvas*)0x%lx)->Selected((TVirtualPad*)0x%lx,(TObject*)0x%lx,1)",
756 const Int_t kMaxDiff = 10;
757 static Bool_t middle, badcase;
758 static Int_t ipoint, pxp, pyp;
759 static Int_t px1,px2,py1,py2;
760 static Int_t pxold, pyold, px1old, py1old, px2old, py2old;
761 static Int_t dpx, dpy;
769 if (!
gPad->IsEditable())
return;
779 theGraph->TAttLine::Modify();
780 px1 =
gPad->XtoAbsPixel(
gPad->GetX1());
781 py1 =
gPad->YtoAbsPixel(
gPad->GetY1());
782 px2 =
gPad->XtoAbsPixel(
gPad->GetX2());
783 py2 =
gPad->YtoAbsPixel(
gPad->GetY2());
788 x =
new Int_t[theNpoints+1];
789 y =
new Int_t[theNpoints+1];
790 for (i=0;i<theNpoints;i++) {
791 pxp =
gPad->XtoAbsPixel(
gPad->XtoPad(theX[i]));
792 pyp =
gPad->YtoAbsPixel(
gPad->YtoPad(theY[i]));
793 if (pxp < -kMaxPixel || pxp >=
kMaxPixel ||
799 gVirtualX->DrawLine(pxp-4, pyp-4, pxp+4, pyp-4);
800 gVirtualX->DrawLine(pxp+4, pyp-4, pxp+4, pyp+4);
801 gVirtualX->DrawLine(pxp+4, pyp+4, pxp-4, pyp+4);
802 gVirtualX->DrawLine(pxp-4, pyp+4, pxp-4, pyp-4);
807 if (
d < kMaxDiff) ipoint =i;
813 if (ipoint < 0)
return;
817 px2old =
gPad->XtoAbsPixel(theX[1]);
818 py2old =
gPad->YtoAbsPixel(theY[1]);
819 }
else if (ipoint == theNpoints-1) {
820 px1old =
gPad->XtoAbsPixel(
gPad->XtoPad(theX[theNpoints-2]));
821 py1old =
gPad->YtoAbsPixel(
gPad->YtoPad(theY[theNpoints-2]));
825 px1old =
gPad->XtoAbsPixel(
gPad->XtoPad(theX[ipoint-1]));
826 py1old =
gPad->YtoAbsPixel(
gPad->YtoPad(theY[ipoint-1]));
827 px2old =
gPad->XtoAbsPixel(
gPad->XtoPad(theX[ipoint+1]));
828 py2old =
gPad->YtoAbsPixel(
gPad->YtoPad(theY[ipoint+1]));
830 pxold =
gPad->XtoAbsPixel(
gPad->XtoPad(theX[ipoint]));
831 pyold =
gPad->YtoAbsPixel(
gPad->YtoPad(theY[ipoint]));
839 for (i=0;i<theNpoints;i++) {
840 pxp =
gPad->XtoAbsPixel(
gPad->XtoPad(theX[i]));
841 pyp =
gPad->YtoAbsPixel(
gPad->YtoPad(theY[i]));
843 if (
d < kMaxDiff) middle =
kFALSE;
855 for(i=0;i<theNpoints-1;i++) {
856 gVirtualX->DrawLine(
x[i]+dpx,
y[i]+dpy,
x[i+1]+dpx,
y[i+1]+dpy);
859 if (pxp < -kMaxPixel || pxp >=
kMaxPixel ||
860 pyp < -kMaxPixel || pyp >=
kMaxPixel)
continue;
861 gVirtualX->DrawLine(pxp-4, pyp-4, pxp+4, pyp-4);
862 gVirtualX->DrawLine(pxp+4, pyp-4, pxp+4, pyp+4);
863 gVirtualX->DrawLine(pxp+4, pyp+4, pxp-4, pyp+4);
864 gVirtualX->DrawLine(pxp-4, pyp+4, pxp-4, pyp-4);
866 pxp =
x[theNpoints-1]+dpx;
867 pyp =
y[theNpoints-1]+dpy;
868 gVirtualX->DrawLine(pxp-4, pyp-4, pxp+4, pyp-4);
869 gVirtualX->DrawLine(pxp+4, pyp-4, pxp+4, pyp+4);
870 gVirtualX->DrawLine(pxp+4, pyp+4, pxp-4, pyp+4);
871 gVirtualX->DrawLine(pxp-4, pyp+4, pxp-4, pyp-4);
876 for(i=0;i<theNpoints-1;i++) {
877 gVirtualX->DrawLine(
x[i]+dpx,
y[i]+dpy,
x[i+1]+dpx,
y[i+1]+dpy);
880 if (pxp < -kMaxPixel || pxp >=
kMaxPixel ||
881 pyp < -kMaxPixel || pyp >=
kMaxPixel)
continue;
882 gVirtualX->DrawLine(pxp-4, pyp-4, pxp+4, pyp-4);
883 gVirtualX->DrawLine(pxp+4, pyp-4, pxp+4, pyp+4);
884 gVirtualX->DrawLine(pxp+4, pyp+4, pxp-4, pyp+4);
885 gVirtualX->DrawLine(pxp-4, pyp+4, pxp-4, pyp-4);
887 pxp =
x[theNpoints-1]+dpx;
888 pyp =
y[theNpoints-1]+dpy;
889 gVirtualX->DrawLine(pxp-4, pyp-4, pxp+4, pyp-4);
890 gVirtualX->DrawLine(pxp+4, pyp-4, pxp+4, pyp+4);
891 gVirtualX->DrawLine(pxp+4, pyp+4, pxp-4, pyp+4);
892 gVirtualX->DrawLine(pxp-4, pyp+4, pxp-4, pyp-4);
894 if (px1old)
gVirtualX->DrawLine(px1old, py1old, pxold, pyold);
895 if (px2old)
gVirtualX->DrawLine(pxold, pyold, px2old, py2old);
896 gVirtualX->DrawLine(pxold-4, pyold-4, pxold+4, pyold-4);
897 gVirtualX->DrawLine(pxold+4, pyold-4, pxold+4, pyold+4);
898 gVirtualX->DrawLine(pxold+4, pyold+4, pxold-4, pyold+4);
899 gVirtualX->DrawLine(pxold-4, pyold+4, pxold-4, pyold-4);
906 if (px1old)
gVirtualX->DrawLine(px1old, py1old, pxold, pyold);
907 if (px2old)
gVirtualX->DrawLine(pxold, pyold, px2old, py2old);
908 gVirtualX->DrawLine(pxold-4, pyold-4, pxold+4, pyold-4);
909 gVirtualX->DrawLine(pxold+4, pyold-4, pxold+4, pyold+4);
910 gVirtualX->DrawLine(pxold+4, pyold+4, pxold-4, pyold+4);
911 gVirtualX->DrawLine(pxold-4, pyold+4, pxold-4, pyold-4);
920 dxr = dx/(1 -
gPad->GetLeftMargin() -
gPad->GetRightMargin());
921 dyr = dy/(1 -
gPad->GetBottomMargin() -
gPad->GetTopMargin());
937 for(i=0;i<theNpoints;i++) {
938 if (badcase)
continue;
939 if (
x) theX[i] =
gPad->PadtoX(
gPad->AbsPixeltoX(
x[i]+dpx));
940 if (
y) theY[i] =
gPad->PadtoY(
gPad->AbsPixeltoY(
y[i]+dpy));
949 theX[ipoint] =
gPad->PadtoX(
gPad->AbsPixeltoX(pxold));
950 theY[ipoint] =
gPad->PadtoY(
gPad->AbsPixeltoY(pyold));
954 theX[theNpoints-1] = theX[0];
955 theY[theNpoints-1] = theY[0];
957 if (ipoint == theNpoints-1) {
958 theX[0] = theX[theNpoints-1];
959 theY[0] = theY[theNpoints-1];
971 if (
gROOT->IsEscaped()) {
985 dxr = dx/(1 -
gPad->GetLeftMargin() -
gPad->GetRightMargin());
986 dyr = dy/(1 -
gPad->GetBottomMargin() -
gPad->GetTopMargin());
998 for(i=0;i<theNpoints;i++) {
999 if (badcase)
continue;
1000 if (
x) theX[i] =
gPad->PadtoX(
gPad->AbsPixeltoX(
x[i]+dpx));
1001 if (
y) theY[i] =
gPad->PadtoY(
gPad->AbsPixeltoY(
y[i]+dpy));
1004 theX[ipoint] =
gPad->PadtoX(
gPad->AbsPixeltoX(pxold));
1005 theY[ipoint] =
gPad->PadtoY(
gPad->AbsPixeltoY(pyold));
1009 theX[theNpoints-1] = theX[0];
1010 theY[theNpoints-1] = theY[0];
1012 if (ipoint == theNpoints-1) {
1013 theX[0] = theX[theNpoints-1];
1014 theY[0] = theY[theNpoints-1];
1068 const Int_t kHighlightRange = 50;
1069 static Int_t distanceOld = kHighlightRange;
1072 if ((distance < kHighlightRange) && (distance < distanceOld)) {
1110 if (
gPad->GetLogx()) {
1114 if (
gPad->GetLogy()) {
1118 if ((hx < uxmin) || (hx > uxmax))
return;
1119 if ((hy < uymin) || (hy > uymax))
return;
1143 strlcpy(chopt,option,80);
1146 char *l1 = strstr(chopt,
"pfc");
1147 char *l2 = strstr(chopt,
"plc");
1148 char *l3 = strstr(chopt,
"pmc");
1149 if (l1 || l2 || l3) {
1158 char *l4 = strstr(chopt,
"rx");
1159 char *l5 = strstr(chopt,
"ry");
1191 TIter next(functions);
1212 gPad->PushSelectableObject(theGraph);
1214 Int_t optionLine , optionAxis , optionCurve , optionStar , optionMark;
1215 Int_t optionBar , optionR , optionOne , optionE;
1216 Int_t optionFill , optionZ , optionCurveFill, optionIAxis;
1217 Int_t i, npt, nloop;
1220 Double_t barxmin, barxmax, barymin, barymax;
1227 Error(
"PaintGraph",
"illegal number of points (%d)", npoints);
1234 if (opt.
Contains(
"L")) optionLine = 1;
else optionLine = 0;
1235 if (opt.
Contains(
"A")) optionAxis = 1;
else optionAxis = 0;
1236 if (opt.
Contains(
"C")) optionCurve = 1;
else optionCurve = 0;
1237 if (opt.
Contains(
"*")) optionStar = 1;
else optionStar = 0;
1238 if (opt.
Contains(
"P")) optionMark = 1;
else optionMark = 0;
1239 if (opt.
Contains(
"B")) optionBar = 1;
else optionBar = 0;
1240 if (opt.
Contains(
"R")) optionR = 1;
else optionR = 0;
1241 if (opt.
Contains(
"1")) optionOne = 1;
else optionOne = 0;
1242 if (opt.
Contains(
"F")) optionFill = 1;
else optionFill = 0;
1243 if (opt.
Contains(
"I")) optionIAxis = 1;
else optionIAxis = 0;
1249 if (optionLine+optionFill+optionCurve+optionStar+optionMark+optionBar+optionE == 0) {
1250 if (!chopt[0]) optionLine=1;
1256 optionCurveFill = 0;
1257 if (optionCurve && optionFill) {
1258 optionCurveFill = 1;
1263 Double_t rwxmin,rwxmax, rwymin, rwymax, maximum, minimum, dx, dy;
1266 rwxmin =
gPad->GetUxmin();
1267 rwxmax =
gPad->GetUxmax();
1268 rwymin =
gPad->GetUymin();
1269 rwymax =
gPad->GetUymax();
1272 if (minimum == -1111) {
1276 if (maximum == -1111) {
1280 uxmin =
gPad->PadtoX(rwxmin);
1281 uxmax =
gPad->PadtoX(rwxmax);
1284 theGraph->
ComputeRange(rwxmin, rwymin, rwxmax, rwymax);
1286 if (rwxmin == rwxmax) rwxmax += 1.;
1287 if (rwymin == rwymax) rwymax += 1.;
1288 dx = 0.1*(rwxmax-rwxmin);
1289 dy = 0.1*(rwymax-rwymin);
1290 uxmin = rwxmin - dx;
1291 uxmax = rwxmax + dx;
1292 minimum = rwymin - dy;
1293 maximum = rwymax + dy;
1297 if (uxmin < 0 && rwxmin >= 0) uxmin = 0.9*rwxmin;
1298 if (uxmax > 0 && rwxmax <= 0) {
1299 if (
gPad->GetLogx()) uxmax = 1.1*rwxmax;
1302 if (minimum < 0 && rwymin >= 0) minimum = 0.9*rwymin;
1303 if (maximum > 0 && rwymax <= 0) {
1307 if (minimum <= 0 && gPad->GetLogy()) minimum = 0.001*maximum;
1308 if (uxmin <= 0 && gPad->GetLogx()) {
1309 if (uxmax > 1000) uxmin = 1;
1310 else uxmin = 0.001*uxmax;
1317 char chopth[8] =
" ";
1318 if (strstr(chopt,
"x+")) strncat(chopth,
"x+",3);
1319 if (strstr(chopt,
"y+")) strncat(chopth,
"y+",3);
1320 if (optionIAxis) strncat(chopth,
"A",2);
1327 if (theNpoints > npt) npt = theNpoints;
1339 if (
gPad->GetLogy()) {
1352 rwxmin =
gPad->GetUxmin();
1353 rwxmax =
gPad->GetUxmax();
1354 rwymin =
gPad->GetUymin();
1355 rwymax =
gPad->GetUymax();
1356 uxmin =
gPad->PadtoX(rwxmin);
1357 uxmax =
gPad->PadtoX(rwxmax);
1362 maximum =
gPad->PadtoY(rwymax);
1363 minimum =
gPad->PadtoY(rwymin);
1367 theGraph->TAttLine::Modify();
1368 theGraph->TAttFill::Modify();
1369 theGraph->TAttMarker::Modify();
1377 if (optionLine || optionFill) {
1383 if (optionFill && (xn !=
x1 || yn != y1)) nloop++;
1385 for (i=1;i<=nloop;i++) {
1428 if (optionCurveFill) {
1430 if (xn !=
x1 || yn != y1) nloop++;
1434 for (i=1;i<=nloop;i++) {
1459 for (i=1;i<=nloop;i++) {
1463 if (
y[i-1] < minimum ||
y[i-1] > maximum)
continue;
1464 if (
x[i-1] < uxmin ||
x[i-1] > uxmax)
continue;
1490 for (i=1;i<=npoints;i++) {
1505 for (i=1;i<=npoints;i++) {
1522 for (i=1;i<npoints;i++) {
1523 if (
x[i] < barxmin) barxmin =
x[i];
1524 if (
x[i] > barxmax) barxmax =
x[i];
1526 bdelta = (barxmax-barxmin)/
Double_t(npoints);
1530 for (i=1;i<npoints;i++) {
1531 if (
y[i] < barymin) barymin =
y[i];
1532 if (
y[i] > barymax) barymax =
y[i];
1534 bdelta = (barymax-barymin)/
Double_t(npoints);
1538 for (i=1;i<=npoints;i++) {
1539 xlow =
x[i-1] - dbar;
1540 xhigh =
x[i-1] + dbar;
1542 if (xlow < uxmin && xhigh < uxmin)
continue;
1543 if (xhigh > uxmax && xlow > uxmax)
continue;
1544 if (xlow < uxmin) xlow = uxmin;
1545 if (xhigh > uxmax) xhigh = uxmax;
1547 else ylow =
gPad->GetUymin();
1561 for (i=1;i<=npoints;i++) {
1563 ylow =
y[i-1] - dbar;
1564 yhigh =
y[i-1] + dbar;
1617 const char *where =
"PaintGrapHist";
1619 Int_t optionLine , optionAxis , optionCurve, optionStar, optionMark;
1620 Int_t optionBar , optionRot , optionOne , optionOff ;
1621 Int_t optionFill , optionZ;
1622 Int_t optionHist , optionBins , optionMarker;
1624 Int_t drawtype=0, drawborder, drawbordersav;
1630 Double_t xi, xi1, xj, xj1, yi1, yi, yj, yj1, xwmin, ywmin;
1634 char choptaxis[10] =
" ";
1637 Error(where,
"illegal number of points (%d)", npoints);
1642 if (opt.
Contains(
"H")) optionHist = 1;
else optionHist = 0;
1643 if (opt.
Contains(
"F")) optionFill = 1;
else optionFill = 0;
1644 if (opt.
Contains(
"C")) optionCurve= 1;
else optionCurve= 0;
1645 if (opt.
Contains(
"*")) optionStar = 1;
else optionStar = 0;
1646 if (opt.
Contains(
"R")) optionRot = 1;
else optionRot = 0;
1647 if (opt.
Contains(
"1")) optionOne = 1;
else optionOne = 0;
1648 if (opt.
Contains(
"B")) optionBar = 1;
else optionBar = 0;
1649 if (opt.
Contains(
"N")) optionBins = 1;
else optionBins = 0;
1650 if (opt.
Contains(
"L")) optionLine = 1;
else optionLine = 0;
1651 if (opt.
Contains(
"P")) optionMark = 1;
else optionMark = 0;
1652 if (opt.
Contains(
"A")) optionAxis = 1;
else optionAxis = 0;
1653 if (opt.
Contains(
"][")) optionOff = 1;
else optionOff = 0;
1654 if (opt.
Contains(
"P0")) optionMark = 10;
1656 Int_t optionFill2 = 0;
1658 optionFill = 0; optionFill2 = 1;
1673 nbins = last -
first + 1;
1685 Double_t rounding = (uxmax-uxmin)*1.e-5;
1688 Int_t nx1, nx2, ndivx, ndivy, ndiv;
1701 if (ndivx < 0) strlcat(choptaxis,
"N",10);
1702 if (
gPad->GetGridx()) {
1704 strlcat(choptaxis,
"W",10);
1706 if (
gPad->GetLogx()) {
1710 strlcat(choptaxis,
"G",10);
1720 axis->
PaintAxis(rwxmin,rwymin,rwxmax,rwymin,rwmin,rwmax,ndiv,choptaxis);
1730 strlcat(choptaxis,
"N",10);
1733 if (
gPad->GetGridy()) {
1735 strlcat(choptaxis,
"W",10);
1737 if (
gPad->GetLogy()) {
1741 strlcat(choptaxis,
"G",10);
1750 axis->
PaintAxis(rwxmin,rwymin,rwxmin,rwymax,rwmin,rwmax,ndiv,choptaxis);
1756 theGraph->TAttLine::Modify();
1757 theGraph->TAttFill::Modify();
1758 theGraph->TAttMarker::Modify();
1762 if (!optionRot) {wmin =
x[0]; wmax =
x[1];}
1763 else {wmin =
y[0]; wmax =
y[1];}
1765 if (!optionBins) delta = (wmax - wmin)/
Double_t(nbins);
1767 Int_t fwidth =
gPad->GetFrameLineWidth();
1770 if (optionOff) fwidth = 1;
1786 if (optionFill && !optionCurve) {
1794 for (j=
first; j<=last;j++) {
1801 xj1 =
x[j]; xj =
x[j-1];
1803 if (j != last)
Error(where,
"X must be in increasing order");
1804 else Error(where,
"X must have N+1 values with option N");
1812 if ((
gxwork[npt-1] >= uxmin-rounding &&
gxwork[npt-1] <= uxmax+rounding) ||
1813 (
gxwork[npt] >= uxmin-rounding &&
gxwork[npt] <= uxmax+rounding)) npt += 2;
1826 if (!fillarea)
gyworkl[0] = ylast;
1837 for (j=
first; j<=last;j++) {
1842 yj1 =
y[j]; yj =
y[j-1];
1844 if (j != last)
Error(where,
"Y must be in increasing order");
1845 else Error(where,
"Y must have N+1 values with option N");
1851 if ((
gxwork[npt-1] >= uxmin-rounding &&
gxwork[npt-1] <= uxmax+rounding) ||
1852 (
gxwork[npt] >= uxmin-rounding &&
gxwork[npt] <= uxmax+rounding)) npt += 2;
1859 if (!fillarea)
gyworkl[0] = ylast;
1866 theGraph->TAttLine::Modify();
1867 theGraph->TAttFill::Modify();
1872 if ((optionHist) || !chopt[0]) {
1878 for (i=
first; i<=last;i++) {
1883 xi1 =
x[i]; xi =
x[i-1];
1885 if (i != last)
Error(where,
"X must be in increasing order");
1886 else Error(where,
"X must have N+1 values with option N");
1894 if ((
gxwork[npt-1] >= uxmin-rounding &&
gxwork[npt-1] <= uxmax+rounding) ||
1895 (
gxwork[npt] >= uxmin-rounding &&
gxwork[npt] <= uxmax+rounding)) npt += 2;
1907 Int_t nbpoints = npt-2;
1913 for (ip=point1; ip<=nbpoints; ip++) {
1920 Int_t point2 = nbpoints;
1921 for (ip=point2; ip>=point1; ip--) {
1927 nbpoints = point2-point1+1;
1931 if (
gxwork[0] >
gPad->GetUxmin()) { nbpoints++; point1 = 0; }
1932 if (
gxwork[nbpoints] <
gPad->GetUxmax()) nbpoints++;
1944 for (i=
first; i<=last;i++) {
1949 yi1 =
y[i]; yi =
y[i-1];
1951 if (i != last)
Error(where,
"Y must be in increasing order");
1952 else Error(where,
"Y must have N+1 values with option N");
1958 if ((
gxwork[npt-1] >= uxmin-rounding &&
gxwork[npt-1] <= uxmax+rounding) ||
1959 (
gxwork[npt] >= uxmin-rounding &&
gxwork[npt] <= uxmax+rounding)) npt += 2;
1978 if (!optionOne) drawtype = 2;
1983 for (i=
first; i<=last;i++) {
1988 xi1 =
x[i]; xi =
x[i-1];
1990 if (i != last)
Error(where,
"X must be in increasing order");
1991 else Error(where,
"X must have N+1 values with option N");
1994 gxwork[npt-1] =
x[i-1] + 0.5*(
x[i]-
x[i-1]);
2025 drawtype = drawtype+10;
2027 for (i=
first; i<=last;i++) {
2032 yi1 =
y[i]; yi =
y[i-1];
2034 if (i != last)
Error(where,
"Y must be in increasing order");
2035 else Error(where,
"Y must have N+1 values with option N");
2038 gywork[npt-1] =
y[i-1] + 0.5*(
y[i]-
y[i-1]);
2070 wminstep = wmin + 0.5*delta;
2072 gPad->GetRangeAxis(ax1,ay1,ax2,ay2);
2076 for (i=
first; i<=last;i++) {
2081 xi1 =
x[i]; xi =
x[i-1];
2083 if (i != last)
Error(where,
"X must be in increasing order");
2084 else Error(where,
"X must have N+1 values with option N");
2087 gxwork[npt-1] =
x[i-1] + 0.5*(
x[i]-
x[i-1]);
2089 if (
gxwork[npt-1] < uxmin ||
gxwork[npt-1] > uxmax) { npt--;
continue;}
2092 if ((
gywork[npt-1] < rwymin) || ((
gywork[npt-1] > rwymax) && !optionFill2)) {
2131 for (i=
first; i<=last;i++) {
2134 gywork[npt-1] = wminstep+(i-
first)*delta+0.5*delta;
2136 yi1 =
y[i]; yi =
y[i-1];
2138 if (i != last)
Error(where,
"Y must be in increasing order");
2139 else Error(where,
"Y must have N+1 values with option N");
2142 gywork[npt-1] =
y[i-1] + 0.5*(
y[i]-
y[i-1]);
2145 if ((
gxwork[npt-1] < uxmin) || (
gxwork[npt-1] > uxmax)) {
2167 if (optionLine != 0 && npt > 1) {
2178 offset = delta*baroffset; dbar = delta*barwidth;
2181 offset = (
x[1]-
x[0])*baroffset;
2182 dbar = (
x[1]-
x[0])*barwidth;
2184 offset = (
y[1]-
y[0])*baroffset;
2185 dbar = (
y[1]-
y[0])*barwidth;
2188 drawbordersav = drawborder;
2192 xhigh = wmin+offset+dbar;
2195 else ylow =
gPad->GetUymin();
2197 for (i=
first; i<=last;i++) {
2204 if (xlow < rwxmax && xhigh > rwxmin)
2208 xhigh = xhigh+delta;
2211 xi1 =
x[i]; xi =
x[i-1];
2213 Error(where,
"X must be in increasing order");
2216 offset = (
x[i+1]-
x[i])*baroffset;
2217 dbar = (
x[i+1]-
x[i])*barwidth;
2218 xlow =
x[i] + offset;
2219 xhigh =
x[i] + offset + dbar;
2224 ylow = wmin + offset;
2225 yhigh = wmin + offset + dbar;
2227 else xlow =
gPad->GetUxmin();
2228 for (i=
first; i<=last;i++) {
2236 gPad->PaintBox(xlow,ylow,xhigh,yhigh);
2238 ylow = ylow + delta;
2239 yhigh = yhigh + delta;
2242 yi1 =
y[i]; yi =
y[i-1];
2244 Error(where,
"Y must be in increasing order");
2247 offset = (
y[i+1]-
y[i])*baroffset;
2248 dbar = (
y[i+1]-
y[i])*barwidth;
2249 ylow =
y[i] + offset;
2250 yhigh =
y[i] + offset + dbar;
2261 if ((optionStar) || (optionMark)) optionMarker=1;
2267 for (i=
first; i<=last;i++) {
2268 if (!optionBins) xm = wmin+(i-
first)*delta+0.5*delta;
2269 else xm =
x[i-1] + 0.5*(
x[i]-
x[i-1]);
2271 if (optionMark != 10) {
2272 if (ym<rwymax && ym > rwymin) {
2278 if (ym<rwymax && ym >= rwymin) {
2295 wminstep = wmin + 0.5*delta;
2296 for (i=
first; i<=last;i++) {
2297 if (!optionBins) ym = wminstep+(i-
first)*delta+0.5*delta;
2298 else ym =
y[i-1] + 0.5*(
y[i]-
y[i-1]);
2300 if (optionMark != 10) {
2301 if (xm<rwxmax && xm > rwxmin) {
2307 if (xm<rwxmax && xm >= rwxmin) {
2347 const Int_t kBASEMARKER=8;
2348 Double_t s2x, s2y, symbolsize, sbase;
2349 Double_t x,
y, xl1, xl2, xr1, xr2, yup1, yup2, ylow1, ylow2, tx, ty;
2350 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};
2351 static Float_t cyy[15] = {1,1,1,1,1,1,1,1,1,0.5,0.6,1,1,1,1};
2360 if (strchr(option,
'X') || strchr(option,
'x')) {
PaintGraphSimple(theGraph, option);
return;}
2363 if (strstr(option,
"||") || strstr(option,
"[]")) {
2365 if (strstr(option,
"[]")) braticks =
kTRUE;
2368 if (strchr(option,
'z')) endLines =
kFALSE;
2369 if (strchr(option,
'Z')) endLines =
kFALSE;
2370 const char *arrowOpt = 0;
2371 if (strchr(option,
'>')) arrowOpt =
">";
2372 if (strstr(option,
"|>")) arrowOpt =
"|>";
2375 if (strchr(option,
'a')) axis =
kTRUE;
2376 if (strchr(option,
'A')) axis =
kTRUE;
2384 if (strchr(option,
'0')) option0 =
kTRUE;
2385 if (strchr(option,
'2')) option2 =
kTRUE;
2386 if (strchr(option,
'3')) option3 =
kTRUE;
2387 if (strchr(option,
'4')) {option3 =
kTRUE; option4 =
kTRUE;}
2388 if (strchr(option,
'5')) {option2 =
kTRUE; option5 =
kTRUE;}
2391 xline =
new Double_t[2*theNpoints];
2392 yline =
new Double_t[2*theNpoints];
2393 if (!xline || !yline) {
2394 Error(
"Paint",
"too many points, out of memory");
2401 theGraph->TAttLine::Modify();
2416 sbase = symbolsize*kBASEMARKER;
2429 tx =
gPad->PixeltoX(dxend) -
gPad->PixeltoX(0);
2430 ty =-
gPad->PixeltoY(dxend) +
gPad->PixeltoY(0);
2431 Float_t asize = 0.6*symbolsize*kBASEMARKER/
gPad->GetWh();
2434 for (
Int_t i=0;i<theNpoints;i++) {
2435 x =
gPad->XtoPad(theX[i]);
2436 y =
gPad->YtoPad(theY[i]);
2439 if (x < gPad->GetUxmin())
x =
gPad->GetUxmin();
2440 if (
x >
gPad->GetUxmax())
x =
gPad->GetUxmax();
2441 if (y < gPad->GetUymin())
y =
gPad->GetUymin();
2442 if (
y >
gPad->GetUymax())
y =
gPad->GetUymax();
2444 if (x < gPad->GetUxmin())
continue;
2445 if (
x >
gPad->GetUxmax())
continue;
2446 if (y < gPad->GetUymin())
continue;
2447 if (
y >
gPad->GetUymax())
continue;
2451 xl2 =
gPad->XtoPad(theX[i] - theEXlow[i]);
2455 x1b =
gPad->XtoPad(theX[i] - theEXlow[i]);
2456 y1b =
gPad->YtoPad(theY[i] - theEYlow[i]);
2457 x2b =
gPad->XtoPad(theX[i] + theEXhigh[i]);
2458 y2b =
gPad->YtoPad(theY[i] + theEYhigh[i]);
2459 if (x1b < gPad->GetUxmin()) x1b =
gPad->GetUxmin();
2460 if (x1b >
gPad->GetUxmax()) x1b =
gPad->GetUxmax();
2461 if (y1b < gPad->GetUymin()) y1b =
gPad->GetUymin();
2462 if (y1b >
gPad->GetUymax()) y1b =
gPad->GetUymax();
2463 if (x2b < gPad->GetUxmin()) x2b =
gPad->GetUxmin();
2464 if (x2b >
gPad->GetUxmax()) x2b =
gPad->GetUxmax();
2465 if (y2b < gPad->GetUymin()) y2b =
gPad->GetUymin();
2466 if (y2b >
gPad->GetUymax()) y2b =
gPad->GetUymax();
2467 if (option5)
box.PaintBox(x1b, y1b, x2b, y2b,
"l");
2468 else box.PaintBox(x1b, y1b, x2b, y2b);
2476 yline[if1-1] =
gPad->YtoPad(theY[i] + theEYhigh[i]);
2477 yline[if2-1] =
gPad->YtoPad(theY[i] - theEYlow[i]);
2485 arrow.PaintArrow(xl1,
y,xl2,
y,asize,arrowOpt);
2487 if (!brackets)
gPad->PaintLine(xl1,
y,xl2,
y);
2490 xb[0] = xl2+tx; yb[0] =
y-ty;
2491 xb[1] = xl2; yb[1] =
y-ty;
2492 xb[2] = xl2; yb[2] =
y+ty;
2493 xb[3] = xl2+tx; yb[3] =
y+ty;
2494 gPad->PaintPolyLine(4, xb, yb);
2496 gPad->PaintLine(xl2,
y-ty,xl2,
y+ty);
2502 xr2 =
gPad->XtoPad(theX[i] + theEXhigh[i]);
2505 arrow.PaintArrow(xr1,
y,xr2,
y,asize,arrowOpt);
2507 if (!brackets)
gPad->PaintLine(xr1,
y,xr2,
y);
2510 xb[0] = xr2-tx; yb[0] =
y-ty;
2511 xb[1] = xr2; yb[1] =
y-ty;
2512 xb[2] = xr2; yb[2] =
y+ty;
2513 xb[3] = xr2-tx; yb[3] =
y+ty;
2514 gPad->PaintPolyLine(4, xb, yb);
2516 gPad->PaintLine(xr2,
y-ty,xr2,
y+ty);
2522 yup2 =
gPad->YtoPad(theY[i] + theEYhigh[i]);
2523 if (yup2 >
gPad->GetUymax()) yup2 =
gPad->GetUymax();
2526 arrow.PaintArrow(
x,yup1,
x,yup2,asize,arrowOpt);
2528 if (!brackets)
gPad->PaintLine(
x,yup1,
x,yup2);
2531 xb[0] =
x-tx; yb[0] = yup2-ty;
2532 xb[1] =
x-tx; yb[1] = yup2;
2533 xb[2] =
x+tx; yb[2] = yup2;
2534 xb[3] =
x+tx; yb[3] = yup2-ty;
2535 gPad->PaintPolyLine(4, xb, yb);
2537 gPad->PaintLine(
x-tx,yup2,
x+tx,yup2);
2543 ylow2 =
gPad->YtoPad(theY[i] - theEYlow[i]);
2544 if (ylow2 < gPad->GetUymin()) ylow2 =
gPad->GetUymin();
2545 if (ylow2 < ylow1) {
2547 arrow.PaintArrow(
x,ylow1,
x,ylow2,asize,arrowOpt);
2549 if (!brackets)
gPad->PaintLine(
x,ylow1,
x,ylow2);
2552 xb[0] =
x-tx; yb[0] = ylow2+ty;
2553 xb[1] =
x-tx; yb[1] = ylow2;
2554 xb[2] =
x+tx; yb[2] = ylow2;
2555 xb[3] =
x+tx; yb[3] = ylow2+ty;
2556 gPad->PaintPolyLine(4, xb, yb);
2558 gPad->PaintLine(
x-tx,ylow2,
x+tx,ylow2);
2572 if (option4)
PaintGraph(theGraph, 2*theNpoints, xline, yline,
"FC");
2573 else PaintGraph(theGraph, 2*theNpoints, xline, yline,
"F");
2574 gPad->SetLogx(logx);
2575 gPad->SetLogy(logy);
2594 const Int_t kBASEMARKER=8;
2595 Double_t s2x, s2y, symbolsize, sbase;
2596 Double_t x,
y, xl1, xl2, xr1, xr2, yup1, yup2, ylow1, ylow2, tx, ty;
2598 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};
2599 static Float_t cyy[15] = {1,1,1,1,1,1,1,1,1,0.5,0.6,1,1,1,1};
2612 if (strchr(option,
'X') || strchr(option,
'x')) {
PaintGraphSimple(theGraph, option);
return;}
2615 if (strstr(option,
"||") || strstr(option,
"[]")) {
2617 if (strstr(option,
"[]")) braticks =
kTRUE;
2620 if (strchr(option,
'z')) endLines =
kFALSE;
2621 if (strchr(option,
'Z')) endLines =
kFALSE;
2622 const char *arrowOpt = 0;
2623 if (strchr(option,
'>')) arrowOpt =
">";
2624 if (strstr(option,
"|>")) arrowOpt =
"|>";
2627 if (strchr(option,
'a')) axis =
kTRUE;
2628 if (strchr(option,
'A')) axis =
kTRUE;
2636 if (strchr(option,
'0')) option0 =
kTRUE;
2637 if (strchr(option,
'2')) option2 =
kTRUE;
2638 if (strchr(option,
'3')) option3 =
kTRUE;
2639 if (strchr(option,
'4')) {option3 =
kTRUE; option4 =
kTRUE;}
2640 if (strchr(option,
'5')) {option2 =
kTRUE; option5 =
kTRUE;}
2643 xline =
new Double_t[2*theNpoints];
2644 yline =
new Double_t[2*theNpoints];
2645 if (!xline || !yline) {
2646 Error(
"Paint",
"too many points, out of memory");
2653 theGraph->TAttLine::Modify();
2668 sbase = symbolsize*kBASEMARKER;
2681 tx =
gPad->PixeltoX(dxend) -
gPad->PixeltoX(0);
2682 ty =-
gPad->PixeltoY(dxend) +
gPad->PixeltoY(0);
2683 Float_t asize = 0.6*symbolsize*kBASEMARKER/
gPad->GetWh();
2686 for (
Int_t i=0;i<theNpoints;i++) {
2687 x =
gPad->XtoPad(theX[i]);
2688 y =
gPad->YtoPad(theY[i]);
2689 bxl =
gPad->YtoPad(theY[i]+theEXlowd[i]);
2690 bxh =
gPad->YtoPad(theY[i]+theEXhighd[i]);
2691 byl =
gPad->XtoPad(theX[i]+theEYlowd[i]);
2692 byh =
gPad->XtoPad(theX[i]+theEYhighd[i]);
2695 if (x < gPad->GetUxmin())
x =
gPad->GetUxmin();
2696 if (
x >
gPad->GetUxmax())
x =
gPad->GetUxmax();
2697 if (y < gPad->GetUymin())
y =
gPad->GetUymin();
2698 if (
y >
gPad->GetUymax())
y =
gPad->GetUymax();
2700 if (x < gPad->GetUxmin())
continue;
2701 if (
x >
gPad->GetUxmax())
continue;
2702 if (y < gPad->GetUymin())
continue;
2703 if (
y >
gPad->GetUymax())
continue;
2709 x1b =
gPad->XtoPad(theX[i] - theEXlow[i]);
2710 y1b =
gPad->YtoPad(theY[i] - theEYlow[i]);
2711 x2b =
gPad->XtoPad(theX[i] + theEXhigh[i]);
2712 y2b =
gPad->YtoPad(theY[i] + theEYhigh[i]);
2713 if (x1b < gPad->GetUxmin()) x1b =
gPad->GetUxmin();
2714 if (x1b >
gPad->GetUxmax()) x1b =
gPad->GetUxmax();
2715 if (y1b < gPad->GetUymin()) y1b =
gPad->GetUymin();
2716 if (y1b >
gPad->GetUymax()) y1b =
gPad->GetUymax();
2717 if (x2b < gPad->GetUxmin()) x2b =
gPad->GetUxmin();
2718 if (x2b >
gPad->GetUxmax()) x2b =
gPad->GetUxmax();
2719 if (y2b < gPad->GetUymin()) y2b =
gPad->GetUymin();
2720 if (y2b >
gPad->GetUymax()) y2b =
gPad->GetUymax();
2721 if (option5)
box.PaintBox(x1b, y1b, x2b, y2b,
"l");
2722 else box.PaintBox(x1b, y1b, x2b, y2b);
2730 yline[if1-1] =
gPad->YtoPad(theY[i] + theEYhigh[i]);
2731 yline[if2-1] =
gPad->YtoPad(theY[i] - theEYlow[i]);
2738 xl2 =
gPad->XtoPad(theX[i] - theEXlow[i]);
2741 arrow.PaintArrow(xl1,
y,xl2,bxl,asize,arrowOpt);
2743 if (!brackets)
gPad->PaintLine(xl1,
y,xl2,bxl);
2746 xb[0] = xl2+tx; yb[0] = bxl-ty;
2747 xb[1] = xl2; yb[1] = bxl-ty;
2748 xb[2] = xl2; yb[2] = bxl+ty;
2749 xb[3] = xl2+tx; yb[3] = bxl+ty;
2750 gPad->PaintPolyLine(4, xb, yb);
2752 gPad->PaintLine(xl2,bxl-ty,xl2,bxl+ty);
2758 xr2 =
gPad->XtoPad(theX[i] + theEXhigh[i]);
2761 arrow.PaintArrow(xr1,
y,xr2,bxh,asize,arrowOpt);
2763 if (!brackets)
gPad->PaintLine(xr1,
y,xr2,bxh);
2766 xb[0] = xr2-tx; yb[0] = bxh-ty;
2767 xb[1] = xr2; yb[1] = bxh-ty;
2768 xb[2] = xr2; yb[2] = bxh+ty;
2769 xb[3] = xr2-tx; yb[3] = bxh+ty;
2770 gPad->PaintPolyLine(4, xb, yb);
2772 gPad->PaintLine(xr2,bxh-ty,xr2,bxh+ty);
2778 yup2 =
gPad->YtoPad(theY[i] + theEYhigh[i]);
2779 if (yup2 >
gPad->GetUymax()) yup2 =
gPad->GetUymax();
2782 arrow.PaintArrow(
x,yup1,byh,yup2,asize,arrowOpt);
2784 if (!brackets)
gPad->PaintLine(
x,yup1,byh,yup2);
2787 xb[0] = byh-tx; yb[0] = yup2-ty;
2788 xb[1] = byh-tx; yb[1] = yup2;
2789 xb[2] = byh+tx; yb[2] = yup2;
2790 xb[3] = byh+tx; yb[3] = yup2-ty;
2791 gPad->PaintPolyLine(4, xb, yb);
2793 gPad->PaintLine(byh-tx,yup2,byh+tx,yup2);
2799 ylow2 =
gPad->YtoPad(theY[i] - theEYlow[i]);
2800 if (ylow2 < gPad->GetUymin()) ylow2 =
gPad->GetUymin();
2801 if (ylow2 < ylow1) {
2803 arrow.PaintArrow(
x,ylow1,byl,ylow2,asize,arrowOpt);
2805 if (!brackets)
gPad->PaintLine(
x,ylow1,byl,ylow2);
2808 xb[0] = byl-tx; yb[0] = ylow2+ty;
2809 xb[1] = byl-tx; yb[1] = ylow2;
2810 xb[2] = byl+tx; yb[2] = ylow2;
2811 xb[3] = byl+tx; yb[3] = ylow2+ty;
2812 gPad->PaintPolyLine(4, xb, yb);
2814 gPad->PaintLine(byl-tx,ylow2,byl+tx,ylow2);
2828 if (option4)
PaintGraph(theGraph, 2*theNpoints, xline, yline,
"FC");
2829 else PaintGraph(theGraph, 2*theNpoints, xline, yline,
"F");
2830 gPad->SetLogx(logx);
2831 gPad->SetLogy(logy);
2850 const Int_t kBASEMARKER=8;
2851 Double_t s2x, s2y, symbolsize, sbase;
2852 Double_t x,
y,
ex,
ey, xl1, xl2, xr1, xr2, yup1, yup2, ylow1, ylow2, tx, ty;
2853 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};
2854 static Float_t cyy[15] = {1,1,1,1,1,1,1,1,1,0.5,0.6,1,1,1,1};
2861 if (strchr(option,
'X') || strchr(option,
'x')) {
PaintGraphSimple(theGraph, option);
return;}
2864 if (strstr(option,
"||") || strstr(option,
"[]")) {
2866 if (strstr(option,
"[]")) braticks =
kTRUE;
2869 if (strchr(option,
'z')) endLines =
kFALSE;
2870 if (strchr(option,
'Z')) endLines =
kFALSE;
2871 const char *arrowOpt = 0;
2872 if (strchr(option,
'>')) arrowOpt =
">";
2873 if (strstr(option,
"|>")) arrowOpt =
"|>";
2876 if (strchr(option,
'a')) axis =
kTRUE;
2877 if (strchr(option,
'A')) axis =
kTRUE;
2885 if (strchr(option,
'0')) option0 =
kTRUE;
2886 if (strchr(option,
'2')) option2 =
kTRUE;
2887 if (strchr(option,
'3')) option3 =
kTRUE;
2888 if (strchr(option,
'4')) {option3 =
kTRUE; option4 =
kTRUE;}
2889 if (strchr(option,
'5')) {option2 =
kTRUE; option5 =
kTRUE;}
2892 xline =
new Double_t[2*theNpoints];
2893 yline =
new Double_t[2*theNpoints];
2894 if (!xline || !yline) {
2895 Error(
"Paint",
"too many points, out of memory");
2902 theGraph->TAttLine::Modify();
2917 sbase = symbolsize*kBASEMARKER;
2930 tx =
gPad->PixeltoX(dxend) -
gPad->PixeltoX(0);
2931 ty =-
gPad->PixeltoY(dxend) +
gPad->PixeltoY(0);
2932 Float_t asize = 0.6*symbolsize*kBASEMARKER/
gPad->GetWh();
2935 for (
Int_t i=0;i<theNpoints;i++) {
2936 x =
gPad->XtoPad(theX[i]);
2937 y =
gPad->YtoPad(theY[i]);
2940 if (x < gPad->GetUxmin())
x =
gPad->GetUxmin();
2941 if (
x >
gPad->GetUxmax())
x =
gPad->GetUxmax();
2942 if (y < gPad->GetUymin())
y =
gPad->GetUymin();
2943 if (
y >
gPad->GetUymax())
y =
gPad->GetUymax();
2945 if (x < gPad->GetUxmin())
continue;
2946 if (
x >
gPad->GetUxmax())
continue;
2947 if (y < gPad->GetUymin())
continue;
2948 if (
y >
gPad->GetUymax())
continue;
2956 x1b =
gPad->XtoPad(theX[i] -
ex);
2957 y1b =
gPad->YtoPad(theY[i] -
ey);
2958 x2b =
gPad->XtoPad(theX[i] +
ex);
2959 y2b =
gPad->YtoPad(theY[i] +
ey);
2960 if (x1b < gPad->GetUxmin()) x1b =
gPad->GetUxmin();
2961 if (x1b >
gPad->GetUxmax()) x1b =
gPad->GetUxmax();
2962 if (y1b < gPad->GetUymin()) y1b =
gPad->GetUymin();
2963 if (y1b >
gPad->GetUymax()) y1b =
gPad->GetUymax();
2964 if (x2b < gPad->GetUxmin()) x2b =
gPad->GetUxmin();
2965 if (x2b >
gPad->GetUxmax()) x2b =
gPad->GetUxmax();
2966 if (y2b < gPad->GetUymin()) y2b =
gPad->GetUymin();
2967 if (y2b >
gPad->GetUymax()) y2b =
gPad->GetUymax();
2968 if (option5)
box.PaintBox(x1b, y1b, x2b, y2b,
"l");
2969 else box.PaintBox(x1b, y1b, x2b, y2b);
2977 yline[if1-1] =
gPad->YtoPad(theY[i] +
ey);
2978 yline[if2-1] =
gPad->YtoPad(theY[i] -
ey);
2985 xl2 =
gPad->XtoPad(theX[i] -
ex);
2988 arrow.PaintArrow(xl1,
y,xl2,
y,asize,arrowOpt);
2990 if (!brackets)
gPad->PaintLine(xl1,
y,xl2,
y);
2993 xb[0] = xl2+tx; yb[0] =
y-ty;
2994 xb[1] = xl2; yb[1] =
y-ty;
2995 xb[2] = xl2; yb[2] =
y+ty;
2996 xb[3] = xl2+tx; yb[3] =
y+ty;
2997 gPad->PaintPolyLine(4, xb, yb);
2999 gPad->PaintLine(xl2,
y-ty,xl2,
y+ty);
3005 xr2 =
gPad->XtoPad(theX[i] +
ex);
3008 arrow.PaintArrow(xr1,
y,xr2,
y,asize,arrowOpt);
3010 if (!brackets)
gPad->PaintLine(xr1,
y,xr2,
y);
3013 xb[0] = xr2-tx; yb[0] =
y-ty;
3014 xb[1] = xr2; yb[1] =
y-ty;
3015 xb[2] = xr2; yb[2] =
y+ty;
3016 xb[3] = xr2-tx; yb[3] =
y+ty;
3017 gPad->PaintPolyLine(4, xb, yb);
3019 gPad->PaintLine(xr2,
y-ty,xr2,
y+ty);
3025 yup2 =
gPad->YtoPad(theY[i] +
ey);
3026 if (yup2 >
gPad->GetUymax()) yup2 =
gPad->GetUymax();
3029 arrow.PaintArrow(
x,yup1,
x,yup2,asize,arrowOpt);
3031 if (!brackets)
gPad->PaintLine(
x,yup1,
x,yup2);
3034 xb[0] =
x-tx; yb[0] = yup2-ty;
3035 xb[1] =
x-tx; yb[1] = yup2;
3036 xb[2] =
x+tx; yb[2] = yup2;
3037 xb[3] =
x+tx; yb[3] = yup2-ty;
3038 gPad->PaintPolyLine(4, xb, yb);
3040 gPad->PaintLine(
x-tx,yup2,
x+tx,yup2);
3046 ylow2 =
gPad->YtoPad(theY[i] -
ey);
3047 if (ylow2 < gPad->GetUymin()) ylow2 =
gPad->GetUymin();
3048 if (ylow2 < ylow1) {
3050 arrow.PaintArrow(
x,ylow1,
x,ylow2,asize,arrowOpt);
3052 if (!brackets)
gPad->PaintLine(
x,ylow1,
x,ylow2);
3055 xb[0] =
x-tx; yb[0] = ylow2+ty;
3056 xb[1] =
x-tx; yb[1] = ylow2;
3057 xb[2] =
x+tx; yb[2] = ylow2;
3058 xb[3] =
x+tx; yb[3] = ylow2+ty;
3059 gPad->PaintPolyLine(4, xb, yb);
3061 gPad->PaintLine(
x-tx,ylow2,
x+tx,ylow2);
3075 if (option4)
PaintGraph(theGraph, 2*theNpoints, xline, yline,
"FC");
3076 else PaintGraph(theGraph, 2*theNpoints, xline, yline,
"F");
3077 gPad->SetLogx(logx);
3078 gPad->SetLogy(logy);
3092 Double_t rwrmin, rwrmax, rwtmin, rwtmax;
3096 Int_t theNpoints = theGraphPolar->
GetN();
3102 if (theNpoints<1)
return;
3117 if (thePolargram)
if (!
gPad->FindObject(thePolargram->
GetName())) thePolargram=0;
3118 if (!thePolargram) {
3131 if (!thePolargram) {
3133 rwrmin = theY[0]; rwrmax = theY[theNpoints-1];
3134 rwtmin = theX[0]; rwtmax = theX[theNpoints-1];
3136 for (ipt = 0; ipt < theNpoints; ipt++) {
3139 if (theX[ipt] -theEX[ipt] < rwtmin) rwtmin = theX[ipt]-theEX[ipt];
3140 if (theX[ipt] +theEX[ipt] > rwtmax) rwtmax = theX[ipt]+theEX[ipt];
3142 if (theX[ipt] < rwtmin) rwtmin=theX[ipt];
3143 if (theX[ipt] > rwtmax) rwtmax=theX[ipt];
3146 if (theY[ipt] -theEY[ipt] < rwrmin) rwrmin = theY[ipt]-theEY[ipt];
3147 if (theY[ipt] +theEY[ipt] > rwrmax) rwrmax = theY[ipt]+theEY[ipt];
3149 if (theY[ipt] < rwrmin) rwrmin=theY[ipt];
3150 if (theY[ipt] > rwrmax) rwrmax=theY[ipt];
3154 if (rwrmin == rwrmax) rwrmax += 1.;
3155 if (rwtmin == rwtmax) rwtmax += 1.;
3162 rwtmax += dt/theNpoints;
3164 rwrmin = thePolargram->
GetRMin();
3165 rwrmax = thePolargram->
GetRMax();
3166 rwtmin = thePolargram->
GetTMin();
3167 rwtmax = thePolargram->
GetTMax();
3172 thePolargram =
new TGraphPolargram(
"Polargram",rwrmin,rwrmax,rwtmin,rwtmax);
3176 if (nolabel) thePolargram->
Draw(
"N");
3177 else thePolargram->
Draw(
"");
3186 Double_t radiusNDC = rwrmax-rwrmin;
3196 for (i=0; i<theNpoints; i++) {
3197 Double_t eymin, eymax, exmin,exmax;
3198 exmin = (theY[i]-theEY[i]-rwrmin)/radiusNDC*
3200 eymin = (theY[i]-theEY[i]-rwrmin)/radiusNDC*
3202 exmax = (theY[i]+theEY[i]-rwrmin)/radiusNDC*
3204 eymax = (theY[i]+theEY[i]-rwrmin)/radiusNDC*
3206 theGraphPolar->TAttLine::Modify();
3207 if (exmin != exmax || eymin != eymax)
gPad->PaintLine(exmin,eymin,exmax,eymax);
3211 for (i=0; i<theNpoints; i++) {
3215 theGraphPolar->TAttLine::Modify();
3216 if (phimin != phimax) thePolargram->
PaintCircle(0,0,
rad,phimin,phimax,0);
3222 if (!(
gPad->GetLogx()) && !(
gPad->GetLogy())) {
3223 Double_t a,
b,
c=1,
x1,
x2, y1, y2, discr, norm1, norm2, xts, yts;
3231 for (i=0; i<theNpoints; i++) {
3234 xt = (theY[i]-rwrmin)/radiusNDC*
TMath::Cos(
c*(theX[i]-rwtmin)/thetaNDC);
3235 yt = (theY[i]-rwrmin)/radiusNDC*
TMath::Sin(
c*(theX[i]-rwtmin)/thetaNDC);
3236 norm =
sqrt(xt*xt+yt*yt);
3241 if (!previouspointin) {
3246 a = (yt-yts)/(xt-xts);
3248 discr = 4*(
a*
a-
b*
b+1);
3253 norm1 =
sqrt((
x1-xt)*(
x1-xt)+(y1-yt)*(y1-yt));
3254 norm2 =
sqrt((
x2-xt)*(
x2-xt)+(y2-yt)*(y2-yt));
3255 previouspointin =
kFALSE;
3257 if (norm1 < norm2) {
3267 PaintGraph(theGraphPolar, j+1, theXpol, theYpol, opt);
3272 if (j>=1 && !previouspointin) {
3273 a = (yt-theYpol[j])/(xt-theXpol[j]);
3274 b = theYpol[j]-
a*theXpol[j];
3275 previouspointin =
kTRUE;
3276 discr = 4*(
a*
a-
b*
b+1);
3281 norm1 =
sqrt((
x1-xt)*(
x1-xt)+(y1-yt)*(y1-yt));
3282 norm2 =
sqrt((
x2-xt)*(
x2-xt)+(y2-yt)*(y2-yt));
3284 if (norm1 < norm2) {
3291 PaintGraph(theGraphPolar, j+1, theXpol, theYpol, opt);
3298 PaintGraph(theGraphPolar, j+1, theXpol, theYpol, opt);
3301 for (i=0; i<theNpoints; i++) {
3305 PaintGraph(theGraphPolar, theNpoints, theXpol, theYpol,opt);
3314 TIter next(
gPad->GetListOfPrimitives());
3315 while ((obj = next())) {
3319 if (strcmp(title->
GetName(),
"title")) {title = 0;
continue;}
3323 if (title)
delete title;
3329 if (ht <= 0) ht = 0.05;
3350 if (talh < 1) talh = 1;
else if (talh > 3) talh = 3;
3352 if (talv < 1) talv = 1;
else if (talv > 3) talv = 3;
3358 if (talh == 2) xpos = xpos-wt/2.;
3359 if (talh == 3) xpos = xpos-wt;
3360 if (talv == 2) ypos = ypos+ht/2.;
3361 if (talv == 1) ypos = ypos+ht;
3394 TF1 *theF = theGraphQQ->
GetF();
3397 Error(
"TGraphQQ::Paint",
"2nd dataset or theoretical function not specified");
3412 Double_t yxmin, xymin, yxmax, xymax;
3418 TLine line1, line2, line3;
3421 yxmin = (theYq2-theYq1)*(
xmin-theXq1)/(theXq2-theXq1) + theYq1;
3423 xymin = (theXq2-theXq1)*(
ymin-theYq1)/(theYq2-theYq1) + theXq1;
3429 line2.
PaintLine(xqmin, yqmin, xqmax, yqmax);
3431 yxmax = (theYq2-theYq1)*(
xmax-theXq1)/(theXq2-theXq1) + theYq1;
3433 xymax = (theXq2-theXq1)*(
ymax-theYq1)/(theYq2-theYq1) + theXq1;
3471 theHist->
Paint(
"0");
3484 std::vector<Double_t> newX(
N);
3485 std::vector<Double_t> newY(
N);
3497 if (
gPad->GetGridx()) {
3498 GL = (YA2-YA1)/(
gPad->GetY2() -
gPad->GetY1());
3514 theNewAxis->
Paint();
3517 for (
Int_t i=0; i<
N; i++) newX[i] = dX-X[i];
3519 for (
Int_t i=0; i<
N; i++) newX[i] = X[i];
3530 if (
gPad->GetGridy()) {
3531 GL = (XA2-XA1)/(
gPad->GetX2() -
gPad->GetX1());
3547 theNewAxis->
Paint();
3550 for (
Int_t i=0; i<
N; i++) newY[i] = dY-Y[i];
3552 for (
Int_t i=0; i<
N; i++) newY[i] = Y[i];
3557 for (
Int_t i=0; i<
N; i++) theNewGraph->
SetPoint(i, newX[i], newY[i]);
3580 if (strstr(option,
"H") || strstr(option,
"h")) {
3591 if (!functions)
return;
3627 Double_t x1,
x2, y1, y2,
x3, y3, xm, ym,
a, a1, a2, a3;
3630 Int_t ix1,iy1,ix2,iy2;
3634 gPad->GetPadPar(x1p,y1p,x2p,y2p);
3635 ix1 = (
Int_t)(iw*x1p);
3636 iy1 = (
Int_t)(ih*y1p);
3637 ix2 = (
Int_t)(iw*x2p);
3638 iy2 = (
Int_t)(ih*y2p);
3650 gPad->GetRange(rx1,ry1,rx2,ry2);
3651 Double_t rx = (x2ndc-x1ndc)/(rx2-rx1);
3652 Double_t ry = (y2ndc-y1ndc)/(ry2-ry1);
3656 xf[0] = rx*(
x[0]-rx1)+x1ndc;
3657 yf[0] = ry*(
y[0]-ry1)+y1ndc;
3659 for (i=1; i<
n; i++) {
3660 if (
x[i]==
x[i-1] &&
y[i]==
y[i-1])
continue;
3662 xf[nf] = rx*(
x[i]-rx1)+x1ndc;
3663 if (xf[i]==xf[i-1]) xf[i] += 0.000001;
3664 yf[nf] = ry*(
y[i]-ry1)+y1ndc;
3683 if (xf[nf]==xf[nf-1]) {
3688 if (xf[nf]>=xf[nf-1]) {
3697 for (i=1; i<nf; i++) {
3709 if (xi1<xi0) a1 = a1+3.14159;
3715 if (xi0<xi2) a2 = a2+3.14159;
3730 if ((xm-xi0)*(
x3-xi0)<0 && (ym-yi0)*(y3-yi0)<0) {
3734 if ((xm==
x1) && (ym==y1)) {
3743 if (xf[nf]==xf[0] && yf[nf]==yf[0]) {
3744 xm = (xt[nf]+xt[0])*0.5;
3745 ym = (yt[nf]+yt[0])*0.5;
3753 if ((xm-xf[0])*(
x3-xf[0])<0 && (ym-yf[0])*(y3-yf[0])<0) {
3767 for (i=nf2; i>0; i--) {
3768 for (j=i-1; j>0; j--) {
3769 if (xt[i-1]==xt[i] || xt[j-1]==xt[j])
continue;
3770 c1 = (yt[i-1]-yt[i])/(xt[i-1]-xt[i]);
3771 b1 = yt[i]-
c1*xt[i];
3772 c2 = (yt[j-1]-yt[j])/(xt[j-1]-xt[j]);
3773 b2 = yt[j]-
c2*xt[j];
3775 xc = (b2-b1)/(
c1-
c2);
3781 nf++; xf[nf] = xt[i]; yf[nf] = yt[i];
3782 nf++; xf[nf] = xc ; yf[nf] = yc;
3800 nf++; xf[nf] = xt[0]; yf[nf] = yt[0];
3803 for (i=0; i<nf+1; i++) {
3804 xf[i] = (1/rx)*(xf[i]-x1ndc)+rx1;
3805 yf[i] = (1/ry)*(yf[i]-y1ndc)+ry1;
3809 gPad->PaintFillArea(nf+1,xf,yf);
3810 theGraph->TAttLine::Modify();
3828 TIter next(functions);
3830 while ((obj = next())) {
3840 if (!dofit) fit = 0;
3842 if (dofit == 1) dofit = 111;
3844 Int_t print_fval = dofit%10;
3845 Int_t print_ferrors = (dofit/10)%10;
3846 Int_t print_fchi2 = (dofit/100)%10;
3847 Int_t print_fprob = (dofit/1000)%10;
3848 Int_t nlinesf = print_fval + print_fchi2 + print_fprob;
3849 if (fit) nlinesf += fit->
GetNpar();
3887 if (print_fchi2) stats->
AddText(t);
3893 if (print_fval || print_ferrors) {
3895 if (print_ferrors) {
3908 if (!done) functions->
Add(stats);
3938 Int_t i, k, kp,
km, npointsMax, banksize, n2, npt;
3939 Int_t maxiterations, finished;
3940 Int_t jtype, ktype, closed;
3941 Double_t sxmin, sxmax, symin, symax;
3944 Double_t ratio_signs, xratio, yratio;
3950 Double_t co, so, ct, st, ctu, stu, xnt;
3951 Double_t dx1, dy1, dx2, dy2, dk1, dk2;
3958 c = t = co = so = ct = st = ctu = stu = dx1 = dy1 = dx2 = dy2 = 0;
3959 xt = yt = xa = xb = ya = yb = u1 = u2 = u3 = tj = sb = 0;
3961 npointsMax = npoints*10;
3968 Error(
"Smooth",
"not enough space in memory");
3975 jtype = (drawtype%1000)-10;
3976 if (jtype > 0) { ktype = jtype; loptx =
kTRUE; }
3977 else ktype = drawtype%1000;
4006 for (i=1;i<npoints;i++) {
4008 if ((
x[i]-
x[i-1])*(
x[i-1]-
x[i-2]) < 0) six++;
4009 if ((
y[i]-
y[i-1])*(
y[i-1]-
y[i-2]) < 0) siy++;
4011 if (
x[i] < sxmin) sxmin =
x[i];
4012 if (
x[i] > sxmax) sxmax =
x[i];
4013 if (
y[i] < symin) symin =
y[i];
4014 if (
y[i] > symax) symax =
y[i];
4019 if (dx1n < 0.01*(sxmax-sxmin) && dy1n < 0.01*(symax-symin)) closed = 1;
4020 if (sxmin == sxmax) {
4023 if (six > 1) ratio_signs = siy/six;
4024 else ratio_signs = 20;
4025 xratio = ratio_signs/(sxmax-sxmin);
4027 if (symin == symax) yratio = 1;
4028 else yratio = 1/(symax-symin);
4032 for (i=0;i<npoints;i++) {
4033 x[i] = (
x[i]-sxmin)*xratio;
4034 y[i] = (
y[i]-symin)*yratio;
4053 if (
x[0] !=
x[npoints-1] ||
y[0] !=
y[npoints-1])
goto L40;
4054 if (
x[npoints-2] ==
x[npoints-1] &&
y[npoints-2] ==
y[npoints-1])
goto L40;
4055 if (
x[0] ==
x[1] &&
y[0] ==
y[1])
goto L40;
4078 if (npt > 1)
goto L310;
4082 if (
x[k-1] ==
x[k-2] &&
y[k-1] ==
y[k-2])
goto L50;
4087 if (npt > 1)
goto L310;
4090 if (k < npoints)
goto L90;
4091 if (!flgic) { kp = 2;
goto L130;}
4094 if (flgis)
goto L150;
4104 if (
x[k-1] ==
x[k] &&
y[k-1] ==
y[k])
goto L80;
4112 if (!flgis)
goto L50;
4127 dx1 =
x[k-1] -
x[
km-1];
4128 dy1 =
y[k-1] -
y[
km-1];
4129 dk1 = dx1*dx1 + dy1*dy1;
4130 dx2 =
x[kp-1] -
x[k-1];
4131 dy2 =
y[kp-1] -
y[k-1];
4132 dk2 = dx2*dx2 + dy2*dy2;
4133 ctu = dx1*dk2 + dx2*dk1;
4134 stu = dy1*dk2 + dy2*dk1;
4135 xnt = ctu*ctu + stu*stu;
4149 if (flgis)
goto L160;
4153 w3 = 2*(dx1*dy2-dx2*dy1);
4165 w3 = 2*(dx1*dy2-dx2*dy1);
4174 if (k <= 1)
goto L120;
4204 xa = (
a*t-2*dx)/tcube;
4205 xb = (3*dx-(co+
a)*t)/tsquare;
4206 ya = (
b*t-2*dy)/tcube;
4207 yb = (3*dy-(so+
b)*t)/tsquare;
4238 p2 = (u1*tj-u3)*3*tj+u2;
4268 z =
s*sth*(
s-
s*sth)*(w1*sth+w1+w2);
4269 z = z*z/((
a*
a+
b*
b)*(delta*delta));
4270 z = (z+2.642937)*z/((.3715652*z+3.063444)*z+.2441889)-cc;
4274 if (iw > 0)
goto L250;
4275 if (z > err)
goto L240;
4280 if (iw+2 == 0)
goto L190;
4281 if (iw+2 > 0)
goto L290;
4299 theGraph->
Zero(kp,0,sb,err,
s,z,maxiterations);
4300 if (kp == 2)
goto L210;
4302 Error(
"Smooth",
"Attempt to plot outside plot limits");
4305 if (iw > 0)
goto L200;
4331 qlx[npt] = sxmin + xt/xratio;
4332 qly[npt] = symin + yt/yratio;
4339 if (npt < banksize)
goto L320;
4340 if (drawtype >= 1000 || ktype > 1) {
4341 Int_t newsize = banksize + n2;
4343 for (i=0;i<banksize;i++) qtemp[i] = qlx[i];
4346 for (i=0;i<banksize;i++) qlx[i] = qtemp[i];
4347 for (i=0;i<banksize;i++) qtemp[i] = qly[i];
4350 for (i=0;i<banksize;i++) qly[i] = qtemp[i];
4359 if (drawtype >= 1000) {
4360 gPad->PaintFillArea(npt,qlx,qly,
"B");
4364 qlx[npt] = qlx[npt-1];
4365 qlx[npt+1] = qlx[0];
4371 qly[npt] = qly[npt-1];
4372 qly[npt+1] = qly[0];
4374 gPad->PaintFillArea(npt+2,qlx,qly);
4377 gPad->PaintPolyLine(npt,qlx,qly);
4380 qlx[0] = sxmin + xt/xratio;
4381 qly[0] = symin + yt/yratio;
4383 if (finished > 0)
goto L390;
4384 if (finished < 0) { finished = 0;
goto L110;}
4385 if (
s > 0)
goto L180;
4391 for (i=0;i<npoints;i++) {
4392 x[i] = sxmin +
x[i]/xratio;
4393 y[i] = symin +
y[i]/yratio;
static double p3(double t, double a, double b, double c, double d)
static double p1(double t, double a, double b)
static double p2(double t, double a, double b, double c)
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 The distance is expressed in per cent of the pad width.
virtual Float_t GetLabelSize() const
virtual Float_t GetTickLength() const
virtual void SetTickLength(Float_t length=0.03)
Set tick mark length The length is expressed in per cent of the pad width.
virtual Color_t GetFillColor() const
Return the fill area color.
virtual Style_t GetFillStyle() const
Return the fill area style.
virtual void SetFillColor(Color_t fcolor)
Set the fill area color.
virtual void SetFillStyle(Style_t fstyle)
Set the fill area style.
virtual Color_t GetLineColor() const
Return the line color.
virtual void SetLineStyle(Style_t lstyle)
Set the line style.
virtual Width_t GetLineWidth() const
Return the line width.
virtual void SetLineColor(Color_t lcolor)
Set the line color.
virtual Style_t GetLineStyle() const
Return the line style.
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 Int_t GetNDF() const
Return the number of degrees of freedom in the fit the fNDF parameter has been previously computed du...
virtual Double_t GetParError(Int_t ipar) const
Return value of parameter number ipar.
Double_t GetChisquare() const
virtual Int_t GetNpar() const
virtual const char * GetParName(Int_t ipar) const
virtual Double_t GetParameter(Int_t ipar) const
virtual void Paint(Option_t *chopt="")
Draw this axis with its current attributes.
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)
void SetTickSize(Float_t ticksize)
void SetLabelSize(Float_t labelsize)
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.
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 Graph is a graphics 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 const char * GetFitFormat() const
void SetParent(TObject *obj)
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)
void ToLower()
Change string to lower-case.
int CompareTo(const char *cs, ECaseCompare cmp=kExact) const
Compare a string to char *cs2.
const char * Data() const
TString & ReplaceAll(const TString &s1, const TString &s2)
void ToUpper()
Change string to upper case.
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)
double dist(Rotation3D const &r1, Rotation3D const &r2)
static constexpr double s
static constexpr double rad
static constexpr double km
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)