// @(#)root/hist:$Id$
// Author: Christian Stratowa 30/09/2001

/*************************************************************************
 * Copyright (C) 2006, Rene Brun and Fons Rademakers.                    *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/

/******************************************************************************
* Copyright(c) 2001-    , Dr. Christian Stratowa, Vienna, Austria.            *
* Author: Christian Stratowa with help from Rene Brun.                        *
*                                                                             *
* Algorithms for smooth regression adapted from:                              *
* R: A Computer Language for Statistical Data Analysis                        *
* Copyright (C) 1996 Robert Gentleman and Ross Ihaka                          *
* Copyright (C) 1999-2001 Robert Gentleman, Ross Ihaka and the                *
* R Development Core Team                                                     *
* R is free software, for licensing see the GNU General Public License        *
* http://www.ci.tuwien.ac.at/R-project/welcome.html                           *
*                                                                             *
******************************************************************************/


#include "Riostream.h"
#include "TMath.h"
#include "TGraphSmooth.h"
#include "TGraphErrors.h"

ClassImp(TGraphSmooth);

//______________________________________________________________________
// TGraphSmooth
//
// A helper class to smooth TGraph
// see examples in $ROOTSYS/tutorials/graphs/motorcycle.C and approx.C
//
//______________________________________________________________________
TGraphSmooth::TGraphSmooth(): TNamed()
{
//*-*-*-*-*-*-*-*-*Default GraphSmooth constructor *-*-*-*-*-*-*-*-*-*-*
//                 ===============================

   fNin  = 0;
   fNout = 0;
   fGin  = 0;
   fGout = 0;
   fMinX = 0;
   fMaxX = 0;
}

//______________________________________________________________________
TGraphSmooth::TGraphSmooth(const char *name): TNamed(name,"")
{
//*-*-*-*-*-*-*-*-*GraphSmooth constructor *-*-*-*-*-*-*-*-*-*-*-*-*-*-*
//                 =======================

   fNin  = 0;
   fNout = 0;
   fGin  = 0;
   fGout = 0;
   fMinX = 0;
   fMaxX = 0;
}

//______________________________________________________________________
TGraphSmooth::~TGraphSmooth()
{
//*-*-*-*-*-*-*-*-*GraphSmooth destructor*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
//                 ======================

   if (fGout) delete fGout;
   fGin  = 0;
   fGout = 0;
}

//______________________________________________________________________
void TGraphSmooth::Smoothin(TGraph *grin)
{
//*-*-*-*-*-*-*-*-*Sort input data points*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
//                 ======================

   if (fGout) {delete fGout; fGout = 0;}
   fGin = grin;

   fNin = fGin->GetN();
   Double_t *xin = new Double_t[fNin];
   Double_t *yin = new Double_t[fNin];
   Int_t i;
   for (i=0;i<fNin;i++) {
      xin[i] = fGin->GetX()[i];
      yin[i] = fGin->GetY()[i];
   }

// sort input x, y
   Int_t *index = new Int_t[fNin];
   TMath::Sort(fNin, xin, index, kFALSE);
   for (i=0;i<fNin;i++) {
      fGin->SetPoint(i, xin[index[i]], yin[index[i]]);
   }

   fMinX = fGin->GetX()[0];  //already sorted!
   fMaxX = fGin->GetX()[fNin-1];

   delete [] index;
   delete [] xin;
   delete [] yin;
}

//______________________________________________________________________
TGraph *TGraphSmooth::SmoothKern(TGraph *grin, Option_t *option,
                      Double_t bandwidth, Int_t nout, Double_t *xout)
{
//*-*-*-*-*-*-*-*-*Smooth data with Kernel smoother*-*-*-*-*-*-*-*-*-*-*
//                 ================================
//
// Smooth grin with the Nadaraya-Watson kernel regression estimate.
//
// Arguments:
// grin:      input graph
//
// option:    the kernel to be used: "box", "normal"
// bandwidth: the bandwidth. The kernels are scaled so that their quartiles
//            (viewed as probability densities) are at +/- 0.25*bandwidth.
// nout:      If xout is not specified, interpolation takes place at equally
//            spaced points spanning the interval [min(x), max(x)], where
//            nout = max(nout, number of input data).
// xout:      an optional set of values at which to evaluate the fit
//

   TString opt = option;
   opt.ToLower();
   Int_t kernel = 1;
   if (opt.Contains("normal")) kernel = 2;

   Smoothin(grin);

   Double_t delta = 0;
   Int_t *index = 0;
   if (xout == 0) {
      fNout = TMath::Max(nout, fNin);
      delta = (fMaxX - fMinX)/(fNout - 1);
   } else {
      fNout = nout;
      index = new Int_t[nout];
      TMath::Sort(nout, xout, index, kFALSE);
   }

   fGout = new TGraph(fNout);
   for (Int_t i=0;i<fNout;i++) {
      if (xout == 0) fGout->SetPoint(i,fMinX + i*delta, 0);
      else           fGout->SetPoint(i,xout[index[i]], 0);
   }

   BDRksmooth(fGin->GetX(), fGin->GetY(), fNin, fGout->GetX(),
                 fGout->GetY(), fNout, kernel, bandwidth);

   if (index) {delete [] index; index = 0;}

   return fGout;
}

//______________________________________________________________________
void TGraphSmooth::BDRksmooth(Double_t *x, Double_t *y, Int_t n, Double_t *xp,
                   Double_t *yp, Int_t np, Int_t kernel, Double_t bw)
{
//*-*-*-*-*-*-*-*-*Smooth data with specified kernel*-*-*-*-*-*-*-*-*-*-*
//*-*              =================================
//
//   Based on R function ksmooth: Translated to C++ by C. Stratowa
//   (R source file: ksmooth.c by B.D.Ripley Copyright (C) 1998)
//
//*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

   Int_t    imin = 0;
   Double_t cutoff = 0.0;

// bandwidth is in units of half inter-quartile range
   if (kernel == 1) {
      bw *= 0.5;
      cutoff = bw;
   }
   if (kernel == 2) {
      bw *= 0.3706506;
      cutoff = 4*bw;
   }

   while ((x[imin] < xp[0] - cutoff) && (imin < n)) imin++;

   for (Int_t j=0;j<np;j++) {
      Double_t xx, w;
      Double_t num = 0.0;
      Double_t den = 0.0;
      Double_t x0 = xp[j];
      for (Int_t i=imin;i<n;i++) {
         if (x[i] < x0 - cutoff) imin = i;
         if (x[i] > x0 + cutoff) break;
         xx = TMath::Abs(x[i] - x0)/bw;
         if (kernel == 1) w = 1;
         else             w = TMath::Exp(-0.5*xx*xx);
         num += w*y[i];
         den += w;
      }
      if (den > 0) {
         yp[j] = num/den;
      } else {
         yp[j] = 0; //should be NA_REAL (see R.h) or nan("NAN")
      }
   }
}


//______________________________________________________________________
TGraph *TGraphSmooth::SmoothLowess(TGraph *grin, Option_t *option ,
                      Double_t span, Int_t iter, Double_t delta)
{
//*-*-*-*-*-*-*-*-*Smooth data with Lowess smoother*-*-*-*-*-*-*-*-*-*-*
//                 ================================
//
// This function performs the computations for the LOWESS smoother
// (see the reference below). Lowess returns the output points
// x and y which give the coordinates of the smooth.
//
// Arguments:
// grin:  Input graph
//
// span:  the smoother span. This gives the proportion of points in the plot
//        which influence the smooth at each value.
//        Larger values give more smoothness.
// iter:  the number of robustifying iterations which should be performed.
//        Using smaller values of iter will make lowess run faster.
// delta: values of x which lie within delta of each other replaced by a
//        single value in the output from lowess.
//        For delta = 0, delta will be calculated.
//
// References:
// Cleveland, W. S. (1979) Robust locally weighted regression and smoothing
//        scatterplots. J. Amer. Statist. Assoc. 74, 829-836.
// Cleveland, W. S. (1981) LOWESS: A program for smoothing scatterplots
//        by robust locally weighted regression.
//        The American Statistician, 35, 54.
//                 ==================

   TString opt = option;
   opt.ToLower();

   Smoothin(grin);

   if (delta == 0) {delta = 0.01*(TMath::Abs(fMaxX - fMinX));}

// output X, Y
   fNout = fNin;
   fGout = new TGraphErrors(fNout);

   for (Int_t i=0;i<fNout;i++) {
      fGout->SetPoint(i,fGin->GetX()[i], 0);
   }

   Lowess(fGin->GetX(), fGin->GetY(), fNin, fGout->GetY(), span, iter, delta);

   return fGout;
}

//______________________________________________________________________
void TGraphSmooth::Lowess(Double_t *x, Double_t *y, Int_t n, Double_t *ys,
                   Double_t span, Int_t iter, Double_t delta)
{
//*-*-*-*-*-*-*-*-*Lowess regression smoother*-*-*-*-*-*-*-*-*-*-*-*-*-*
//                 ==========================
//   Based on R function clowess: Translated to C++ by C. Stratowa
//   (R source file: lowess.c by R Development Core Team (C) 1999-2001)
//
//*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

   Int_t    i, iiter, j, last, m1, m2, nleft, nright, ns;
   Double_t alpha, c1, c9, cmad, cut, d1, d2, denom, r;
   Bool_t   ok;

   if (n < 2) {
      ys[0] = y[0];
      return;
   }

// nleft, nright, last, etc. must all be shifted to get rid of these:
   x--;
   y--;
   ys--;

   Double_t *rw  = ((TGraphErrors*)fGout)->GetEX();
   Double_t *res = ((TGraphErrors*)fGout)->GetEY();

// at least two, at most n poInt_ts
   ns = TMath::Max(2, TMath::Min(n, (Int_t)(span*n + 1e-7)));

// robustness iterations
   iiter = 1;
   while (iiter <= iter+1) {
      nleft = 1;
      nright = ns;
      last = 0;   // index of prev estimated poInt_t
      i = 1;      // index of current poInt_t

      for(;;) {
         if (nright < n) {
         // move nleft,  nright to right if radius decreases
            d1 = x[i] - x[nleft];
            d2 = x[nright+1] - x[i];

         // if d1 <= d2 with x[nright+1] == x[nright], lowest fixes
            if (d1 > d2) {
            // radius will not decrease by move right
               nleft++;
               nright++;
               continue;
            }
         }

      // fitted value at x[i]
         Bool_t iterg1 = iiter>1;
         Lowest(&x[1], &y[1], n, x[i], ys[i], nleft, nright,
                      res, iterg1, rw, ok);
         if (!ok) ys[i] = y[i];

      // all weights zero copy over value (all rw==0)
         if (last < i-1) {
            denom = x[i]-x[last];

         // skipped poInt_ts -- Int_terpolate non-zero - proof?
            for(j = last+1; j < i; j++) {
               alpha = (x[j]-x[last])/denom;
               ys[j] = alpha*ys[i] + (1.-alpha)*ys[last];
            }
      }

      // last poInt_t actually estimated
         last = i;

      // x coord of close poInt_ts
         cut = x[last] + delta;
         for (i = last+1; i <= n; i++) {
            if (x[i] > cut)
               break;
            if (x[i] == x[last]) {
               ys[i] = ys[last];
               last = i;
            }
         }
         i = TMath::Max(last+1, i-1);
         if (last >= n)
            break;
      }

   // residuals
      for(i=0; i < n; i++)
         res[i] = y[i+1] - ys[i+1];

   // compute robustness weights except last time
      if (iiter > iter)
         break;
      for(i=0 ; i<n ; i++)
         rw[i] = TMath::Abs(res[i]);

   // compute cmad := 6 * median(rw[], n)
      m1 = n/2;
   // partial sort, for m1 & m2
      Psort(rw, n, m1);
      if(n % 2 == 0) {
         m2 = n-m1-1;
         Psort(rw, n, m2);
         cmad = 3.*(rw[m1]+rw[m2]);
      } else { /* n odd */
         cmad = 6.*rw[m1];
      }

      c9 = 0.999*cmad;
      c1 = 0.001*cmad;
      for(i=0 ; i<n ; i++) {
         r = TMath::Abs(res[i]);
         if (r <= c1)
            rw[i] = 1.;
         else if (r <= c9)
            rw[i] = (1.-(r/cmad)*(r/cmad))*(1.-(r/cmad)*(r/cmad));
         else
            rw[i] = 0.;
      }
      iiter++;
   }
}

//______________________________________________________________________
void TGraphSmooth::Lowest(Double_t *x, Double_t *y, Int_t n, Double_t &xs,
                   Double_t &ys, Int_t nleft, Int_t nright, Double_t *w,
                   Bool_t userw, Double_t *rw, Bool_t &ok)
{
//*-*-*-*-*-*-*-*-*Fit value at x[i] *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
//                 =================
//  Based on R function lowest: Translated to C++ by C. Stratowa
//  (R source file: lowess.c by R Development Core Team (C) 1999-2001)
//
//*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

   Int_t    nrt, j;
   Double_t a, b, c, d, h, h1, h9, r, range;

   x--;
   y--;
   w--;
   rw--;

   range = x[n]-x[1];
   h = TMath::Max(xs-x[nleft], x[nright]-xs);
   h9 = 0.999*h;
   h1 = 0.001*h;

// sum of weights
   a = 0.;
   j = nleft;
   while (j <= n) {
   // compute weights (pick up all ties on right)
      w[j] = 0.;
      r = TMath::Abs(x[j] - xs);
      if (r <= h9) {
         if (r <= h1) {
            w[j] = 1.;
         } else {
            d = (r/h)*(r/h)*(r/h);
            w[j] = (1.- d)*(1.- d)*(1.- d);
         }
         if (userw)
            w[j] *= rw[j];
         a += w[j];
      } else if (x[j] > xs)
         break;
      j = j+1;
   }

// rightmost pt (may be greater than nright because of ties)
   nrt = j-1;
   if (a <= 0.)
      ok = kFALSE;
   else {
      ok = kTRUE;
   // weighted least squares: make sum of w[j] == 1
      for(j=nleft ; j<=nrt ; j++)
         w[j] /= a;
      if (h > 0.) {
         a = 0.;
      // use linear fit weighted center of x values
         for(j=nleft ; j<=nrt ; j++)
            a += w[j] * x[j];
         b = xs - a;
         c = 0.;
         for(j=nleft ; j<=nrt ; j++)
            c += w[j]*(x[j]-a)*(x[j]-a);
         if (TMath::Sqrt(c) > 0.001*range) {
            b /= c;
         // poInt_ts are spread out enough to compute slope
            for(j=nleft; j <= nrt; j++)
               w[j] *= (b*(x[j]-a) + 1.);
         }
      }
      ys = 0.;
      for(j=nleft; j <= nrt; j++)
         ys += w[j] * y[j];
   }
}

//______________________________________________________________________
TGraph *TGraphSmooth::SmoothSuper(TGraph *grin, Option_t *,
        Double_t bass, Double_t span, Bool_t isPeriodic, Double_t *w)
{
//*-*-*-*-*-*-*-*-*Smooth data with Super smoother*-*-*-*-*-*-*-*-*-*-*-*
//                 ===============================
//
// Smooth the (x, y) values by Friedman's ``super smoother''.
//
// Arguments:
// grin: graph for smoothing
//
// span: the fraction of the observations in the span of the running lines
//        smoother, or 0 to choose this by leave-one-out cross-validation.
// bass: controls the smoothness of the fitted curve.
//        Values of up to 10 indicate increasing smoothness.
// isPeriodic: if TRUE, the x values are assumed to be in [0, 1]
//        and of period 1.
// w:     case weights
//
// Details:
// supsmu is a running lines smoother which chooses between three spans for
// the lines. The running lines smoothers are symmetric, with k/2 data points
// each side of the predicted point, and values of k as 0.5 * n, 0.2 * n and
// 0.05 * n, where n is the number of data points. If span is specified,
// a single smoother with span span * n is used.
//
// The best of the three smoothers is chosen by cross-validation for each
// prediction. The best spans are then smoothed by a running lines smoother
// and the final prediction chosen by linear interpolation.
//
// The FORTRAN code says: ``For small samples (n < 40) or if there are
// substantial serial correlations between observations close in x - value,
// then a prespecified fixed span smoother (span > 0) should be used.
// Reasonable span values are 0.2 to 0.4.''
//
// References:
// Friedman, J. H. (1984) SMART User's Guide.
//           Laboratory for Computational Statistics,
//           Stanford University Technical Report No. 1.
//
// Friedman, J. H. (1984) A variable span scatterplot smoother.
//           Laboratory for Computational Statistics,
//           Stanford University Technical Report No. 5.
//                 ==================

   if (span < 0 || span > 1) {
      std::cout << "Error: Span must be between 0 and 1" << std::endl;
      return 0;
   }

   Smoothin(grin);

   Int_t iper = 1;
   if (isPeriodic) {
      iper = 2;
      if (fMinX < 0 || fMaxX > 1) {
         std::cout << "Error: x must be between 0 and 1 for periodic smooth" << std::endl;
         return 0;
      }
   }

// output X, Y
   fNout = fNin;
   fGout = new TGraph(fNout);
   Int_t i;
   for (i=0; i<fNout; i++) {
      fGout->SetPoint(i,fGin->GetX()[i], 0);
   }

// weights
   Double_t *weight = new Double_t[fNin];
   for (i=0; i<fNin; i++) {
      if (w == 0) weight[i] = 1;
      else        weight[i] = w[i];
   }

// temporary storage array
   Int_t nTmp = (fNin+1)*8;
   Double_t *tmp = new Double_t[nTmp];
   for (i=0; i<nTmp; i++) {
      tmp[i] = 0;
   }

   BDRsupsmu(fNin, fGin->GetX(), fGin->GetY(), weight, iper, span, bass, fGout->GetY(), tmp);

   delete [] tmp;
   delete [] weight;

   return fGout;
}

//______________________________________________________________________
void TGraphSmooth::BDRsupsmu(Int_t n, Double_t *x, Double_t *y, Double_t *w,
     Int_t iper, Double_t span, Double_t alpha, Double_t *smo, Double_t *sc)
{
//*-*-*-*-*-*-*-*-*Friedmannīs super smoother *-*-*-*-*-*-*-*-*-*-*-*-*-*
//                 ==========================
//
//  super smoother (Friedman, 1984).
//
//  version 10/10/84
//
//  coded  and copywrite (c) 1984 by:
//
//                         Jerome H. Friedman
//                      department of statistics
//                                and
//                 stanford linear accelerator center
//                         stanford university
//
//  all rights reserved.
//
//
//  input:
//     n : number of observations (x,y - pairs).
//     x(n) : ordered abscissa values.
//     y(n) : corresponding ordinate (response) values.
//     w(n) : weight for each (x,y) observation.
//     iper : periodic variable flag.
//        iper=1 => x is ordered interval variable.
//        iper=2 => x is a periodic variable with values
//                  in the range (0.0,1.0) and period 1.0.
//     span : smoother span (fraction of observations in window).
//            span=0.0 => automatic (variable) span selection.
//     alpha : controls high frequency (small span) penality
//             used with automatic span selection (bass tone control).
//             (alpha.le.0.0 or alpha.gt.10.0 => no effect.)
//  output:
//    smo(n) : smoothed ordinate (response) values.
//  scratch:
//    sc(n,7) : internal working storage.
//
//  note:
//     for small samples (n < 40) or if there are substantial serial
//     correlations between observations close in x - value, then
//     a prespecified fixed span smoother (span > 0) should be
//     used. reasonable span values are 0.2 to 0.4.
//
// current implementation:
//   Based on R function supsmu: Translated to C++ by C. Stratowa
//   (R source file: ppr.f by B.D.Ripley Copyright (C) 1994-97)
//
//*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

// Local variables
   Int_t sc_offset;
   Int_t i, j, jper;
   Double_t a, f;
   Double_t sw, sy, resmin, vsmlsq;
   Double_t scale;
   Double_t d1, d2;

   Double_t spans[3] = { 0.05, 0.2, 0.5 };
   Double_t big = 1e20;
   Double_t sml = 1e-7;
   Double_t eps = 0.001;

// Parameter adjustments
   sc_offset = n + 1;
   sc -= sc_offset;
   --smo;
   --w;
   --y;
   --x;

// Function Body
   if (x[n] <= x[1]) {
      sy = 0.0;
      sw = sy;
      for (j=1;j<=n;++j) {
         sy += w[j] * y[j];
         sw += w[j];
      }

      a = 0.0;
      if (sw > 0.0) a = sy / sw;
      for (j=1;j<=n;++j) smo[j] = a;
      return;
   }

   i = (Int_t)(n / 4);
   j = i * 3;
   scale = x[j] - x[i];
   while (scale <= 0.0) {
      if (j < n) ++j;
      if (i > 1) --i;
      scale = x[j] - x[i];
   }

// Computing 2nd power
   d1 = eps * scale;
   vsmlsq = d1 * d1;
   jper = iper;
   if (iper == 2 && (x[1] < 0.0 || x[n] > 1.0)) {
      jper = 1;
   }
   if (jper < 1 || jper > 2) {
      jper = 1;
   }
   if (span > 0.0) {
      BDRsmooth(n, &x[1], &y[1], &w[1], span, jper, vsmlsq,
                      &smo[1], &sc[sc_offset]);
      return;
   }

   Double_t *h = new Double_t[n+1];
   for (i = 1; i <= 3; ++i) {
      BDRsmooth(n, &x[1], &y[1], &w[1], spans[i - 1], jper, vsmlsq,
                      &sc[((i<<1)-1)*n + 1], &sc[n*7 + 1]);
      BDRsmooth(n, &x[1], &sc[n*7 + 1], &w[1], spans[1], -jper, vsmlsq,
                      &sc[(i<<1)*n + 1], &h[1]);
   }

   for (j=1; j<=n; ++j) {
      resmin = big;
      for (i=1; i<=3; ++i) {
         if (sc[j + (i<<1)*n] < resmin) {
            resmin = sc[j + (i<<1)*n];
            sc[j + n*7] = spans[i-1];
         }
      }

      if (alpha>0.0 && alpha<=10.0 && resmin<sc[j + n*6]  && resmin>0.0) {
      // Computing MAX
         d1 = TMath::Max(sml,(resmin/sc[j + n*6]));
         d2 = 10. - alpha;
         sc[j + n*7] += (spans[2] - sc[j + n*7]) * TMath::Power(d1, d2);
      }
   }

   BDRsmooth(n, &x[1], &sc[n*7 + 1], &w[1], spans[1], -jper, vsmlsq,
                   &sc[(n<<1) + 1], &h[1]);

   for (j=1; j<=n; ++j) {
      if (sc[j + (n<<1)] <= spans[0]) {
         sc[j + (n<<1)] = spans[0];
      }
      if (sc[j + (n<<1)] >= spans[2]) {
         sc[j + (n<<1)] = spans[2];
      }
      f = sc[j + (n<<1)] - spans[1];
      if (f < 0.0) {
         f = -f / (spans[1] - spans[0]);
         sc[j + (n<<2)] = (1.0 - f) * sc[j + n*3] + f * sc[j + n];
      } else {
         f /= spans[2] - spans[1];
         sc[j + (n<<2)] = (1.0 - f) * sc[j + n*3] + f * sc[j + n*5];
      }
   }

   BDRsmooth(n, &x[1], &sc[(n<<2) + 1], &w[1], spans[0], -jper, vsmlsq,
                   &smo[1], &h[1]);

   delete [] h;
   return;
}

//______________________________________________________________________
void TGraphSmooth::BDRsmooth(Int_t n, Double_t *x, Double_t *y, Double_t *w,
     Double_t span, Int_t iper, Double_t vsmlsq, Double_t *smo, Double_t *acvr)
{
//*-*-*-*-*-*-*-*-* Function for super smoother *-*-*-*-*-*-*-*-*-*-*-*
//                 ============================
//
//   Based on R function supsmu: Translated to C++ by C. Stratowa
//   (R source file: ppr.f by B.D.Ripley Copyright (C) 1994-97)
//
//*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

// Local variables
   Int_t i, j, j0, in, out, it, jper, ibw;
   Double_t a, h1, d1;
   Double_t xm, ym, wt, sy, fbo, fbw;
   Double_t cvar, var, tmp, xti, xto;

// Parameter adjustments
   --acvr;
   --smo;
   --w;
   --y;
   --x;

// Function Body
   xm = 0.;
   ym = xm;
   var = ym;
   cvar = var;
   fbw = cvar;
   jper = TMath::Abs(iper);

   ibw = (Int_t)(span * 0.5 * n + 0.5);
   if (ibw < 2) {
      ibw = 2;
   }

   it = 2*ibw + 1;
   for (i=1; i<=it; ++i) {
      j = i;
      if (jper == 2) {
         j = i - ibw - 1;
      }
      xti = x[j];
      if (j < 1) {
         j = n + j;
         xti = x[j] - 1.0;
      }
      wt = w[j];
      fbo = fbw;
      fbw += wt;
      if (fbw > 0.0) {
         xm = (fbo * xm + wt * xti) / fbw;
         ym = (fbo * ym + wt * y[j]) / fbw;
      }
      tmp = 0.0;
      if (fbo > 0.0) {
         tmp = fbw * wt * (xti - xm) / fbo;
      }
      var += tmp * (xti - xm);
      cvar += tmp * (y[j] - ym);
   }

   for (j=1; j<=n; ++j) {
      out = j - ibw - 1;
      in = j + ibw;
      if (!(jper != 2 && (out < 1 || in > n))) {
         if (out < 1) {
            out = n + out;
            xto = x[out] - 1.0;
            xti = x[in];
         } else if (in > n) {
            in -= n;
            xti = x[in] + 1.0;
            xto = x[out];
         } else {
            xto = x[out];
            xti = x[in];
         }

         wt = w[out];
         fbo = fbw;
         fbw -= wt;
         tmp = 0.0;
         if (fbw > 0.0) {
            tmp = fbo * wt * (xto - xm) / fbw;
         }
         var -= tmp * (xto - xm);
         cvar -= tmp * (y[out] - ym);
         if (fbw > 0.0) {
            xm = (fbo * xm - wt * xto) / fbw;
            ym = (fbo * ym - wt * y[out]) / fbw;
         }
         wt = w[in];
         fbo = fbw;
         fbw += wt;
         if (fbw > 0.0) {
            xm = (fbo * xm + wt * xti) / fbw;
            ym = (fbo * ym + wt * y[in]) / fbw;
         }
         tmp = 0.0;
         if (fbo > 0.0) {
            tmp = fbw * wt * (xti - xm) / fbo;
         }
         var += tmp * (xti - xm);
         cvar += tmp * (y[in] - ym);
      }

      a = 0.0;
      if (var > vsmlsq) {
         a = cvar / var;
      }
      smo[j] = a * (x[j] - xm) + ym;

      if (iper <= 0) {
         continue;
      }

      h1 = 0.0;
      if (fbw > 0.0) {
         h1 = 1.0 / fbw;
      }
      if (var > vsmlsq) {
      // Computing 2nd power
         d1 = x[j] - xm;
         h1 += d1 * d1 / var;
      }

      acvr[j] = 0.0;
      a = 1.0 - w[j] * h1;
      if (a > 0.0) {
         acvr[j] = TMath::Abs(y[j] - smo[j]) / a;
         continue;
      }
      if (j > 1) {
         acvr[j] = acvr[j-1];
      }
   }

   j = 1;
   do {
      j0 = j;
      sy = smo[j] * w[j];
      fbw = w[j];
      if (j < n) {
         do {
            if (x[j + 1] > x[j]) {
               break;
            }
            ++j;
            sy += w[j] * smo[j];
            fbw += w[j];
         } while (j < n);
      }

      if (j > j0) {
         a = 0.0;
         if (fbw > 0.0) {
            a = sy / fbw;
         }
         for (i=j0; i<=j; ++i) {
            smo[i] = a;
         }
      }
      ++j;
   } while (j <= n);

   return;
}

//______________________________________________________________________
void TGraphSmooth::Approxin(TGraph *grin, Int_t /*iKind*/, Double_t &ylow,
     Double_t &yhigh, Int_t rule, Int_t iTies)
{
//*-*-*-*-*-*-*-*-*Sort data points and eliminate double x values*-*-*-*
//                 ==============================================

   if (fGout) {delete fGout; fGout = 0;}
   fGin = grin;

   fNin = fGin->GetN();
   Double_t *xin = new Double_t[fNin];
   Double_t *yin = new Double_t[fNin];
   Int_t i;
   for (i=0;i<fNin;i++) {
      xin[i] = fGin->GetX()[i];
      yin[i] = fGin->GetY()[i];
   }

// sort/rank input x, y
   Int_t *index = new Int_t[fNin];
   Int_t *rank  = new Int_t[fNin];
   Rank(fNin, xin, index, rank, kFALSE);

// input X, Y
   Int_t vNDup = 0;
   Int_t k = 0;
   Int_t *dup = new Int_t[fNin];
   Double_t *x = new Double_t[fNin];
   Double_t *y = new Double_t[fNin];
   Double_t vMean, vMin, vMax;
   for (i=1;i<fNin+1;i++) {
      Int_t ndup = 1;
      vMin = vMean = vMax = yin[index[i-1]];
      while ((i < fNin) && (rank[index[i]] == rank[index[i-1]])) {
         vMean += yin[index[i]];
         vMax = (vMax < yin[index[i]]) ? yin[index[i]] : vMax;
         vMin = (vMin > yin[index[i]]) ? yin[index[i]] : vMin;
         dup[vNDup] = i;
         i++;
         ndup++;
         vNDup++;
      }
      x[k] = xin[index[i-1]];
      if (ndup == 1) {y[k++] = yin[index[i-1]];}
      else switch(iTies) {
         case 1:
            y[k++] = vMean/ndup;
            break;
         case 2:
            y[k++] = vMin;
            break;
         case 3:
            y[k++] = vMax;
            break;
         default:
            y[k++] = vMean/ndup;
            break;
      }
   }
   fNin = k;

// set unique sorted input data x,y as final graph points
   fGin->Set(fNin);
   for (i=0;i<fNin;i++) {
      fGin->SetPoint(i, x[i], y[i]);
   }

   fMinX = fGin->GetX()[0];  //already sorted!
   fMaxX = fGin->GetX()[fNin-1];

// interpolate outside interval [min(x),max(x)]
   switch(rule) {
      case 1:
         ylow  = 0;   // = nan("NAN") ??
         yhigh = 0;   // = nan("NAN") ??
         break;
      case 2:
         ylow  = fGin->GetY()[0];
         yhigh = fGin->GetY()[fNin-1];
         break;
      default:
         break;
   }

// cleanup
   delete [] x;
   delete [] y;
   delete [] dup;
   delete [] rank;
   delete [] index;
   delete [] xin;
   delete [] yin;
}

//______________________________________________________________________
TGraph *TGraphSmooth::Approx(TGraph *grin, Option_t *option, Int_t nout, Double_t *xout,
        Double_t yleft, Double_t yright, Int_t rule, Double_t f, Option_t *ties)
{
//*-*-*-*-*-*-*-*-*Approximate data points*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
//                 =======================
//
// Arguments:
// grin:  graph giving the coordinates of the points to be interpolated.
//        Alternatively a single plotting structure can be specified:
//
// option: specifies the interpolation method to be used.
//        Choices are "linear" (iKind = 1) or "constant" (iKind = 2).
// nout:  If xout is not specified, interpolation takes place at n equally
//        spaced points spanning the interval [min(x), max(x)], where
//        nout = max(nout, number of input data).
// xout:  an optional set of values specifying where interpolation is to
//        take place.
// yleft: the value to be returned when input x values less than min(x).
//        The default is defined by the value of rule given below.
// yright: the value to be returned when input x values greater than max(x).
//        The default is defined by the value of rule given below.
// rule:  an integer describing how interpolation is to take place outside
//        the interval [min(x), max(x)]. If rule is 0 then the given yleft
//        and yright values are returned, if it is 1 then 0 is returned
//        for such points and if it is 2, the value at the closest data
//        extreme is used.
// f:     For method="constant" a number between 0 and 1 inclusive,
//        indicating a compromise between left- and right-continuous step
//        functions. If y0 and y1 are the values to the left and right of
//        the point then the value is y0*f+y1*(1-f) so that f=0 is
//        right-continuous and f=1 is left-continuous
// ties:  Handling of tied x values. An integer describing a function with
//        a single vector argument returning a single number result:
//        ties = "ordered" (iTies = 0): input x are "ordered"
//        ties = "mean"    (iTies = 1): function "mean"
//        ties = "min"     (iTies = 2): function "min"
//        ties = "max"     (iTies = 3): function "max"
//
// Details:
// At least two complete (x, y) pairs are required.
// If there are duplicated (tied) x values and ties is a function it is
// applied to the y values for each distinct x value. Useful functions in
// this context include mean, min, and max.
// If ties="ordered" the x values are assumed to be already ordered. The
// first y value will be used for interpolation to the left and the last
// one for interpolation to the right.
//
// Value:
// approx returns a graph with components x and y, containing n coordinates
// which interpolate the given data points according to the method (and rule)
// desired.

   TString opt = option;
   opt.ToLower();
   Int_t iKind = 0;
   if (opt.Contains("linear")) iKind = 1;
   else if (opt.Contains("constant")) iKind = 2;

   if (f < 0 || f > 1) {
      std::cout << "Error: Invalid f value" << std::endl;
      return 0;
   }

   opt = ties;
   opt.ToLower();
   Int_t iTies = 0;
   if (opt.Contains("ordered")) {
      iTies = 0;
   } else if (opt.Contains("mean")) {
      iTies = 1;
   } else if (opt.Contains("min")) {
      iTies = 2;
   } else if (opt.Contains("max")) {
      iTies = 3;
   } else {
      std::cout << "Error: Method not known: " << ties << std::endl;
      return 0;
   }

// input X, Y
   Double_t ylow  = yleft;
   Double_t yhigh = yright;
   Approxin(grin, iKind, ylow, yhigh, rule, iTies);

// output X, Y
   Double_t delta = 0;
   fNout = nout;
   if (xout == 0) {
      fNout = TMath::Max(nout, fNin);
      delta = (fMaxX - fMinX)/(fNout - 1);
   }

   fGout = new TGraph(fNout);

   Double_t x;
   for (Int_t i=0;i<fNout;i++) {
      if (xout == 0) x = fMinX + i*delta;
      else           x = xout[i];
      Double_t yout = Approx1(x, f, fGin->GetX(), fGin->GetY(), fNin, iKind, ylow, yhigh);
      fGout->SetPoint(i,x, yout);
   }

   return fGout;
}

//______________________________________________________________________
Double_t TGraphSmooth::Approx1(Double_t v, Double_t f, Double_t *x, Double_t *y,
         Int_t n, Int_t iKind, Double_t ylow, Double_t yhigh)
{
//*-*-*-*-*-*-*-*-*Approximate one data point*-*-*-*-*-*-*-*-*-*-*-*-*-*
//*-*              ==========================
//
//   Approximate  y(v),  given (x,y)[i], i = 0,..,n-1
//   Based on R function approx1: Translated to C++ by Christian Stratowa
//   (R source file: approx.c by R Development Core Team (C) 1999-2001)
//

   Int_t i = 0;
   Int_t j = n - 1;

// handle out-of-domain points
   if(v < x[i]) return ylow;
   if(v > x[j]) return yhigh;

// find the correct interval by bisection
   while(i < j - 1) {
      Int_t ij = (i + j)/2;
      if(v < x[ij]) j = ij;
      else i = ij;
   }

// interpolation
   if(v == x[j]) return y[j];
   if(v == x[i]) return y[i];

   if(iKind == 1) { // linear
      return y[i] + (y[j] - y[i]) * ((v - x[i])/(x[j] - x[i]));
   } else { // 2 : constant
      return y[i] * (1-f) + y[j] * f;
   }
}

// helper functions
//______________________________________________________________________
Int_t TGraphSmooth::Rcmp(Double_t x, Double_t y)
{
//   static function
//   if (ISNAN(x))   return 1;
//   if (ISNAN(y))   return -1;
   if (x < y)      return -1;
   if (x > y)      return 1;
   return 0;
}

//______________________________________________________________________
void TGraphSmooth::Psort(Double_t *x, Int_t n, Int_t k)
{
//   static function
//   based on R function rPsort: adapted to C++ by Christian Stratowa
//   (R source file: R_sort.c by R Development Core Team (C) 1999-2001)
//

   Double_t v, w;
   Int_t pL, pR, i, j;

   for (pL = 0, pR = n - 1; pL < pR; ) {
      v = x[k];
      for(i = pL, j = pR; i <= j;) {
         while (TGraphSmooth::Rcmp(x[i], v) < 0) i++;
         while (TGraphSmooth::Rcmp(v, x[j]) < 0) j--;
         if (i <= j) { w = x[i]; x[i++] = x[j]; x[j--] = w; }
      }
      if (j < k) pL = i;
      if (k < i) pR = j;
   }
}

//______________________________________________________________________
void TGraphSmooth::Rank(Int_t n, Double_t *a, Int_t *index, Int_t *rank, Bool_t down)
{
//   static function
   if (n <= 0) return;
   if (n == 1) {
      index[0] = 0;
      rank[0] = 0;
      return;
   }

   TMath::Sort(n,a,index,down);

   Int_t k = 0;
   for (Int_t i=0;i<n;i++) {
      if ((i > 0) && (a[index[i]] == a[index[i-1]])) {
         rank[index[i]] = i-1;
         k++;
      }
      rank[index[i]] = i-k;
   }
}
 TGraphSmooth.cxx:1
 TGraphSmooth.cxx:2
 TGraphSmooth.cxx:3
 TGraphSmooth.cxx:4
 TGraphSmooth.cxx:5
 TGraphSmooth.cxx:6
 TGraphSmooth.cxx:7
 TGraphSmooth.cxx:8
 TGraphSmooth.cxx:9
 TGraphSmooth.cxx:10
 TGraphSmooth.cxx:11
 TGraphSmooth.cxx:12
 TGraphSmooth.cxx:13
 TGraphSmooth.cxx:14
 TGraphSmooth.cxx:15
 TGraphSmooth.cxx:16
 TGraphSmooth.cxx:17
 TGraphSmooth.cxx:18
 TGraphSmooth.cxx:19
 TGraphSmooth.cxx:20
 TGraphSmooth.cxx:21
 TGraphSmooth.cxx:22
 TGraphSmooth.cxx:23
 TGraphSmooth.cxx:24
 TGraphSmooth.cxx:25
 TGraphSmooth.cxx:26
 TGraphSmooth.cxx:27
 TGraphSmooth.cxx:28
 TGraphSmooth.cxx:29
 TGraphSmooth.cxx:30
 TGraphSmooth.cxx:31
 TGraphSmooth.cxx:32
 TGraphSmooth.cxx:33
 TGraphSmooth.cxx:34
 TGraphSmooth.cxx:35
 TGraphSmooth.cxx:36
 TGraphSmooth.cxx:37
 TGraphSmooth.cxx:38
 TGraphSmooth.cxx:39
 TGraphSmooth.cxx:40
 TGraphSmooth.cxx:41
 TGraphSmooth.cxx:42
 TGraphSmooth.cxx:43
 TGraphSmooth.cxx:44
 TGraphSmooth.cxx:45
 TGraphSmooth.cxx:46
 TGraphSmooth.cxx:47
 TGraphSmooth.cxx:48
 TGraphSmooth.cxx:49
 TGraphSmooth.cxx:50
 TGraphSmooth.cxx:51
 TGraphSmooth.cxx:52
 TGraphSmooth.cxx:53
 TGraphSmooth.cxx:54
 TGraphSmooth.cxx:55
 TGraphSmooth.cxx:56
 TGraphSmooth.cxx:57
 TGraphSmooth.cxx:58
 TGraphSmooth.cxx:59
 TGraphSmooth.cxx:60
 TGraphSmooth.cxx:61
 TGraphSmooth.cxx:62
 TGraphSmooth.cxx:63
 TGraphSmooth.cxx:64
 TGraphSmooth.cxx:65
 TGraphSmooth.cxx:66
 TGraphSmooth.cxx:67
 TGraphSmooth.cxx:68
 TGraphSmooth.cxx:69
 TGraphSmooth.cxx:70
 TGraphSmooth.cxx:71
 TGraphSmooth.cxx:72
 TGraphSmooth.cxx:73
 TGraphSmooth.cxx:74
 TGraphSmooth.cxx:75
 TGraphSmooth.cxx:76
 TGraphSmooth.cxx:77
 TGraphSmooth.cxx:78
 TGraphSmooth.cxx:79
 TGraphSmooth.cxx:80
 TGraphSmooth.cxx:81
 TGraphSmooth.cxx:82
 TGraphSmooth.cxx:83
 TGraphSmooth.cxx:84
 TGraphSmooth.cxx:85
 TGraphSmooth.cxx:86
 TGraphSmooth.cxx:87
 TGraphSmooth.cxx:88
 TGraphSmooth.cxx:89
 TGraphSmooth.cxx:90
 TGraphSmooth.cxx:91
 TGraphSmooth.cxx:92
 TGraphSmooth.cxx:93
 TGraphSmooth.cxx:94
 TGraphSmooth.cxx:95
 TGraphSmooth.cxx:96
 TGraphSmooth.cxx:97
 TGraphSmooth.cxx:98
 TGraphSmooth.cxx:99
 TGraphSmooth.cxx:100
 TGraphSmooth.cxx:101
 TGraphSmooth.cxx:102
 TGraphSmooth.cxx:103
 TGraphSmooth.cxx:104
 TGraphSmooth.cxx:105
 TGraphSmooth.cxx:106
 TGraphSmooth.cxx:107
 TGraphSmooth.cxx:108
 TGraphSmooth.cxx:109
 TGraphSmooth.cxx:110
 TGraphSmooth.cxx:111
 TGraphSmooth.cxx:112
 TGraphSmooth.cxx:113
 TGraphSmooth.cxx:114
 TGraphSmooth.cxx:115
 TGraphSmooth.cxx:116
 TGraphSmooth.cxx:117
 TGraphSmooth.cxx:118
 TGraphSmooth.cxx:119
 TGraphSmooth.cxx:120
 TGraphSmooth.cxx:121
 TGraphSmooth.cxx:122
 TGraphSmooth.cxx:123
 TGraphSmooth.cxx:124
 TGraphSmooth.cxx:125
 TGraphSmooth.cxx:126
 TGraphSmooth.cxx:127
 TGraphSmooth.cxx:128
 TGraphSmooth.cxx:129
 TGraphSmooth.cxx:130
 TGraphSmooth.cxx:131
 TGraphSmooth.cxx:132
 TGraphSmooth.cxx:133
 TGraphSmooth.cxx:134
 TGraphSmooth.cxx:135
 TGraphSmooth.cxx:136
 TGraphSmooth.cxx:137
 TGraphSmooth.cxx:138
 TGraphSmooth.cxx:139
 TGraphSmooth.cxx:140
 TGraphSmooth.cxx:141
 TGraphSmooth.cxx:142
 TGraphSmooth.cxx:143
 TGraphSmooth.cxx:144
 TGraphSmooth.cxx:145
 TGraphSmooth.cxx:146
 TGraphSmooth.cxx:147
 TGraphSmooth.cxx:148
 TGraphSmooth.cxx:149
 TGraphSmooth.cxx:150
 TGraphSmooth.cxx:151
 TGraphSmooth.cxx:152
 TGraphSmooth.cxx:153
 TGraphSmooth.cxx:154
 TGraphSmooth.cxx:155
 TGraphSmooth.cxx:156
 TGraphSmooth.cxx:157
 TGraphSmooth.cxx:158
 TGraphSmooth.cxx:159
 TGraphSmooth.cxx:160
 TGraphSmooth.cxx:161
 TGraphSmooth.cxx:162
 TGraphSmooth.cxx:163
 TGraphSmooth.cxx:164
 TGraphSmooth.cxx:165
 TGraphSmooth.cxx:166
 TGraphSmooth.cxx:167
 TGraphSmooth.cxx:168
 TGraphSmooth.cxx:169
 TGraphSmooth.cxx:170
 TGraphSmooth.cxx:171
 TGraphSmooth.cxx:172
 TGraphSmooth.cxx:173
 TGraphSmooth.cxx:174
 TGraphSmooth.cxx:175
 TGraphSmooth.cxx:176
 TGraphSmooth.cxx:177
 TGraphSmooth.cxx:178
 TGraphSmooth.cxx:179
 TGraphSmooth.cxx:180
 TGraphSmooth.cxx:181
 TGraphSmooth.cxx:182
 TGraphSmooth.cxx:183
 TGraphSmooth.cxx:184
 TGraphSmooth.cxx:185
 TGraphSmooth.cxx:186
 TGraphSmooth.cxx:187
 TGraphSmooth.cxx:188
 TGraphSmooth.cxx:189
 TGraphSmooth.cxx:190
 TGraphSmooth.cxx:191
 TGraphSmooth.cxx:192
 TGraphSmooth.cxx:193
 TGraphSmooth.cxx:194
 TGraphSmooth.cxx:195
 TGraphSmooth.cxx:196
 TGraphSmooth.cxx:197
 TGraphSmooth.cxx:198
 TGraphSmooth.cxx:199
 TGraphSmooth.cxx:200
 TGraphSmooth.cxx:201
 TGraphSmooth.cxx:202
 TGraphSmooth.cxx:203
 TGraphSmooth.cxx:204
 TGraphSmooth.cxx:205
 TGraphSmooth.cxx:206
 TGraphSmooth.cxx:207
 TGraphSmooth.cxx:208
 TGraphSmooth.cxx:209
 TGraphSmooth.cxx:210
 TGraphSmooth.cxx:211
 TGraphSmooth.cxx:212
 TGraphSmooth.cxx:213
 TGraphSmooth.cxx:214
 TGraphSmooth.cxx:215
 TGraphSmooth.cxx:216
 TGraphSmooth.cxx:217
 TGraphSmooth.cxx:218
 TGraphSmooth.cxx:219
 TGraphSmooth.cxx:220
 TGraphSmooth.cxx:221
 TGraphSmooth.cxx:222
 TGraphSmooth.cxx:223
 TGraphSmooth.cxx:224
 TGraphSmooth.cxx:225
 TGraphSmooth.cxx:226
 TGraphSmooth.cxx:227
 TGraphSmooth.cxx:228
 TGraphSmooth.cxx:229
 TGraphSmooth.cxx:230
 TGraphSmooth.cxx:231
 TGraphSmooth.cxx:232
 TGraphSmooth.cxx:233
 TGraphSmooth.cxx:234
 TGraphSmooth.cxx:235
 TGraphSmooth.cxx:236
 TGraphSmooth.cxx:237
 TGraphSmooth.cxx:238
 TGraphSmooth.cxx:239
 TGraphSmooth.cxx:240
 TGraphSmooth.cxx:241
 TGraphSmooth.cxx:242
 TGraphSmooth.cxx:243
 TGraphSmooth.cxx:244
 TGraphSmooth.cxx:245
 TGraphSmooth.cxx:246
 TGraphSmooth.cxx:247
 TGraphSmooth.cxx:248
 TGraphSmooth.cxx:249
 TGraphSmooth.cxx:250
 TGraphSmooth.cxx:251
 TGraphSmooth.cxx:252
 TGraphSmooth.cxx:253
 TGraphSmooth.cxx:254
 TGraphSmooth.cxx:255
 TGraphSmooth.cxx:256
 TGraphSmooth.cxx:257
 TGraphSmooth.cxx:258
 TGraphSmooth.cxx:259
 TGraphSmooth.cxx:260
 TGraphSmooth.cxx:261
 TGraphSmooth.cxx:262
 TGraphSmooth.cxx:263
 TGraphSmooth.cxx:264
 TGraphSmooth.cxx:265
 TGraphSmooth.cxx:266
 TGraphSmooth.cxx:267
 TGraphSmooth.cxx:268
 TGraphSmooth.cxx:269
 TGraphSmooth.cxx:270
 TGraphSmooth.cxx:271
 TGraphSmooth.cxx:272
 TGraphSmooth.cxx:273
 TGraphSmooth.cxx:274
 TGraphSmooth.cxx:275
 TGraphSmooth.cxx:276
 TGraphSmooth.cxx:277
 TGraphSmooth.cxx:278
 TGraphSmooth.cxx:279
 TGraphSmooth.cxx:280
 TGraphSmooth.cxx:281
 TGraphSmooth.cxx:282
 TGraphSmooth.cxx:283
 TGraphSmooth.cxx:284
 TGraphSmooth.cxx:285
 TGraphSmooth.cxx:286
 TGraphSmooth.cxx:287
 TGraphSmooth.cxx:288
 TGraphSmooth.cxx:289
 TGraphSmooth.cxx:290
 TGraphSmooth.cxx:291
 TGraphSmooth.cxx:292
 TGraphSmooth.cxx:293
 TGraphSmooth.cxx:294
 TGraphSmooth.cxx:295
 TGraphSmooth.cxx:296
 TGraphSmooth.cxx:297
 TGraphSmooth.cxx:298
 TGraphSmooth.cxx:299
 TGraphSmooth.cxx:300
 TGraphSmooth.cxx:301
 TGraphSmooth.cxx:302
 TGraphSmooth.cxx:303
 TGraphSmooth.cxx:304
 TGraphSmooth.cxx:305
 TGraphSmooth.cxx:306
 TGraphSmooth.cxx:307
 TGraphSmooth.cxx:308
 TGraphSmooth.cxx:309
 TGraphSmooth.cxx:310
 TGraphSmooth.cxx:311
 TGraphSmooth.cxx:312
 TGraphSmooth.cxx:313
 TGraphSmooth.cxx:314
 TGraphSmooth.cxx:315
 TGraphSmooth.cxx:316
 TGraphSmooth.cxx:317
 TGraphSmooth.cxx:318
 TGraphSmooth.cxx:319
 TGraphSmooth.cxx:320
 TGraphSmooth.cxx:321
 TGraphSmooth.cxx:322
 TGraphSmooth.cxx:323
 TGraphSmooth.cxx:324
 TGraphSmooth.cxx:325
 TGraphSmooth.cxx:326
 TGraphSmooth.cxx:327
 TGraphSmooth.cxx:328
 TGraphSmooth.cxx:329
 TGraphSmooth.cxx:330
 TGraphSmooth.cxx:331
 TGraphSmooth.cxx:332
 TGraphSmooth.cxx:333
 TGraphSmooth.cxx:334
 TGraphSmooth.cxx:335
 TGraphSmooth.cxx:336
 TGraphSmooth.cxx:337
 TGraphSmooth.cxx:338
 TGraphSmooth.cxx:339
 TGraphSmooth.cxx:340
 TGraphSmooth.cxx:341
 TGraphSmooth.cxx:342
 TGraphSmooth.cxx:343
 TGraphSmooth.cxx:344
 TGraphSmooth.cxx:345
 TGraphSmooth.cxx:346
 TGraphSmooth.cxx:347
 TGraphSmooth.cxx:348
 TGraphSmooth.cxx:349
 TGraphSmooth.cxx:350
 TGraphSmooth.cxx:351
 TGraphSmooth.cxx:352
 TGraphSmooth.cxx:353
 TGraphSmooth.cxx:354
 TGraphSmooth.cxx:355
 TGraphSmooth.cxx:356
 TGraphSmooth.cxx:357
 TGraphSmooth.cxx:358
 TGraphSmooth.cxx:359
 TGraphSmooth.cxx:360
 TGraphSmooth.cxx:361
 TGraphSmooth.cxx:362
 TGraphSmooth.cxx:363
 TGraphSmooth.cxx:364
 TGraphSmooth.cxx:365
 TGraphSmooth.cxx:366
 TGraphSmooth.cxx:367
 TGraphSmooth.cxx:368
 TGraphSmooth.cxx:369
 TGraphSmooth.cxx:370
 TGraphSmooth.cxx:371
 TGraphSmooth.cxx:372
 TGraphSmooth.cxx:373
 TGraphSmooth.cxx:374
 TGraphSmooth.cxx:375
 TGraphSmooth.cxx:376
 TGraphSmooth.cxx:377
 TGraphSmooth.cxx:378
 TGraphSmooth.cxx:379
 TGraphSmooth.cxx:380
 TGraphSmooth.cxx:381
 TGraphSmooth.cxx:382
 TGraphSmooth.cxx:383
 TGraphSmooth.cxx:384
 TGraphSmooth.cxx:385
 TGraphSmooth.cxx:386
 TGraphSmooth.cxx:387
 TGraphSmooth.cxx:388
 TGraphSmooth.cxx:389
 TGraphSmooth.cxx:390
 TGraphSmooth.cxx:391
 TGraphSmooth.cxx:392
 TGraphSmooth.cxx:393
 TGraphSmooth.cxx:394
 TGraphSmooth.cxx:395
 TGraphSmooth.cxx:396
 TGraphSmooth.cxx:397
 TGraphSmooth.cxx:398
 TGraphSmooth.cxx:399
 TGraphSmooth.cxx:400
 TGraphSmooth.cxx:401
 TGraphSmooth.cxx:402
 TGraphSmooth.cxx:403
 TGraphSmooth.cxx:404
 TGraphSmooth.cxx:405
 TGraphSmooth.cxx:406
 TGraphSmooth.cxx:407
 TGraphSmooth.cxx:408
 TGraphSmooth.cxx:409
 TGraphSmooth.cxx:410
 TGraphSmooth.cxx:411
 TGraphSmooth.cxx:412
 TGraphSmooth.cxx:413
 TGraphSmooth.cxx:414
 TGraphSmooth.cxx:415
 TGraphSmooth.cxx:416
 TGraphSmooth.cxx:417
 TGraphSmooth.cxx:418
 TGraphSmooth.cxx:419
 TGraphSmooth.cxx:420
 TGraphSmooth.cxx:421
 TGraphSmooth.cxx:422
 TGraphSmooth.cxx:423
 TGraphSmooth.cxx:424
 TGraphSmooth.cxx:425
 TGraphSmooth.cxx:426
 TGraphSmooth.cxx:427
 TGraphSmooth.cxx:428
 TGraphSmooth.cxx:429
 TGraphSmooth.cxx:430
 TGraphSmooth.cxx:431
 TGraphSmooth.cxx:432
 TGraphSmooth.cxx:433
 TGraphSmooth.cxx:434
 TGraphSmooth.cxx:435
 TGraphSmooth.cxx:436
 TGraphSmooth.cxx:437
 TGraphSmooth.cxx:438
 TGraphSmooth.cxx:439
 TGraphSmooth.cxx:440
 TGraphSmooth.cxx:441
 TGraphSmooth.cxx:442
 TGraphSmooth.cxx:443
 TGraphSmooth.cxx:444
 TGraphSmooth.cxx:445
 TGraphSmooth.cxx:446
 TGraphSmooth.cxx:447
 TGraphSmooth.cxx:448
 TGraphSmooth.cxx:449
 TGraphSmooth.cxx:450
 TGraphSmooth.cxx:451
 TGraphSmooth.cxx:452
 TGraphSmooth.cxx:453
 TGraphSmooth.cxx:454
 TGraphSmooth.cxx:455
 TGraphSmooth.cxx:456
 TGraphSmooth.cxx:457
 TGraphSmooth.cxx:458
 TGraphSmooth.cxx:459
 TGraphSmooth.cxx:460
 TGraphSmooth.cxx:461
 TGraphSmooth.cxx:462
 TGraphSmooth.cxx:463
 TGraphSmooth.cxx:464
 TGraphSmooth.cxx:465
 TGraphSmooth.cxx:466
 TGraphSmooth.cxx:467
 TGraphSmooth.cxx:468
 TGraphSmooth.cxx:469
 TGraphSmooth.cxx:470
 TGraphSmooth.cxx:471
 TGraphSmooth.cxx:472
 TGraphSmooth.cxx:473
 TGraphSmooth.cxx:474
 TGraphSmooth.cxx:475
 TGraphSmooth.cxx:476
 TGraphSmooth.cxx:477
 TGraphSmooth.cxx:478
 TGraphSmooth.cxx:479
 TGraphSmooth.cxx:480
 TGraphSmooth.cxx:481
 TGraphSmooth.cxx:482
 TGraphSmooth.cxx:483
 TGraphSmooth.cxx:484
 TGraphSmooth.cxx:485
 TGraphSmooth.cxx:486
 TGraphSmooth.cxx:487
 TGraphSmooth.cxx:488
 TGraphSmooth.cxx:489
 TGraphSmooth.cxx:490
 TGraphSmooth.cxx:491
 TGraphSmooth.cxx:492
 TGraphSmooth.cxx:493
 TGraphSmooth.cxx:494
 TGraphSmooth.cxx:495
 TGraphSmooth.cxx:496
 TGraphSmooth.cxx:497
 TGraphSmooth.cxx:498
 TGraphSmooth.cxx:499
 TGraphSmooth.cxx:500
 TGraphSmooth.cxx:501
 TGraphSmooth.cxx:502
 TGraphSmooth.cxx:503
 TGraphSmooth.cxx:504
 TGraphSmooth.cxx:505
 TGraphSmooth.cxx:506
 TGraphSmooth.cxx:507
 TGraphSmooth.cxx:508
 TGraphSmooth.cxx:509
 TGraphSmooth.cxx:510
 TGraphSmooth.cxx:511
 TGraphSmooth.cxx:512
 TGraphSmooth.cxx:513
 TGraphSmooth.cxx:514
 TGraphSmooth.cxx:515
 TGraphSmooth.cxx:516
 TGraphSmooth.cxx:517
 TGraphSmooth.cxx:518
 TGraphSmooth.cxx:519
 TGraphSmooth.cxx:520
 TGraphSmooth.cxx:521
 TGraphSmooth.cxx:522
 TGraphSmooth.cxx:523
 TGraphSmooth.cxx:524
 TGraphSmooth.cxx:525
 TGraphSmooth.cxx:526
 TGraphSmooth.cxx:527
 TGraphSmooth.cxx:528
 TGraphSmooth.cxx:529
 TGraphSmooth.cxx:530
 TGraphSmooth.cxx:531
 TGraphSmooth.cxx:532
 TGraphSmooth.cxx:533
 TGraphSmooth.cxx:534
 TGraphSmooth.cxx:535
 TGraphSmooth.cxx:536
 TGraphSmooth.cxx:537
 TGraphSmooth.cxx:538
 TGraphSmooth.cxx:539
 TGraphSmooth.cxx:540
 TGraphSmooth.cxx:541
 TGraphSmooth.cxx:542
 TGraphSmooth.cxx:543
 TGraphSmooth.cxx:544
 TGraphSmooth.cxx:545
 TGraphSmooth.cxx:546
 TGraphSmooth.cxx:547
 TGraphSmooth.cxx:548
 TGraphSmooth.cxx:549
 TGraphSmooth.cxx:550
 TGraphSmooth.cxx:551
 TGraphSmooth.cxx:552
 TGraphSmooth.cxx:553
 TGraphSmooth.cxx:554
 TGraphSmooth.cxx:555
 TGraphSmooth.cxx:556
 TGraphSmooth.cxx:557
 TGraphSmooth.cxx:558
 TGraphSmooth.cxx:559
 TGraphSmooth.cxx:560
 TGraphSmooth.cxx:561
 TGraphSmooth.cxx:562
 TGraphSmooth.cxx:563
 TGraphSmooth.cxx:564
 TGraphSmooth.cxx:565
 TGraphSmooth.cxx:566
 TGraphSmooth.cxx:567
 TGraphSmooth.cxx:568
 TGraphSmooth.cxx:569
 TGraphSmooth.cxx:570
 TGraphSmooth.cxx:571
 TGraphSmooth.cxx:572
 TGraphSmooth.cxx:573
 TGraphSmooth.cxx:574
 TGraphSmooth.cxx:575
 TGraphSmooth.cxx:576
 TGraphSmooth.cxx:577
 TGraphSmooth.cxx:578
 TGraphSmooth.cxx:579
 TGraphSmooth.cxx:580
 TGraphSmooth.cxx:581
 TGraphSmooth.cxx:582
 TGraphSmooth.cxx:583
 TGraphSmooth.cxx:584
 TGraphSmooth.cxx:585
 TGraphSmooth.cxx:586
 TGraphSmooth.cxx:587
 TGraphSmooth.cxx:588
 TGraphSmooth.cxx:589
 TGraphSmooth.cxx:590
 TGraphSmooth.cxx:591
 TGraphSmooth.cxx:592
 TGraphSmooth.cxx:593
 TGraphSmooth.cxx:594
 TGraphSmooth.cxx:595
 TGraphSmooth.cxx:596
 TGraphSmooth.cxx:597
 TGraphSmooth.cxx:598
 TGraphSmooth.cxx:599
 TGraphSmooth.cxx:600
 TGraphSmooth.cxx:601
 TGraphSmooth.cxx:602
 TGraphSmooth.cxx:603
 TGraphSmooth.cxx:604
 TGraphSmooth.cxx:605
 TGraphSmooth.cxx:606
 TGraphSmooth.cxx:607
 TGraphSmooth.cxx:608
 TGraphSmooth.cxx:609
 TGraphSmooth.cxx:610
 TGraphSmooth.cxx:611
 TGraphSmooth.cxx:612
 TGraphSmooth.cxx:613
 TGraphSmooth.cxx:614
 TGraphSmooth.cxx:615
 TGraphSmooth.cxx:616
 TGraphSmooth.cxx:617
 TGraphSmooth.cxx:618
 TGraphSmooth.cxx:619
 TGraphSmooth.cxx:620
 TGraphSmooth.cxx:621
 TGraphSmooth.cxx:622
 TGraphSmooth.cxx:623
 TGraphSmooth.cxx:624
 TGraphSmooth.cxx:625
 TGraphSmooth.cxx:626
 TGraphSmooth.cxx:627
 TGraphSmooth.cxx:628
 TGraphSmooth.cxx:629
 TGraphSmooth.cxx:630
 TGraphSmooth.cxx:631
 TGraphSmooth.cxx:632
 TGraphSmooth.cxx:633
 TGraphSmooth.cxx:634
 TGraphSmooth.cxx:635
 TGraphSmooth.cxx:636
 TGraphSmooth.cxx:637
 TGraphSmooth.cxx:638
 TGraphSmooth.cxx:639
 TGraphSmooth.cxx:640
 TGraphSmooth.cxx:641
 TGraphSmooth.cxx:642
 TGraphSmooth.cxx:643
 TGraphSmooth.cxx:644
 TGraphSmooth.cxx:645
 TGraphSmooth.cxx:646
 TGraphSmooth.cxx:647
 TGraphSmooth.cxx:648
 TGraphSmooth.cxx:649
 TGraphSmooth.cxx:650
 TGraphSmooth.cxx:651
 TGraphSmooth.cxx:652
 TGraphSmooth.cxx:653
 TGraphSmooth.cxx:654
 TGraphSmooth.cxx:655
 TGraphSmooth.cxx:656
 TGraphSmooth.cxx:657
 TGraphSmooth.cxx:658
 TGraphSmooth.cxx:659
 TGraphSmooth.cxx:660
 TGraphSmooth.cxx:661
 TGraphSmooth.cxx:662
 TGraphSmooth.cxx:663
 TGraphSmooth.cxx:664
 TGraphSmooth.cxx:665
 TGraphSmooth.cxx:666
 TGraphSmooth.cxx:667
 TGraphSmooth.cxx:668
 TGraphSmooth.cxx:669
 TGraphSmooth.cxx:670
 TGraphSmooth.cxx:671
 TGraphSmooth.cxx:672
 TGraphSmooth.cxx:673
 TGraphSmooth.cxx:674
 TGraphSmooth.cxx:675
 TGraphSmooth.cxx:676
 TGraphSmooth.cxx:677
 TGraphSmooth.cxx:678
 TGraphSmooth.cxx:679
 TGraphSmooth.cxx:680
 TGraphSmooth.cxx:681
 TGraphSmooth.cxx:682
 TGraphSmooth.cxx:683
 TGraphSmooth.cxx:684
 TGraphSmooth.cxx:685
 TGraphSmooth.cxx:686
 TGraphSmooth.cxx:687
 TGraphSmooth.cxx:688
 TGraphSmooth.cxx:689
 TGraphSmooth.cxx:690
 TGraphSmooth.cxx:691
 TGraphSmooth.cxx:692
 TGraphSmooth.cxx:693
 TGraphSmooth.cxx:694
 TGraphSmooth.cxx:695
 TGraphSmooth.cxx:696
 TGraphSmooth.cxx:697
 TGraphSmooth.cxx:698
 TGraphSmooth.cxx:699
 TGraphSmooth.cxx:700
 TGraphSmooth.cxx:701
 TGraphSmooth.cxx:702
 TGraphSmooth.cxx:703
 TGraphSmooth.cxx:704
 TGraphSmooth.cxx:705
 TGraphSmooth.cxx:706
 TGraphSmooth.cxx:707
 TGraphSmooth.cxx:708
 TGraphSmooth.cxx:709
 TGraphSmooth.cxx:710
 TGraphSmooth.cxx:711
 TGraphSmooth.cxx:712
 TGraphSmooth.cxx:713
 TGraphSmooth.cxx:714
 TGraphSmooth.cxx:715
 TGraphSmooth.cxx:716
 TGraphSmooth.cxx:717
 TGraphSmooth.cxx:718
 TGraphSmooth.cxx:719
 TGraphSmooth.cxx:720
 TGraphSmooth.cxx:721
 TGraphSmooth.cxx:722
 TGraphSmooth.cxx:723
 TGraphSmooth.cxx:724
 TGraphSmooth.cxx:725
 TGraphSmooth.cxx:726
 TGraphSmooth.cxx:727
 TGraphSmooth.cxx:728
 TGraphSmooth.cxx:729
 TGraphSmooth.cxx:730
 TGraphSmooth.cxx:731
 TGraphSmooth.cxx:732
 TGraphSmooth.cxx:733
 TGraphSmooth.cxx:734
 TGraphSmooth.cxx:735
 TGraphSmooth.cxx:736
 TGraphSmooth.cxx:737
 TGraphSmooth.cxx:738
 TGraphSmooth.cxx:739
 TGraphSmooth.cxx:740
 TGraphSmooth.cxx:741
 TGraphSmooth.cxx:742
 TGraphSmooth.cxx:743
 TGraphSmooth.cxx:744
 TGraphSmooth.cxx:745
 TGraphSmooth.cxx:746
 TGraphSmooth.cxx:747
 TGraphSmooth.cxx:748
 TGraphSmooth.cxx:749
 TGraphSmooth.cxx:750
 TGraphSmooth.cxx:751
 TGraphSmooth.cxx:752
 TGraphSmooth.cxx:753
 TGraphSmooth.cxx:754
 TGraphSmooth.cxx:755
 TGraphSmooth.cxx:756
 TGraphSmooth.cxx:757
 TGraphSmooth.cxx:758
 TGraphSmooth.cxx:759
 TGraphSmooth.cxx:760
 TGraphSmooth.cxx:761
 TGraphSmooth.cxx:762
 TGraphSmooth.cxx:763
 TGraphSmooth.cxx:764
 TGraphSmooth.cxx:765
 TGraphSmooth.cxx:766
 TGraphSmooth.cxx:767
 TGraphSmooth.cxx:768
 TGraphSmooth.cxx:769
 TGraphSmooth.cxx:770
 TGraphSmooth.cxx:771
 TGraphSmooth.cxx:772
 TGraphSmooth.cxx:773
 TGraphSmooth.cxx:774
 TGraphSmooth.cxx:775
 TGraphSmooth.cxx:776
 TGraphSmooth.cxx:777
 TGraphSmooth.cxx:778
 TGraphSmooth.cxx:779
 TGraphSmooth.cxx:780
 TGraphSmooth.cxx:781
 TGraphSmooth.cxx:782
 TGraphSmooth.cxx:783
 TGraphSmooth.cxx:784
 TGraphSmooth.cxx:785
 TGraphSmooth.cxx:786
 TGraphSmooth.cxx:787
 TGraphSmooth.cxx:788
 TGraphSmooth.cxx:789
 TGraphSmooth.cxx:790
 TGraphSmooth.cxx:791
 TGraphSmooth.cxx:792
 TGraphSmooth.cxx:793
 TGraphSmooth.cxx:794
 TGraphSmooth.cxx:795
 TGraphSmooth.cxx:796
 TGraphSmooth.cxx:797
 TGraphSmooth.cxx:798
 TGraphSmooth.cxx:799
 TGraphSmooth.cxx:800
 TGraphSmooth.cxx:801
 TGraphSmooth.cxx:802
 TGraphSmooth.cxx:803
 TGraphSmooth.cxx:804
 TGraphSmooth.cxx:805
 TGraphSmooth.cxx:806
 TGraphSmooth.cxx:807
 TGraphSmooth.cxx:808
 TGraphSmooth.cxx:809
 TGraphSmooth.cxx:810
 TGraphSmooth.cxx:811
 TGraphSmooth.cxx:812
 TGraphSmooth.cxx:813
 TGraphSmooth.cxx:814
 TGraphSmooth.cxx:815
 TGraphSmooth.cxx:816
 TGraphSmooth.cxx:817
 TGraphSmooth.cxx:818
 TGraphSmooth.cxx:819
 TGraphSmooth.cxx:820
 TGraphSmooth.cxx:821
 TGraphSmooth.cxx:822
 TGraphSmooth.cxx:823
 TGraphSmooth.cxx:824
 TGraphSmooth.cxx:825
 TGraphSmooth.cxx:826
 TGraphSmooth.cxx:827
 TGraphSmooth.cxx:828
 TGraphSmooth.cxx:829
 TGraphSmooth.cxx:830
 TGraphSmooth.cxx:831
 TGraphSmooth.cxx:832
 TGraphSmooth.cxx:833
 TGraphSmooth.cxx:834
 TGraphSmooth.cxx:835
 TGraphSmooth.cxx:836
 TGraphSmooth.cxx:837
 TGraphSmooth.cxx:838
 TGraphSmooth.cxx:839
 TGraphSmooth.cxx:840
 TGraphSmooth.cxx:841
 TGraphSmooth.cxx:842
 TGraphSmooth.cxx:843
 TGraphSmooth.cxx:844
 TGraphSmooth.cxx:845
 TGraphSmooth.cxx:846
 TGraphSmooth.cxx:847
 TGraphSmooth.cxx:848
 TGraphSmooth.cxx:849
 TGraphSmooth.cxx:850
 TGraphSmooth.cxx:851
 TGraphSmooth.cxx:852
 TGraphSmooth.cxx:853
 TGraphSmooth.cxx:854
 TGraphSmooth.cxx:855
 TGraphSmooth.cxx:856
 TGraphSmooth.cxx:857
 TGraphSmooth.cxx:858
 TGraphSmooth.cxx:859
 TGraphSmooth.cxx:860
 TGraphSmooth.cxx:861
 TGraphSmooth.cxx:862
 TGraphSmooth.cxx:863
 TGraphSmooth.cxx:864
 TGraphSmooth.cxx:865
 TGraphSmooth.cxx:866
 TGraphSmooth.cxx:867
 TGraphSmooth.cxx:868
 TGraphSmooth.cxx:869
 TGraphSmooth.cxx:870
 TGraphSmooth.cxx:871
 TGraphSmooth.cxx:872
 TGraphSmooth.cxx:873
 TGraphSmooth.cxx:874
 TGraphSmooth.cxx:875
 TGraphSmooth.cxx:876
 TGraphSmooth.cxx:877
 TGraphSmooth.cxx:878
 TGraphSmooth.cxx:879
 TGraphSmooth.cxx:880
 TGraphSmooth.cxx:881
 TGraphSmooth.cxx:882
 TGraphSmooth.cxx:883
 TGraphSmooth.cxx:884
 TGraphSmooth.cxx:885
 TGraphSmooth.cxx:886
 TGraphSmooth.cxx:887
 TGraphSmooth.cxx:888
 TGraphSmooth.cxx:889
 TGraphSmooth.cxx:890
 TGraphSmooth.cxx:891
 TGraphSmooth.cxx:892
 TGraphSmooth.cxx:893
 TGraphSmooth.cxx:894
 TGraphSmooth.cxx:895
 TGraphSmooth.cxx:896
 TGraphSmooth.cxx:897
 TGraphSmooth.cxx:898
 TGraphSmooth.cxx:899
 TGraphSmooth.cxx:900
 TGraphSmooth.cxx:901
 TGraphSmooth.cxx:902
 TGraphSmooth.cxx:903
 TGraphSmooth.cxx:904
 TGraphSmooth.cxx:905
 TGraphSmooth.cxx:906
 TGraphSmooth.cxx:907
 TGraphSmooth.cxx:908
 TGraphSmooth.cxx:909
 TGraphSmooth.cxx:910
 TGraphSmooth.cxx:911
 TGraphSmooth.cxx:912
 TGraphSmooth.cxx:913
 TGraphSmooth.cxx:914
 TGraphSmooth.cxx:915
 TGraphSmooth.cxx:916
 TGraphSmooth.cxx:917
 TGraphSmooth.cxx:918
 TGraphSmooth.cxx:919
 TGraphSmooth.cxx:920
 TGraphSmooth.cxx:921
 TGraphSmooth.cxx:922
 TGraphSmooth.cxx:923
 TGraphSmooth.cxx:924
 TGraphSmooth.cxx:925
 TGraphSmooth.cxx:926
 TGraphSmooth.cxx:927
 TGraphSmooth.cxx:928
 TGraphSmooth.cxx:929
 TGraphSmooth.cxx:930
 TGraphSmooth.cxx:931
 TGraphSmooth.cxx:932
 TGraphSmooth.cxx:933
 TGraphSmooth.cxx:934
 TGraphSmooth.cxx:935
 TGraphSmooth.cxx:936
 TGraphSmooth.cxx:937
 TGraphSmooth.cxx:938
 TGraphSmooth.cxx:939
 TGraphSmooth.cxx:940
 TGraphSmooth.cxx:941
 TGraphSmooth.cxx:942
 TGraphSmooth.cxx:943
 TGraphSmooth.cxx:944
 TGraphSmooth.cxx:945
 TGraphSmooth.cxx:946
 TGraphSmooth.cxx:947
 TGraphSmooth.cxx:948
 TGraphSmooth.cxx:949
 TGraphSmooth.cxx:950
 TGraphSmooth.cxx:951
 TGraphSmooth.cxx:952
 TGraphSmooth.cxx:953
 TGraphSmooth.cxx:954
 TGraphSmooth.cxx:955
 TGraphSmooth.cxx:956
 TGraphSmooth.cxx:957
 TGraphSmooth.cxx:958
 TGraphSmooth.cxx:959
 TGraphSmooth.cxx:960
 TGraphSmooth.cxx:961
 TGraphSmooth.cxx:962
 TGraphSmooth.cxx:963
 TGraphSmooth.cxx:964
 TGraphSmooth.cxx:965
 TGraphSmooth.cxx:966
 TGraphSmooth.cxx:967
 TGraphSmooth.cxx:968
 TGraphSmooth.cxx:969
 TGraphSmooth.cxx:970
 TGraphSmooth.cxx:971
 TGraphSmooth.cxx:972
 TGraphSmooth.cxx:973
 TGraphSmooth.cxx:974
 TGraphSmooth.cxx:975
 TGraphSmooth.cxx:976
 TGraphSmooth.cxx:977
 TGraphSmooth.cxx:978
 TGraphSmooth.cxx:979
 TGraphSmooth.cxx:980
 TGraphSmooth.cxx:981
 TGraphSmooth.cxx:982
 TGraphSmooth.cxx:983
 TGraphSmooth.cxx:984
 TGraphSmooth.cxx:985
 TGraphSmooth.cxx:986
 TGraphSmooth.cxx:987
 TGraphSmooth.cxx:988
 TGraphSmooth.cxx:989
 TGraphSmooth.cxx:990
 TGraphSmooth.cxx:991
 TGraphSmooth.cxx:992
 TGraphSmooth.cxx:993
 TGraphSmooth.cxx:994
 TGraphSmooth.cxx:995
 TGraphSmooth.cxx:996
 TGraphSmooth.cxx:997
 TGraphSmooth.cxx:998
 TGraphSmooth.cxx:999
 TGraphSmooth.cxx:1000
 TGraphSmooth.cxx:1001
 TGraphSmooth.cxx:1002
 TGraphSmooth.cxx:1003
 TGraphSmooth.cxx:1004
 TGraphSmooth.cxx:1005
 TGraphSmooth.cxx:1006
 TGraphSmooth.cxx:1007
 TGraphSmooth.cxx:1008
 TGraphSmooth.cxx:1009
 TGraphSmooth.cxx:1010
 TGraphSmooth.cxx:1011
 TGraphSmooth.cxx:1012
 TGraphSmooth.cxx:1013
 TGraphSmooth.cxx:1014
 TGraphSmooth.cxx:1015
 TGraphSmooth.cxx:1016
 TGraphSmooth.cxx:1017
 TGraphSmooth.cxx:1018
 TGraphSmooth.cxx:1019
 TGraphSmooth.cxx:1020
 TGraphSmooth.cxx:1021
 TGraphSmooth.cxx:1022
 TGraphSmooth.cxx:1023
 TGraphSmooth.cxx:1024
 TGraphSmooth.cxx:1025
 TGraphSmooth.cxx:1026
 TGraphSmooth.cxx:1027
 TGraphSmooth.cxx:1028
 TGraphSmooth.cxx:1029
 TGraphSmooth.cxx:1030
 TGraphSmooth.cxx:1031
 TGraphSmooth.cxx:1032
 TGraphSmooth.cxx:1033
 TGraphSmooth.cxx:1034
 TGraphSmooth.cxx:1035
 TGraphSmooth.cxx:1036
 TGraphSmooth.cxx:1037
 TGraphSmooth.cxx:1038
 TGraphSmooth.cxx:1039
 TGraphSmooth.cxx:1040
 TGraphSmooth.cxx:1041
 TGraphSmooth.cxx:1042
 TGraphSmooth.cxx:1043
 TGraphSmooth.cxx:1044
 TGraphSmooth.cxx:1045
 TGraphSmooth.cxx:1046
 TGraphSmooth.cxx:1047
 TGraphSmooth.cxx:1048
 TGraphSmooth.cxx:1049
 TGraphSmooth.cxx:1050
 TGraphSmooth.cxx:1051
 TGraphSmooth.cxx:1052
 TGraphSmooth.cxx:1053
 TGraphSmooth.cxx:1054
 TGraphSmooth.cxx:1055
 TGraphSmooth.cxx:1056
 TGraphSmooth.cxx:1057
 TGraphSmooth.cxx:1058
 TGraphSmooth.cxx:1059
 TGraphSmooth.cxx:1060
 TGraphSmooth.cxx:1061
 TGraphSmooth.cxx:1062
 TGraphSmooth.cxx:1063
 TGraphSmooth.cxx:1064
 TGraphSmooth.cxx:1065
 TGraphSmooth.cxx:1066
 TGraphSmooth.cxx:1067
 TGraphSmooth.cxx:1068
 TGraphSmooth.cxx:1069
 TGraphSmooth.cxx:1070
 TGraphSmooth.cxx:1071
 TGraphSmooth.cxx:1072
 TGraphSmooth.cxx:1073
 TGraphSmooth.cxx:1074
 TGraphSmooth.cxx:1075
 TGraphSmooth.cxx:1076
 TGraphSmooth.cxx:1077
 TGraphSmooth.cxx:1078
 TGraphSmooth.cxx:1079
 TGraphSmooth.cxx:1080
 TGraphSmooth.cxx:1081
 TGraphSmooth.cxx:1082
 TGraphSmooth.cxx:1083
 TGraphSmooth.cxx:1084
 TGraphSmooth.cxx:1085
 TGraphSmooth.cxx:1086
 TGraphSmooth.cxx:1087
 TGraphSmooth.cxx:1088
 TGraphSmooth.cxx:1089
 TGraphSmooth.cxx:1090
 TGraphSmooth.cxx:1091
 TGraphSmooth.cxx:1092
 TGraphSmooth.cxx:1093
 TGraphSmooth.cxx:1094
 TGraphSmooth.cxx:1095
 TGraphSmooth.cxx:1096
 TGraphSmooth.cxx:1097
 TGraphSmooth.cxx:1098
 TGraphSmooth.cxx:1099
 TGraphSmooth.cxx:1100
 TGraphSmooth.cxx:1101
 TGraphSmooth.cxx:1102
 TGraphSmooth.cxx:1103
 TGraphSmooth.cxx:1104
 TGraphSmooth.cxx:1105
 TGraphSmooth.cxx:1106
 TGraphSmooth.cxx:1107
 TGraphSmooth.cxx:1108
 TGraphSmooth.cxx:1109
 TGraphSmooth.cxx:1110
 TGraphSmooth.cxx:1111
 TGraphSmooth.cxx:1112
 TGraphSmooth.cxx:1113
 TGraphSmooth.cxx:1114
 TGraphSmooth.cxx:1115
 TGraphSmooth.cxx:1116
 TGraphSmooth.cxx:1117
 TGraphSmooth.cxx:1118
 TGraphSmooth.cxx:1119
 TGraphSmooth.cxx:1120
 TGraphSmooth.cxx:1121
 TGraphSmooth.cxx:1122
 TGraphSmooth.cxx:1123
 TGraphSmooth.cxx:1124
 TGraphSmooth.cxx:1125
 TGraphSmooth.cxx:1126
 TGraphSmooth.cxx:1127
 TGraphSmooth.cxx:1128
 TGraphSmooth.cxx:1129
 TGraphSmooth.cxx:1130
 TGraphSmooth.cxx:1131
 TGraphSmooth.cxx:1132
 TGraphSmooth.cxx:1133
 TGraphSmooth.cxx:1134
 TGraphSmooth.cxx:1135
 TGraphSmooth.cxx:1136
 TGraphSmooth.cxx:1137
 TGraphSmooth.cxx:1138
 TGraphSmooth.cxx:1139
 TGraphSmooth.cxx:1140
 TGraphSmooth.cxx:1141
 TGraphSmooth.cxx:1142
 TGraphSmooth.cxx:1143
 TGraphSmooth.cxx:1144
 TGraphSmooth.cxx:1145
 TGraphSmooth.cxx:1146
 TGraphSmooth.cxx:1147
 TGraphSmooth.cxx:1148
 TGraphSmooth.cxx:1149
 TGraphSmooth.cxx:1150
 TGraphSmooth.cxx:1151
 TGraphSmooth.cxx:1152
 TGraphSmooth.cxx:1153
 TGraphSmooth.cxx:1154
 TGraphSmooth.cxx:1155
 TGraphSmooth.cxx:1156
 TGraphSmooth.cxx:1157
 TGraphSmooth.cxx:1158
 TGraphSmooth.cxx:1159
 TGraphSmooth.cxx:1160
 TGraphSmooth.cxx:1161
 TGraphSmooth.cxx:1162
 TGraphSmooth.cxx:1163
 TGraphSmooth.cxx:1164
 TGraphSmooth.cxx:1165
 TGraphSmooth.cxx:1166
 TGraphSmooth.cxx:1167
 TGraphSmooth.cxx:1168
 TGraphSmooth.cxx:1169
 TGraphSmooth.cxx:1170
 TGraphSmooth.cxx:1171
 TGraphSmooth.cxx:1172
 TGraphSmooth.cxx:1173
 TGraphSmooth.cxx:1174
 TGraphSmooth.cxx:1175
 TGraphSmooth.cxx:1176
 TGraphSmooth.cxx:1177
 TGraphSmooth.cxx:1178
 TGraphSmooth.cxx:1179
 TGraphSmooth.cxx:1180
 TGraphSmooth.cxx:1181
 TGraphSmooth.cxx:1182
 TGraphSmooth.cxx:1183
 TGraphSmooth.cxx:1184
 TGraphSmooth.cxx:1185
 TGraphSmooth.cxx:1186
 TGraphSmooth.cxx:1187
 TGraphSmooth.cxx:1188
 TGraphSmooth.cxx:1189
 TGraphSmooth.cxx:1190
 TGraphSmooth.cxx:1191
 TGraphSmooth.cxx:1192
 TGraphSmooth.cxx:1193