Index: trunk/SophyaLib/HiStats/hbook.h
===================================================================
--- trunk/SophyaLib/HiStats/hbook.h	(revision 1089)
+++ trunk/SophyaLib/HiStats/hbook.h	(revision 1092)
@@ -9,70 +9,70 @@
 #endif
 
-void hbandx_(int_4 *,float *,float *,float *);
-void hbandy_(int_4 *,float *,float *,float *);
+void hbandx_(int_4 *,r_4 *,r_4 *,r_4 *);
+void hbandy_(int_4 *,r_4 *,r_4 *,r_4 *);
 
 void hbarx_(int_4 *);
 void hbary_(int_4 *);
 
-void hbfun1_(int_4 *,char *,int_4 *,float *,float *,float fun(float *),int_4);
-void hbfun2_(int_4 *,char *,int_4 *,float *,float *,int_4 *,float *,float *
-            ,float fun(float *,float *),int_4);
+void hbfun1_(int_4 *,char *,int_4 *,r_4 *,r_4 *,r_4 fun(r_4 *),int_4);
+void hbfun2_(int_4 *,char *,int_4 *,r_4 *,r_4 *,int_4 *,r_4 *,r_4 *
+            ,r_4 fun(r_4 *,r_4 *),int_4);
 void hbigbi_(int_4 *,int_4 *);
-void hbook1_(int_4 *,char *,int_4 *,float *,float *,float *,int_4);
-void hbook2_(int_4 *,char *,int_4 *,float *,float *
-            ,int_4 *,float *,float *,float *,int_4);
-void hbpro_(int_4 *,float *);
-void hbprof_(int_4 *,char *,int_4 *,float *,float *
-            ,float *,float *,char *,int_4,int_4);
-void hbprox_(int_4 *,float *);
-void hbproy_(int_4 *,float *);
-void hbslix_(int_4 *,int_4 *,float *);
-void hbsliy_(int_4 *,int_4 *,float *);
+void hbook1_(int_4 *,char *,int_4 *,r_4 *,r_4 *,r_4 *,int_4);
+void hbook2_(int_4 *,char *,int_4 *,r_4 *,r_4 *
+            ,int_4 *,r_4 *,r_4 *,r_4 *,int_4);
+void hbpro_(int_4 *,r_4 *);
+void hbprof_(int_4 *,char *,int_4 *,r_4 *,r_4 *
+            ,r_4 *,r_4 *,char *,int_4,int_4);
+void hbprox_(int_4 *,r_4 *);
+void hbproy_(int_4 *,r_4 *);
+void hbslix_(int_4 *,int_4 *,r_4 *);
+void hbsliy_(int_4 *,int_4 *,r_4 *);
 void hcdir_(char *,char *,int_4,int_4);
 void hdelet_(int_4 *);
-void hfill_(int_4 *,float *,float *,float *);
-void hfithn_(int_4 *,char *,char *,int_4 *,float *
-            ,float *,float *,float *,float *,float *,int_4,int_4);
-void hfn_(int_4 *,float *);
-void hfunc_(int_4 *,float fun(float *));
-void hgive_(int_4 *,char *,int_4 *,float *,float *
-                          ,int_4 *,float *,float *,int_4 *,int_4 *);
-void hgn_(int_4 *,int_4 *,int_4 *,float *,int_4 *);
-void hgnf_(int_4 *,int_4 *,float *,int_4 *);
+void hfill_(int_4 *,r_4 *,r_4 *,r_4 *);
+void hfithn_(int_4 *,char *,char *,int_4 *,r_4 *
+            ,r_4 *,r_4 *,r_4 *,r_4 *,r_4 *,int_4,int_4);
+void hfn_(int_4 *,r_4 *);
+void hfunc_(int_4 *,r_4 fun(r_4 *));
+void hgive_(int_4 *,char *,int_4 *,r_4 *,r_4 *
+                          ,int_4 *,r_4 *,r_4 *,int_4 *,int_4 *);
+void hgn_(int_4 *,int_4 *,int_4 *,r_4 *,int_4 *);
+void hgnf_(int_4 *,int_4 *,r_4 *,int_4 *);
 void hgnpar_(int_4 *,char *,int_4);
-float hi_(int_4 *,int_4 *);
+r_4 hi_(int_4 *,int_4 *);
 void hidopt_(int_4 *,char *,int_4);
-float hie_(int_4 *,int_4 *);
-float hif_(int_4 *,int_4 *);
-float hij_(int_4 *,int_4 *,int_4 *);
-void hijxy_(int_4 *,int_4 *,int_4 *,float *,float *);
-void hix_(int_4 *,int_4 *,float *);
+r_4 hie_(int_4 *,int_4 *);
+r_4 hif_(int_4 *,int_4 *);
+r_4 hij_(int_4 *,int_4 *,int_4 *);
+void hijxy_(int_4 *,int_4 *,int_4 *,r_4 *,r_4 *);
+void hix_(int_4 *,int_4 *,r_4 *);
 void hldir_(char *,char *,int_4,int_4);
 void hmdir_(char *,char *,int_4,int_4);
-float hmax_(int_4 *);
-void hmaxim_(int_4 *,float *);
-float hmin_(int_4 *);
-void hminim_(int_4 *,float *);
-void hnorma_(int_4 *,float *);
+r_4 hmax_(int_4 *);
+void hmaxim_(int_4 *,r_4 *);
+r_4 hmin_(int_4 *);
+void hminim_(int_4 *,r_4 *);
+void hnorma_(int_4 *,r_4 *);
 void hnoent_(int_4 *,int_4 *);
-void hpak_(int_4 *,float *);
-void hpake_(int_4 *,float *);
+void hpak_(int_4 *,r_4 *);
+void hpake_(int_4 *,r_4 *);
 void hprint_(int_4 *);
 void hrend_(char *,int_4);
 void hrin_(int_4 *,int_4 *,int_4 *);
-float hrndm1_(int_4 *);
-void hrndm2_(int_4 *,float *,float *);
+r_4 hrndm1_(int_4 *);
+void hrndm2_(int_4 *,r_4 *,r_4 *);
 void hropen_(int_4 *,char *,char *,char *,int_4 *,int_4 *,int_4,int_4,int_4);
 void hrout_(int_4 *,int_4 *,char *,int_4);
-void hscale_(int_4 *,float *);
-float hstati_(int_4 *,int_4 *,char *,int_4 *,int_4);
-float hsum_(int_4 *);
-void hunpak_(int_4 *,float *,char *,int_4 *,int_4);
-void hunpke_(int_4 *,float *,char *,int_4 *,int_4);
-float hx_(int_4 *,float *);
-float hxe_(int_4 *,float *);
-float hxi_(int_4 *,float *,int_4 *);
-float hxyij_(int_4 *,float *,float *,int_4 *,int_4 *);
-float hxy_(int_4 *,float *,float *);
+void hscale_(int_4 *,r_4 *);
+r_4 hstati_(int_4 *,int_4 *,char *,int_4 *,int_4);
+r_4 hsum_(int_4 *);
+void hunpak_(int_4 *,r_4 *,char *,int_4 *,int_4);
+void hunpke_(int_4 *,r_4 *,char *,int_4 *,int_4);
+r_4 hx_(int_4 *,r_4 *);
+r_4 hxe_(int_4 *,r_4 *);
+r_4 hxi_(int_4 *,r_4 *,int_4 *);
+r_4 hxyij_(int_4 *,r_4 *,r_4 *,int_4 *,int_4 *);
+r_4 hxy_(int_4 *,r_4 *,r_4 *);
 
 #ifdef __cplusplus
Index: trunk/SophyaLib/HiStats/hisprof.cc
===================================================================
--- trunk/SophyaLib/HiStats/hisprof.cc	(revision 1089)
+++ trunk/SophyaLib/HiStats/hisprof.cc	(revision 1092)
@@ -31,7 +31,9 @@
   SetErrOpt(1) permet de demander de calculer l'erreur sur la moyenne.
 */
-HProf::HProf(float xMin, float xMax, int nBin, float yMin, float yMax)
+HProf::HProf(r_8 xMin, r_8 xMax, int_4 nBin, r_8 yMin, r_8 yMax)
 : Histo(xMin,xMax,nBin)
-, SumY(new double[nBin]), SumY2(new double[nBin]), SumW(new double[nBin])
+, SumY( (nBin>0) ? new r_8[nBin] : NULL)
+, SumY2((nBin>0) ? new r_8[nBin] : NULL)
+, SumW( (nBin>0) ? new r_8[nBin] : NULL)
 , Ok(false), YMin(yMin), YMax(yMax), Opt(0)
 {
@@ -43,17 +45,33 @@
 /********* Methode *********/
 /*!
+  Constructeur.
+*/
+HProf::HProf(r_4 xMin, r_4 xMax, int_4 nBin, r_4 yMin, r_4 yMax)
+: Histo((r_8)xMin,(r_8)xMax,nBin)
+, SumY( (nBin>0) ? new r_8[nBin] : NULL)
+, SumY2((nBin>0) ? new r_8[nBin] : NULL)
+, SumW( (nBin>0) ? new r_8[nBin] : NULL)
+, Ok(false), YMin((r_8)yMin), YMax((r_8)yMax), Opt(0)
+{
+  Histo::Errors();
+  Zero();
+  END_CONSTRUCTOR
+}
+
+/********* Methode *********/
+/*!
   Constructeur par copie.
 */
 HProf::HProf(const HProf& H)
 : Histo(H)
-, SumY((H.bins>0)  ? new double[H.bins] : NULL)
-, SumY2((H.bins>0) ? new double[H.bins] : NULL)
-, SumW((H.bins>0)  ? new double[H.bins] : NULL)
+, SumY((H.mBins>0)  ? new r_8[H.mBins] : NULL)
+, SumY2((H.mBins>0) ? new r_8[H.mBins] : NULL)
+, SumW((H.mBins>0)  ? new r_8[H.mBins] : NULL)
 , Ok(H.Ok), YMin(H.YMin), YMax(H.YMax), Opt(H.Opt)
 {
-  if(bins>0) {
-    memcpy(SumY,  H.SumY,  bins*sizeof(double));
-    memcpy(SumY2, H.SumY2, bins*sizeof(double));
-    memcpy(SumW,  H.SumW,  bins*sizeof(double));
+  if(mBins>0) {
+    memcpy(SumY,  H.SumY,  mBins*sizeof(r_8));
+    memcpy(SumY2, H.SumY2, mBins*sizeof(r_8));
+    memcpy(SumW,  H.SumW,  mBins*sizeof(r_8));
   }
   UpdateHisto();
@@ -88,7 +106,7 @@
 void HProf::Zero()
 {
-  memset(SumY,  0, bins*sizeof(double));
-  memset(SumY2, 0, bins*sizeof(double));
-  memset(SumW,  0, bins*sizeof(double));
+  memset(SumY,  0, mBins*sizeof(r_8));
+  memset(SumY2, 0, mBins*sizeof(r_8));
+  memset(SumW,  0, mBins*sizeof(r_8));
   Ok = false;
   Histo::Zero();
@@ -112,5 +130,5 @@
 void HProf::SetErrOpt(bool spread)
 {
-int opt = (spread) ? 0 : 1;
+uint_2 opt = (spread) ? 0 : 1;
 if(opt!=Opt) {Opt=opt; Ok=false;}
 }
@@ -130,6 +148,6 @@
 void HProf::updatehisto() const
 {
-float m,e2;
-if(bins>0) for(int i=0;i<bins;i++) {
+r_8 m,e2;
+if(mBins>0) for(int_4 i=0;i<mBins;i++) {
   if(SumW[i]<=0.) {
     m = e2 = 0.;
@@ -139,6 +157,6 @@
     if(Opt) e2 /= SumW[i];
   }
-  data[i] = m;
-  err2[i] = e2;
+  mData[i] = m;
+  mErr2[i] = e2;
 }
 Ok = true;
@@ -153,10 +171,10 @@
   Addition au contenu de l'histo pour abscisse x de la valeur y et poids w
 */
-void HProf::Add(float x, float y, float w)
+void HProf::Add(r_8 x, r_8 y, r_8 w)
 {
   if(YMax>YMin && (y<YMin || YMax<y)) return;
-  int numBin = FindBin(x);
-  if (numBin<0) under += w;
-  else if (numBin>=bins) over += w;
+  int_4 numBin = FindBin(x);
+  if (numBin<0) mUnder += w;
+  else if (numBin>=mBins) mOver += w;
   else {
     Ok = false;
@@ -173,9 +191,9 @@
   Addition au contenu de l'histo bin numBin de la valeur y poids w
 */
-void HProf::AddBin(int numBin, float y, float w)
+void HProf::AddBin(int_4 numBin, r_8 y, r_8 w)
 {
   if(YMax>YMin && (y<YMin || YMax<y)) return;
-  if (numBin<0) under += w;
-  else if (numBin>=bins) over += w;
+  if (numBin<0) mUnder += w;
+  else if (numBin>=mBins) mOver += w;
   else {
     Ok = false;
@@ -195,13 +213,13 @@
 {
 if(this == &h) return *this;
-if( h.bins > bins ) Delete();
+if( h.mBins > mBins ) Delete();
 Histo *hthis = (Histo *) this;
 *hthis = (Histo) h;
-if(!SumY)  SumY  = new double[bins];
-if(!SumY2) SumY2 = new double[bins];
-if(!SumW)  SumW  = new double[bins];
-memcpy(SumY,  h.SumY,  bins*sizeof(double));
-memcpy(SumY2, h.SumY2, bins*sizeof(double));
-memcpy(SumW,  h.SumW,  bins*sizeof(double));
+if(!SumY)  SumY  = new r_8[mBins];
+if(!SumY2) SumY2 = new r_8[mBins];
+if(!SumW)  SumW  = new r_8[mBins];
+memcpy(SumY,  h.SumY,  mBins*sizeof(r_8));
+memcpy(SumY2, h.SumY2, mBins*sizeof(r_8));
+memcpy(SumW,  h.SumW,  mBins*sizeof(r_8));
 Ok = h.Ok;
 YMin = h.YMin;
@@ -222,8 +240,8 @@
 HProf& HProf::operator += (const HProf& a)
 {
-if(bins!=a.bins) THROW(sizeMismatchErr);
+if(mBins!=a.mBins) THROW(sizeMismatchErr);
 Histo *hthis = (Histo *) this;
 *hthis += (Histo) a;
-if(bins>0) for(int i=0;i<bins;i++) {
+if(mBins>0) for(int_4 i=0;i<mBins;i++) {
   SumY[i]  += a.SumY[i];
   SumY2[i] += a.SumY2[i];
@@ -239,7 +257,7 @@
   Pour rebinner l'histogramme de profile sur nbinew bins
 */
-void HProf::HRebin(int nbinew)
-{
-  if( bins <= 0 ) return; // createur par default
+void HProf::HRebin(int_4 nbinew)
+{
+  if( mBins <= 0 ) return; // createur par default
   if( nbinew <= 0 ) return;
 
@@ -248,23 +266,23 @@
 
   // Rebin de la partie Histo
-  int binold = bins;
+  int_4 binold = mBins;
   Histo::HRebin(nbinew);
 
   // Le nombre de bins est il plus grand ??
-  if( bins > binold ) {
-    delete [] SumY;  SumY  = new double[nbinew]; memset(SumY, 0,bins*sizeof(double));
-    delete [] SumY2; SumY2 = new double[nbinew]; memset(SumY2,0,bins*sizeof(double));
-    delete [] SumW;  SumW  = new double[nbinew]; memset(SumW, 0,bins*sizeof(double));
+  if( mBins > binold ) {
+    delete [] SumY;  SumY  = new r_8[nbinew]; memset(SumY, 0,mBins*sizeof(r_8));
+    delete [] SumY2; SumY2 = new r_8[nbinew]; memset(SumY2,0,mBins*sizeof(r_8));
+    delete [] SumW;  SumW  = new r_8[nbinew]; memset(SumW, 0,mBins*sizeof(r_8));
   }
 
   // Remplissage des parties propres au HPprof
-  for(int i=0;i<bins;i++) {
-    float xmi = BinLowEdge(i);
-    float xma = BinHighEdge(i);
-    int imi =  H.FindBin(xmi);
+  for(int_4 i=0;i<mBins;i++) {
+    r_8 xmi = BinLowEdge(i);
+    r_8 xma = BinHighEdge(i);
+    int_4 imi =  H.FindBin(xmi);
     if( imi < 0 ) imi = 0;
-    int ima =  H.FindBin(xma);
-    if( ima >= H.bins ) ima = H.bins-1;
-    double wY = 0., wY2 = 0., wW = 0.;
+    int_4 ima =  H.FindBin(xma);
+    if( ima >= H.mBins ) ima = H.mBins-1;
+    r_8 wY = 0., wY2 = 0., wW = 0.;
     if( ima == imi ) {
       wY  = H.SumY[imi]  * binWidth/H.binWidth;
@@ -278,5 +296,5 @@
       wW  += H.SumW[imi]  * (H.BinHighEdge(imi)-xmi)/H.binWidth;
       wW  += H.SumW[ima]  * (xma -H.BinLowEdge(ima))/H.binWidth;
-      if(ima>imi+1) for(int ii=imi+1;ii<ima;ii++)
+      if(ima>imi+1) for(int_4 ii=imi+1;ii<ima;ii++)
 	{wY += H.SumY[ii]; wY2 += H.SumY2[ii]; wW += H.SumW[ii];}
     }
@@ -305,5 +323,5 @@
 
 // Lecture des valeurs
-is.Get(dobj->bins);
+is.Get(dobj->mBins);
 is.Get(dobj->YMin);
 is.Get(dobj->YMax);
@@ -313,10 +331,10 @@
 // Lecture des donnees propres a l'histogramme de profil.
 is.GetLine(strg,255);
-dobj->SumY  = new double[dobj->bins];
-dobj->SumY2 = new double[dobj->bins];
-dobj->SumW  = new double[dobj->bins];
-is.Get(dobj->SumY,  dobj->bins);
-is.Get(dobj->SumY2, dobj->bins);
-is.Get(dobj->SumW,  dobj->bins);
+dobj->SumY  = new r_8[dobj->mBins];
+dobj->SumY2 = new r_8[dobj->mBins];
+dobj->SumW  = new r_8[dobj->mBins];
+is.Get(dobj->SumY,  dobj->mBins);
+is.Get(dobj->SumY2, dobj->mBins);
+is.Get(dobj->SumW,  dobj->mBins);
 
 // Lecture de l'histogramme
@@ -337,5 +355,5 @@
 
 // Ecriture des valeurs
-os.Put(dobj->bins);
+os.Put(dobj->mBins);
 os.Put(dobj->YMin);
 os.Put(dobj->YMax);
@@ -345,7 +363,7 @@
 sprintf(strg,"HProf: SumY SumY2 SumW");
 os.PutLine(strg);
-os.Put(dobj->SumY,  dobj->bins);
-os.Put(dobj->SumY2, dobj->bins);
-os.Put(dobj->SumW,  dobj->bins);
+os.Put(dobj->SumY,  dobj->mBins);
+os.Put(dobj->SumY2, dobj->mBins);
+os.Put(dobj->SumW,  dobj->mBins);
 
 // Ecriture de l'histogramme
Index: trunk/SophyaLib/HiStats/hisprof.h
===================================================================
--- trunk/SophyaLib/HiStats/hisprof.h	(revision 1089)
+++ trunk/SophyaLib/HiStats/hisprof.h	(revision 1092)
@@ -17,5 +17,6 @@
   // CREATOR / DESTRUCTOR
   HProf();
-  HProf(float xMin, float xMax, int nBin=100, float yMin=1., float yMax=-1.);
+  HProf(r_8 xMin, r_8 xMax, int_4 nBin=100, r_8 yMin=1., r_8 yMax=-1.);
+  HProf(r_4 xMin, r_4 xMax, int_4 nBin=100, r_4 yMin=1., r_4 yMax=-1.);
   HProf(const HProf& H);
   virtual ~HProf();
@@ -27,6 +28,6 @@
   void SetErrOpt(bool spread = true);
   void Zero();
-  void Add(float x, float y, float w = 1.);
-  void AddBin(int numBin, float y, float w = 1.);
+  void Add(r_8 x, r_8 y, r_8 w = 1.);
+  void AddBin(int_4 numBin, r_8 y, r_8 w = 1.);
   
   // Acces a l information
@@ -44,13 +45,13 @@
               {UpdateHisto(); Histo::GetError(v);}
   //! Retourne le contenu du bin i
-  inline float operator()(int i) const
-               {UpdateHisto(); return data[i];}
+  inline r_8 operator()(int_4 i) const
+               {UpdateHisto(); return mData[i];}
   //! Retourne le carre de la dispersion/erreur du bin i
-  inline double Error2(int i) const
-                {UpdateHisto(); return (float) err2[i];}
+  inline r_8 Error2(int_4 i) const
+                {UpdateHisto(); return mErr2[i];}
   //! Retourne la dispersion/erreur du bin i
-  inline float Error(int i) const
+  inline r_8 Error(int_4 i) const
                {UpdateHisto();
-                return (err2[i]>0.) ? (float) sqrt(err2[i]) : 0.f;}
+                return (mErr2[i]>0.) ? sqrt(mErr2[i]) : 0.;}
 
   // Operators
@@ -59,9 +60,9 @@
 
   // Info, statistique et calculs sur les histogrammes
-  virtual void HRebin(int nbinew);
+  virtual void HRebin(int_4 nbinew);
 
   // Fit
   //! Fit du profile par ``gfit''.
-  inline int Fit(GeneralFit& gfit)
+  inline int_4 Fit(GeneralFit& gfit)
          {UpdateHisto(); return Histo::Fit(gfit,0);}
   //! Retourne l'Histogramme des residus par ``gfit''.
@@ -74,10 +75,10 @@
   // Print
   //! Print, voir detail dans Histo::Print
-  inline void Print(int dyn=100,float hmin=1.,float hmax=-1.
-                   ,int pflag=0,int il=1,int ih=-1)
+  inline void Print(int_4 dyn=100,r_8 hmin=1.,r_8 hmax=-1.
+                   ,int_4 pflag=0,int_4 il=1,int_4 ih=-1)
          {UpdateHisto(); Histo::Print(dyn,hmin,hmax,pflag,il,ih);}
   //! PrintF, voir detail dans Histo::PrintF
-  inline void PrintF(FILE * fp,int dyn=100,float hmin=1.,float hmax=-1.
-                    ,int pflag=0,int il=1,int ih=-1)
+  inline void PrintF(FILE * fp,int_4 dyn=100,r_8 hmin=1.,r_8 hmax=-1.
+                    ,int_4 pflag=0,int_4 il=1,int_4 ih=-1)
          {UpdateHisto(); Histo::PrintF(fp,dyn,hmin,hmax,pflag,il,ih);}
 
@@ -86,11 +87,11 @@
   void updatehisto() const;
 
-  double*        SumY;  //!< somme
-  double*        SumY2; //!< somme des carres
-  double*        SumW;  //!< somme des poids
-  mutable bool   Ok;    //!< true if update fait
-  float          YMin;  //!< limite minimum Y pour somme
-  float          YMax;  //!< limite maximum Y pour somme
-  uint_2         Opt;   //!< options pour les erreurs
+  r_8*         SumY;  //!< somme
+  r_8*         SumY2; //!< somme des carres
+  r_8*         SumW;  //!< somme des poids
+  mutable bool Ok;    //!< true if update fait
+  r_8          YMin;  //!< limite minimum Y pour somme
+  r_8          YMax;  //!< limite maximum Y pour somme
+  uint_2       Opt;   //!< options pour les erreurs
 };
 
Index: trunk/SophyaLib/HiStats/histos.cc
===================================================================
--- trunk/SophyaLib/HiStats/histos.cc	(revision 1089)
+++ trunk/SophyaLib/HiStats/histos.cc	(revision 1092)
@@ -1,4 +1,4 @@
 //
-// $Id: histos.cc,v 1.9 2000-07-11 18:57:25 ansari Exp $
+// $Id: histos.cc,v 1.10 2000-07-26 13:15:15 ansari Exp $
 //
 
@@ -22,7 +22,7 @@
 /*! Constructeur par defaut */
 Histo::Histo()
-: data(NULL), err2(NULL),
-  under(0), over(0), nHist(0), nEntries(0),
-  bins(0), min(0), max(0),
+: mData(NULL), mErr2(NULL),
+  mUnder(0), mOver(0), nHist(0), nEntries(0),
+  mBins(0), mMin(0), mMax(0),
   binWidth(0)
 {
@@ -32,9 +32,10 @@
 /********* Methode *********/
 /*! Constructeur d'un histo de nBin bins allant de xMin a xMax */
-Histo::Histo(float xMin, float xMax, int nBin)
-: data(new float[nBin]), err2(NULL),
-  under(0), over(0), nHist(0), nEntries(0),
-  bins(nBin), min(xMin), max(xMax),
-  binWidth((max - min)/nBin)
+Histo::Histo(r_8 xMin, r_8 xMax, int_4 nBin)
+: mData((nBin>0) ? new r_8[nBin] : NULL),
+  mErr2(NULL),
+  mUnder(0), mOver(0), nHist(0), nEntries(0),
+  mBins(nBin), mMin(xMin), mMax(xMax),
+  binWidth((nBin>0) ? (mMax-mMin)/nBin : 0)
 {
   Zero();
@@ -43,17 +44,30 @@
 
 /********* Methode *********/
+/*! Constructeur d'un histo de nBin bins allant de xMin a xMax */
+Histo::Histo(r_4 xMin, r_4 xMax, int_4 nBin)
+: mData((nBin>0) ? new r_8[nBin] : NULL),
+  mErr2(NULL),
+  mUnder(0), mOver(0), nHist(0), nEntries(0),
+  mBins(nBin), mMin((r_8)xMin), mMax((r_8)xMax),
+  binWidth((nBin>0) ? (mMax-mMin)/nBin : 0)
+{
+  Zero();
+  END_CONSTRUCTOR
+}
+
+/********* Methode *********/
 /*! Constructeur par copie */
 Histo::Histo(const Histo& H)
-: data((H.bins>0)? new float[H.bins] : NULL),
-  err2(NULL),
-  under(H.under), over(H.over), nHist(H.nHist), nEntries(H.nEntries),
-  bins(H.bins), min(H.min), max(H.max),
+: mData((H.mBins>0)? new r_8[H.mBins] : NULL),
+  mErr2(NULL),
+  mUnder(H.mUnder), mOver(H.mOver), nHist(H.nHist), nEntries(H.nEntries),
+  mBins(H.mBins), mMin(H.mMin), mMax(H.mMax),
   binWidth(H.binWidth)
 {
-  if(bins>0) {
-    memcpy(data, H.data, bins*sizeof(float));
-    if( H.err2 != NULL ) {
-      err2 = new double[bins];
-      memcpy(err2, H.err2, bins*sizeof(double));
+  if(mBins>0) {
+    memcpy(mData, H.mData, mBins*sizeof(r_8));
+    if( H.mErr2 != NULL ) {
+      mErr2 = new r_8[mBins];
+      memcpy(mErr2, H.mErr2, mBins*sizeof(r_8));
     }
   }
@@ -65,9 +79,9 @@
 void Histo::Delete()
 {
-  if( data != NULL ) { delete[] data; data = NULL;}
-  if( err2 != NULL ) { delete[] err2; err2 = NULL;}
-  under = over = min = max = binWidth= 0.;
+  if( mData != NULL ) { delete[] mData; mData = NULL;}
+  if( mErr2 != NULL ) { delete[] mErr2; mErr2 = NULL;}
+  mUnder = mOver = mMin = mMax = binWidth= 0.;
   nHist = 0.;
-  nEntries = bins = 0;
+  nEntries = mBins = 0;
 }
 
@@ -85,10 +99,10 @@
 void Histo::Zero()
 {
-  if(bins<=0) return;
-  memset(data, 0, bins*sizeof(float));
-  under = over = 0;
+  if(mBins<=0) return;
+  memset(mData, 0, mBins*sizeof(r_8));
+  mUnder = mOver = 0;
   nHist = 0;
   nEntries = 0;
-  if( err2 != NULL ) memset(err2, 0, bins*sizeof(double));
+  if( mErr2 != NULL ) memset(mErr2, 0, mBins*sizeof(r_8));
 }
 
@@ -99,7 +113,7 @@
 void Histo::Errors()
 {
- if(bins<=0) return;
- if(err2==NULL) err2 = new double[bins];
- memset(err2, 0, bins*sizeof(double));
+ if(mBins<=0) return;
+ if(mErr2==NULL) mErr2 = new r_8[mBins];
+ memset(mErr2, 0, mBins*sizeof(r_8));
 }
 
@@ -111,21 +125,21 @@
 {
   if(this == &h) return *this;
-  if( h.bins <= 0 ) {Delete(); return *this;}
-  if( h.bins > bins ) Delete();
-  if(!h.err2 && err2 ) { delete [] err2; err2=NULL;}
-  if(!data) data = new float[h.bins];
-  if(h.err2 && !err2 ) err2 = new double[h.bins];
-
-  under = h.under;
-  over = h.over;
+  if( h.mBins <= 0 ) {Delete(); return *this;}
+  if( h.mBins > mBins ) Delete();
+  if(!h.mErr2 && mErr2 ) { delete [] mErr2; mErr2=NULL;}
+  if(!mData) mData = new r_8[h.mBins];
+  if(h.mErr2 && !mErr2 ) mErr2 = new r_8[h.mBins];
+
+  mUnder = h.mUnder;
+  mOver = h.mOver;
   nHist = h.nHist;
   nEntries = h.nEntries;
-  bins = h.bins;
-  min = h.min;
-  max = h.max;
+  mBins = h.mBins;
+  mMin = h.mMin;
+  mMax = h.mMax;
   binWidth = h.binWidth;
   
-  memcpy(data, h.data, bins*sizeof(float));
-  if(err2) memcpy(err2, h.err2, bins*sizeof(double));
+  memcpy(mData, h.mData, mBins*sizeof(r_8));
+  if(mErr2) memcpy(mErr2, h.mErr2, mBins*sizeof(r_8));
 
   return *this;
@@ -136,13 +150,13 @@
   Operateur de multiplication par une constante
 */
-Histo& Histo::operator *= (double b)
-{
-double b2 = b*b;
-for(int i=0;i<bins;i++) {
-  data[i] *= b;
-  if(err2) err2[i] *= b2;
-}
-under *= b;
-over *= b;
+Histo& Histo::operator *= (r_8 b)
+{
+r_8 b2 = b*b;
+for(int_4 i=0;i<mBins;i++) {
+  mData[i] *= b;
+  if(mErr2) mErr2[i] *= b2;
+}
+mUnder *= b;
+mOver *= b;
 nHist *= b;
 
@@ -153,14 +167,14 @@
   Operateur de division par une constante
 */
-Histo& Histo::operator /= (double b)
+Histo& Histo::operator /= (r_8 b)
 {
 if (b==0.) THROW(inconsistentErr);
-double b2 = b*b;
-for(int i=0;i<bins;i++) {
-  data[i] /= b;
-  if(err2) err2[i] /= b2;
-}
-under /= b;
-over /= b;
+r_8 b2 = b*b;
+for(int_4 i=0;i<mBins;i++) {
+  mData[i] /= b;
+  if(mErr2) mErr2[i] /= b2;
+}
+mUnder /= b;
+mOver /= b;
 nHist /= b;
 
@@ -171,10 +185,10 @@
   Operateur d'addition d'une constante
 */
-Histo& Histo::operator += (double b)
-{
-for(int i=0;i<bins;i++) data[i] += b;
-under += b;
-over += b;
-nHist += bins*b;
+Histo& Histo::operator += (r_8 b)
+{
+for(int_4 i=0;i<mBins;i++) mData[i] += b;
+mUnder += b;
+mOver += b;
+nHist += mBins*b;
 
 return *this;
@@ -184,10 +198,10 @@
   Operateur de soustraction d'une constante
 */
-Histo& Histo::operator -= (double b)
-{
-for(int i=0;i<bins;i++) data[i] -= b;
-under -= b;
-over -= b;
-nHist -= bins*b;
+Histo& Histo::operator -= (r_8 b)
+{
+for(int_4 i=0;i<mBins;i++) mData[i] -= b;
+mUnder -= b;
+mOver -= b;
+nHist -= mBins*b;
 
 return *this;
@@ -200,11 +214,11 @@
 Histo& Histo::operator += (const Histo& a)
 {
-if(bins!=a.bins) THROW(sizeMismatchErr);
-for(int i=0;i<bins;i++) {
-  data[i] += a(i);
-  if(err2 && a.err2) err2[i] += a.Error2(i);
-}
-under += a.under;
-over += a.over;
+if(mBins!=a.mBins) THROW(sizeMismatchErr);
+for(int_4 i=0;i<mBins;i++) {
+  mData[i] += a(i);
+  if(mErr2 && a.mErr2) mErr2[i] += a.Error2(i);
+}
+mUnder += a.mUnder;
+mOver += a.mOver;
 nHist += a.nHist;
 nEntries += a.nEntries;
@@ -218,11 +232,11 @@
 Histo& Histo::operator -= (const Histo& a)
 {
-if(bins!=a.bins) THROW(sizeMismatchErr);
-for(int i=0;i<bins;i++) {
-  data[i] -= a(i);
-  if(err2 && a.err2) err2[i] += a.Error2(i);
-}
-under -= a.under;
-over -= a.over;
+if(mBins!=a.mBins) THROW(sizeMismatchErr);
+for(int_4 i=0;i<mBins;i++) {
+  mData[i] -= a(i);
+  if(mErr2 && a.mErr2) mErr2[i] += a.Error2(i);
+}
+mUnder -= a.mUnder;
+mOver -= a.mOver;
 nHist -= a.nHist;
 nEntries += a.nEntries;
@@ -236,14 +250,14 @@
 Histo& Histo::operator *= (const Histo& a)
 {
-if(bins!=a.bins) THROW(sizeMismatchErr);
+if(mBins!=a.mBins) THROW(sizeMismatchErr);
 nHist = 0.;
-for(int i=0;i<bins;i++) {
-  if(err2 && a.err2)
-      err2[i] = a(i)*a(i)*err2[i] + data[i]*data[i]*a.Error2(i);
-  data[i] *= a(i);
-  nHist += data[i];
-}
-under *= a.under;
-over *= a.over;
+for(int_4 i=0;i<mBins;i++) {
+  if(mErr2 && a.mErr2)
+      mErr2[i] = a(i)*a(i)*mErr2[i] + mData[i]*mData[i]*a.Error2(i);
+  mData[i] *= a(i);
+  nHist += mData[i];
+}
+mUnder *= a.mUnder;
+mOver *= a.mOver;
 nEntries += a.nEntries;
 
@@ -256,20 +270,20 @@
 Histo& Histo::operator /= (const Histo& a)
 {
-if(bins!=a.bins) THROW(sizeMismatchErr);
+if(mBins!=a.mBins) THROW(sizeMismatchErr);
 nHist = 0.;
-for(int i=0;i<bins;i++) {
+for(int_4 i=0;i<mBins;i++) {
   if(a(i)==0.) {
-    data[i]=0.;
-    if(err2) err2[i]=0.;
+    mData[i]=0.;
+    if(mErr2) mErr2[i]=0.;
     continue;
   }
-  if(err2 && a.err2)
-      err2[i] = (err2[i] + data[i]/a(i)*data[i]/a(i)*a.Error2(i))
+  if(mErr2 && a.mErr2)
+      mErr2[i] = (mErr2[i] + mData[i]/a(i)*mData[i]/a(i)*a.Error2(i))
                 /(a(i)*a(i));
-  data[i] /= a(i);
-  nHist += data[i];
-}
-if(a.under!=0.) under /= a.under; else under = 0.;
-if(a.over!=0.)  over  /= a.over;  else over  = 0.;
+  mData[i] /= a(i);
+  nHist += mData[i];
+}
+if(a.mUnder!=0.) mUnder /= a.mUnder; else mUnder = 0.;
+if(a.mOver!=0.)  mOver  /= a.mOver;  else mOver  = 0.;
 nEntries += a.nEntries;
 
@@ -283,6 +297,6 @@
 void Histo::GetAbsc(TVector<r_8> &v)
 {
-v.Realloc(bins);
-for(int i=0;i<bins;i++) v(i) = BinLowEdge(i);
+v.Realloc(mBins);
+for(int_4 i=0;i<mBins;i++) v(i) = BinLowEdge(i);
 return;
 }
@@ -293,6 +307,6 @@
 void Histo::GetValue(TVector<r_8> &v)
 {
-v.Realloc(bins);
-for(int i=0;i<bins;i++) v(i) = data[i];
+v.Realloc(mBins);
+for(int_4 i=0;i<mBins;i++) v(i) = mData[i];
 return;
 }
@@ -303,7 +317,7 @@
 void Histo::GetError2(TVector<r_8> &v)
 {
-v.Realloc(bins);
-if(!err2) {for(int i=0;i<bins;i++) v(i) = 0.; return;}
-for(int i=0;i<bins;i++) v(i) = err2[i];
+v.Realloc(mBins);
+if(!mErr2) {for(int_4 i=0;i<mBins;i++) v(i) = 0.; return;}
+for(int_4 i=0;i<mBins;i++) v(i) = mErr2[i];
 return;
 }
@@ -314,7 +328,7 @@
 void Histo::GetError(TVector<r_8> &v)
 {
-v.Realloc(bins);
-if(!err2) {for(int i=0;i<bins;i++) v(i) = 0.; return;}
-for(int i=0;i<bins;i++) v(i) = Error(i);
+v.Realloc(mBins);
+if(!mErr2) {for(int_4 i=0;i<mBins;i++) v(i) = 0.; return;}
+for(int_4 i=0;i<mBins;i++) v(i) = Error(i);
 return;
 }
@@ -324,11 +338,11 @@
   Remplissage du contenu de l'histo avec les valeurs d'un vecteur
 */
-void Histo::PutValue(TVector<r_8> &v, int ierr)
-{
-//if(v.NElts()<(uint_4) bins) THROW(sizeMismatchErr);
-uint_4 n = (v.NElts()<(uint_4) bins) ? v.NElts(): (uint_4) bins;
-if(n>0) for(int i=0;i<n;i++) {
-  data[i] = v(i);
-  if(err2&&ierr) err2[i] = fabs(v(i));
+void Histo::PutValue(TVector<r_8> &v, int_4 ierr)
+{
+//if(v.NElts()<(uint_4) mBins) THROW(sizeMismatchErr);
+uint_4 n = (v.NElts()<(uint_4) mBins) ? v.NElts(): (uint_4) mBins;
+if(n>0) for(uint_4 i=0;i<n;i++) {
+  mData[i] = v(i);
+  if(mErr2&&ierr) mErr2[i] = fabs(v(i));
 }
 return;
@@ -338,11 +352,11 @@
   Addition du contenu de l'histo avec les valeurs d'un vecteur
 */
-void Histo::PutValueAdd(TVector<r_8> &v, int ierr)
-{
-//if(v.NElts()<(uint_4) bins) THROW(sizeMismatchErr);
-uint_4 n = (v.NElts()<(uint_4) bins) ? v.NElts(): (uint_4) bins;
-if(n>0) for(int i=0;i<n;i++) {
-  data[i] += v(i);
-  if(err2 && ierr) err2[i] += fabs(v(i));
+void Histo::PutValueAdd(TVector<r_8> &v, int_4 ierr)
+{
+//if(v.NElts()<(uint_4) mBins) THROW(sizeMismatchErr);
+uint_4 n = (v.NElts()<(uint_4) mBins) ? v.NElts(): (uint_4) mBins;
+if(n>0) for(uint_4 i=0;i<n;i++) {
+  mData[i] += v(i);
+  if(mErr2 && ierr) mErr2[i] += fabs(v(i));
 }
 return;
@@ -354,9 +368,9 @@
 void Histo::PutError2(TVector<r_8> &v)
 {
-//if(v.NElts()<(uint_4) bins) THROW(sizeMismatchErr);
-uint_4 n = (v.NElts()<(uint_4) bins) ? v.NElts(): (uint_4) bins;
+//if(v.NElts()<(uint_4) mBins) THROW(sizeMismatchErr);
+uint_4 n = (v.NElts()<(uint_4) mBins) ? v.NElts(): (uint_4) mBins;
 if(n>0) {
-  if(!err2) Errors();
-  for(int i=0;i<n;i++) err2[i] = v(i);
+  if(!mErr2) Errors();
+  for(uint_4 i=0;i<n;i++) mErr2[i] = v(i);
 }
 return;
@@ -368,9 +382,9 @@
 void Histo::PutError2Add(TVector<r_8> &v)
 {
-//if(v.NElts()<(uint_4) bins) THROW(sizeMismatchErr);
-uint_4 n = (v.NElts()<(uint_4) bins) ? v.NElts(): (uint_4) bins;
+//if(v.NElts()<(uint_4) mBins) THROW(sizeMismatchErr);
+uint_4 n = (v.NElts()<(uint_4) mBins) ? v.NElts(): (uint_4) mBins;
 if(n>0) {
-  if(!err2) Errors();
-  for(int i=0;i<n;i++) if(v(i)>0.) err2[i] += v(i);
+  if(!mErr2) Errors();
+  for(uint_4 i=0;i<n;i++) if(v(i)>0.) mErr2[i] += v(i);
 }
 return;
@@ -382,10 +396,10 @@
 void Histo::PutError(TVector<r_8> &v)
 {
-//if(v.NElts()<(uint_4) bins) THROW(sizeMismatchErr);
-uint_4 n = (v.NElts()<(uint_4) bins) ? v.NElts(): (uint_4) bins;
+//if(v.NElts()<(uint_4) mBins) THROW(sizeMismatchErr);
+uint_4 n = (v.NElts()<(uint_4) mBins) ? v.NElts(): (uint_4) mBins;
 if(n>0) {
-  if(!err2) Errors();
-  for(int i=0;i<n;i++)
-    if(v(i)>0.) err2[i]=v(i)*v(i); else err2[i]=-v(i)*v(i);
+  if(!mErr2) Errors();
+  for(uint_4 i=0;i<n;i++)
+    if(v(i)>0.) mErr2[i]=v(i)*v(i); else mErr2[i]=-v(i)*v(i);
 }
 return;
@@ -396,12 +410,12 @@
   Addition du contenu de l'histo pour abscisse x poids w
 */
-void Histo::Add(float x, float w)
-{
-  int numBin = FindBin(x);
-  if (numBin<0) under += w;
-  else if (numBin>=bins) over += w;
+void Histo::Add(r_8 x, r_8 w)
+{
+  int_4 numBin = FindBin(x);
+  if (numBin<0) mUnder += w;
+  else if (numBin>=mBins) mOver += w;
   else {
-    data[numBin] += w;
-    if(err2!=NULL) err2[numBin] += w*w;
+    mData[numBin] += w;
+    if(mErr2!=NULL) mErr2[numBin] += w*w;
     nHist += w;
     nEntries++;
@@ -413,11 +427,11 @@
   Addition du contenu de l'histo bin numBin poids w
 */
-void Histo::AddBin(int numBin, float w)
-{
-  if (numBin<0) under += w;
-  else if (numBin>=bins) over += w;
+void Histo::AddBin(int_4 numBin, r_8 w)
+{
+  if (numBin<0) mUnder += w;
+  else if (numBin>=mBins) mOver += w;
   else {
-    data[numBin] += w;
-    if(err2!=NULL) err2[numBin] += w*w;
+    mData[numBin] += w;
+    if(mErr2!=NULL) mErr2[numBin] += w*w;
     nHist += w;
     nEntries++;
@@ -429,7 +443,7 @@
   Remplissage du contenu de l'histo pour abscisse x poids w
 */
-void Histo::SetBin(float x, float w)
-{
-  int numBin = FindBin(x);
+void Histo::SetBin(r_8 x, r_8 w)
+{
+  int_4 numBin = FindBin(x);
   SetBin(numBin,w);
 }
@@ -439,11 +453,11 @@
   Remplissage du contenu de l'histo pour numBin poids w
 */
-void Histo::SetBin(int numBin, float w)
-{
-  if (numBin<0) under = w;
-  else if (numBin>=bins) over = w;
+void Histo::SetBin(int_4 numBin, r_8 w)
+{
+  if (numBin<0) mUnder = w;
+  else if (numBin>=mBins) mOver = w;
   else {
-    nHist -= data[numBin];
-    data[numBin] = w;
+    nHist -= mData[numBin];
+    mData[numBin] = w;
     nHist += w;
   }
@@ -454,7 +468,7 @@
   Remplissage des erreurs au carre pour abscisse x
 */
-void Histo::SetErr2(float x, double e2)
-{
-  int numBin = FindBin(x);
+void Histo::SetErr2(r_8 x, r_8 e2)
+{
+  int_4 numBin = FindBin(x);
   SetErr2(numBin,e2);
 }
@@ -464,9 +478,9 @@
   Remplissage des erreurs au carre pour numBin poids
 */
-void Histo::SetErr2(int numBin, double e2)
-{
-  if( err2==NULL) return;
-  if ( numBin<0 || numBin>=bins ) return;
-  err2[numBin] = e2;
+void Histo::SetErr2(int_4 numBin, r_8 e2)
+{
+  if( mErr2==NULL) return;
+  if ( numBin<0 || numBin>=mBins ) return;
+  mErr2[numBin] = e2;
 }
 
@@ -475,7 +489,7 @@
   Remplissage des erreurs pour abscisse x
 */
-void Histo::SetErr(float x, float e)
-{
-SetErr2(x, (double) e*e);
+void Histo::SetErr(r_8 x, r_8 e)
+{
+SetErr2(x,  e*e);
 }
 
@@ -484,7 +498,7 @@
   Remplissage des erreurs pour numBin
 */
-void Histo::SetErr(int numBin, float e)
-{
-SetErr2(numBin, (double) e*e);
+void Histo::SetErr(int_4 numBin, r_8 e)
+{
+SetErr2(numBin,  e*e);
 }
 
@@ -493,11 +507,11 @@
   Numero du bin ayant le contenu maximum
 */
-int Histo::IMax() const
-{
-  int imx=0;
-  if(bins==1) return imx;
-  float mx=data[0];
-  for (int i=1; i<bins; i++)
-    if (data[i]>mx) {imx = i; mx=data[i];}
+int_4 Histo::IMax() const
+{
+  int_4 imx=0;
+  if(mBins==1) return imx;
+  r_8 mx=mData[0];
+  for (int_4 i=1; i<mBins; i++)
+    if (mData[i]>mx) {imx = i; mx=mData[i];}
   return imx;
 }
@@ -507,11 +521,11 @@
   Numero du bin ayant le contenu minimum
 */
-int Histo::IMin() const
-{
-  int imx=0;
-  if(bins==1) return imx;
-  float mx=data[0];
-  for (int i=1; i<bins; i++)
-    if (data[i]<mx) {imx = i; mx=data[i];}
+int_4 Histo::IMin() const
+{
+  int_4 imx=0;
+  if(mBins==1) return imx;
+  r_8 mx=mData[0];
+  for (int_4 i=1; i<mBins; i++)
+    if (mData[i]<mx) {imx = i; mx=mData[i];}
   return imx;
 }
@@ -521,9 +535,9 @@
   Valeur le contenu maximum
 */
-float Histo::VMax() const
-{
-  float mx=data[0];
-  if(bins==1) return mx;
-  for (int i=1;i<bins;i++) if(data[i]>mx) mx=data[i];
+r_8 Histo::VMax() const
+{
+  r_8 mx=mData[0];
+  if(mBins==1) return mx;
+  for (int_4 i=1;i<mBins;i++) if(mData[i]>mx) mx=mData[i];
   return mx;
 }
@@ -533,9 +547,9 @@
   Valeur le contenu minimum
 */
-float Histo::VMin() const
-{
-  float mx=data[0];
-  if(bins==1) return mx;
-  for (int i=1;i<bins;i++) if(data[i]<mx) mx=data[i];
+r_8 Histo::VMin() const
+{
+  r_8 mx=mData[0];
+  if(mBins==1) return mx;
+  for (int_4 i=1;i<mBins;i++) if(mData[i]<mx) mx=mData[i];
   return mx;
 }
@@ -545,14 +559,14 @@
   Valeur moyenne
 */
-float Histo::Mean() const
-{
-  double n = 0;
-  double sx = 0;
-  for (int i=0; i<bins; i++) {
-    double v = (data[i]>=0.) ? data[i] : -data[i];
+r_8 Histo::Mean() const
+{
+  r_8 n = 0;
+  r_8 sx = 0;
+  for (int_4 i=0; i<mBins; i++) {
+    r_8 v = (mData[i]>=0.) ? mData[i] : -mData[i];
     n += v;
     sx += BinCenter(i)*v;
   }
-  if(n>0.) return sx/n; else return min;
+  if(n>0.) return sx/n; else return mMin;
 }
 
@@ -561,11 +575,11 @@
   Valeur du sigma
 */
-float Histo::Sigma() const
-{
-  double n = 0;
-  double sx = 0;
-  double sx2= 0;
-  for (int i=0; i<bins; i++) {
-    double v = (data[i]>=0.) ? data[i] : -data[i];
+r_8 Histo::Sigma() const
+{
+  r_8 n = 0;
+  r_8 sx = 0;
+  r_8 sx2= 0;
+  for (int_4 i=0; i<mBins; i++) {
+    r_8 v = (mData[i]>=0.) ? mData[i] : -mData[i];
     n += v;
     sx += BinCenter(i)*v;
@@ -583,13 +597,13 @@
   Valeur de la moyenne calculee entre les bin il et ih
 */
-float Histo::MeanLH(int il,int ih) const
-{
-  if( ih < il ) { il = 0; ih = bins-1; }
+r_8 Histo::MeanLH(int_4 il,int_4 ih) const
+{
+  if( ih < il ) { il = 0; ih = mBins-1; }
   if( il < 0 ) il = 0;
-  if( ih >= bins ) ih = bins-1;
-  double n = 0;
-  double sx = 0;
-  for (int i=il; i<=ih; i++) {
-    double v = (data[i]>=0.) ? data[i] : -data[i];
+  if( ih >= mBins ) ih = mBins-1;
+  r_8 n = 0;
+  r_8 sx = 0;
+  for (int_4 i=il; i<=ih; i++) {
+    r_8 v = (mData[i]>=0.) ? mData[i] : -mData[i];
     n += v;
     sx += BinCenter(i)*v;
@@ -602,14 +616,14 @@
   Valeur de la moyenne calculee entre les bin il et ih
 */
-float Histo::SigmaLH(int il,int ih) const
-{
-  if( ih < il ) { il = 0; ih = bins - 1; }
+r_8 Histo::SigmaLH(int_4 il,int_4 ih) const
+{
+  if( ih < il ) { il = 0; ih = mBins - 1; }
   if( il < 0 ) il = 0;
-  if( ih >= bins ) ih = bins - 1;
-  double n = 0;
-  double sx = 0;
-  double sx2= 0;
-  for (int i=il; i<=ih; i++) {
-    double v = (data[i]>=0.) ? data[i] : -data[i];
+  if( ih >= mBins ) ih = mBins - 1;
+  r_8 n = 0;
+  r_8 sx = 0;
+  r_8 sx2= 0;
+  for (int_4 i=il; i<=ih; i++) {
+    r_8 v = (mData[i]>=0.) ? mData[i] : -mData[i];
     n += v;
     sx += BinCenter(i)*v;
@@ -626,18 +640,18 @@
   Valeur de la moyenne calculee entre x0-dx et x0+dx
 */
-float Histo::Mean(float x0, float dx) const
-{
-  double sdata = 0;
-  double sx = 0;
-  int iMin = FindBin(x0-dx);
+r_8 Histo::Mean(r_8 x0, r_8 dx) const
+{
+  r_8 sdata = 0;
+  r_8 sx = 0;
+  int_4 iMin = FindBin(x0-dx);
   if (iMin<0) iMin = 0;
-  int iMax = FindBin(x0+dx);
-  if (iMax>bins) iMax=bins;
-  for (int i=iMin; i<iMax; i++) {
-    double v = (data[i]>=0.) ? data[i] : -data[i];
+  int_4 iMax = FindBin(x0+dx);
+  if (iMax>mBins) iMax=mBins;
+  for (int_4 i=iMin; i<iMax; i++) {
+    r_8 v = (mData[i]>=0.) ? mData[i] : -mData[i];
     sx += BinCenter(i)*v;
     sdata += v;
   }
-  if(sdata>0.) return sx/sdata; else return min;
+  if(sdata>0.) return sx/sdata; else return mMin;
 }
 
@@ -646,15 +660,15 @@
   Valeur du sigma calcule entre x0-dx et x0+dx
 */
-float Histo::Sigma(float x0, float dx) const
-{
-  double sx = 0;
-  double sx2= 0;
-  double sdata = 0;
-  int iMin = FindBin(x0-dx);
+r_8 Histo::Sigma(r_8 x0, r_8 dx) const
+{
+  r_8 sx = 0;
+  r_8 sx2= 0;
+  r_8 sdata = 0;
+  int_4 iMin = FindBin(x0-dx);
   if (iMin<0) iMin = 0;
-  int iMax = FindBin(x0+dx);
-  if (iMax>bins) iMax=bins;
-  for (int i=iMin; i<iMax; i++) {
-    double v = (data[i]>=0.) ? data[i] : -data[i];
+  int_4 iMax = FindBin(x0+dx);
+  if (iMax>mBins) iMax=mBins;
+  for (int_4 i=iMin; i<iMax; i++) {
+    r_8 v = (mData[i]>=0.) ? mData[i] : -mData[i];
     sx += BinCenter(i)*v;
     sx2+= BinCenter(i)*BinCenter(i)*v;
@@ -669,13 +683,13 @@
   Valeur de la moyenne et du sigma nettoyes
 */
-float Histo::CleanedMean(float& sigma) const
+r_8 Histo::CleanedMean(r_8& sigma) const
 {
   if (!nHist) return 0;
   // on fait ca de facon bete, on pourra raffiner apres...
-  float x0 = Mean();
-  float s  = Sigma()+binWidth;
+  r_8 x0 = Mean();
+  r_8 s  = Sigma()+binWidth;
   
-  for (int i=0; i<3; i++) {
-    float xx0 = Mean(x0,5*s);
+  for (int_4 i=0; i<3; i++) {
+    r_8 xx0 = Mean(x0,5*s);
     s  = Sigma(x0,5*s)+binWidth;
     x0 = xx0;
@@ -689,8 +703,8 @@
   Valeur de la moyenne nettoyee
 */
-float Histo::CleanedMean() const
+r_8 Histo::CleanedMean() const
 {
   if (!nHist) return 0;
-  float s=0;
+  r_8 s=0;
   return CleanedMean(s);
 }
@@ -700,8 +714,8 @@
   Retourne le nombre de bins non-nul
 */
-int Histo::BinNonNul() const
-{
-int non=0;
-for (int i=0;i<bins;i++) if( data[i] != 0. ) non++;
+int_4 Histo::BinNonNul() const
+{
+int_4 non=0;
+for (int_4 i=0;i<mBins;i++) if( mData[i] != 0. ) non++;
 return non;
 }
@@ -711,9 +725,9 @@
   Retourne le nombre de bins ayant une erreur non-nulle
 */
-int Histo::ErrNonNul() const
-{
-if(err2==NULL) return -1;
-int non=0;
-for (int i=0;i<bins;i++) if( err2[i] != 0. ) non++;
+int_4 Histo::ErrNonNul() const
+{
+if(mErr2==NULL) return -1;
+int_4 non=0;
+for (int_4 i=0;i<mBins;i++) if( mErr2[i] != 0. ) non++;
 return non;
 }
@@ -724,14 +738,14 @@
   entre le bin 0 et ce bin (y compris le contenu de ce bin).
 */
-int Histo::BinPercent(float per) const
-{
-double n = nHist*per;
-double s = 0.;
-int i;
-for(i=0; i<bins; i++ ) {
-  s += data[i];
+int_4 Histo::BinPercent(r_8 per) const
+{
+r_8 n = nHist*per;
+r_8 s = 0.;
+int_4 i;
+for(i=0; i<mBins; i++ ) {
+  s += mData[i];
   if( s >= n ) break;
 }
-if( i == bins ) i = bins-1;
+if( i == mBins ) i = mBins-1;
 return i;
 }
@@ -747,26 +761,26 @@
        imax = bin tel que nombre d'entrees entre I et imax = N2 * per
      Return: <0 si echec
-             min(I-imin,imax-I) si ok
+             mMin(I-imin,imax-I) si ok
   \endverbatim
 */
-int Histo::BinPercent(float x,float per,int& imin,int& imax)
+int_4 Histo::BinPercent(r_8 x,r_8 per,int& imin,int& imax)
 {
 imin = imax = -1;
 if( per <= 0. ) return -1;
 
-int I = FindBin(x);
-if( I<0 || I>=bins ) return -2;
-
-double N1 = 0.; for(int i=0; i<=I;   i++) N1 += data[i]; N1 *= per;
-double N2 = 0.; {for(int i=I; i<bins; i++) N2 += data[i]; N2 *= per;}
-
-double n = 0.;
-for(imin=I; imin>=0; imin--)   { n += data[imin]; if(n>=N1) break; }
+int_4 I = FindBin(x);
+if( I<0 || I>=mBins ) return -2;
+
+r_8 N1 = 0.; for(int_4 i=0; i<=I;   i++) N1 += mData[i]; N1 *= per;
+r_8 N2 = 0.; {for(int_4 i=I; i<mBins; i++) N2 += mData[i]; N2 *= per;}
+
+r_8 n = 0.;
+for(imin=I; imin>=0; imin--)   { n += mData[imin]; if(n>=N1) break; }
 if( imin<0 ) imin = 0;
 // cout<<"I="<<I<<" imin="<<imin<<" n="<<n<<" N1="<<N1<<endl;
 
 n = 0.;
-for(imax=I; imax<bins; imax++) { n += data[imax]; if(n>=N2) break; }
-if( imax>=bins ) imax = bins-1;
+for(imax=I; imax<mBins; imax++) { n += mData[imax]; if(n>=N2) break; }
+if( imax>=mBins ) imax = mBins-1;
 // cout<<"I="<<I<<" imax="<<imax<<" n="<<n<<" N2="<<N2<<endl;
 
@@ -778,9 +792,9 @@
   Idem precedent mais renvoie xmin et xmax
 */
-int Histo::BinPercent(float x,float per,float& xmin,float& xmax)
+int_4 Histo::BinPercent(r_8 x,r_8 per,r_8& xmin,r_8& xmax)
 {
 xmin = xmax = 0.;
-int imin,imax;
-int rc = BinPercent(x,per,imin,imax);
+int_4 imin,imax;
+int_4 rc = BinPercent(x,per,imin,imax);
 if( rc >= 0 ) { xmin = BinLowEdge(imin); xmax = BinHighEdge(imax); }
 return rc;
@@ -792,17 +806,17 @@
   si norm <= 0 : pas de normalisation, integration seule
 */
-void Histo::HInteg(float norm)
-{
-if( bins <= 0 ) return; // createur par default
-if(bins>1)
-  for(int i=1; i<bins; i++) {
-    data[i] += data[i-1];
-    if(err2!=NULL) err2[i] += err2[i-1];
+void Histo::HInteg(r_8 norm)
+{
+if( mBins <= 0 ) return; // createur par default
+if(mBins>1)
+  for(int_4 i=1; i<mBins; i++) {
+    mData[i] += mData[i-1];
+    if(mErr2!=NULL) mErr2[i] += mErr2[i-1];
   }
 if( norm <= 0. ) return;
-norm /= data[bins-1];
-for(int i=0; i<bins; i++) {
-  data[i] *= norm;
-  if(err2!=NULL) err2[i] *= norm*norm;
+norm /= mData[mBins-1];
+for(int_4 i=0; i<mBins; i++) {
+  mData[i] *= norm;
+  if(mErr2!=NULL) mErr2[i] *= norm*norm;
 }
 }
@@ -814,13 +828,13 @@
 void Histo::HDeriv()
 {
-if( bins <= 0 ) return; // createur par default
-if( bins <= 1 ) return;
-float *temp = new float[bins];
-memcpy(temp, data, bins*sizeof(float));
-if(bins>=3) for(int i=1; i<bins-1; i++)
-              temp[i] = (data[i+1]-data[i-1])/(2.*binWidth);
-temp[0] = (data[1]-data[0])/binWidth;
-temp[bins-1] = (data[bins-1]-data[bins-2])/binWidth;
-memcpy(data, temp, bins*sizeof(float));
+if( mBins <= 0 ) return; // createur par default
+if( mBins <= 1 ) return;
+r_8 *temp = new r_8[mBins];
+memcpy(temp, mData, mBins*sizeof(r_8));
+if(mBins>=3) for(int_4 i=1; i<mBins-1; i++)
+              temp[i] = (mData[i+1]-mData[i-1])/(2.*binWidth);
+temp[0] = (mData[1]-mData[0])/binWidth;
+temp[mBins-1] = (mData[mBins-1]-mData[mBins-2])/binWidth;
+memcpy(mData, temp, mBins*sizeof(r_8));
 delete [] temp;
 }
@@ -830,7 +844,7 @@
   Pour rebinner l'histogramme sur nbinew bins
 */
-void Histo::HRebin(int nbinew)
-{
-  if( bins <= 0 ) return; // createur par default
+void Histo::HRebin(int_4 nbinew)
+{
+  if( mBins <= 0 ) return; // createur par default
   if( nbinew <= 0 ) return;
 
@@ -839,31 +853,31 @@
 
   // Le nombre de bins est il plus grand ??
-  if( nbinew > bins ) {
-    delete [] data; data = NULL;
-    data = new float[nbinew];
-    if( err2 != NULL ) {
-      delete [] err2; err2 = NULL;
-      err2 = new double[nbinew];
+  if( nbinew > mBins ) {
+    delete [] mData; mData = NULL;
+    mData = new r_8[nbinew];
+    if( mErr2 != NULL ) {
+      delete [] mErr2; mErr2 = NULL;
+      mErr2 = new r_8[nbinew];
     }
   }
 
   // remise en forme de this
-  bins = nbinew;
+  mBins = nbinew;
   this->Zero();
-  binWidth = (max-min)/bins;
+  binWidth = (mMax-mMin)/mBins;
   // On recopie les parametres qui n'ont pas changes
-  under = H.under;
-  over  = H.over;
+  mUnder = H.mUnder;
+  mOver  = H.mOver;
 
 
   // Remplissage
-  for(int i=0;i<bins;i++) {
-    float xmi = BinLowEdge(i);
-    float xma = BinHighEdge(i);
-    int imi =  H.FindBin(xmi);
+  for(int_4 i=0;i<mBins;i++) {
+    r_8 xmi = BinLowEdge(i);
+    r_8 xma = BinHighEdge(i);
+    int_4 imi =  H.FindBin(xmi);
     if( imi < 0 ) imi = 0;
-    int ima =  H.FindBin(xma);
-    if( ima >= H.bins ) ima = H.bins-1;
-    double w = 0.;
+    int_4 ima =  H.FindBin(xma);
+    if( ima >= H.mBins ) ima = H.mBins-1;
+    r_8 w = 0.;
     if( ima == imi ) {
       w = H(imi) * binWidth/H.binWidth;
@@ -872,7 +886,7 @@
       w += H(ima) * (xma -H.BinLowEdge(ima))/H.binWidth;
       if( ima > imi+1 )
-          for(int ii=imi+1;ii<ima;ii++) w += H(ii);
+          for(int_4 ii=imi+1;ii<ima;ii++) w += H(ii);
     }
-    AddBin(i,(float) w);
+    AddBin(i, w);
   }
 
@@ -887,17 +901,17 @@
   consecutifs, le bin le plus a droite est pris.
 */
-int Histo::MaxiLocal(float& maxi,int& imax,float& maxn,int& imaxn)
-{
-int nml = 0;
+int_4 Histo::MaxiLocal(r_8& maxi,int& imax,r_8& maxn,int& imaxn)
+{
+int_4 nml = 0;
 imax = imaxn = -1;
-maxi = maxn = -1.f;
+maxi = maxn = -1.;
 
 bool up = true;
 bool down = false;
-for(int i=0;i<bins;i++) {
-  if( !up ) if( data[i] > data[i-1] ) up = true;
+for(int_4 i=0;i<mBins;i++) {
+  if( !up ) if( mData[i] > mData[i-1] ) up = true;
   if( up && !down ) {
-    if( i == bins-1 ) down=true;
-      else if( data[i] > data[i+1] ) down=true;
+    if( i == mBins-1 ) down=true;
+      else if( mData[i] > mData[i+1] ) down=true;
   }
 
@@ -906,10 +920,10 @@
     up = down = false;
     if( imax < 0 ) {
-      imax = i; maxi = data[i];
-    } else if( data[i] >= maxi ) {
+      imax = i; maxi = mData[i];
+    } else if( mData[i] >= maxi ) {
       imaxn = imax; maxn = maxi;
-      imax = i; maxi = data[i];
+      imax = i; maxi = mData[i];
     } else {
-      if( imaxn < 0 || data[i] >= maxn ) { imaxn = i; maxn = data[i]; }
+      if( imaxn < 0 || mData[i] >= maxn ) { imaxn = i; maxn = mData[i]; }
     }
   }
@@ -925,5 +939,5 @@
   L'histo est suppose etre remplit de valeurs positives
 */
-float Histo::FitMax(int degree, float frac, int debug) const
+r_8 Histo::FitMax(int_4 degree, r_8 frac, int_4 debug) const
 {
   if (degree < 2 || degree > 3) degree = 3;
@@ -935,7 +949,7 @@
   if (NEntries() < 1) THROW(inconsistentErr);
 
-  int iMax = IMax();
-  float hmax = (*this)(iMax);
-  float xCenter = BinCenter(iMax);
+  int_4 iMax = IMax();
+  r_8 hmax = (*this)(iMax);
+  r_8 xCenter = BinCenter(iMax);
 
   if(debug>1)
@@ -944,17 +958,17 @@
   /* find limits at frac*hmax */
 
-  float limit = frac*hmax;
-
-  volatile int iLow = iMax;
+  r_8 limit = frac*hmax;
+
+  volatile int_4 iLow = iMax;
   while (iLow>0 && (*this)(iLow)>limit) iLow--;
 
-  volatile int iHigh = iMax;
+  volatile int_4 iHigh = iMax;
   while (iHigh<NBins()-1 && (*this)(iHigh)>limit) iHigh++;
 
-  int nLowHigh;
+  int_4 nLowHigh;
   for(;;) {
     nLowHigh = 0;
-    for (int i=iLow; i<=iHigh; i++) if((*this)(i)>0) {
-      if(!err2) nLowHigh++;
+    for (int_4 i=iLow; i<=iHigh; i++) if((*this)(i)>0) {
+      if(!mErr2) nLowHigh++;
         else if(Error2(i)>0.) nLowHigh++;
     }
@@ -977,8 +991,8 @@
   TVector<r_8> e2Fit(nLowHigh);
   TVector<r_8> errcoef(1);
-  int ii = 0;
-  for (int j=iLow; j<=iHigh; j++) {
+  int_4 ii = 0;
+  for (int_4 j=iLow; j<=iHigh; j++) {
     if ((*this)(j)>0) {
-      if(!err2) {
+      if(!mErr2) {
         xFit(ii) = BinCenter(j)-xCenter;
         yFit(ii) = (*this)(j);
@@ -994,5 +1008,5 @@
   }
   if(debug>4) {
-    int k;
+    int_4 k;
     for(k=0;k<nLowHigh;k++) cout<<" "<<xFit(k);  cout<<endl;
     for(k=0;k<nLowHigh;k++) cout<<" "<<yFit(k);  cout<<endl;
@@ -1009,6 +1023,6 @@
   } ENDTRY
 
-  int DPolDeg = pol.Degre();
-  float fd = 0.;
+  int_4 DPolDeg = pol.Degre();
+  r_8 fd = 0.;
 
   if (DPolDeg == 0) {
@@ -1026,11 +1040,11 @@
   } else if (DPolDeg == 1) {
     // on est dans le cas d'un fit de parabole
-    double r=0;
+    r_8 r=0;
     if (pol.Root1(r)==0) THROW(inconsistentErr);
     fd = r + xCenter;
   } else if (DPolDeg == 2) {
     // on est dans le cas d'un fit de cubique
-    double r1=0;
-    double r2=0;
+    r_8 r1=0;
+    r_8 r2=0;
     if (pol.Root2(r1,r2) == 0) THROW(inconsistentErr);
     pol.Derivate();
@@ -1041,6 +1055,6 @@
   }
 
-  if(fd>max) fd = max;
-  if(fd<min) fd = min;
+  if(fd>mMax) fd = mMax;
+  if(fd<mMin) fd = mMin;
 
   if (debug>1)
@@ -1060,7 +1074,7 @@
   L'histo est suppose etre remplit de valeurs positives
 */
-float Histo::FindWidth(float frac, int debug) const
-{
-  float xmax = BinCenter( IMax() );
+r_8 Histo::FindWidth(r_8 frac, int_4 debug) const
+{
+  r_8 xmax = BinCenter( IMax() );
   return FindWidth(xmax,frac,debug);
 }
@@ -1071,5 +1085,5 @@
   L'histo est suppose etre remplit de valeurs positives
 */
-float Histo::FindWidth(float xmax,float frac, int debug) const
+r_8 Histo::FindWidth(r_8 xmax,r_8 frac, int_4 debug) const
 {
   if (frac <= 0 || frac >= 1.) frac = 0.5;
@@ -1085,39 +1099,39 @@
   if (NBins() < 3) THROW(inconsistentErr);
 
-  int iMax = FindBin(xmax);
+  int_4 iMax = FindBin(xmax);
   if (iMax<0 || iMax>=NBins()) THROW(inconsistentErr);
-  float hmax = data[iMax];
-  float limit = frac*hmax;
+  r_8 hmax = mData[iMax];
+  r_8 limit = frac*hmax;
   if (debug > 1)
     cout << "  Max histo[" << iMax << "] = " << hmax
          << ", limite " << limit << endl;
 
-  int iLow = iMax;
-  while (iLow>=0 && data[iLow]>limit) iLow--;
+  int_4 iLow = iMax;
+  while (iLow>=0 && mData[iLow]>limit) iLow--;
   if( iLow < 0 ) iLow = 0;
 
-  int iHigh = iMax;
-  while (iHigh<NBins() && data[iHigh]>limit) iHigh++;
+  int_4 iHigh = iMax;
+  while (iHigh<NBins() && mData[iHigh]>limit) iHigh++;
   if( iHigh >=NBins() ) iHigh = NBins()-1;
 
-  float xlow   = BinCenter(iLow);
-  float ylow   = data[iLow];
-
-  float xlow1=xlow, ylow1=ylow;
+  r_8 xlow   = BinCenter(iLow);
+  r_8 ylow   = mData[iLow];
+
+  r_8 xlow1=xlow, ylow1=ylow;
   if(iLow+1<NBins()) {
     xlow1  = BinCenter(iLow+1);
-    ylow1  = data[iLow+1];
-  }
-
-  float xhigh  = BinCenter(iHigh);
-  float yhigh  = data[iHigh];
-
-  float xhigh1=xhigh, yhigh1=yhigh;
+    ylow1  = mData[iLow+1];
+  }
+
+  r_8 xhigh  = BinCenter(iHigh);
+  r_8 yhigh  = mData[iHigh];
+
+  r_8 xhigh1=xhigh, yhigh1=yhigh;
   if(iHigh-1>=0) {
     xhigh1 = BinCenter(iHigh-1);
-    yhigh1 = data[iHigh-1];
-  }
-
-  float xlpred,xhpred,wd;
+    yhigh1 = mData[iHigh-1];
+  }
+
+  r_8 xlpred,xhpred,wd;
 
   if(ylow1>ylow) {
@@ -1148,7 +1162,7 @@
   Cf suivant mais im est le bin du maximum de l'histo
 */
-int Histo::EstimeMax(float& xm,int SzPav)
-{
-int im = IMax();
+int_4 Histo::EstimeMax(r_8& xm,int_4 SzPav)
+{
+int_4 im = IMax();
 return EstimeMax(im,xm,SzPav);
 }
@@ -1166,17 +1180,17 @@
   \endverbatim
 */
-int Histo::EstimeMax(int& im,float& xm,int SzPav)
+int_4 Histo::EstimeMax(int& im,r_8& xm,int_4 SzPav)
 {
 xm = 0;
 if( SzPav <= 0 ) return -1;
-if( im < 0 || im >= bins ) return -1;
+if( im < 0 || im >= mBins ) return -1;
 
 if( SzPav%2 == 0 ) SzPav++;
 SzPav = (SzPav-1)/2;
 
-int rc = 0;
-double dxm = 0, wx = 0;
-for(int i=im-SzPav;i<=im+SzPav;i++) {
-  if( i<0 || i>= bins ) {rc=1; continue;}
+int_4 rc = 0;
+r_8 dxm = 0, wx = 0;
+for(int_4 i=im-SzPav;i<=im+SzPav;i++) {
+  if( i<0 || i>= mBins ) {rc=1; continue;}
   dxm += BinCenter(i) * (*this)(i);
   wx  += (*this)(i);
@@ -1198,24 +1212,24 @@
   et a droite (widthD)
 */
-void Histo::EstimeWidthS(float frac,float& widthG,float& widthD)
-{
-int i;
+void Histo::EstimeWidthS(r_8 frac,r_8& widthG,r_8& widthD)
+{
+int_4 i;
 widthG = widthD = -1.;
-if( bins<=1 || frac<=0. || frac>=1. ) return;
-
-int imax = 0;
-float maxi = data[0];
-for(i=1;i<bins;i++) if(data[i]>maxi) {imax=i; maxi=data[i];}
-float xmax = BinCenter(imax);
-float maxf = maxi * frac;
+if( mBins<=1 || frac<=0. || frac>=1. ) return;
+
+int_4 imax = 0;
+r_8 maxi = mData[0];
+for(i=1;i<mBins;i++) if(mData[i]>maxi) {imax=i; maxi=mData[i];}
+r_8 xmax = BinCenter(imax);
+r_8 maxf = maxi * frac;
 
 // recherche du sigma a gauche
 widthG = 0.;
-for(i=imax;i>=0;i--) if( data[i] <= maxf ) break;
+for(i=imax;i>=0;i--) if( mData[i] <= maxf ) break;
 if(i<0) i=0;
 if(i<imax) {
-  if( data[i+1] != data[i] ) {
+  if( mData[i+1] != mData[i] ) {
     widthG = BinCenter(i) + binWidth
-           * (maxf-data[i])/(data[i+1]-data[i]);
+           * (maxf-mData[i])/(mData[i+1]-mData[i]);
     widthG = xmax - widthG;
   } else widthG = xmax - BinCenter(i);
@@ -1224,10 +1238,10 @@
 // recherche du sigma a droite
 widthD = 0.;
-for(i=imax;i<bins;i++) if( data[i] <= maxf ) break;
-if(i>=bins) i=bins-1;
+for(i=imax;i<mBins;i++) if( mData[i] <= maxf ) break;
+if(i>=mBins) i=mBins-1;
 if(i>imax) {
-  if( data[i] != data[i-1] ) {
+  if( mData[i] != mData[i-1] ) {
     widthD = BinCenter(i) - binWidth
-           * (maxf-data[i])/(data[i-1]-data[i]);
+           * (maxf-mData[i])/(mData[i-1]-mData[i]);
     widthD -= xmax;
   } else widthD = BinCenter(i) - xmax;
@@ -1257,5 +1271,5 @@
   \endverbatim
 */
-int  Histo::Fit(GeneralFit& gfit,unsigned short typ_err)
+int_4  Histo::Fit(GeneralFit& gfit,unsigned short typ_err)
 {
 if(NBins()<=0) return -1000;
@@ -1264,9 +1278,9 @@
 GeneralFitData mydata(1,NBins());
 
-for(int i=0;i<NBins();i++) {
-  double x = (double) BinCenter(i);
-  double f = (double) (*this)(i);
-  double saf = sqrt(fabs((double) f)); if(saf<1.) saf=1.;
-  double e=0.;
+for(int_4 i=0;i<NBins();i++) {
+  r_8 x =  BinCenter(i);
+  r_8 f =  (*this)(i);
+  r_8 saf = sqrt(fabs( f)); if(saf<1.) saf=1.;
+  r_8 e=0.;
   if(typ_err==0)      {if(HasErrors()) e=Error(i); else e=1.;}
   else if(typ_err==1) {if(HasErrors()) e=Error(i); else e=saf;}
@@ -1295,7 +1309,7 @@
 TVector<r_8> par = gfit.GetParm();
 Histo h(*this);
-for(int i=0;i<NBins();i++) {
-  double x = (double) BinCenter(i);
-  h(i) -= (float) f->Value(&x,par.Data());
+for(int_4 i=0;i<NBins();i++) {
+  r_8 x =  BinCenter(i);
+  h(i) -=  f->Value(&x,par.Data());
 }
 return h;
@@ -1314,7 +1328,7 @@
 TVector<r_8> par = gfit.GetParm();
 Histo h(*this);
-for(int i=0;i<NBins();i++) {
-  double x = (double) BinCenter(i);
-  h(i) = (float) f->Value(&x,par.Data());
+for(int_4 i=0;i<NBins();i++) {
+  r_8 x =  BinCenter(i);
+  h(i) =  f->Value(&x,par.Data());
 }
 return h;
@@ -1334,20 +1348,20 @@
           sinon : hmin hmax
       pflag < 0 : on imprime les informations (nbin,min,...) sans l'histogramme
-            = 0 : on imprime  "BinCenter(i) data[i]"  (note "... ...")
+            = 0 : on imprime  "BinCenter(i) mData[i]"  (note "... ...")
             bit 0 on : (v=1): numero_bin "... ..."
             bit 1 on : (v=2): "... ..." erreur
   \endverbatim
 */
-void Histo::PrintF(FILE * fp, int hdyn,float hmin, float hmax,int pflag,
-	      int il, int ih)
+void Histo::PrintF(FILE * fp, int_4 hdyn,r_8 hmin, r_8 hmax,int_4 pflag,
+	      int_4 il, int_4 ih)
 {
  
- if( il > ih ) { il = 0; ih = bins-1; }
+ if( il > ih ) { il = 0; ih = mBins-1; }
  if( il < 0 ) il = 0;
- if( ih >= bins ) ih = bins-1;
-
- double dhmin = (double) hmin;
- double dhmax = (double) hmax;
- double hb,hbmn,hbmx;
+ if( ih >= mBins ) ih = mBins-1;
+
+ r_8 dhmin =  hmin;
+ r_8 dhmax =  hmax;
+ r_8 hb,hbmn,hbmx;
 
  if(hdyn==0) hdyn = 100;
@@ -1355,7 +1369,7 @@
  cout << "~Histo::Print  "
       << " nHist=" << nHist << "  nEntries=" << nEntries
-      << "  under=" << under << "  over=" << over << endl;
- cout << "       bins=" << bins
-      << "  min=" << min << "  max=" << max
+      << "  mUnder=" << mUnder << "  mOver=" << mOver << endl;
+ cout << "       mBins=" << mBins
+      << "  min=" << mMin << "  mMax=" << mMax
       << "  binWidth=" << binWidth << endl;
  cout << "       mean=" << Mean() << " r.m.s=" << Sigma() 
@@ -1364,12 +1378,12 @@
  if(hdyn<0 || pflag<0 ) return;
 
- if(dhmax<=dhmin) { if(hmin != 0.) dhmin = (double) VMin(); else dhmin=0.;
-                  dhmax = (double) VMax(); }
+ if(dhmax<=dhmin) { if(hmin != 0.) dhmin =  VMin(); else dhmin=0.;
+                  dhmax =  VMax(); }
  if(dhmin>dhmax) return;
  if(dhmin==dhmax) {dhmin -= 1.; dhmax += 1.;}
- double wb = (dhmax-dhmin) / (double) hdyn;
+ r_8 wb = (dhmax-dhmin) /  hdyn;
 
  // determination de la position de la valeur zero
- int i0 = (int)(-dhmin/wb);
+ int_4 i0 = (int_4)(-dhmin/wb);
 
  // si le zero est dans la dynamique,
@@ -1389,6 +1403,6 @@
        dhmax -= hbmx;
      }
-     wb = (dhmax-dhmin) / (double) hdyn;
-     i0 = (int)(-dhmin/wb);
+     wb = (dhmax-dhmin) /  hdyn;
+     i0 = (int_4)(-dhmin/wb);
    }
  }
@@ -1401,18 +1415,18 @@
 
  // premiere ligne
- {for(int i=0;i<hdyn;i++) s[i] = '=';}
+ {for(int_4 i=0;i<hdyn;i++) s[i] = '=';}
  if( 0 <= i0 && i0 < hdyn ) s[i0] = '0';
  if(pflag&1) fprintf( fp, "====");
  fprintf( fp, "======================");
- if(pflag&2 && err2!=NULL) fprintf( fp, "===========");
+ if(pflag&2 && mErr2!=NULL) fprintf( fp, "===========");
  fprintf( fp, "==%s\n",s);
 
  // histogramme
- {for(int i=il;i<=ih;i++) {
-   for(int k=0;k<hdyn;k++) s[k] = ' ';
+ {for(int_4 i=il;i<=ih;i++) {
+   for(int_4 k=0;k<hdyn;k++) s[k] = ' ';
    hb = (*this)(i);
 
    //choix du bin (hdyn bin entre [dhmin,dhmax[
-   int ii = (int)( (hb-dhmin)/wb );
+   int_4 ii = (int_4)( (hb-dhmin)/wb );
    if(ii<0) ii = 0; else if(ii>=hdyn) ii = hdyn-1;
 
@@ -1424,24 +1438,24 @@
    if(i0<0) {
      // courbe entierement positive
-     for(int k=0;k<=ii;k++) s[k] = 'X';
+     for(int_4 k=0;k<=ii;k++) s[k] = 'X';
    } else if(i0>=hdyn) {
      // courbe entierement negative
-     for(int k=hdyn-1;k>=ii;k--) s[k] = 'X';
+     for(int_4 k=hdyn-1;k>=ii;k--) s[k] = 'X';
    } else {
      // courbe positive et negative
      s[i0] = '|';
-     if(ii>i0)        for(int k=i0+1;k<=ii;k++) s[k] = 'X';
-       else if(ii<i0) for(int k=ii;k<i0;k++)    s[k] = 'X';
+     if(ii>i0)        for(int_4 k=i0+1;k<=ii;k++) s[k] = 'X';
+       else if(ii<i0) for(int_4 k=ii;k<i0;k++)    s[k] = 'X';
           else s[ii] = 'X';
    }
 
    // valeur a mettre dans le bin le plus haut/bas
-   int ib;
-   if(hb>0.) ib = (int)( 10.*(hb-hbmn)/(hbmx-hbmn) );
-     else if(hb<0.) ib = (int)( 10.*(hbmx-hb)/(hbmx-hbmn) );
+   int_4 ib;
+   if(hb>0.) ib = (int_4)( 10.*(hb-hbmn)/(hbmx-hbmn) );
+     else if(hb<0.) ib = (int_4)( 10.*(hbmx-hb)/(hbmx-hbmn) );
        else ib = -1;
    if(ib==-1) s[ii] = '|';
      else if(ib==0) s[ii] = '.';
-       else if(ib>0 && ib<10) s[ii] = (char)((int) '0' + ib);
+       else if(ib>0 && ib<10) s[ii] = (char)((int_4) '0' + ib);
 
    // traitement des saturations +/-
@@ -1451,39 +1465,39 @@
    if(pflag&1) fprintf( fp, "%3d ",i);
    fprintf( fp, "%10.4g %10.4g ",BinCenter(i),hb);
-   if(pflag&2 && err2!=NULL) fprintf( fp, "%10.4g ",Error(i));
+   if(pflag&2 && mErr2!=NULL) fprintf( fp, "%10.4g ",Error(i));
    fprintf( fp, "= %s\n",s);
  }}
 
  // derniere ligne
- for(int i=0;i<hdyn;i++) s[i] = '=';
+ for(int_4 i=0;i<hdyn;i++) s[i] = '=';
  if( 0 <= i0 && i0 < hdyn ) s[i0] = '0';
  if(pflag&1) fprintf( fp, "====");
  fprintf( fp, "======================");
- if(pflag&2 && err2!=NULL) fprintf( fp, "===========");
+ if(pflag&2 && mErr2!=NULL) fprintf( fp, "===========");
  fprintf( fp, "==%s\n",s);
 
  // valeur basse des bins (sur ["ndig-1" digits + signe] =  ndig char (>=3))
- const int ndig = 7;
+ const int_4 ndig = 7;
  char sn[2*ndig+10];
  hb = ( fabs(dhmin) > fabs(dhmax) ) ? fabs(dhmin) : fabs(dhmax);
- int n;
- if( hb > 0. ) n = (int)(log10(hb*1.00000001)); else n = 1;
- double scaledig = pow(10.,(double) ndig-2);
- double expo = scaledig/pow(10.,(double) n);
+ int_4 n;
+ if( hb > 0. ) n = (int_4)(log10(hb*1.00000001)); else n = 1;
+ r_8 scaledig = pow(10.,(r_8) ndig-2);
+ r_8 expo = scaledig/pow(10.,(r_8) n);
  // cout <<"n="<<n<<" hb="<<hb<<" scaledig="<<scaledig<<" expo="<<expo<<endl;
- for(int k=0;k<ndig;k++) {
-   for(int i=0;i<hdyn;i++) s[i] = ' ';
-   {for(int i=0;i<hdyn;i++) {
-     n = (int)( (dhmin + i*wb)*expo );
-     for(int j=0;j<2*ndig+10;j++) sn[j] = ' ';
+ for(int_4 k=0;k<ndig;k++) {
+   for(int_4 i=0;i<hdyn;i++) s[i] = ' ';
+   {for(int_4 i=0;i<hdyn;i++) {
+     n = (int_4)( (dhmin + i*wb)*expo );
+     for(int_4 j=0;j<2*ndig+10;j++) sn[j] = ' ';
      sprintf(sn,"%d%c",n,'\0');
      strip(sn,'B',' ');
      // cout <<"n="<<n<<" sn=("<<sn<<")  l="<<strlen(sn)<<" k="<<k;
-     if( (int) strlen(sn) > k ) s[i] = sn[k];
+     if( (int_4) strlen(sn) > k ) s[i] = sn[k];
      // cout <<"  s=("<<s<<")"<<endl;
    }}
    if(pflag&1) fprintf( fp, "    ");
    fprintf( fp, "                      ");
-   if(pflag&2 && err2!=NULL) fprintf( fp, "           ");
+   if(pflag&2 && mErr2!=NULL) fprintf( fp, "           ");
    fprintf( fp, "  %s\n",s);
  }
@@ -1497,6 +1511,6 @@
   Impression de l'histogramme sur stdout
 */
-void Histo::Print(int hdyn,float hmin, float hmax,int pflag,
-	     int il, int ih)
+void Histo::Print(int_4 hdyn,r_8 hmin, r_8 hmax,int_4 pflag,
+	     int_4 il, int_4 ih)
 {
  Histo::PrintF(stdout, hdyn, hmin, hmax, pflag, il, ih);
@@ -1523,5 +1537,5 @@
 
 // Lecture des valeurs
-is.Get(dobj->bins);
+is.Get(dobj->mBins);
 is.Get(dobj->nEntries);
 int_4 errok;
@@ -1529,21 +1543,21 @@
 
 is.Get(dobj->binWidth);
-is.Get(dobj->min);
-is.Get(dobj->max);
-is.Get(dobj->under);
-is.Get(dobj->over);
+is.Get(dobj->mMin);
+is.Get(dobj->mMax);
+is.Get(dobj->mUnder);
+is.Get(dobj->mOver);
 
 is.Get(dobj->nHist);
 
 // Lecture des donnees Histo 1D
-dobj->data = new float[dobj->bins];
+dobj->mData = new r_8[dobj->mBins];
 is.GetLine(strg, 255);
-is.Get(dobj->data, dobj->bins);
+is.Get(dobj->mData, dobj->mBins);
 
 // Lecture des erreurs
 if(errok) {
   is.GetLine(strg, 255);
-  dobj->err2 = new double[dobj->bins];
-  is.Get(dobj->err2, dobj->bins);
+  dobj->mErr2 = new r_8[dobj->mBins];
+  is.Get(dobj->mErr2, dobj->mBins);
 }
 
@@ -1557,37 +1571,37 @@
 
 // Que faut-il ecrire?
-int_4 errok = (dobj->err2) ? 1 : 0;
+int_4 errok = (dobj->mErr2) ? 1 : 0;
 
 // Ecriture entete pour identifier facilement
-sprintf(strg,"bins=%6d  NEnt=%15d  errok=%1d",dobj->bins,dobj->nEntries,errok);
+sprintf(strg,"mBins=%6d  NEnt=%15d  errok=%1d",dobj->mBins,dobj->nEntries,errok);
 os.PutLine(strg);
-sprintf(strg,"binw=%g  min=%g max=%g",dobj->binWidth,dobj->min,dobj->max);
+sprintf(strg,"binw=%g  mMin=%g mMax=%g",dobj->binWidth,dobj->mMin,dobj->mMax);
 os.PutLine(strg);
-sprintf(strg, "under=%g over=%g nHist=%g",dobj->under,dobj->over,dobj->nHist);
+sprintf(strg, "mUnder=%g mOver=%g nHist=%g",dobj->mUnder,dobj->mOver,dobj->nHist);
 os.PutLine(strg);
 
 // Ecriture des valeurs
-os.Put(dobj->bins);
+os.Put(dobj->mBins);
 os.Put(dobj->nEntries);
 os.Put(errok);
 
 os.Put(dobj->binWidth);
-os.Put(dobj->min);
-os.Put(dobj->max);
-os.Put(dobj->under);
-os.Put(dobj->over);
+os.Put(dobj->mMin);
+os.Put(dobj->mMax);
+os.Put(dobj->mUnder);
+os.Put(dobj->mOver);
 
 os.Put(dobj->nHist);
 
 // Ecriture des donnees Histo 1D
-sprintf(strg,"Histo: Tableau des donnees %d",dobj->bins);
+sprintf(strg,"Histo: Tableau des donnees %d",dobj->mBins);
 os.PutLine(strg);
-os.Put(dobj->data, dobj->bins);
+os.Put(dobj->mData, dobj->mBins);
 
 // Ecriture des erreurs
 if(errok) {
-  sprintf(strg,"Histo: Tableau des erreurs %d",dobj->bins);
+  sprintf(strg,"Histo: Tableau des erreurs %d",dobj->mBins);
   os.PutLine(strg);
-  os.Put(dobj->err2, dobj->bins);
+  os.Put(dobj->mErr2, dobj->mBins);
 }
 
Index: trunk/SophyaLib/HiStats/histos.h
===================================================================
--- trunk/SophyaLib/HiStats/histos.h	(revision 1089)
+++ trunk/SophyaLib/HiStats/histos.h	(revision 1092)
@@ -1,5 +1,5 @@
 // This may look like C code, but it is really -*- C++ -*-
 //
-// $Id: histos.h,v 1.10 2000-07-25 10:20:43 ansari Exp $
+// $Id: histos.h,v 1.11 2000-07-26 13:15:15 ansari Exp $
 //
 
@@ -26,5 +26,6 @@
   // CREATOR / DESTRUCTOR
   Histo();
-  Histo(float xMin, float xMax, int nBin=100);
+  Histo(r_8 xMin, r_8 xMax, int_4 nBin=100);
+  Histo(r_4 xMin, r_4 xMax, int_4 nBin=100);
   Histo(const Histo& H);
   virtual ~Histo();
@@ -35,20 +36,20 @@
   // UPDATING or SETTING
   void Zero();
-  void Add(float x, float w = 1.);
-  void AddBin(int numBin, float w = 1.);
-  void SetBin(float x, float w = 1.);
-  void SetBin(int numBin, float w = 1.);
-  void SetErr2(float x, double e2);
-  void SetErr2(int numBin, double e2);
-  void SetErr(float x, float e);
-  void SetErr(int numBin, float e);
+  void Add(r_8 x, r_8 w = 1.);
+  void AddBin(int_4 numBin, r_8 w = 1.);
+  void SetBin(r_8 x, r_8 w = 1.);
+  void SetBin(int_4 numBin, r_8 w = 1.);
+  void SetErr2(r_8 x, r_8 e2);
+  void SetErr2(int_4 numBin, r_8 e2);
+  void SetErr(r_8 x, r_8 e);
+  void SetErr(int_4 numBin, r_8 e);
   virtual inline void UpdateHisto() const { return;}
 
   // Operators
   Histo& operator = (const Histo& h);
-  Histo& operator *= (double b);
-  Histo& operator /= (double b);
-  Histo& operator += (double b);
-  Histo& operator -= (double b);
+  Histo& operator *= (r_8 b);
+  Histo& operator /= (r_8 b);
+  Histo& operator += (r_8 b);
+  Histo& operator -= (r_8 b);
   Histo& operator += (const Histo& a);
   Histo& operator -= (const Histo& a);
@@ -61,6 +62,6 @@
   void GetError2(TVector<r_8>& v);
   void GetError(TVector<r_8>& v);
-  void PutValue(TVector<r_8>& v, int ierr=0);
-  void PutValueAdd(TVector<r_8> &v, int ierr=0);
+  void PutValue(TVector<r_8>& v, int_4 ierr=0);
+  void PutValueAdd(TVector<r_8> &v, int_4 ierr=0);
   void PutError2(TVector<r_8>& v);
   void PutError2Add(TVector<r_8>& v);
@@ -69,102 +70,102 @@
   // INLINES
   //! Retourne l'abscisse minimum
-  inline float XMin() const {return min;}
+  inline r_8 XMin() const {return mMin;}
   //! Retourne l'abscisse maximum
-  inline float XMax() const {return max;}
+  inline r_8 XMax() const {return mMax;}
   //! Retourne le nombre de bins
-  inline int_4 NBins() const {return bins;}
+  inline int_4 NBins() const {return mBins;}
   //! Retourne la largeur du bin
-  inline float BinWidth() const {return binWidth;}
+  inline r_8 BinWidth() const {return binWidth;}
   //! Retourne le pointeur sur le tableaux des contenus
-  inline float* Bins() const {return data;}
+  inline r_8* Bins() const {return mData;}
   //! Retourne le contenu du bin i
-  inline float operator()(int i) const  {return data[i];}
+  inline r_8 operator()(int_4 i) const  {return mData[i];}
   //! Remplit le contenu du bin i
-  inline float& operator()(int i) {return data[i];}
+  inline r_8& operator()(int_4 i) {return mData[i];}
   //! retourne "true" si il y a des erreurs stoquees
   inline bool HasErrors()
-         {if(err2) return true; else return false;}
+         {if(mErr2) return true; else return false;}
   //! Retourne l'erreur du bin i
-  inline float Error(int i) const
-         {if(err2) {if(err2[i]>0.) return sqrt(err2[i]); else return 0.;}
+  inline r_8 Error(int_4 i) const
+         {if(mErr2) {if(mErr2[i]>0.) return sqrt(mErr2[i]); else return 0.;}
                     else return 0.;}
   //! Retourne l'erreur au carre du bin i
-  inline double Error2(int i) const
-         {if(err2) return err2[i]; else return 0.;}
+  inline r_8 Error2(int_4 i) const
+         {if(mErr2) return mErr2[i]; else return 0.;}
   //! Remplit l'erreur au carre du bin i
-  inline double& Error2(int i) {return err2[i];}
+  inline r_8& Error2(int_4 i) {return mErr2[i];}
   //! Retourne la somme ponderee
-  inline float NData() const            {return (float) nHist;}
+  inline r_8 NData() const            {return nHist;}
   //! Retourne le nombre d'entrees
-  inline float NEntries() const         {return nEntries;}
+  inline r_8 NEntries() const         {return nEntries;}
   //! Retourne le nombre d'overflow
-  inline float NOver() const            {return over;}
+  inline r_8 NOver() const            {return mOver;}
   //! Retourne le nombre d'underflow
-  inline float NUnder() const           {return under;}
+  inline r_8 NUnder() const           {return mUnder;}
 
   //! Retourne l'abscisse du bord inferieur du bin i
-  inline float BinLowEdge(int i)  const {return min + i*binWidth;}
+  inline r_8 BinLowEdge(int_4 i)  const {return mMin + i*binWidth;}
   //! Retourne l'abscisse du centre du bin i
-  inline float BinCenter(int i)   const {return min + (i+0.5)*binWidth;}
+  inline r_8 BinCenter(int_4 i)   const {return mMin + (i+0.5)*binWidth;}
   //! Retourne l'abscisse du bord superieur du bin i
-  inline float BinHighEdge(int i) const {return min + (i+1)*binWidth;} 
+  inline r_8 BinHighEdge(int_4 i) const {return mMin + (i+1)*binWidth;} 
   //! Retourne le numero du bin contenant l'abscisse x
-  inline int_4 FindBin(float x) const   
-         {return (int_4) floorf((x - min) / binWidth);}
+  inline int_4 FindBin(r_8 x) const   
+         {return (int_4) floor((x - mMin) / binWidth);}
 
   // Info, statistique et calculs sur les histogrammes
-  int       BinNonNul() const;
-  int       ErrNonNul() const;
-  int       IMax() const;
-  int       IMin() const;
-  float     VMax() const;
-  float     VMin() const;
-  float     Mean() const;
-  float     Sigma() const;
-  float     MeanLH(int il,int ih) const;
-  float     SigmaLH(int il,int ih) const;
-  float     Mean(float x0, float dx) const;
-  float     Sigma(float x0, float dx) const;
-  float     CleanedMean() const;
-  float     CleanedMean(float& sigma) const;
-  int       BinPercent(float per) const;
-  int       BinPercent(float x,float per,int& imin,int& imax);
-  int       BinPercent(float x,float per,float& xmin,float& xmax);
-  void      HInteg(float norm = 0.);
+  int_4     BinNonNul() const;
+  int_4     ErrNonNul() const;
+  int_4     IMax() const;
+  int_4     IMin() const;
+  r_8       VMax() const;
+  r_8       VMin() const;
+  r_8       Mean() const;
+  r_8       Sigma() const;
+  r_8       MeanLH(int_4 il,int_4 ih) const;
+  r_8       SigmaLH(int_4 il,int_4 ih) const;
+  r_8       Mean(r_8 x0, r_8 dx) const;
+  r_8       Sigma(r_8 x0, r_8 dx) const;
+  r_8       CleanedMean() const;
+  r_8       CleanedMean(r_8& sigma) const;
+  int_4     BinPercent(r_8 per) const;
+  int_4     BinPercent(r_8 x,r_8 per,int_4& imin,int_4& imax);
+  int_4     BinPercent(r_8 x,r_8 per,r_8& xmin,r_8& xmax);
+  void      HInteg(r_8 norm = 0.);
   void      HDeriv();
-  virtual void HRebin(int nbinew);
-
-  int       MaxiLocal(float& maxi,int& imax,float& maxn,int& imaxn);
-  float     FitMax(int degree=2, float frac=0.5f, int debug=0) const;
-  float     FindWidth(float xmax,float frac=0.5f, int debug=0) const;
-  float     FindWidth(float frac=0.5f, int debug=0) const;
-  int       EstimeMax(float& xm,int SzPav = 3);
-  int       EstimeMax(int& im,float& xm,int SzPav = 3);
-  void      EstimeWidthS(float frac,float& widthG,float& widthD);
+  virtual void HRebin(int_4 nbinew);
+
+  int_4     MaxiLocal(r_8& maxi,int_4& imax,r_8& maxn,int_4& imaxn);
+  r_8       FitMax(int_4 degree=2, r_8 frac=0.5f, int_4 debug=0) const;
+  r_8       FindWidth(r_8 xmax,r_8 frac=0.5f, int_4 debug=0) const;
+  r_8       FindWidth(r_8 frac=0.5f, int_4 debug=0) const;
+  int_4     EstimeMax(r_8& xm,int_4 SzPav = 3);
+  int_4     EstimeMax(int_4& im,r_8& xm,int_4 SzPav = 3);
+  void      EstimeWidthS(r_8 frac,r_8& widthG,r_8& widthD);
 
   // Fit
-  int    Fit(GeneralFit& gfit,unsigned short typ_err=0);
+  int_4  Fit(GeneralFit& gfit,unsigned short typ_err=0);
   Histo  FitResidus(GeneralFit& gfit);
   Histo  FitFunction(GeneralFit& gfit);
 
   // Print et Display ASCII
-  void PrintF(FILE * fp, int dyn = 100, float hmin = 1., float hmax = -1.,
-		      int pflag = 0, int il = 1, int ih = -1);
-  void Print(int dyn = 100, float hmin = 1., float hmax = -1.,
-		     int pflag = 0, int il = 1, int ih = -1);
+  void PrintF(FILE * fp, int_4 dyn = 100, r_8 hmin = 1., r_8 hmax = -1.,
+		      int_4 pflag = 0, int_4 il = 1, int_4 ih = -1);
+  void Print(int_4 dyn = 100, r_8 hmin = 1., r_8 hmax = -1.,
+		     int_4 pflag = 0, int_4 il = 1, int_4 ih = -1);
 
 protected:
   void Delete();
 
-  float*    data;     //!< donnees
-  double*   err2;	   //!< erreurs carrees
-  float     under;    //!< underflow
-  float     over;     //!< overflow
-  double    nHist;    //!< somme ponderee des entrees
-  int_4     nEntries; //!< nombre d'entrees
-  int_4     bins;     //!< nombre de bins
-  float     min;      //!< abscisse minimum
-  float     max;      //!< abscisse maximum
-  float     binWidth; //!< largeur du bin
+  r_8*   mData;    //!< donnees
+  r_8*   mErr2;	   //!< erreurs carrees
+  r_8    mUnder;   //!< underflow
+  r_8    mOver;    //!< overflow
+  r_8    nHist;    //!< somme ponderee des entrees
+  int_4  nEntries; //!< nombre d'entrees
+  int_4  mBins;    //!< nombre de bins
+  r_8    mMin;     //!< abscisse minimum
+  r_8    mMax;     //!< abscisse maximum
+  r_8    binWidth; //!< largeur du bin
 };
 
@@ -182,7 +183,7 @@
 // ObjFileIO<Histo>
 
-/*! \ingroup HiStats \fn operator*(const Histo&,double)
+/*! \ingroup HiStats \fn operator*(const Histo&,r_8)
   \brief Operateur H2 = H1 * b */
-inline Histo operator * (const Histo& a, double b)
+inline Histo operator * (const Histo& a, r_8 b)
 {
   Histo result(a);
@@ -190,7 +191,7 @@
 }
 
-/*! \ingroup HiStats \fn operator*(double,const Histo&)
+/*! \ingroup HiStats \fn operator*(r_8,const Histo&)
   \brief Operateur H2 = b * H1 */
-inline Histo operator * (double b, const Histo& a)
+inline Histo operator * (r_8 b, const Histo& a)
 {
   Histo result(a);
@@ -198,7 +199,7 @@
 }
 
-/*! \ingroup HiStats \fn operator/(const Histo&,double)
+/*! \ingroup HiStats \fn operator/(const Histo&,r_8)
   \brief Operateur H2 = H1 / b */
-inline Histo operator / (const Histo& a, double b)
+inline Histo operator / (const Histo& a, r_8 b)
 {
   Histo result(a);
@@ -206,7 +207,7 @@
 }
 
-/*! \ingroup HiStats \fn operator+(const Histo&,double)
+/*! \ingroup HiStats \fn operator+(const Histo&,r_8)
   \brief Operateur H2 = H1 + b */
-inline Histo operator + (const Histo& a, double b)
+inline Histo operator + (const Histo& a, r_8 b)
 {
   Histo result(a);
@@ -214,7 +215,7 @@
 }
 
-/*! \ingroup HiStats \fn operator+(double,const Histo&)
+/*! \ingroup HiStats \fn operator+(r_8,const Histo&)
   \brief Operateur H2 = b + H1 */
-inline Histo operator + (double b, const Histo& a)
+inline Histo operator + (r_8 b, const Histo& a)
 {
   Histo result(a);
@@ -222,7 +223,7 @@
 }
 
-/*! \ingroup HiStats \fn operator-(const Histo&,double)
+/*! \ingroup HiStats \fn operator-(const Histo&,r_8)
   \brief Operateur H2 = H1 - b */
-inline Histo operator - (const Histo& a, double b)
+inline Histo operator - (const Histo& a, r_8 b)
 {
   Histo result(a);
@@ -230,7 +231,7 @@
 }
 
-/*! \ingroup HiStats \fn operator-(double,const Histo&)
+/*! \ingroup HiStats \fn operator-(r_8,const Histo&)
   \brief Operateur H2 = b - H1 */
-inline Histo operator - (double b, const Histo& a)
+inline Histo operator - (r_8 b, const Histo& a)
 {
   Histo result(a);
Index: trunk/SophyaLib/HiStats/histos2.cc
===================================================================
--- trunk/SophyaLib/HiStats/histos2.cc	(revision 1089)
+++ trunk/SophyaLib/HiStats/histos2.cc	(revision 1092)
@@ -43,54 +43,72 @@
   entre xMin,xMax et yMin,yMax.
 */
-Histo2D::Histo2D(float xMin, float xMax, int nxBin
-                ,float yMin, float yMax, int nyBin)
-      : data(new float[nxBin*nyBin]), err2(NULL)
+Histo2D::Histo2D(r_8 xMin,r_8 xMax,int_4 nxBin,r_8 yMin,r_8 yMax,int_4 nyBin)
+      : mData(new r_8[nxBin*nyBin]), mErr2(NULL)
       , nHist(0), nEntries(0)
-      , nx(nxBin), ny(nyBin), nxy(nxBin*nyBin)
-      , xmin(xMin), xmax(xMax), ymin(yMin), ymax(yMax)
-      , wbinx((xMax - xMin)/nxBin), wbiny((yMax - yMin)/nyBin)
-      , hprojx(NULL), hprojy(NULL)
+      , mNx(nxBin), mNy(nyBin), mNxy(nxBin*nyBin)
+      , mXmin(xMin), mXmax(xMax), mYmin(yMin), mYmax(yMax)
+      , mWBinx((xMax - xMin)/nxBin), mWBiny((yMax - yMin)/nyBin)
+      , mHprojx(NULL), mHprojy(NULL)
 {
 ASSERT(nxBin>0 && nyBin>0 && xMin<xMax && yMin<yMax);
-for(int i=0;i<3;i++) for(int j=0;j<3;j++) over[i][j]=0.;
+for(int_4 i=0;i<3;i++) for(int_4 j=0;j<3;j++) mOver[i][j]=0.;
 Zero();
-b_s.H = NULL;
+mB_s.H = NULL;
 END_CONSTRUCTOR
 }
 
 /*!
+  Createur d'un histogramme 2D ayant nxBin,nyBin bins
+  entre xMin,xMax et yMin,yMax.
+*/
+Histo2D::Histo2D(r_4 xMin,r_4 xMax,int_4 nxBin,r_4 yMin,r_4 yMax,int_4 nyBin)
+      : mData(new r_8[nxBin*nyBin]), mErr2(NULL)
+      , nHist(0), nEntries(0)
+      , mNx(nxBin), mNy(nyBin), mNxy(nxBin*nyBin)
+      , mXmin((r_8)xMin), mXmax((r_8)xMax), mYmin((r_8)yMin), mYmax((r_8)yMax)
+      , mWBinx((xMax - xMin)/nxBin), mWBiny((yMax - yMin)/nyBin)
+      , mHprojx(NULL), mHprojy(NULL)
+{
+ASSERT(nxBin>0 && nyBin>0 && xMin<xMax && yMin<yMax);
+for(int_4 i=0;i<3;i++) for(int_4 j=0;j<3;j++) mOver[i][j]=0.;
+Zero();
+mB_s.H = NULL;
+END_CONSTRUCTOR
+}
+
+/*!
   Constructeur par copie.
 */
 Histo2D::Histo2D(const Histo2D& h)
 {
-int i,j;
-data = new float[h.nxy];
-memcpy(data, h.data, h.nxy*sizeof(float));
-
-err2 = NULL;
-if(h.err2) {
-  err2 = new double[h.nxy];
-  memcpy(err2, h.err2, h.nxy*sizeof(double));
+int_4 i,j;
+mData = new r_8[h.mNxy];
+memcpy(mData, h.mData, h.mNxy*sizeof(r_8));
+
+mErr2 = NULL;
+if(h.mErr2) {
+  mErr2 = new r_8[h.mNxy];
+  memcpy(mErr2, h.mErr2, h.mNxy*sizeof(r_8));
 }
 
 nHist = h.nHist; nEntries = h.nEntries;
-for(i=0;i<3;i++) for(j=0;j<3;j++) over[i][j]=h.over[i][j];
-nx = h.nx;  ny = h.ny;  nxy = h.nxy;
-xmin = h.xmin; xmax = h.xmax; ymin = h.ymin; ymax = h.ymax;
-wbinx = h.wbinx; wbiny = h.wbiny;
-b_s.H = NULL;
-
-hprojx = hprojy = NULL;
-if(h.hprojx) {
+for(i=0;i<3;i++) for(j=0;j<3;j++) mOver[i][j]=h.mOver[i][j];
+mNx = h.mNx;  mNy = h.mNy;  mNxy = h.mNxy;
+mXmin = h.mXmin; mXmax = h.mXmax; mYmin = h.mYmin; mYmax = h.mYmax;
+mWBinx = h.mWBinx; mWBiny = h.mWBiny;
+mB_s.H = NULL;
+
+mHprojx = mHprojy = NULL;
+if(h.mHprojx) {
   SetProjX();
-  *hprojx = *(h.hprojx);
-}
-if(h.hprojy) {
+  *mHprojx = *(h.mHprojx);
+}
+if(h.mHprojy) {
   SetProjY();
-  *hprojy = *(h.hprojy); 
-}
-
-int nb;
-float min,max;
+  *mHprojy = *(h.mHprojy); 
+}
+
+int_4 nb;
+r_8 min,max;
 nb = h.NSliX();
 if(nb>0) {
@@ -130,13 +148,13 @@
 */
 Histo2D::Histo2D()
-      : data(NULL), err2(NULL)
+      : mData(NULL), mErr2(NULL)
       , nHist(0), nEntries(0)
-      , nx(0), ny(0), nxy(0)
-      , xmin(0), xmax(0), ymin(0), ymax(0)
-      , wbinx(0), wbiny(0)
-      , hprojx(NULL), hprojy(NULL)
-{
-for(int i=0;i<3;i++) for(int j=0;j<3;j++) over[i][j]=0.;
-b_s.H = NULL;
+      , mNx(0), mNy(0), mNxy(0)
+      , mXmin(0), mXmax(0), mYmin(0), mYmax(0)
+      , mWBinx(0), mWBiny(0)
+      , mHprojx(NULL), mHprojy(NULL)
+{
+for(int_4 i=0;i<3;i++) for(int_4 j=0;j<3;j++) mOver[i][j]=0.;
+mB_s.H = NULL;
 END_CONSTRUCTOR
 }
@@ -148,7 +166,7 @@
 void Histo2D::Delete()
 {
-  if( data != NULL ) { delete[] data; data = NULL;}
-
-  if( err2 != NULL ) { delete[] err2; err2 = NULL;}
+  if( mData != NULL ) { delete[] mData; mData = NULL;}
+
+  if( mErr2 != NULL ) { delete[] mErr2; mErr2 = NULL;}
 
   DelProj();
@@ -162,9 +180,9 @@
   nHist = 0;
   nEntries = 0;
-  nx = 0; ny = 0; nxy = 0;
-  xmin = 0; xmax = 0; ymin = 0; ymax = 0;
-  wbinx = 0; wbiny = 0;
-  for(int i=0;i<3;i++) for(int j=0;j<3;j++) over[i][j]=0.;
-  b_s.H = NULL;
+  mNx = 0; mNy = 0; mNxy = 0;
+  mXmin = 0; mXmax = 0; mYmin = 0; mYmax = 0;
+  mWBinx = 0; mWBiny = 0;
+  for(int_4 i=0;i<3;i++) for(int_4 j=0;j<3;j++) mOver[i][j]=0.;
+  mB_s.H = NULL;
 }
 
@@ -184,9 +202,9 @@
 {
   nHist = nEntries = 0;
-  for(int i=0;i<3;i++) for(int j=0;j<3;j++) over[i][j]=0.;
-  memset(data, 0, nxy*sizeof(float));
-  memset(over, 0, 9*sizeof(float));
-
-  if( err2 != NULL ) memset(err2, 0, nxy*sizeof(double));
+  for(int_4 i=0;i<3;i++) for(int_4 j=0;j<3;j++) mOver[i][j]=0.;
+  memset(mData, 0, mNxy*sizeof(r_8));
+  memset(mOver, 0, 9*sizeof(r_8));
+
+  if( mErr2 != NULL ) memset(mErr2, 0, mNxy*sizeof(r_8));
 
   ZeroProj();
@@ -205,7 +223,7 @@
 void Histo2D::Errors()
 {
- if( nxy > 0 ) {
-   if(err2==NULL) err2 = new double[nxy];
-   memset(err2, 0, nxy*sizeof(double));
+ if( mNxy > 0 ) {
+   if(mErr2==NULL) mErr2 = new r_8[mNxy];
+   memset(mErr2, 0, mNxy*sizeof(r_8));
  }
 }
@@ -217,32 +235,32 @@
 Histo2D& Histo2D::operator = (const Histo2D& h)
 {
-  int i,j,nb;
-  float min,max;
+  int_4 i,j,nb;
+  r_8 min,max;
 
   if(this == &h) return *this;
-  if( h.nxy > nxy ) Delete();
-  if(!data) data = new float[h.nxy];
-  if( !h.err2 && err2 ) { delete [] err2; err2=NULL;}
-  if( h.err2 && !err2 ) err2 = new double[h.nxy];
-
-  for(i=0;i<3;i++) for(j=0;j<3;j++) over[i][j] = h.over[i][j];
+  if( h.mNxy > mNxy ) Delete();
+  if(!mData) mData = new r_8[h.mNxy];
+  if( !h.mErr2 && mErr2 ) { delete [] mErr2; mErr2=NULL;}
+  if( h.mErr2 && !mErr2 ) mErr2 = new r_8[h.mNxy];
+
+  for(i=0;i<3;i++) for(j=0;j<3;j++) mOver[i][j] = h.mOver[i][j];
   nHist = h.nHist;
   nEntries = h.nEntries;
-  nx = h.nx;  ny = h.ny;  nxy = h.nxy;
-  xmin = h.xmin; xmax = h.xmax; wbinx = h.wbinx;
-  ymin = h.ymin; ymax = h.ymax; wbiny = h.wbiny;
+  mNx = h.mNx;  mNy = h.mNy;  mNxy = h.mNxy;
+  mXmin = h.mXmin; mXmax = h.mXmax; mWBinx = h.mWBinx;
+  mYmin = h.mYmin; mYmax = h.mYmax; mWBiny = h.mWBiny;
   
-  memcpy(data, h.data, nxy*sizeof(float));
-  if(err2) memcpy(err2, h.err2, nxy*sizeof(double));
+  memcpy(mData, h.mData, mNxy*sizeof(r_8));
+  if(mErr2) memcpy(mErr2, h.mErr2, mNxy*sizeof(r_8));
 
   DelProjX();
-  if(h.hprojx) {
+  if(h.mHprojx) {
     SetProjX();
-    *hprojx = *(h.hprojx);
+    *mHprojx = *(h.mHprojx);
   }
   DelProjY();
-  if(h.hprojy) {
+  if(h.mHprojy) {
     SetProjY();
-    *hprojy = *(h.hprojy);
+    *mHprojy = *(h.mHprojy);
   }
 
@@ -288,17 +306,17 @@
   Operateur H *= b
 */
-Histo2D& Histo2D::operator *= (double b)
-{
-int i,j;
-double b2 = b*b;
-for(i=0;i<nxy;i++) {
-  data[i] *= b;
-  if(err2) err2[i] *= b2;
-}
-for(i=0;i<3;i++) for(j=0;j<3;j++) over[i][j] *= b;
+Histo2D& Histo2D::operator *= (r_8 b)
+{
+int_4 i,j;
+r_8 b2 = b*b;
+for(i=0;i<mNxy;i++) {
+  mData[i] *= b;
+  if(mErr2) mErr2[i] *= b2;
+}
+for(i=0;i<3;i++) for(j=0;j<3;j++) mOver[i][j] *= b;
 nHist *= b;
 
-if(hprojx) *hprojx *= b;
-if(hprojy) *hprojy *= b;
+if(mHprojx) *mHprojx *= b;
+if(mHprojy) *mHprojy *= b;
 if(NSliX()>0) for(i=0; i<NSliX();i++) *HSliX(i) *= b;
 if(NSliY()>0) for(i=0; i<NSliY();i++) *HSliY(i) *= b;
@@ -312,18 +330,18 @@
   Operateur H /= b
 */
-Histo2D& Histo2D::operator /= (double b)
-{
-int i,j;
+Histo2D& Histo2D::operator /= (r_8 b)
+{
+int_4 i,j;
 if (b==0.) THROW(inconsistentErr);
-double b2 = b*b;
-for(i=0;i<nxy;i++) {
-  data[i] /= b;
-  if(err2) err2[i] /= b2;
-}
-for(i=0;i<3;i++) for(j=0;j<3;j++) over[i][j] /= b;
+r_8 b2 = b*b;
+for(i=0;i<mNxy;i++) {
+  mData[i] /= b;
+  if(mErr2) mErr2[i] /= b2;
+}
+for(i=0;i<3;i++) for(j=0;j<3;j++) mOver[i][j] /= b;
 nHist /= b;
 
-if(hprojx) *hprojx /= b;
-if(hprojy) *hprojy /= b;
+if(mHprojx) *mHprojx /= b;
+if(mHprojy) *mHprojy /= b;
 if(NSliX()>0) for(i=0; i<NSliX();i++) *HSliX(i) /= b;
 if(NSliY()>0) for(i=0; i<NSliY();i++) *HSliY(i) /= b;
@@ -337,23 +355,23 @@
   Operateur H += b
 */
-Histo2D& Histo2D::operator += (double b)
-{
-int i,j;
-float min,max;
-for(i=0;i<nxy;i++) data[i] += b;
-for(i=0;i<3;i++) for(j=0;j<3;j++) over[i][j] += b;
-nHist += nxy*b;
-
-if(hprojx) *hprojx += b*ny;
-if(hprojy) *hprojy += b*nx;
-if(NSliX()>0) for(i=0; i<NSliX();i++) *HSliX(i) += b*ny/NSliX();
-if(NSliY()>0) for(i=0; i<NSliY();i++) *HSliY(i) += b*nx/NSliY();
+Histo2D& Histo2D::operator += (r_8 b)
+{
+int_4 i,j;
+r_8 min,max;
+for(i=0;i<mNxy;i++) mData[i] += b;
+for(i=0;i<3;i++) for(j=0;j<3;j++) mOver[i][j] += b;
+nHist += mNxy*b;
+
+if(mHprojx) *mHprojx += b*mNy;
+if(mHprojy) *mHprojy += b*mNx;
+if(NSliX()>0) for(i=0; i<NSliX();i++) *HSliX(i) += b*mNy/NSliX();
+if(NSliY()>0) for(i=0; i<NSliY();i++) *HSliY(i) += b*mNx/NSliY();
 if(NBandX()>0) for(i=0; i<NBandX();i++) {
   GetBandX(i,min,max);
-  *HBandX(i) += b*(max-min)/(ymax-ymin)*ny;
+  *HBandX(i) += b*(max-min)/(mYmax-mYmin)*mNy;
 }
 if(NBandY()>0) for(i=0; i<NBandY();i++) {
   GetBandY(i,min,max);
-  *HBandY(i) += b*(max-min)/(xmax-xmin)*nx;
+  *HBandY(i) += b*(max-min)/(mXmax-mXmin)*mNx;
 }
 
@@ -364,23 +382,23 @@
   Operateur H -= b
 */
-Histo2D& Histo2D::operator -= (double b)
-{
-int i,j;
-float min,max;
-for(i=0;i<nxy;i++) data[i] -= b;
-for(i=0;i<3;i++) for(j=0;j<3;j++) over[i][j] -= b;
-nHist -= nxy*b;
-
-if(hprojx) *hprojx -= b*ny;
-if(hprojy) *hprojy -= b*nx;
-if(NSliX()>0) for(i=0; i<NSliX();i++) *HSliX(i) -= b*ny/NSliX();
-if(NSliY()>0) for(i=0; i<NSliY();i++) *HSliY(i) -= b*nx/NSliY();
+Histo2D& Histo2D::operator -= (r_8 b)
+{
+int_4 i,j;
+r_8 min,max;
+for(i=0;i<mNxy;i++) mData[i] -= b;
+for(i=0;i<3;i++) for(j=0;j<3;j++) mOver[i][j] -= b;
+nHist -= mNxy*b;
+
+if(mHprojx) *mHprojx -= b*mNy;
+if(mHprojy) *mHprojy -= b*mNx;
+if(NSliX()>0) for(i=0; i<NSliX();i++) *HSliX(i) -= b*mNy/NSliX();
+if(NSliY()>0) for(i=0; i<NSliY();i++) *HSliY(i) -= b*mNx/NSliY();
 if(NBandX()>0) for(i=0; i<NBandX();i++) {
   GetBandX(i,min,max);
-  *HBandX(i) -= b*(max-min)/(ymax-ymin)*ny;
+  *HBandX(i) -= b*(max-min)/(mYmax-mYmin)*mNy;
 }
 if(NBandY()>0) for(i=0; i<NBandY();i++) {
   GetBandY(i,min,max);
-  *HBandY(i) -= b*(max-min)/(xmax-xmin)*nx;
+  *HBandY(i) -= b*(max-min)/(mXmax-mXmin)*mNx;
 }
 
@@ -394,16 +412,16 @@
 Histo2D& Histo2D::operator += (const Histo2D& a)
 {
-int i,j;
-if(nx!=a.nx || ny!=a.ny) THROW(sizeMismatchErr);
-for(i=0;i<nxy;i++) {
-  data[i] += a.data[i];
-  if(err2 && a.err2) err2[i] += a.err2[i];
-}
-for(i=0;i<3;i++) for(j=0;j<3;j++) over[i][j] += a.over[i][j];
+int_4 i,j;
+if(mNx!=a.mNx || mNy!=a.mNy) THROW(sizeMismatchErr);
+for(i=0;i<mNxy;i++) {
+  mData[i] += a.mData[i];
+  if(mErr2 && a.mErr2) mErr2[i] += a.mErr2[i];
+}
+for(i=0;i<3;i++) for(j=0;j<3;j++) mOver[i][j] += a.mOver[i][j];
 nHist += a.nHist;
 nEntries += a.nEntries;
 
-if(hprojx && a.hprojx) *hprojx += *(a.hprojx);
-if(hprojy && a.hprojy) *hprojy += *(a.hprojy);
+if(mHprojx && a.mHprojx) *mHprojx += *(a.mHprojx);
+if(mHprojy && a.mHprojy) *mHprojy += *(a.mHprojy);
 ZeroSliX();  ZeroSliY();
 ZeroBandX(); ZeroBandY();
@@ -417,16 +435,16 @@
 Histo2D& Histo2D::operator -= (const Histo2D& a)
 {
-int i,j;
-if(nx!=a.nx || ny!=a.ny) THROW(sizeMismatchErr);
-for(i=0;i<nxy;i++) {
-  data[i] -= a.data[i];
-  if(err2 && a.err2) err2[i] += a.err2[i];
-}
-for(i=0;i<3;i++) for(j=0;j<3;j++) over[i][j] += a.over[i][j];
+int_4 i,j;
+if(mNx!=a.mNx || mNy!=a.mNy) THROW(sizeMismatchErr);
+for(i=0;i<mNxy;i++) {
+  mData[i] -= a.mData[i];
+  if(mErr2 && a.mErr2) mErr2[i] += a.mErr2[i];
+}
+for(i=0;i<3;i++) for(j=0;j<3;j++) mOver[i][j] += a.mOver[i][j];
 nHist -= a.nHist;
 nEntries += a.nEntries;
 
-if(hprojx && a.hprojx) *hprojx -= *(a.hprojx);
-if(hprojy && a.hprojy) *hprojy -= *(a.hprojy);
+if(mHprojx && a.mHprojx) *mHprojx -= *(a.mHprojx);
+if(mHprojy && a.mHprojy) *mHprojy -= *(a.mHprojy);
 ZeroSliX();  ZeroSliY();
 ZeroBandX(); ZeroBandY();
@@ -440,18 +458,18 @@
 Histo2D& Histo2D::operator *= (const Histo2D& a)
 {
-int i,j;
-if(nx!=a.nx || ny!=a.ny) THROW(sizeMismatchErr);
+int_4 i,j;
+if(mNx!=a.mNx || mNy!=a.mNy) THROW(sizeMismatchErr);
 nHist = 0.;
-for(i=0;i<nxy;i++) {
-  if(err2 && a.err2)
-      err2[i] = a.data[i]*a.data[i]*err2[i] + data[i]*data[i]*a.err2[i];
-  data[i] *= a.data[i];
-  nHist += data[i];
-}
-for(i=0;i<3;i++) for(j=0;j<3;j++) over[i][j] *= a.over[i][j];
+for(i=0;i<mNxy;i++) {
+  if(mErr2 && a.mErr2)
+      mErr2[i] = a.mData[i]*a.mData[i]*mErr2[i] + mData[i]*mData[i]*a.mErr2[i];
+  mData[i] *= a.mData[i];
+  nHist += mData[i];
+}
+for(i=0;i<3;i++) for(j=0;j<3;j++) mOver[i][j] *= a.mOver[i][j];
 nEntries += a.nEntries;
 
-if(hprojx && a.hprojx) *hprojx *= *(a.hprojx);
-if(hprojy && a.hprojy) *hprojy *= *(a.hprojy);
+if(mHprojx && a.mHprojx) *mHprojx *= *(a.mHprojx);
+if(mHprojy && a.mHprojy) *mHprojy *= *(a.mHprojy);
 ZeroSliX();  ZeroSliY();
 ZeroBandX(); ZeroBandY();
@@ -465,25 +483,25 @@
 Histo2D& Histo2D::operator /= (const Histo2D& a)
 {
-int i,j;
-if(nx!=a.nx || ny!=a.ny) THROW(sizeMismatchErr);
+int_4 i,j;
+if(mNx!=a.mNx || mNy!=a.mNy) THROW(sizeMismatchErr);
 nHist = 0.;
-for(i=0;i<nxy;i++) {
-  if(a.data[i]==0.) {
-    data[i]=0.;
-    if(err2) err2[i]=0.;
+for(i=0;i<mNxy;i++) {
+  if(a.mData[i]==0.) {
+    mData[i]=0.;
+    if(mErr2) mErr2[i]=0.;
     continue;
   }
-  if(err2 && a.err2)
-      err2[i] = (err2[i] + data[i]/a.data[i]*data[i]/a.data[i]*a.err2[i])
-                /(a.data[i]*a.data[i]);
-  data[i] /= a.data[i];
-  nHist += data[i];
+  if(mErr2 && a.mErr2)
+      mErr2[i] = (mErr2[i] + mData[i]/a.mData[i]*mData[i]/a.mData[i]*a.mErr2[i])
+                /(a.mData[i]*a.mData[i]);
+  mData[i] /= a.mData[i];
+  nHist += mData[i];
 }
 for(i=0;i<3;i++) for(j=0;j<3;j++) 
-  if(a.over[i][j]!=0.) over[i][j] *= a.over[i][j]; else over[i][j] = 0.;
+  if(a.mOver[i][j]!=0.) mOver[i][j] *= a.mOver[i][j]; else mOver[i][j] = 0.;
 nEntries += a.nEntries;
 
-if(hprojx && a.hprojx) *hprojx /= *(a.hprojx);
-if(hprojy && a.hprojy) *hprojy /= *(a.hprojy);
+if(mHprojx && a.mHprojx) *mHprojx /= *(a.mHprojx);
+if(mHprojy && a.mHprojy) *mHprojy /= *(a.mHprojy);
 ZeroSliX();  ZeroSliY();
 ZeroBandX(); ZeroBandY();
@@ -498,7 +516,7 @@
 void Histo2D::GetXCoor(TVector<r_8> &v)
 {
-float x,y;
-v.Realloc(nx);
-for(int i=0;i<nx;i++) {BinLowEdge(i,0,x,y); v(i) = x;}
+r_8 x,y;
+v.Realloc(mNx);
+for(int_4 i=0;i<mNx;i++) {BinLowEdge(i,0,x,y); v(i) = x;}
 return;
 }
@@ -509,7 +527,7 @@
 void Histo2D::GetYCoor(TVector<r_8> &v)
 {
-float x,y;
-v.Realloc(ny);
-for(int i=0;i<ny;i++) {BinLowEdge(0,i,x,y); v(i) = y;}
+r_8 x,y;
+v.Realloc(mNy);
+for(int_4 i=0;i<mNy;i++) {BinLowEdge(0,i,x,y); v(i) = y;}
 return;
 }
@@ -520,7 +538,7 @@
 void Histo2D::GetValue(TMatrix<r_8> &v)
 {
-v.Realloc(nx,ny);
-for(int i=0;i<nx;i++)
-  for(int j=0;j<ny;j++) v(i,j) = (*this)(i,j);
+v.Realloc(mNx,mNy);
+for(int_4 i=0;i<mNx;i++)
+  for(int_4 j=0;j<mNy;j++) v(i,j) = (*this)(i,j);
 return;
 }
@@ -531,9 +549,9 @@
 void Histo2D::GetError2(TMatrix<r_8> &v)
 {
-int i,j;
-v.Realloc(nx,ny);
-if(!err2)
-  {for(i=0;i<nx;i++) for(j=0;j<ny;j++) v(i,j) = 0.; return;}
-for(i=0;i<nx;i++) for(j=0;j<ny;j++) v(i,j) = Error2(i,j);
+int_4 i,j;
+v.Realloc(mNx,mNy);
+if(!mErr2)
+  {for(i=0;i<mNx;i++) for(j=0;j<mNy;j++) v(i,j) = 0.; return;}
+for(i=0;i<mNx;i++) for(j=0;j<mNy;j++) v(i,j) = Error2(i,j);
 return;
 }
@@ -544,9 +562,9 @@
 void Histo2D::GetError(TMatrix<r_8> &v)
 {
-int i,j;
-v.Realloc(nx,ny);
-if(!err2)
-  {for(i=0;i<nx;i++) for(j=0;j<ny;j++) v(i,j) = 0.; return;}
-for(i=0;i<nx;i++) for(j=0;j<ny;j++) v(i,j) = Error(i,j);
+int_4 i,j;
+v.Realloc(mNx,mNy);
+if(!mErr2)
+  {for(i=0;i<mNx;i++) for(j=0;j<mNy;j++) v(i,j) = 0.; return;}
+for(i=0;i<mNx;i++) for(j=0;j<mNy;j++) v(i,j) = Error(i,j);
 return;
 }
@@ -556,13 +574,12 @@
   Remplissage du contenu de l'histo avec les valeurs d'un tableau.
 */
-void Histo2D::PutValue(TMatrix<r_8> &v, int ierr)
-{
-int i,j;
-//if(v.NRows()!=(uint_4)nx || v.NCol()!=(uint_4)ny) THROW(sizeMismatchErr);
-uint_4 nnx = (v.NRows()<(uint_4)nx)? v.NRows(): (uint_4)nx;
-uint_4 nny = (v.NCol() <(uint_4)ny)? v.NCol() : (uint_4)ny;
-if(nnx>0 && nny>0) for(i=0;i<nnx;i++) for(j=0;j<nny;j++) {
+void Histo2D::PutValue(TMatrix<r_8> &v, int_4 ierr)
+{
+//if(v.NRows()!=(uint_4)mNx || v.NCol()!=(uint_4)mNy) THROW(sizeMismatchErr);
+uint_4 nnx = (v.NRows()<(uint_4)mNx)? v.NRows(): (uint_4)mNx;
+uint_4 nny = (v.NCol() <(uint_4)mNy)? v.NCol() : (uint_4)mNy;
+if(nnx>0 && nny>0) for(uint_4 i=0;i<nnx;i++) for(uint_4 j=0;j<nny;j++) {
   (*this)(i,j) = v(i,j);
-  if(err2 && ierr) Error2(i,j) = fabs(v(i,j));
+  if(mErr2 && ierr) Error2(i,j) = fabs(v(i,j));
 }
 return;
@@ -572,13 +589,12 @@
   Addition du contenu de l'histo avec les valeurs d'un tableau.
 */
-void Histo2D::PutValueAdd(TMatrix<r_8> &v, int ierr)
-{
-int i,j;
-//if(v.NRows()!=(uint_4)nx || v.NCol()!=(uint_4)ny) THROW(sizeMismatchErr);
-uint_4 nnx = (v.NRows()<(uint_4)nx)? v.NRows(): (uint_4)nx;
-uint_4 nny = (v.NCol() <(uint_4)ny)? v.NCol() : (uint_4)ny;
-if(nnx>0 && nny>0) for(i=0;i<nnx;i++) for(j=0;j<nny;j++) {
+void Histo2D::PutValueAdd(TMatrix<r_8> &v, int_4 ierr)
+{
+//if(v.NRows()!=(uint_4)mNx || v.NCol()!=(uint_4)mNy) THROW(sizeMismatchErr);
+uint_4 nnx = (v.NRows()<(uint_4)mNx)? v.NRows(): (uint_4)mNx;
+uint_4 nny = (v.NCol() <(uint_4)mNy)? v.NCol() : (uint_4)mNy;
+if(nnx>0 && nny>0) for(uint_4 i=0;i<nnx;i++) for(uint_4 j=0;j<nny;j++) {
   (*this)(i,j) += v(i,j);
-  if(err2 && ierr) Error2(i,j) += fabs(v(i,j));
+  if(mErr2 && ierr) Error2(i,j) += fabs(v(i,j));
 }
 return;
@@ -591,11 +607,10 @@
 void Histo2D::PutError2(TMatrix<r_8> &v)
 {
-int i,j;
-//if(v.NRows()!=(uint_4)nx || v.NCol()!=(uint_4)ny) THROW(sizeMismatchErr);
-uint_4 nnx = (v.NRows()<(uint_4)nx)? v.NRows(): (uint_4)nx;
-uint_4 nny = (v.NCol() <(uint_4)ny)? v.NCol() : (uint_4)ny;
+//if(v.NRows()!=(uint_4)mNx || v.NCol()!=(uint_4)mNy) THROW(sizeMismatchErr);
+uint_4 nnx = (v.NRows()<(uint_4)mNx)? v.NRows(): (uint_4)mNx;
+uint_4 nny = (v.NCol() <(uint_4)mNy)? v.NCol() : (uint_4)mNy;
 if(nnx>0 && nny>0) {
-  if(!err2) Errors();
-  for(i=0;i<nnx;i++) for(j=0;j<nny;j++) Error2(i,j) = v(i,j);
+  if(!mErr2) Errors();
+  for(uint_4 i=0;i<nnx;i++) for(uint_4 j=0;j<nny;j++) Error2(i,j) = v(i,j);
 }
 return;
@@ -608,11 +623,10 @@
 void Histo2D::PutError2Add(TMatrix<r_8> &v)
 {
-int i,j;
-//if(v.NRows()!=(uint_4)nx || v.NCol()!=(uint_4)ny) THROW(sizeMismatchErr);
-uint_4 nnx = (v.NRows()<(uint_4)nx)? v.NRows(): (uint_4)nx;
-uint_4 nny = (v.NCol() <(uint_4)ny)? v.NCol() : (uint_4)ny;
+//if(v.NRows()!=(uint_4)mNx || v.NCol()!=(uint_4)mNy) THROW(sizeMismatchErr);
+uint_4 nnx = (v.NRows()<(uint_4)mNx)? v.NRows(): (uint_4)mNx;
+uint_4 nny = (v.NCol() <(uint_4)mNy)? v.NCol() : (uint_4)mNy;
 if(nnx>0 && nny>0) {
-  if(!err2) Errors();
-  for(i=0;i<nnx;i++) for(j=0;j<nny;j++)
+  if(!mErr2) Errors();
+  for(uint_4 i=0;i<nnx;i++) for(uint_4 j=0;j<nny;j++)
           if(v(i,j)>0.) Error2(i,j) += v(i,j);
 }
@@ -625,11 +639,10 @@
 void Histo2D::PutError(TMatrix<r_8> &v)
 {
-int i,j;
-//if(v.NRows()!=(uint_4)nx || v.NCol()!=(uint_4)ny) THROW(sizeMismatchErr);
-uint_4 nnx = (v.NRows()<(uint_4)nx)? v.NRows(): (uint_4)nx;
-uint_4 nny = (v.NCol() <(uint_4)ny)? v.NCol() : (uint_4)ny;
+//if(v.NRows()!=(uint_4)mNx || v.NCol()!=(uint_4)mNy) THROW(sizeMismatchErr);
+uint_4 nnx = (v.NRows()<(uint_4)mNx)? v.NRows(): (uint_4)mNx;
+uint_4 nny = (v.NCol() <(uint_4)mNy)? v.NCol() : (uint_4)mNy;
 if(nnx>0 && nny>0) {
-  if(!err2) Errors();
-  for(i=0;i<nnx;i++) for(j=0;j<nny;j++)
+  if(!mErr2) Errors();
+  for(uint_4 i=0;i<nnx;i++) for(uint_4 j=0;j<nny;j++)
     if(v(i,j)>0.) Error2(i,j)=v(i,j)*v(i,j); else Error2(i,j)= -v(i,j)*v(i,j);
 }
@@ -642,39 +655,39 @@
   Addition du contenu de l'histo pour x,y poids w.
 */
-void Histo2D::Add(float x, float y, float w)
+void Histo2D::Add(r_8 x, r_8 y, r_8 w)
 {
 list<bande_slice>::iterator it;
-int i,j;
+int_4 i,j;
 FindBin(x,y,i,j);
 
-if( hprojx != NULL ) hprojx->Add(x,w);
-if( hprojy != NULL ) hprojy->Add(y,w);
-
-if(lbandx.size()>0)
-  for( it = lbandx.begin(); it != lbandx.end(); it++)
+if( mHprojx != NULL ) mHprojx->Add(x,w);
+if( mHprojy != NULL ) mHprojy->Add(y,w);
+
+if(mLBandx.size()>0)
+  for( it = mLBandx.begin(); it != mLBandx.end(); it++)
     if( (*it).min <= y && y < (*it).max ) (*it).H->Add(x,w);
 
-if(lbandy.size()>0)
-  for( it = lbandy.begin(); it != lbandy.end(); it++)
+if(mLBandy.size()>0)
+  for( it = mLBandy.begin(); it != mLBandy.end(); it++)
     if( (*it).min <= x && x < (*it).max ) (*it).H->Add(y,w);
 
-if(lslix.size()>0)
-  for( it = lslix.begin(); it != lslix.end(); it++)
+if(mLSlix.size()>0)
+  for( it = mLSlix.begin(); it != mLSlix.end(); it++)
     if( (*it).min <= y && y < (*it).max ) (*it).H->Add(x,w);
 
-if(lsliy.size()>0)
-  for( it = lsliy.begin(); it != lsliy.end(); it++)
+if(mLSliy.size()>0)
+  for( it = mLSliy.begin(); it != mLSliy.end(); it++)
     if( (*it).min <= x && x < (*it).max ) (*it).H->Add(y,w);
 
-if( i<0 || i>=nx || j<0 || j>=ny ) {
-  if(i<0) i=0; else if(i>=nx) i=2; else i=1;
-  if(j<0) j=0; else if(j>=ny) j=2; else j=1;
-  over[i][j] += w;
-  over[1][1] += w;
+if( i<0 || i>=mNx || j<0 || j>=mNy ) {
+  if(i<0) i=0; else if(i>=mNx) i=2; else i=1;
+  if(j<0) j=0; else if(j>=mNy) j=2; else j=1;
+  mOver[i][j] += w;
+  mOver[1][1] += w;
   return;
 }
 
-data[j*nx+i] += w;
-if(err2!=NULL) err2[j*nx+i] += w*w;
+mData[j*mNx+i] += w;
+if(mErr2!=NULL) mErr2[j*mNx+i] += w*w;
 nHist += w;
 nEntries++;
@@ -685,19 +698,19 @@
   Recherche du bin du maximum dans le pave [il,ih][jl,jh].
 */
-void Histo2D::IJMax(int& imax,int& jmax,int il,int ih,int jl,int jh)
-{
-if( il > ih ) { il = 0; ih = nx-1; }
-if( jl > jh ) { jl = 0; jh = ny-1; }
+void Histo2D::IJMax(int_4& imax,int_4& jmax,int_4 il,int_4 ih,int_4 jl,int_4 jh)
+{
+if( il > ih ) { il = 0; ih = mNx-1; }
+if( jl > jh ) { jl = 0; jh = mNy-1; }
 if( il < 0 ) il = 0;
 if( jl < 0 ) jl = 0;
-if( ih >= nx ) ih = nx-1;
-if( jh >= ny ) jh = ny-1;
+if( ih >= mNx ) ih = mNx-1;
+if( jh >= mNy ) jh = mNy-1;
 
 imax = jmax = 0;
-if(nxy==1) return;
-
-float mx=(*this)(il,jl);
-for (int i=il; i<=ih; i++)
-   for (int j=jl; j<=jh; j++)
+if(mNxy==1) return;
+
+r_8 mx=(*this)(il,jl);
+for (int_4 i=il; i<=ih; i++)
+   for (int_4 j=jl; j<=jh; j++)
       if ((*this)(i,j)>mx) {imax = i; jmax = j; mx=(*this)(i,j);}
 }
@@ -706,19 +719,19 @@
   Recherche du bin du minimum dans le pave [il,ih][jl,jh].
 */
-void Histo2D::IJMin(int& imax,int& jmax,int il,int ih,int jl,int jh)
-{
-if( il > ih ) { il = 0; ih = nx-1; }
-if( jl > jh ) { jl = 0; jh = ny-1; }
+void Histo2D::IJMin(int_4& imax,int_4& jmax,int_4 il,int_4 ih,int_4 jl,int_4 jh)
+{
+if( il > ih ) { il = 0; ih = mNx-1; }
+if( jl > jh ) { jl = 0; jh = mNy-1; }
 if( il < 0 ) il = 0;
 if( jl < 0 ) jl = 0;
-if( ih >= nx ) ih = nx-1;
-if( jh >= ny ) jh = ny-1;
+if( ih >= mNx ) ih = mNx-1;
+if( jh >= mNy ) jh = mNy-1;
 
 imax = jmax = 0;
-if(nxy==1) return;
-
-float mx=(*this)(il,jl);
-for (int i=il; i<=ih; i++)
-   for (int j=jl; j<=jh; j++)
+if(mNxy==1) return;
+
+r_8 mx=(*this)(il,jl);
+for (int_4 i=il; i<=ih; i++)
+   for (int_4 j=jl; j<=jh; j++)
       if ((*this)(i,j)<mx) {imax = i; jmax = j; mx=(*this)(i,j);}
 }
@@ -728,17 +741,17 @@
   Recherche du maximum dans le pave [il,ih][jl,jh].
 */
-float Histo2D::VMax(int il,int ih,int jl,int jh) const
-{
-if( il > ih ) { il = 0; ih = nx-1; }
-if( jl > jh ) { jl = 0; jh = ny-1; }
+r_8 Histo2D::VMax(int_4 il,int_4 ih,int_4 jl,int_4 jh) const
+{
+if( il > ih ) { il = 0; ih = mNx-1; }
+if( jl > jh ) { jl = 0; jh = mNy-1; }
 if( il < 0 ) il = 0;
 if( jl < 0 ) jl = 0;
-if( ih >= nx ) ih = nx-1;
-if( jh >= ny ) jh = ny-1;
-
-float mx=(*this)(il,jl);
-if(nxy==1) return mx;
-for (int i=il; i<=ih; i++)
-   for (int j=jl; j<=jh; j++)
+if( ih >= mNx ) ih = mNx-1;
+if( jh >= mNy ) jh = mNy-1;
+
+r_8 mx=(*this)(il,jl);
+if(mNxy==1) return mx;
+for (int_4 i=il; i<=ih; i++)
+   for (int_4 j=jl; j<=jh; j++)
       if ((*this)(i,j)>mx) mx=(*this)(i,j);
 return mx;
@@ -748,17 +761,17 @@
   Recherche du minimum dans le pave [il,ih][jl,jh].
 */
-float Histo2D::VMin(int il,int ih,int jl,int jh) const
-{
-if( il > ih ) { il = 0; ih = nx-1; }
-if( jl > jh ) { jl = 0; jh = ny-1; }
+r_8 Histo2D::VMin(int_4 il,int_4 ih,int_4 jl,int_4 jh) const
+{
+if( il > ih ) { il = 0; ih = mNx-1; }
+if( jl > jh ) { jl = 0; jh = mNy-1; }
 if( il < 0 ) il = 0;
 if( jl < 0 ) jl = 0;
-if( ih >= nx ) ih = nx-1;
-if( jh >= ny ) jh = ny-1;
-
-float mx=(*this)(il,jl);
-if(nxy==1) return mx;
-for (int i=il; i<=ih; i++)
-   for (int j=jl; j<=jh; j++)
+if( ih >= mNx ) ih = mNx-1;
+if( jh >= mNy ) jh = mNy-1;
+
+r_8 mx=(*this)(il,jl);
+if(mNxy==1) return mx;
+for (int_4 i=il; i<=ih; i++)
+   for (int_4 j=jl; j<=jh; j++)
       if ((*this)(i,j)<mx) mx=(*this)(i,j);
 return mx;
@@ -769,5 +782,5 @@
   Renvoie les under.overflow dans les 8 quadrants.
   \verbatim
-     over[3][3]:        20 | 21 | 22
+     mOver[3][3]:       20 | 21 | 22
                            |    |
                        --------------
@@ -780,8 +793,8 @@
   \endverbatim
 */
-float Histo2D::NOver(int i,int j) const
-{
-if( i < 0 || i>=3 || j < 0 || j>=3 ) return over[1][1];
-return over[i][j];
+r_8 Histo2D::NOver(int_4 i,int_4 j) const
+{
+if( i < 0 || i>=3 || j < 0 || j>=3 ) return mOver[1][1];
+return mOver[i][j];
 }
 
@@ -791,8 +804,8 @@
   Retourne le nombre de bins non-nuls.
 */
-int Histo2D::BinNonNul() const
-{
-int non=0;
-for (int i=0;i<nxy;i++) if( data[i] != 0. ) non++;
+int_4 Histo2D::BinNonNul() const
+{
+int_4 non=0;
+for (int_4 i=0;i<mNxy;i++) if( mData[i] != 0. ) non++;
 return non;
 }
@@ -801,9 +814,9 @@
   Retourne le nombre de bins avec erreurs non-nulles.
 */
-int Histo2D::ErrNonNul() const
-{
-if(err2==NULL) return -1;
-int non=0;
-for (int i=0;i<nxy;i++) if( err2[i] != 0. ) non++;
+int_4 Histo2D::ErrNonNul() const
+{
+if(mErr2==NULL) return -1;
+int_4 non=0;
+for (int_4 i=0;i<mNxy;i++) if( mErr2[i] != 0. ) non++;
 return non;
 }
@@ -813,8 +826,8 @@
   Idem EstimeMax(int...) mais retourne x,y.
 */
-int Histo2D::EstimeMax(float& xm,float& ym,int SzPav
-                      ,int il,int ih,int jl,int jh)
-{
-int im,jm;
+int_4 Histo2D::EstimeMax(r_8& xm,r_8& ym,int_4 SzPav
+                      ,int_4 il,int_4 ih,int_4 jl,int_4 jh)
+{
+int_4 im,jm;
 IJMax(im,jm,il,ih,jl,jh);
 return EstimeMax(im,jm,xm,ym,SzPav);
@@ -833,21 +846,21 @@
   \endverbatim
 */
-int Histo2D::EstimeMax(int im,int jm,float& xm,float& ym,int SzPav)
+int_4 Histo2D::EstimeMax(int_4 im,int_4 jm,r_8& xm,r_8& ym,int_4 SzPav)
 {
 xm = ym = 0;
 if( SzPav <= 0 ) return -1;
-if( im < 0 || im >= nx ) return -1;
-if( jm < 0 || jm >= ny ) return -1;
+if( im < 0 || im >= mNx ) return -1;
+if( jm < 0 || jm >= mNy ) return -1;
 
 if( SzPav%2 == 0 ) SzPav++;
 SzPav = (SzPav-1)/2;
 
-int rc = 0;
-double dxm = 0, dym = 0, wx = 0;
-for(int i=im-SzPav;i<=im+SzPav;i++) {
-  if( i<0 || i>= nx ) {rc=1; continue;}
-  for(int j=jm-SzPav;j<=jm+SzPav;j++) {
-    if( j<0 || j>= ny ) {rc=1; continue;}
-    float x,y;
+int_4 rc = 0;
+r_8 dxm = 0, dym = 0, wx = 0;
+for(int_4 i=im-SzPav;i<=im+SzPav;i++) {
+  if( i<0 || i>= mNx ) {rc=1; continue;}
+  for(int_4 j=jm-SzPav;j<=jm+SzPav;j++) {
+    if( j<0 || j>= mNy ) {rc=1; continue;}
+    r_8 x,y;
     BinCenter(i,j,x,y);
     dxm += x * (*this)(i,j);
@@ -888,31 +901,31 @@
   \endverbatim
 */
-int Histo2D::FindMax(int& im,int& jm,int SzPav,float Dz
-                    ,int il,int ih,int jl,int jh)
-{
-if( il > ih ) { il = 0; ih = nx-1; }
-if( jl > jh ) { jl = 0; jh = ny-1; }
+int_4 Histo2D::FindMax(int_4& im,int_4& jm,int_4 SzPav,r_8 Dz
+                    ,int_4 il,int_4 ih,int_4 jl,int_4 jh)
+{
+if( il > ih ) { il = 0; ih = mNx-1; }
+if( jl > jh ) { jl = 0; jh = mNy-1; }
 if( il < 0 ) il = 0;
 if( jl < 0 ) jl = 0;
-if( ih >= nx ) ih = nx-1;
-if( jh >= ny ) jh = ny-1;
+if( ih >= mNx ) ih = mNx-1;
+if( jh >= mNy ) jh = mNy-1;
 if( SzPav < 0 ) SzPav = 0;
   else { if( SzPav%2 == 0 ) SzPav++; SzPav = (SzPav-1)/2;}
 if( Dz < 0 ) Dz = 0.;
-float max = VMax(il,ih,jl,jh) - Dz;
-int nmax = 0;
-float sumx = -MAXFLOAT;
-for(int i=il;i<=ih;i++) for(int j=jl;j<=jh;j++) {
+r_8 max = VMax(il,ih,jl,jh) - Dz;
+int_4 nmax = 0;
+r_8 sumx = -1.e20;
+for(int_4 i=il;i<=ih;i++) for(int_4 j=jl;j<=jh;j++) {
   if( (*this)(i,j) < max) continue;
   nmax++;
-  float sum = 0.;
-  for(int ii=i-SzPav;ii<=i+SzPav;ii++) {
-    if( ii<0 || ii >= nx ) continue;
-    for(int jj=j-SzPav;jj<=j+SzPav;jj++) {
-      if( jj<0 || jj >= ny ) continue;
+  r_8 sum = 0.;
+  for(int_4 ii=i-SzPav;ii<=i+SzPav;ii++) {
+    if( ii<0 || ii >= mNx ) continue;
+    for(int_4 jj=j-SzPav;jj<=j+SzPav;jj++) {
+      if( jj<0 || jj >= mNy ) continue;
       sum += (*this)(ii,jj);
     }
   }
-  if( sum > sumx ) { im = i; jm = j; sumx = sum;}
+  if(nmax==1 || sum>sumx) {im=i; jm=j; sumx=sum;}
 }
 if( nmax <= 0 ) { IJMax(im,jm,il,ih,jl,jh); return 1;}
@@ -943,5 +956,5 @@
   \endverbatim
 */
-int  Histo2D::Fit(GeneralFit& gfit,unsigned short typ_err)
+int_4  Histo2D::Fit(GeneralFit& gfit,unsigned short typ_err)
 {
 if(NBinX()*NBinY()<=0) return -1000;
@@ -950,10 +963,10 @@
 GeneralFitData mydata(2,NBinX()*NBinY());
 
-for(int i=0;i<NBinX();i++) for(int j=0;j<NBinY();j++) {
-  float x,y;
+for(int_4 i=0;i<NBinX();i++) for(int_4 j=0;j<NBinY();j++) {
+  r_8 x,y;
   BinCenter(i,j,x,y);
-  double f = (double) (*this)(i,j);
-  double saf = sqrt(fabs(f)); if(saf<1.) saf=1.;
-  double e=0.;
+  r_8 f = (*this)(i,j);
+  r_8 saf = sqrt(fabs(f)); if(saf<1.) saf=1.;
+  r_8 e=0.;
   if(typ_err==0)      {if(HasErrors()) e=Error(i,j); else e=1.;}
   else if(typ_err==1) {if(HasErrors()) e=Error(i,j); else e=saf;}
@@ -962,5 +975,5 @@
   else if(typ_err==4) e=(f==0.)?0.:1.;
   else if(typ_err==5) e=(f==0.)?0.:saf;
-  mydata.AddData2((double) x,(double) y,f,e);
+  mydata.AddData2(x,y,f,e);
 }
 
@@ -982,9 +995,9 @@
 TVector<r_8> par = gfit.GetParm();
 Histo2D h2(*this);
-for(int i=0;i<NBinX();i++) for(int j=0;j<NBinY();j++) {
-  float xc,yc;
+for(int_4 i=0;i<NBinX();i++) for(int_4 j=0;j<NBinY();j++) {
+  r_8 xc,yc;
   BinCenter(i,j,xc,yc);
-  double x[2] = {(double)xc,(double)yc};
-  h2(i,j) -= (float) f->Value(x,par.Data());
+  r_8 x[2] = {xc,yc};
+  h2(i,j) -= f->Value(x,par.Data());
 }
 return h2;
@@ -1003,9 +1016,9 @@
 TVector<r_8> par = gfit.GetParm();
 Histo2D h2(*this);
-for(int i=0;i<NBinX();i++) for(int j=0;j<NBinY();j++) {
-  float xc,yc;
+for(int_4 i=0;i<NBinX();i++) for(int_4 j=0;j<NBinY();j++) {
+  r_8 xc,yc;
   BinCenter(i,j,xc,yc);
-  double x[2] = {(double)xc,(double)yc};
-  h2(i,j) = (float) f->Value(x,par.Data());
+  r_8 x[2] = {xc,yc};
+  h2(i,j) = f->Value(x,par.Data());
 }
 return h2;
@@ -1020,10 +1033,10 @@
 printf("~Histo::Print    nHist=%g nEntries=%d",nHist,nEntries);
 if(HasErrors()) printf("  Errors=1\n"); else printf("  Errors=0\n");
-printf("over: [ %g %g %g // %g %g %g  // %g %g %g ]\n"
-      ,over[2][0],over[2][1],over[2][2]
-      ,over[1][0],over[1][1],over[1][2]
-      ,over[0][0],over[0][1],over[0][2]);
-printf("  nx=%d xmin=%g xmax=%g binx=%g  ",nx,xmin,xmax,wbinx);
-printf("  ny=%d ymin=%g ymax=%g biny=%g\n",ny,ymin,ymax,wbiny);
+printf("mOver: [ %g %g %g // %g %g %g  // %g %g %g ]\n"
+      ,mOver[2][0],mOver[2][1],mOver[2][2]
+      ,mOver[1][0],mOver[1][1],mOver[1][2]
+      ,mOver[0][0],mOver[0][1],mOver[0][2]);
+printf("  nx=%d xmin=%g xmax=%g binx=%g  ",mNx,mXmin,mXmax,mWBinx);
+printf("  ny=%d ymin=%g ymax=%g biny=%g\n",mNy,mYmin,mYmax,mWBiny);
 }
 
@@ -1038,21 +1051,21 @@
   \endverbatim
 */
-void Histo2D::Print(float min,float max
-                   ,int il,int ih,int jl,int jh)
-{
-int ns = 35;
+void Histo2D::Print(r_8 min,r_8 max
+                   ,int_4 il,int_4 ih,int_4 jl,int_4 jh)
+{
+int_4 ns = 35;
 const char *s =    "+23456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
 
-if( il > ih ) { il = 0; ih = nx-1; }
-if( jl > jh ) { jl = 0; jh = ny-1; }
+if( il > ih ) { il = 0; ih = mNx-1; }
+if( jl > jh ) { jl = 0; jh = mNy-1; }
 if( il < 0 ) il = 0;
 if( jl < 0 ) jl = 0;
-if( ih >= nx ) ih = nx-1;
-if( jh >= ny ) jh = ny-1;
+if( ih >= mNx ) ih = mNx-1;
+if( jh >= mNy ) jh = mNy-1;
 
 PrintStatus();
 
-if( il != 0 || ih != nx-1 || jl != 0 || jh != ny-1 ) {
-  float xl,xh,yl,yh;
+if( il != 0 || ih != mNx-1 || jl != 0 || jh != mNy-1 ) {
+  r_8 xl,xh,yl,yh;
   BinLowEdge(il,jl,xl,yl);
   BinHighEdge(ih,jh,xh,yh);
@@ -1072,26 +1085,26 @@
 // imprime numero de bin en colonne
 printf("\n");
-if( nx-1 >= 100 ) {
+if( mNx-1 >= 100 ) {
   printf("     ");
-  for(int i=il;i<=ih;i++) printf("%1d",(int) (i%1000)/100);
+  for(int_4 i=il;i<=ih;i++) printf("%1d",(int_4) (i%1000)/100);
   printf("\n");
 }
-if( nx-1 >= 10 ) {
+if( mNx-1 >= 10 ) {
   printf("     ");
-  for(int i=il;i<=ih;i++) printf("%1d",(int) (i%100)/10);
+  for(int_4 i=il;i<=ih;i++) printf("%1d",(int_4) (i%100)/10);
   printf("\n");
 }
 printf("     ");
-for(int i=il;i<=ih;i++) printf("%1d",i%10);
+for(int_4 i=il;i<=ih;i++) printf("%1d",i%10);
 printf("\n");
-printf("     "); {for(int i=il;i<=ih;i++) printf("-"); printf("\n");}
+printf("     "); {for(int_4 i=il;i<=ih;i++) printf("-"); printf("\n");}
 
 // imprime histogramme
-for(int j=jh;j>=jl;j--) {
+for(int_4 j=jh;j>=jl;j--) {
   printf("%3d: ",j);
-  for(int i=il;i<=ih;i++) {
-    int h;
-    if( 1<=max-min && max-min<=35 ) h = (int)( (*this)(i,j) - min ) - 1;
-      else h = (int)( ((*this)(i,j)-min)/(max-min) * ns ) - 1;
+  for(int_4 i=il;i<=ih;i++) {
+    int_4 h;
+    if( 1<=max-min && max-min<=35 ) h = (int_4)( (*this)(i,j) - min ) - 1;
+      else h = (int_4)( ((*this)(i,j)-min)/(max-min) * ns ) - 1;
     char c;
     if(h<0 && (*this)(i,j)>min) c = '.';
@@ -1105,17 +1118,17 @@
 
 // imprime numero de bin en colonne
-printf("     "); {for(int i=il;i<=ih;i++) printf("-"); printf("\n");}
-if( nx-1 >= 100 ) {
+printf("     "); {for(int_4 i=il;i<=ih;i++) printf("-"); printf("\n");}
+if( mNx-1 >= 100 ) {
   printf("     ");
-  for(int i=il;i<=ih;i++) printf("%1d",(int) (i%1000)/100);
+  for(int_4 i=il;i<=ih;i++) printf("%1d",(int_4) (i%1000)/100);
   printf("\n");
 }
-if( nx-1 >= 10 ) {
+if( mNx-1 >= 10 ) {
   printf("     ");
-  for(int i=il;i<=ih;i++) printf("%1d",(int) (i%100)/10);
+  for(int_4 i=il;i<=ih;i++) printf("%1d",(int_4) (i%100)/10);
   printf("\n");
 }
 printf("     ");
-{for(int i=il;i<=ih;i++) printf("%1d",i%10);}
+{for(int_4 i=il;i<=ih;i++) printf("%1d",i%10);}
 printf("\n");
 
@@ -1130,7 +1143,7 @@
 void Histo2D::SetProjX()
 {
-if( hprojx != NULL ) DelProjX();
-hprojx = new Histo(xmin,xmax,nx);
-if( err2 != NULL && hprojx != NULL ) hprojx->Errors();
+if( mHprojx != NULL ) DelProjX();
+mHprojx = new Histo(mXmin,mXmax,mNx);
+if( mErr2 != NULL && mHprojx != NULL ) mHprojx->Errors();
 }
 
@@ -1140,7 +1153,7 @@
 void Histo2D::SetProjY()
 {
-if( hprojy != NULL ) DelProjY();
-hprojy = new Histo(ymin,ymax,ny);
-if( err2 != NULL && hprojy != NULL  ) hprojy->Errors();
+if( mHprojy != NULL ) DelProjY();
+mHprojy = new Histo(mYmin,mYmax,mNy);
+if( mErr2 != NULL && mHprojy != NULL  ) mHprojy->Errors();
 }
 
@@ -1159,7 +1172,7 @@
 void Histo2D::ShowProj()
 {
-if( hprojx != NULL ) cout << ">>>> Projection X set : "<< hprojx <<endl;
+if( mHprojx != NULL ) cout << ">>>> Projection X set : "<< mHprojx <<endl;
   else cout << ">>>> NO Projection X set"<<endl;
-if( hprojy != NULL ) cout << ">>>> Projection Y set : "<< hprojy <<endl;
+if( mHprojy != NULL ) cout << ">>>> Projection Y set : "<< mHprojy <<endl;
   else cout << ">>>> NO Projection Y set"<<endl;
 }
@@ -1170,7 +1183,7 @@
 void Histo2D::DelProjX()
 {
-if( hprojx == NULL ) return;
-delete hprojx;
-hprojx = NULL;
+if( mHprojx == NULL ) return;
+delete mHprojx;
+mHprojx = NULL;
 }
 
@@ -1180,7 +1193,7 @@
 void Histo2D::DelProjY()
 {
-if( hprojy == NULL ) return;
-delete hprojy;
-hprojy = NULL;
+if( mHprojy == NULL ) return;
+delete mHprojy;
+mHprojy = NULL;
 }
 
@@ -1199,6 +1212,6 @@
 void Histo2D::ZeroProjX()
 {
-if( hprojx == NULL ) return;
-hprojx->Zero();
+if( mHprojx == NULL ) return;
+mHprojx->Zero();
 }
 
@@ -1208,6 +1221,6 @@
 void Histo2D::ZeroProjY()
 {
-if( hprojy == NULL ) return;
-hprojy->Zero();
+if( mHprojy == NULL ) return;
+mHprojy->Zero();
 }
 
@@ -1227,13 +1240,13 @@
   Pour creer une bande en X entre ybmin et ybmax.
 */
-int Histo2D::SetBandX(float ybmin,float ybmax)
-{
-b_s.num = lbandx.size();
-b_s.min = ybmin;
-b_s.max = ybmax;
-b_s.H = new Histo(xmin,xmax,nx);
-lbandx.push_back(b_s);
-b_s.H = NULL;
-return lbandx.size()-1;
+int_4 Histo2D::SetBandX(r_8 ybmin,r_8 ybmax)
+{
+mB_s.num = mLBandx.size();
+mB_s.min = ybmin;
+mB_s.max = ybmax;
+mB_s.H = new Histo(mXmin,mXmax,mNx);
+mLBandx.push_back(mB_s);
+mB_s.H = NULL;
+return mLBandx.size()-1;
 }
 
@@ -1241,13 +1254,13 @@
   Pour creer une bande en Y entre xbmin et xbmax.
 */
-int Histo2D::SetBandY(float xbmin,float xbmax)
-{
-b_s.num = lbandy.size();
-b_s.min = xbmin;
-b_s.max = xbmax;
-b_s.H = new Histo(ymin,ymax,ny);
-lbandy.push_back(b_s);
-b_s.H = NULL;
-return lbandy.size()-1;
+int_4 Histo2D::SetBandY(r_8 xbmin,r_8 xbmax)
+{
+mB_s.num = mLBandy.size();
+mB_s.min = xbmin;
+mB_s.max = xbmax;
+mB_s.H = new Histo(mYmin,mYmax,mNy);
+mLBandy.push_back(mB_s);
+mB_s.H = NULL;
+return mLBandy.size()-1;
 }
 
@@ -1257,8 +1270,8 @@
 void Histo2D::DelBandX()
 {
-if( lbandx.size() <= 0 ) return;
-for(list<bande_slice>::iterator i = lbandx.begin(); i != lbandx.end(); i++)
+if( mLBandx.size() <= 0 ) return;
+for(list<bande_slice>::iterator i = mLBandx.begin(); i != mLBandx.end(); i++)
        if( (*i).H != NULL ) {delete (*i).H; (*i).H=NULL;}
-lbandx.erase(lbandx.begin(),lbandx.end());
+mLBandx.erase(mLBandx.begin(),mLBandx.end());
 }
 
@@ -1268,8 +1281,8 @@
 void Histo2D::DelBandY()
 {
-if( lbandy.size() <= 0 ) return;
-for(list<bande_slice>::iterator i = lbandy.begin(); i != lbandy.end(); i++)
+if( mLBandy.size() <= 0 ) return;
+for(list<bande_slice>::iterator i = mLBandy.begin(); i != mLBandy.end(); i++)
        if( (*i).H != NULL ) {delete (*i).H; (*i).H=NULL;}
-lbandy.erase(lbandy.begin(),lbandy.end());
+mLBandy.erase(mLBandy.begin(),mLBandy.end());
 }
 
@@ -1279,7 +1292,7 @@
 void Histo2D::ZeroBandX()
 {
-if( lbandx.size() <= 0 ) return;
+if( mLBandx.size() <= 0 ) return;
 list<bande_slice>::iterator i;
-for(i = lbandx.begin(); i != lbandx.end(); i++)
+for(i = mLBandx.begin(); i != mLBandx.end(); i++)
               (*i).H->Zero();
 }
@@ -1290,7 +1303,7 @@
 void Histo2D::ZeroBandY()
 {
-if( lbandy.size() <= 0 ) return;
+if( mLBandy.size() <= 0 ) return;
 list<bande_slice>::iterator i;
-for(i = lbandy.begin(); i != lbandy.end(); i++)
+for(i = mLBandy.begin(); i != mLBandy.end(); i++)
               (*i).H->Zero();
 }
@@ -1299,8 +1312,8 @@
   Retourne un pointeur sur la bande numero `n' selon X.
 */
-Histo* Histo2D::HBandX(int n) const
-{
-if( lbandx.size() <= 0 || n < 0 || n >= (int) lbandx.size() ) return NULL;
-for(list<bande_slice>::const_iterator i = lbandx.begin(); i != lbandx.end(); i++)
+Histo* Histo2D::HBandX(int_4 n) const
+{
+if( mLBandx.size() <= 0 || n < 0 || n >= (int_4) mLBandx.size() ) return NULL;
+for(list<bande_slice>::const_iterator i = mLBandx.begin(); i != mLBandx.end(); i++)
               if( (*i).num == n ) return (*i).H;
 return NULL;
@@ -1310,8 +1323,8 @@
   Retourne un pointeur sur la bande numero `n' selon Y.
 */
-Histo* Histo2D::HBandY(int n) const
-{
-if( lbandy.size() <= 0 || n < 0 || n >= (int) lbandy.size() ) return NULL;
-for(list<bande_slice>::const_iterator i = lbandy.begin(); i != lbandy.end(); i++)
+Histo* Histo2D::HBandY(int_4 n) const
+{
+if( mLBandy.size() <= 0 || n < 0 || n >= (int_4) mLBandy.size() ) return NULL;
+for(list<bande_slice>::const_iterator i = mLBandy.begin(); i != mLBandy.end(); i++)
               if( (*i).num == n ) return (*i).H;
 return NULL;
@@ -1321,9 +1334,9 @@
   Retourne les limites de la bande numero `n' selon X.
 */
-void Histo2D::GetBandX(int n,float& ybmin,float& ybmax) const
+void Histo2D::GetBandX(int_4 n,r_8& ybmin,r_8& ybmax) const
 {
 ybmin = 0.; ybmax = 0.;
-if( lbandx.size() <= 0 || n < 0 || n >= (int) lbandx.size() ) return;
-for(list<bande_slice>::const_iterator i = lbandx.begin(); i != lbandx.end(); i++)
+if( mLBandx.size() <= 0 || n < 0 || n >= (int_4) mLBandx.size() ) return;
+for(list<bande_slice>::const_iterator i = mLBandx.begin(); i != mLBandx.end(); i++)
   if( (*i).num == n ) { ybmin = (*i).min; ybmax = (*i).max; return;}
 return;
@@ -1333,9 +1346,9 @@
   Retourne les limites de la bande numero `n' selon Y.
 */
-void Histo2D::GetBandY(int n,float& xbmin,float& xbmax) const
+void Histo2D::GetBandY(int_4 n,r_8& xbmin,r_8& xbmax) const
 {
 xbmin = 0.; xbmax = 0.;
-if( lbandy.size() <= 0 || n < 0 || n >= (int) lbandy.size() ) return;
-for(list<bande_slice>::const_iterator i = lbandy.begin(); i != lbandy.end(); i++)
+if( mLBandy.size() <= 0 || n < 0 || n >= (int_4) mLBandy.size() ) return;
+for(list<bande_slice>::const_iterator i = mLBandy.begin(); i != mLBandy.end(); i++)
   if( (*i).num == n ) { xbmin = (*i).min; xbmax = (*i).max; return;}
 return;
@@ -1345,10 +1358,10 @@
   Informations sur les bandes.
 */
-void Histo2D::ShowBand(int lp)
-{
-  cout << ">>>> Nombre de bande X : " << lbandx.size() << endl;
-if( lp>0 && lbandx.size()>0 ) {
+void Histo2D::ShowBand(int_4 lp)
+{
+  cout << ">>>> Nombre de bande X : " << mLBandx.size() << endl;
+if( lp>0 && mLBandx.size()>0 ) {
   list<bande_slice>::iterator i;
-  for(i = lbandx.begin(); i != lbandx.end(); i++) {
+  for(i = mLBandx.begin(); i != mLBandx.end(); i++) {
     cout<<"  "<<(*i).num<<" de ymin="<<(*i).min<<" a ymax="<<(*i).max;
     if(lp>1) cout << "   H=" << (*i).H;
@@ -1357,8 +1370,8 @@
 }
 
-cout << ">>>> Nombre de bande Y : " << lbandy.size() << endl;
-if( lp>0 && lbandy.size()>0 ) {
+cout << ">>>> Nombre de bande Y : " << mLBandy.size() << endl;
+if( lp>0 && mLBandy.size()>0 ) {
   list<bande_slice>::iterator i;
-  for(i = lbandy.begin(); i != lbandy.end(); i++) {
+  for(i = mLBandy.begin(); i != mLBandy.end(); i++) {
     cout<<"  "<<(*i).num<<" de xmin="<<(*i).min<<" a xmax="<<(*i).max;
     if(lp>1) cout << "   H=" << (*i).H;
@@ -1374,20 +1387,20 @@
   Pour creer `nsli' bandes equidistantes selon X.
 */
-int Histo2D::SetSliX(int nsli)
+int_4 Histo2D::SetSliX(int_4 nsli)
 {
 if( nsli <= 0 ) return -1;
-if( nsli >  ny ) nsli = ny;
-if( lslix.size() > 0 ) DelSliX();
-float w = (ymax-ymin)/nsli;
-
-for(int i=0; i<nsli; i++ ) {
-  b_s.num = i;
-  b_s.min = ymin + i*w;
-  b_s.max = b_s.min + w;
-  b_s.H = new Histo(xmin,xmax,nx);
-  lslix.push_back(b_s);
-  b_s.H = NULL;
-}
-return (int) lslix.size();
+if( nsli >  mNy ) nsli = mNy;
+if( mLSlix.size() > 0 ) DelSliX();
+r_8 w = (mYmax-mYmin)/nsli;
+
+for(int_4 i=0; i<nsli; i++ ) {
+  mB_s.num = i;
+  mB_s.min = mYmin + i*w;
+  mB_s.max = mB_s.min + w;
+  mB_s.H = new Histo(mXmin,mXmax,mNx);
+  mLSlix.push_back(mB_s);
+  mB_s.H = NULL;
+}
+return (int_4) mLSlix.size();
 }
 
@@ -1395,20 +1408,20 @@
   Pour creer `nsli' bandes equidistantes selon Y.
 */
-int Histo2D::SetSliY(int nsli)
+int_4 Histo2D::SetSliY(int_4 nsli)
 {
 if( nsli <= 0 ) return -1;
-if( nsli >  nx ) nsli = nx;
-if( lsliy.size() > 0 ) DelSliY();
-float w = (xmax-xmin)/nsli;
-
-for(int i=0; i<nsli; i++ ) {
-  b_s.num = i;
-  b_s.min = xmin + i*w;
-  b_s.max = b_s.min + w;
-  b_s.H = new Histo(ymin,ymax,ny);
-  lsliy.push_back(b_s);
-  b_s.H = NULL;
-}
-return (int) lsliy.size();
+if( nsli >  mNx ) nsli = mNx;
+if( mLSliy.size() > 0 ) DelSliY();
+r_8 w = (mXmax-mXmin)/nsli;
+
+for(int_4 i=0; i<nsli; i++ ) {
+  mB_s.num = i;
+  mB_s.min = mXmin + i*w;
+  mB_s.max = mB_s.min + w;
+  mB_s.H = new Histo(mYmin,mYmax,mNy);
+  mLSliy.push_back(mB_s);
+  mB_s.H = NULL;
+}
+return (int_4) mLSliy.size();
 }
 
@@ -1418,8 +1431,8 @@
 void Histo2D::DelSliX()
 {
-if( lslix.size() <= 0 ) return;
-for(list<bande_slice>::iterator i = lslix.begin(); i != lslix.end(); i++)
+if( mLSlix.size() <= 0 ) return;
+for(list<bande_slice>::iterator i = mLSlix.begin(); i != mLSlix.end(); i++)
        if( (*i).H != NULL ) {delete (*i).H; (*i).H=NULL;}
-lslix.erase(lslix.begin(),lslix.end());
+mLSlix.erase(mLSlix.begin(),mLSlix.end());
 }
 
@@ -1429,8 +1442,8 @@
 void Histo2D::DelSliY()
 {
-if( lsliy.size() <= 0 ) return;
-for(list<bande_slice>::iterator i = lsliy.begin(); i != lsliy.end(); i++)
+if( mLSliy.size() <= 0 ) return;
+for(list<bande_slice>::iterator i = mLSliy.begin(); i != mLSliy.end(); i++)
        if( (*i).H != NULL ) {delete (*i).H; (*i).H=NULL;}
-lsliy.erase(lsliy.begin(),lsliy.end());
+mLSliy.erase(mLSliy.begin(),mLSliy.end());
 }
 
@@ -1440,7 +1453,7 @@
 void Histo2D::ZeroSliX()
 {
-if( lslix.size() <= 0 ) return;
+if( mLSlix.size() <= 0 ) return;
 list<bande_slice>::iterator i;
-for(i = lslix.begin(); i != lslix.end(); i++)
+for(i = mLSlix.begin(); i != mLSlix.end(); i++)
               (*i).H->Zero();
 }
@@ -1451,7 +1464,7 @@
 void Histo2D::ZeroSliY()
 {
-if( lsliy.size() <= 0 ) return;
+if( mLSliy.size() <= 0 ) return;
 list<bande_slice>::iterator i;
-for(i = lsliy.begin(); i != lsliy.end(); i++)
+for(i = mLSliy.begin(); i != mLSliy.end(); i++)
               (*i).H->Zero();
 }
@@ -1461,8 +1474,8 @@
   selon X.
 */
-Histo* Histo2D::HSliX(int n) const
-{
-if( lslix.size() <= 0 || n < 0 || n >= (int) lslix.size() ) return NULL;
-for(list<bande_slice>::const_iterator i = lslix.begin(); i != lslix.end(); i++)
+Histo* Histo2D::HSliX(int_4 n) const
+{
+if( mLSlix.size() <= 0 || n < 0 || n >= (int_4) mLSlix.size() ) return NULL;
+for(list<bande_slice>::const_iterator i = mLSlix.begin(); i != mLSlix.end(); i++)
               if( (*i).num == n ) return (*i).H;
 return NULL;
@@ -1473,8 +1486,8 @@
   selon Y.
 */
-Histo* Histo2D::HSliY(int n) const
-{
-if( lsliy.size() <= 0 || n < 0 || n >= (int) lsliy.size() ) return NULL;
-for(list<bande_slice>::const_iterator i = lsliy.begin(); i != lsliy.end(); i++)
+Histo* Histo2D::HSliY(int_4 n) const
+{
+if( mLSliy.size() <= 0 || n < 0 || n >= (int_4) mLSliy.size() ) return NULL;
+for(list<bande_slice>::const_iterator i = mLSliy.begin(); i != mLSliy.end(); i++)
               if( (*i).num == n ) return (*i).H;
 return NULL;
@@ -1484,10 +1497,10 @@
   Informations sur les bandes equidistantes.
 */
-void Histo2D::ShowSli(int lp)
+void Histo2D::ShowSli(int_4 lp)
 {
 list<bande_slice>::iterator i;
-cout << ">>>> Nombre de slice X : " << lslix.size() << endl;
-if( lp>0 && lslix.size() > 0 )
-  for(i = lslix.begin(); i != lslix.end(); i++) {
+cout << ">>>> Nombre de slice X : " << mLSlix.size() << endl;
+if( lp>0 && mLSlix.size() > 0 )
+  for(i = mLSlix.begin(); i != mLSlix.end(); i++) {
     cout<<"  "<<(*i).num<<" de ymin="<<(*i).min<<" a ymax="<<(*i).max;
     if(lp>1) cout << "   H=" << (*i).H;
@@ -1495,7 +1508,7 @@
   }
 
-cout << ">>>> Nombre de slice Y : " << lsliy.size() << endl;
-if( lp>0 && lsliy.size()>0 )
-  for(i = lsliy.begin(); i != lsliy.end(); i++) {
+cout << ">>>> Nombre de slice Y : " << mLSliy.size() << endl;
+if( lp>0 && mLSliy.size()>0 )
+  for(i = mLSliy.begin(); i != mLSliy.end(); i++) {
     cout<<"  "<<(*i).num<<" de xmin="<<(*i).min<<" a xmax="<<(*i).max;
     if(lp>1) cout << "   H=" << (*i).H;
@@ -1518,5 +1531,5 @@
   else         dobj->Delete();
 
-float min,max;
+r_8 min,max;
 int_4 errok, projx, projy, nslix, nsliy, nbanx, nbany;
 
@@ -1530,19 +1543,19 @@
 
 // Lecture variables de definitions
-is.Get(dobj->nx);
-is.Get(dobj->ny);
-is.Get(dobj->nxy);
+is.Get(dobj->mNx);
+is.Get(dobj->mNy);
+is.Get(dobj->mNxy);
 is.Get(errok);
 is.Get(dobj->nEntries);
 is.Get(dobj->nHist);
 
-is.Get(dobj->xmin);
-is.Get(dobj->xmax);
-is.Get(dobj->ymin);
-is.Get(dobj->ymax);
-is.Get(dobj->wbinx);
-is.Get(dobj->wbiny);
-
-is.Get(&(dobj->over[0][0]),9);
+is.Get(dobj->mXmin);
+is.Get(dobj->mXmax);
+is.Get(dobj->mYmin);
+is.Get(dobj->mYmax);
+is.Get(dobj->mWBinx);
+is.Get(dobj->mWBiny);
+
+is.Get(&(dobj->mOver[0][0]),9);
 
 is.Get(projx);
@@ -1554,13 +1567,13 @@
 
 // Lecture histo2D
-dobj->data = new float[dobj->nxy];
+dobj->mData = new r_8[dobj->mNxy];
 is.GetLine(strg, 255);
-{for(int j=0;j<dobj->ny;j++) is.Get(dobj->data+j*dobj->nx,dobj->nx);}
+{for(int_4 j=0;j<dobj->mNy;j++) is.Get(dobj->mData+j*dobj->mNx,dobj->mNx);}
 
 // Lecture erreurs
 if(errok) {
   is.GetLine(strg, 255);
-  dobj->err2 = new double[dobj->nxy];
-  for(int j=0;j<dobj->ny;j++) is.Get(dobj->err2+j*dobj->nx,dobj->nx);
+  dobj->mErr2 = new r_8[dobj->mNxy];
+  for(int_4 j=0;j<dobj->mNy;j++) is.Get(dobj->mErr2+j*dobj->mNx,dobj->mNx);
 }
 
@@ -1569,5 +1582,5 @@
   is.GetLine(strg, 255);
   dobj->SetProjX();
-  ObjFileIO<Histo> fio_h(dobj->hprojx);
+  ObjFileIO<Histo> fio_h(dobj->mHprojx);
   fio_h.Read(is);
 }
@@ -1575,5 +1588,5 @@
   is.GetLine(strg, 255);
   dobj->SetProjY();
-  ObjFileIO<Histo> fio_h(dobj->hprojy);
+  ObjFileIO<Histo> fio_h(dobj->mHprojy);
   fio_h.Read(is);
 }
@@ -1584,5 +1597,5 @@
   dobj->SetSliX(nslix);
   ASSERT (nslix==dobj->NSliX());
-  for(int j=0;j<dobj->NSliX();j++)
+  for(int_4 j=0;j<dobj->NSliX();j++)
     {ObjFileIO<Histo> fio_h(dobj->HSliX(j)); fio_h.Read(is);}
 }
@@ -1591,5 +1604,5 @@
   dobj->SetSliY(nsliy);
   ASSERT (nsliy==dobj->NSliY());
-  for(int j=0;j<dobj->NSliY();j++)
+  for(int_4 j=0;j<dobj->NSliY();j++)
     {ObjFileIO<Histo> fio_h(dobj->HSliY(j)); fio_h.Read(is);}
 }
@@ -1598,10 +1611,10 @@
 if( nbanx>0 ) {
   is.GetLine(strg, 255);
-  {for(int j=0; j<nbanx; j++) {
+  {for(int_4 j=0; j<nbanx; j++) {
     is.Get(min); is.Get(max);
     dobj->SetBandX(min,max);
   }}
   ASSERT (nbanx==dobj->NBandX());
-  {for(int j=0; j<dobj->NBandX(); j++) {
+  {for(int_4 j=0; j<dobj->NBandX(); j++) {
     ObjFileIO<Histo> fio_h(dobj->HBandX(j));
     fio_h.Read(is);
@@ -1610,10 +1623,10 @@
 if( nbany>0 ) {
   is.GetLine(strg, 255);
-  {for(int j=0; j<nbany; j++) {
+  {for(int_4 j=0; j<nbany; j++) {
     is.Get(min); is.Get(max);
     dobj->SetBandY(min,max);
   }}
   ASSERT (nbany==dobj->NBandY());
-  {for(int j=0; j<dobj->NBandY(); j++) {
+  {for(int_4 j=0; j<dobj->NBandY(); j++) {
     ObjFileIO<Histo> fio_h(dobj->HBandY(j));
     fio_h.Read(is);
@@ -1630,7 +1643,7 @@
 
 // Que faut-il ecrire?
-int_4 errok = (dobj->err2) ? 1 : 0;
-int_4 projx = (dobj->hprojx) ? 1 : 0;
-int_4 projy = (dobj->hprojy) ? 1 : 0;
+int_4 errok = (dobj->mErr2) ? 1 : 0;
+int_4 projx = (dobj->mHprojx) ? 1 : 0;
+int_4 projy = (dobj->mHprojy) ? 1 : 0;
 int_4 nslix = dobj->NSliX();
 int_4 nsliy = dobj->NSliY();
@@ -1640,38 +1653,38 @@
 // Ecriture entete pour identifier facilement
 sprintf(strg,"nx=%d  ny=%d  nxy=%d errok=%1d"
-       ,dobj->nx,dobj->ny,dobj->nxy,errok);
+       ,dobj->mNx,dobj->mNy,dobj->mNxy,errok);
 os.PutLine(strg);
 sprintf(strg,"nHist=%g nEntries=%d",dobj->nHist,dobj->nEntries);
 os.PutLine(strg);
-sprintf(strg,"wbinx=%g wbiny=%g",dobj->wbinx,dobj->wbiny);
+sprintf(strg,"wbinx=%g wbiny=%g",dobj->mWBinx,dobj->mWBiny);
 os.PutLine(strg);
 sprintf(strg,"xmin=%g xmax=%g ymin=%g ymax=%g"
-       ,dobj->xmin,dobj->xmax,dobj->ymin,dobj->ymax);
+       ,dobj->mXmin,dobj->mXmax,dobj->mYmin,dobj->mYmax);
 os.PutLine(strg);
 sprintf(strg,"projx/y=%d %d nbandx/y=%d %d nbslix/y=%d %d"
        ,projx,projy,nbanx,nbany,nslix,nsliy);
 os.PutLine(strg);
-sprintf(strg,"over %g %g %g %g %g %g %g %g %g"
-       ,dobj->over[0][0],dobj->over[0][1],dobj->over[0][2]
-       ,dobj->over[1][0],dobj->over[1][1],dobj->over[1][2]
-       ,dobj->over[2][0],dobj->over[2][1],dobj->over[2][2]);
+sprintf(strg,"mOver %g %g %g %g %g %g %g %g %g"
+       ,dobj->mOver[0][0],dobj->mOver[0][1],dobj->mOver[0][2]
+       ,dobj->mOver[1][0],dobj->mOver[1][1],dobj->mOver[1][2]
+       ,dobj->mOver[2][0],dobj->mOver[2][1],dobj->mOver[2][2]);
 os.PutLine(strg);
 
 // Ecriture variables de definitions
-os.Put(dobj->nx);
-os.Put(dobj->ny);
-os.Put(dobj->nxy);
+os.Put(dobj->mNx);
+os.Put(dobj->mNy);
+os.Put(dobj->mNxy);
 os.Put(errok);
 os.Put(dobj->nEntries);
 os.Put(dobj->nHist);
 
-os.Put(dobj->xmin);
-os.Put(dobj->xmax);
-os.Put(dobj->ymin);
-os.Put(dobj->ymax);
-os.Put(dobj->wbinx);
-os.Put(dobj->wbiny);
-
-os.Put(&(dobj->over[0][0]),9);
+os.Put(dobj->mXmin);
+os.Put(dobj->mXmax);
+os.Put(dobj->mYmin);
+os.Put(dobj->mYmax);
+os.Put(dobj->mWBinx);
+os.Put(dobj->mWBiny);
+
+os.Put(&(dobj->mOver[0][0]),9);
 
 os.Put(projx);
@@ -1684,14 +1697,14 @@
 // Ecriture histo2D
 sprintf(strg,"Histo2D: Tableau des donnees %d = %d * %d"
-       ,dobj->nxy,dobj->nx,dobj->ny);
+       ,dobj->mNxy,dobj->mNx,dobj->mNy);
 os.PutLine(strg);
-{for(int j=0;j<dobj->ny;j++) os.Put(dobj->data+j*dobj->nx,dobj->nx);}
+{for(int_4 j=0;j<dobj->mNy;j++) os.Put(dobj->mData+j*dobj->mNx,dobj->mNx);}
 
 // Ecriture erreurs
 if(errok) {
   sprintf(strg,"Histo2D: Tableau des erreurs %d = %d * %d"
-         ,dobj->nxy,dobj->nx,dobj->ny);
+         ,dobj->mNxy,dobj->mNx,dobj->mNy);
   os.PutLine(strg);
-  for(int j=0;j<dobj->ny;j++) os.Put(dobj->err2+j*dobj->nx,dobj->nx);
+  for(int_4 j=0;j<dobj->mNy;j++) os.Put(dobj->mErr2+j*dobj->mNx,dobj->mNx);
 }
 
@@ -1700,10 +1713,10 @@
   sprintf(strg,"Histo2D: Projection X");
   os.PutLine(strg);
-  ObjFileIO<Histo> fio_h(dobj->hprojx); fio_h.Write(os);
+  ObjFileIO<Histo> fio_h(dobj->mHprojx); fio_h.Write(os);
 }
 if(projy) {
   sprintf(strg,"Histo2D: Projection Y");
   os.PutLine(strg);
-  ObjFileIO<Histo> fio_h(dobj->hprojy); fio_h.Write(os);
+  ObjFileIO<Histo> fio_h(dobj->mHprojy); fio_h.Write(os);
 }
 
@@ -1712,5 +1725,5 @@
   sprintf(strg,"Histo2D: Slices X %d",nslix);
   os.PutLine(strg);
-  for(int j=0;j<nslix;j++) {
+  for(int_4 j=0;j<nslix;j++) {
     Histo* h = dobj->HSliX(j);
     ObjFileIO<Histo> fio_h(h); fio_h.Write(os);
@@ -1720,5 +1733,5 @@
   sprintf(strg,"Histo2D: Slices Y %d",nsliy);
   os.PutLine(strg);
-  for(int j=0;j<nsliy;j++) {
+  for(int_4 j=0;j<nsliy;j++) {
     Histo* h = dobj->HSliY(j);
     ObjFileIO<Histo> fio_h(h); fio_h.Write(os);
@@ -1731,9 +1744,9 @@
   os.PutLine(strg);
   list<Histo2D::bande_slice>::const_iterator it;
-  for(it = dobj->lbandx.begin(); it != dobj->lbandx.end(); it++) {
-    float min = (*it).min; float max = (*it).max;
+  for(it = dobj->mLBandx.begin(); it != dobj->mLBandx.end(); it++) {
+    r_8 min = (*it).min; r_8 max = (*it).max;
     os.Put(min); os.Put(max);
   }
-  for(it = dobj->lbandx.begin(); it != dobj->lbandx.end(); it++) {
+  for(it = dobj->mLBandx.begin(); it != dobj->mLBandx.end(); it++) {
     Histo* h = (*it).H;
     ObjFileIO<Histo> fio_h(h); fio_h.Write(os);
@@ -1744,9 +1757,9 @@
   os.PutLine(strg);
   list<Histo2D::bande_slice>::const_iterator it;
-  for(it = dobj->lbandy.begin(); it != dobj->lbandy.end(); it++) {
-    float min = (*it).min; float max = (*it).max;
+  for(it = dobj->mLBandy.begin(); it != dobj->mLBandy.end(); it++) {
+    r_8 min = (*it).min; r_8 max = (*it).max;
     os.Put(min); os.Put(max);
   }
-  for(it = dobj->lbandy.begin(); it != dobj->lbandy.end(); it++) {
+  for(it = dobj->mLBandy.begin(); it != dobj->mLBandy.end(); it++) {
     Histo* h = (*it).H;
     ObjFileIO<Histo> fio_h(h); fio_h.Write(os);
Index: trunk/SophyaLib/HiStats/histos2.h
===================================================================
--- trunk/SophyaLib/HiStats/histos2.h	(revision 1089)
+++ trunk/SophyaLib/HiStats/histos2.h	(revision 1092)
@@ -28,23 +28,23 @@
 
   // CREATOR / DESTRUCTOR
-  Histo2D(float xMin, float xMax, int nxBin
-         ,float yMin, float yMax, int nyBin);
+  Histo2D(r_8 xMin,r_8 xMax,int_4 nxBin,r_8 yMin,r_8 yMax,int_4 nyBin);
+  Histo2D(r_4 xMin,r_4 xMax,int_4 nxBin,r_4 yMin,r_4 yMax,int_4 nyBin);
   Histo2D(const Histo2D& h);
   Histo2D();
-  virtual  ~Histo2D();
+  virtual ~Histo2D();
 
   // OPTIONS
-  void   Errors();  
+  void Errors();  
   
   // UPDATING
-  void   Zero();
-  void   Add(float x, float y, float w = 1.);
+  void Zero();
+  void Add(r_8 x, r_8 y, r_8 w = 1.);
 
   // Operators
   Histo2D& operator = (const Histo2D& h);
-  Histo2D& operator *= (double b);
-  Histo2D& operator /= (double b);
-  Histo2D& operator += (double b);
-  Histo2D& operator -= (double b);
+  Histo2D& operator *= (r_8 b);
+  Histo2D& operator /= (r_8 b);
+  Histo2D& operator += (r_8 b);
+  Histo2D& operator -= (r_8 b);
   Histo2D& operator += (const Histo2D& a);
   Histo2D& operator -= (const Histo2D& a);
@@ -58,6 +58,6 @@
   void GetError2(TMatrix<r_8>& v);
   void GetError(TMatrix<r_8>& v);
-  void PutValue(TMatrix<r_8>& v, int ierr=0);
-  void PutValueAdd(TMatrix<r_8>& v, int ierr=0);
+  void PutValue(TMatrix<r_8>& v, int_4 ierr=0);
+  void PutValueAdd(TMatrix<r_8>& v, int_4 ierr=0);
   void PutError2(TMatrix<r_8>& v);
   void PutError2Add(TMatrix<r_8>& v);
@@ -66,125 +66,134 @@
   // INLINES
   //! Retourne l'abscisse minimum.
-  inline float   XMin() const {return xmin;}
+  inline r_8 XMin() const {return mXmin;}
   //! Retourne l'abscisse maximum.
-  inline float   XMax() const {return xmax;}
+  inline r_8 XMax() const {return mXmax;}
   //! Retourne l'ordonnee minimum.
-  inline float   YMin() const {return ymin;}
+  inline r_8 YMin() const {return mYmin;}
   //! Retourne l'ordonnee maximum.
-  inline float   YMax() const {return ymax;}
+  inline r_8 YMax() const {return mYmax;}
   //! Retourne le nombre de bins selon X.
-  inline int_4   NBinX() const {return nx;}
+  inline int_4 NBinX() const {return mNx;}
   //! Retourne le nombre de bins selon Y.
-  inline int_4   NBinY() const {return ny;}
+  inline int_4 NBinY() const {return mNy;}
   //! Retourne la largeur du bin selon X.
-  inline float   WBinX() const {return wbinx;}
+  inline r_8 WBinX() const {return mWBinx;}
   //! Retourne la largeur du bin selon Y.
-  inline float   WBinY() const {return wbiny;}
+  inline r_8 WBinY() const {return mWBiny;}
   //! Retourne le pointeur sur le tableaux des contenus.
-  inline float*  Bins() const  {return data;}
+  inline r_8* Bins() const  {return mData;}
   //! Retourne le contenu du bin i,j.
-  inline float   operator()(int i,int j) const {return data[j*nx+i];}
+  inline r_8 operator()(int_4 i,int_4 j) const {return mData[j*mNx+i];}
   //! Remplit le contenu du bin i,j.
-  inline float&  operator()(int i,int j)       {return data[j*nx+i];}
+  inline r_8& operator()(int_4 i,int_4 j)      {return mData[j*mNx+i];}
   //! retourne "true" si il y a des erreurs stoquees
-  inline bool    HasErrors() { if(err2) return true; else return false;}
+  inline bool HasErrors() { if(mErr2) return true; else return false;}
   //! Retourne l'erreur du bin i,j.
-  inline float   Error(int i,int j)  const
-                   {if(err2)
-                      {if(err2[j*nx+i]>0.) return sqrt(err2[j*nx+i]); else return 0.;}
-                    else return 0.;}
+  inline r_8 Error(int_4 i,int_4 j)  const
+    {if(mErr2)
+       {if(mErr2[j*mNx+i]>0.) return sqrt(mErr2[j*mNx+i]); else return 0.;}
+     else return 0.;}
   //! Remplit l'erreur au carre du bin i,j.
-  inline double  Error2(int i,int j) const
-                   {if(err2) return err2[j*nx+i]; else return 0.;}
+  inline r_8 Error2(int_4 i,int_4 j) const
+             {if(mErr2) return mErr2[j*mNx+i]; else return 0.;}
   //! Remplit l'erreur au carre du bin i,j.
-  inline double& Error2(int i,int j) {return err2[j*nx+i];}
+  inline r_8& Error2(int_4 i,int_4 j) {return mErr2[j*mNx+i];}
   //! Retourne la somme ponderee.
-  inline float   NData() const    {return (float) nHist;}
+  inline r_8 NData() const    {return nHist;}
   //! Retourne le nombre d'entrees.
-  inline int_4   NEntries() const {return nEntries;}
+  inline int_4 NEntries() const {return nEntries;}
   //! Retourne l'abscisse et l'ordonnee du coin inferieur du bin i,j.
-  inline void BinLowEdge(int i,int j,float& x,float& y)
-                 {x = xmin + i*wbinx; y = ymin + j*wbiny;}
+  inline void BinLowEdge(int_4 i,int_4 j,r_8& x,r_8& y)
+              {x = mXmin + i*mWBinx; y = mYmin + j*mWBiny;}
+  //! Retourne l'abscisse et l'ordonnee du coin inferieur du bin i,j.
+  inline void BinLowEdge(int_4 i,int_4 j,r_4& xf,r_4& yf)
+              {r_8 x,y; BinLowEdge(i,j,x,y); xf=x; yf=y;}
   //! Retourne l'abscisse et l'ordonnee du centre du bin i,j.
-  inline void BinCenter(int i,int j,float& x,float& y)
-                 {x = xmin + (i+0.5)*wbinx; y = ymin + (j+0.5)*wbiny;}
+  inline void BinCenter(int_4 i,int_4 j,r_8& x,r_8& y)
+              {x = mXmin + (i+0.5)*mWBinx; y = mYmin + (j+0.5)*mWBiny;}
+  //! Retourne l'abscisse et l'ordonnee du centre du bin i,j.
+  inline void BinCenter(int_4 i,int_4 j,r_4& xf,r_4& yf)
+              {r_8 x,y; BinCenter(i,j,x,y); xf=x; yf=y;}
   //! Retourne l'abscisse et l'ordonnee du coin superieur du bin i,j.
-  inline void BinHighEdge(int i,int j,float& x,float& y)
-                 {x = xmin + (i+1)*wbinx; y = ymin + (j+1)*wbiny;}
+  inline void BinHighEdge(int_4 i,int_4 j,r_8& x,r_8& y)
+              {x = mXmin + (i+1)*mWBinx; y = mYmin + (j+1)*mWBiny;}
+  //! Retourne l'abscisse et l'ordonnee du coin superieur du bin i,j.
+  inline void BinHighEdge(int_4 i,int_4 j,r_4& xf,r_4& yf)
+              {r_8 x,y; BinHighEdge(i,j,x,y); xf=x; yf=y;}
   //! Retourne les numeros du bin contenant l'abscisse et l'ordonnee x,y.
-  inline void FindBin(float x,float y,int& i,int& j)
-    { i = (int) floorf((x - xmin)/wbinx); j = (int) floorf((y - ymin)/wbiny);}
+  inline void FindBin(r_8 x,r_8 y,int_4& i,int_4& j)
+    {i=(int_4) floor((x-mXmin)/mWBinx); j=(int_4) floor((y-mYmin)/mWBiny);}
 
   // Info, statistique et calculs sur les histogrammes
-  float   NOver(int i=-1,int j=-1) const;
-  int     BinNonNul() const;
-  int     ErrNonNul() const;
-  void    IJMax(int& imax,int& jmax,int il=1,int ih= -1,int jl=1,int jh= -1);
-  void    IJMin(int& imax,int& jmax,int il=1,int ih= -1,int jl=1,int jh= -1);
-  float   VMax(int il=1,int ih= -1,int jl=1,int jh= -1) const;
-  float   VMin(int il=1,int ih= -1,int jl=1,int jh= -1) const;
-  int     EstimeMax(float& xm,float& ym,int SzPav = 3
-                   ,int il=1,int ih= -1,int jl=1,int jh= -1);
-  int     EstimeMax(int im,int jm,float& xm,float& ym,int SzPav = 3);
-  int     FindMax(int& im,int& jm,int SzPav = 3,float Dz = 0.
-                 ,int il=1,int ih= -1,int jl=1,int jh= -1);
+  r_8   NOver(int_4 i=-1,int_4 j=-1) const;
+  int_4 BinNonNul() const;
+  int_4 ErrNonNul() const;
+  void IJMax(int_4& imax,int_4& jmax,int_4 il=1,int_4 ih= -1,int_4 jl=1,int_4 jh= -1);
+  void IJMin(int_4& imax,int_4& jmax,int_4 il=1,int_4 ih= -1,int_4 jl=1,int_4 jh= -1);
+  r_8 VMax(int_4 il=1,int_4 ih= -1,int_4 jl=1,int_4 jh= -1) const;
+  r_8 VMin(int_4 il=1,int_4 ih= -1,int_4 jl=1,int_4 jh= -1) const;
+  int_4 EstimeMax(r_8& xm,r_8& ym,int_4 SzPav = 3
+                 ,int_4 il=1,int_4 ih= -1,int_4 jl=1,int_4 jh= -1);
+  int_4 EstimeMax(int_4 im,int_4 jm,r_8& xm,r_8& ym,int_4 SzPav = 3);
+  int_4 FindMax(int_4& im,int_4& jm,int_4 SzPav = 3,r_8 Dz = 0.
+               ,int_4 il=1,int_4 ih= -1,int_4 jl=1,int_4 jh= -1);
 
   // Fit
-  int      Fit(GeneralFit& gfit,unsigned short typ_err=0);
-  Histo2D  FitResidus(GeneralFit& gfit);
-  Histo2D  FitFunction(GeneralFit& gfit);
+  int_4   Fit(GeneralFit& gfit,unsigned short typ_err=0);
+  Histo2D FitResidus(GeneralFit& gfit);
+  Histo2D FitFunction(GeneralFit& gfit);
 
   // Print et Display ASCII
-  void    PrintStatus();
-  void    Print(float min=1.,float max=-1.
-               ,int il=1,int ih= -1,int jl=1,int jh= -1);
+  void PrintStatus();
+  void Print(r_8 min=1.,r_8 max=-1.
+               ,int_4 il=1,int_4 ih= -1,int_4 jl=1,int_4 jh= -1);
 
   // PROJECTIONS
-  void           SetProjX();
-  void           SetProjY();
-  void           SetProj();
-  void           DelProjX();
-  void           DelProjY();
-  void           DelProj();
-  void           ZeroProjX();
-  void           ZeroProjY();
-  void           ZeroProj();
+  void SetProjX();
+  void SetProjY();
+  void SetProj();
+  void DelProjX();
+  void DelProjY();
+  void DelProj();
+  void ZeroProjX();
+  void ZeroProjY();
+  void ZeroProj();
   //! Retourne le pointeur sur l'histo 1D de la projection selon X.
-  inline Histo*  HProjX() const {return hprojx;}
+  inline Histo* HProjX() const {return mHprojx;}
   //! Retourne le pointeur sur l'histo 1D de la projection selon Y.
-  inline Histo*  HProjY() const {return hprojy;}
-  void           ShowProj();
+  inline Histo* HProjY() const {return mHprojy;}
+  void ShowProj();
 
   // BANDES
   //! Retourne le nombre de bandes selon X
-  inline int     NBandX() const {return lbandx.size();}
+  inline int_4 NBandX() const {return mLBandx.size();}
   //! Retourne le nombre de bandes selon Y
-  inline int     NBandY() const {return lbandy.size();}
-  int            SetBandX(float ybmin,float ybmax);
-  int            SetBandY(float xbmin,float xbmax);
-  void           DelBandX();
-  void           DelBandY();
-  void           ZeroBandX();
-  void           ZeroBandY();
-  Histo*         HBandX(int n) const;
-  Histo*         HBandY(int n) const;
-  void           GetBandX(int n,float& ybmin,float& ybmax) const;
-  void           GetBandY(int n,float& xbmin,float& xbmax) const;
-  void           ShowBand(int lp = 0);
+  inline int_4 NBandY() const {return mLBandy.size();}
+  int_4 SetBandX(r_8 ybmin,r_8 ybmax);
+  int_4 SetBandY(r_8 xbmin,r_8 xbmax);
+  void DelBandX();
+  void DelBandY();
+  void ZeroBandX();
+  void ZeroBandY();
+  Histo* HBandX(int_4 n) const;
+  Histo* HBandY(int_4 n) const;
+  void GetBandX(int_4 n,r_8& ybmin,r_8& ybmax) const;
+  void GetBandY(int_4 n,r_8& xbmin,r_8& xbmax) const;
+  void ShowBand(int_4 lp = 0);
 
   // SLICES
   //! Retourne le nombre de slices selon X
-  inline int     NSliX() const {return lslix.size();}
+  inline int_4 NSliX() const {return mLSlix.size();}
   //! Retourne le nombre de slices selon Y
-  inline int     NSliY() const {return lsliy.size();}
-  int            SetSliX(int nsli);
-  int            SetSliY(int nsli);
-  void           DelSliX();
-  void           DelSliY();
-  void           ZeroSliX();
-  void           ZeroSliY();
-  Histo*         HSliX(int n) const;
-  Histo*         HSliY(int n) const;
-  void           ShowSli(int lp = 0);
+  inline int_4 NSliY() const {return mLSliy.size();}
+  int_4 SetSliX(int_4 nsli);
+  int_4 SetSliY(int_4 nsli);
+  void DelSliX();
+  void DelSliY();
+  void ZeroSliX();
+  void ZeroSliY();
+  Histo* HSliX(int_4 n) const;
+  Histo* HSliY(int_4 n) const;
+  void ShowSli(int_4 lp = 0);
 
 #ifndef __DECCXX
@@ -193,8 +202,8 @@
   //! structure de definition des bandes
   struct bande_slice {
-    int num;   //!< nombre de bandes
-    float min; //!< limite minimum pour remplir la bande
-    float max; //!< limite maximum pour remplir la bande
-    Histo* H;  //!< pointer sur l Histo 1D de la bande
+    int_4 num;   //!< nombre de bandes
+    r_8 min;     //!< limite minimum pour remplir la bande
+    r_8 max;     //!< limite maximum pour remplir la bande
+    Histo* H;    //!< pointer sur l Histo 1D de la bande
     STRUCTCOMP(bande_slice)
   };
@@ -205,31 +214,31 @@
   void Delete();
 
-  float*         data; //!< donnees
-  double*        err2; //!< erreurs carrees
-
-  float          over[3][3]; //!< overflow table
-  double         nHist;      //!< somme ponderee des entrees
-  int_4          nEntries;   //!< nombre d'entrees
-
-  int_4          nx;    //!< nombre de bins en X
-  int_4          ny;    //!< nombre de bins en Y
-  int_4          nxy;   //!< nombre de bins total
-  float          xmin;  //!< abscisse minimum
-  float          xmax;  //!< abscisse maximum
-  float          ymin;  //!< ordonnee minimum
-  float          ymax;  //!< ordonnee maximum
-  float          wbinx; //!< largeur du bin en X
-  float          wbiny; //!< largeur du bin en Y
-
-  bande_slice    b_s;
-
-  Histo*         hprojx; //!< pointer sur Histo des proj X
-  Histo*         hprojy; //!< pointer sur Histo des proj Y
-
-  list<bande_slice>  lbandx; //!< liste des bandes selon X
-  list<bande_slice>  lbandy; //!< liste des bandes selon Y
+  r_8*        mData; //!< donnees
+  r_8*        mErr2; //!< erreurs carrees
+
+  r_8         mOver[3][3]; //!< overflow table
+  r_8         nHist;       //!< somme ponderee des entrees
+  int_4       nEntries;    //!< nombre d'entrees
+
+  int_4       mNx;    //!< nombre de bins en X
+  int_4       mNy;    //!< nombre de bins en Y
+  int_4       mNxy;   //!< nombre de bins total
+  r_8         mXmin;  //!< abscisse minimum
+  r_8         mXmax;  //!< abscisse maximum
+  r_8         mYmin;  //!< ordonnee minimum
+  r_8         mYmax;  //!< ordonnee maximum
+  r_8         mWBinx; //!< largeur du bin en X
+  r_8         mWBiny; //!< largeur du bin en Y
+
+  bande_slice mB_s;
+
+  Histo*      mHprojx; //!< pointer sur Histo des proj X
+  Histo*      mHprojy; //!< pointer sur Histo des proj Y
+
+  list<bande_slice>  mLBandx; //!< liste des bandes selon X
+  list<bande_slice>  mLBandy; //!< liste des bandes selon Y
   
-  list<bande_slice>  lslix; //!< liste des slices selon X
-  list<bande_slice>  lsliy; //!< liste des slices selon Y
+  list<bande_slice>  mLSlix; //!< liste des slices selon X
+  list<bande_slice>  mLSliy; //!< liste des slices selon Y
 
 };
@@ -250,7 +259,7 @@
 // ObjFileIO<Histo2D>
 
-/*! \ingroup HiStats \fn operator*(const Histo2D&,double)
+/*! \ingroup HiStats \fn operator*(const Histo2D&,r_8)
   \brief Operateur H2 = H1 * b */
-inline Histo2D operator * (const Histo2D& a, double b)
+inline Histo2D operator * (const Histo2D& a, r_8 b)
 {
   Histo2D result(a);
@@ -258,7 +267,7 @@
 }
 
-/*! \ingroup HiStats \fn operator*(double,const Histo2D&)
+/*! \ingroup HiStats \fn operator*(r_8,const Histo2D&)
   \brief Operateur H2 = b * H1 */
-inline Histo2D operator * (double b, const Histo2D& a)
+inline Histo2D operator * (r_8 b, const Histo2D& a)
 {
   Histo2D result(a);
@@ -266,7 +275,7 @@
 }
 
-/*! \ingroup HiStats \fn operator/(const Histo2D&,double)
+/*! \ingroup HiStats \fn operator/(const Histo2D&,r_8)
   \brief Operateur H2 = H1 / b */
-inline Histo2D operator / (const Histo2D& a, double b)
+inline Histo2D operator / (const Histo2D& a, r_8 b)
 {
   Histo2D result(a);
@@ -274,7 +283,7 @@
 }
 
-/*! \ingroup HiStats \fn operator+(const Histo2D&,double)
+/*! \ingroup HiStats \fn operator+(const Histo2D&,r_8)
   \brief Operateur H2 = H1 + b */
-inline Histo2D operator + (const Histo2D& a, double b)
+inline Histo2D operator + (const Histo2D& a, r_8 b)
 {
   Histo2D result(a);
@@ -282,7 +291,7 @@
 }
 
-/*! \ingroup HiStats \fn operator+(double,const Histo2D&)
+/*! \ingroup HiStats \fn operator+(r_8,const Histo2D&)
   \brief Operateur H2 = b + H1 */
-inline Histo2D operator + (double b, const Histo2D& a)
+inline Histo2D operator + (r_8 b, const Histo2D& a)
 {
   Histo2D result(a);
@@ -290,7 +299,7 @@
 }
 
-/*! \ingroup HiStats \fn operator-(const Histo2D&,double)
+/*! \ingroup HiStats \fn operator-(const Histo2D&,r_8)
   \brief Operateur H2 = H1 - b */
-inline Histo2D operator - (const Histo2D& a, double b)
+inline Histo2D operator - (const Histo2D& a, r_8 b)
 {
   Histo2D result(a);
@@ -298,7 +307,7 @@
 }
 
-/*! \ingroup HiStats \fn operator-(double,const Histo2D&)
+/*! \ingroup HiStats \fn operator-(r_8,const Histo2D&)
   \brief Operateur H2 = b - H1 */
-inline Histo2D operator - (double b, const Histo2D& a)
+inline Histo2D operator - (r_8 b, const Histo2D& a)
 {
   Histo2D result(a);
Index: trunk/SophyaLib/HiStats/ntuple.cc
===================================================================
--- trunk/SophyaLib/HiStats/ntuple.cc	(revision 1089)
+++ trunk/SophyaLib/HiStats/ntuple.cc	(revision 1092)
@@ -324,5 +324,5 @@
 for(i=0; i<mNVar; i++) {
   GetMinMax(i, min, max);
-  sprintf(buff, "%3d  %16s  %10lg  %10lg \n", i, mNames+i*LENNAME1, min, max);
+  sprintf(buff, "%3d  %16s  %10g  %10g \n", i, mNames+i*LENNAME1, min, max);
   os << (string)buff ;
   }
Index: trunk/SophyaLib/NTools/cimage.cc
===================================================================
--- trunk/SophyaLib/NTools/cimage.cc	(revision 1089)
+++ trunk/SophyaLib/NTools/cimage.cc	(revision 1092)
@@ -5,5 +5,5 @@
 // LAL (Orsay) / IN2P3-CNRS  DAPNIA/SPP (Saclay) / CEA
 
-// $Id: cimage.cc,v 1.5 1999-10-21 15:25:42 ansari Exp $        
+// $Id: cimage.cc,v 1.6 2000-07-26 13:15:29 ansari Exp $        
 
 
@@ -723,6 +723,6 @@
 // redimensionnement de l'histo pour avoir une bonne signification stat.
 for(;;) {
-  float max1,max2;
-  int imax1,imax2;
+  r_8 max1,max2;
+  int_4 imax1,imax2;
   rc = H.MaxiLocal(max1,imax1,max2,imax2);
   float rap = 1.;
@@ -742,5 +742,5 @@
 
 TRY {
-  xbmax = H.FitMax(2,0.5f,deb-2);
+  xbmax = H.FitMax(2,0.5,deb-2);
   if(deb>1) cout<<"H.FitMax = "<<xbmax<<endl;
 } CATCHALL {
@@ -750,8 +750,9 @@
 
 TRY {
-  float sdroit = -2.;
-  H.EstimeWidthS(0.5f,sgbmax,sdroit);
-  if(sgbmax<=0.) sgbmax = H.FindWidth(0.5f,deb-2);
-  sgbmax /= 2.36;
+  r_8 sdroit = -2., dum=sgbmax;
+  H.EstimeWidthS(0.5,dum,sdroit);
+  if(dum<=0.) dum = H.FindWidth(0.5,deb-2);
+  dum /= 2.36;
+  sgbmax = dum;
   if(deb>1) cout<<"H.FindWidth = "<<sgbmax<<" (droit="<<sdroit<<")"<<endl;
 } CATCHALL {
Index: trunk/SophyaLib/NTools/perandom.cc
===================================================================
--- trunk/SophyaLib/NTools/perandom.cc	(revision 1089)
+++ trunk/SophyaLib/NTools/perandom.cc	(revision 1092)
@@ -15,5 +15,5 @@
 
 //++
-FunRan::FunRan(FunRan::Func f, float xMin, float xMax, int nBin)
+FunRan::FunRan(FunRan::Func f, r_8 xMin, r_8 xMax, int_4 nBin)
 //
 //	Createur.
@@ -22,8 +22,8 @@
 {
   (*this)(0) = f(BinLowEdge(0));
-  for(int i=1; i<nBin; i++)
+  for(int_4 i=1; i<nBin; i++)
     (*this)(i) = (*this)(i-1) + f(BinLowEdge(i));
     
-  for(int j=0; j<nBin; j++)
+  for(int_4 j=0; j<nBin; j++)
     (*this)(j) /= (*this)(nBin-1);
   END_CONSTRUCTOR
@@ -31,12 +31,12 @@
 
 //++
-FunRan::FunRan(double *tab, int nBin)
-//
-//	Createur.
-//--
-: Histo(0, (float)(nBin), nBin)
+FunRan::FunRan(r_8 *tab, int_4 nBin)
+//
+//	Createur.
+//--
+: Histo(0, (r_8)(nBin), nBin)
 {
   (*this)(0) = tab[0];
-  for(int i=1; i<nBin; i++)
+  for(int_4 i=1; i<nBin; i++)
     (*this)(i) = (*this)(i-1) + tab[i];
 
@@ -46,14 +46,14 @@
   }
 
-  for(int j=0; j<nBin; j++)
+  for(int_4 j=0; j<nBin; j++)
     (*this)(j) /= (*this)(nBin-1);
   END_CONSTRUCTOR
 }
 
-FunRan::FunRan(double *tab, int nBin, float xMin, float xMax)
+FunRan::FunRan(r_8 *tab, int_4 nBin, r_8 xMin, r_8 xMax)
 : Histo(xMin, xMax, nBin)
 {
   (*this)(0) = tab[0];
-  for(int i=1; i<nBin; i++)
+  for(int_4 i=1; i<nBin; i++)
     (*this)(i) = (*this)(i-1) + tab[i];
 
@@ -63,5 +63,5 @@
   }
 
-  for(int j=0; j<nBin; j++)
+  for(int_4 j=0; j<nBin; j++)
     (*this)(j) /= (*this)(nBin-1);
   END_CONSTRUCTOR
@@ -69,16 +69,16 @@
 
 //++
-int FunRan::BinRandom()
+int_4 FunRan::BinRandom()
 //
 //	Tirage avec retour du numero de bin.
 //--
 {
-  double z=drand01();
+  r_8 z=drand01();
   if (z <= 0) return 0;
-  if (z >= 1) return bins-1;
+  if (z >= 1) return mBins-1;
   
   // recherche du premier bin plus grand que z
-  int iBin = 0;
-  for (; iBin<bins; iBin++)
+  int_4 iBin = 0;
+  for (; iBin<mBins; iBin++)
     if (z < (*this)(iBin)) break;
 
@@ -87,31 +87,31 @@
 
 //++
-double FunRan::Random()
+r_8 FunRan::Random()
 //
 //	Tirage avec retour abscisse du bin interpole.
 //--
 {
-  double z=drand01();
-  if (z <= 0) return min;
-  if (z >= 1) return max;
+  r_8 z=drand01();
+  if (z <= 0) return mMin;
+  if (z >= 1) return mMax;
   // cas z <= tab[0] 
   if (z <= (*this)(0)) {
-    double t = min + binWidth/(*this)(0) * z;
+    r_8 t = mMin + binWidth/(*this)(0) * z;
     return t;
   }
 
   // recherche du premier bin plus grand que z
-  int iBin = 0;
-  for (; iBin<bins; iBin++)
+  int_4 iBin = 0;
+  for (; iBin<mBins; iBin++)
     if (z < (*this)(iBin)) break;
 
   // interpolation pour trouver la valeur du tirage aleatoire
-  double t1 = (*this)(iBin-1);
-  double x1 = BinLowEdge(iBin-1);
-  double t2 = (*this)(iBin);
-  double x2 = x1 + binWidth;
-  double t = x1 + (x2-x1) / (t2-t1) * (z-t1);
-  if (t < min) t = min;
-  if (t > max) t = max;
+  r_8 t1 = (*this)(iBin-1);
+  r_8 x1 = BinLowEdge(iBin-1);
+  r_8 t2 = (*this)(iBin);
+  r_8 x2 = x1 + binWidth;
+  r_8 t = x1 + (x2-x1) / (t2-t1) * (z-t1);
+  if (t < mMin) t = mMin;
+  if (t > mMax) t = mMax;
   return(t);
 }
@@ -129,5 +129,5 @@
 
 //++
-FunRan2D::FunRan2D(double *tab, int nBinX, int nBinY)
+FunRan2D::FunRan2D(r_8 *tab, int_4 nBinX, int_4 nBinY)
 //
 //	Createur.
@@ -135,8 +135,8 @@
 {
   // Tirage en X, somme sur les Y.
-   double* tabX = new double[nBinX];
-   for (int i=0; i<nBinX; i++) {
+   r_8* tabX = new r_8[nBinX];
+   for (int_4 i=0; i<nBinX; i++) {
      tabX[i] = 0;
-     for (int j=0; j<nBinY; j++) {
+     for (int_4 j=0; j<nBinY; j++) {
        tabX[i] += tab[i*nBinY +j];
      }
@@ -147,5 +147,5 @@
    ranY = new(FunRan*[nBinX]);
    
-   for (int k=0; k<nBinX; k++)
+   for (int_4 k=0; k<nBinX; k++)
       ranY[k] = new FunRan(tab + nBinY*k, nBinY);
    
@@ -155,5 +155,5 @@
 
 //++
-FunRan2D::FunRan2D(double **tab, int nBinX, int nBinY)
+FunRan2D::FunRan2D(r_8 **tab, int_4 nBinX, int_4 nBinY)
 //
 //	Createur.
@@ -161,8 +161,8 @@
 {
   // Tirage en X, somme sur les Y.
-   double* tabX = new double[nBinX];
-   for (int i=0; i<nBinX; i++) {
+   r_8* tabX = new r_8[nBinX];
+   for (int_4 i=0; i<nBinX; i++) {
      tabX[i] = 0;
-     for (int j=0; j<nBinY; j++) {
+     for (int_4 j=0; j<nBinY; j++) {
        tabX[i] += tab[i][j];
      }
@@ -172,5 +172,5 @@
    ranY = new(FunRan*[nBinX]);
    
-   for (int k=0; k<nBinX; k++)
+   for (int_4 k=0; k<nBinX; k++)
     if (tabX[k] != 0) 
       ranY[k] = new FunRan(tab[k], nBinY);
@@ -184,5 +184,5 @@
 FunRan2D::~FunRan2D()
 {
-  for (int i=nx-1; i>=0; i--)
+  for (int_4 i=nx-1; i>=0; i--)
     delete ranY[i];
     
@@ -193,5 +193,5 @@
 
 //++
-void FunRan2D::BinRandom(int& x, int& y)
+void FunRan2D::BinRandom(int_4& x, int_4& y)
 //
 //	Tirage avec retour du numeros de bin.
@@ -204,5 +204,5 @@
 
 //++
-void FunRan2D::Random(double& x, double& y)
+void FunRan2D::Random(r_8& x, r_8& y)
 //
 //	Tirage avec retour abscisse et ordonnee
@@ -211,5 +211,5 @@
 {
   x = ranX->Random();
-  int i = int(ceil(x));
+  int_4 i = int_4(ceil(x));
   //  FAILNIL(ranY[i]);  Ne compile pas $CHECK$ Reza 22/04/99
   y = ranY[i]->Random();
Index: trunk/SophyaLib/NTools/perandom.h
===================================================================
--- trunk/SophyaLib/NTools/perandom.h	(revision 1089)
+++ trunk/SophyaLib/NTools/perandom.h	(revision 1092)
@@ -13,27 +13,27 @@
 class FunRan : public Histo {
 public:
-  typedef double (*Func)(double);
-  FunRan(Func f, float xMin=0.0, float xMax=1.0, int nBin=100);
-  FunRan(double *tab, int nBin);
-  FunRan(double *tab, int nBin, float xMin, float xMax);
-  void IFunRan(double *tab, int nBin);
-  double Random(void);
-  int BinRandom(void);
+  typedef r_8 (*Func)(r_8);
+  FunRan(Func f, r_8 xMin=0.0, r_8 xMax=1.0, int_4 nBin=100);
+  FunRan(r_8 *tab, int_4 nBin);
+  FunRan(r_8 *tab, int_4 nBin, r_8 xMin, r_8 xMax);
+  void IFunRan(r_8 *tab, int_4 nBin);
+  r_8 Random(void);
+  int_4 BinRandom(void);
 };
 
 class FunRan2D EXC_AWARE {
 public:
-//  typedef double (*Func)(double, double);
-//  FunRan2D(Func f, float xMin=0.0, float xMax=1.0, int nBinX=100,
-//                   float yMin=0.0, float yMax=1.0, int nBinY=100);
-  FunRan2D(double *tab, int nBinX, int nBinY);
-  FunRan2D(double **tab, int nBinX, int nBinY);
+//  typedef r_8 (*Func)(r_8, r_8);
+//  FunRan2D(Func f, r_8 xMin=0.0, r_8 xMax=1.0, int_4 nBinX=100,
+//                   r_8 yMin=0.0, r_8 yMax=1.0, int_4 nBinY=100);
+  FunRan2D(r_8 *tab, int_4 nBinX, int_4 nBinY);
+  FunRan2D(r_8 **tab, int_4 nBinX, int_4 nBinY);
   ~FunRan2D();
-  void Random(double& x, double& y);
-  void BinRandom(int& x, int& y);
+  void Random(r_8& x, r_8& y);
+  void BinRandom(int_4& x, int_4& y);
 private:
   FunRan* ranX;
   FunRan** ranY;
-  int nx;
+  int_4 nx;
 };
 
