// @(#)root/hist:$Id$
// Author: Rene Brun   17/05/2006

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

#include "TProfile3D.h"
#include "TProfile2D.h"
#include "THashList.h"
#include "TMath.h"
#include "THLimitsFinder.h"
#include "Riostream.h"
#include "TVirtualPad.h"
#include "TError.h"
#include "TClass.h"

#include "TProfileHelper.h"

Bool_t TProfile3D::fgApproximate = kFALSE;

ClassImp(TProfile3D)

//______________________________________________________________________________
//
//  Profile3D histograms are used to display the mean
//  value of T and its RMS for each cell in X,Y,Z.
//  Profile3D histograms are in many cases an
//  The inter-relation of three measured quantities X, Y, Z and T can always 
//  be visualized by a four-dimensional histogram or scatter-plot; 
//  its representation on the line-printer is not particularly
//  satisfactory, except for sparse data. If T is an unknown (but single-valued)
//  approximate function of X,Y,Z this function is displayed by a profile3D histogram with
//  much better precision than by a scatter-plot.
//
//  The following formulae show the cumulated contents (capital letters) and the values
//  displayed by the printing or plotting routines (small letters) of the elements for cell I, J.
//
//                                                                2
//      H(I,J,K)  =  sum T                      E(I,J,K)  =  sum T
//      l(I,J,K)  =  sum l                      L(I,J,K)  =  sum l
//      h(I,J,K)  =  H(I,J,K)/L(I,J,K)          s(I,J,K)  =  sqrt(E(I,J,K)/L(I,J,K)- h(I,J,K)**2)
//      e(I,J,K)  =  s(I,J,K)/sqrt(L(I,J,K))
//
//  In the special case where s(I,J,K) is zero (eg, case of 1 entry only in one cell)
//  e(I,J,K) is computed from the average of the s(I,J,K) for all cells,
//  if the static function TProfile3D::Approximate has been called. 
//  This simple/crude approximation was suggested in order to keep the cell
//  during a fit operation. But note that this approximation is not the default behaviour.
//
//           Example of a profile3D histogram
//{
//  TCanvas *c1 = new TCanvas("c1","Profile histogram example",200,10,700,500);
//  hprof3d  = new TProfile3D("hprof3d","Profile of pt versus px, py and pz",40,-4,4,40,-4,4,40,0,20);
//  Double_t px, py, pz, pt;
//  TRandom3 r(0);
//  for ( Int_t i=0; i<25000; i++) {
//     r.Rannor(px,py);
//     pz = px*px + py*py;
//     pt = r.Landau(0,1);
//     hprof3d->Fill(px,py,pz,pt,1);
//  }
//  hprof3d->Draw();
//}
//
// NOTE: A TProfile3D is drawn as it was a simple TH3

//______________________________________________________________________________
TProfile3D::TProfile3D() : TH3D()
{
//*-*-*-*-*-*Default constructor for Profile3D histograms*-*-*-*-*-*-*-*-*
//*-*        ============================================
   fTsumwt = fTsumwt2 = 0;
   fScaling = kFALSE;
   BuildOptions(0,0,"");
}

//______________________________________________________________________________
TProfile3D::~TProfile3D()
{
//*-*-*-*-*-*Default destructor for Profile3D histograms*-*-*-*-*-*-*-*-*
//*-*        ===========================================

}

//______________________________________________________________________________
TProfile3D::TProfile3D(const char *name,const char *title,Int_t nx,Double_t xlow,Double_t xup,Int_t ny,Double_t ylow,Double_t yup,Int_t nz, Double_t zlow,Double_t zup,Option_t *option)
    : TH3D(name,title,nx,xlow,xup,ny,ylow,yup,nz,zlow,zup)
{
//*-*-*-*-*-*Normal Constructor for Profile histograms*-*-*-*-*-*-*-*-*-*
//*-*        ==========================================
//
//  The first eleven parameters are similar to TH3D::TH3D.
//  All values of t are accepted at filling time.
//  To fill a profile3D histogram, one must use TProfile3D::Fill function.
//
//  Note that when filling the profile histogram the function Fill
//  checks if the variable t is betyween fTmin and fTmax.
//  If a minimum or maximum value is set for the T scale before filling,
//  then all values below tmin or above tmax will be discarded.
//  Setting the minimum or maximum value for the T scale before filling
//  has the same effect as calling the special TProfile3D constructor below
//  where tmin and tmax are specified.
//
//  H(I,J,K) is printed as the cell contents. The errors computed are s(I,J,K) if CHOPT='S'
//  (spread option), or e(I,J,K) if CHOPT=' ' (error on mean).
//
//        See TProfile3D::BuildOptions for explanation of parameters
//
//   see other constructors below with all possible combinations of
//   fix and variable bin size like in TH3D.

   BuildOptions(0,0,option);
   if (xlow >= xup || ylow >= yup || zlow >= zup) SetBuffer(fgBufferSize);
}

//______________________________________________________________________________
TProfile3D::TProfile3D(const char *name,const char *title,Int_t nx,const Double_t *xbins,Int_t ny,const Double_t *ybins,Int_t nz,const Double_t *zbins,Option_t *option)
    : TH3D(name,title,nx,xbins,ny,ybins,nz,zbins)
{
//  Create a 3-D Profile with variable bins in X , Y and Z

   BuildOptions(0,0,option);
}

//______________________________________________________________________________
void TProfile3D::BuildOptions(Double_t tmin, Double_t tmax, Option_t *option)
{
//*-*-*-*-*-*-*Set Profile3D histogram structure and options*-*-*-*-*-*-*-*-*
//*-*          =============================================
//
//    tmin:  minimum value allowed for t 
//    tmax:  maximum value allowed for t 
//            if (tmin = tmax = 0) there are no limits on the allowed t values (tmin = -inf, tmax = +inf)
//
//    option:  this is the option for the computation of the t error of the profile ( TProfile3D::GetBinError )
//             possible values for the options are documented in TProfile3D::SetErrorOption
// 
//    see also TProfile::BuildOptions for a detailed description

   SetErrorOption(option);

   // create extra profile data structire (bin entries/ y^2 and sum of weight square)
   TProfileHelper::BuildArray(this);

   fTmin = tmin;
   fTmax = tmax;
   fScaling = kFALSE;
   fTsumwt  = fTsumwt2 = 0;
}

//______________________________________________________________________________
TProfile3D::TProfile3D(const TProfile3D &profile) : TH3D()
{
   //copy constructor
   ((TProfile3D&)profile).Copy(*this);
}


//______________________________________________________________________________
Bool_t TProfile3D::Add(TF1 *, Double_t , Option_t*)
{
   // Performs the operation: this = this + c1*f1

   Error("Add","Function not implemented for TProfile3D");
   return kFALSE;
}


//______________________________________________________________________________
Bool_t TProfile3D::Add(const TH1 *h1, Double_t c1)
{
   // Performs the operation: this = this + c1*h1

   if (!h1) {
      Error("Add","Attempt to add a non-existing profile");
      return kFALSE;
   }
   if (!h1->InheritsFrom(TProfile3D::Class())) {
      Error("Add","Attempt to add a non-profile2D object");
      return kFALSE;
   }

   return TProfileHelper::Add(this, this, h1, 1, c1);
}

//______________________________________________________________________________
Bool_t TProfile3D::Add(const TH1 *h1, const TH1 *h2, Double_t c1, Double_t c2)
{
//*-*-*-*-*Replace contents of this profile3D by the addition of h1 and h2*-*-*
//*-*      ===============================================================
//
//   this = c1*h1 + c2*h2
//

   if (!h1 || !h2) {
      Error("Add","Attempt to add a non-existing profile");
      return kFALSE;
   }
   if (!h1->InheritsFrom(TProfile3D::Class())) {
      Error("Add","Attempt to add a non-profile3D object");
      return kFALSE;
   }
   if (!h2->InheritsFrom(TProfile3D::Class())) {
      Error("Add","Attempt to add a non-profile3D object");
      return kFALSE;
   }

   return TProfileHelper::Add(this, h1, h2, c1, c2);
}


//______________________________________________________________________________
void TProfile3D::Approximate(Bool_t approx)
{
//     static function
// set the fgApproximate flag. When the flag is true, the function GetBinError
// will approximate the bin error with the average profile error on all bins
// in the following situation only
//  - the number of bins in the profile3D is less than 10404 (eg 100x100x100)
//  - the bin number of entries is small ( <5)
//  - the estimated bin error is extremely small compared to the bin content
//  (see TProfile3D::GetBinError)

   fgApproximate = approx;
}


//______________________________________________________________________________
Int_t TProfile3D::BufferEmpty(Int_t action)
{
// Fill histogram with all entries in the buffer.
// action = -1 histogram is reset and refilled from the buffer (called by THistPainter::Paint)
// action =  0 histogram is filled from the buffer
// action =  1 histogram is filled and buffer is deleted
//             The buffer is automatically deleted when the number of entries
//             in the buffer is greater than the number of entries in the histogram

   // do we need to compute the bin size?
   if (!fBuffer) return 0;
   Int_t nbentries = (Int_t)fBuffer[0];
   if (!nbentries) return 0;
   Double_t *buffer = fBuffer;
   if (nbentries < 0) {
      if (action == 0) return 0;
      nbentries  = -nbentries;
      fBuffer=0;
      Reset("ICES"); // reset without deleting the functions
      fBuffer = buffer;
   }
   if (CanExtendAllAxes() || fXaxis.GetXmax() <= fXaxis.GetXmin() || fYaxis.GetXmax() <= fYaxis.GetXmin()) {
      //find min, max of entries in buffer
      Double_t xmin = fBuffer[2];
      Double_t xmax = xmin;
      Double_t ymin = fBuffer[3];
      Double_t ymax = ymin;
      Double_t zmin = fBuffer[4];
      Double_t zmax = zmin;
      for (Int_t i=1;i<nbentries;i++) {
         Double_t x = fBuffer[5*i+2];
         if (x < xmin) xmin = x;
         if (x > xmax) xmax = x;
         Double_t y = fBuffer[5*i+3];
         if (y < ymin) ymin = y;
         if (y > ymax) ymax = y;
         Double_t z = fBuffer[5*i+4];
         if (z < zmin) zmin = z;
         if (z > zmax) zmax = z;
     }
      if (fXaxis.GetXmax() <= fXaxis.GetXmin() || fYaxis.GetXmax() <= fYaxis.GetXmin() || fZaxis.GetXmax() <= fZaxis.GetXmin()) {
         THLimitsFinder::GetLimitsFinder()->FindGoodLimits(this,xmin,xmax,ymin,ymax,zmin,zmax);
      } else {
         fBuffer = 0;
         Int_t keep = fBufferSize; fBufferSize = 0;
         if (xmin <  fXaxis.GetXmin()) ExtendAxis(xmin,&fXaxis);
         if (xmax >= fXaxis.GetXmax()) ExtendAxis(xmax,&fXaxis);
         if (ymin <  fYaxis.GetXmin()) ExtendAxis(ymin,&fYaxis);
         if (ymax >= fYaxis.GetXmax()) ExtendAxis(ymax,&fYaxis);
         if (zmin <  fZaxis.GetXmin()) ExtendAxis(zmin,&fZaxis);
         if (zmax >= fZaxis.GetXmax()) ExtendAxis(zmax,&fZaxis);
         fBuffer = buffer;
         fBufferSize = keep;
      }
   }

   fBuffer = 0;
   for (Int_t i=0;i<nbentries;i++) {
      Fill(buffer[5*i+2],buffer[5*i+3],buffer[5*i+4],buffer[5*i+5],buffer[5*i+1]);
   }
   fBuffer = buffer;

   if (action > 0) { delete [] fBuffer; fBuffer = 0; fBufferSize = 0;}
   else {
      if (nbentries == (Int_t)fEntries) fBuffer[0] = -nbentries;
      else                              fBuffer[0] = 0;
   }
   return nbentries;
}

//______________________________________________________________________________
Int_t TProfile3D::BufferFill(Double_t x, Double_t y, Double_t z, Double_t t, Double_t w)
{
// accumulate arguments in buffer. When buffer is full, empty the buffer
// fBuffer[0] = number of entries in buffer
// fBuffer[1] = w of first entry
// fBuffer[2] = x of first entry
// fBuffer[3] = y of first entry
// fBuffer[4] = z of first entry
// fBuffer[5] = t of first entry

   if (!fBuffer) return -3;
   Int_t nbentries = (Int_t)fBuffer[0];
   if (nbentries < 0) {
      nbentries  = -nbentries;
      fBuffer[0] =  nbentries;
      if (fEntries > 0) {
         Double_t *buffer = fBuffer; fBuffer=0;
         Reset("ICES"); // reset without deleting the functions
         fBuffer = buffer;
      }
   }
   if (5*nbentries+5 >= fBufferSize) {
      BufferEmpty(1);
      return Fill(x,y,z,t,w);
   }
   fBuffer[5*nbentries+1] = w;
   fBuffer[5*nbentries+2] = x;
   fBuffer[5*nbentries+3] = y;
   fBuffer[5*nbentries+4] = z;
   fBuffer[5*nbentries+5] = t;
   fBuffer[0] += 1;
   return -2;
}

//______________________________________________________________________________
void TProfile3D::Copy(TObject &obj) const
{
//*-*-*-*-*-*-*-*Copy a Profile3D histogram to a new profile2D histogram*-*-*-*
//*-*            =======================================================

   try { 
      TProfile3D & pobj = dynamic_cast<TProfile3D&>(obj);

      TH3D::Copy(pobj);
      fBinEntries.Copy(pobj.fBinEntries);
      fBinSumw2.Copy(pobj.fBinSumw2);
      for (int bin=0;bin<fNcells;bin++) {
         pobj.fArray[bin]        = fArray[bin];
         pobj.fSumw2.fArray[bin] = fSumw2.fArray[bin];
      }
      pobj.fTmin = fTmin;
      pobj.fTmax = fTmax;
      pobj.fScaling = fScaling;
      pobj.fErrorMode = fErrorMode;
      pobj.fTsumwt  = fTsumwt;
      pobj.fTsumwt2 = fTsumwt2;

   } catch(...) {
      Fatal("Copy","Cannot copy a TProfile3D in a %s",obj.IsA()->GetName());
   }
}

//______________________________________________________________________________
Bool_t TProfile3D::Divide(TF1 *, Double_t )
{
   // Performs the operation: this = this/(c1*f1)
   // This function is not implemented

   Error("Divide","Function not implemented for TProfile3D");
   return kFALSE;
}

//______________________________________________________________________________
Bool_t TProfile3D::Divide(const TH1 *h1)
{
//*-*-*-*-*-*-*-*-*-*-*Divide this profile2D by h1*-*-*-*-*-*-*-*-*-*-*-*-*
//*-*                  ===========================
//
//   this = this/h1
//
//   This function return kFALSE if the divide operation failed

   if (!h1) {
      Error("Divide","Attempt to divide a non-existing profile2D");
      return kFALSE;
   }
   if (!h1->InheritsFrom(TProfile3D::Class())) {
      Error("Divide","Attempt to divide a non-profile3D object");
      return kFALSE;
   }
   TProfile3D *p1 = (TProfile3D*)h1;

   // delete buffer if it is there since it will become invalid
   if (fBuffer) BufferEmpty(1);

//*-*- Check profile compatibility
   Int_t nx = GetNbinsX();
   if (nx != p1->GetNbinsX()) {
      Error("Divide","Attempt to divide profiles with different number of bins");
      return kFALSE;
   }
   Int_t ny = GetNbinsY();
   if (ny != p1->GetNbinsY()) {
      Error("Divide","Attempt to divide profiles with different number of bins");
      return kFALSE;
   }
   Int_t nz = GetNbinsZ();
   if (nz != p1->GetNbinsZ()) {
      Error("Divide","Attempt to divide profiles with different number of bins");
      return kFALSE;
   }

//*-*- Reset statistics
   fEntries = fTsumw   = fTsumw2 = fTsumwx = fTsumwx2 = 0;

//*-*- Loop on bins (including underflows/overflows)
   Int_t bin,binx,biny,binz;
   Double_t *cu1 = p1->GetW();
   Double_t *er1 = p1->GetW2();
   Double_t *en1 = p1->GetB();
   Double_t c0,c1,w,u,x,y,z;
   for (binx =0;binx<=nx+1;binx++) {
      for (biny =0;biny<=ny+1;biny++) {
         for (binz =0;binz<=nz+1;binz++) {
            bin   = GetBin(binx,biny,binz);
            c0  = fArray[bin];
            c1  = cu1[bin];
            if (c1) w = c0/c1;
            else    w = 0;
            fArray[bin] = w;
            u = TMath::Abs(w);
            x = fXaxis.GetBinCenter(binx);
            y = fYaxis.GetBinCenter(biny);
            z = fZaxis.GetBinCenter(binz);
            fEntries++;
            fTsumw   += u;
            fTsumw2  += u*u;
            fTsumwx  += u*x;
            fTsumwx2 += u*x*x;
            fTsumwy  += u*y;
            fTsumwy2 += u*y*y;
            fTsumwxy += u*x*y;
            fTsumwz  += u;
            fTsumwz2 += u*z;
            fTsumwxz += u*x*z;
            fTsumwyz += u*y*z;
            fTsumwt  += u;
            fTsumwt2 += u*u;
            Double_t e0 = fSumw2.fArray[bin];
            Double_t e1 = er1[bin];
            Double_t c12= c1*c1;
            if (!c1) fSumw2.fArray[bin] = 0;
            else     fSumw2.fArray[bin] = (e0*c1*c1 + e1*c0*c0)/(c12*c12);
            if (!en1[bin]) fBinEntries.fArray[bin] = 0;
            else           fBinEntries.fArray[bin] /= en1[bin];
         }
      }
   }
   // mantaining the correct sum of weights square is not supported when dividing
   // bin error resulting from division of profile needs to be checked 
   if (fBinSumw2.fN) { 
      Warning("Divide","Cannot preserve during the division of profiles the sum of bin weight square");
      fBinSumw2 = TArrayD();
   }
   return kTRUE;
}


//______________________________________________________________________________
Bool_t TProfile3D::Divide(const TH1 *h1, const TH1 *h2, Double_t c1, Double_t c2, Option_t *option)
{
//*-*-*-*-*Replace contents of this profile2D by the division of h1 by h2*-*-*
//*-*      ==============================================================
//
//   this = c1*h1/(c2*h2)
//
//   This function return kFALSE if the divide operation failed

   TString opt = option;
   opt.ToLower();
   Bool_t binomial = kFALSE;
   if (opt.Contains("b")) binomial = kTRUE;
   if (!h1 || !h2) {
      Error("Divide","Attempt to divide a non-existing profile2D");
      return kFALSE;
   }
   if (!h1->InheritsFrom(TProfile3D::Class())) {
      Error("Divide","Attempt to divide a non-profile2D object");
      return kFALSE;
   }
   TProfile3D *p1 = (TProfile3D*)h1;
   if (!h2->InheritsFrom(TProfile3D::Class())) {
      Error("Divide","Attempt to divide a non-profile2D object");
      return kFALSE;
   }
   TProfile3D *p2 = (TProfile3D*)h2;

//*-*- Check histogram compatibility
   Int_t nx = GetNbinsX();
   if (nx != p1->GetNbinsX() || nx != p2->GetNbinsX()) {
      Error("Divide","Attempt to divide profiles with different number of bins");
      return kFALSE;
   }
   Int_t ny = GetNbinsY();
   if (ny != p1->GetNbinsY() || ny != p2->GetNbinsY()) {
      Error("Divide","Attempt to divide profiles with different number of bins");
      return kFALSE;
   }
   Int_t nz = GetNbinsZ();
   if (nz != p1->GetNbinsZ() || nz != p2->GetNbinsZ()) {
      Error("Divide","Attempt to divide profiles with different number of bins");
      return kFALSE;
   }
   if (!c2) {
      Error("Divide","Coefficient of dividing profile cannot be zero");
      return kFALSE;
   }

//*-*- Reset statistics
   fEntries = fTsumw   = fTsumw2 = fTsumwx = fTsumwx2 = 0;

//*-*- Loop on bins (including underflows/overflows)
   Int_t bin,binx,biny,binz;
   Double_t *cu1 = p1->GetW();
   Double_t *cu2 = p2->GetW();
   Double_t *er1 = p1->GetW2();
   Double_t *er2 = p2->GetW2();
   Double_t *en1 = p1->GetB();
   Double_t *en2 = p2->GetB();
   Double_t b1,b2,w,u,x,y,z,ac1,ac2;
   ac1 = TMath::Abs(c1);
   ac2 = TMath::Abs(c2);
   for (binx =0;binx<=nx+1;binx++) {
      for (biny =0;biny<=ny+1;biny++) {
         for (binz =0;binz<=nz+1;binz++) {
            bin   = GetBin(binx,biny,binz);
            b1  = cu1[bin];
            b2  = cu2[bin];
            if (b2) w = c1*b1/(c2*b2);
            else    w = 0;
            fArray[bin] = w;
            u = TMath::Abs(w);
            x = fXaxis.GetBinCenter(binx);
            y = fYaxis.GetBinCenter(biny);
            z = fZaxis.GetBinCenter(biny);
            fEntries++;
            fTsumw   += u;
            fTsumw2  += u*u;
            fTsumwx  += u*x;
            fTsumwx2 += u*x*x;
            fTsumwy  += u*y;
            fTsumwy2 += u*y*y;
            fTsumwxy += u*x*y;
            fTsumwz  += u*z;
            fTsumwz2 += u*z*z;
            fTsumwxz += u*x*z;
            fTsumwyz += u*y*z;
            fTsumwt  += u;
            fTsumwt2 += u*u;
            Double_t e1 = er1[bin];
            Double_t e2 = er2[bin];
          //Double_t b22= b2*b2*d2;
            Double_t b22= b2*b2*TMath::Abs(c2);
            if (!b2) fSumw2.fArray[bin] = 0;
            else {
               if (binomial) {
                  fSumw2.fArray[bin] = TMath::Abs(w*(1-w)/(c2*b2));
               } else {
                  fSumw2.fArray[bin] = ac1*ac2*(e1*b2*b2 + e2*b1*b1)/(b22*b22);
               }
            }
            if (!en2[bin]) fBinEntries.fArray[bin] = 0;
            else           fBinEntries.fArray[bin] = en1[bin]/en2[bin];
         }
      }
   }
   return kTRUE;
}

//______________________________________________________________________________
Int_t TProfile3D::Fill(Double_t x, Double_t y, Double_t z, Double_t t)
{
//*-*-*-*-*-*-*-*-*-*-*Fill a Profile3D histogram (no weights)*-*-*-*-*-*-*-*
//*-*                  =======================================

   if (fBuffer) return BufferFill(x,y,z,t,1);

   Int_t bin,binx,biny,binz;

   if (fTmin != fTmax) {
      if (t <fTmin || t> fTmax || TMath::IsNaN(t) ) return -1;
   }

   fEntries++;
   binx =fXaxis.FindBin(x);
   biny =fYaxis.FindBin(y);
   binz =fZaxis.FindBin(z);
   if (binx <0 || biny <0 || binz<0) return -1;
   bin  = GetBin(binx,biny,binz);
   AddBinContent(bin, t);
   fSumw2.fArray[bin] += (Double_t)t*t;
   fBinEntries.fArray[bin] += 1;
   if (fBinSumw2.fN)  fBinSumw2.fArray[bin] += 1;
   if (binx == 0 || binx > fXaxis.GetNbins()) {
      if (!fgStatOverflows) return -1;
   }
   if (biny == 0 || biny > fYaxis.GetNbins()) {
      if (!fgStatOverflows) return -1;
   }
   if (binz == 0 || binz > fZaxis.GetNbins()) {
      if (!fgStatOverflows) return -1;
   }
//printf("x=%g, y=%g, z=%g, t=%g, binx=%d, biny=%d, binz=%d, bin=%d\n",x,y,z,t,binx,biny,binz,bin);
   ++fTsumw;
   ++fTsumw2;
   fTsumwx  += x;
   fTsumwx2 += x*x;
   fTsumwy  += y;
   fTsumwy2 += y*y;
   fTsumwxy += x*y;
   fTsumwz  += z;
   fTsumwz2 += z*z;
   fTsumwxz += x*z;
   fTsumwyz += y*z;
   fTsumwt  += t;
   fTsumwt2 += t*t;
   return bin;
}

//______________________________________________________________________________
Int_t TProfile3D::Fill(Double_t x, Double_t y, Double_t z, Double_t t, Double_t w)
{
//*-*-*-*-*-*-*-*-*-*-*Fill a Profile3D histogram with weights*-*-*-*-*-*-*-*
//*-*                  =======================================

   if (fBuffer) return BufferFill(x,y,z,t,w);

   Int_t bin,binx,biny,binz;

   if (fTmin != fTmax) {
      if (t <fTmin || z> fTmax || TMath::IsNaN(t) ) return -1;
   }

   Double_t u= w; // (w > 0 ? w : -w);
   fEntries++;
   binx =fXaxis.FindBin(x);
   biny =fYaxis.FindBin(y);
   binz =fZaxis.FindBin(z);
   if (binx <0 || biny <0 || binz<0) return -1;
   bin  = GetBin(binx,biny,binz);
   AddBinContent(bin, u*t);
   fSumw2.fArray[bin] += u*t*t;
   if (!fBinSumw2.fN && u != 1.)  Sumw2();  // must be called before accumulating the entries 
   if (fBinSumw2.fN)  fBinSumw2.fArray[bin] += u*u;
   fBinEntries.fArray[bin] += u;
   if (binx == 0 || binx > fXaxis.GetNbins()) {
      if (!fgStatOverflows) return -1;
   }
   if (biny == 0 || biny > fYaxis.GetNbins()) {
      if (!fgStatOverflows) return -1;
   }
   if (binz == 0 || binz > fZaxis.GetNbins()) {
      if (!fgStatOverflows) return -1;
   }
   fTsumw   += u;
   fTsumw2  += u*u;
   fTsumwx  += u*x;
   fTsumwx2 += u*x*x;
   fTsumwy  += u*y;
   fTsumwy2 += u*y*y;
   fTsumwxy += u*x*y;
   fTsumwz  += u*z;
   fTsumwz2 += u*z*z;
   fTsumwxz += u*x*z;
   fTsumwyz += u*y*z;
   fTsumwt  += u*t;
   fTsumwt2 += u*t*t;
   return bin;
}

//______________________________________________________________________________
Double_t TProfile3D::GetBinContent(Int_t bin) const
{
//*-*-*-*-*-*-*Return bin content of a Profile3D histogram*-*-*-*-*-*-*-*-*
//*-*          ===========================================

   if (fBuffer) ((TProfile3D*)this)->BufferEmpty();

   if (bin < 0 || bin >= fNcells) return 0;
   if (fBinEntries.fArray[bin] == 0) return 0;
   if (!fArray) return 0;
   return fArray[bin]/fBinEntries.fArray[bin];
}

//______________________________________________________________________________
Double_t TProfile3D::GetBinEntries(Int_t bin) const
{
//*-*-*-*-*-*-*Return bin entries of a Profile3D histogram*-*-*-*-*-*-*-*-*
//*-*          ===========================================

   if (fBuffer) ((TProfile3D*)this)->BufferEmpty();

   if (bin < 0 || bin >= fNcells) return 0;
   return fBinEntries.fArray[bin];
}

//______________________________________________________________________________
Double_t TProfile3D::GetBinEffectiveEntries(Int_t bin)
{
//            Return bin effective entries for a weighted filled Profile histogram. 
//            In case of an unweighted profile, it is equivalent to the number of entries per bin   
//            The effective entries is defined as the square of the sum of the weights divided by the 
//            sum of the weights square. 
//            TProfile::Sumw2() must be called before filling the profile with weights. 
//            Only by calling this method the  sum of the square of the weights per bin is stored. 
//  
//*-*          =========================================

   return TProfileHelper::GetBinEffectiveEntries((TProfile3D*)this, bin);
}

//______________________________________________________________________________
Double_t TProfile3D::GetBinError(Int_t bin) const
{
// *-*-*-*-*-*-*Return bin error of a Profile3D histogram*-*-*-*-*-*-*-*-*
//
// Computing errors: A moving field
// =================================
// The computation of errors for a TProfile3D has evolved with the versions
// of ROOT. The difficulty is in computing errors for bins with low statistics.
// - prior to version 3.10, we had no special treatment of low statistic bins.
//   As a result, these bins had huge errors. The reason is that the
//   expression eprim2 is very close to 0 (rounding problems) or 0.
// - The algorithm is modified/protected for the case
//   when a TProfile3D is projected (ProjectionX). The previous algorithm
//   generated a N^2 problem when projecting a TProfile3D with a large number of
//   bins (eg 100000).
// - in version 3.10/02, a new static function TProfile::Approximate
//   is introduced to enable or disable (default) the approximation.
//   (see also comments in TProfile::GetBinError)

   return TProfileHelper::GetBinError((TProfile3D*)this, bin);
}

//______________________________________________________________________________
Option_t *TProfile3D::GetErrorOption() const
{
//*-*-*-*-*-*-*-*-*-*Return option to compute profile2D errors*-*-*-*-*-*-*-*
//*-*                =========================================

   if (fErrorMode == kERRORSPREAD)  return "s";
   if (fErrorMode == kERRORSPREADI) return "i";
   if (fErrorMode == kERRORSPREADG) return "g";
   return "";
}

//______________________________________________________________________________
void TProfile3D::GetStats(Double_t *stats) const
{
   // fill the array stats from the contents of this profile
   // The array stats must be correctly dimensionned in the calling program.
   // stats[0] = sumw
   // stats[1] = sumw2
   // stats[2] = sumwx
   // stats[3] = sumwx2
   // stats[4] = sumwy
   // stats[5] = sumwy2
   // stats[6] = sumwxy
   // stats[7] = sumwz
   // stats[8] = sumwz2
   // stats[9] = sumwxz
   // stats[10]= sumwyz
   // stats[11]= sumwt
   // stats[12]= sumwt2
   //
   // If no axis-subrange is specified (via TAxis::SetRange), the array stats
   // is simply a copy of the statistics quantities computed at filling time.
   // If a sub-range is specified, the function recomputes these quantities
   // from the bin contents in the current axis range.

   if (fBuffer) ((TProfile3D*)this)->BufferEmpty();

   // Loop on bins
   if (fTsumw == 0 || fXaxis.TestBit(TAxis::kAxisRange) || fYaxis.TestBit(TAxis::kAxisRange)) {
      Int_t bin, binx, biny,binz;
      Double_t w, w2;
      Double_t x,y,z;
      for (bin=0;bin<kNstat;bin++) stats[bin] = 0;
      if (!fBinEntries.fArray) return;
      for (binz=fZaxis.GetFirst();binz<=fZaxis.GetLast();binz++) {
         z = fZaxis.GetBinCenter(binz);
         for (biny=fYaxis.GetFirst();biny<=fYaxis.GetLast();biny++) {
            y = fYaxis.GetBinCenter(biny);
            for (binx=fXaxis.GetFirst();binx<=fXaxis.GetLast();binx++) {
               bin = GetBin(binx,biny,binz);
               w         = fBinEntries.fArray[bin];
               w2        = (fBinSumw2.fN ? fBinSumw2.fArray[bin] : w );
               x         = fXaxis.GetBinCenter(binx);
               stats[0]  += w;
               stats[1]  += w2;
               stats[2]  += w*x;
               stats[3]  += w*x*x;
               stats[4]  += w*y;
               stats[5]  += w*y*y;
               stats[6]  += w*x*y;
               stats[7]  += w*z;
               stats[8]  += w*z*z;
               stats[9]  += w*x*z;
               stats[10] += w*y*z;
               stats[11] += fArray[bin];
               stats[12] += fSumw2.fArray[bin];
            }
         }
      }
   } else {
      stats[0]  = fTsumw;
      stats[1]  = fTsumw2;
      stats[2]  = fTsumwx;
      stats[3]  = fTsumwx2;
      stats[4]  = fTsumwy;
      stats[5]  = fTsumwy2;
      stats[6]  = fTsumwxy;
      stats[7]  = fTsumwz;
      stats[8]  = fTsumwz2;
      stats[9]  = fTsumwxz;
      stats[10] = fTsumwyz;
      stats[11] = fTsumwt;
      stats[12] = fTsumwt2;
   }
}

//______________________________________________________________________________
Long64_t TProfile3D::Merge(TCollection *li)
{
   //Merge all histograms in the collection in this histogram.
   //This function computes the min/max for the axes,
   //compute a new number of bins, if necessary,
   //add bin contents, errors and statistics.
   //If overflows are present and limits are different the function will fail.
   //The function returns the total number of entries in the result histogram
   //if the merge is successfull, -1 otherwise.
   //
   //IMPORTANT remark. The 2 axis x and y may have different number
   //of bins and different limits, BUT the largest bin width must be
   //a multiple of the smallest bin width and the upper limit must also
   //be a multiple of the bin width.

   return TProfileHelper::Merge(this, li);

//    if (!li) return 0;
//    if (li->IsEmpty()) return (Int_t) GetEntries();

//    TList inlist;
//    TH1* hclone = (TH1*)Clone("FirstClone");
//    R__ASSERT(hclone);
//    BufferEmpty(1);         // To remove buffer.
//    Reset();                // BufferEmpty sets limits so we can't use it later.
//    SetEntries(0);
//    inlist.Add(hclone);
//    inlist.AddAll(li);

//    TAxis newXAxis;
//    TAxis newYAxis;
//    TAxis newZAxis;
//    Bool_t initialLimitsFound = kFALSE;
//    Bool_t same = kTRUE;
//    Bool_t allHaveLimits = kTRUE;

//    TIter next(&inlist);
//    while (TObject *o = next()) {
//       TProfile3D* h = dynamic_cast<TProfile3D*> (o);
//       if (!h) {
//          Error("Add","Attempt to add object of class: %s to a %s",
//                o->ClassName(),this->ClassName());
//          return -1;
//       }
//       Bool_t hasLimits = h->GetXaxis()->GetXmin() < h->GetXaxis()->GetXmax();
//       allHaveLimits = allHaveLimits && hasLimits;

//       if (hasLimits) {
//          h->BufferEmpty();
//          if (!initialLimitsFound) {
//             initialLimitsFound = kTRUE;
//             newXAxis.Set(h->GetXaxis()->GetNbins(), h->GetXaxis()->GetXmin(),
//                      h->GetXaxis()->GetXmax());
//             newYAxis.Set(h->GetYaxis()->GetNbins(), h->GetYaxis()->GetXmin(),
//                      h->GetYaxis()->GetXmax());
//             newZAxis.Set(h->GetZaxis()->GetNbins(), h->GetZaxis()->GetXmin(),
//                      h->GetZaxis()->GetXmax());
//          }
//          else {
//             if (!RecomputeAxisLimits(newXAxis, *(h->GetXaxis()))) {
//                Error("Merge", "Cannot merge histograms - limits are inconsistent:\n "
//                      "first: (%d, %f, %f), second: (%d, %f, %f)",
//                      newXAxis.GetNbins(), newXAxis.GetXmin(), newXAxis.GetXmax(),
//                      h->GetXaxis()->GetNbins(), h->GetXaxis()->GetXmin(),
//                      h->GetXaxis()->GetXmax());
//             }
//             if (!RecomputeAxisLimits(newYAxis, *(h->GetYaxis()))) {
//                Error("Merge", "Cannot merge histograms - limits are inconsistent:\n "
//                      "first: (%d, %f, %f), second: (%d, %f, %f)",
//                      newYAxis.GetNbins(), newYAxis.GetXmin(), newYAxis.GetXmax(),
//                      h->GetYaxis()->GetNbins(), h->GetYaxis()->GetXmin(),
//                      h->GetYaxis()->GetXmax());
//             }
//             if (!RecomputeAxisLimits(newZAxis, *(h->GetZaxis()))) {
//                Error("Merge", "Cannot merge histograms - limits are inconsistent:\n "
//                      "first: (%d, %f, %f), second: (%d, %f, %f)",
//                      newZAxis.GetNbins(), newZAxis.GetXmin(), newZAxis.GetXmax(),
//                      h->GetZaxis()->GetNbins(), h->GetZaxis()->GetXmin(),
//                      h->GetZaxis()->GetXmax());
//             }
//          }
//       }
//    }
//    next.Reset();

//    same = same && SameLimitsAndNBins(newXAxis, *GetXaxis())
//                && SameLimitsAndNBins(newYAxis, *GetYaxis())
//                && SameLimitsAndNBins(newZAxis, *GetZaxis());
//    if (!same && initialLimitsFound)
//       SetBins(newXAxis.GetNbins(), newXAxis.GetXmin(), newXAxis.GetXmax(),
//               newYAxis.GetNbins(), newYAxis.GetXmin(), newYAxis.GetXmax(),
//               newZAxis.GetNbins(), newZAxis.GetXmin(), newZAxis.GetXmax());

//    if (!allHaveLimits) {
//       // fill this histogram with all the data from buffers of histograms without limits
//       while (TProfile3D* h = dynamic_cast<TProfile3D*> (next())) {
//          if (h->GetXaxis()->GetXmin() >= h->GetXaxis()->GetXmax() && h->fBuffer) {
//              // no limits
//             Int_t nbentries = (Int_t)h->fBuffer[0];
//             for (Int_t i = 0; i < nbentries; i++)
//                Fill(h->fBuffer[5*i + 2], h->fBuffer[5*i + 3],
//                     h->fBuffer[5*i + 4], h->fBuffer[5*i + 5], h->fBuffer[5*i + 1]);
//          }
//       }
//       if (!initialLimitsFound)
//          return (Int_t) GetEntries();  // all histograms have been processed
//       next.Reset();
//    }

//    //merge bin contents and errors
//    Double_t stats[kNstat], totstats[kNstat];
//    for (Int_t i=0;i<kNstat;i++) {totstats[i] = stats[i] = 0;}
//    GetStats(totstats);
//    Double_t nentries = GetEntries();
//    Int_t binx, biny, binz, ix, iy, iz, nx, ny, nz, bin, ibin;
//    Int_t nbix = fXaxis.GetNbins();
//    Int_t nbiy = fYaxis.GetNbins();
//    Bool_t canExtend = CanExtendAllAxes();
//    SetCanExtend(TH1::kNoAxis); // reset, otherwise setting the under/overflow will rebin

//    while (TProfile3D* h=(TProfile3D*)next()) {
//       // process only if the histogram has limits; otherwise it was processed before
//       if (h->GetXaxis()->GetXmin() < h->GetXaxis()->GetXmax()) {
//          // import statistics
//          h->GetStats(stats);
//          for (Int_t i = 0; i < kNstat; i++)
//             totstats[i] += stats[i];
//          nentries += h->GetEntries();

//          nx = h->GetXaxis()->GetNbins();
//          ny = h->GetYaxis()->GetNbins();
//          nz = h->GetZaxis()->GetNbins();

//          for (binz = 0; binz <= nz + 1; binz++) {
//             iz = fZaxis.FindBin(h->GetZaxis()->GetBinCenter(binz));
//             for (biny = 0; biny <= ny + 1; biny++) {
//                iy = fYaxis.FindBin(h->GetYaxis()->GetBinCenter(biny));
//                for (binx = 0; binx <= nx + 1; binx++) {
//                   ix = fXaxis.FindBin(h->GetXaxis()->GetBinCenter(binx));
//                   bin  = binx +(nx+2)*(biny + (ny+2)*binz);
//                   ibin = ix   +(nbix+2)*(iy + (nbiy+2)*iz);
//                   if ((!same) && (binx == 0 || binx == nx + 1
//                                || biny == 0 || biny == ny + 1 
//                                || binz == 0 || binz == nz + 1)) {
//                      if (h->GetW()[bin] != 0) {
//                         Error("Merge", "Cannot merge histograms - the histograms have"
//                                        " different limits and undeflows/overflows are present."
//                                        " The initial histogram is now broken!");
//                         return -1;
//                      }
//                   }
//                   fArray[ibin]             += h->GetW()[bin];
//                   fSumw2.fArray[ibin]      += h->GetW2()[bin];
//                   fBinEntries.fArray[ibin] += h->GetB()[bin];
//                }
//             }
//          }
//          fEntries += h->GetEntries();
//          fTsumw   += h->fTsumw;
//          fTsumw2  += h->fTsumw2;
//          fTsumwx  += h->fTsumwx;
//          fTsumwx2 += h->fTsumwx2;
//          fTsumwy  += h->fTsumwy;
//          fTsumwy2 += h->fTsumwy2;
//          fTsumwxy += h->fTsumwxy;
//          fTsumwz  += h->fTsumwz;
//          fTsumwz2 += h->fTsumwz2;
//          fTsumwxz += h->fTsumwxz;
//          fTsumwyz += h->fTsumwyz;
//          fTsumwt  += h->fTsumwt;
//          fTsumwt2 += h->fTsumwt2;
//       }
//    }
//    if (canExtend) SetCanExtend(TH1::kAllAxes);

//    //copy merged stats
//    PutStats(totstats);
//    SetEntries(nentries);
//    inlist.Remove(hclone);
//    delete hclone;
//    return (Long64_t)nentries;
}

//______________________________________________________________________________
Bool_t TProfile3D::Multiply(TF1 *, Double_t )
{
   // Performs the operation: this = this*c1*f1

   Error("Multiply","Function not implemented for TProfile3D");
   return kFALSE;
}

//______________________________________________________________________________
Bool_t TProfile3D::Multiply(const TH1 *)
{
//*-*-*-*-*-*-*-*-*-*-*Multiply this profile2D by h1*-*-*-*-*-*-*-*-*-*-*-*
//*-*                  =============================
//
//   this = this*h1
//
   Error("Multiply","Multiplication of profile2D histograms not implemented");
   return kFALSE;
}


//______________________________________________________________________________
Bool_t TProfile3D::Multiply(const TH1 *, const TH1 *, Double_t, Double_t, Option_t *)
{
//*-*-*-*-*Replace contents of this profile2D by multiplication of h1 by h2*-*
//*-*      ================================================================
//
//   this = (c1*h1)*(c2*h2)
//

   Error("Multiply","Multiplication of profile2D histograms not implemented");
   return kFALSE;
}

//______________________________________________________________________________
TH3D *TProfile3D::ProjectionXYZ(const char *name, Option_t *option) const
{
//*-*-*-*-*Project this profile3D into a 3-D histogram along X,Y,Z*-*-*-*-*-*-*
//*-*      =====================================================
//
//   The projection is always of the type TH3D.
//
//   if option "E" is specified, the errors are computed. (default)
//   if option "B" is specified, the content of bin of the returned histogram
//      will be equal to the GetBinEntries(bin) of the profile,
//   if option "C=E" the bin contents of the projection are set to the
//       bin errors of the profile
//   if option "E" is specified  the errors of the projected histogram are computed and set 
//      to be equal to the errors of the profile.
//      Option "E" is defined as the default one in the header file. 
//   if option "" is specified the histogram errors are simply the sqrt of its content
//   if option "B" is specified, the content of bin of the returned histogram
//      will be equal to the GetBinEntries(bin) of the profile,
//   if option "C=E" the bin contents of the projection are set to the
//       bin errors of the profile
//   if option "W" is specified the bin content of the projected histogram  is set to the 
//       product of the bin content of the profile and the entries. 
//       With this option the returned histogram will be equivalent to the one obtained by 
//       filling directly a TH2D using the 3-rd value as a weight. 
//       This option makes sense only for profile filled with all weights =1. 
//       When the profile is weighted (filled with weights different than 1) the  
//       bin error of the projected histogram (obtained using this option "W") cannot be 
//       correctly computed from the information stored in the profile. In that case the 
//       obtained histogram contains as bin error square the weighted sum of the square of the 
//       profiled observable (TProfile2D::fSumw2[bin] ) 


   TString opt = option;
   opt.ToLower();
   Int_t nx = fXaxis.GetNbins();
   Int_t ny = fYaxis.GetNbins();
   Int_t nz = fZaxis.GetNbins();
   const TArrayD *xbins = fXaxis.GetXbins();
   const TArrayD *ybins = fYaxis.GetXbins();
   const TArrayD *zbins = fZaxis.GetXbins();

   // Create the projection histogram
   TString pname = name; 
   if (pname == "_px") { 
      pname = GetName();  pname.Append("_pxyz");
   }
   TH3D *h1 = 0 ; 
   if (xbins->fN == 0 && ybins->fN == 0 && zbins->fN == 0) 
      h1 = new TH3D(pname,GetTitle(),nx,fXaxis.GetXmin(),fXaxis.GetXmax(),ny,fYaxis.GetXmin(),fYaxis.GetXmax(),nz,fZaxis.GetXmin(),fZaxis.GetXmax());
   else if ( xbins->fN != 0 && ybins->fN != 0 && zbins->fN != 0)
      h1 = new TH3D(pname,GetTitle(),nx,xbins->GetArray(),ny,ybins->GetArray(), nz,zbins->GetArray() );
   else {
      Error("ProjectionXYZ","Histogram has an axis with variable bins and an axis with fixed bins. This case is not cupported - return a null pointer"); 
      return 0; 
   }
   
      
   Bool_t computeErrors = kFALSE;
   Bool_t cequalErrors  = kFALSE;
   Bool_t binEntries    = kFALSE;
   Bool_t binWeight     = kFALSE;

   if (opt.Contains("b")) binEntries = kTRUE;
   if (opt.Contains("e")) computeErrors = kTRUE;
   if (opt.Contains("w")) binWeight = kTRUE;
   if (opt.Contains("c=e")) {cequalErrors = kTRUE; computeErrors=kFALSE;}
   if (computeErrors || binWeight || (binEntries && fBinSumw2.fN)  ) h1->Sumw2();

   // Fill the projected histogram
   Int_t bin,binx,biny,binz;
   Double_t cont;
   for (binx =0;binx<=nx+1;binx++) {
      for (biny =0;biny<=ny+1;biny++) {
         for (binz =0;binz<=nz+1;binz++) {
            bin = GetBin(binx,biny,binz);

            if (binEntries)         cont = GetBinEntries(bin);
            else if (cequalErrors)  cont = GetBinError(bin);
            else if (binWeight)     cont = GetBinContent(bin) * GetBinEntries(bin);
            else                    cont = GetBinContent(bin);    // default case
            
            h1->SetBinContent(bin ,cont);
            
            // if option E projected histogram errors are same as profile
            if (computeErrors ) h1->SetBinError(bin , GetBinError(bin) );
            // in case of option W bin error is deduced from bin sum of z**2 values of profile
            // this is correct only if the profile is unweighted 
            if (binWeight)      h1->GetSumw2()->fArray[bin] = fSumw2.fArray[bin];
            // in case of bin entries and profile is weighted, we need to set also the bin error
            if (binEntries && fBinSumw2.fN ) {
               R__ASSERT(  h1->GetSumw2() );
               h1->GetSumw2()->fArray[bin] =  fBinSumw2.fArray[bin]; 
            }
         }
      }
   }
   h1->SetEntries(fEntries);
   return h1;
}
//______________________________________________________________________________
TProfile2D *TProfile3D::Project3DProfile(Option_t *option) const
{
   // *-*-*-*-*Project a 3-D profile into a 2D-profile histogram depending
   // on the option parameter
   // option may contain a combination of the characters x,y,z
   // option = "xy" return the x versus y projection into a TProfile2D histogram
   // option = "yx" return the y versus x projection into a TProfile2D histogram
   // option = "xz" return the x versus z projection into a TProfile2D histogram
   // option = "zx" return the z versus x projection into a TProfile2D histogram
   // option = "yz" return the y versus z projection into a TProfile2D histogram
   // option = "zy" return the z versus y projection into a TProfile2D histogram
   // NB: the notation "a vs b" means "a" vertical and "b" horizontalalong X*-*-*-*-*-*
   //
   //   The resulting profile contains the combination of all the considered bins along X
   //   By default, all bins are included considering also underflow/overflows
   //
   //   The option can also be used to specify the projected profile error type.
   //   Values which can be used are 's', 'i', or 'g'. See TProfile::BuildOptions for details
   //
   //   To select a bin range along an axis, use TAxis::SetRange, eg
   //     h3.GetYaxis()->SetRange(23,56);
   //
   //
   
   // can call TH3 method which will call the virtual method :DoProjectProfile2D reimplented below 
   // but need to add underflow/overflow
   TString opt(option); 
   opt.Append(" UF OF");
   return TH3::Project3DProfile(opt);
}

//______________________________________________________________________________
TProfile2D *TProfile3D::DoProjectProfile2D(const char* name, const char * title, TAxis* projX, TAxis* projY, 
                                           bool originalRange, bool useUF, bool useOF) const
{
   // internal method to project to a 2D Profile
   // called from TH3::Project3DProfile but re-implemented in case of the TPRofile3D since what is done is different

   // Get the ranges where we will work.
   Int_t ixmin = projX->GetFirst();
   Int_t ixmax = projX->GetLast();
   Int_t iymin = projY->GetFirst();
   Int_t iymax = projY->GetLast();
   if (ixmin == 0 && ixmax == 0) { ixmin = 1; ixmax = projX->GetNbins(); }
   if (iymin == 0 && iymax == 0) { iymin = 1; iymax = projY->GetNbins(); }
   Int_t nx = ixmax-ixmin+1;
   Int_t ny = iymax-iymin+1;

   // Create the projected profiles
   TProfile2D *p2 = 0;
   // Create always a new TProfile2D (not as in the case of TH3 projection)

   const TArrayD *xbins = projX->GetXbins();
   const TArrayD *ybins = projY->GetXbins();
   // assume all axis have variable bins or have fixed bins
   if ( originalRange ) {
      if (xbins->fN == 0 && ybins->fN == 0) {
         p2 = new TProfile2D(name,title,projY->GetNbins(),projY->GetXmin(),projY->GetXmax()
                             ,projX->GetNbins(),projX->GetXmin(),projX->GetXmax());
      } else {
         p2 = new TProfile2D(name,title,projY->GetNbins(),&ybins->fArray[iymin-1],projX->GetNbins(),&xbins->fArray[ixmin-1]);
      }
   } else {
      if (xbins->fN == 0 && ybins->fN == 0) {
         p2 = new TProfile2D(name,title,ny,projY->GetBinLowEdge(iymin),projY->GetBinUpEdge(iymax)
                             ,nx,projX->GetBinLowEdge(ixmin),projX->GetBinUpEdge(ixmax));
      } else {
         p2 = new TProfile2D(name,title,ny,&ybins->fArray[iymin-1],nx,&xbins->fArray[ixmin-1]);
      }
   }

   // weights 
   bool useWeights = (fBinSumw2.fN != 0); 
   if (useWeights) p2->Sumw2(); 

   // make projection in a 3D first 
   TH3D * h3dW = ProjectionXYZ("h3temp-W","W");
   TH3D * h3dN = ProjectionXYZ("h3temp-N","B");

   h3dW->SetDirectory(0); h3dN->SetDirectory(0);
       
   // note that h3dW is always a weighted histogram - so we need to compute error in the projection
   TAxis * projX_hW = h3dW->GetXaxis(); 
   TAxis * projX_hN = h3dN->GetXaxis(); 
   if (projX == GetYaxis() ) {  projX_hW =  h3dW->GetYaxis();  projX_hN =  h3dN->GetYaxis(); }
   if (projX == GetZaxis() ) {  projX_hW =  h3dW->GetZaxis();  projX_hN =  h3dN->GetZaxis(); }
   TAxis * projY_hW = h3dW->GetYaxis(); 
   TAxis * projY_hN = h3dN->GetYaxis(); 
   if (projY == GetXaxis() ) {  projY_hW =  h3dW->GetXaxis();  projY_hN =  h3dN->GetXaxis(); }
   if (projY == GetZaxis() ) {  projY_hW =  h3dW->GetZaxis();  projY_hN =  h3dN->GetZaxis(); }

   TH2D * h2W = TH3::DoProject2D(*h3dW,"htemp-W","",projX_hW, projY_hW, true, originalRange, useUF, useOF); 
   TH2D * h2N = TH3::DoProject2D(*h3dN,"htemp-N","",projX_hN, projY_hN, useWeights, originalRange, useUF, useOF); 
   h2W->SetDirectory(0); h2N->SetDirectory(0);


   // fill the bin content
   R__ASSERT( h2W->fN == p2->fN ); 
   R__ASSERT( h2N->fN == p2->fN ); 
   R__ASSERT( h2W->GetSumw2()->fN != 0); // h2W should always be a weighted histogram since h3dW is weighted
   for (int i = 0; i < p2->fN ; ++i) {
      //std::cout << " proj bin " << i << "  " <<  h2W->fArray[i] << "  " << h2N->fArray[i] << std::endl;
      p2->fArray[i] = h2W->fArray[i];   // array of profile is sum of all values
      p2->GetSumw2()->fArray[i]  = h2W->GetSumw2()->fArray[i];   // array of content square of profile is weight square of the W projected histogram
      p2->SetBinEntries(i, h2N->fArray[i] );          
      if (useWeights) p2->GetBinSumw2()->fArray[i] = h2N->GetSumw2()->fArray[i];    // sum of weight squares are stored to compute errors in h1N histogram
   }
   // delete the created histograms
   delete h3dW; 
   delete h3dN; 
   delete h2W; 
   delete h2N; 

   // Also we need to set the entries since they have not been correctly calculated during the projection
   // we can only set them to the effective entries
   p2->SetEntries( p2->GetEffectiveEntries() );

   return p2; 

}

//______________________________________________________________________________
void TProfile3D::PutStats(Double_t *stats)
{
   // Replace current statistics with the values in array stats

   TH3::PutStats(stats);
   fTsumwt  = stats[11];
   fTsumwt2 = stats[12];
}

//______________________________________________________________________________
void TProfile3D::Reset(Option_t *option)
{
//*-*-*-*-*-*-*-*-*-*Reset contents of a Profile3D histogram*-*-*-*-*-*-*-*
//*-*                =======================================
   TH3D::Reset(option);
   fBinSumw2.Reset();
   fBinEntries.Reset();
   TString opt = option;
   opt.ToUpper();
   if (opt.Contains("ICE") && !opt.Contains("S")) return;
   fTsumwt = fTsumwt2 = 0;
}

//______________________________________________________________________________
void TProfile3D::ExtendAxis(Double_t x, TAxis *axis)
{
// Profile histogram is resized along axis such that x is in the axis range.
// The new axis limits are recomputed by doubling iteratively
// the current axis range until the specified value x is within the limits.
// The algorithm makes a copy of the histogram, then loops on all bins
// of the old histogram to fill the rebinned histogram.
// Takes into account errors (Sumw2) if any.
// The axis must be rebinnable before invoking this function.
// Ex: h->GetXaxis()->SetCanExtend(kTRUE)

   TProfile3D* hold = TProfileHelper::ExtendAxis(this, x, axis);
   if ( hold ) {
      fTsumwt  = hold->fTsumwt;
      fTsumwt2 = hold->fTsumwt2;
      delete hold;
   }
}

//______________________________________________________________________________
void TProfile3D::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
{
   // Save primitive as a C++ statement(s) on output stream out

   //Note the following restrictions in the code generated:
   // - variable bin size not implemented
   // - SetErrorOption not implemented


   char quote = '"';
   out <<"   "<<std::endl;
   out <<"   "<<ClassName()<<" *";

   out << GetName() << " = new " << ClassName() << "(" << quote
       << GetName() << quote << "," << quote<< GetTitle() << quote
       << "," << GetXaxis()->GetNbins();
   out << "," << GetXaxis()->GetXmin()
       << "," << GetXaxis()->GetXmax();
   out << "," << GetYaxis()->GetNbins();
   out << "," << GetYaxis()->GetXmin()
       << "," << GetYaxis()->GetXmax();
   out << "," << GetZaxis()->GetNbins();
   out << "," << GetZaxis()->GetXmin()
       << "," << GetZaxis()->GetXmax();
   out << "," << fTmin
       << "," << fTmax;
   out << ");" << std::endl;


   // save bin entries
   Int_t bin;
   for (bin=0;bin<fNcells;bin++) {
      Double_t bi = GetBinEntries(bin);
      if (bi) {
         out<<"   "<<GetName()<<"->SetBinEntries("<<bin<<","<<bi<<");"<<std::endl;
      }
   }
   //save bin contents
   for (bin=0;bin<fNcells;bin++) {
      Double_t bc = fArray[bin];
      if (bc) {
         out<<"   "<<GetName()<<"->SetBinContent("<<bin<<","<<bc<<");"<<std::endl;
      }
   }
   // save bin errors
   if (fSumw2.fN) {
      for (bin=0;bin<fNcells;bin++) {
         Double_t be = TMath::Sqrt(fSumw2.fArray[bin]);
         if (be) {
            out<<"   "<<GetName()<<"->SetBinError("<<bin<<","<<be<<");"<<std::endl;
         }
      }
   }

   TH1::SavePrimitiveHelp(out, GetName(), option);
}

//______________________________________________________________________________
void TProfile3D::Scale(Double_t c1, Option_t *option)
{
// *-*-*-*-*Multiply this profile2D by a constant c1*-*-*-*-*-*-*-*-*
// *-*      ========================================
//
//   this = c1*this
//
// This function uses the services of TProfile3D::Add
//

   TProfileHelper::Scale(this, c1, option);
}

//______________________________________________________________________________
void TProfile3D::SetBinEntries(Int_t bin, Double_t w)
{
//*-*-*-*-*-*-*-*-*Set the number of entries in bin*-*-*-*-*-*-*-*-*-*-*-*
//*-*              ================================
   TProfileHelper::SetBinEntries(this, bin, w);
}

//______________________________________________________________________________
void TProfile3D::SetBins(Int_t nx, Double_t xmin, Double_t xmax, Int_t ny, Double_t ymin, Double_t ymax, Int_t nz, Double_t zmin, Double_t zmax)
{
//   -*-*-*-*-*-*-*Redefine  x, y and z axis parameters*-*-*-*-*-*-*-*-*-*-*-*
//*-*              ===========================
   TH1::SetBins(nx, xmin, xmax, ny, ymin, ymax, nz, zmin, zmax);
   fBinEntries.Set(fNcells);
   if (fBinSumw2.fN) fBinSumw2.Set(fNcells);
}

//______________________________________________________________________________
void TProfile3D::SetBins(Int_t nx, const Double_t *xBins, Int_t ny, const Double_t *yBins, Int_t nz, const Double_t *zBins)
{
   //   -*-*-*-*-*-*-*Redefine  x, y and z axis parameters with variable bin sizes *-*-*-*-*-*-*-*-*
   //                 ============================================================
   TH1::SetBins(nx,xBins,ny,yBins,nz,zBins);
   fBinEntries.Set(fNcells);
   if (fBinSumw2.fN) fBinSumw2.Set(fNcells);
}

//______________________________________________________________________________
void TProfile3D::SetBinsLength(Int_t n)
{
   // Set total number of bins including under/overflow
   // Reallocate bin contents array
   TH3D::SetBinsLength(n);
   TProfileHelper::BuildArray(this);   
}

//______________________________________________________________________________
void TProfile3D::SetBuffer(Int_t buffersize, Option_t *)
{
// set the buffer size in units of 8 bytes (double)

   if (fBuffer) {
      BufferEmpty();
      delete [] fBuffer;
      fBuffer = 0;
   }
   if (buffersize <= 0) {
      fBufferSize = 0;
      return;
   }
   if (buffersize < 100) buffersize = 100;
   fBufferSize = 1 + 5*buffersize; 
   fBuffer = new Double_t[fBufferSize];
   memset(fBuffer,0,sizeof(Double_t)*fBufferSize);
}

//______________________________________________________________________________
void TProfile3D::SetErrorOption(Option_t *option)
{
//*-*-*-*-*-*-*-*-*-*Set option to compute profile3D errors*-*-*-*-*-*-*-*
//*-*                =======================================
//
//    The computation of the bin errors is based on the parameter option:
//    option:
//     ' '  (Default) The bin errors are the standard error on the mean of the bin profiled values (T), 
//                    i.e. the standard error of the bin contents.
//                    Note that if TProfile3D::Approximate()  is called, an approximation is used when 
//                    the spread in T is 0 and the number of bin entries  is > 0
//
//     's'            The bin errors are the standard deviations of the T bin values 
//                    Note that if TProfile3D::Approximate()  is called, an approximation is used when 
//                    the spread in T is 0 and the number of bin entries is > 0
//
//     'i'            Errors are as in default case (standard errors of the bin contents)
//                    The only difference is for the case when the spread in T is zero. 
//                    In this case for N > 0 the error is  1./SQRT(12.*N) 
//
//     'g'            Errors are 1./SQRT(W)  for W not equal to 0 and 0 for W = 0.
//                    W is the sum in the bin of the weights of the profile. 
//                    This option is for combining measurements t +/- dt,  
//                    and  the profile is filled with values t and weights w = 1/dt**2
//
//   See TProfile::BuildOptions for explanation of all options

   TProfileHelper::SetErrorOption(this, option);
}

//______________________________________________________________________________
void TProfile3D::Sumw2(Bool_t flag)
{
   // Create/Delete structure to store sum of squares of weights per bin  *-*-*-*-*-*-*-*
   //   This is needed to compute  the correct statistical quantities  
   //    of a profile filled with weights 
   //  
   //
   //  This function is automatically called when the histogram is created
   //  if the static function TH1::SetDefaultSumw2 has been called before.
   //  If flag = false the structure is deleted

   TProfileHelper::Sumw2(this, flag);
}
 TProfile3D.cxx:1
 TProfile3D.cxx:2
 TProfile3D.cxx:3
 TProfile3D.cxx:4
 TProfile3D.cxx:5
 TProfile3D.cxx:6
 TProfile3D.cxx:7
 TProfile3D.cxx:8
 TProfile3D.cxx:9
 TProfile3D.cxx:10
 TProfile3D.cxx:11
 TProfile3D.cxx:12
 TProfile3D.cxx:13
 TProfile3D.cxx:14
 TProfile3D.cxx:15
 TProfile3D.cxx:16
 TProfile3D.cxx:17
 TProfile3D.cxx:18
 TProfile3D.cxx:19
 TProfile3D.cxx:20
 TProfile3D.cxx:21
 TProfile3D.cxx:22
 TProfile3D.cxx:23
 TProfile3D.cxx:24
 TProfile3D.cxx:25
 TProfile3D.cxx:26
 TProfile3D.cxx:27
 TProfile3D.cxx:28
 TProfile3D.cxx:29
 TProfile3D.cxx:30
 TProfile3D.cxx:31
 TProfile3D.cxx:32
 TProfile3D.cxx:33
 TProfile3D.cxx:34
 TProfile3D.cxx:35
 TProfile3D.cxx:36
 TProfile3D.cxx:37
 TProfile3D.cxx:38
 TProfile3D.cxx:39
 TProfile3D.cxx:40
 TProfile3D.cxx:41
 TProfile3D.cxx:42
 TProfile3D.cxx:43
 TProfile3D.cxx:44
 TProfile3D.cxx:45
 TProfile3D.cxx:46
 TProfile3D.cxx:47
 TProfile3D.cxx:48
 TProfile3D.cxx:49
 TProfile3D.cxx:50
 TProfile3D.cxx:51
 TProfile3D.cxx:52
 TProfile3D.cxx:53
 TProfile3D.cxx:54
 TProfile3D.cxx:55
 TProfile3D.cxx:56
 TProfile3D.cxx:57
 TProfile3D.cxx:58
 TProfile3D.cxx:59
 TProfile3D.cxx:60
 TProfile3D.cxx:61
 TProfile3D.cxx:62
 TProfile3D.cxx:63
 TProfile3D.cxx:64
 TProfile3D.cxx:65
 TProfile3D.cxx:66
 TProfile3D.cxx:67
 TProfile3D.cxx:68
 TProfile3D.cxx:69
 TProfile3D.cxx:70
 TProfile3D.cxx:71
 TProfile3D.cxx:72
 TProfile3D.cxx:73
 TProfile3D.cxx:74
 TProfile3D.cxx:75
 TProfile3D.cxx:76
 TProfile3D.cxx:77
 TProfile3D.cxx:78
 TProfile3D.cxx:79
 TProfile3D.cxx:80
 TProfile3D.cxx:81
 TProfile3D.cxx:82
 TProfile3D.cxx:83
 TProfile3D.cxx:84
 TProfile3D.cxx:85
 TProfile3D.cxx:86
 TProfile3D.cxx:87
 TProfile3D.cxx:88
 TProfile3D.cxx:89
 TProfile3D.cxx:90
 TProfile3D.cxx:91
 TProfile3D.cxx:92
 TProfile3D.cxx:93
 TProfile3D.cxx:94
 TProfile3D.cxx:95
 TProfile3D.cxx:96
 TProfile3D.cxx:97
 TProfile3D.cxx:98
 TProfile3D.cxx:99
 TProfile3D.cxx:100
 TProfile3D.cxx:101
 TProfile3D.cxx:102
 TProfile3D.cxx:103
 TProfile3D.cxx:104
 TProfile3D.cxx:105
 TProfile3D.cxx:106
 TProfile3D.cxx:107
 TProfile3D.cxx:108
 TProfile3D.cxx:109
 TProfile3D.cxx:110
 TProfile3D.cxx:111
 TProfile3D.cxx:112
 TProfile3D.cxx:113
 TProfile3D.cxx:114
 TProfile3D.cxx:115
 TProfile3D.cxx:116
 TProfile3D.cxx:117
 TProfile3D.cxx:118
 TProfile3D.cxx:119
 TProfile3D.cxx:120
 TProfile3D.cxx:121
 TProfile3D.cxx:122
 TProfile3D.cxx:123
 TProfile3D.cxx:124
 TProfile3D.cxx:125
 TProfile3D.cxx:126
 TProfile3D.cxx:127
 TProfile3D.cxx:128
 TProfile3D.cxx:129
 TProfile3D.cxx:130
 TProfile3D.cxx:131
 TProfile3D.cxx:132
 TProfile3D.cxx:133
 TProfile3D.cxx:134
 TProfile3D.cxx:135
 TProfile3D.cxx:136
 TProfile3D.cxx:137
 TProfile3D.cxx:138
 TProfile3D.cxx:139
 TProfile3D.cxx:140
 TProfile3D.cxx:141
 TProfile3D.cxx:142
 TProfile3D.cxx:143
 TProfile3D.cxx:144
 TProfile3D.cxx:145
 TProfile3D.cxx:146
 TProfile3D.cxx:147
 TProfile3D.cxx:148
 TProfile3D.cxx:149
 TProfile3D.cxx:150
 TProfile3D.cxx:151
 TProfile3D.cxx:152
 TProfile3D.cxx:153
 TProfile3D.cxx:154
 TProfile3D.cxx:155
 TProfile3D.cxx:156
 TProfile3D.cxx:157
 TProfile3D.cxx:158
 TProfile3D.cxx:159
 TProfile3D.cxx:160
 TProfile3D.cxx:161
 TProfile3D.cxx:162
 TProfile3D.cxx:163
 TProfile3D.cxx:164
 TProfile3D.cxx:165
 TProfile3D.cxx:166
 TProfile3D.cxx:167
 TProfile3D.cxx:168
 TProfile3D.cxx:169
 TProfile3D.cxx:170
 TProfile3D.cxx:171
 TProfile3D.cxx:172
 TProfile3D.cxx:173
 TProfile3D.cxx:174
 TProfile3D.cxx:175
 TProfile3D.cxx:176
 TProfile3D.cxx:177
 TProfile3D.cxx:178
 TProfile3D.cxx:179
 TProfile3D.cxx:180
 TProfile3D.cxx:181
 TProfile3D.cxx:182
 TProfile3D.cxx:183
 TProfile3D.cxx:184
 TProfile3D.cxx:185
 TProfile3D.cxx:186
 TProfile3D.cxx:187
 TProfile3D.cxx:188
 TProfile3D.cxx:189
 TProfile3D.cxx:190
 TProfile3D.cxx:191
 TProfile3D.cxx:192
 TProfile3D.cxx:193
 TProfile3D.cxx:194
 TProfile3D.cxx:195
 TProfile3D.cxx:196
 TProfile3D.cxx:197
 TProfile3D.cxx:198
 TProfile3D.cxx:199
 TProfile3D.cxx:200
 TProfile3D.cxx:201
 TProfile3D.cxx:202
 TProfile3D.cxx:203
 TProfile3D.cxx:204
 TProfile3D.cxx:205
 TProfile3D.cxx:206
 TProfile3D.cxx:207
 TProfile3D.cxx:208
 TProfile3D.cxx:209
 TProfile3D.cxx:210
 TProfile3D.cxx:211
 TProfile3D.cxx:212
 TProfile3D.cxx:213
 TProfile3D.cxx:214
 TProfile3D.cxx:215
 TProfile3D.cxx:216
 TProfile3D.cxx:217
 TProfile3D.cxx:218
 TProfile3D.cxx:219
 TProfile3D.cxx:220
 TProfile3D.cxx:221
 TProfile3D.cxx:222
 TProfile3D.cxx:223
 TProfile3D.cxx:224
 TProfile3D.cxx:225
 TProfile3D.cxx:226
 TProfile3D.cxx:227
 TProfile3D.cxx:228
 TProfile3D.cxx:229
 TProfile3D.cxx:230
 TProfile3D.cxx:231
 TProfile3D.cxx:232
 TProfile3D.cxx:233
 TProfile3D.cxx:234
 TProfile3D.cxx:235
 TProfile3D.cxx:236
 TProfile3D.cxx:237
 TProfile3D.cxx:238
 TProfile3D.cxx:239
 TProfile3D.cxx:240
 TProfile3D.cxx:241
 TProfile3D.cxx:242
 TProfile3D.cxx:243
 TProfile3D.cxx:244
 TProfile3D.cxx:245
 TProfile3D.cxx:246
 TProfile3D.cxx:247
 TProfile3D.cxx:248
 TProfile3D.cxx:249
 TProfile3D.cxx:250
 TProfile3D.cxx:251
 TProfile3D.cxx:252
 TProfile3D.cxx:253
 TProfile3D.cxx:254
 TProfile3D.cxx:255
 TProfile3D.cxx:256
 TProfile3D.cxx:257
 TProfile3D.cxx:258
 TProfile3D.cxx:259
 TProfile3D.cxx:260
 TProfile3D.cxx:261
 TProfile3D.cxx:262
 TProfile3D.cxx:263
 TProfile3D.cxx:264
 TProfile3D.cxx:265
 TProfile3D.cxx:266
 TProfile3D.cxx:267
 TProfile3D.cxx:268
 TProfile3D.cxx:269
 TProfile3D.cxx:270
 TProfile3D.cxx:271
 TProfile3D.cxx:272
 TProfile3D.cxx:273
 TProfile3D.cxx:274
 TProfile3D.cxx:275
 TProfile3D.cxx:276
 TProfile3D.cxx:277
 TProfile3D.cxx:278
 TProfile3D.cxx:279
 TProfile3D.cxx:280
 TProfile3D.cxx:281
 TProfile3D.cxx:282
 TProfile3D.cxx:283
 TProfile3D.cxx:284
 TProfile3D.cxx:285
 TProfile3D.cxx:286
 TProfile3D.cxx:287
 TProfile3D.cxx:288
 TProfile3D.cxx:289
 TProfile3D.cxx:290
 TProfile3D.cxx:291
 TProfile3D.cxx:292
 TProfile3D.cxx:293
 TProfile3D.cxx:294
 TProfile3D.cxx:295
 TProfile3D.cxx:296
 TProfile3D.cxx:297
 TProfile3D.cxx:298
 TProfile3D.cxx:299
 TProfile3D.cxx:300
 TProfile3D.cxx:301
 TProfile3D.cxx:302
 TProfile3D.cxx:303
 TProfile3D.cxx:304
 TProfile3D.cxx:305
 TProfile3D.cxx:306
 TProfile3D.cxx:307
 TProfile3D.cxx:308
 TProfile3D.cxx:309
 TProfile3D.cxx:310
 TProfile3D.cxx:311
 TProfile3D.cxx:312
 TProfile3D.cxx:313
 TProfile3D.cxx:314
 TProfile3D.cxx:315
 TProfile3D.cxx:316
 TProfile3D.cxx:317
 TProfile3D.cxx:318
 TProfile3D.cxx:319
 TProfile3D.cxx:320
 TProfile3D.cxx:321
 TProfile3D.cxx:322
 TProfile3D.cxx:323
 TProfile3D.cxx:324
 TProfile3D.cxx:325
 TProfile3D.cxx:326
 TProfile3D.cxx:327
 TProfile3D.cxx:328
 TProfile3D.cxx:329
 TProfile3D.cxx:330
 TProfile3D.cxx:331
 TProfile3D.cxx:332
 TProfile3D.cxx:333
 TProfile3D.cxx:334
 TProfile3D.cxx:335
 TProfile3D.cxx:336
 TProfile3D.cxx:337
 TProfile3D.cxx:338
 TProfile3D.cxx:339
 TProfile3D.cxx:340
 TProfile3D.cxx:341
 TProfile3D.cxx:342
 TProfile3D.cxx:343
 TProfile3D.cxx:344
 TProfile3D.cxx:345
 TProfile3D.cxx:346
 TProfile3D.cxx:347
 TProfile3D.cxx:348
 TProfile3D.cxx:349
 TProfile3D.cxx:350
 TProfile3D.cxx:351
 TProfile3D.cxx:352
 TProfile3D.cxx:353
 TProfile3D.cxx:354
 TProfile3D.cxx:355
 TProfile3D.cxx:356
 TProfile3D.cxx:357
 TProfile3D.cxx:358
 TProfile3D.cxx:359
 TProfile3D.cxx:360
 TProfile3D.cxx:361
 TProfile3D.cxx:362
 TProfile3D.cxx:363
 TProfile3D.cxx:364
 TProfile3D.cxx:365
 TProfile3D.cxx:366
 TProfile3D.cxx:367
 TProfile3D.cxx:368
 TProfile3D.cxx:369
 TProfile3D.cxx:370
 TProfile3D.cxx:371
 TProfile3D.cxx:372
 TProfile3D.cxx:373
 TProfile3D.cxx:374
 TProfile3D.cxx:375
 TProfile3D.cxx:376
 TProfile3D.cxx:377
 TProfile3D.cxx:378
 TProfile3D.cxx:379
 TProfile3D.cxx:380
 TProfile3D.cxx:381
 TProfile3D.cxx:382
 TProfile3D.cxx:383
 TProfile3D.cxx:384
 TProfile3D.cxx:385
 TProfile3D.cxx:386
 TProfile3D.cxx:387
 TProfile3D.cxx:388
 TProfile3D.cxx:389
 TProfile3D.cxx:390
 TProfile3D.cxx:391
 TProfile3D.cxx:392
 TProfile3D.cxx:393
 TProfile3D.cxx:394
 TProfile3D.cxx:395
 TProfile3D.cxx:396
 TProfile3D.cxx:397
 TProfile3D.cxx:398
 TProfile3D.cxx:399
 TProfile3D.cxx:400
 TProfile3D.cxx:401
 TProfile3D.cxx:402
 TProfile3D.cxx:403
 TProfile3D.cxx:404
 TProfile3D.cxx:405
 TProfile3D.cxx:406
 TProfile3D.cxx:407
 TProfile3D.cxx:408
 TProfile3D.cxx:409
 TProfile3D.cxx:410
 TProfile3D.cxx:411
 TProfile3D.cxx:412
 TProfile3D.cxx:413
 TProfile3D.cxx:414
 TProfile3D.cxx:415
 TProfile3D.cxx:416
 TProfile3D.cxx:417
 TProfile3D.cxx:418
 TProfile3D.cxx:419
 TProfile3D.cxx:420
 TProfile3D.cxx:421
 TProfile3D.cxx:422
 TProfile3D.cxx:423
 TProfile3D.cxx:424
 TProfile3D.cxx:425
 TProfile3D.cxx:426
 TProfile3D.cxx:427
 TProfile3D.cxx:428
 TProfile3D.cxx:429
 TProfile3D.cxx:430
 TProfile3D.cxx:431
 TProfile3D.cxx:432
 TProfile3D.cxx:433
 TProfile3D.cxx:434
 TProfile3D.cxx:435
 TProfile3D.cxx:436
 TProfile3D.cxx:437
 TProfile3D.cxx:438
 TProfile3D.cxx:439
 TProfile3D.cxx:440
 TProfile3D.cxx:441
 TProfile3D.cxx:442
 TProfile3D.cxx:443
 TProfile3D.cxx:444
 TProfile3D.cxx:445
 TProfile3D.cxx:446
 TProfile3D.cxx:447
 TProfile3D.cxx:448
 TProfile3D.cxx:449
 TProfile3D.cxx:450
 TProfile3D.cxx:451
 TProfile3D.cxx:452
 TProfile3D.cxx:453
 TProfile3D.cxx:454
 TProfile3D.cxx:455
 TProfile3D.cxx:456
 TProfile3D.cxx:457
 TProfile3D.cxx:458
 TProfile3D.cxx:459
 TProfile3D.cxx:460
 TProfile3D.cxx:461
 TProfile3D.cxx:462
 TProfile3D.cxx:463
 TProfile3D.cxx:464
 TProfile3D.cxx:465
 TProfile3D.cxx:466
 TProfile3D.cxx:467
 TProfile3D.cxx:468
 TProfile3D.cxx:469
 TProfile3D.cxx:470
 TProfile3D.cxx:471
 TProfile3D.cxx:472
 TProfile3D.cxx:473
 TProfile3D.cxx:474
 TProfile3D.cxx:475
 TProfile3D.cxx:476
 TProfile3D.cxx:477
 TProfile3D.cxx:478
 TProfile3D.cxx:479
 TProfile3D.cxx:480
 TProfile3D.cxx:481
 TProfile3D.cxx:482
 TProfile3D.cxx:483
 TProfile3D.cxx:484
 TProfile3D.cxx:485
 TProfile3D.cxx:486
 TProfile3D.cxx:487
 TProfile3D.cxx:488
 TProfile3D.cxx:489
 TProfile3D.cxx:490
 TProfile3D.cxx:491
 TProfile3D.cxx:492
 TProfile3D.cxx:493
 TProfile3D.cxx:494
 TProfile3D.cxx:495
 TProfile3D.cxx:496
 TProfile3D.cxx:497
 TProfile3D.cxx:498
 TProfile3D.cxx:499
 TProfile3D.cxx:500
 TProfile3D.cxx:501
 TProfile3D.cxx:502
 TProfile3D.cxx:503
 TProfile3D.cxx:504
 TProfile3D.cxx:505
 TProfile3D.cxx:506
 TProfile3D.cxx:507
 TProfile3D.cxx:508
 TProfile3D.cxx:509
 TProfile3D.cxx:510
 TProfile3D.cxx:511
 TProfile3D.cxx:512
 TProfile3D.cxx:513
 TProfile3D.cxx:514
 TProfile3D.cxx:515
 TProfile3D.cxx:516
 TProfile3D.cxx:517
 TProfile3D.cxx:518
 TProfile3D.cxx:519
 TProfile3D.cxx:520
 TProfile3D.cxx:521
 TProfile3D.cxx:522
 TProfile3D.cxx:523
 TProfile3D.cxx:524
 TProfile3D.cxx:525
 TProfile3D.cxx:526
 TProfile3D.cxx:527
 TProfile3D.cxx:528
 TProfile3D.cxx:529
 TProfile3D.cxx:530
 TProfile3D.cxx:531
 TProfile3D.cxx:532
 TProfile3D.cxx:533
 TProfile3D.cxx:534
 TProfile3D.cxx:535
 TProfile3D.cxx:536
 TProfile3D.cxx:537
 TProfile3D.cxx:538
 TProfile3D.cxx:539
 TProfile3D.cxx:540
 TProfile3D.cxx:541
 TProfile3D.cxx:542
 TProfile3D.cxx:543
 TProfile3D.cxx:544
 TProfile3D.cxx:545
 TProfile3D.cxx:546
 TProfile3D.cxx:547
 TProfile3D.cxx:548
 TProfile3D.cxx:549
 TProfile3D.cxx:550
 TProfile3D.cxx:551
 TProfile3D.cxx:552
 TProfile3D.cxx:553
 TProfile3D.cxx:554
 TProfile3D.cxx:555
 TProfile3D.cxx:556
 TProfile3D.cxx:557
 TProfile3D.cxx:558
 TProfile3D.cxx:559
 TProfile3D.cxx:560
 TProfile3D.cxx:561
 TProfile3D.cxx:562
 TProfile3D.cxx:563
 TProfile3D.cxx:564
 TProfile3D.cxx:565
 TProfile3D.cxx:566
 TProfile3D.cxx:567
 TProfile3D.cxx:568
 TProfile3D.cxx:569
 TProfile3D.cxx:570
 TProfile3D.cxx:571
 TProfile3D.cxx:572
 TProfile3D.cxx:573
 TProfile3D.cxx:574
 TProfile3D.cxx:575
 TProfile3D.cxx:576
 TProfile3D.cxx:577
 TProfile3D.cxx:578
 TProfile3D.cxx:579
 TProfile3D.cxx:580
 TProfile3D.cxx:581
 TProfile3D.cxx:582
 TProfile3D.cxx:583
 TProfile3D.cxx:584
 TProfile3D.cxx:585
 TProfile3D.cxx:586
 TProfile3D.cxx:587
 TProfile3D.cxx:588
 TProfile3D.cxx:589
 TProfile3D.cxx:590
 TProfile3D.cxx:591
 TProfile3D.cxx:592
 TProfile3D.cxx:593
 TProfile3D.cxx:594
 TProfile3D.cxx:595
 TProfile3D.cxx:596
 TProfile3D.cxx:597
 TProfile3D.cxx:598
 TProfile3D.cxx:599
 TProfile3D.cxx:600
 TProfile3D.cxx:601
 TProfile3D.cxx:602
 TProfile3D.cxx:603
 TProfile3D.cxx:604
 TProfile3D.cxx:605
 TProfile3D.cxx:606
 TProfile3D.cxx:607
 TProfile3D.cxx:608
 TProfile3D.cxx:609
 TProfile3D.cxx:610
 TProfile3D.cxx:611
 TProfile3D.cxx:612
 TProfile3D.cxx:613
 TProfile3D.cxx:614
 TProfile3D.cxx:615
 TProfile3D.cxx:616
 TProfile3D.cxx:617
 TProfile3D.cxx:618
 TProfile3D.cxx:619
 TProfile3D.cxx:620
 TProfile3D.cxx:621
 TProfile3D.cxx:622
 TProfile3D.cxx:623
 TProfile3D.cxx:624
 TProfile3D.cxx:625
 TProfile3D.cxx:626
 TProfile3D.cxx:627
 TProfile3D.cxx:628
 TProfile3D.cxx:629
 TProfile3D.cxx:630
 TProfile3D.cxx:631
 TProfile3D.cxx:632
 TProfile3D.cxx:633
 TProfile3D.cxx:634
 TProfile3D.cxx:635
 TProfile3D.cxx:636
 TProfile3D.cxx:637
 TProfile3D.cxx:638
 TProfile3D.cxx:639
 TProfile3D.cxx:640
 TProfile3D.cxx:641
 TProfile3D.cxx:642
 TProfile3D.cxx:643
 TProfile3D.cxx:644
 TProfile3D.cxx:645
 TProfile3D.cxx:646
 TProfile3D.cxx:647
 TProfile3D.cxx:648
 TProfile3D.cxx:649
 TProfile3D.cxx:650
 TProfile3D.cxx:651
 TProfile3D.cxx:652
 TProfile3D.cxx:653
 TProfile3D.cxx:654
 TProfile3D.cxx:655
 TProfile3D.cxx:656
 TProfile3D.cxx:657
 TProfile3D.cxx:658
 TProfile3D.cxx:659
 TProfile3D.cxx:660
 TProfile3D.cxx:661
 TProfile3D.cxx:662
 TProfile3D.cxx:663
 TProfile3D.cxx:664
 TProfile3D.cxx:665
 TProfile3D.cxx:666
 TProfile3D.cxx:667
 TProfile3D.cxx:668
 TProfile3D.cxx:669
 TProfile3D.cxx:670
 TProfile3D.cxx:671
 TProfile3D.cxx:672
 TProfile3D.cxx:673
 TProfile3D.cxx:674
 TProfile3D.cxx:675
 TProfile3D.cxx:676
 TProfile3D.cxx:677
 TProfile3D.cxx:678
 TProfile3D.cxx:679
 TProfile3D.cxx:680
 TProfile3D.cxx:681
 TProfile3D.cxx:682
 TProfile3D.cxx:683
 TProfile3D.cxx:684
 TProfile3D.cxx:685
 TProfile3D.cxx:686
 TProfile3D.cxx:687
 TProfile3D.cxx:688
 TProfile3D.cxx:689
 TProfile3D.cxx:690
 TProfile3D.cxx:691
 TProfile3D.cxx:692
 TProfile3D.cxx:693
 TProfile3D.cxx:694
 TProfile3D.cxx:695
 TProfile3D.cxx:696
 TProfile3D.cxx:697
 TProfile3D.cxx:698
 TProfile3D.cxx:699
 TProfile3D.cxx:700
 TProfile3D.cxx:701
 TProfile3D.cxx:702
 TProfile3D.cxx:703
 TProfile3D.cxx:704
 TProfile3D.cxx:705
 TProfile3D.cxx:706
 TProfile3D.cxx:707
 TProfile3D.cxx:708
 TProfile3D.cxx:709
 TProfile3D.cxx:710
 TProfile3D.cxx:711
 TProfile3D.cxx:712
 TProfile3D.cxx:713
 TProfile3D.cxx:714
 TProfile3D.cxx:715
 TProfile3D.cxx:716
 TProfile3D.cxx:717
 TProfile3D.cxx:718
 TProfile3D.cxx:719
 TProfile3D.cxx:720
 TProfile3D.cxx:721
 TProfile3D.cxx:722
 TProfile3D.cxx:723
 TProfile3D.cxx:724
 TProfile3D.cxx:725
 TProfile3D.cxx:726
 TProfile3D.cxx:727
 TProfile3D.cxx:728
 TProfile3D.cxx:729
 TProfile3D.cxx:730
 TProfile3D.cxx:731
 TProfile3D.cxx:732
 TProfile3D.cxx:733
 TProfile3D.cxx:734
 TProfile3D.cxx:735
 TProfile3D.cxx:736
 TProfile3D.cxx:737
 TProfile3D.cxx:738
 TProfile3D.cxx:739
 TProfile3D.cxx:740
 TProfile3D.cxx:741
 TProfile3D.cxx:742
 TProfile3D.cxx:743
 TProfile3D.cxx:744
 TProfile3D.cxx:745
 TProfile3D.cxx:746
 TProfile3D.cxx:747
 TProfile3D.cxx:748
 TProfile3D.cxx:749
 TProfile3D.cxx:750
 TProfile3D.cxx:751
 TProfile3D.cxx:752
 TProfile3D.cxx:753
 TProfile3D.cxx:754
 TProfile3D.cxx:755
 TProfile3D.cxx:756
 TProfile3D.cxx:757
 TProfile3D.cxx:758
 TProfile3D.cxx:759
 TProfile3D.cxx:760
 TProfile3D.cxx:761
 TProfile3D.cxx:762
 TProfile3D.cxx:763
 TProfile3D.cxx:764
 TProfile3D.cxx:765
 TProfile3D.cxx:766
 TProfile3D.cxx:767
 TProfile3D.cxx:768
 TProfile3D.cxx:769
 TProfile3D.cxx:770
 TProfile3D.cxx:771
 TProfile3D.cxx:772
 TProfile3D.cxx:773
 TProfile3D.cxx:774
 TProfile3D.cxx:775
 TProfile3D.cxx:776
 TProfile3D.cxx:777
 TProfile3D.cxx:778
 TProfile3D.cxx:779
 TProfile3D.cxx:780
 TProfile3D.cxx:781
 TProfile3D.cxx:782
 TProfile3D.cxx:783
 TProfile3D.cxx:784
 TProfile3D.cxx:785
 TProfile3D.cxx:786
 TProfile3D.cxx:787
 TProfile3D.cxx:788
 TProfile3D.cxx:789
 TProfile3D.cxx:790
 TProfile3D.cxx:791
 TProfile3D.cxx:792
 TProfile3D.cxx:793
 TProfile3D.cxx:794
 TProfile3D.cxx:795
 TProfile3D.cxx:796
 TProfile3D.cxx:797
 TProfile3D.cxx:798
 TProfile3D.cxx:799
 TProfile3D.cxx:800
 TProfile3D.cxx:801
 TProfile3D.cxx:802
 TProfile3D.cxx:803
 TProfile3D.cxx:804
 TProfile3D.cxx:805
 TProfile3D.cxx:806
 TProfile3D.cxx:807
 TProfile3D.cxx:808
 TProfile3D.cxx:809
 TProfile3D.cxx:810
 TProfile3D.cxx:811
 TProfile3D.cxx:812
 TProfile3D.cxx:813
 TProfile3D.cxx:814
 TProfile3D.cxx:815
 TProfile3D.cxx:816
 TProfile3D.cxx:817
 TProfile3D.cxx:818
 TProfile3D.cxx:819
 TProfile3D.cxx:820
 TProfile3D.cxx:821
 TProfile3D.cxx:822
 TProfile3D.cxx:823
 TProfile3D.cxx:824
 TProfile3D.cxx:825
 TProfile3D.cxx:826
 TProfile3D.cxx:827
 TProfile3D.cxx:828
 TProfile3D.cxx:829
 TProfile3D.cxx:830
 TProfile3D.cxx:831
 TProfile3D.cxx:832
 TProfile3D.cxx:833
 TProfile3D.cxx:834
 TProfile3D.cxx:835
 TProfile3D.cxx:836
 TProfile3D.cxx:837
 TProfile3D.cxx:838
 TProfile3D.cxx:839
 TProfile3D.cxx:840
 TProfile3D.cxx:841
 TProfile3D.cxx:842
 TProfile3D.cxx:843
 TProfile3D.cxx:844
 TProfile3D.cxx:845
 TProfile3D.cxx:846
 TProfile3D.cxx:847
 TProfile3D.cxx:848
 TProfile3D.cxx:849
 TProfile3D.cxx:850
 TProfile3D.cxx:851
 TProfile3D.cxx:852
 TProfile3D.cxx:853
 TProfile3D.cxx:854
 TProfile3D.cxx:855
 TProfile3D.cxx:856
 TProfile3D.cxx:857
 TProfile3D.cxx:858
 TProfile3D.cxx:859
 TProfile3D.cxx:860
 TProfile3D.cxx:861
 TProfile3D.cxx:862
 TProfile3D.cxx:863
 TProfile3D.cxx:864
 TProfile3D.cxx:865
 TProfile3D.cxx:866
 TProfile3D.cxx:867
 TProfile3D.cxx:868
 TProfile3D.cxx:869
 TProfile3D.cxx:870
 TProfile3D.cxx:871
 TProfile3D.cxx:872
 TProfile3D.cxx:873
 TProfile3D.cxx:874
 TProfile3D.cxx:875
 TProfile3D.cxx:876
 TProfile3D.cxx:877
 TProfile3D.cxx:878
 TProfile3D.cxx:879
 TProfile3D.cxx:880
 TProfile3D.cxx:881
 TProfile3D.cxx:882
 TProfile3D.cxx:883
 TProfile3D.cxx:884
 TProfile3D.cxx:885
 TProfile3D.cxx:886
 TProfile3D.cxx:887
 TProfile3D.cxx:888
 TProfile3D.cxx:889
 TProfile3D.cxx:890
 TProfile3D.cxx:891
 TProfile3D.cxx:892
 TProfile3D.cxx:893
 TProfile3D.cxx:894
 TProfile3D.cxx:895
 TProfile3D.cxx:896
 TProfile3D.cxx:897
 TProfile3D.cxx:898
 TProfile3D.cxx:899
 TProfile3D.cxx:900
 TProfile3D.cxx:901
 TProfile3D.cxx:902
 TProfile3D.cxx:903
 TProfile3D.cxx:904
 TProfile3D.cxx:905
 TProfile3D.cxx:906
 TProfile3D.cxx:907
 TProfile3D.cxx:908
 TProfile3D.cxx:909
 TProfile3D.cxx:910
 TProfile3D.cxx:911
 TProfile3D.cxx:912
 TProfile3D.cxx:913
 TProfile3D.cxx:914
 TProfile3D.cxx:915
 TProfile3D.cxx:916
 TProfile3D.cxx:917
 TProfile3D.cxx:918
 TProfile3D.cxx:919
 TProfile3D.cxx:920
 TProfile3D.cxx:921
 TProfile3D.cxx:922
 TProfile3D.cxx:923
 TProfile3D.cxx:924
 TProfile3D.cxx:925
 TProfile3D.cxx:926
 TProfile3D.cxx:927
 TProfile3D.cxx:928
 TProfile3D.cxx:929
 TProfile3D.cxx:930
 TProfile3D.cxx:931
 TProfile3D.cxx:932
 TProfile3D.cxx:933
 TProfile3D.cxx:934
 TProfile3D.cxx:935
 TProfile3D.cxx:936
 TProfile3D.cxx:937
 TProfile3D.cxx:938
 TProfile3D.cxx:939
 TProfile3D.cxx:940
 TProfile3D.cxx:941
 TProfile3D.cxx:942
 TProfile3D.cxx:943
 TProfile3D.cxx:944
 TProfile3D.cxx:945
 TProfile3D.cxx:946
 TProfile3D.cxx:947
 TProfile3D.cxx:948
 TProfile3D.cxx:949
 TProfile3D.cxx:950
 TProfile3D.cxx:951
 TProfile3D.cxx:952
 TProfile3D.cxx:953
 TProfile3D.cxx:954
 TProfile3D.cxx:955
 TProfile3D.cxx:956
 TProfile3D.cxx:957
 TProfile3D.cxx:958
 TProfile3D.cxx:959
 TProfile3D.cxx:960
 TProfile3D.cxx:961
 TProfile3D.cxx:962
 TProfile3D.cxx:963
 TProfile3D.cxx:964
 TProfile3D.cxx:965
 TProfile3D.cxx:966
 TProfile3D.cxx:967
 TProfile3D.cxx:968
 TProfile3D.cxx:969
 TProfile3D.cxx:970
 TProfile3D.cxx:971
 TProfile3D.cxx:972
 TProfile3D.cxx:973
 TProfile3D.cxx:974
 TProfile3D.cxx:975
 TProfile3D.cxx:976
 TProfile3D.cxx:977
 TProfile3D.cxx:978
 TProfile3D.cxx:979
 TProfile3D.cxx:980
 TProfile3D.cxx:981
 TProfile3D.cxx:982
 TProfile3D.cxx:983
 TProfile3D.cxx:984
 TProfile3D.cxx:985
 TProfile3D.cxx:986
 TProfile3D.cxx:987
 TProfile3D.cxx:988
 TProfile3D.cxx:989
 TProfile3D.cxx:990
 TProfile3D.cxx:991
 TProfile3D.cxx:992
 TProfile3D.cxx:993
 TProfile3D.cxx:994
 TProfile3D.cxx:995
 TProfile3D.cxx:996
 TProfile3D.cxx:997
 TProfile3D.cxx:998
 TProfile3D.cxx:999
 TProfile3D.cxx:1000
 TProfile3D.cxx:1001
 TProfile3D.cxx:1002
 TProfile3D.cxx:1003
 TProfile3D.cxx:1004
 TProfile3D.cxx:1005
 TProfile3D.cxx:1006
 TProfile3D.cxx:1007
 TProfile3D.cxx:1008
 TProfile3D.cxx:1009
 TProfile3D.cxx:1010
 TProfile3D.cxx:1011
 TProfile3D.cxx:1012
 TProfile3D.cxx:1013
 TProfile3D.cxx:1014
 TProfile3D.cxx:1015
 TProfile3D.cxx:1016
 TProfile3D.cxx:1017
 TProfile3D.cxx:1018
 TProfile3D.cxx:1019
 TProfile3D.cxx:1020
 TProfile3D.cxx:1021
 TProfile3D.cxx:1022
 TProfile3D.cxx:1023
 TProfile3D.cxx:1024
 TProfile3D.cxx:1025
 TProfile3D.cxx:1026
 TProfile3D.cxx:1027
 TProfile3D.cxx:1028
 TProfile3D.cxx:1029
 TProfile3D.cxx:1030
 TProfile3D.cxx:1031
 TProfile3D.cxx:1032
 TProfile3D.cxx:1033
 TProfile3D.cxx:1034
 TProfile3D.cxx:1035
 TProfile3D.cxx:1036
 TProfile3D.cxx:1037
 TProfile3D.cxx:1038
 TProfile3D.cxx:1039
 TProfile3D.cxx:1040
 TProfile3D.cxx:1041
 TProfile3D.cxx:1042
 TProfile3D.cxx:1043
 TProfile3D.cxx:1044
 TProfile3D.cxx:1045
 TProfile3D.cxx:1046
 TProfile3D.cxx:1047
 TProfile3D.cxx:1048
 TProfile3D.cxx:1049
 TProfile3D.cxx:1050
 TProfile3D.cxx:1051
 TProfile3D.cxx:1052
 TProfile3D.cxx:1053
 TProfile3D.cxx:1054
 TProfile3D.cxx:1055
 TProfile3D.cxx:1056
 TProfile3D.cxx:1057
 TProfile3D.cxx:1058
 TProfile3D.cxx:1059
 TProfile3D.cxx:1060
 TProfile3D.cxx:1061
 TProfile3D.cxx:1062
 TProfile3D.cxx:1063
 TProfile3D.cxx:1064
 TProfile3D.cxx:1065
 TProfile3D.cxx:1066
 TProfile3D.cxx:1067
 TProfile3D.cxx:1068
 TProfile3D.cxx:1069
 TProfile3D.cxx:1070
 TProfile3D.cxx:1071
 TProfile3D.cxx:1072
 TProfile3D.cxx:1073
 TProfile3D.cxx:1074
 TProfile3D.cxx:1075
 TProfile3D.cxx:1076
 TProfile3D.cxx:1077
 TProfile3D.cxx:1078
 TProfile3D.cxx:1079
 TProfile3D.cxx:1080
 TProfile3D.cxx:1081
 TProfile3D.cxx:1082
 TProfile3D.cxx:1083
 TProfile3D.cxx:1084
 TProfile3D.cxx:1085
 TProfile3D.cxx:1086
 TProfile3D.cxx:1087
 TProfile3D.cxx:1088
 TProfile3D.cxx:1089
 TProfile3D.cxx:1090
 TProfile3D.cxx:1091
 TProfile3D.cxx:1092
 TProfile3D.cxx:1093
 TProfile3D.cxx:1094
 TProfile3D.cxx:1095
 TProfile3D.cxx:1096
 TProfile3D.cxx:1097
 TProfile3D.cxx:1098
 TProfile3D.cxx:1099
 TProfile3D.cxx:1100
 TProfile3D.cxx:1101
 TProfile3D.cxx:1102
 TProfile3D.cxx:1103
 TProfile3D.cxx:1104
 TProfile3D.cxx:1105
 TProfile3D.cxx:1106
 TProfile3D.cxx:1107
 TProfile3D.cxx:1108
 TProfile3D.cxx:1109
 TProfile3D.cxx:1110
 TProfile3D.cxx:1111
 TProfile3D.cxx:1112
 TProfile3D.cxx:1113
 TProfile3D.cxx:1114
 TProfile3D.cxx:1115
 TProfile3D.cxx:1116
 TProfile3D.cxx:1117
 TProfile3D.cxx:1118
 TProfile3D.cxx:1119
 TProfile3D.cxx:1120
 TProfile3D.cxx:1121
 TProfile3D.cxx:1122
 TProfile3D.cxx:1123
 TProfile3D.cxx:1124
 TProfile3D.cxx:1125
 TProfile3D.cxx:1126
 TProfile3D.cxx:1127
 TProfile3D.cxx:1128
 TProfile3D.cxx:1129
 TProfile3D.cxx:1130
 TProfile3D.cxx:1131
 TProfile3D.cxx:1132
 TProfile3D.cxx:1133
 TProfile3D.cxx:1134
 TProfile3D.cxx:1135
 TProfile3D.cxx:1136
 TProfile3D.cxx:1137
 TProfile3D.cxx:1138
 TProfile3D.cxx:1139
 TProfile3D.cxx:1140
 TProfile3D.cxx:1141
 TProfile3D.cxx:1142
 TProfile3D.cxx:1143
 TProfile3D.cxx:1144
 TProfile3D.cxx:1145
 TProfile3D.cxx:1146
 TProfile3D.cxx:1147
 TProfile3D.cxx:1148
 TProfile3D.cxx:1149
 TProfile3D.cxx:1150
 TProfile3D.cxx:1151
 TProfile3D.cxx:1152
 TProfile3D.cxx:1153
 TProfile3D.cxx:1154
 TProfile3D.cxx:1155
 TProfile3D.cxx:1156
 TProfile3D.cxx:1157
 TProfile3D.cxx:1158
 TProfile3D.cxx:1159
 TProfile3D.cxx:1160
 TProfile3D.cxx:1161
 TProfile3D.cxx:1162
 TProfile3D.cxx:1163
 TProfile3D.cxx:1164
 TProfile3D.cxx:1165
 TProfile3D.cxx:1166
 TProfile3D.cxx:1167
 TProfile3D.cxx:1168
 TProfile3D.cxx:1169
 TProfile3D.cxx:1170
 TProfile3D.cxx:1171
 TProfile3D.cxx:1172
 TProfile3D.cxx:1173
 TProfile3D.cxx:1174
 TProfile3D.cxx:1175
 TProfile3D.cxx:1176
 TProfile3D.cxx:1177
 TProfile3D.cxx:1178
 TProfile3D.cxx:1179
 TProfile3D.cxx:1180
 TProfile3D.cxx:1181
 TProfile3D.cxx:1182
 TProfile3D.cxx:1183
 TProfile3D.cxx:1184
 TProfile3D.cxx:1185
 TProfile3D.cxx:1186
 TProfile3D.cxx:1187
 TProfile3D.cxx:1188
 TProfile3D.cxx:1189
 TProfile3D.cxx:1190
 TProfile3D.cxx:1191
 TProfile3D.cxx:1192
 TProfile3D.cxx:1193
 TProfile3D.cxx:1194
 TProfile3D.cxx:1195
 TProfile3D.cxx:1196
 TProfile3D.cxx:1197
 TProfile3D.cxx:1198
 TProfile3D.cxx:1199
 TProfile3D.cxx:1200
 TProfile3D.cxx:1201
 TProfile3D.cxx:1202
 TProfile3D.cxx:1203
 TProfile3D.cxx:1204
 TProfile3D.cxx:1205
 TProfile3D.cxx:1206
 TProfile3D.cxx:1207
 TProfile3D.cxx:1208
 TProfile3D.cxx:1209
 TProfile3D.cxx:1210
 TProfile3D.cxx:1211
 TProfile3D.cxx:1212
 TProfile3D.cxx:1213
 TProfile3D.cxx:1214
 TProfile3D.cxx:1215
 TProfile3D.cxx:1216
 TProfile3D.cxx:1217
 TProfile3D.cxx:1218
 TProfile3D.cxx:1219
 TProfile3D.cxx:1220
 TProfile3D.cxx:1221
 TProfile3D.cxx:1222
 TProfile3D.cxx:1223
 TProfile3D.cxx:1224
 TProfile3D.cxx:1225
 TProfile3D.cxx:1226
 TProfile3D.cxx:1227
 TProfile3D.cxx:1228
 TProfile3D.cxx:1229
 TProfile3D.cxx:1230
 TProfile3D.cxx:1231
 TProfile3D.cxx:1232
 TProfile3D.cxx:1233
 TProfile3D.cxx:1234
 TProfile3D.cxx:1235
 TProfile3D.cxx:1236
 TProfile3D.cxx:1237
 TProfile3D.cxx:1238
 TProfile3D.cxx:1239
 TProfile3D.cxx:1240
 TProfile3D.cxx:1241
 TProfile3D.cxx:1242
 TProfile3D.cxx:1243
 TProfile3D.cxx:1244
 TProfile3D.cxx:1245
 TProfile3D.cxx:1246
 TProfile3D.cxx:1247
 TProfile3D.cxx:1248
 TProfile3D.cxx:1249
 TProfile3D.cxx:1250
 TProfile3D.cxx:1251
 TProfile3D.cxx:1252
 TProfile3D.cxx:1253
 TProfile3D.cxx:1254
 TProfile3D.cxx:1255
 TProfile3D.cxx:1256
 TProfile3D.cxx:1257
 TProfile3D.cxx:1258
 TProfile3D.cxx:1259
 TProfile3D.cxx:1260
 TProfile3D.cxx:1261
 TProfile3D.cxx:1262
 TProfile3D.cxx:1263
 TProfile3D.cxx:1264
 TProfile3D.cxx:1265
 TProfile3D.cxx:1266
 TProfile3D.cxx:1267
 TProfile3D.cxx:1268
 TProfile3D.cxx:1269
 TProfile3D.cxx:1270
 TProfile3D.cxx:1271
 TProfile3D.cxx:1272
 TProfile3D.cxx:1273
 TProfile3D.cxx:1274
 TProfile3D.cxx:1275
 TProfile3D.cxx:1276
 TProfile3D.cxx:1277
 TProfile3D.cxx:1278
 TProfile3D.cxx:1279
 TProfile3D.cxx:1280
 TProfile3D.cxx:1281
 TProfile3D.cxx:1282
 TProfile3D.cxx:1283
 TProfile3D.cxx:1284
 TProfile3D.cxx:1285
 TProfile3D.cxx:1286
 TProfile3D.cxx:1287
 TProfile3D.cxx:1288
 TProfile3D.cxx:1289
 TProfile3D.cxx:1290
 TProfile3D.cxx:1291
 TProfile3D.cxx:1292
 TProfile3D.cxx:1293
 TProfile3D.cxx:1294
 TProfile3D.cxx:1295
 TProfile3D.cxx:1296
 TProfile3D.cxx:1297
 TProfile3D.cxx:1298
 TProfile3D.cxx:1299
 TProfile3D.cxx:1300
 TProfile3D.cxx:1301
 TProfile3D.cxx:1302
 TProfile3D.cxx:1303
 TProfile3D.cxx:1304
 TProfile3D.cxx:1305
 TProfile3D.cxx:1306
 TProfile3D.cxx:1307
 TProfile3D.cxx:1308
 TProfile3D.cxx:1309
 TProfile3D.cxx:1310
 TProfile3D.cxx:1311
 TProfile3D.cxx:1312
 TProfile3D.cxx:1313
 TProfile3D.cxx:1314
 TProfile3D.cxx:1315
 TProfile3D.cxx:1316
 TProfile3D.cxx:1317
 TProfile3D.cxx:1318
 TProfile3D.cxx:1319
 TProfile3D.cxx:1320
 TProfile3D.cxx:1321
 TProfile3D.cxx:1322
 TProfile3D.cxx:1323
 TProfile3D.cxx:1324
 TProfile3D.cxx:1325
 TProfile3D.cxx:1326
 TProfile3D.cxx:1327
 TProfile3D.cxx:1328
 TProfile3D.cxx:1329
 TProfile3D.cxx:1330
 TProfile3D.cxx:1331
 TProfile3D.cxx:1332
 TProfile3D.cxx:1333
 TProfile3D.cxx:1334
 TProfile3D.cxx:1335
 TProfile3D.cxx:1336
 TProfile3D.cxx:1337
 TProfile3D.cxx:1338
 TProfile3D.cxx:1339
 TProfile3D.cxx:1340
 TProfile3D.cxx:1341
 TProfile3D.cxx:1342
 TProfile3D.cxx:1343
 TProfile3D.cxx:1344
 TProfile3D.cxx:1345
 TProfile3D.cxx:1346
 TProfile3D.cxx:1347
 TProfile3D.cxx:1348
 TProfile3D.cxx:1349
 TProfile3D.cxx:1350
 TProfile3D.cxx:1351
 TProfile3D.cxx:1352
 TProfile3D.cxx:1353
 TProfile3D.cxx:1354
 TProfile3D.cxx:1355
 TProfile3D.cxx:1356
 TProfile3D.cxx:1357
 TProfile3D.cxx:1358
 TProfile3D.cxx:1359
 TProfile3D.cxx:1360
 TProfile3D.cxx:1361
 TProfile3D.cxx:1362
 TProfile3D.cxx:1363
 TProfile3D.cxx:1364
 TProfile3D.cxx:1365
 TProfile3D.cxx:1366
 TProfile3D.cxx:1367
 TProfile3D.cxx:1368
 TProfile3D.cxx:1369
 TProfile3D.cxx:1370
 TProfile3D.cxx:1371
 TProfile3D.cxx:1372
 TProfile3D.cxx:1373
 TProfile3D.cxx:1374
 TProfile3D.cxx:1375
 TProfile3D.cxx:1376
 TProfile3D.cxx:1377
 TProfile3D.cxx:1378
 TProfile3D.cxx:1379
 TProfile3D.cxx:1380
 TProfile3D.cxx:1381
 TProfile3D.cxx:1382
 TProfile3D.cxx:1383
 TProfile3D.cxx:1384
 TProfile3D.cxx:1385
 TProfile3D.cxx:1386
 TProfile3D.cxx:1387
 TProfile3D.cxx:1388
 TProfile3D.cxx:1389
 TProfile3D.cxx:1390
 TProfile3D.cxx:1391
 TProfile3D.cxx:1392
 TProfile3D.cxx:1393
 TProfile3D.cxx:1394
 TProfile3D.cxx:1395
 TProfile3D.cxx:1396
 TProfile3D.cxx:1397
 TProfile3D.cxx:1398
 TProfile3D.cxx:1399
 TProfile3D.cxx:1400
 TProfile3D.cxx:1401
 TProfile3D.cxx:1402
 TProfile3D.cxx:1403
 TProfile3D.cxx:1404
 TProfile3D.cxx:1405
 TProfile3D.cxx:1406
 TProfile3D.cxx:1407
 TProfile3D.cxx:1408
 TProfile3D.cxx:1409
 TProfile3D.cxx:1410
 TProfile3D.cxx:1411
 TProfile3D.cxx:1412
 TProfile3D.cxx:1413
 TProfile3D.cxx:1414
 TProfile3D.cxx:1415
 TProfile3D.cxx:1416
 TProfile3D.cxx:1417
 TProfile3D.cxx:1418
 TProfile3D.cxx:1419
 TProfile3D.cxx:1420
 TProfile3D.cxx:1421
 TProfile3D.cxx:1422
 TProfile3D.cxx:1423
 TProfile3D.cxx:1424
 TProfile3D.cxx:1425
 TProfile3D.cxx:1426
 TProfile3D.cxx:1427
 TProfile3D.cxx:1428
 TProfile3D.cxx:1429
 TProfile3D.cxx:1430
 TProfile3D.cxx:1431
 TProfile3D.cxx:1432
 TProfile3D.cxx:1433
 TProfile3D.cxx:1434
 TProfile3D.cxx:1435
 TProfile3D.cxx:1436
 TProfile3D.cxx:1437
 TProfile3D.cxx:1438
 TProfile3D.cxx:1439
 TProfile3D.cxx:1440
 TProfile3D.cxx:1441
 TProfile3D.cxx:1442
 TProfile3D.cxx:1443
 TProfile3D.cxx:1444
 TProfile3D.cxx:1445
 TProfile3D.cxx:1446
 TProfile3D.cxx:1447
 TProfile3D.cxx:1448
 TProfile3D.cxx:1449
 TProfile3D.cxx:1450
 TProfile3D.cxx:1451
 TProfile3D.cxx:1452
 TProfile3D.cxx:1453
 TProfile3D.cxx:1454
 TProfile3D.cxx:1455
 TProfile3D.cxx:1456
 TProfile3D.cxx:1457
 TProfile3D.cxx:1458
 TProfile3D.cxx:1459
 TProfile3D.cxx:1460
 TProfile3D.cxx:1461
 TProfile3D.cxx:1462
 TProfile3D.cxx:1463
 TProfile3D.cxx:1464
 TProfile3D.cxx:1465
 TProfile3D.cxx:1466
 TProfile3D.cxx:1467
 TProfile3D.cxx:1468
 TProfile3D.cxx:1469
 TProfile3D.cxx:1470
 TProfile3D.cxx:1471
 TProfile3D.cxx:1472
 TProfile3D.cxx:1473
 TProfile3D.cxx:1474
 TProfile3D.cxx:1475
 TProfile3D.cxx:1476
 TProfile3D.cxx:1477
 TProfile3D.cxx:1478
 TProfile3D.cxx:1479
 TProfile3D.cxx:1480
 TProfile3D.cxx:1481
 TProfile3D.cxx:1482
 TProfile3D.cxx:1483
 TProfile3D.cxx:1484
 TProfile3D.cxx:1485
 TProfile3D.cxx:1486
 TProfile3D.cxx:1487
 TProfile3D.cxx:1488
 TProfile3D.cxx:1489
 TProfile3D.cxx:1490
 TProfile3D.cxx:1491
 TProfile3D.cxx:1492
 TProfile3D.cxx:1493
 TProfile3D.cxx:1494