99 Double_t xdeb_bis = xdeb, xfin_bis = xfin, np_bis =
np;
105 if (xdeb_bis == -1) xdeb_bis =
xmin;
106 if (xfin_bis == -1) xfin_bis =
xmax;
107 if (np_bis == 1) np_bis =
Double_t(
dynamic_cast<TF1*
>(obj)->GetNpx());
108 Double_t inter = (xfin_bis - xdeb_bis) / (np_bis);
110 for (
Double_t xx = xdeb_bis; xx <= xfin_bis; xx += inter) {
111 line->SetPoint(pp++, xx,
dynamic_cast<TF1*
>(obj)->
Eval(xx));
113 if (save)
line->Fit(
dynamic_cast<TF1*
>(obj),
"0+",
"", xdeb_bis, xfin_bis);
119 if (xdeb_bis == -1) xdeb_bis = xtab[0];
120 if (xfin_bis == -1) xfin_bis = xtab[nx - 1];
121 if (xdeb_bis < xtab[0])
line->SetPoint(np2++, xdeb_bis, ytab[0]);
122 for (
Int_t pp = 0; pp < nx; pp += 1)
if (xdeb_bis <= xtab[pp] && xtab[pp] <= xfin_bis)
line->SetPoint(np2++, xtab[pp], ytab[pp]);
123 if (xfin_bis > xtab[nx - 1])
line->SetPoint(np2, xfin_bis, ytab[nx - 1]);
137 for (pp =
xmin; pp <=
xmax; pp += 1) {
139 if (xdeb_bis <= xx && xx <= xfin_bis && pf->GetBinEntries(pp) >=
np)
line->SetPoint(np2++, xx, pf->
GetBinContent(pp));
142 if (save)
line->GetListOfFunctions()->Add(pf);
144 else cout <<
"le type ne correspond pas " << endl;
244 const Int_t kMaxDiff = 10;
245 static Bool_t middle, badcase;
246 static Int_t ipoint, pxp, pyp;
247 static Int_t px1, px2, py1, py2;
248 static Int_t pxold, pyold, px1old, py1old, px2old, py2old;
249 static Int_t dpx, dpy;
256 if (!
gPad->IsEditable())
return;
264 px1 =
gPad->XtoAbsPixel(
gPad->GetX1());
265 py1 =
gPad->YtoAbsPixel(
gPad->GetY1());
266 px2 =
gPad->XtoAbsPixel(
gPad->GetX2());
267 py2 =
gPad->YtoAbsPixel(
gPad->GetY2());
277 if (pxp < -kMaxPixel || pxp >=
kMaxPixel ||
282 gVirtualX->DrawLine(pxp - 4, pyp - 4, pxp + 4, pyp - 4);
283 gVirtualX->DrawLine(pxp + 4, pyp - 4, pxp + 4, pyp + 4);
284 gVirtualX->DrawLine(pxp + 4, pyp + 4, pxp - 4, pyp + 4);
285 gVirtualX->DrawLine(pxp - 4, pyp + 4, pxp - 4, pyp - 4);
289 if (
d < kMaxDiff) ipoint = i;
295 if (ipoint < 0)
return;
299 px2old =
gPad->XtoAbsPixel(
fX[1]);
300 py2old =
gPad->YtoAbsPixel(
fY[1]);
309 px1old =
gPad->XtoAbsPixel(
gPad->XtoPad(
fX[ipoint - 1]));
310 py1old =
gPad->YtoAbsPixel(
gPad->YtoPad(
fY[ipoint - 1]));
311 px2old =
gPad->XtoAbsPixel(
gPad->XtoPad(
fX[ipoint + 1]));
312 py2old =
gPad->YtoAbsPixel(
gPad->YtoPad(
fY[ipoint + 1]));
314 pxold =
gPad->XtoAbsPixel(
gPad->XtoPad(
fX[ipoint]));
315 pyold =
gPad->YtoAbsPixel(
gPad->YtoPad(
fY[ipoint]));
327 if (
d < kMaxDiff) middle =
kFALSE;
338 for (i = 0; i <
fNpoints - 1; i++) {
339 gVirtualX->DrawLine(
x[i] + dpx,
y[i] + dpy,
x[i + 1] + dpx,
y[i + 1] + dpy);
342 if (pxp < -kMaxPixel || pxp >=
kMaxPixel ||
343 pyp < -kMaxPixel || pyp >=
kMaxPixel)
continue;
344 gVirtualX->DrawLine(pxp - 4, pyp - 4, pxp + 4, pyp - 4);
345 gVirtualX->DrawLine(pxp + 4, pyp - 4, pxp + 4, pyp + 4);
346 gVirtualX->DrawLine(pxp + 4, pyp + 4, pxp - 4, pyp + 4);
347 gVirtualX->DrawLine(pxp - 4, pyp + 4, pxp - 4, pyp - 4);
351 gVirtualX->DrawLine(pxp - 4, pyp - 4, pxp + 4, pyp - 4);
352 gVirtualX->DrawLine(pxp + 4, pyp - 4, pxp + 4, pyp + 4);
353 gVirtualX->DrawLine(pxp + 4, pyp + 4, pxp - 4, pyp + 4);
354 gVirtualX->DrawLine(pxp - 4, pyp + 4, pxp - 4, pyp - 4);
359 for (i = 0; i <
fNpoints - 1; i++) {
360 gVirtualX->DrawLine(
x[i] + dpx,
y[i] + dpy,
x[i + 1] + dpx,
y[i + 1] + dpy);
363 if (pxp < -kMaxPixel || pxp >=
kMaxPixel ||
364 pyp < -kMaxPixel || pyp >=
kMaxPixel)
continue;
365 gVirtualX->DrawLine(pxp - 4, pyp - 4, pxp + 4, pyp - 4);
366 gVirtualX->DrawLine(pxp + 4, pyp - 4, pxp + 4, pyp + 4);
367 gVirtualX->DrawLine(pxp + 4, pyp + 4, pxp - 4, pyp + 4);
368 gVirtualX->DrawLine(pxp - 4, pyp + 4, pxp - 4, pyp - 4);
372 gVirtualX->DrawLine(pxp - 4, pyp - 4, pxp + 4, pyp - 4);
373 gVirtualX->DrawLine(pxp + 4, pyp - 4, pxp + 4, pyp + 4);
374 gVirtualX->DrawLine(pxp + 4, pyp + 4, pxp - 4, pyp + 4);
375 gVirtualX->DrawLine(pxp - 4, pyp + 4, pxp - 4, pyp - 4);
378 if (px1old)
gVirtualX->DrawLine(px1old, py1old, pxold, pyold);
379 if (px2old)
gVirtualX->DrawLine(pxold, pyold, px2old, py2old);
380 gVirtualX->DrawLine(pxold - 4, pyold - 4, pxold + 4, pyold - 4);
381 gVirtualX->DrawLine(pxold + 4, pyold - 4, pxold + 4, pyold + 4);
382 gVirtualX->DrawLine(pxold + 4, pyold + 4, pxold - 4, pyold + 4);
383 gVirtualX->DrawLine(pxold - 4, pyold + 4, pxold - 4, pyold - 4);
390 if (px1old)
gVirtualX->DrawLine(px1old, py1old, pxold, pyold);
391 if (px2old)
gVirtualX->DrawLine(pxold, pyold, px2old, py2old);
392 gVirtualX->DrawLine(pxold - 4, pyold - 4, pxold + 4, pyold - 4);
393 gVirtualX->DrawLine(pxold + 4, pyold - 4, pxold + 4, pyold + 4);
394 gVirtualX->DrawLine(pxold + 4, pyold + 4, pxold - 4, pyold + 4);
395 gVirtualX->DrawLine(pxold - 4, pyold + 4, pxold - 4, pyold - 4);
401 if (
gROOT->IsEscaped()) {
417 dxr = dx / (1 -
gPad->GetLeftMargin() -
gPad->GetRightMargin());
418 dyr = dy / (1 -
gPad->GetBottomMargin() -
gPad->GetTopMargin());
424 ymin - dyr *
gPad->GetBottomMargin(),
425 xmax + dxr *
gPad->GetRightMargin(),
431 if (badcase)
continue;
432 if (
x)
fX[i] =
gPad->PadtoX(
gPad->AbsPixeltoX(
x[i] + dpx));
433 if (
y)
fY[i] =
gPad->PadtoY(
gPad->AbsPixeltoY(
y[i] + dpy));
437 fX[ipoint] =
gPad->PadtoX(
gPad->AbsPixeltoX(pxold));
438 fY[ipoint] =
gPad->PadtoY(
gPad->AbsPixeltoY(pyold));