56 :
TNamed ("Spectrum Painter2","Miroslav Morhac Painter")
60 gPad->Range(0, 0, 1 ,1);
62 fXmax = h2->GetNbinsX() - 1;
64 fYmax = h2->GetNbinsY() - 1;
66 fMaximumXScreenResolution = bs;
68 for (i = 0;i <= fXmax; i++) {
69 for (j = 0;j <= fYmax; j++) {
70 val = h2->GetBinContent(i + 1,j + 1);
71 if (val > fZmax) fZmax = val;
75 fBx1 =
gPad->XtoPixel(0.1);
76 fBx2 =
gPad->XtoPixel(0.99);
77 fBy1 =
gPad->YtoPixel(0.99);
78 fBy2 =
gPad->YtoPixel(0.05);
80 fModeGroup = kModeGroupLightHeight;
82 fDisplayMode = kDisplayModeSurface;
84 fZscale = kZScaleLinear;
86 fNodesx = fXmax-fXmin+1;
87 fNodesy = fYmax-fYmin+1;
115 fColorAlg = kColorAlgRgbSmooth;
137 fShadow = kShadowsNotPainted;
146 fBezier = kNoBezierInterpol;
152 fPenDash = kPenStyleSolid;
154 fChanmarkEnDis = kChannelMarksNotDrawn;
156 fChanmarkColor =
kBlue;
159 fChanmarkStyle = kChannelMarksStyleDot;
161 fChanlineEnDis = kChannelGridNotDrawn;
163 fChanlineColor =
kRed;
165 fEnvelope =
new Short_t [fMaximumXScreenResolution];
166 fEnvelopeContour =
new Short_t [fMaximumXScreenResolution];
167 for (i=0;i<fMaximumXScreenResolution;i++) {
169 fEnvelopeContour[i] = fBy2;
181 for (
int i=0; i<256; i++) {
209 if ((zmt==0)||(zmt==-3)||(zmt==-4)) {
216 if (zf>=1.0) zf = log(zf);
220 if (zf>0) zf = sqrt(zf);
249 Double_t da,db,dc=0,dd,dl,dm,dn,xtaz,ytaz,ztaz,
v=0,
v1;
254 if (z1>900) z1 = 900;
256 if (z2>900) z2 = 900;
258 if (z3>900) z3 = 900;
269 if ((i==1)||(i==3)) {
280 xtaz = (dx1+dx2+dx3)/3;
281 ytaz = (dy1+dy2+dy3)/3;
287 da = (dy2-dy1)*(z3-z1)-(dy3-dy1)*(z2-z1);
288 db = (z2-z1)*(dx3-dx1)-(z3-z1)*(dx2-dx1);
289 dc = (dx2-dx1)*(dy3-dy1)-(dx3-dx1)*(dy2-dy1);
290 dd = (da*da+db*db+dc*dc)*(dl*dl+dm*dm+dn*dn);
292 if (dd!=0)
v = (da*dl+db*dm+dc*dn)/dd;
310 if (da>=1) da=log(da);
311 if (db>=1) db=log(db);
330 da = (dy2-dy1)*(z3-z1)-(dy3-dy1)*(z2-z1);
331 db = (z2-z1)*(dx3-dx1)-(z3-z1)*(dx2-dx1);
332 dc = (dx2-dx1)*(dy3-dy1)-(dx3-dx1)*(dy2-dy1);
333 dd = (da*da+db*db+dc*dc)*(dl*dl+dm*dm+dn*dn);
335 if (dd!=0)
v = (da*dl+db*dm+dc*dn)/dd;
352 if (da>=1) da = log(da);
353 if (db>=1) db = log(db);
354 if (da!=0) dc = db/da;
393 Double_t pom1,pom2,sdx1=0,sdx2=0,sdy1,sdy2,spriz;
396 if (ztaz>900) ztaz = 900;
398 if (ztaz>32767) ztaz = 32767;
414 if (sx1<sx2) skrokx = 1;
416 if (sy1<sy2) skroky = 1;
420 if (
TMath::Abs(pom1)>0.0000001) sdx1 = pom2/pom1;
423 sdy1 = pom2-sdx1*pom1;
426 if (
TMath::Abs(pom1)>0.0000001) sdx2 = pom2/pom1;
429 sdy2 = pom2-sdx2*pom1;
432 pom2 = pom1*sdx1+sdy1;
434 for (;(sx1>(
fXmin-skrokx)) && (sx1<(
xmax-skrokx)) &&
435 (sy1>(
fYmin-skroky)) && (sy1<(
ymax-skroky)) &&
436 (spriz==0);sx1+=skrokx) {
438 pom2 = pom1*sdx1+sdy1;
442 pom2 = pom1*sdx2+sdy2;
443 sz2 = (
Int_t)(pom2+shad_noise);
444 if (sz1>sz2) spriz = 1;
447 }
else if (sy1!=sy2) {
448 if (sy1<sy2) skroky = 1;
452 if (
TMath::Abs(pom1)>0.0000001) sdx2 = pom2/pom1;
455 sdy2 = pom2-sdx2*pom1;
457 for (;(sy1>(
fYmin-skroky)) && (sy1<(
ymax-skroky)) &&
458 (spriz==0);sy1+=skroky) {
461 pom2 = pom1*sdx2+sdy2;
462 sz2 = (
Int_t)(pom2+shad_noise);
463 if (sz1>sz2) spriz=1;
479 unsigned long uinc1=0,uinc2=0,uinc3=0,upom,i;
484 else if (iv>255) iv = 255;
485 if (
gROOT->GetColor(250+iv)) {
493 if (
a >= UINT_MAX) uinc1 = UINT_MAX;
494 else uinc1 = (unsigned)
a;
496 i = (uinc1-upom)/256;
497 if ((i%2)==0) uinc1 = upom;
498 else uinc1 = 255-upom;
504 i = (uinc2-upom)/256;
505 if ((i%2)==0) uinc2 = upom;
506 else uinc2 = 255-upom;
512 i = (uinc3-upom)/256;
513 if ((i%2)==0) uinc3 = upom;
514 else uinc3 = 255-upom;
533 uinc2 = (
Int_t)green;
542 red =
a+0.956*
b+0.62*
c;
543 green =
a-0.272*
b-0.647*
c;
544 blue =
a-1.108*
b+1.705*
c;
545 if (red>=2) red = red-2;
546 else if (red>=1) red = 2-red;
547 if (green<0) green = -green;
548 if (blue>=2) blue = blue-2;
549 else if (blue>=1) blue = 2-blue;
550 else if (blue<-1) blue = 2+blue;
551 else if (blue<0) blue = -blue;
556 uinc2 = (
Int_t)green;
614 uinc2 = (
Int_t)green;
617 ui = uinc1+uinc2*256+uinc3*65536;
652 uinc2 = (
Int_t)green;
661 red =
a+0.956*
b+0.62*
c;
662 green =
a-0.272*
b-0.647*
c;
663 blue =
a-1.108*
b+1.705*
c;
664 if (red>=2) red = red-2;
665 else if (red>=1) red = red-1;
666 if (green<0) green = 1+green;
667 if (blue>=2) blue = blue-2;
668 else if (blue>=1) blue = blue-1;
669 else if (blue<-1) blue = 2+blue;
670 else if (blue<0) blue = 1+blue;
675 uinc2 = (
Int_t)green;
733 uinc2 = (
Int_t)green;
736 ui = uinc1+uinc2*256+uinc3*65536;
757 for (j=i+1;j<=3;j++)
a =
a*j;
758 for (j=1;j<=3-i;j++)
a =
a/j;
771 for (j=1;j<=i;j++)
v =
v*bezf;
772 for (j=1;j<=3-i;j++)
v =
v*(1-bezf);
801 Int_t x,
y,krok,xold=0,yold=0,prvy,yprv=0;
862 krok = (
x1<
x2)? 1:-1;
914 Int_t x,
y,krok,xold=0,yold=0,prvy,xprv,yprv=0;
949 krok = (
x1<
x2)? 1:-1;
1087 Int_t krok,xi,yi,xj,yj,
a,
b,as,bs,pr,ae,be;
1100 krok = (xi<xj)? 1:-1;
1117 if (yi!=yj)
b += (yi<yj)? +1:-1;
1134 gPad->PixeltoX(ae),
gPad->PixeltoY(be)+1);
1151 for (
a=xi;
a<=xj;
a++) {
1157 for (
a=xj;
a<=xi;
a++) {
1588 Int_t q1=0,q2=0,qv=0,smer=0,flag=0,i=0,j=0,
x1=0,
y1=0,
x2=0,
y2=0,x3=0,y3=0,x4=0,y4=0,uhl=0,xp1=0,yp1=0,xp2=0,yp2=0;
1589 Int_t ix5,iy5,x6,y6,x7,y7,y8,x1d,y1d,x2d=0,y2d=0;
1590 Int_t i1=0,i2=0,i3=0,i4=0,j1=0,j2=0,j3=0,j4=0;
1591 Int_t s1=0,s2=0,s3=0,s4=0,
t1=0,t2=0,t3=0,t4=0;
1592 Double_t dx1,dx2,dx3,dx4,dy1,dy2,dy3,dy4,z1,z2,z3,z4,zl,zh;
1593 Double_t xa,xb=0,ya,yb=0,x5=0,y5=0;
1594 Double_t da=0,db=0,dc=0,dd=0,xtaz,ytaz,ztaz,
v,shad_noise;
1595 Int_t iv=0,ekv,stvor,sx1,sx2,sx3,sx4,sx5,sy1,sy2,sy3,sy4,sy5;
1596 Double_t pom1,pom2,sdx1,sdy1,sdx2=0,sdy2,sdx3,sdy3,sdy4,spriz;
1597 Int_t sr1=0,sr2=0,sr3=0,sr4=0,sr5=0,sr6=0,sr7=0,sr8=0;
1598 Int_t tr1=0,tr2=0,tr3=0,tr4=0,tr5=0,tr6=0,tr7=0,tr8=0;
1599 Int_t il,iv1=0,iv2=0,iv3=0,iv4=0;
1600 Double_t v1=0,
v2=0,
v3=0,
v4=0,dxr1,dxr2,dyr1,dyr2,zr1,zr2,bezf;
1601 Double_t dcount_reg,z1l,z2l,z3l,z4l,sdx2p,sdy2p,dap,dbp,dcp,ddp;
1602 Int_t sx1p,sy1p,sx3p,uip=0;
1604 Double_t p000x,p000y,p100x,p100y,p010x,p010y,p110x,p110y;
1605 Double_t p001x,p001y,p101x,p101y,p011x,p011y,p111x,p111y;
1606 Int_t ibezx1=0,ibezy1=0,ibezx2,ibezy2;
1607 unsigned ui1,ui2,ui3;
1608 Double_t fi,alfa,beta,x3max,y3max,mul,movx,movy;
1610 Double_t mxx,mxy,myx,myy,myz,px,py,kx,ky;
1611 Double_t bxl,bxh,byl,byh,xd,yd,
a,
b,rotx,roty;
1621 printf(
"The canvas size exceed the maximum X screen resolution.\n");
1622 printf(
"Use the option bf() to increase the buffer size (it should be greater than %d).\n",
fBx2);
1657 alfa = (
fAlpha*3.1415927)/180;
1658 beta = (
fBeta*3.1415927)/180;
1667 mx = (bxh-bxl)/(x3max*(cos(alfa)+cos(beta)));
1668 my = (bxh-bxl)/(y3max*(cos(alfa)+cos(beta)));
1669 mul = (byh-byl)/(bxh-bxl);
1670 movx = bxl+my*cos(alfa)*y3max;
1671 mxx =
mx*cos(beta)*cos(fi)-my*cos(alfa)*sin(fi);
1672 mxy = (-1)*
mx*cos(beta)*sin(fi)-my*cos(alfa)*cos(fi);
1673 myx = mul*(
mx*sin(beta)*cos(fi)+my*sin(alfa)*sin(fi));
1674 myy = mul*((-1)*
mx*sin(beta)*sin(fi)+my*sin(alfa)*cos(fi));
1675 px = rotx*
mx*cos(beta)-roty*my*cos(alfa)+movx;
1690 mz = (bxh-bxl)*(cos(alfa)+cos(beta)-sin(alfa)-sin(beta));
1691 mz = mz/((zmax-zmin)*(cos(alfa)+cos(beta)));
1692 movy = byl+mul*mz*zmax;
1694 py = mul*(rotx*
mx*sin(beta)+roty*my*sin(alfa))+movy;
1699 if (zmin>=1) zmin = log(zmin);
1701 if (zmax>=1) zmax = log(zmax);
1703 if ((zmax-zmin)<0.000001) zmax = zmin+0.000001;
1704 mz = (bxh-bxl)*(cos(alfa)+cos(beta)-sin(alfa)-sin(beta));
1705 mz = mz/((zmax-zmin)*(cos(alfa)+cos(beta)));
1706 movy = byl+mul*mz*zmax;
1708 py = mul*(rotx*
mx*sin(beta)+roty*my*sin(alfa))+movy;
1713 if (zmin>=1) zmin = sqrt(zmin);
1715 if (zmax>=1) zmax = sqrt(zmax);
1717 if ((zmax-zmin)<0.000001) zmax = zmin+0.000001;
1718 mz = (bxh-bxl)*(cos(alfa)+cos(beta)-sin(alfa)-sin(beta));
1719 mz = mz/((zmax-zmin)*(cos(alfa)+cos(beta)));
1720 movy = byl+mul*mz*zmax;
1722 py = mul*(rotx*
mx*sin(beta)+roty*my*sin(alfa))+movy;
1732 dcount_reg=log(dcount_reg);
1735 dcount_reg=sqrt(dcount_reg);
1746 p000y =
gPad->PixeltoY(
fYt)+1;
1749 p100y =
gPad->PixeltoY(
fYt)+1;
1752 p010y =
gPad->PixeltoY(
fYt)+1;
1755 p110y =
gPad->PixeltoY(
fYt)+1;
1759 p001y =
gPad->PixeltoY(
fYt)+1;
1762 p101y =
gPad->PixeltoY(
fYt)+1;
1765 p011y =
gPad->PixeltoY(
fYt)+1;
1768 p111y =
gPad->PixeltoY(
fYt)+1;
1769 Double_t bmin, bmax, binLow, binHigh, binWidth;
1770 Double_t axisLevel, gridDist, gridY1, gridY2;
1771 Int_t ndivx = 0, ndivy, ndivz, nbins;
1778 axis->
PaintAxis(p000x, p000y, p100x, p100y, bmin, bmax, ndivx,
"");
1779 axis->
PaintAxis(p000x, p000y, p010x, p010y, bmin, bmax, ndivx,
"");
1781 axis->
PaintAxis(p000x, p000y, p001x, p001y, bmin, bmax, ndivx,
"");
1783 axis->
PaintAxis(p100x, p100y, p101x, p101y, bmin, bmax, ndivx,
"");
1784 axis->
PaintAxis(p101x, p101y, p001x, p001y, bmin, bmax, ndivx,
"");
1785 axis->
PaintAxis(p001x, p001y, p011x, p011y, bmin, bmax, ndivx,
"");
1791 nbins, binWidth,
" ");
1792 for (i = 0; i < nbins + 1; i++) {
1793 axisLevel = binLow+i*binWidth;
1794 gridDist = (axisLevel-bmin)*(p001y-p000y)/(bmax-bmin);
1795 gridY1 = p000y + gridDist, gridY2 = p100y + gridDist;
1797 gridY2 = p010y + gridDist;
1802 axis->
PaintAxis(p010x, p010y, p000x, p000y, bmin, bmax, ndivx,
"");
1803 axis->
PaintAxis(p010x, p010y, p110x, p110y, bmin, bmax, ndivx,
"");
1805 axis->
PaintAxis(p010x, p010y, p011x, p011y, bmin, bmax, ndivx,
"");
1807 axis->
PaintAxis(p000x, p000y, p001x, p001y, bmin, bmax, ndivx,
"");
1808 axis->
PaintAxis(p001x, p001y, p011x, p011y, bmin, bmax, ndivx,
"");
1809 axis->
PaintAxis(p011x, p011y, p111x, p111y, bmin, bmax, ndivx,
"");
1815 nbins, binWidth,
" ");
1816 for (i = 0; i < nbins + 1; i++) {
1817 axisLevel = binLow+i*binWidth;
1818 gridDist = (axisLevel-bmin)*(p011y-p010y)/(bmax-bmin);
1819 gridY1 = p010y + gridDist, gridY2 = p000y + gridDist;
1821 gridY2 = p110y + gridDist;
1826 axis->
PaintAxis(p110x, p110y, p010x, p010y, bmin, bmax, ndivx,
"");
1827 axis->
PaintAxis(p110x, p110y, p100x, p100y, bmin, bmax, ndivx,
"");
1829 axis->
PaintAxis(p110x, p110y, p111x, p111y, bmin, bmax, ndivx,
"");
1831 axis->
PaintAxis(p010x, p010y, p011x, p011y, bmin, bmax, ndivx,
"");
1832 axis->
PaintAxis(p011x, p011y, p111x, p111y, bmin, bmax, ndivx,
"");
1833 axis->
PaintAxis(p111x, p111y, p101x, p101y, bmin, bmax, ndivx,
"");
1839 nbins, binWidth,
" ");
1840 for (i = 0; i < nbins + 1; i++) {
1841 axisLevel = binLow+i*binWidth;
1842 gridDist = (axisLevel-bmin)*(p111y-p110y)/(bmax-bmin);
1843 gridY1 = p110y + gridDist, gridY2 = p010y + gridDist;
1845 gridY2 = p100y + gridDist;
1850 axis->
PaintAxis(p100x, p100y, p110x, p110y, bmin, bmax, ndivx,
"");
1851 axis->
PaintAxis(p100x, p100y, p000x, p000y, bmin, bmax, ndivx,
"");
1853 axis->
PaintAxis(p100x, p100y, p101x, p101y, bmin, bmax, ndivx,
"");
1855 axis->
PaintAxis(p110x, p110y, p111x, p111y, bmin, bmax, ndivx,
"");
1856 axis->
PaintAxis(p111x, p111y, p101x, p101y, bmin, bmax, ndivx,
"");
1857 axis->
PaintAxis(p101x, p101y, p001x, p001y, bmin, bmax, ndivx,
"");
1863 nbins, binWidth,
" ");
1864 for (i = 0; i < nbins + 1; i++) {
1865 axisLevel = binLow+i*binWidth;
1866 gridDist = (axisLevel-bmin)*(p101y-p100y)/(bmax-bmin);
1867 gridY1 = p100y + gridDist, gridY2 = p110y + gridDist;
1869 gridY2 = p000y + gridDist;
1888 if (
x2>=
x1) turnj = 1;
1889 if (x3>=
x2) turni = 1;
1917 if (smer==0) q1 -= 1;
1921 if (smer==0) q2 += 1;
1958 if ((q1!=q2||smer!=0) && flag==1) {
2053 xtaz = (dx1+dx2+dx4)/3;
2054 ytaz = (dy1+dy2+dy4)/3;
2055 ztaz = (z1+z2+z4)/3;
2059 if (sr1<0||sr1>w1||tr1<0||tr1>w2)
Transform(sr1,tr1,-1);
2064 if (sr8<0||sr8>w1||tr8<0||tr8>w2)
Transform(sr8,tr8,-1);
2073 if (sr3<0||sr3>w1||tr3<0||tr3>w2)
Transform(sr3,tr3,-1);
2078 if (sr2<0||sr2>w1||tr2<0||tr2>w2)
Transform(sr2,tr2,-1);
2088 if (sr5<0||sr5>w1||tr5<0||tr5>w2)
Transform(sr5,tr5,-1);
2093 if (sr4<0||sr4>w1||tr4<0||tr4>w2)
Transform(sr4,tr4,-1);
2103 if (sr7<0||sr7>w1||tr7<0||tr7>w2)
Transform(sr7,tr7,-1);
2108 if (sr6<0||sr6>w1||tr6<0||tr6>w2)
Transform(sr6,tr6,-1);
2122 if (sr1<0||sr1>w1||tr1<0||tr1>w2)
Transform(sr1,tr1,-1);
2127 if (sr8<0||sr8>w1||tr8<0||tr8>w2)
Transform(sr8,tr8,-1);
2132 da = (dxr1+dx2+dx1)/3;
2133 db = (dyr1+dy2+dy1)/3;
2137 da = (dxr1+dxr2+dx1)/3;
2138 db = (dyr1+dyr2+dy1)/3;
2139 dc = (zr1+zr2+z1)/3;
2142 da = (dxr2+dx1+dx4)/3;
2143 db = (dyr2+dy1+dy4)/3;
2148 if (sr3<0||sr3>w1||tr3<0||tr3>w2)
Transform(sr3,tr3,-1);
2153 if (sr2<0||sr2>w1||tr2<0||tr2>w2)
Transform(sr2,tr2,-1);
2158 da = (dx1+dx2+dx3)/3;
2159 db = (dy1+dy2+dy3)/3;
2163 da = (dx2+dxr1+dx3)/3;
2164 db = (dy2+dyr1+dy3)/3;
2168 da = (dx2+dxr2+dxr1)/3;
2169 db = (dy2+dyr2+dyr1)/3;
2170 dc = (z2+zr2+zr1)/3;
2173 da = (dxr2+dx2+dx1)/3;
2174 db = (dyr2+dy2+dy1)/3;
2179 if (sr5<0||sr5>w1||tr5<0||tr5>w2)
Transform(sr5,tr5,-1);
2184 if (sr4<0||sr4>w1||tr4<0||tr4>w2)
Transform(sr4,tr4,-1);
2189 da = (dx2+dx3+dx4)/3;
2190 db = (dy2+dy3+dy4)/3;
2194 da = (dx4+dx3+dxr1)/3;
2195 db = (dy4+dy3+dyr1)/3;
2199 da = (dx3+dxr2+dxr1)/3;
2200 db = (dy3+dyr2+dyr1)/3;
2201 dc = (z3+zr2+zr1)/3;
2204 da = (dx2+dxr2+dx3)/3;
2205 db = (dy2+dyr2+dy3)/3;
2210 if (sr7<0||sr7>w1||tr7<0||tr7>w2)
Transform(sr7,tr7,-1);
2215 if (sr6<0||sr6>w1||tr6<0||tr6>w2)
Transform(sr6,tr6,-1);
2220 da = (dx1+dx3+dx4)/3;
2221 db = (dy1+dy3+dy4)/3;
2225 da = (dx4+dx3+dxr2)/3;
2226 db = (dy4+dy3+dyr2)/3;
2230 da = (dx4+dxr2+dxr1)/3;
2231 db = (dy4+dyr2+dyr1)/3;
2232 dc = (z4+zr2+zr1)/3;
2235 da = (dx1+dx4+dxr1)/3;
2236 db = (dy1+dy4+dyr1)/3;
2308 xtaz = (dx3+dx2+dx4)/3;
2309 ytaz = (dy3+dy2+dy4)/3;
2310 ztaz = (z3+z2+z4)/3;
2365 if ((q1!=q2||smer!=0)&&flag==1) {
2460 xtaz = (dx1+dx2+dx4)/3;
2461 ytaz = (dy1+dy2+dy4)/3;
2462 ztaz = (z1+z2+z4)/3;
2466 if (sr1<0||sr1>w1||tr1<0||tr1>w2)
Transform(sr1,tr1,-1);
2471 if (sr8<0||sr8>w1||tr8<0||tr8>w2)
Transform(sr8,tr8,-1);
2480 if (sr3<0||sr3>w1||tr3<0||tr3>w2)
Transform(sr3,tr3,-1);
2485 if (sr2<0||sr2>w1||tr2<0||tr2>w2)
Transform(sr2,tr2,-1);
2495 if (sr5<0||sr5>w1||tr5<0||tr5>w2)
Transform(sr5,tr5,-1);
2500 if (sr4<0||sr4>w1||tr4<0||tr4>w2)
Transform(sr4,tr4,-1);
2510 if (sr7<0||sr7>w1||tr7<0||tr7>w2)
Transform(sr7,tr7,-1);
2515 if (sr6<0||sr6>w1||tr6<0||tr6>w2)
Transform(sr6,tr6,-1);
2529 if (sr1<0||sr1>w1||tr1<0||tr1>w2)
Transform(sr1,tr1,-1);
2534 if (sr8<0||sr8>w1||tr8<0||tr8>w2)
Transform(sr8,tr8,-1);
2539 da = (dxr1+dx2+dx1)/3;
2540 db = (dyr1+dy2+dy1)/3;
2544 da = (dxr1+dxr2+dx1)/3;
2545 db = (dyr1+dyr2+dy1)/3;
2546 dc = (zr1+zr2+z1)/3;
2549 da = (dxr2+dx1+dx4)/3;
2550 db = (dyr2+dy1+dy4)/3;
2555 if (sr3<0||sr3>w1||tr3<0||tr3>w2)
Transform(sr3,tr3,-1);
2560 if (sr2<0||sr2>w1||tr2<0||tr2>w2)
Transform(sr2,tr2,-1);
2565 da = (dx1+dx2+dx3)/3;
2566 db = (dy1+dy2+dy3)/3;
2570 da = (dx2+dxr1+dx3)/3;
2571 db = (dy2+dyr1+dy3)/3;
2575 da = (dx2+dxr2+dxr1)/3;
2576 db = (dy2+dyr2+dyr1)/3;
2577 dc = (z2+zr2+zr1)/3;
2580 da = (dxr2+dx2+dx1)/3;
2581 db = (dyr2+dy2+dy1)/3;
2586 if (sr5<0||sr5>w1||tr5<0||tr5>w2)
Transform(sr5,tr5,-1);
2591 if (sr4<0||sr4>w1||tr4<0||tr4>w2)
Transform(sr4,tr4,-1);
2596 da = (dx2+dx3+dx4)/3;
2597 db = (dy2+dy3+dy4)/3;
2601 da = (dx4+dx3+dxr1)/3;
2602 db = (dy4+dy3+dyr1)/3;
2606 da = (dx3+dxr2+dxr1)/3;
2607 db = (dy3+dyr2+dyr1)/3;
2608 dc = (z3+zr2+zr1)/3;
2611 da = (dx2+dxr2+dx3)/3;
2612 db = (dy2+dyr2+dy3)/3;
2617 if (sr7<0||sr7>w1||tr7<0||tr7>w2)
Transform(sr7,tr7,-1);
2622 if (sr6<0||sr6>w1||tr6<0||tr6>w2)
Transform(sr6,tr6,-1);
2627 da = (dx1+dx3+dx4)/3;
2628 db = (dy1+dy3+dy4)/3;
2632 da = (dx4+dx3+dxr2)/3;
2633 db = (dy4+dy3+dyr2)/3;
2637 da = (dx4+dxr2+dxr1)/3;
2638 db = (dy4+dyr2+dyr1)/3;
2639 dc = (z4+zr2+zr1)/3;
2642 da = (dx1+dx4+dxr1)/3;
2643 db = (dy1+dy4+dyr1)/3;
2690 da = (dy2-dy1)*(z3-z1)-(dy3-dy1)*(z2-z1);
2691 db = (z2-z1)*(dx3-dx1)-(z3-z1)*(dx2-dx1);
2692 dc = (dx2-dx1)*(dy3-dy1)-(dx3-dx1)*(dy2-dy1);
2693 dd = -da*dx1-db*dy1-dc*z1;
2710 if (pom2!=0) sdx1 = pom1/pom2;
2713 sdy1 = pom1-sdx1*pom2;
2714 for (sx4=sx1,sx5=sx1,sy5=sy1;sx4<=sx2;sx4++) {
2716 sdy4 = sdx1*pom1+sdy1;
2717 sy4 = (
Int_t)(sdy4);
2725 if (dc!=0)
v = (-dd-da*dx1-db*dy1)/dc;
2726 else v = (iv1+iv2+iv4)/3;
2740 if (dc!=0)
v = (-dd-da*dx1-db*dy1)/dc;
2741 else v = (iv1+iv2+iv4)/3;
2765 if (pom2!=0) sdx2 = pom1/pom2;
2768 sdy2 = pom1-sdx2*pom2;
2779 xtaz = (dx3+dx2+dx4)/3;
2780 ytaz = (dy3+dy2+dy4)/3;
2781 ztaz = (z3+z2+z4)/3;
2816 da = (dy2-dy1)*(z3-z1)-(dy3-dy1)*(z2-z1);
2817 db = (z2-z1)*(dx3-dx1)-(z3-z1)*(dx2-dx1);
2818 dc = (dx2-dx1)*(dy3-dy1)-(dx3-dx1)*(dy2-dy1);
2819 dd = -da*dx1-db*dy1-dc*z1;
2836 if (pom2!=0) sdx1 = pom1/pom2;
2839 sdy1 = pom1-sdx1*pom2;
2840 for (sx4=sx1,sx5=sx1,sy5=sy1;sx4<=sx2;sx4++) {
2842 sdy4 = sdx1*pom1+sdy1;
2851 if (dc!=0)
v = (-dd-da*dx1-db*dy1)/dc;
2852 else v = (iv1+iv2+iv4)/3;
2866 if (dc!=0)
v = (-dd-da*dx1-db*dy1)/dc;
2867 else v = (iv1+iv2+iv4)/3;
2877 for (sx4=sx1p,sx5=sx1p,sy5=sy1p;sx4<=sx3p;sx4++) {
2879 sdy4 = sdx2p*pom1+sdy2p;
2889 if (dcp!=0)
v = (-ddp-dap*dx1-dbp*dy1)/dcp;
2890 else v = (iv1+iv2+iv4)/3;
2905 if (dcp!=0)
v = (-ddp-dap*dx1-dbp*dy1)/dcp;
2906 else v = (iv1+iv2+iv4)/3;
2931 if (pom2!=0) sdx2 = pom1/pom2;
2934 sdy2 = pom1-sdx2*pom2;
2935 for (sx4=sx2,sx5=sx2,sy5=sy2;sx4<=sx3;sx4++) {
2937 sdy4 = sdx2*pom1+sdy2;
2946 if (dc!=0)
v = (-dd-da*dx1-db*dy1)/dc;
2947 else v =(iv1+iv2+iv4)/3;
2961 if (dc!=0)
v = (-dd-da*dx1-db*dy1)/dc;
2962 else v =(iv1+iv2+iv4)/3;
2975 if (((flag==0)&&(smer==0))||((flag!=0)&&(smer!=0))) {
2980 }
else if (((flag!=0)&&(smer==0))||((flag==0)&&(smer!=0))) {
3008 bezy1 =
y1+(
y2-y3)/6;
3009 bezy2 =
y2-(y4-
y1)/6;
3035 for (bezf=0;bezf<1.01;bezf+=0.1) {
3045 Envelope(ibezx2,ibezy2,ibezx1,ibezy1);
3080 for (bezf=0;bezf<1.01;bezf+=0.1) {
3090 Envelope(ibezx1,ibezy1,ibezx2,ibezy2);
3104 if ((q1!=q2||smer!=0)&&flag==1) {
3161 i1 = (
Int_t)(zl/dcount_reg+1);
3162 if (z1!=z2||z2!=z3||z3!=z4) {
3167 if (
fZ>=1.0)
fZ = log(
fZ);
3182 if (
fZ>zh)
goto eqend;
3186 if ((z2<=
fZ&&
fZ<z1)||(z2<
fZ&&
fZ<=z1)) {
3187 xb = (
fZ-z2)*(dx1-dx2)/(z1-z2)+dx2;
3190 if ((z1<=
fZ&&
fZ<z2)||(z1<
fZ&&
fZ<=z2)) {
3191 xb = (
fZ-z1)*(dx2-dx1)/(z2-z1)+dx1;
3194 if (z2==
fZ&&
fZ==z1) {
3203 if ((z1<=
fZ&&
fZ<z4)||(z1<
fZ&&
fZ<=z4)) {
3204 ya = (
fZ-z1)*(dy4-dy1)/(z4-z1)+dy1;
3207 if ((z4<=
fZ&&
fZ<z1)||(z4<
fZ&&
fZ<=z1)) {
3208 ya = (
fZ-z4)*(dy1-dy4)/(z1-z4)+dy4;
3211 if (z4==
fZ&&
fZ==z1) {
3223 if ((z3<=
fZ&&
fZ<z4)||(z3<
fZ&&
fZ<=z4)) {
3224 xa = (
fZ-z3)*(dx4-dx3)/(z4-z3)+dx3;
3227 if ((z4<=
fZ&&
fZ<z3)||(z4<
fZ&&
fZ<=z3)) {
3228 xa = (
fZ-z4)*(dx3-dx4)/(z3-z4)+dx4;
3231 if (z4==
fZ&&
fZ==z3) {
3243 if ((z2<=
fZ&&
fZ<z3)||(z2<
fZ&&
fZ<=z3)) {
3244 ya = (
fZ-z2)*(dy3-dy2)/(z3-z2)+dy2;
3247 if ((z3<=
fZ&&
fZ<z2)||(z3<
fZ&&
fZ<=z2)) {
3248 ya = (
fZ-z3)*(dy2-dy3)/(z2-z3)+dy3;
3251 if (z3==
fZ&&
fZ==z2) {
3270 if ((q1!=q2||smer!=0)&&flag==1) {
3282 if (
s1<=w1&&s2<=w1&&s3<=w1&&s4<=w1) {
3296 if (
s1<=w1&&s2<=w1&&s3<=w1&&s4<=w1) {
3311 if (
t1<=w2&&t2<=w2&&t3<=w2&&t4<=w2) {
3325 if (
t1<=w2&&t2<=w2&&t3<=w2&&t4<=w2) {
3456 if (pom2!=0) sdx1 = pom1/pom2;
3459 sdy1 = pom1-sdx1*pom2;
3462 if (pom2!=0) sdx2 = pom1/pom2;
3465 sdy2 = pom1-sdx2*pom2;
3468 if (pom2!=0) sdx3 = pom1/pom2;
3471 sdy3 = pom1-sdx3*pom2;
3474 for (sx4=sx1;sx4<=sx2;sx4++) {
3476 sdy4 = sdx1*pom1+sdy1;
3479 sdy4 = sdx2*pom1+sdy2;
3487 if ((sy4<=y5)||(sy5<y5)) {
3496 for (sx4=sx2;sx4<=sx3;sx4++) {
3498 sdy4 = sdx3*pom1+sdy3;
3501 sdy4 = sdx2*pom1+sdy2;
3509 if ((sy4<=y5)||(sy5<y5)) {
3519 for (sx4=sx1;sx4<=sx3;sx4++) {
3521 sdy4 = sdx2*pom1+sdy2;
3524 sdy4 = sdx1*pom1+sdy1;
3532 if ((sy4<=y5)||(sy5<y5)) {
3541 for (sx4=sx3;sx4<=sx2;sx4++) {
3543 sdy4 = sdx3*pom1+sdy3;
3546 sdy4 = sdx1*pom1+sdy1;
3554 if ((sy4<=y5)||(sy5<y5)) {
3598 if (pom2!=0) sdx1 = pom1/pom2;
3601 sdy1 = pom1-sdx1*pom2;
3604 if (pom2!=0) sdx2 = pom1/pom2;
3607 sdy2 = pom1-sdx2*pom2;
3610 if (pom2!=0) sdx3 = pom1/pom2;
3613 sdy3 = pom1-sdx3*pom2;
3616 for (sx4=sx1;sx4<=sx2;sx4++) {
3618 sdy4 = sdx1*pom1+sdy1;
3621 sdy4 = sdx2*pom1+sdy2;
3629 if ((sy4<=y5)||(sy5<y5)) {
3638 for (sx4=sx2;sx4<=sx3;sx4++) {
3640 sdy4 = sdx3*pom1+sdy3;
3643 sdy4 = sdx2*pom1+sdy2;
3651 if ((sy4<=y5)||(sy5<y5)) {
3661 for (sx4=sx1;sx4<=sx3;sx4++) {
3663 sdy4 = sdx2*pom1+sdy2;
3666 sdy4 = sdx1*pom1+sdy1;
3674 if ((sy4<=y5)||(sy5<y5)) {
3683 for (sx4=sx3;sx4<=sx2;sx4++) {
3685 sdy4 = sdx3*pom1+sdy3;
3688 sdy4 = sdx1*pom1+sdy1;
3696 if ((sy4<=y5)||(sy5<y5)) {
3831 if (((flag==0)&&(smer==0))||((flag!=0)&&(smer!=0))) {
3868 bezy1 =
y1+(
y2-y3)/6;
3869 bezy2 =
y2-(y4-
y1)/6;
3895 for (bezf=0;bezf<1.01;bezf+=0.1) {
3905 Envelope(ibezx2,ibezy2,ibezx1,ibezy1);
3940 for (bezf=0;bezf<1.01;bezf+=0.1) {
3950 Envelope(ibezx1,ibezy1,ibezx2,ibezy2);
3964 if ((q1!=q2||smer!=0)&&flag==1) {
4059 xtaz = (dx1+dx2+dx4)/3;
4060 ytaz = (dy1+dy2+dy4)/3;
4061 ztaz = (z1+z2+z4)/3;
4065 if (sr1<0||sr1>w1||tr1<0||tr1>w2)
Transform(sr1,tr1,-1);
4070 if (sr8<0||sr8>w1||tr8<0||tr8>w2)
Transform(sr8,tr8,-1);
4079 if (sr3<0||sr3>w1||tr3<0||tr3>w2)
Transform(sr3,tr3,-1);
4084 if (sr2<0||sr2>w1||tr2<0||tr2>w2)
Transform(sr2,tr2,-1);
4094 if (sr5<0||sr5>w1||tr5<0||tr5>w2)
Transform(sr5,tr5,-1);
4099 if (sr4<0||sr4>w1||tr4<0||tr4>w2)
Transform(sr4,tr4,-1);
4109 if (sr7<0||sr7>w1||tr7<0||tr7>w2)
Transform(sr7,tr7,-1);
4114 if (sr6<0||sr6>w1||tr6<0||tr6>w2)
Transform(sr6,tr6,-1);
4128 if (sr1<0||sr1>w1||tr1<0||tr1>w2)
Transform(sr1,tr1,-1);
4133 if (sr8<0||sr8>w1||tr8<0||tr8>w2)
Transform(sr8,tr8,-1);
4138 da = (dxr1+dx2+dx1)/3;
4139 db = (dyr1+dy2+dy1)/3;
4143 da = (dxr1+dxr2+dx1)/3;
4144 db = (dyr1+dyr2+dy1)/3;
4145 dc = (zr1+zr2+z1)/3;
4148 da = (dxr2+dx1+dx4)/3;
4149 db = (dyr2+dy1+dy4)/3;
4154 if (sr3<0||sr3>w1||tr3<0||tr3>w2)
Transform(sr3,tr3,-1);
4159 if (sr2<0||sr2>w1||tr2<0||tr2>w2)
Transform(sr2,tr2,-1);
4164 da = (dx1+dx2+dx3)/3;
4165 db = (dy1+dy2+dy3)/3;
4169 da = (dx2+dxr1+dx3)/3;
4170 db = (dy2+dyr1+dy3)/3;
4174 da = (dx2+dxr2+dxr1)/3;
4175 db = (dy2+dyr2+dyr1)/3;
4176 dc = (z2+zr2+zr1)/3;
4179 da = (dxr2+dx2+dx1)/3;
4180 db = (dyr2+dy2+dy1)/3;
4185 if (sr5<0||sr5>w1||tr5<0||tr5>w2)
Transform(sr5,tr5,-1);
4190 if (sr4<0||sr4>w1||tr4<0||tr4>w2)
Transform(sr4,tr4,-1);
4195 da = (dx2+dx3+dx4)/3;
4196 db = (dy2+dy3+dy4)/3;
4200 da = (dx4+dx3+dxr1)/3;
4201 db = (dy4+dy3+dyr1)/3;
4205 da = (dx3+dxr2+dxr1)/3;
4206 db = (dy3+dyr2+dyr1)/3;
4207 dc = (z3+zr2+zr1)/3;
4210 da = (dx2+dxr2+dx3)/3;
4211 db = (dy2+dyr2+dy3)/3;
4216 if (sr7<0||sr7>w1||tr7<0||tr7>w2)
Transform(sr7,tr7,-1);
4221 if (sr6<0||sr6>w1||tr6<0||tr6>w2)
Transform(sr6,tr6,-1);
4226 da = (dx1+dx3+dx4)/3;
4227 db = (dy1+dy3+dy4)/3;
4231 da = (dx4+dx3+dxr2)/3;
4232 db = (dy4+dy3+dyr2)/3;
4236 da = (dx4+dxr2+dxr1)/3;
4237 db = (dy4+dyr2+dyr1)/3;
4238 dc = (z4+zr2+zr1)/3;
4241 da = (dx1+dx4+dxr1)/3;
4242 db = (dy1+dy4+dyr1)/3;