697 fLabelOffset = 0.005;
703 fTitleSize = fLabelSize;
732 fGridLength = gridlength;
733 fLabelOffset = 0.005;
739 fTitleSize = fLabelSize;
764 fFunction = (
TF1*)
gROOT->GetFunction(funcname);
766 Error(
"TGaxis",
"calling constructor with an unknown function: %s", funcname);
770 fWmin = fFunction->GetXmin();
771 fWmax = fFunction->GetXmax();
773 fFunctionName= funcname;
777 fGridLength = gridlength;
778 fLabelOffset = 0.005;
784 fTitleSize = fLabelSize;
800 fGridLength(ax.fGridLength),
801 fTickSize(ax.fTickSize),
802 fLabelOffset(ax.fLabelOffset),
803 fLabelSize(ax.fLabelSize),
804 fTitleOffset(ax.fTitleOffset),
805 fTitleSize(ax.fTitleSize),
807 fLabelColor(ax.fLabelColor),
808 fLabelFont(ax.fLabelFont),
809 fNModLabs(ax.fNModLabs),
813 fTimeFormat(ax.fTimeFormat),
814 fFunctionName(ax.fFunctionName),
815 fFunction(ax.fFunction),
818 if (ax.IsOwnedModLabs())
819 fModLabs = (
TList *) ax.fModLabs->Clone();
821 fModLabs = ax.fModLabs;
832 TAttText::operator=(ax);
948 return gStyle->GetAxisMaxDigits();
1013 const char *where =
"PaintAxis";
1023 Double_t phil, phi, sinphi, cosphi;
1024 Double_t binLow = 0., binLow2 = 0., binLow3 = 0.;
1025 Double_t binHigh = 0., binHigh2 = 0., binHigh3 = 0.;
1026 Double_t binWidth = 0., binWidth2 = 0., binWidth3 = 0.;
1029 Double_t wlabel, dwlabel, axis_value;
1034 Double_t x0, x1, y0, y1, xx0, xx1, yy0, yy1;
1035 xx0 = xx1 = yy0 = yy1 = 0;
1036 Double_t xxmin, xxmax, yymin, yymax;
1037 xxmin = xxmax = yymin = yymax = 0;
1041 Double_t xmnlog, x00, x11, h2, h2sav, axmul,
y;
1044 Int_t nlabels, nticks, nticks0 = 0, nticks1 = 0;
1045 Int_t i, j, k,
l, decade;
1049 Int_t iexe, if1, if2, na, nf, ih1, ih2, nbinin, nch, kmod;
1050 Int_t optionLog,optionBlank,optionVert,optionPlus,optionMinus,optionUnlab,optionPara;
1051 Int_t optionDown,optionRight,optionLeft,optionCent,optionEqual,optionDecimals=0,optionDot;
1052 Int_t optionY,optionText,optionGrid,optionSize,optionNoopt,optionInt,optionM,optionUp,optionX;
1053 Int_t optionTime, optionArrow;
1054 Int_t first=0,last=0,labelnumber;
1055 Int_t xalign, yalign;
1056 Int_t nn1, nn2, nn3, n1a, n2a, n3a, nb2, nb3;
1057 Int_t nbins=10, n1aold, nn1old;
1059 n1aold = nn1old = 0;
1083 chtemp = &kchtemp[0];
1084 label = &chlabel[0];
1103 if(strchr(chopt,
'G')) optionLog = 1;
else optionLog = 0;
1104 if(strchr(chopt,
'B')) optionBlank= 1;
else optionBlank= 0;
1105 if(strchr(chopt,
'V')) optionVert = 1;
else optionVert = 0;
1106 if(strchr(chopt,
'+')) optionPlus = 1;
else optionPlus = 0;
1107 if(strchr(chopt,
'-')) optionMinus= 1;
else optionMinus= 0;
1108 if(strchr(chopt,
'U')) optionUnlab= 1;
else optionUnlab= 0;
1109 if(strchr(chopt,
'P')) optionPara = 1;
else optionPara = 0;
1110 if(strchr(chopt,
'O')) optionDown = 1;
else optionDown = 0;
1111 if(strchr(chopt,
'R')) optionRight= 1;
else optionRight= 0;
1112 if(strchr(chopt,
'L')) optionLeft = 1;
else optionLeft = 0;
1113 if(strchr(chopt,
'C')) optionCent = 1;
else optionCent = 0;
1114 if(strchr(chopt,
'=')) optionEqual= 1;
else optionEqual= 0;
1115 if(strchr(chopt,
'Y')) optionY = 1;
else optionY = 0;
1116 if(strchr(chopt,
'T')) optionText = 1;
else optionText = 0;
1117 if(strchr(chopt,
'W')) optionGrid = 1;
else optionGrid = 0;
1118 if(strchr(chopt,
'S')) optionSize = 1;
else optionSize = 0;
1119 if(strchr(chopt,
'N')) optionNoopt= 1;
else optionNoopt= 0;
1120 if(strchr(chopt,
'I')) optionInt = 1;
else optionInt = 0;
1121 if(strchr(chopt,
'M')) optionM = 1;
else optionM = 0;
1122 if(strchr(chopt,
'0')) optionUp = 1;
else optionUp = 0;
1123 if(strchr(chopt,
'X')) optionX = 1;
else optionX = 0;
1124 if(strchr(chopt,
't')) optionTime = 1;
else optionTime = 0;
1125 if(strchr(chopt,
'.')) optionDot = 1;
else optionDot = 0;
1130 if (!
gStyle->GetStripDecimals()) optionDecimals = 1;
1132 if(strchr(chopt,
'>')) optionArrow = 1;
1133 if(strchr(chopt,
'<')) optionArrow = optionArrow+2;
1135 if (
fAxis->GetLabels()) {
1141 TList *ml =
fAxis->GetModifiedLabels();
1151 Error(where,
"Invalid number of divisions: %d",ndiv);
1158 if (gridlength == 0) gridlength = 0.8;
1187 TString stringtimeoffset =
fTimeFormat(idF+2,lnF);
1188 Int_t year, mm, dd, hh, mi, ss;
1189 if (sscanf(stringtimeoffset.
Data(),
"%d-%d-%d %d:%d:%d", &year, &mm, &dd, &hh, &mi, &ss) == 6) {
1192 tp.tm_year = year-1900;
1206 TString sdp = stringtimeoffset(ids+1,lns);
1207 sscanf(sdp.
Data(),
"%g",&dp);
1211 Error(where,
"Time offset has not the right format");
1214 timeoffset =
gStyle->GetTimeOffset();
1216 wmin += timeoffset - (int)(timeoffset);
1217 wmax += timeoffset - (int)(timeoffset);
1221 time_t timetp = (time_t)((
Long_t)(timeoffset));
1224 if (range>60) rangeBase = 60*20;
1225 if (range>3600) rangeBase = 3600*20;
1226 if (range>86400) rangeBase = 86400*20;
1227 if (range>2419200) rangeBase = 31556736;
1229 if (range>31536000) {
1230 tp0 = gmtime(&timetp);
1237 rangeBase = (timetp-mktime(tp0));
1238 rangeOffset = (
Double_t) (rangeBase);
1240 wmax += rangeOffset;
1241 wmin += rangeOffset;
1246 n2a = (ndiv%10000 - n1a)/100;
1247 n3a = (ndiv%1000000 - n2a -n1a)/10000;
1252 maxDigits = (ndiv/1000000);
1253 if (maxDigits==0) maxDigits =
gStyle->GetAxisMaxDigits();
1261 if (wmin == wmax || ndiv == 0 || n1a <= 1 || optionLog) {
1267 if ( (wmax-wmin) < 1 && optionInt) {
1268 Error(where,
"option I not available");
1271 if (!optionNoopt || optionInt ) {
1279 if (binLow !=
Double_t(
int(binLow)) || binWidth !=
Double_t(
int(binWidth))) {
1283 if ((wmin-binLow) > epsilon) { binLow += binWidth; nbins--; }
1284 if ((binHigh-wmax) > epsilon) { binHigh -= binWidth; nbins--; }
1289 yymin = rtyw*(binLow-wmin) +
ymin;
1290 yymax = rtyw*(binHigh-wmin) +
ymin;
1294 xxmin = rtxw*(binLow-wmin) +
xmin;
1295 xxmax = rtxw*(binHigh-wmin) +
xmin;
1303 yymin = alfa*xxmin +
beta;
1304 yymax = alfa*xxmax +
beta;
1319 if (!optionNoopt && n2a > 1 && binWidth > 0) {
1325 if (!optionNoopt && n3a > 1 && binWidth2 > 0) {
1339 ratio1 = 1/(rwxmax-rwxmin);
1340 ratio2 = 1/(rwymax-rwymin);
1341 x0 = ratio1*(
xmin-rwxmin);
1342 x1 = ratio1*(
xmax-rwxmin);
1343 y0 = ratio2*(
ymin-rwymin);
1344 y1 = ratio2*(
ymax-rwymin);
1345 if (!optionNoopt || optionInt ) {
1346 xx0 = ratio1*(xxmin-rwxmin);
1347 xx1 = ratio1*(xxmax-rwxmin);
1348 yy0 = ratio2*(yymin-rwymin);
1349 yy1 = ratio2*(yymax-rwymin);
1352 if ((x0 == x1) && (y0 == y1)) {
1353 Error(where,
"length of axis is 0");
1360 if (toffset==0 && x1 == x0) autotoff =
kTRUE;
1373 if (!
gPad->IsBatch()) {
1374 gVirtualX->GetCharacterUp(chupxvsav, chupyvsav);
1379 axis_length =
TMath::Sqrt((x1-x0)*(x1-x0)+(y1-y0)*(y1-y0));
1380 if (axis_length == 0) {
1381 Error(where,
"length of axis is 0");
1384 if (!optionNoopt || optionInt) {
1385 axis_lengthN =
TMath::Sqrt((xx1-xx0)*(xx1-xx0)+(yy1-yy0)*(yy1-yy0));
1386 axis_length0 =
TMath::Sqrt((xx0-x0)*(xx0-x0)+(yy0-y0)*(yy0-y0));
1387 axis_length1 =
TMath::Sqrt((x1-xx1)*(x1-xx1)+(y1-yy1)*(y1-yy1));
1388 if (axis_lengthN < epsilon) {
1397 wmin += timeoffset - (int)(timeoffset) + rangeOffset;
1398 wmax += timeoffset - (int)(timeoffset) + rangeOffset;
1404 if (y1>=y0) phi = 0.5*
kPI;
1429 if (x0 == x1 && y1 > y0) mside = -1;
1430 if (optionPlus) mside = 1;
1431 if (optionMinus) mside = -1;
1432 if (optionPlus && optionMinus) mside = 0;
1435 if (optionEqual) lside = mside;
1436 if (optionPlus && optionMinus) {
1438 if (optionEqual) lside=1;
1443 if(xmside >= 0) tick_side = 1;
1444 else tick_side = -1;
1445 if (optionSize) atick[0] = tick_side*axis_length*
fTickSize;
1446 else atick[0] = tick_side*axis_length*0.03;
1448 atick[1] = 0.5*atick[0];
1449 atick[2] = 0.5*atick[1];
1452 if ((x0 == x1) && (y1 > y0)) grid_side =-1;
1479 if (optionArrow==1)
a.PaintArrowNDC(xpl1, ypl1, xpl2, ypl2, as,
"|>");
1480 if (optionArrow==2)
a.PaintArrowNDC(xpl1, ypl1, xpl2, ypl2, as,
"<|");
1481 if (optionArrow==3)
a.PaintArrowNDC(xpl1, ypl1, xpl2, ypl2, as,
"<|>");
1489 if (ndiv == 0)
return;
1491 Error(where,
"wmin (%f) == wmax (%f)", wmin, wmax);
1501 if (optionText &&
GetLabelFont()%10 != 3) charheight *= 0.66666;
1511 if (!optionUp && !optionDown && !optionY && !optionUnlab) {
1517 for (i=
fAxis->GetFirst(); i<=fAxis->GetLast(); i++) {
1523 for (i=
fAxis->GetFirst(); i<=fAxis->GetLast(); i++) {
1526 if (nl > 50) angle = 90;
1539 strlcpy(chtemp,
fAxis->GetBinLabel(i), 255);
1547 }
else if ((!strcmp(
fAxis->GetName(),
"yaxis") && !
gPad->TestBit(
kHori))
1548 || (!strcmp(
fAxis->GetName(),
"xaxis") &&
gPad->TestBit(
kHori))) {
1558 double scale=
gPad->GetWw()*
gPad->GetWNDC();
1559 if (scale>0.0) toffset =
TMath::Max(toffset,(
double)w/scale);
1561 strlcpy(chtemp,
fAxis->GetBinLabel(i), 255);
1564 fAxis->GetBinCenter(i),
1570 strlcpy(chtemp,
fAxis->GetBinLabel(i), 255);
1584 if (!
gPad->IsBatch()) {
1585 if (cosphi > 0)
gVirtualX->SetCharacterUp(-sinphi,cosphi);
1586 else gVirtualX->SetCharacterUp(sinphi,-cosphi);
1587 if (x0 == x1)
gVirtualX->SetCharacterUp(0,1);
1588 if (optionVert)
gVirtualX->SetCharacterUp(0,1);
1589 if (optionPara)
gVirtualX->SetCharacterUp(-sinphi,cosphi);
1590 if (optionDown)
gVirtualX->SetCharacterUp(cosphi,sinphi);
1596 if (x0 == x1) xalign = 3;
1597 if (y0 != y1) yalign = 2;
1598 if (optionCent) xalign = 2;
1599 if (optionRight) xalign = 3;
1600 if (optionLeft) xalign = 1;
1604 if (cosphi*sinphi > 0) xalign = 1;
1605 if (cosphi*sinphi < 0) xalign = 3;
1611 if (optionPlus && !optionMinus) {
1616 if (lside < 0) ylabel += atick[0];
1618 }
else if (y0 == y1) {
1619 if (optionMinus && !optionPlus) {
1630 if (mside <= 0) ylabel -=
TMath::Abs(atick[0]);
1632 if (optionLog) ylabel -= 0.5*charheight;
1637 if (optionText) ylabel /= 2;
1640 if (!optionLog && ndiv) {
1642 dxtick = (binHigh-binLow)/
Double_t(nticks-1);
1643 axis_length0 = binLow-wmin;
1644 axis_length1 = wmax-binHigh;
1646 if (optionNoopt && !optionInt) dxtick = axis_length/
Double_t(nticks-1);
1647 else dxtick = axis_lengthN/
Double_t(nticks-1);
1649 if (!optionNoopt || optionInt) {
1656 std::vector<Double_t> ticksx, ticksy, gridx, gridy;
1657 if (!drawGridOnly) {
1658 ticksx.reserve(nticks + nticks0 + nticks1);
1659 ticksy.reserve(nticks + nticks0 + nticks1);
1662 gridx.reserve((nticks + nticks0 + nticks1) / nn2 + 2);
1663 gridy.reserve((nticks + nticks0 + nticks1) / nn2 + 2);
1666 auto draw_tick = [&](
int indx,
double xtick,
double xf) {
1668 if (indx % nn2 == 0)
1670 else if (indx % nn3 == 0)
1677 xtick = zz * axis_length /
TMath::Abs(rwma-rwmi);
1680 Double_t ytick = mside ? 0. : -atick[ltick];
1681 if (optionNoopt && !optionInt) {
1682 Rotate(xtick,ytick,cosphi,sinphi,x0,y0, xpl2,ypl2);
1683 Rotate(xtick,atick[ltick],cosphi,sinphi,x0,y0, xpl1,ypl1);
1685 Rotate(xtick,ytick,cosphi,sinphi,xx0,yy0, xpl2,ypl2);
1686 Rotate(xtick,atick[ltick],cosphi,sinphi,xx0,yy0, xpl1,ypl1);
1689 if ((x0 != x1) && (y0 != y1)) {
1692 if (cosphi > 0) ypl1 = ypl2 + atick[ltick];
1693 else ypl1 = ypl2 - atick[ltick];
1695 xpl1 = 0.5*(xpl1 + xpl2);
1697 ypl1 = 0.5*(ypl1 + ypl2) + atick[ltick];
1698 ypl2 = 0.5*(ypl1 + ypl2) - atick[ltick];
1702 if (!drawGridOnly) {
1704 if (optionArrow == 1)
1705 paint_tick = (x1 != x0) ? (xpl2 < x1) : (ypl2 < y1);
1706 else if (optionArrow == 2)
1707 paint_tick = (x1 != x0) ? (xpl1 > x0) : (ypl1 > y0);
1708 else if (optionArrow == 3)
1709 paint_tick = (x1 != x0) ? (xpl1 > x0 && xpl2 < x1) : (ypl1 > y0 && ypl2 < y1);
1711 ticksx.push_back(xpl1);
1712 ticksx.push_back(xpl2);
1713 ticksy.push_back(ypl1);
1714 ticksy.push_back(ypl2);
1718 if (optionGrid && (ltick == 0)) {
1719 if (optionNoopt && !optionInt) {
1720 Rotate(xtick,0,cosphi,sinphi,x0,y0, xpl2,ypl2);
1721 Rotate(xtick,grid_side*gridlength,cosphi,sinphi,x0,y0, xpl1,ypl1);
1723 Rotate(xtick,0,cosphi,sinphi,xx0,yy0, xpl2,ypl2);
1724 Rotate(xtick,grid_side*gridlength,cosphi,sinphi,xx0,yy0, xpl1,ypl1);
1726 gridx.push_back(xpl1);
1727 gridx.push_back(xpl2);
1728 gridy.push_back(ypl1);
1729 gridy.push_back(ypl2);
1733 for (k = 0; k < nticks; k++)
1736 for (k = 1; k <= nticks0; k++)
1739 for (k = 1; k <= nticks1; k++)
1740 draw_tick(k,
Double_t(nticks-1 + k) * dxtick, binHigh +
Double_t(k)*dxtick);
1743 if (ticksx.size() > 0) {
1745 gPad->PaintSegmentsNDC(ticksx.size() / 2, ticksx.data(), ticksy.data());
1749 if (gridx.size() > 0) {
1750 linegrid.TAttLine::Modify();
1751 gPad->PaintSegmentsNDC(gridx.size() / 2, gridx.data(), gridy.data());
1756 if (!drawGridOnly && !optionUnlab) {
1760 if ((wmin == wmax) || (ndiv == 0)) {
1761 Error(where,
"wmin (%f) == wmax (%f), or ndiv == 0", wmin, wmax);
1765 dwlabel = (wmax-wmin)/
Double_t(n1a);
1766 if (optionNoopt && !optionInt) dxlabel = axis_length/
Double_t(n1a);
1767 else dxlabel = axis_lengthN/
Double_t(n1a);
1769 if (!optionText && !optionTime) {
1791 if (iexe%3 == 1) iexe += 2;
1792 else if(iexe%3 == 2) iexe += 1;
1793 if (nexe < 0) nexe = -iexe;
1806 if (!noExponent && nf > maxDigits) flexpo =
kTRUE;
1807 if (!noExponent && nf < -maxDigits) flexne =
kTRUE;
1818 if (nexe%3 == 0 && ww <=
TMath::Power(10,maxDigits-1))
break;
1830 if (nexe%3 == 0 && ww >= rne)
break;
1835 for (i=maxDigits-1; i>0; i--) {
1841 if (wdyn <= 0.999 && na < maxDigits-2) {
1861 if (if1 > 14) if1 = 14;
1862 if (if2 > 14) if2 = 14;
1863 if (if1 < 0) if1 = 0;
1866 len =
snprintf(chcoded,
sizeof(chcoded),
"%%%d.%df",if1,if2);
1868 len =
snprintf(chcoded,
sizeof(chcoded),
"%%%d.%df",if1+1,1);
1871 if ((len < 0) || (len >= (
int)
sizeof(chcoded)))
1872 strcpy(chcoded,
"%7.3f");
1878 Int_t ndecimals = 0;
1879 if (optionDecimals) {
1880 char *
dot = strchr(chtemp,
'.');
1882 ndecimals = chtemp + strlen(chtemp) -
dot;
1885 exp = strstr(chtemp,
"e-");
1887 sscanf(&exp[2],
"%d",&ndecimals);
1892 if (optionM) nlabels = n1a-1;
1895 for ( k=0; k<=nlabels; k++) {
1900 xlabel = zz* axis_length /
TMath::Abs(rwma-rwmi);
1904 if (optionM) xlabel += 0.5*dxlabel;
1906 axis_value = wlabel;
1908 if (!optionText && !optionTime) {
1909 snprintf(label,256,chcoded,wlabel);
1916 if (label[first] ==
'.') {
1917 strncpy(chtemp,
"0", 256);
1918 strlcat(chtemp, &label[first],256);
1919 strlcpy(label, chtemp, 256);
1920 first = 1; last = strlen(label);
1922 if (label[first] ==
'-' && label[first+1] ==
'.') {
1923 strncpy(chtemp,
"-0",256);
1924 strlcat(chtemp, &label[first+1],256);
1925 strlcpy(label, chtemp, 256);
1926 first = 1; last = strlen(label);
1931 char *adot = strchr(label,
'.');
1932 if (adot) adot[ndecimals] = 0;
1934 while (label[last] ==
'0') { label[last] = 0; last--;}
1938 if (label[last] ==
'.') {
1939 if (!optionDot) { label[last] = 0; last--;}
1943 if (last-first == 1 && label[first] ==
'-'
1944 && label[last] ==
'0') {
1945 strncpy(label,
"0", 256);
1953 timed = wlabel + (int)(timeoffset) - rangeOffset;
1954 timelabel = (time_t)((
Long_t)(timed));
1955 if (optionTime == 1) {
1956 utctis = localtime(&timelabel);
1958 utctis = gmtime(&timelabel);
1960 TString timeformattmp;
1961 if (timeformat.
Length() < 220) timeformattmp = timeformat;
1962 else timeformattmp =
"#splitline{Format}{too long}";
1968 snprintf(label, 256,
"%%S%7.5f", modf(timed,&tmpdb));
1969 tmplast = strlen(label)-1;
1972 while (label[tmplast] ==
'0') {
1973 label[tmplast] = 0; tmplast--;
1982 if (utctis !=
nullptr) {
1983 strftime(label, 256, timeformattmp.
Data(), utctis);
1985 strncpy(label,
"invalid", 256);
1987 strlcpy(chtemp, &label[0], 256);
1988 first = 0; last=strlen(label)-1;
1989 wlabel = wTimeIni + (k+1)*dwlabel;
1994 if (optionNoopt && !optionInt)
1995 Rotate (xlabel,ylabel,cosphi,sinphi,x0,y0,xx,yy);
1996 else Rotate (xlabel,ylabel,cosphi,sinphi,xx0,yy0,xx,yy);
1997 if (y0 == y1 && !optionDown && !optionUp) {
1998 yy -= 0.80*charheight;
2001 if (x0 != x1 && y0 != y1) {
2002 if (optionNoopt && !optionInt)
2003 Rotate (xlabel,0,cosphi,sinphi,x0,y0,xx,yy);
2004 else Rotate (xlabel,0,cosphi,sinphi,xx0,yy0,xx,yy);
2005 if (cosphi > 0 ) yy += ylabel;
2006 if (cosphi < 0 ) yy -= ylabel;
2009 if (!optionY || (x0 == x1)) {
2011 if (first > last) strncpy(chtemp,
" ", 256);
2012 else strlcpy(chtemp, &label[first], 255);
2015 if (!optionTime) typolabel.
ReplaceAll(
"-",
"#minus");
2020 double scale=
gPad->GetWw()*
gPad->GetWNDC();
2021 if (scale>0.0) toffset =
TMath::Max(toffset,(
double)w/scale);
2030 strlcpy(chtemp,
fAxis->GetBinLabel(k+
fAxis->GetFirst()), 255);
2042 if (!optionText) lnlen = last-first+1;
2044 if (k+1 > nhilab) lnlen = 0;
2046 for (
l=1;
l<=lnlen;
l++) {
2047 if (!optionText) *chtemp = label[first+
l-2];
2049 if (lnlen == 0) strncpy(chtemp,
" ", 256);
2050 else strncpy(chtemp,
"1", 256);
2059 yy -= charheight*1.3;
2066 if (flexe && !optionText && nexe) {
2067 snprintf(label,256,
"#times10^{%d}", nexe);
2068 if (x0 != x1) { xfactor = axis_length+0.1*charheight; yfactor = 0; }
2069 else { xfactor = y1-y0+0.1*charheight; yfactor = 0; }
2070 Rotate (xfactor,yfactor,cosphi,sinphi,x0,y0,xx,yy);
2074 if (
fAxis && !strcmp(
fAxis->GetName(),
"xaxis")) {
2076 gStyle->GetExponentOffset(xoff, yoff,
"x");
2080 if (
fAxis && !strcmp(
fAxis->GetName(),
"yaxis")) {
2082 gStyle->GetExponentOffset(xoff, yoff,
"y");
2100 if (optionLog && ndiv) {
2101 UInt_t xi1=0,xi2=0,wi=0,yi1=0,yi2=0,
hi=0,xl=0,xh=0;
2103 if ((wmin == wmax) || (ndiv == 0)) {
2104 Error(where,
"wmin (%f) == wmax (%f), or ndiv == 0", wmin, wmax);
2108 Error(where,
"negative logarithmic axis");
2112 Error(where,
"negative logarithmic axis");
2116 if (xmnlog > 0) xmnlog += 1.E-6;
2117 else xmnlog -= 1.E-6;
2122 if (h2 > 0) h2 += 1.E-6;
2127 axmul = (x11-x00)/(h2sav-xmnlog);
2129 std::vector<Double_t> ticksx, ticksy, gridsx, gridsy;
2131 if (!drawGridOnly) {
2132 ticksx.reserve(nbinin*2);
2133 ticksy.reserve(nbinin*2);
2136 gridsx.reserve(nbinin*2);
2137 gridsy.reserve(nbinin*2);
2141 Int_t id = 0, num = 0;
2145 std::vector<LogLabel> loglabels;
2146 if (!drawGridOnly && !optionUnlab)
2147 loglabels.reserve(nbinin);
2153 if ( xmnlog > 0 && (xmnlog-
Double_t(ih1) > 0) ) labelnumber++;
2154 Int_t changelablogid = 0;
2155 Int_t changelablognum = 0;
2156 for (j=1; j<=nbinin; j++) {
2161 if (x0 == x1 && j == 1) ylabel += charheight*0.33;
2162 if (y0 == y1 && j == 1) ylabel -= charheight*0.65;
2163 xone = x00+axmul*(
Double_t(decade)-xmnlog);
2165 if (j < 0) printf(
"j=%d\n",j);
2166 if (x00 > xone)
goto L160;
2167 if ((xone-x11)>epsilon)
break;
2170 if (!mside)
y -= atick[0];
2171 Rotate(xone,
y,cosphi,sinphi,x0,y0,xpl2,ypl2);
2172 Rotate(xtwo,atick[0],cosphi,sinphi,x0,y0,xpl1,ypl1);
2174 if ((x0 != x1) && (y0 != y1)) {
2177 if (cosphi > 0) ypl1 = ypl2 + atick[0];
2178 else ypl1 = ypl2 - atick[0];
2181 xpl1 = 0.5*(xpl1 + xpl2);
2183 ypl1 = 0.5*(ypl1 + ypl2) + atick[0];
2184 ypl2 = 0.5*(ypl1 + ypl2) - atick[0];
2188 if (!drawGridOnly) {
2189 ticksx.emplace_back(xpl1);
2190 ticksx.emplace_back(xpl2);
2191 ticksy.emplace_back(ypl1);
2192 ticksy.emplace_back(ypl2);
2196 Rotate(xone,0,cosphi,sinphi,x0,y0,xpl2,ypl2);
2197 Rotate(xone,grid_side*gridlength,cosphi,sinphi,x0,y0,xpl1,ypl1);
2198 gridsx.emplace_back(xpl1);
2199 gridsx.emplace_back(xpl2);
2200 gridsy.emplace_back(ypl1);
2201 gridsy.emplace_back(ypl2);
2204 if (!drawGridOnly && !optionUnlab) {
2212 while (last > first) {
2213 if (label[last] !=
'0')
break;
2217 if (label[last] ==
'.') {label[last] = 0; last--;}
2219 snprintf(label,256,
"%d", labelnumber);
2222 Rotate (xone,ylabel,cosphi,sinphi,x0,y0,xx,yy);
2223 if ((x0 == x1) && !optionPara) {
2226 if (labelnumber == 0) nch=1;
2228 xx += nch*charheight;
2230 xx += 0.25*charheight;
2233 xx += 0.25*charheight;
2235 if ((y0 == y1) && !optionDown && !optionUp) {
2236 if (noExponent) yy += 0.33*charheight;
2238 if (n1a == 0)
return;
2240 if (kmod == 0) kmod=1000000;
2241 if ((nbinin <= n1a) || (j == 1) || (j == nbinin) || ((nbinin > n1a) && (j%kmod == 0))) {
2242 if (labelnumber == 0) {
2244 }
else if (labelnumber == 1) {
2248 chtemp = &label[first];
2250 snprintf(chtemp,256,
"10^{%d}", labelnumber);
2254 if (changelablogid == 0) changelablognum = nbinin-j;
2264 double scale=
gPad->GetWw()*
gPad->GetWNDC();
2265 if (scale>0.0) toffset =
TMath::Max(toffset,(
double)w/scale);
2267 loglabels.emplace_back();
2268 auto &back = loglabels.back();
2269 back.id = changelablogid;
2270 back.num = changelablognum;
2271 back.u =
gPad->GetX1() + xx*(
gPad->GetX2() -
gPad->GetX1());
2272 back.v =
gPad->GetY1() + yy*(
gPad->GetY2() -
gPad->GetY1());
2273 back.value = axis_value;
2274 back.lbl = typolabel;
2280 for (k=2;k<10;k++) {
2284 if (x00 > xone)
continue;
2285 if (xone > x11)
goto L200;
2287 if (!mside)
y -= atick[1];
2289 Rotate(xone,
y,cosphi,sinphi,x0,y0,xpl2,ypl2);
2290 Rotate(xtwo,atick[1],cosphi,sinphi,x0,y0,xpl1,ypl1);
2292 if ((x0 != x1) && (y0 != y1)) {
2295 if (cosphi > 0) ypl1 = ypl2 + atick[1];
2296 else ypl1 = ypl2 - atick[1];
2299 xpl1 = 0.5*(xpl1+xpl2);
2301 ypl1 = 0.5*(ypl1+ypl2) + atick[1];
2302 ypl2 = 0.5*(ypl1+ypl2) - atick[1];
2307 if ((nbinin <= idn) || ((nbinin > idn) && (k == 5))) {
2308 if (!drawGridOnly) {
2309 ticksx.emplace_back(xpl1);
2310 ticksx.emplace_back(xpl2);
2311 ticksy.emplace_back(ypl1);
2312 ticksy.emplace_back(ypl2);
2317 if (moreLogLabels && !optionUnlab && !drawGridOnly && !overlap) {
2323 if (labelnumber-1 == 0) {
2325 }
else if (labelnumber-1 == 1) {
2328 snprintf(chtemp,256,
"%d#times10^{%d}", k, labelnumber-1);
2331 Rotate (xone,ylabel,cosphi,sinphi,x0,y0,xx,yy);
2332 if ((x0 == x1) && !optionPara) {
2335 if (labelnumber == 0) nch=1;
2337 xx += nch*charheight;
2339 if (labelnumber >= 0) xx += 0.25*charheight;
2340 else xx += 0.50*charheight;
2343 xx += 0.25*charheight;
2345 if ((y0 == y1) && !optionDown && !optionUp) {
2346 if (noExponent) yy += 0.33*charheight;
2349 if ((x0 != x1) && (y0 != y1)) {
2350 Rotate(xone,ylabel,cosphi,sinphi,x0,y0,xx,yy);
2351 if (cosphi > 0) yy += ylabel;
2360 xi1 =
gPad->XtoAbsPixel(u);
2361 yi1 =
gPad->YtoAbsPixel(
v);
2369 loglabels.emplace_back();
2370 auto &back = loglabels.back();
2371 back.id = changelablogid;
2375 back.value = axis_value;
2376 back.lbl = typolabel;
2379 xi2 =
gPad->XtoAbsPixel(u);
2380 yi2 =
gPad->YtoAbsPixel(
v);
2383 if ((x0 == x1 && yi1-
hi <= yi2) || (y0 == y1 && xl+wi >= xh)){
2395 loglabels.emplace_back();
2396 auto &back = loglabels.back();
2397 back.id = changelablogid;
2401 back.value = axis_value;
2402 back.lbl = typolabel;
2409 if (optionGrid && nbinin <= 5 && ndiv > 100) {
2410 Rotate(xone,0,cosphi,sinphi,x0,y0, xpl2, ypl2);
2411 Rotate(xone,grid_side*gridlength,cosphi,sinphi,x0,y0, xpl1,ypl1);
2412 gridsx.emplace_back(xpl1);
2413 gridsx.emplace_back(xpl2);
2414 gridsy.emplace_back(ypl1);
2415 gridsy.emplace_back(ypl2);
2422 if (ticksx.size() > 0) {
2424 gPad->PaintSegmentsNDC(ticksx.size() / 2, ticksx.data(), ticksy.data());
2428 for(
auto & lbl : loglabels) {
2437 if (gridsx.size() > 0) {
2438 linegrid.TAttLine::Modify();
2439 gPad->PaintSegmentsNDC(gridsx.size() / 2, gridsx.data(), gridsy.data());
2445 if (!drawGridOnly && strlen(
GetTitle())) {
2449 charheight /= ((x1==x0) ? padw : padh);
2453 if (toffset) ylabel = xlside*charheight+toffset;
2454 else ylabel = xlside*1.6*charheight;
2456 ylabel = xlside*1.6*charheight*toffset;
2459 ylabel = xlside*1.3*charheight*toffset;
2462 if (toffset == 0.) toffset =
gStyle->GetTitleOffset(
"X");
2463 ylabel = xlside*1.6*charheight*toffset;
2467 else axispos = axis_length;
2486 Rotate(axispos,ylabel,cosphi,sinphi,x0,y0,xpl1,ypl1);
2513 if (binWidth <= 1) { binWidth = 1; binLow = int(A1); }
2515 Int_t width = int(binWidth/5) + 1;
2517 binLow = int(A1/binWidth)*binWidth;
2523 for (
Int_t ic=0; ic<1000; ic++) {
2525 Int_t ibl = int(binLow/binWidth);
2526 if ( (rbl-ibl) == 0 || ic > width) { binLow -= 5;
break;}
2533 while (xb <= binHigh) {
2537 binHigh = xb - binWidth;
2545 last = strlen(label)-1;
2546 for (
Int_t i=0; i<=last; i++) {
2547 if (strchr(
"1234567890-+.", label[i]) ) { first = i;
return; }
2549 Error(
"LabelsLimits",
"attempt to draw a blank label");
2568 TString::Format(
"%g, %g, %g, %g, %14.12g, %14.12g, %d, \"%s\", %g",
fX1,
fY1,
fX2,
fY2,
2575 out <<
" gaxis->SetName(\"" <<
GetName() <<
"\");\n";
2577 out <<
" gaxis->SetTitle(\"" << TString(
GetTitle()).ReplaceSpecialCppChars() <<
"\");\n";
2579 out <<
" gaxis->SetTimeFormat(\"" << TString(
fTimeFormat).ReplaceSpecialCppChars() <<
"\");\n";
2582 out <<
" gaxis->SetLabelSize(" <<
GetLabelSize() <<
");\n";
2586 out <<
" gaxis->SetLabelFont(" <<
GetLabelFont() <<
");\n";
2588 out <<
" gaxis->SetMoreLogLabels();\n";
2590 out <<
" gaxis->SetTickSize(" <<
GetTickSize() <<
");\n";
2592 out <<
" gaxis->SetTitleSize(" <<
GetTitleSize() <<
");\n";
2595 out <<
" gaxis->SetNoExponent();\n";
2598 while (
auto ml =
static_cast<TAxisModLab *
>(next())) {
2599 if (ml->GetLabNum() == 0)
2600 out <<
" gaxis->ChangeLabelByValue(" << ml->GetLabValue();
2602 out <<
" gaxis->ChangeLabel(" << ml->GetLabNum();
2603 out <<
", " << ml->GetAngle() <<
", " << ml->
GetSize() <<
", " << ml->GetAlign() <<
", "
2605 << TString(ml->GetText()).ReplaceSpecialCppChars() <<
"\");\n";
2631 if (!funcname || !funcname[0]) {
2637 Error(
"SetFunction",
"unknown function: %s", funcname);
2653 while (
auto ml = (TAxisModLab*)next()) {
2655 if (ml->GetLabNum() == 0) {
2658 }
else if (indx != 0) {
2659 Bool_t match = ml->GetLabNum() == indx;
2660 if (!match && (ml->GetLabNum() < 0) && (indx > 0) && (numlabels > 0)) {
2662 Error(
"FindModLab",
"reverse numbering in ChangeLabel doesn't work when more log labels are requested");
2666 match = indx == (ml->GetLabNum() + 2 + numlabels);
2668 if (match)
return ml;
2743 ml =
new TAxisModLab();
2814 TAxisModLab *ml =
FindModLab(0, 0, labValue, 0.);
2816 ml =
new TAxisModLab();
2846 t->TAttText::Copy(SavedAttText);
2848 auto ml =
FindModLab(i, nlabels, value, eps);
2867 SavedAttText.
Copy(*t);
2883 gStyle->SetAxisMaxDigits(maxd);
2956 TString timeformat = tformat;
2958 if (timeformat.
Index(
"%F")>=0 || timeformat.
IsNull()) {
2980 TString opt = option;
2990 timeoff = (time_t)((
Long_t)(toffset));
2994 utctis = gmtime(&timeoff);
2996 if (utctis !=
nullptr) {
2997 strftime(tmp, 20,
"%Y-%m-%d %H:%M:%S",utctis);
3022 gStyle->SetExponentOffset(xoff, yoff, axis);
3054 fName.Streamer(R__b);
int Int_t
Signed integer 4 bytes (int).
short Version_t
Class version identifier (short).
unsigned int UInt_t
Unsigned integer 4 bytes (unsigned int).
long Long_t
Signed long integer 4 bytes (long). Size depends on architecture.
bool Bool_t
Boolean (0=false, 1=true) (bool).
double Double_t
Double 8 bytes.
float Float_t
Float 4 bytes (float).
const char Option_t
Option string (const char).
Error("WriteTObject","The current directory (%s) is not associated with a file. The object (%s) has not been written.", GetName(), objname)
virtual Color_t GetTitleColor() const
virtual Color_t GetLabelColor() const
virtual Color_t GetAxisColor() const
virtual Style_t GetTitleFont() const
virtual Float_t GetLabelOffset() const
virtual Style_t GetLabelFont() const
virtual Float_t GetTitleSize() const
virtual Float_t GetLabelSize() const
virtual Float_t GetTickLength() const
virtual Float_t GetTitleOffset() const
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 SaveLineAttributes(std::ostream &out, const char *name, Int_t coldef=1, Int_t stydef=1, Int_t widdef=1)
Width_t fLineWidth
Line width.
virtual void SetLineColor(Color_t lcolor)
Set the line color.
Style_t fLineStyle
Line style.
Color_t fLineColor
Line color.
virtual Float_t GetTextSize() const
Return the text size.
virtual void SetTextAlign(Short_t align=11)
Set the text alignment.
virtual Font_t GetTextFont() const
Return the text font.
Color_t fTextColor
Text color.
Float_t fTextAngle
Text angle.
virtual Color_t GetTextColor() const
Return the text color.
virtual void Streamer(TBuffer &)
virtual void SetTextAngle(Float_t tangle=0)
Set the text angle.
virtual Float_t GetTextAngle() const
Return the text angle.
virtual void SetTextColor(Color_t tcolor=1)
Set the text color.
virtual void SetTextFont(Font_t tfont=62)
Set the text font.
Font_t fTextFont
Text font.
virtual void SetTextSize(Float_t tsize=1)
Set the text size.
Short_t fTextAlign
Text alignment.
void Copy(TAttText &atttext) const
virtual void SaveTextAttributes(std::ostream &out, const char *name, Int_t alidef=12, Float_t angdef=0, Int_t coldef=1, Int_t fondef=61, Float_t sizdef=1)
Float_t fTextSize
Text size.
TAxis helper class used to store the modified labels.
void SetColor(Int_t c=-1)
Set modified label color.
void SetSize(Double_t s=-1.)
Set modified label size.
const TString & GetText() const
void SetFont(Int_t f=-1)
Set modified label font.
void SetText(TString t="")
Set modified label text.
void SetLabValue(Double_t v=0.)
Set modified label value.
void SetAlign(Int_t a=-1)
Set modified label alignment.
void SetLabNum(Int_t n=0)
Set modified label number.
Double_t GetAngle() const
void SetAngle(Double_t a=-1.)
Set modified label angle.
Class to manage histogram axis.
const char * GetTitle() const override
Returns title of object.
@ kCenterLabels
Bit 13 is used by TObject.
Bool_t GetDecimals() const
virtual const char * GetTimeFormat() const
Buffer base class used for serializing objects.
virtual Version_t ReadVersion(UInt_t *start=nullptr, UInt_t *bcnt=nullptr, const TClass *cl=nullptr)=0
virtual Int_t CheckByteCount(UInt_t startpos, UInt_t bcnt, const TClass *clss)=0
virtual Int_t ReadClassBuffer(const TClass *cl, void *pointer, const TClass *onfile_class=nullptr)=0
virtual Int_t WriteClassBuffer(const TClass *cl, void *pointer)=0
virtual Int_t GetSize() const
Return the capacity of the collection, i.e.
static TString SavePrimitiveColor(Int_t ci)
virtual void SetNoExponent(Bool_t noExponent=kTRUE)
static Int_t GetMaxDigits()
void SetTimeFormat(const char *tformat)
void SetTitleOffset(Float_t titleoffset=1)
void ChangeLabelAttributes(Int_t i, Int_t nlabels, TLatex *t, char *c, Double_t value=0., Double_t eps=-1.)
Float_t fTitleSize
Size of title in NDC.
Float_t GetGridLength() const
void SetLabelFont(Int_t labelfont)
void SetTitleSize(Float_t titlesize)
virtual void PaintAxis(Double_t xmin, Double_t ymin, Double_t xmax, Double_t ymax, Double_t &wmin, Double_t &wmax, Int_t &ndiv, Option_t *chopt="", Double_t gridlength=0, Bool_t drawGridOnly=kFALSE)
void Streamer(TBuffer &) override
Stream an object of class TObject.
Float_t fTitleOffset
Offset of title wrt axis.
TString fTitle
Axis title.
Int_t fLabelFont
Font for labels.
TAxisModLab * FindModLab(Int_t indx, Int_t numlabels=0, Double_t v=0., Double_t eps=-1.) const
Int_t fLabelColor
Color for labels.
TAxis * fAxis
! Pointer to original TAxis axis (if any)
TString fTimeFormat
Time format, ex: 09/12/99 12:34:00.
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save a primitive as a C++ statement(s) on output stream "out".
TString fFunctionName
Name of mapping function pointed by fFunction.
virtual void SetDecimals(Bool_t dot=kTRUE)
void SetLabelOffset(Float_t labeloffset)
Float_t GetLabelOffset() const
virtual void ImportAxisAttributes(TAxis *axis)
void SetTimeOffset(Double_t toffset, Option_t *option="local")
Float_t fTickSize
Size of primary tick mark in NDC.
void ChangeLabelByValue(Double_t labValue, Double_t labAngle=-1., Double_t labSize=-1., Int_t labAlign=-1, Int_t labColor=-1, Int_t labFont=-1, const TString &labText="")
Int_t GetLabelFont() const
Float_t fLabelOffset
Offset of label wrt axis.
Float_t fLabelSize
Size of labels in NDC.
Int_t fNdiv
Number of divisions.
const char * GetTitle() const override
Returns title of object.
TString fChopt
Axis options.
TGaxis & operator=(const TGaxis &)
Float_t GetTitleOffset() const
TF1 * fFunction
! Pointer to function computing axis values
Float_t GetTitleSize() const
virtual void CenterLabels(Bool_t center=kTRUE)
const char * GetName() const override
Returns name of object.
void SetLabelColor(Int_t labelcolor)
virtual void CenterTitle(Bool_t center=kTRUE)
Float_t fGridLength
Length of the grid in NDC.
virtual void SetName(const char *name)
Int_t GetLabelColor() const
virtual void SetMoreLogLabels(Bool_t more=kTRUE)
TList * fModLabs
List of modified labels.
void ChangeLabel(Int_t labNum=0, Double_t labAngle=-1., Double_t labSize=-1., Int_t labAlign=-1, Int_t labColor=-1, Int_t labFont=-1, const TString &labText="")
Double_t fWmax
Highest value on the axis.
Float_t GetTickSize() const
void SetTickSize(Float_t ticksize)
void Paint(Option_t *chopt="") override
This method must be overridden if a class wants to paint itself.
Int_t fNModLabs
Number of modified labels.
virtual void Rotate(Double_t X, Double_t Y, Double_t CFI, Double_t SFI, Double_t XT, Double_t YT, Double_t &U, Double_t &V)
Double_t fWmin
Lowest value on the axis.
void SetLabelSize(Float_t labelsize)
void SetFunction(const char *funcname="")
virtual void AdjustBinSize(Double_t A1, Double_t A2, Int_t nold, Double_t &BinLow, Double_t &BinHigh, Int_t &nbins, Double_t &BinWidth)
virtual void SetTitle(const char *title="")
static void SetMaxDigits(Int_t maxd=5)
void LabelsLimits(const char *label, Int_t &first, Int_t &last)
Bool_t IsOwnedModLabs() const
void ResetLabelAttributes(TLatex *t)
Float_t GetLabelSize() const
static void SetExponentOffset(Float_t xoff=0., Float_t yoff=0., Option_t *axis="xy")
virtual TGaxis * DrawAxis(Double_t xmin, Double_t ymin, Double_t xmax, Double_t ymax, Double_t wmin, Double_t wmax, Int_t ndiv=510, Option_t *chopt="", Double_t gridlength=0)
void SetOption(Option_t *option="")
TClass * IsA() const override
static void Optimize(Double_t A1, Double_t A2, Int_t nold, Double_t &BinLow, Double_t &BinHigh, Int_t &nbins, Double_t &BWID, Option_t *option="")
Static function to compute reasonable axis limits.
virtual void PaintLatex(Double_t x, Double_t y, Double_t angle, Double_t size, const char *text)
void GetBoundingBox(UInt_t &w, UInt_t &h, Bool_t angle=kFALSE) override
Use the TLine constructor to create a simple line.
Double_t fY1
Y of 1st point.
Double_t fX1
X of 1st point.
Double_t fX2
X of 2nd point.
TLine & operator=(const TLine &src)
Assignment operator.
Double_t fY2
Y of 2nd point.
virtual void PaintLineNDC(Double_t u1, Double_t v1, Double_t u2, Double_t v2)
Draw this line with new coordinates in NDC.
void Streamer(TBuffer &) override
Stream an object of class TLine.
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
Bool_t TestBit(UInt_t f) const
virtual void AppendPad(Option_t *option="")
Append graphics object to current pad.
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
static void SavePrimitiveDraw(std::ostream &out, const char *variable_name, Option_t *option=nullptr)
Save invocation of primitive Draw() method Skipped if option contains "nodraw" string.
static void SavePrimitiveConstructor(std::ostream &out, TClass *cl, const char *variable_name, const char *constructor_agrs="", Bool_t empty_line=kTRUE)
Save object constructor in the output stream "out".
@ kCanDelete
if object in a list can be deleted
void ToLower()
Change string to lower-case.
const char * Data() const
TString & ReplaceAll(const TString &s1, const TString &s2)
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
virtual void SetText(Double_t x, Double_t y, const char *text)
static time_t MktimeFromUTC(tm_t *tmstruct)
Equivalent of standard routine "mktime" but using the assumption that tm struct is filled with UTC,...
double beta(double x, double y)
Calculates the beta function.
RVec< PromoteType< T > > exp(const RVec< T > &v)
Short_t Max(Short_t a, Short_t b)
Returns the largest of a and b.
Double_t ATan2(Double_t y, Double_t x)
Returns the principal value of the arc tangent of y/x, expressed in radians.
Double_t Sqrt(Double_t x)
Returns the square root of x.
LongDouble_t Power(LongDouble_t x, LongDouble_t y)
Returns x raised to the power y.
Short_t Min(Short_t a, Short_t b)
Returns the smallest of a and b.
Double_t Cos(Double_t)
Returns the cosine of an angle of x radians.
Double_t Sin(Double_t)
Returns the sine of an angle of x radians.
Double_t Log10(Double_t x)
Returns the common (base-10) logarithm of x.
Short_t Abs(Short_t d)
Returns the absolute value of parameter Short_t d.
BVH_ALWAYS_INLINE T dot(const Vec< T, N > &a, const Vec< T, N > &b)