diff --git a/hist/src/TH2.cxx b/hist/src/TH2.cxx index 115f3111aedae48e0c8ac87eed2929613515dd09..f9f9de0becd10788f5d5ff1cd47f36ec5c56cfdc 100644 --- a/hist/src/TH2.cxx +++ b/hist/src/TH2.cxx @@ -1,4 +1,4 @@ -// @(#)root/hist:$Name: $:$Id: TH2.cxx,v 1.63 2005/01/20 21:58:44 brun Exp $ +// @(#)root/hist:$Name: $:$Id: TH2.cxx,v 1.64 2005/01/25 07:36:21 brun Exp $ // Author: Rene Brun 26/12/94 /************************************************************************* @@ -2101,6 +2101,8 @@ TH2C::TH2C(const char *name,const char *title,Int_t nbinsx,Axis_t xlow,Axis_t xu :TH2(name,title,nbinsx,xlow,xup,nbinsy,ylow,yup) { TArrayC::Set(fNcells); + + if (xlow >= xup || ylow >= yup) SetBuffer(fgBufferSize); } //______________________________________________________________________________ @@ -2331,6 +2333,8 @@ TH2S::TH2S(const char *name,const char *title,Int_t nbinsx,Axis_t xlow,Axis_t xu :TH2(name,title,nbinsx,xlow,xup,nbinsy,ylow,yup) { TArrayS::Set(fNcells); + + if (xlow >= xup || ylow >= yup) SetBuffer(fgBufferSize); } //______________________________________________________________________________ @@ -2561,6 +2565,8 @@ TH2I::TH2I(const char *name,const char *title,Int_t nbinsx,Axis_t xlow,Axis_t xu :TH2(name,title,nbinsx,xlow,xup,nbinsy,ylow,yup) { TArrayI::Set(fNcells); + + if (xlow >= xup || ylow >= yup) SetBuffer(fgBufferSize); } //______________________________________________________________________________ @@ -2756,6 +2762,8 @@ TH2F::TH2F(const char *name,const char *title,Int_t nbinsx,Axis_t xlow,Axis_t xu :TH2(name,title,nbinsx,xlow,xup,nbinsy,ylow,yup) { TArrayF::Set(fNcells); + + if (xlow >= xup || ylow >= yup) SetBuffer(fgBufferSize); } //______________________________________________________________________________ @@ -2992,6 +3000,8 @@ TH2D::TH2D(const char *name,const char *title,Int_t nbinsx,Axis_t xlow,Axis_t xu :TH2(name,title,nbinsx,xlow,xup,nbinsy,ylow,yup) { TArrayD::Set(fNcells); + + if (xlow >= xup || ylow >= yup) SetBuffer(fgBufferSize); } //______________________________________________________________________________ diff --git a/hist/src/TH3.cxx b/hist/src/TH3.cxx index eccb7de1c2575958ecad7f800fa62b6b28a02538..e42047d28accbc2e97ef981e603922b095b3d243 100644 --- a/hist/src/TH3.cxx +++ b/hist/src/TH3.cxx @@ -1,4 +1,4 @@ -// @(#)root/hist:$Name: $:$Id: TH3.cxx,v 1.55 2005/01/20 21:58:44 brun Exp $ +// @(#)root/hist:$Name: $:$Id: TH3.cxx,v 1.56 2005/01/25 07:36:21 brun Exp $ // Author: Rene Brun 27/10/95 /************************************************************************* @@ -1906,6 +1906,8 @@ TH3C::TH3C(const char *name,const char *title,Int_t nbinsx,Axis_t xlow,Axis_t xu //*-* ================================================== TArrayC::Set(fNcells); + + if (xlow >= xup || ylow >= yup || zlow >= zup) SetBuffer(fgBufferSize); } //______________________________________________________________________________ @@ -2130,6 +2132,8 @@ TH3S::TH3S(const char *name,const char *title,Int_t nbinsx,Axis_t xlow,Axis_t xu //*-*-*-*-*-*-*-*-*Normal constructor for fix bin size 3-D histograms*-*-*-*-* //*-* ================================================== TH3S::Set(fNcells); + + if (xlow >= xup || ylow >= yup || zlow >= zup) SetBuffer(fgBufferSize); } //______________________________________________________________________________ @@ -2354,6 +2358,8 @@ TH3I::TH3I(const char *name,const char *title,Int_t nbinsx,Axis_t xlow,Axis_t xu //*-*-*-*-*-*-*-*-*Normal constructor for fix bin size 3-D histograms*-*-*-*-* //*-* ================================================== TH3I::Set(fNcells); + + if (xlow >= xup || ylow >= yup || zlow >= zup) SetBuffer(fgBufferSize); } //______________________________________________________________________________ @@ -2545,6 +2551,8 @@ TH3F::TH3F(const char *name,const char *title,Int_t nbinsx,Axis_t xlow,Axis_t xu //*-*-*-*-*-*-*-*-*Normal constructor for fix bin size 3-D histograms*-*-*-*-* //*-* ================================================== TArrayF::Set(fNcells); + + if (xlow >= xup || ylow >= yup || zlow >= zup) SetBuffer(fgBufferSize); } //______________________________________________________________________________ @@ -2748,6 +2756,8 @@ TH3D::TH3D(const char *name,const char *title,Int_t nbinsx,Axis_t xlow,Axis_t xu //*-*-*-*-*-*-*-*-*Normal constructor for fix bin size 3-D histograms*-*-*-*-* //*-* ================================================== TArrayD::Set(fNcells); + + if (xlow >= xup || ylow >= yup || zlow >= zup) SetBuffer(fgBufferSize); } //______________________________________________________________________________ diff --git a/hist/src/TProfile2D.cxx b/hist/src/TProfile2D.cxx index daa830e70b8312dd9c587e4ab8368d4b3bc35312..9f5c40d625a6893b5d90c93706d91e2db97857f6 100644 --- a/hist/src/TProfile2D.cxx +++ b/hist/src/TProfile2D.cxx @@ -1,4 +1,4 @@ -// @(#)root/hist:$Name: $:$Id: TProfile2D.cxx,v 1.28 2005/01/20 21:58:44 brun Exp $ +// @(#)root/hist:$Name: $:$Id: TProfile2D.cxx,v 1.29 2005/01/25 07:36:21 brun Exp $ // Author: Rene Brun 16/04/2000 /************************************************************************* @@ -103,6 +103,7 @@ TProfile2D::TProfile2D(const char *name,const char *title,Int_t nx,Axis_t xlow,A // fix and variable bin size like in TH2D. BuildOptions(0,0,option); + if (xlow >= xup || ylow >= yup) SetBuffer(fgBufferSize); } //______________________________________________________________________________ @@ -148,6 +149,7 @@ TProfile2D::TProfile2D(const char *name,const char *title,Int_t nx,Axis_t xlow,A // BuildOptions(zlow,zup,option); + if (xlow >= xup || ylow >= yup) SetBuffer(fgBufferSize); } @@ -456,7 +458,7 @@ Int_t TProfile2D::BufferFill(Axis_t x, Axis_t y, Axis_t z, Stat_t w) fBuffer = buffer; } } - if (nbentries >= fBufferSize) { + if (4*nbentries+4 >= fBufferSize) { BufferEmpty(1); return Fill(x,y,z,w); }