ROOT logo
// @(#)root/hist:$Id: TProfile3D.h 41358 2011-10-12 13:15:35Z moneta $
// 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.             *
 *************************************************************************/

#ifndef ROOT_TProfile3D
#define ROOT_TProfile3D


//////////////////////////////////////////////////////////////////////////
//                                                                      //
// TProfile3D                                                           //
//                                                                      //
// Profile3D histogram class.                                           //
//                                                                      //
//////////////////////////////////////////////////////////////////////////

#ifndef ROOT_TH3
#include "TH3.h"
#endif
#ifndef ROOT_TProfile
#include "TProfile.h"
#endif

class TProfile3D : public TH3D {

public:
   friend class TProfileHelper;

protected:
   TArrayD       fBinEntries;      //number of entries per bin
   EErrorType    fErrorMode;       //Option to compute errors
   Double_t      fTmin;            //Lower limit in T (if set)
   Double_t      fTmax;            //Upper limit in T (if set)
   Bool_t        fScaling;         //!True when TProfile3D::Scale is called
   Double_t      fTsumwt;          //Total Sum of weight*T
   Double_t      fTsumwt2;         //Total Sum of weight*T*T
   TArrayD       fBinSumw2;        //Array of sum of squares of weights per bin 
   static Bool_t fgApproximate;    //bin error approximation option

   virtual Int_t    BufferFill(Double_t, Double_t) {return -2;} //may not use
   virtual Int_t    BufferFill(Double_t, Double_t, Double_t) {return -2;} //may not use
   virtual Int_t    BufferFill(Double_t, Double_t, Double_t, Double_t) {return -2;} //may not use
   virtual Int_t    BufferFill(Double_t x, Double_t y, Double_t z, Double_t t, Double_t w);

   // helper methods for the Merge unification in TProfileHelper
   void SetBins(const Int_t* nbins,const Double_t* range) { SetBins(nbins[0], range[0], range[1], 
                                                                    nbins[1], range[2], range[3], 
                                                                    nbins[2], range[4], range[5]); };
   Int_t Fill(const Double_t* v) { return Fill(v[0], v[1], v[2], v[3], v[4]); };
   
private:
   Double_t *GetB()  {return &fBinEntries.fArray[0];}
   Double_t *GetB2() {return (fBinSumw2.fN ? &fBinSumw2.fArray[0] : 0 ); }
   Double_t *GetW()  {return &fArray[0];}
   Double_t *GetW2() {return &fSumw2.fArray[0];}
   void  SetBins(Int_t, Double_t, Double_t)
      { MayNotUse("SetBins(Int_t, Double_t, Double_t"); }
   void  SetBins(Int_t, const Double_t*)
      { MayNotUse("SetBins(Int_t, const Double_t*"); }
   void SetBins(Int_t, Double_t, Double_t, Int_t, Double_t, Double_t)
      { MayNotUse("SetBins(Int_t, Double_t, Double_t, Int_t, Double_t, Double_t"); }
   void SetBins(Int_t, const Double_t*, Int_t, const Double_t*)
      { MayNotUse("SetBins(Int_t, const Double_t*, Int_t, const Double_t*"); }

public:
   TProfile3D();
   TProfile3D(const char *name,const char *title,Int_t nbinsx,Double_t xlow,Double_t xup
                                                ,Int_t nbinsy,Double_t ylow,Double_t yup
                                                ,Int_t nbinsz,Double_t zlow,Double_t zup, Option_t *option="");
   TProfile3D(const char *name,const char *title,Int_t nbinsx,const Double_t *xbins
                                                ,Int_t nbinsy,const Double_t *ybins
                                                ,Int_t nbinsz,const Double_t *zbins,Option_t *option="");
   TProfile3D(const TProfile3D &profile);
   virtual ~TProfile3D();
   virtual void      Add(TF1 *h1, Double_t c1=1, Option_t *option="");
   virtual void      Add(const TH1 *h1, Double_t c1=1);
   virtual void      Add(const TH1 *h1, const TH1 *h2, Double_t c1=1, Double_t c2=1); // *MENU*
   static  void      Approximate(Bool_t approx=kTRUE);
   void              BuildOptions(Double_t tmin, Double_t tmax, Option_t *option);
   virtual Int_t     BufferEmpty(Int_t action=0);
   virtual void      Copy(TObject &hnew) const;
   virtual void      Divide(TF1 *h1, Double_t c1=1);
   virtual void      Divide(const TH1 *h1);
   virtual void      Divide(const TH1 *h1, const TH1 *h2, Double_t c1=1, Double_t c2=1, Option_t *option=""); // *MENU*
   virtual TH1      *DrawCopy(Option_t *option="") const;
   Int_t             Fill(Double_t) {return -1;} //MayNotUse
   Int_t             Fill(const char*, Double_t) {return -1;} //MayNotUse
   Int_t             Fill(Double_t, Double_t) {return -1; } //MayNotUse
   Int_t             Fill(Double_t, Double_t,Double_t) {return -1; } //MayNotUse
   Int_t             Fill(const char *, const char *, const char *, Double_t) {return -1; } //MayNotUse
   Int_t             Fill(const char *, Double_t , const char *, Double_t) {return -1; } //MayNotUse
   Int_t             Fill(const char *, const char *, Double_t, Double_t) {return -1; } //MayNotUse
   Int_t             Fill(Double_t, const char *, const char *, Double_t) {return -1; } //MayNotUse
   Int_t             Fill(Double_t, const char *, Double_t, Double_t) {return -1; } //MayNotUse
   Int_t             Fill(Double_t, Double_t, const char *, Double_t) {return -1; } //MayNotUse
   virtual Int_t     Fill(Double_t x, Double_t y, Double_t z, Double_t t);
   virtual Int_t     Fill(Double_t x, Double_t y, Double_t z, Double_t t, Double_t w);
   virtual Double_t  GetBinContent(Int_t bin) const;
   virtual Double_t  GetBinContent(Int_t,Int_t) const
                     { MayNotUse("GetBinContent(Int_t, Int_t"); return -1; }
   virtual Double_t  GetBinContent(Int_t binx, Int_t biny, Int_t binz) const {return GetBinContent(GetBin(binx,biny,binz));}
   virtual Double_t  GetBinError(Int_t bin) const;
   virtual Double_t  GetBinError(Int_t,Int_t) const
                     { MayNotUse("GetBinError(Int_t, Int_t"); return -1; }
   virtual Double_t  GetBinError(Int_t binx, Int_t biny, Int_t binz) const {return GetBinError(GetBin(binx,biny,binz));}
   virtual Double_t  GetBinEntries(Int_t bin) const;
   virtual Double_t  GetBinEffectiveEntries(Int_t bin);
   virtual TArrayD *GetBinSumw2() {return &fBinSumw2;}
   virtual const TArrayD *GetBinSumw2() const {return &fBinSumw2;}
   Option_t         *GetErrorOption() const;
   virtual void      GetStats(Double_t *stats) const;
   virtual Double_t  GetTmin() const {return fTmin;}
   virtual Double_t  GetTmax() const {return fTmax;}
   virtual Long64_t  Merge(TCollection *list);
   virtual void      Multiply(TF1 *h1, Double_t c1=1);
   virtual void      Multiply(const TH1 *h1);
   virtual void      Multiply(const TH1 *h1, const TH1 *h2, Double_t c1=1, Double_t c2=1, Option_t *option=""); // *MENU*
   TH3D             *ProjectionXYZ(const char *name="_pxyz", Option_t *option="e") const;
   virtual void      PutStats(Double_t *stats);
   virtual void      Reset(Option_t *option="");
   virtual void      RebinAxis(Double_t x, TAxis *axis);
   virtual void      SavePrimitive(ostream &out, Option_t *option = "");
   virtual void      Scale(Double_t c1=1, Option_t *option="");
   virtual void      SetBinEntries(Int_t bin, Double_t w);
   virtual void      SetBins(Int_t nbinsx, Double_t xmin, Double_t xmax, 
                             Int_t nbinsy, Double_t ymin, Double_t ymax, 
                             Int_t nbinsz, Double_t zmin, Double_t zmax);
   virtual void      SetBins(Int_t nx, const Double_t *xBins, Int_t ny, const Double_t * yBins, Int_t nz,
			    const Double_t *zBins);
   virtual void      SetBuffer(Int_t buffersize, Option_t *opt="");
   virtual void      SetErrorOption(Option_t *option=""); // *MENU*
   virtual void      Sumw2(); 

   ClassDef(TProfile3D,7)  //Profile3D histogram class
};

#endif
 TProfile3D.h:1
 TProfile3D.h:2
 TProfile3D.h:3
 TProfile3D.h:4
 TProfile3D.h:5
 TProfile3D.h:6
 TProfile3D.h:7
 TProfile3D.h:8
 TProfile3D.h:9
 TProfile3D.h:10
 TProfile3D.h:11
 TProfile3D.h:12
 TProfile3D.h:13
 TProfile3D.h:14
 TProfile3D.h:15
 TProfile3D.h:16
 TProfile3D.h:17
 TProfile3D.h:18
 TProfile3D.h:19
 TProfile3D.h:20
 TProfile3D.h:21
 TProfile3D.h:22
 TProfile3D.h:23
 TProfile3D.h:24
 TProfile3D.h:25
 TProfile3D.h:26
 TProfile3D.h:27
 TProfile3D.h:28
 TProfile3D.h:29
 TProfile3D.h:30
 TProfile3D.h:31
 TProfile3D.h:32
 TProfile3D.h:33
 TProfile3D.h:34
 TProfile3D.h:35
 TProfile3D.h:36
 TProfile3D.h:37
 TProfile3D.h:38
 TProfile3D.h:39
 TProfile3D.h:40
 TProfile3D.h:41
 TProfile3D.h:42
 TProfile3D.h:43
 TProfile3D.h:44
 TProfile3D.h:45
 TProfile3D.h:46
 TProfile3D.h:47
 TProfile3D.h:48
 TProfile3D.h:49
 TProfile3D.h:50
 TProfile3D.h:51
 TProfile3D.h:52
 TProfile3D.h:53
 TProfile3D.h:54
 TProfile3D.h:55
 TProfile3D.h:56
 TProfile3D.h:57
 TProfile3D.h:58
 TProfile3D.h:59
 TProfile3D.h:60
 TProfile3D.h:61
 TProfile3D.h:62
 TProfile3D.h:63
 TProfile3D.h:64
 TProfile3D.h:65
 TProfile3D.h:66
 TProfile3D.h:67
 TProfile3D.h:68
 TProfile3D.h:69
 TProfile3D.h:70
 TProfile3D.h:71
 TProfile3D.h:72
 TProfile3D.h:73
 TProfile3D.h:74
 TProfile3D.h:75
 TProfile3D.h:76
 TProfile3D.h:77
 TProfile3D.h:78
 TProfile3D.h:79
 TProfile3D.h:80
 TProfile3D.h:81
 TProfile3D.h:82
 TProfile3D.h:83
 TProfile3D.h:84
 TProfile3D.h:85
 TProfile3D.h:86
 TProfile3D.h:87
 TProfile3D.h:88
 TProfile3D.h:89
 TProfile3D.h:90
 TProfile3D.h:91
 TProfile3D.h:92
 TProfile3D.h:93
 TProfile3D.h:94
 TProfile3D.h:95
 TProfile3D.h:96
 TProfile3D.h:97
 TProfile3D.h:98
 TProfile3D.h:99
 TProfile3D.h:100
 TProfile3D.h:101
 TProfile3D.h:102
 TProfile3D.h:103
 TProfile3D.h:104
 TProfile3D.h:105
 TProfile3D.h:106
 TProfile3D.h:107
 TProfile3D.h:108
 TProfile3D.h:109
 TProfile3D.h:110
 TProfile3D.h:111
 TProfile3D.h:112
 TProfile3D.h:113
 TProfile3D.h:114
 TProfile3D.h:115
 TProfile3D.h:116
 TProfile3D.h:117
 TProfile3D.h:118
 TProfile3D.h:119
 TProfile3D.h:120
 TProfile3D.h:121
 TProfile3D.h:122
 TProfile3D.h:123
 TProfile3D.h:124
 TProfile3D.h:125
 TProfile3D.h:126
 TProfile3D.h:127
 TProfile3D.h:128
 TProfile3D.h:129
 TProfile3D.h:130
 TProfile3D.h:131
 TProfile3D.h:132
 TProfile3D.h:133
 TProfile3D.h:134
 TProfile3D.h:135
 TProfile3D.h:136
 TProfile3D.h:137
 TProfile3D.h:138
 TProfile3D.h:139
 TProfile3D.h:140
 TProfile3D.h:141
 TProfile3D.h:142
 TProfile3D.h:143
 TProfile3D.h:144