Index: trunk/SophyaLib/HiStats/histos.cc
===================================================================
--- trunk/SophyaLib/HiStats/histos.cc	(revision 3057)
+++ trunk/SophyaLib/HiStats/histos.cc	(revision 3060)
@@ -1,4 +1,4 @@
 //
-// $Id: histos.cc,v 1.24 2006-08-12 22:41:08 cmv Exp $
+// $Id: histos.cc,v 1.25 2006-08-13 13:20:01 cmv Exp $
 //
 
Index: trunk/SophyaLib/HiStats/histos.h
===================================================================
--- trunk/SophyaLib/HiStats/histos.h	(revision 3057)
+++ trunk/SophyaLib/HiStats/histos.h	(revision 3060)
@@ -1,5 +1,5 @@
 // This may look like C code, but it is really -*- C++ -*-
 //
-// $Id: histos.h,v 1.24 2006-08-12 22:41:08 cmv Exp $
+// $Id: histos.h,v 1.25 2006-08-13 13:20:02 cmv Exp $
 //
 
Index: trunk/SophyaLib/HiStats/histos2.cc
===================================================================
--- trunk/SophyaLib/HiStats/histos2.cc	(revision 3057)
+++ trunk/SophyaLib/HiStats/histos2.cc	(revision 3060)
@@ -96,42 +96,23 @@
 
 mHprojx = mHprojy = NULL;
-if(h.mHprojx) {
-  SetProjX();
-  *mHprojx = *(h.mHprojx);
-}
-if(h.mHprojy) {
-  SetProjY();
-  *mHprojy = *(h.mHprojy); 
-}
-
-int_4 nb;
-r_8 min,max;
+if(h.mHprojx) {SetProjX(); *mHprojx = *(h.mHprojx);}
+if(h.mHprojy) {SetProjY(); *mHprojy = *(h.mHprojy);}
+
+int_4 nb; r_8 min,max;
 nb = h.NSliX();
-if(nb>0) {
-  SetSliX(nb);
-  for(i=0; i<NSliX();i++) *HSliX(i) = *(h.HSliX(i));
-}
+if(nb>0) {SetSliX(nb); for(i=0;i<NSliX();i++) *HSliX(i)=*(h.HSliX(i));}
 nb = h.NSliY();
-if(nb>0) {
-  SetSliY(nb);
-  for(i=0; i<NSliY();i++) *HSliY(i) = *(h.HSliY(i));
-}
+if(nb>0) {SetSliY(nb); for(i=0;i<NSliY();i++) *HSliY(i)=*(h.HSliY(i));}
 
 nb = h.NBandX();
 if(nb>0) {
-  for(i=0; i<nb;i++) {
-    h.GetBandX(i,min,max);
-    SetBandX(min,max);
-    *HBandX(i) = *(h.HBandX(i));
-  }
-  for(i=0; i<NBandX();i++) *HBandX(i) = *(h.HBandX(i));
+  for(i=0;i<nb;i++)
+    {h.GetBandX(i,min,max); SetBandX(min,max); *HBandX(i)=*(h.HBandX(i));}
+  for(i=0;i<NBandX();i++) *HBandX(i) = *(h.HBandX(i));
 }
 nb = h.NBandY();
 if(nb>0) {
-  for(i=0; i<nb;i++) {
-    h.GetBandY(i,min,max);
-    SetBandY(min,max);
-    *HBandY(i) = *(h.HBandY(i));
-  }
+  for(i=0;i<nb;i++)
+    {h.GetBandY(i,min,max); SetBandY(min,max); *HBandY(i)=*(h.HBandY(i));}
   for(i=0; i<NBandY();i++) *HBandY(i) = *(h.HBandY(i));
 }
@@ -166,4 +147,8 @@
   for(int_4 i=0;i<3;i++) for(int_4 j=0;j<3;j++) mOver[i][j]=0.;
   mB_s.H = NULL;
+
+  DelProjX(); DelProjY();
+  DelBandX(); DelBandY();
+  DelSliX(); DelSliY();
 }
 
@@ -177,10 +162,6 @@
 
   DelProj();
-
-  DelBandX();
-  DelBandY();
-
-  DelSliX();
-  DelSliY();
+  DelBandX(); DelBandY();
+  DelSliX();  DelSliY();
 
   nHist = 0;
@@ -208,9 +189,7 @@
   ZeroProj();
 
-  ZeroBandX();
-  ZeroBandY();
-
-  ZeroSliX();
-  ZeroSliY();
+  ZeroBandX(); ZeroBandY();
+
+  ZeroSliX(); ZeroSliY();
 }
 
@@ -242,17 +221,8 @@
   nHist = h.nHist;  nEntries = h.nEntries;  
 
-  DelProjX();
-  if(h.mHprojx) {
-    SetProjX();
-    *mHprojx = *(h.mHprojx);
-  }
-  DelProjY();
-  if(h.mHprojy) {
-    SetProjY();
-    *mHprojy = *(h.mHprojy);
-  }
+  if(h.mHprojx) {SetProjX(); *mHprojx = *(h.mHprojx);}
+  if(h.mHprojy) {SetProjY(); *mHprojy = *(h.mHprojy);}
 
   int_4 nb;
-  DelSliX();
   nb = h.NSliX();
   if(nb>0) {
@@ -260,5 +230,4 @@
     for(int i=0; i<NSliX();i++) *HSliX(i) = *(h.HSliX(i));
   }
-  DelSliY();
   nb = h.NSliY();
   if(nb>0) {
@@ -267,5 +236,4 @@
   }
 
-  DelBandX();
   nb = h.NBandX();
   if(nb>0) {
@@ -278,5 +246,4 @@
     for(int i=0; i<NBandX();i++) *HBandX(i) = *(h.HBandX(i));
   }
-  DelBandY();
   nb = h.NBandY();
   if(nb>0) {
@@ -1063,5 +1030,5 @@
 if( mHprojx != NULL ) DelProjX();
 mHprojx = new Histo(mXmin,mXmax,mNx);
-if( mErr2 != NULL && mHprojx != NULL ) mHprojx->Errors();
+if(mErr2 && mHprojx) mHprojx->Errors();
 }
 
@@ -1073,5 +1040,5 @@
 if( mHprojy != NULL ) DelProjY();
 mHprojy = new Histo(mYmin,mYmax,mNy);
-if( mErr2 != NULL && mHprojy != NULL  ) mHprojy->Errors();
+if(mErr2 && mHprojy) mHprojy->Errors();
 }
 
@@ -1164,4 +1131,5 @@
 mB_s.max = ybmax;
 mB_s.H = new Histo(mXmin,mXmax,mNx);
+if(mErr2 && mB_s.H) mB_s.H->Errors();
 mLBandx.push_back(mB_s);
 mB_s.H = NULL;
@@ -1178,4 +1146,5 @@
 mB_s.max = xbmax;
 mB_s.H = new Histo(mYmin,mYmax,mNy);
+if(mErr2 && mB_s.H) mB_s.H->Errors();
 mLBandy.push_back(mB_s);
 mB_s.H = NULL;
@@ -1317,4 +1286,5 @@
   mB_s.max = mB_s.min + w;
   mB_s.H = new Histo(mXmin,mXmax,mNx);
+  if(mErr2 && mB_s.H) mB_s.H->Errors();
   mLSlix.push_back(mB_s);
   mB_s.H = NULL;
@@ -1338,4 +1308,5 @@
   mB_s.max = mB_s.min + w;
   mB_s.H = new Histo(mYmin,mYmax,mNy);
+  if(mErr2 && mB_s.H) mB_s.H->Errors();
   mLSliy.push_back(mB_s);
   mB_s.H = NULL;
@@ -1410,4 +1381,28 @@
               if( (*i).num == n ) return (*i).H;
 return NULL;
+}
+
+/*!
+  Retourne les limites de la bande equidistante numero `n' selon X.
+*/
+void Histo2D::GetSliX(int_4 n,r_8& ybmin,r_8& ybmax) const
+{
+ybmin = 0.; ybmax = 0.;
+if( mLSlix.size() <= 0 || n < 0 || n >= (int_4) mLSlix.size() ) return;
+for(list<bande_slice>::const_iterator i = mLSlix.begin(); i != mLSlix.end(); i++)
+  if( (*i).num == n ) { ybmin = (*i).min; ybmax = (*i).max; return;}
+return;
+}
+
+/*!
+  Retourne les limites de la bande equidistante numero `n' selon Y.
+*/
+void Histo2D::GetSliY(int_4 n,r_8& xbmin,r_8& xbmax) const
+{
+xbmin = 0.; xbmax = 0.;
+if( mLSliy.size() <= 0 || n < 0 || n >= (int_4) mLSliy.size() ) return;
+for(list<bande_slice>::const_iterator i = mLSliy.begin(); i != mLSliy.end(); i++)
+  if( (*i).num == n ) { xbmin = (*i).min; xbmax = (*i).max; return;}
+return;
 }
 
Index: trunk/SophyaLib/HiStats/histos2.h
===================================================================
--- trunk/SophyaLib/HiStats/histos2.h	(revision 3057)
+++ trunk/SophyaLib/HiStats/histos2.h	(revision 3060)
@@ -195,4 +195,6 @@
   Histo* HSliX(int_4 n) const;
   Histo* HSliY(int_4 n) const;
+  void GetSliX(int_4 n,r_8& ybmin,r_8& ybmax) const;
+  void GetSliY(int_4 n,r_8& xbmin,r_8& xbmax) const;
   void ShowSli(int_4 lp = 0) const;
 
