Index: trunk/SophyaLib/HiStats/Makefile
===================================================================
--- trunk/SophyaLib/HiStats/Makefile	(revision 3119)
+++ trunk/SophyaLib/HiStats/Makefile	(revision 3121)
@@ -4,8 +4,8 @@
  
 clean:
-	 rm -f $(SOPHYAOBJP)basedtable.o $(SOPHYAOBJP)datatable.o $(SOPHYAOBJP)fio_dtable.o $(SOPHYAOBJP)hisprof.o $(SOPHYAOBJP)histerr.o $(SOPHYAOBJP)histinit.o $(SOPHYAOBJP)histos2.o $(SOPHYAOBJP)histos.o $(SOPHYAOBJP)ntupintf.o $(SOPHYAOBJP)ntuple.o $(SOPHYAOBJP)proxtuple.o $(SOPHYAOBJP)swppfdtable.o $(SOPHYAOBJP)xntuple.o
+	 rm -f $(SOPHYAOBJP)basedtable.o $(SOPHYAOBJP)datatable.o $(SOPHYAOBJP)fio_dtable.o $(SOPHYAOBJP)hisprof.o $(SOPHYAOBJP)hist2err.o $(SOPHYAOBJP)histerr.o $(SOPHYAOBJP)histinit.o $(SOPHYAOBJP)histos2.o $(SOPHYAOBJP)histos.o $(SOPHYAOBJP)ntupintf.o $(SOPHYAOBJP)ntuple.o $(SOPHYAOBJP)proxtuple.o $(SOPHYAOBJP)swppfdtable.o $(SOPHYAOBJP)xntuple.o
 	rm -f $(SOPHYALIBP)libHiStats.a
  
-$(SOPHYALIBP)libHiStats.a : $(SOPHYAOBJP)basedtable.o $(SOPHYAOBJP)datatable.o $(SOPHYAOBJP)fio_dtable.o $(SOPHYAOBJP)hisprof.o $(SOPHYAOBJP)histerr.o $(SOPHYAOBJP)histinit.o $(SOPHYAOBJP)histos2.o $(SOPHYAOBJP)histos.o $(SOPHYAOBJP)ntupintf.o $(SOPHYAOBJP)ntuple.o $(SOPHYAOBJP)proxtuple.o $(SOPHYAOBJP)swppfdtable.o $(SOPHYAOBJP)xntuple.o
+$(SOPHYALIBP)libHiStats.a : $(SOPHYAOBJP)basedtable.o $(SOPHYAOBJP)datatable.o $(SOPHYAOBJP)fio_dtable.o $(SOPHYAOBJP)hisprof.o $(SOPHYAOBJP)hist2err.o $(SOPHYAOBJP)histerr.o $(SOPHYAOBJP)histinit.o $(SOPHYAOBJP)histos2.o $(SOPHYAOBJP)histos.o $(SOPHYAOBJP)ntupintf.o $(SOPHYAOBJP)ntuple.o $(SOPHYAOBJP)proxtuple.o $(SOPHYAOBJP)swppfdtable.o $(SOPHYAOBJP)xntuple.o
 	$(AR) $(ARFLAGS) $@ $? 
 	touch $(SOPHYAINCP)/SophyaConfInfo/libsophya.objlist
@@ -15,23 +15,26 @@
   ntupintf.h $(SOPHYAINCP)dvlist.h \
   $(SOPHYAINCP)objfio.h \
-  $(SOPHYAINCP)anydataobj.h \
-  $(SOPHYAINCP)ppersist.h \
-  $(SOPHYAINCP)pexceptions.h \
-  $(SOPHYAINCP)gnumd5.h \
-  $(SOPHYAINCP)ppfbinstream.h \
-  $(SOPHYAINCP)rawstream.h \
-  $(SOPHYAINCP)ppfnametag.h \
-  $(SOPHYAINCP)mutyv.h \
-  $(SOPHYAINCP)timestamp.h \
-  $(SOPHYAINCP)segdatablock.h \
-  $(SOPHYAINCP)tvector.h \
-  $(SOPHYAINCP)tmatrix.h \
-  $(SOPHYAINCP)tarray.h \
-  $(SOPHYAINCP)basarr.h \
-  $(SOPHYAINCP)ndatablock.h \
-  $(SOPHYAINCP)utilarr.h \
-  $(SOPHYAINCP)tmatrix_tsnl.h \
-  $(SOPHYAINCP)tvector_tsnl.h \
-  $(SOPHYAINCP)sopnamsp.h
+  $(SOPHYAINCP)machdefs.h \
+  $(SOPHYAINCP)anydataobj.h \
+  $(SOPHYAINCP)ppersist.h \
+  $(SOPHYAINCP)pexceptions.h \
+  $(SOPHYAINCP)gnumd5.h \
+  $(SOPHYAINCP)ppfbinstream.h \
+  $(SOPHYAINCP)rawstream.h \
+  $(SOPHYAINCP)ppfnametag.h \
+  $(SOPHYAINCP)mutyv.h \
+  $(SOPHYAINCP)timestamp.h \
+  $(SOPHYAINCP)segdatablock.h \
+  $(SOPHYAINCP)tvector.h \
+  $(SOPHYAINCP)tmatrix.h \
+  $(SOPHYAINCP)tarray.h \
+  $(SOPHYAINCP)basarr.h \
+  $(SOPHYAINCP)dvlist.h \
+  $(SOPHYAINCP)ndatablock.h \
+  $(SOPHYAINCP)utilarr.h \
+  $(SOPHYAINCP)tmatrix_tsnl.h \
+  $(SOPHYAINCP)tvector_tsnl.h \
+  $(SOPHYAINCP)sopnamsp.h \
+  $(SOPHYAINCP)pexceptions.h
 	$(CXXCOMPILE) $(CXXTEMPFLG) -o $@  basedtable.cc
  
@@ -40,25 +43,30 @@
   ntupintf.h $(SOPHYAINCP)dvlist.h \
   $(SOPHYAINCP)objfio.h \
-  $(SOPHYAINCP)anydataobj.h \
-  $(SOPHYAINCP)ppersist.h \
-  $(SOPHYAINCP)pexceptions.h \
-  $(SOPHYAINCP)gnumd5.h \
-  $(SOPHYAINCP)ppfbinstream.h \
-  $(SOPHYAINCP)rawstream.h \
-  $(SOPHYAINCP)ppfnametag.h \
-  $(SOPHYAINCP)mutyv.h \
-  $(SOPHYAINCP)timestamp.h \
-  $(SOPHYAINCP)segdatablock.h \
-  $(SOPHYAINCP)tvector.h \
-  $(SOPHYAINCP)tmatrix.h \
-  $(SOPHYAINCP)tarray.h \
-  $(SOPHYAINCP)basarr.h \
-  $(SOPHYAINCP)ndatablock.h \
-  $(SOPHYAINCP)utilarr.h \
-  $(SOPHYAINCP)tmatrix_tsnl.h \
-  $(SOPHYAINCP)tvector_tsnl.h \
+  $(SOPHYAINCP)machdefs.h \
+  $(SOPHYAINCP)anydataobj.h \
+  $(SOPHYAINCP)ppersist.h \
+  $(SOPHYAINCP)pexceptions.h \
+  $(SOPHYAINCP)gnumd5.h \
+  $(SOPHYAINCP)ppfbinstream.h \
+  $(SOPHYAINCP)rawstream.h \
+  $(SOPHYAINCP)ppfnametag.h \
+  $(SOPHYAINCP)mutyv.h \
+  $(SOPHYAINCP)timestamp.h \
+  $(SOPHYAINCP)segdatablock.h \
+  $(SOPHYAINCP)tvector.h \
+  $(SOPHYAINCP)tmatrix.h \
+  $(SOPHYAINCP)tarray.h \
+  $(SOPHYAINCP)basarr.h \
+  $(SOPHYAINCP)dvlist.h \
+  $(SOPHYAINCP)ndatablock.h \
+  $(SOPHYAINCP)utilarr.h \
+  $(SOPHYAINCP)tmatrix_tsnl.h \
+  $(SOPHYAINCP)tvector_tsnl.h \
+  $(SOPHYAINCP)objfio.h \
   $(SOPHYAINCP)sopnamsp.h \
   $(SOPHYAINCP)strutil.h \
+  $(SOPHYAINCP)pexceptions.h \
   $(SOPHYAINCP)fiosegdb.h \
+  $(SOPHYAINCP)segdatablock.h \
   $(SOPHYAINCP)ppftpointerio.h
 	$(CXXCOMPILE) $(CXXTEMPFLG) -o $@  datatable.cc
@@ -68,27 +76,33 @@
   ntupintf.h $(SOPHYAINCP)dvlist.h \
   $(SOPHYAINCP)objfio.h \
-  $(SOPHYAINCP)anydataobj.h \
-  $(SOPHYAINCP)ppersist.h \
-  $(SOPHYAINCP)pexceptions.h \
-  $(SOPHYAINCP)gnumd5.h \
-  $(SOPHYAINCP)ppfbinstream.h \
-  $(SOPHYAINCP)rawstream.h \
-  $(SOPHYAINCP)ppfnametag.h \
-  $(SOPHYAINCP)mutyv.h \
-  $(SOPHYAINCP)timestamp.h \
-  $(SOPHYAINCP)segdatablock.h \
-  $(SOPHYAINCP)tvector.h \
-  $(SOPHYAINCP)tmatrix.h \
-  $(SOPHYAINCP)tarray.h \
-  $(SOPHYAINCP)basarr.h \
-  $(SOPHYAINCP)ndatablock.h \
-  $(SOPHYAINCP)utilarr.h \
-  $(SOPHYAINCP)tmatrix_tsnl.h \
-  $(SOPHYAINCP)tvector_tsnl.h \
+  $(SOPHYAINCP)machdefs.h \
+  $(SOPHYAINCP)anydataobj.h \
+  $(SOPHYAINCP)ppersist.h \
+  $(SOPHYAINCP)pexceptions.h \
+  $(SOPHYAINCP)gnumd5.h \
+  $(SOPHYAINCP)ppfbinstream.h \
+  $(SOPHYAINCP)rawstream.h \
+  $(SOPHYAINCP)ppfnametag.h \
+  $(SOPHYAINCP)mutyv.h \
+  $(SOPHYAINCP)timestamp.h \
+  $(SOPHYAINCP)segdatablock.h \
+  $(SOPHYAINCP)tvector.h \
+  $(SOPHYAINCP)tmatrix.h \
+  $(SOPHYAINCP)tarray.h \
+  $(SOPHYAINCP)basarr.h \
+  $(SOPHYAINCP)dvlist.h \
+  $(SOPHYAINCP)ndatablock.h \
+  $(SOPHYAINCP)utilarr.h \
+  $(SOPHYAINCP)tmatrix_tsnl.h \
+  $(SOPHYAINCP)tvector_tsnl.h \
+  $(SOPHYAINCP)objfio.h \
   swppfdtable.h \
   $(SOPHYAINCP)swsegdb.h \
+  $(SOPHYAINCP)segdatablock.h \
   $(SOPHYAINCP)ppfswapper.h \
+  $(SOPHYAINCP)swsegdb.h \
   $(SOPHYAINCP)ppftpointerio.h \
   $(SOPHYAINCP)sopnamsp.h \
+  $(SOPHYAINCP)pexceptions.h \
   $(SOPHYAINCP)fiosegdb.h
 	$(CXXCOMPILE) $(CXXTEMPFLG) -o $@  fio_dtable.cc
@@ -98,4 +112,5 @@
   $(SOPHYAINCP)machdefs.h \
   hisprof.h $(SOPHYAINCP)peida.h \
+  $(SOPHYAINCP)machdefs.h \
   $(SOPHYAINCP)utils.h \
   $(SOPHYAINCP)perrors.h \
@@ -120,6 +135,38 @@
   $(SOPHYAINCP)tmatrix_tsnl.h \
   $(SOPHYAINCP)tvector_tsnl.h \
-  histos.h
+  $(SOPHYAINCP)ppersist.h histos.h \
+  $(SOPHYAINCP)objfio.h \
+  $(SOPHYAINCP)anydataobj.h \
+  $(SOPHYAINCP)perrors.h
 	$(CXXCOMPILE) $(CXXTEMPFLG) -o $@  hisprof.cc
+ 
+$(SOPHYAOBJP)hist2err.o: hist2err.cc \
+  $(SOPHYAINCP)sopnamsp.h \
+  $(SOPHYAINCP)machdefs.h \
+  $(SOPHYAINCP)perrors.h \
+  $(SOPHYAINCP)pexceptions.h \
+  $(SOPHYAINCP)machdefs.h \
+  $(SOPHYAINCP)fioarr.h \
+  $(SOPHYAINCP)tarray.h \
+  $(SOPHYAINCP)basarr.h \
+  $(SOPHYAINCP)anydataobj.h \
+  $(SOPHYAINCP)mutyv.h \
+  $(SOPHYAINCP)timestamp.h \
+  $(SOPHYAINCP)objfio.h \
+  $(SOPHYAINCP)ppersist.h \
+  $(SOPHYAINCP)gnumd5.h \
+  $(SOPHYAINCP)ppfbinstream.h \
+  $(SOPHYAINCP)rawstream.h \
+  $(SOPHYAINCP)ppfnametag.h \
+  $(SOPHYAINCP)dvlist.h \
+  $(SOPHYAINCP)ndatablock.h \
+  $(SOPHYAINCP)utilarr.h \
+  $(SOPHYAINCP)tmatrix.h \
+  $(SOPHYAINCP)tmatrix_tsnl.h \
+  $(SOPHYAINCP)tvector.h \
+  $(SOPHYAINCP)tvector_tsnl.h \
+  hist2err.h $(SOPHYAINCP)objfio.h \
+  $(SOPHYAINCP)tmatrix.h
+	$(CXXCOMPILE) $(CXXTEMPFLG) -o $@  hist2err.cc
  
 $(SOPHYAOBJP)histerr.o: histerr.cc \
@@ -130,4 +177,5 @@
   $(SOPHYAINCP)tarrinit.h \
   $(SOPHYAINCP)sophyainit.h \
+  $(SOPHYAINCP)machdefs.h \
   histerr.h $(SOPHYAINCP)objfio.h \
   $(SOPHYAINCP)anydataobj.h \
@@ -148,9 +196,13 @@
   $(SOPHYAINCP)mutyv.h \
   $(SOPHYAINCP)timestamp.h \
-  $(SOPHYAINCP)dvlist.h \
-  $(SOPHYAINCP)ndatablock.h \
-  $(SOPHYAINCP)utilarr.h \
-  $(SOPHYAINCP)tmatrix_tsnl.h \
-  $(SOPHYAINCP)tvector_tsnl.h
+  $(SOPHYAINCP)objfio.h \
+  $(SOPHYAINCP)dvlist.h \
+  $(SOPHYAINCP)ndatablock.h \
+  $(SOPHYAINCP)utilarr.h \
+  $(SOPHYAINCP)tmatrix_tsnl.h \
+  $(SOPHYAINCP)tvector_tsnl.h \
+  $(SOPHYAINCP)ppersist.h \
+  $(SOPHYAINCP)anydataobj.h \
+  $(SOPHYAINCP)perrors.h
 	$(CXXCOMPILE) $(CXXTEMPFLG) -o $@  histerr.cc
  
@@ -162,5 +214,6 @@
   $(SOPHYAINCP)tarrinit.h \
   $(SOPHYAINCP)sophyainit.h \
-  histos.h $(SOPHYAINCP)objfio.h \
+  $(SOPHYAINCP)machdefs.h histos.h \
+  $(SOPHYAINCP)objfio.h \
   $(SOPHYAINCP)anydataobj.h \
   $(SOPHYAINCP)ppersist.h \
@@ -180,15 +233,23 @@
   $(SOPHYAINCP)mutyv.h \
   $(SOPHYAINCP)timestamp.h \
-  $(SOPHYAINCP)dvlist.h \
-  $(SOPHYAINCP)ndatablock.h \
-  $(SOPHYAINCP)utilarr.h \
-  $(SOPHYAINCP)tmatrix_tsnl.h \
-  $(SOPHYAINCP)tvector_tsnl.h \
-  histos2.h hisprof.h histerr.h ntuple.h ntupintf.h xntuple.h datatable.h \
-  basedtable.h \
+  $(SOPHYAINCP)objfio.h \
+  $(SOPHYAINCP)dvlist.h \
+  $(SOPHYAINCP)ndatablock.h \
+  $(SOPHYAINCP)utilarr.h \
+  $(SOPHYAINCP)tmatrix_tsnl.h \
+  $(SOPHYAINCP)tvector_tsnl.h \
+  $(SOPHYAINCP)ppersist.h \
+  $(SOPHYAINCP)anydataobj.h \
+  histos2.h $(SOPHYAINCP)utils.h \
+  hisprof.h histerr.h hist2err.h \
+  $(SOPHYAINCP)tmatrix.h ntuple.h \
+  ntupintf.h $(SOPHYAINCP)dvlist.h \
+  xntuple.h datatable.h basedtable.h \
   $(SOPHYAINCP)segdatablock.h \
   swppfdtable.h \
   $(SOPHYAINCP)swsegdb.h \
+  $(SOPHYAINCP)segdatablock.h \
   $(SOPHYAINCP)ppfswapper.h \
+  $(SOPHYAINCP)swsegdb.h \
   $(SOPHYAINCP)ppftpointerio.h
 	$(CXXCOMPILE) $(CXXTEMPFLG) -o $@  histinit.cc
@@ -198,26 +259,31 @@
   $(SOPHYAINCP)machdefs.h \
   histos2.h $(SOPHYAINCP)peida.h \
+  $(SOPHYAINCP)machdefs.h \
   $(SOPHYAINCP)utils.h \
   $(SOPHYAINCP)perrors.h \
   $(SOPHYAINCP)pexceptions.h \
-  $(SOPHYAINCP)fmath.h histos.h \
-  $(SOPHYAINCP)objfio.h \
-  $(SOPHYAINCP)anydataobj.h \
-  $(SOPHYAINCP)ppersist.h \
-  $(SOPHYAINCP)gnumd5.h \
-  $(SOPHYAINCP)ppfbinstream.h \
-  $(SOPHYAINCP)rawstream.h \
-  $(SOPHYAINCP)ppfnametag.h \
-  $(SOPHYAINCP)tvector.h \
-  $(SOPHYAINCP)tmatrix.h \
-  $(SOPHYAINCP)tarray.h \
-  $(SOPHYAINCP)basarr.h \
-  $(SOPHYAINCP)mutyv.h \
-  $(SOPHYAINCP)timestamp.h \
-  $(SOPHYAINCP)dvlist.h \
-  $(SOPHYAINCP)ndatablock.h \
-  $(SOPHYAINCP)utilarr.h \
-  $(SOPHYAINCP)tmatrix_tsnl.h \
-  $(SOPHYAINCP)tvector_tsnl.h
+  $(SOPHYAINCP)fmath.h \
+  $(SOPHYAINCP)utils.h histos.h \
+  $(SOPHYAINCP)objfio.h \
+  $(SOPHYAINCP)anydataobj.h \
+  $(SOPHYAINCP)ppersist.h \
+  $(SOPHYAINCP)gnumd5.h \
+  $(SOPHYAINCP)ppfbinstream.h \
+  $(SOPHYAINCP)rawstream.h \
+  $(SOPHYAINCP)ppfnametag.h \
+  $(SOPHYAINCP)tvector.h \
+  $(SOPHYAINCP)tmatrix.h \
+  $(SOPHYAINCP)tarray.h \
+  $(SOPHYAINCP)basarr.h \
+  $(SOPHYAINCP)mutyv.h \
+  $(SOPHYAINCP)timestamp.h \
+  $(SOPHYAINCP)objfio.h \
+  $(SOPHYAINCP)dvlist.h \
+  $(SOPHYAINCP)ndatablock.h \
+  $(SOPHYAINCP)utilarr.h \
+  $(SOPHYAINCP)tmatrix_tsnl.h \
+  $(SOPHYAINCP)tvector_tsnl.h \
+  $(SOPHYAINCP)ppersist.h \
+  $(SOPHYAINCP)anydataobj.h
 	$(CXXCOMPILE) $(CXXTEMPFLG) -o $@  histos2.cc
  
@@ -226,4 +292,5 @@
   $(SOPHYAINCP)machdefs.h histos.h \
   $(SOPHYAINCP)objfio.h \
+  $(SOPHYAINCP)machdefs.h \
   $(SOPHYAINCP)anydataobj.h \
   $(SOPHYAINCP)ppersist.h \
@@ -243,10 +310,16 @@
   $(SOPHYAINCP)mutyv.h \
   $(SOPHYAINCP)timestamp.h \
-  $(SOPHYAINCP)dvlist.h \
-  $(SOPHYAINCP)ndatablock.h \
-  $(SOPHYAINCP)utilarr.h \
-  $(SOPHYAINCP)tmatrix_tsnl.h \
-  $(SOPHYAINCP)tvector_tsnl.h \
+  $(SOPHYAINCP)objfio.h \
+  $(SOPHYAINCP)dvlist.h \
+  $(SOPHYAINCP)ndatablock.h \
+  $(SOPHYAINCP)utilarr.h \
+  $(SOPHYAINCP)tmatrix_tsnl.h \
+  $(SOPHYAINCP)tvector_tsnl.h \
+  $(SOPHYAINCP)ppersist.h \
+  $(SOPHYAINCP)anydataobj.h \
+  $(SOPHYAINCP)perrors.h \
   $(SOPHYAINCP)poly.h \
+  $(SOPHYAINCP)peida.h \
+  $(SOPHYAINCP)tvector.h \
   $(SOPHYAINCP)strutil.h
 	$(CXXCOMPILE) $(CXXTEMPFLG) -o $@  histos.cc
@@ -256,5 +329,6 @@
   ntupintf.h \
   $(SOPHYAINCP)machdefs.h \
-  $(SOPHYAINCP)pexceptions.h
+  $(SOPHYAINCP)pexceptions.h \
+  $(SOPHYAINCP)machdefs.h
 	$(CXXCOMPILE) $(CXXTEMPFLG) -o $@  ntupintf.cc
  
@@ -272,5 +346,9 @@
   $(SOPHYAINCP)rawstream.h \
   $(SOPHYAINCP)ppfnametag.h \
-  ntupintf.h $(SOPHYAINCP)dvlist.h \
+  ntupintf.h \
+  $(SOPHYAINCP)machdefs.h \
+  $(SOPHYAINCP)ppersist.h \
+  $(SOPHYAINCP)dvlist.h \
+  $(SOPHYAINCP)objfio.h \
   $(SOPHYAINCP)mutyv.h \
   $(SOPHYAINCP)timestamp.h
@@ -289,5 +367,9 @@
   $(SOPHYAINCP)rawstream.h \
   $(SOPHYAINCP)ppfnametag.h \
-  ntupintf.h $(SOPHYAINCP)dvlist.h \
+  ntupintf.h \
+  $(SOPHYAINCP)machdefs.h \
+  $(SOPHYAINCP)ppersist.h \
+  $(SOPHYAINCP)dvlist.h \
+  $(SOPHYAINCP)objfio.h \
   $(SOPHYAINCP)mutyv.h \
   $(SOPHYAINCP)timestamp.h
@@ -298,26 +380,32 @@
   ntupintf.h $(SOPHYAINCP)dvlist.h \
   $(SOPHYAINCP)objfio.h \
-  $(SOPHYAINCP)anydataobj.h \
-  $(SOPHYAINCP)ppersist.h \
-  $(SOPHYAINCP)pexceptions.h \
-  $(SOPHYAINCP)gnumd5.h \
-  $(SOPHYAINCP)ppfbinstream.h \
-  $(SOPHYAINCP)rawstream.h \
-  $(SOPHYAINCP)ppfnametag.h \
-  $(SOPHYAINCP)mutyv.h \
-  $(SOPHYAINCP)timestamp.h \
-  $(SOPHYAINCP)segdatablock.h \
-  $(SOPHYAINCP)tvector.h \
-  $(SOPHYAINCP)tmatrix.h \
-  $(SOPHYAINCP)tarray.h \
-  $(SOPHYAINCP)basarr.h \
-  $(SOPHYAINCP)ndatablock.h \
-  $(SOPHYAINCP)utilarr.h \
-  $(SOPHYAINCP)tmatrix_tsnl.h \
-  $(SOPHYAINCP)tvector_tsnl.h \
-  $(SOPHYAINCP)swsegdb.h \
+  $(SOPHYAINCP)machdefs.h \
+  $(SOPHYAINCP)anydataobj.h \
+  $(SOPHYAINCP)ppersist.h \
+  $(SOPHYAINCP)pexceptions.h \
+  $(SOPHYAINCP)gnumd5.h \
+  $(SOPHYAINCP)ppfbinstream.h \
+  $(SOPHYAINCP)rawstream.h \
+  $(SOPHYAINCP)ppfnametag.h \
+  $(SOPHYAINCP)mutyv.h \
+  $(SOPHYAINCP)timestamp.h \
+  $(SOPHYAINCP)segdatablock.h \
+  $(SOPHYAINCP)tvector.h \
+  $(SOPHYAINCP)tmatrix.h \
+  $(SOPHYAINCP)tarray.h \
+  $(SOPHYAINCP)basarr.h \
+  $(SOPHYAINCP)dvlist.h \
+  $(SOPHYAINCP)ndatablock.h \
+  $(SOPHYAINCP)utilarr.h \
+  $(SOPHYAINCP)tmatrix_tsnl.h \
+  $(SOPHYAINCP)tvector_tsnl.h \
+  $(SOPHYAINCP)swsegdb.h \
+  $(SOPHYAINCP)segdatablock.h \
   $(SOPHYAINCP)ppfswapper.h \
+  $(SOPHYAINCP)swsegdb.h \
   $(SOPHYAINCP)ppftpointerio.h \
-  $(SOPHYAINCP)sopnamsp.h
+  $(SOPHYAINCP)objfio.h \
+  $(SOPHYAINCP)sopnamsp.h \
+  $(SOPHYAINCP)pexceptions.h
 	$(CXXCOMPILE) $(CXXTEMPFLG) -o $@  swppfdtable.cc
  
@@ -331,10 +419,13 @@
   $(SOPHYAINCP)rawstream.h \
   $(SOPHYAINCP)ppfnametag.h \
+  $(SOPHYAINCP)ppersist.h \
   $(SOPHYAINCP)perrors.h xntuple.h \
-  ntupintf.h $(SOPHYAINCP)dvlist.h \
-  $(SOPHYAINCP)objfio.h \
-  $(SOPHYAINCP)anydataobj.h \
-  $(SOPHYAINCP)mutyv.h \
-  $(SOPHYAINCP)timestamp.h
+  $(SOPHYAINCP)machdefs.h \
+  ntupintf.h $(SOPHYAINCP)dvlist.h \
+  $(SOPHYAINCP)objfio.h \
+  $(SOPHYAINCP)anydataobj.h \
+  $(SOPHYAINCP)mutyv.h \
+  $(SOPHYAINCP)timestamp.h \
+  $(SOPHYAINCP)objfio.h
 	$(CXXCOMPILE) $(CXXTEMPFLG) -o $@  xntuple.cc
  
Index: trunk/SophyaLib/HiStats/hist2err.cc
===================================================================
--- trunk/SophyaLib/HiStats/hist2err.cc	(revision 3121)
+++ trunk/SophyaLib/HiStats/hist2err.cc	(revision 3121)
@@ -0,0 +1,282 @@
+#include "sopnamsp.h"
+#include "machdefs.h"
+#include <string.h>
+#include <stdio.h>
+#include <math.h>
+#include "perrors.h"
+#include "fioarr.h"
+#include "hist2err.h"
+
+/*!
+  \class SOPHYA::Histo2DErr
+  \ingroup HiStats
+  Classe d'histogrammes 1D avec erreurs donnees par l'utilisateur
+*/
+
+/********* Methode *********/
+/*! Constructeur par defaut */
+Histo2DErr::Histo2DErr(void)
+: xmin_(1.), xmax_(-1.), nx_(0), dx_(0.)
+, ymin_(1.), ymax_(-1.), ny_(0), dy_(0.)
+, mCorrel(0)
+{
+}
+
+/********* Methode *********/
+/*! Constructeur d'un histo */
+Histo2DErr::Histo2DErr(r_8 xmin,r_8 xmax,int_4 nx,r_8 ymin,r_8 ymax,int_4 ny)
+: mCorrel(0)
+{
+  CreateOrResize(xmin,xmax,nx,ymin,ymax,ny);
+}
+
+/********* Methode *********/
+/*! Constructeur par copie */
+Histo2DErr::Histo2DErr(const Histo2DErr& H)
+: mCorrel(H.mCorrel)
+{
+ if(H.nx_<=0 || H.ny_<=0) return;
+ CreateOrResize(H.xmin_,H.xmax_,H.nx_,H.ymin_,H.ymax_,H.ny_);
+ data_  = H.data_; 
+ err2_  = H.err2_; 
+ ndata_ = H.ndata_; 
+}
+
+/********* Methode *********/
+/*! Destructeur */
+Histo2DErr::~Histo2DErr(void)
+{
+ mCorrel = 0;
+}
+
+/********* Methode *********/
+/*! Gestion de l'allocation */
+void Histo2DErr::CreateOrResize(r_8 xmin,r_8 xmax,int_4 nx,r_8 ymin,r_8 ymax,int_4 ny)
+{
+  xmin_ = xmin; xmax_ = xmax; nx_ = nx; dx_=0.;
+  ymin_ = ymin; ymax_ = ymax; ny_ = ny; dy_=0.;
+  if(nx_>0 && ny_>0) {
+    data_.ReSize(nx_,ny_);  data_ = 0.;
+    err2_.ReSize(nx_,ny_);  err2_ = 0.;
+    ndata_.ReSize(nx_,ny_); ndata_ = 0.;
+    dx_ = (xmax_-xmin_)/nx_;
+    dy_ = (ymax_-ymin_)/ny_;
+  }
+  mCorrel = 0;
+}
+
+/********* Methode *********/
+/*!
+  Remise a zero
+*/
+void Histo2DErr::Zero(void)
+{
+ if(nx_<=0 || ny_<=0) return;
+ data_ = 0.;
+ err2_ = 0.;
+ ndata_ = 0.;
+}
+
+/********* Methode *********/
+/*!
+ Recompute XMin (YMin) and XMax (YMax) so that
+ the CENTER of the first bin is exactly XMin (YMin) and
+ the CENTER of the last bin is exactly XMax (YMax).
+ Remember that otherwise
+ XMin (YMin) is the beginning of the first bin
+ and XMax (YMax) is the end of the last bin
+*/
+void Histo2DErr::ReCenterBinX(void)
+{
+ if(nx_<=1) return;
+ double dx = (xmax_-xmin_)/(nx_-1);
+ xmin_ -= dx/2.;
+ xmax_ += dx/2.;
+ dx_ = (xmax_-xmin_)/nx_;
+}
+
+void Histo2DErr::ReCenterBinY(void)
+{
+ if(ny_<=1) return;
+ double dy = (ymax_-ymin_)/(ny_-1);
+ ymin_ -= dy/2.;
+ ymax_ += dy/2.;
+ dy_ = (ymax_-ymin_)/ny_;
+}
+
+void Histo2DErr::ReCenterBin(void)
+{
+ ReCenterBinX();
+ ReCenterBinY();
+}
+
+/********* Methode *********/
+/*!
+  Compute the correlation histogram.
+  Each bin content is divided by the number of entries in that bin.
+  Each squared error is divided by the number of entries in that bin.
+  The number of entries by bin is NOT set to 1 (calling ToCorrel
+    many time will change the histogram !)
+*/
+void Histo2DErr::ToCorrel(void)
+{
+ if(nx_<1 || ny_<1) return;
+ mCorrel++;
+ for(int_4 i=0;i<nx_;i++) {
+   for(int_4 j=0;j<ny_;j++) {
+     if(ndata_(i,j)<1.) continue;
+     data_(i,j) /= ndata_(i,j);
+     err2_(i,j) /= ndata_(i,j);
+   }
+ }
+ return;
+}
+
+/********* Methode *********/
+/*!
+ Recompute back the original Histo2DErr before ToCorrel action
+*/
+void Histo2DErr::FromCorrel(void)
+{
+ if(nx_<1 || ny_<1) return;
+ mCorrel--;
+ for(int_4 i=0;i<nx_;i++) {
+   for(int_4 j=0;j<ny_;j++) {
+     if(ndata_(i,j)<1.) continue;
+     data_(i,j) *= ndata_(i,j);
+     err2_(i,j) *= ndata_(i,j);
+   }
+ }
+ return;
+}
+
+/********* Methode *********/
+/*!
+ Fill the histogram with an other histogram
+*/
+void Histo2DErr::FillFrHErr(Histo2DErr& hfrom)
+{
+ if(nx_<=0 || ny_<=0) return;
+ if(hfrom.nx_<=0 || hfrom.ny_<=0) return;
+
+ Zero();
+
+ for(int_4 i=0;i<hfrom.nx_;i++) {
+   for(int_4 j=0;j<hfrom.ny_;j++) {
+     r_8 x,y;  hfrom.BinCenter(i,j,x,y);
+     int ii,jj; FindBin(x,y,ii,jj);
+     if(jj<0 || jj>=ny_ || ii<0 || ii>=nx_) continue;
+     data_(ii,jj)  += hfrom.data_(ii,jj);
+     err2_(ii,jj)  += hfrom.err2_(ii,jj);
+     ndata_(ii,jj) += hfrom.ndata_(ii,jj);
+   }
+ }
+ mCorrel = hfrom.mCorrel;
+
+}
+
+/********* Methode *********/
+/*!
+  Operateur egal Histo2DErr = Histo2DErr
+*/
+Histo2DErr& Histo2DErr::operator = (const Histo2DErr& h)
+{
+  if(this==&h) return *this;
+  CreateOrResize(h.xmin_,h.xmax_,h.nx_,h.ymin_,h.ymax_,h.ny_);
+  data_  = h.data_;
+  err2_  = h.err2_;
+  ndata_ = h.ndata_;
+  mCorrel = h.mCorrel;
+  return *this;
+}
+
+/********* Methode *********/
+/*!
+  Print info
+*/
+void Histo2DErr::Show(ostream & os) const
+{
+  os <<"Histo2DErr(ncorrel="<<mCorrel<<")"<<endl
+     <<"          nx="<<nx_<<" ["<<xmin_<<","<<xmax_<<"] dx="<<dx_<<endl
+     <<"          ny="<<ny_<<" ["<<ymin_<<","<<ymax_<<"] dy="<<dy_<<endl;
+}
+
+///////////////////////////////////////////////////////////
+// --------------------------------------------------------
+//   Les objets delegues pour la gestion de persistance 
+// --------------------------------------------------------
+///////////////////////////////////////////////////////////
+
+DECL_TEMP_SPEC  /* equivalent a template <> , pour SGI-CC en particulier */
+void ObjFileIO<Histo2DErr>::ReadSelf(PInPersist& is)
+{
+string strg;
+
+if(dobj==NULL) dobj = new Histo2DErr;
+
+// Lecture entete
+is.GetStr(strg);
+
+// Nombre d'appels a ToCorrel/FromCorrel
+is.Get(dobj->mCorrel);
+
+// Lecture des parametres Histo2DErr
+is.Get(dobj->xmin_);
+is.Get(dobj->xmax_);
+is.Get(dobj->nx_);
+is.Get(dobj->dx_);
+is.Get(dobj->ymin_);
+is.Get(dobj->ymax_);
+is.Get(dobj->ny_);
+is.Get(dobj->dy_);
+
+// Lecture des donnees
+if(dobj->nx_>0 && dobj->ny_>0) {
+  is >> dobj->data_;
+  is >> dobj->err2_;
+  is >> dobj->ndata_;
+}
+
+return;
+}
+
+DECL_TEMP_SPEC  /* equivalent a template <> , pour SGI-CC en particulier */
+void ObjFileIO<Histo2DErr>::WriteSelf(POutPersist& os) const
+{
+if(dobj == NULL)   return;
+string strg;
+
+// Ecriture entete
+strg = "Hist2DErr";
+os.PutStr(strg);
+
+// Nombre d'appels a ToCorrel/FromCorrel
+os.Put(dobj->mCorrel);
+
+// Ecriture des parametres Histo2DErr
+os.Put(dobj->xmin_);
+os.Put(dobj->xmax_);
+os.Put(dobj->nx_);
+os.Put(dobj->dx_);
+os.Put(dobj->ymin_);
+os.Put(dobj->ymax_);
+os.Put(dobj->ny_);
+os.Put(dobj->dy_);
+
+// Ecriture des donnees
+if(dobj->nx_>0 && dobj->ny_>0) {
+  os << dobj->data_;
+  os << dobj->err2_;
+  os << dobj->ndata_;
+}
+
+return;
+}
+
+#ifdef __CXX_PRAGMA_TEMPLATES__
+#pragma define_template ObjFileIO<Histo2DErr>
+#endif
+
+#if defined(ANSI_TEMPLATES) || defined(GNU_TEMPLATES)
+template class SOPHYA::ObjFileIO<Histo2DErr>;
+#endif
Index: trunk/SophyaLib/HiStats/hist2err.h
===================================================================
--- trunk/SophyaLib/HiStats/hist2err.h	(revision 3121)
+++ trunk/SophyaLib/HiStats/hist2err.h	(revision 3121)
@@ -0,0 +1,156 @@
+#ifndef HIST2ERR_SEEN
+#define HIST2ERR_SEEN
+
+#include "objfio.h"
+#include <iostream>
+#include <stdio.h>
+#include "tmatrix.h"
+
+namespace SOPHYA {
+
+//! 2 dimensions histograms with errors given by user
+class Histo2DErr : public AnyDataObj {
+  friend class ObjFileIO<Histo2DErr>;
+public:
+
+  //! Create or destroy
+  Histo2DErr(void);
+  Histo2DErr(r_8 xmin,r_8 xmax,int_4 nx,r_8 ymin,r_8 ymax,int_4 ny);
+  Histo2DErr(const Histo2DErr& H);
+  virtual ~Histo2DErr(void);
+
+  //! Updating or Setting
+  void ReCenterBinX(void);
+  void ReCenterBinY(void);
+  void ReCenterBin(void);
+  void Zero(void);
+
+  //! Getting Info
+  int_4 NBinX(void) {return nx_;}
+  int_4 NBinY(void) {return ny_;}
+  r_8 XMin(void) {return xmin_;}
+  r_8 YMin(void) {return ymin_;}
+  r_8 XMax(void) {return xmax_;}
+  r_8 YMax(void) {return ymax_;}
+  r_8 WBinX(void) {return dx_;}
+  r_8 WBinY(void) {return dy_;}
+
+  //! Retourne le contenu du bin
+  inline r_8 operator()(int_4 i,int_4 j) const
+    {
+    if(i<0 || i>=nx_ || j<0 || j>=ny_) return 0.;
+    return data_(i,j);
+    }
+
+  //! Retourne le nombre l'erreur au carre dans le bin
+  inline r_8 Error2(int_4 i,int_4 j) const
+    {
+    if(i<0 || i>=nx_ || j<0 || j>=ny_) return 0.;
+    return err2_(i,j);
+    }
+
+  //! Retourne le nombre d'entree dans le bin
+  inline r_8 NEntBin(int_4 i,int_4 j) const
+    {
+    if(i<0 || i>=nx_ || j<0 || j>=ny_) return 0.;
+    return ndata_(i,j);
+    }
+
+  //! Retourne l'abscisse et l'ordonnee du coin inferieur du bin i,j.
+  inline void BinLowEdge(int_4 i,int_4 j,r_8& x,r_8& y) const
+              {x = xmin_ + i*dx_; y = ymin_ + j*dy_;}
+  //! Retourne l'abscisse et l'ordonnee du centre du bin i,j.
+  inline void BinCenter(int_4 i,int_4 j,r_8& x,r_8& y) const
+              {x = xmin_ + (i+0.5)*dx_; y = ymin_ + (j+0.5)*dy_;}
+  //! Retourne l'abscisse et l'ordonnee du coin superieur du bin i,j.
+  inline void BinHighEdge(int_4 i,int_4 j,r_8& x,r_8& y) const
+              {x = xmin_ + (i+1)*dx_; y = ymin_ + (j+1)*dy_;}
+  //! Retourne les numeros du bin contenant l'abscisse et l'ordonnee x,y.
+  inline void FindBin(r_8 x,r_8 y,int_4& i,int_4& j) const
+    {i=(int_4) floor((x-xmin_)/dx_); j=(int_4) floor((y-ymin_)/dy_);}
+
+  //! Addition du contenu de l'histo pour abscisse x poids w et l'erreur e
+  inline void Add(r_8 x, r_8 y, r_8 w, r_8 e)
+    {
+    int_4 i,j; FindBin(x,y,i,j);
+    if(i<0 || i>=nx_ || j<0 || j>=ny_) return;
+    data_(i,j) += w; ndata_(i,j) += 1.; err2_(i,j) += e*e;
+    }
+  inline void Add(r_8 x,r_8 y, r_8 w) {Add(x,y,w,1.);}
+  inline void Add(r_8 x,r_8 y) {Add(x,y,1.,1.);}
+
+  //! Addition du contenu de l'histo pour le bin numBin poids w et l'erreur e
+  inline void AddBin(int_4 i,int_4 j, r_8 w, r_8 e)
+    {
+    if(i<0 || i>=nx_ || j<0 || j>=ny_) return;
+    data_(i,j) += w; ndata_(i,j) += 1.; err2_(i,j) += e*e;
+    }
+  inline void AddBin(int_4 i,int_4 j, r_8 w) {AddBin(i,j,w,1.);}
+  inline void AddBin(int_4 i,int_4 j) {AddBin(i,j,1.,1.);}
+
+  //! remplissage contenu de l'histo pour le bin numBin poids w et l'erreur e
+  inline void SetBin(int_4 i,int_4 j, r_8 w, r_8 e, r_8 nb)
+    {
+    if(i<0 || i>=nx_ || j<0 || j>=ny_) return;
+    data_(i,j)  = w;
+    err2_(i,j)  = e*e;
+    ndata_(i,j) = nb;
+    }
+  inline void SetBin(int_4 i,int_4 j, r_8 w, r_8 e) {SetBin(i,j,w,e,1.);}
+  inline void SetBin(int_4 i,int_4 j, r_8 w) {SetBin(i,j,w,1.,1.);}
+  inline void SetBin(int_4 i,int_4 j) {SetBin(i,j,1.,1.,1.);}
+  //! remplissage nombre d'entrees pour le bin numBin
+  void SetNentB(int_4 i,int_4 j, r_8 nb)
+    {
+    if(i<0 || i>=nx_ || j<0 || j>=ny_) return;
+    ndata_(i,j) = nb;
+    }
+
+  //! Compute the correlation histogram
+  void ToCorrel(void);
+  void FromCorrel(void);
+  int_4 NCorrel(void) {return mCorrel;}
+  void SetCorrel(int_4 mcorrel) {mCorrel = mcorrel;}
+
+  //! Fill an histogram with an histogram
+  void FillFrHErr(Histo2DErr& hfrom);
+
+  //! Recuperation des matrices elementaires
+  inline void GetData(TMatrix<r_8>& data) {data = data_;}
+  inline void GetError2(TMatrix<r_8>& err2) {err2 = err2_;}
+  inline void GetNData(TMatrix<r_8>& ndata) {ndata = ndata_;}
+
+  // Operators
+  Histo2DErr& operator = (const Histo2DErr& h);
+
+  // Print
+  virtual void Show(ostream& os) const;
+  inline  void Show() const { Show(cout); }
+
+protected:
+  void CreateOrResize(r_8 xmin,r_8 xmax,int_4 nx,r_8 ymin,r_8 ymax,int_4 ny);
+
+  r_4 xmin_,xmax_,dx_,ymin_,ymax_,dy_;
+  int_4 nx_,ny_;
+  TMatrix<r_8> data_;
+  TMatrix<r_8> err2_;
+  TMatrix<r_8> ndata_;
+  int_4 mCorrel;  //!< Nombre d'appels a ToCorrel(+1) ou FromCorrel(-1)
+};
+
+/*! Prints histogram information on stream \b s (h.Show(s)) */
+inline ostream& operator << (ostream& s, Histo2DErr const & h)
+  {  h.Show(s);  return(s);  }
+
+/*! \ingroup HiStats \fn operator<<(POuttPersist&,Histo2DErr)
+  \brief Persistance management */
+inline POutPersist& operator << (POutPersist& os, Histo2DErr & obj)
+{ ObjFileIO<Histo2DErr> fio(&obj);  fio.Write(os);  return(os); }
+/*! \ingroup HiStats \fn operator<<(POuttPersist&,Histo2DErr)
+  \brief Persistance management */
+inline PInPersist& operator >> (PInPersist& is, Histo2DErr & obj)
+{ ObjFileIO<Histo2DErr> fio(&obj); is.SkipToNextObject(); fio.Read(is); return(is); }
+
+} // Fin du namespace
+
+#endif // HIST2ERR_SEEN
Index: trunk/SophyaLib/HiStats/histinit.cc
===================================================================
--- trunk/SophyaLib/HiStats/histinit.cc	(revision 3119)
+++ trunk/SophyaLib/HiStats/histinit.cc	(revision 3121)
@@ -10,4 +10,5 @@
 #include "hisprof.h"
 #include "histerr.h"
+#include "hist2err.h"
 #include "ntuple.h"
 #include "xntuple.h"
@@ -33,6 +34,7 @@
   - Histo
   - HProf
+  - Histo2D
   - HistoErr
-  - Histo2D
+  - Histo2DErr
   - NTuple
   - XNTuple
@@ -59,6 +61,9 @@
   PPRegister(ObjFileIO<HProf>);
   DObjRegister(ObjFileIO<HProf>, HProf);
+
   PPRegister(ObjFileIO<HistoErr>);
   DObjRegister(ObjFileIO<HistoErr>, HistoErr);
+  PPRegister(ObjFileIO<Histo2DErr>);
+  DObjRegister(ObjFileIO<Histo2DErr>, Histo2DErr);
 
   PPRegister(ObjFileIO<NTuple>);
Index: trunk/SophyaLib/HiStats/objlist.list
===================================================================
--- trunk/SophyaLib/HiStats/objlist.list	(revision 3119)
+++ trunk/SophyaLib/HiStats/objlist.list	(revision 3121)
@@ -3,4 +3,5 @@
 fio_dtable.o
 hisprof.o
+hist2err.o
 histerr.o
 histinit.o
Index: trunk/SophyaLib/HiStats/smakefile
===================================================================
--- trunk/SophyaLib/HiStats/smakefile	(revision 3119)
+++ trunk/SophyaLib/HiStats/smakefile	(revision 3121)
@@ -4,8 +4,8 @@
  
 clean:
-	 rm -f $(SOPHYAOBJP)basedtable.o $(SOPHYAOBJP)datatable.o $(SOPHYAOBJP)fio_dtable.o $(SOPHYAOBJP)hisprof.o $(SOPHYAOBJP)histerr.o $(SOPHYAOBJP)histinit.o $(SOPHYAOBJP)histos2.o $(SOPHYAOBJP)histos.o $(SOPHYAOBJP)ntupintf.o $(SOPHYAOBJP)ntuple.o $(SOPHYAOBJP)proxtuple.o $(SOPHYAOBJP)swppfdtable.o $(SOPHYAOBJP)xntuple.o
+	 rm -f $(SOPHYAOBJP)basedtable.o $(SOPHYAOBJP)datatable.o $(SOPHYAOBJP)fio_dtable.o $(SOPHYAOBJP)hisprof.o $(SOPHYAOBJP)hist2err.o $(SOPHYAOBJP)histerr.o $(SOPHYAOBJP)histinit.o $(SOPHYAOBJP)histos2.o $(SOPHYAOBJP)histos.o $(SOPHYAOBJP)ntupintf.o $(SOPHYAOBJP)ntuple.o $(SOPHYAOBJP)proxtuple.o $(SOPHYAOBJP)swppfdtable.o $(SOPHYAOBJP)xntuple.o
 	rm -f $(SOPHYALIBP)libHiStats.a
  
-$(SOPHYALIBP)libHiStats.a : $(SOPHYAOBJP)basedtable.o $(SOPHYAOBJP)datatable.o $(SOPHYAOBJP)fio_dtable.o $(SOPHYAOBJP)hisprof.o $(SOPHYAOBJP)histerr.o $(SOPHYAOBJP)histinit.o $(SOPHYAOBJP)histos2.o $(SOPHYAOBJP)histos.o $(SOPHYAOBJP)ntupintf.o $(SOPHYAOBJP)ntuple.o $(SOPHYAOBJP)proxtuple.o $(SOPHYAOBJP)swppfdtable.o $(SOPHYAOBJP)xntuple.o
+$(SOPHYALIBP)libHiStats.a : $(SOPHYAOBJP)basedtable.o $(SOPHYAOBJP)datatable.o $(SOPHYAOBJP)fio_dtable.o $(SOPHYAOBJP)hisprof.o $(SOPHYAOBJP)hist2err.o $(SOPHYAOBJP)histerr.o $(SOPHYAOBJP)histinit.o $(SOPHYAOBJP)histos2.o $(SOPHYAOBJP)histos.o $(SOPHYAOBJP)ntupintf.o $(SOPHYAOBJP)ntuple.o $(SOPHYAOBJP)proxtuple.o $(SOPHYAOBJP)swppfdtable.o $(SOPHYAOBJP)xntuple.o
 	$(AR) $(ARFLAGS) $@ $? 
 	touch $(SOPHYAINCP)/SophyaConfInfo/libsophya.objlist
@@ -15,23 +15,26 @@
   ntupintf.h $(SOPHYAINCP)dvlist.h \
   $(SOPHYAINCP)objfio.h \
-  $(SOPHYAINCP)anydataobj.h \
-  $(SOPHYAINCP)ppersist.h \
-  $(SOPHYAINCP)pexceptions.h \
-  $(SOPHYAINCP)gnumd5.h \
-  $(SOPHYAINCP)ppfbinstream.h \
-  $(SOPHYAINCP)rawstream.h \
-  $(SOPHYAINCP)ppfnametag.h \
-  $(SOPHYAINCP)mutyv.h \
-  $(SOPHYAINCP)timestamp.h \
-  $(SOPHYAINCP)segdatablock.h \
-  $(SOPHYAINCP)tvector.h \
-  $(SOPHYAINCP)tmatrix.h \
-  $(SOPHYAINCP)tarray.h \
-  $(SOPHYAINCP)basarr.h \
-  $(SOPHYAINCP)ndatablock.h \
-  $(SOPHYAINCP)utilarr.h \
-  $(SOPHYAINCP)tmatrix_tsnl.h \
-  $(SOPHYAINCP)tvector_tsnl.h \
-  $(SOPHYAINCP)sopnamsp.h
+  $(SOPHYAINCP)machdefs.h \
+  $(SOPHYAINCP)anydataobj.h \
+  $(SOPHYAINCP)ppersist.h \
+  $(SOPHYAINCP)pexceptions.h \
+  $(SOPHYAINCP)gnumd5.h \
+  $(SOPHYAINCP)ppfbinstream.h \
+  $(SOPHYAINCP)rawstream.h \
+  $(SOPHYAINCP)ppfnametag.h \
+  $(SOPHYAINCP)mutyv.h \
+  $(SOPHYAINCP)timestamp.h \
+  $(SOPHYAINCP)segdatablock.h \
+  $(SOPHYAINCP)tvector.h \
+  $(SOPHYAINCP)tmatrix.h \
+  $(SOPHYAINCP)tarray.h \
+  $(SOPHYAINCP)basarr.h \
+  $(SOPHYAINCP)dvlist.h \
+  $(SOPHYAINCP)ndatablock.h \
+  $(SOPHYAINCP)utilarr.h \
+  $(SOPHYAINCP)tmatrix_tsnl.h \
+  $(SOPHYAINCP)tvector_tsnl.h \
+  $(SOPHYAINCP)sopnamsp.h \
+  $(SOPHYAINCP)pexceptions.h
 	$(CXXCOMPILE) $(CXXTEMPFLG) -o $@  basedtable.cc
  
@@ -40,25 +43,30 @@
   ntupintf.h $(SOPHYAINCP)dvlist.h \
   $(SOPHYAINCP)objfio.h \
-  $(SOPHYAINCP)anydataobj.h \
-  $(SOPHYAINCP)ppersist.h \
-  $(SOPHYAINCP)pexceptions.h \
-  $(SOPHYAINCP)gnumd5.h \
-  $(SOPHYAINCP)ppfbinstream.h \
-  $(SOPHYAINCP)rawstream.h \
-  $(SOPHYAINCP)ppfnametag.h \
-  $(SOPHYAINCP)mutyv.h \
-  $(SOPHYAINCP)timestamp.h \
-  $(SOPHYAINCP)segdatablock.h \
-  $(SOPHYAINCP)tvector.h \
-  $(SOPHYAINCP)tmatrix.h \
-  $(SOPHYAINCP)tarray.h \
-  $(SOPHYAINCP)basarr.h \
-  $(SOPHYAINCP)ndatablock.h \
-  $(SOPHYAINCP)utilarr.h \
-  $(SOPHYAINCP)tmatrix_tsnl.h \
-  $(SOPHYAINCP)tvector_tsnl.h \
+  $(SOPHYAINCP)machdefs.h \
+  $(SOPHYAINCP)anydataobj.h \
+  $(SOPHYAINCP)ppersist.h \
+  $(SOPHYAINCP)pexceptions.h \
+  $(SOPHYAINCP)gnumd5.h \
+  $(SOPHYAINCP)ppfbinstream.h \
+  $(SOPHYAINCP)rawstream.h \
+  $(SOPHYAINCP)ppfnametag.h \
+  $(SOPHYAINCP)mutyv.h \
+  $(SOPHYAINCP)timestamp.h \
+  $(SOPHYAINCP)segdatablock.h \
+  $(SOPHYAINCP)tvector.h \
+  $(SOPHYAINCP)tmatrix.h \
+  $(SOPHYAINCP)tarray.h \
+  $(SOPHYAINCP)basarr.h \
+  $(SOPHYAINCP)dvlist.h \
+  $(SOPHYAINCP)ndatablock.h \
+  $(SOPHYAINCP)utilarr.h \
+  $(SOPHYAINCP)tmatrix_tsnl.h \
+  $(SOPHYAINCP)tvector_tsnl.h \
+  $(SOPHYAINCP)objfio.h \
   $(SOPHYAINCP)sopnamsp.h \
   $(SOPHYAINCP)strutil.h \
+  $(SOPHYAINCP)pexceptions.h \
   $(SOPHYAINCP)fiosegdb.h \
+  $(SOPHYAINCP)segdatablock.h \
   $(SOPHYAINCP)ppftpointerio.h
 	$(CXXCOMPILE) $(CXXTEMPFLG) -o $@  datatable.cc
@@ -68,27 +76,33 @@
   ntupintf.h $(SOPHYAINCP)dvlist.h \
   $(SOPHYAINCP)objfio.h \
-  $(SOPHYAINCP)anydataobj.h \
-  $(SOPHYAINCP)ppersist.h \
-  $(SOPHYAINCP)pexceptions.h \
-  $(SOPHYAINCP)gnumd5.h \
-  $(SOPHYAINCP)ppfbinstream.h \
-  $(SOPHYAINCP)rawstream.h \
-  $(SOPHYAINCP)ppfnametag.h \
-  $(SOPHYAINCP)mutyv.h \
-  $(SOPHYAINCP)timestamp.h \
-  $(SOPHYAINCP)segdatablock.h \
-  $(SOPHYAINCP)tvector.h \
-  $(SOPHYAINCP)tmatrix.h \
-  $(SOPHYAINCP)tarray.h \
-  $(SOPHYAINCP)basarr.h \
-  $(SOPHYAINCP)ndatablock.h \
-  $(SOPHYAINCP)utilarr.h \
-  $(SOPHYAINCP)tmatrix_tsnl.h \
-  $(SOPHYAINCP)tvector_tsnl.h \
+  $(SOPHYAINCP)machdefs.h \
+  $(SOPHYAINCP)anydataobj.h \
+  $(SOPHYAINCP)ppersist.h \
+  $(SOPHYAINCP)pexceptions.h \
+  $(SOPHYAINCP)gnumd5.h \
+  $(SOPHYAINCP)ppfbinstream.h \
+  $(SOPHYAINCP)rawstream.h \
+  $(SOPHYAINCP)ppfnametag.h \
+  $(SOPHYAINCP)mutyv.h \
+  $(SOPHYAINCP)timestamp.h \
+  $(SOPHYAINCP)segdatablock.h \
+  $(SOPHYAINCP)tvector.h \
+  $(SOPHYAINCP)tmatrix.h \
+  $(SOPHYAINCP)tarray.h \
+  $(SOPHYAINCP)basarr.h \
+  $(SOPHYAINCP)dvlist.h \
+  $(SOPHYAINCP)ndatablock.h \
+  $(SOPHYAINCP)utilarr.h \
+  $(SOPHYAINCP)tmatrix_tsnl.h \
+  $(SOPHYAINCP)tvector_tsnl.h \
+  $(SOPHYAINCP)objfio.h \
   swppfdtable.h \
   $(SOPHYAINCP)swsegdb.h \
+  $(SOPHYAINCP)segdatablock.h \
   $(SOPHYAINCP)ppfswapper.h \
+  $(SOPHYAINCP)swsegdb.h \
   $(SOPHYAINCP)ppftpointerio.h \
   $(SOPHYAINCP)sopnamsp.h \
+  $(SOPHYAINCP)pexceptions.h \
   $(SOPHYAINCP)fiosegdb.h
 	$(CXXCOMPILE) $(CXXTEMPFLG) -o $@  fio_dtable.cc
@@ -98,4 +112,5 @@
   $(SOPHYAINCP)machdefs.h \
   hisprof.h $(SOPHYAINCP)peida.h \
+  $(SOPHYAINCP)machdefs.h \
   $(SOPHYAINCP)utils.h \
   $(SOPHYAINCP)perrors.h \
@@ -120,6 +135,38 @@
   $(SOPHYAINCP)tmatrix_tsnl.h \
   $(SOPHYAINCP)tvector_tsnl.h \
-  histos.h
+  $(SOPHYAINCP)ppersist.h histos.h \
+  $(SOPHYAINCP)objfio.h \
+  $(SOPHYAINCP)anydataobj.h \
+  $(SOPHYAINCP)perrors.h
 	$(CXXCOMPILE) $(CXXTEMPFLG) -o $@  hisprof.cc
+ 
+$(SOPHYAOBJP)hist2err.o: hist2err.cc \
+  $(SOPHYAINCP)sopnamsp.h \
+  $(SOPHYAINCP)machdefs.h \
+  $(SOPHYAINCP)perrors.h \
+  $(SOPHYAINCP)pexceptions.h \
+  $(SOPHYAINCP)machdefs.h \
+  $(SOPHYAINCP)fioarr.h \
+  $(SOPHYAINCP)tarray.h \
+  $(SOPHYAINCP)basarr.h \
+  $(SOPHYAINCP)anydataobj.h \
+  $(SOPHYAINCP)mutyv.h \
+  $(SOPHYAINCP)timestamp.h \
+  $(SOPHYAINCP)objfio.h \
+  $(SOPHYAINCP)ppersist.h \
+  $(SOPHYAINCP)gnumd5.h \
+  $(SOPHYAINCP)ppfbinstream.h \
+  $(SOPHYAINCP)rawstream.h \
+  $(SOPHYAINCP)ppfnametag.h \
+  $(SOPHYAINCP)dvlist.h \
+  $(SOPHYAINCP)ndatablock.h \
+  $(SOPHYAINCP)utilarr.h \
+  $(SOPHYAINCP)tmatrix.h \
+  $(SOPHYAINCP)tmatrix_tsnl.h \
+  $(SOPHYAINCP)tvector.h \
+  $(SOPHYAINCP)tvector_tsnl.h \
+  hist2err.h $(SOPHYAINCP)objfio.h \
+  $(SOPHYAINCP)tmatrix.h
+	$(CXXCOMPILE) $(CXXTEMPFLG) -o $@  hist2err.cc
  
 $(SOPHYAOBJP)histerr.o: histerr.cc \
@@ -130,4 +177,5 @@
   $(SOPHYAINCP)tarrinit.h \
   $(SOPHYAINCP)sophyainit.h \
+  $(SOPHYAINCP)machdefs.h \
   histerr.h $(SOPHYAINCP)objfio.h \
   $(SOPHYAINCP)anydataobj.h \
@@ -148,9 +196,13 @@
   $(SOPHYAINCP)mutyv.h \
   $(SOPHYAINCP)timestamp.h \
-  $(SOPHYAINCP)dvlist.h \
-  $(SOPHYAINCP)ndatablock.h \
-  $(SOPHYAINCP)utilarr.h \
-  $(SOPHYAINCP)tmatrix_tsnl.h \
-  $(SOPHYAINCP)tvector_tsnl.h
+  $(SOPHYAINCP)objfio.h \
+  $(SOPHYAINCP)dvlist.h \
+  $(SOPHYAINCP)ndatablock.h \
+  $(SOPHYAINCP)utilarr.h \
+  $(SOPHYAINCP)tmatrix_tsnl.h \
+  $(SOPHYAINCP)tvector_tsnl.h \
+  $(SOPHYAINCP)ppersist.h \
+  $(SOPHYAINCP)anydataobj.h \
+  $(SOPHYAINCP)perrors.h
 	$(CXXCOMPILE) $(CXXTEMPFLG) -o $@  histerr.cc
  
@@ -162,5 +214,6 @@
   $(SOPHYAINCP)tarrinit.h \
   $(SOPHYAINCP)sophyainit.h \
-  histos.h $(SOPHYAINCP)objfio.h \
+  $(SOPHYAINCP)machdefs.h histos.h \
+  $(SOPHYAINCP)objfio.h \
   $(SOPHYAINCP)anydataobj.h \
   $(SOPHYAINCP)ppersist.h \
@@ -180,15 +233,23 @@
   $(SOPHYAINCP)mutyv.h \
   $(SOPHYAINCP)timestamp.h \
-  $(SOPHYAINCP)dvlist.h \
-  $(SOPHYAINCP)ndatablock.h \
-  $(SOPHYAINCP)utilarr.h \
-  $(SOPHYAINCP)tmatrix_tsnl.h \
-  $(SOPHYAINCP)tvector_tsnl.h \
-  histos2.h hisprof.h histerr.h ntuple.h ntupintf.h xntuple.h datatable.h \
-  basedtable.h \
+  $(SOPHYAINCP)objfio.h \
+  $(SOPHYAINCP)dvlist.h \
+  $(SOPHYAINCP)ndatablock.h \
+  $(SOPHYAINCP)utilarr.h \
+  $(SOPHYAINCP)tmatrix_tsnl.h \
+  $(SOPHYAINCP)tvector_tsnl.h \
+  $(SOPHYAINCP)ppersist.h \
+  $(SOPHYAINCP)anydataobj.h \
+  histos2.h $(SOPHYAINCP)utils.h \
+  hisprof.h histerr.h hist2err.h \
+  $(SOPHYAINCP)tmatrix.h ntuple.h \
+  ntupintf.h $(SOPHYAINCP)dvlist.h \
+  xntuple.h datatable.h basedtable.h \
   $(SOPHYAINCP)segdatablock.h \
   swppfdtable.h \
   $(SOPHYAINCP)swsegdb.h \
+  $(SOPHYAINCP)segdatablock.h \
   $(SOPHYAINCP)ppfswapper.h \
+  $(SOPHYAINCP)swsegdb.h \
   $(SOPHYAINCP)ppftpointerio.h
 	$(CXXCOMPILE) $(CXXTEMPFLG) -o $@  histinit.cc
@@ -198,26 +259,31 @@
   $(SOPHYAINCP)machdefs.h \
   histos2.h $(SOPHYAINCP)peida.h \
+  $(SOPHYAINCP)machdefs.h \
   $(SOPHYAINCP)utils.h \
   $(SOPHYAINCP)perrors.h \
   $(SOPHYAINCP)pexceptions.h \
-  $(SOPHYAINCP)fmath.h histos.h \
-  $(SOPHYAINCP)objfio.h \
-  $(SOPHYAINCP)anydataobj.h \
-  $(SOPHYAINCP)ppersist.h \
-  $(SOPHYAINCP)gnumd5.h \
-  $(SOPHYAINCP)ppfbinstream.h \
-  $(SOPHYAINCP)rawstream.h \
-  $(SOPHYAINCP)ppfnametag.h \
-  $(SOPHYAINCP)tvector.h \
-  $(SOPHYAINCP)tmatrix.h \
-  $(SOPHYAINCP)tarray.h \
-  $(SOPHYAINCP)basarr.h \
-  $(SOPHYAINCP)mutyv.h \
-  $(SOPHYAINCP)timestamp.h \
-  $(SOPHYAINCP)dvlist.h \
-  $(SOPHYAINCP)ndatablock.h \
-  $(SOPHYAINCP)utilarr.h \
-  $(SOPHYAINCP)tmatrix_tsnl.h \
-  $(SOPHYAINCP)tvector_tsnl.h
+  $(SOPHYAINCP)fmath.h \
+  $(SOPHYAINCP)utils.h histos.h \
+  $(SOPHYAINCP)objfio.h \
+  $(SOPHYAINCP)anydataobj.h \
+  $(SOPHYAINCP)ppersist.h \
+  $(SOPHYAINCP)gnumd5.h \
+  $(SOPHYAINCP)ppfbinstream.h \
+  $(SOPHYAINCP)rawstream.h \
+  $(SOPHYAINCP)ppfnametag.h \
+  $(SOPHYAINCP)tvector.h \
+  $(SOPHYAINCP)tmatrix.h \
+  $(SOPHYAINCP)tarray.h \
+  $(SOPHYAINCP)basarr.h \
+  $(SOPHYAINCP)mutyv.h \
+  $(SOPHYAINCP)timestamp.h \
+  $(SOPHYAINCP)objfio.h \
+  $(SOPHYAINCP)dvlist.h \
+  $(SOPHYAINCP)ndatablock.h \
+  $(SOPHYAINCP)utilarr.h \
+  $(SOPHYAINCP)tmatrix_tsnl.h \
+  $(SOPHYAINCP)tvector_tsnl.h \
+  $(SOPHYAINCP)ppersist.h \
+  $(SOPHYAINCP)anydataobj.h
 	$(CXXCOMPILE) $(CXXTEMPFLG) -o $@  histos2.cc
  
@@ -226,4 +292,5 @@
   $(SOPHYAINCP)machdefs.h histos.h \
   $(SOPHYAINCP)objfio.h \
+  $(SOPHYAINCP)machdefs.h \
   $(SOPHYAINCP)anydataobj.h \
   $(SOPHYAINCP)ppersist.h \
@@ -243,10 +310,16 @@
   $(SOPHYAINCP)mutyv.h \
   $(SOPHYAINCP)timestamp.h \
-  $(SOPHYAINCP)dvlist.h \
-  $(SOPHYAINCP)ndatablock.h \
-  $(SOPHYAINCP)utilarr.h \
-  $(SOPHYAINCP)tmatrix_tsnl.h \
-  $(SOPHYAINCP)tvector_tsnl.h \
+  $(SOPHYAINCP)objfio.h \
+  $(SOPHYAINCP)dvlist.h \
+  $(SOPHYAINCP)ndatablock.h \
+  $(SOPHYAINCP)utilarr.h \
+  $(SOPHYAINCP)tmatrix_tsnl.h \
+  $(SOPHYAINCP)tvector_tsnl.h \
+  $(SOPHYAINCP)ppersist.h \
+  $(SOPHYAINCP)anydataobj.h \
+  $(SOPHYAINCP)perrors.h \
   $(SOPHYAINCP)poly.h \
+  $(SOPHYAINCP)peida.h \
+  $(SOPHYAINCP)tvector.h \
   $(SOPHYAINCP)strutil.h
 	$(CXXCOMPILE) $(CXXTEMPFLG) -o $@  histos.cc
@@ -256,5 +329,6 @@
   ntupintf.h \
   $(SOPHYAINCP)machdefs.h \
-  $(SOPHYAINCP)pexceptions.h
+  $(SOPHYAINCP)pexceptions.h \
+  $(SOPHYAINCP)machdefs.h
 	$(CXXCOMPILE) $(CXXTEMPFLG) -o $@  ntupintf.cc
  
@@ -272,5 +346,9 @@
   $(SOPHYAINCP)rawstream.h \
   $(SOPHYAINCP)ppfnametag.h \
-  ntupintf.h $(SOPHYAINCP)dvlist.h \
+  ntupintf.h \
+  $(SOPHYAINCP)machdefs.h \
+  $(SOPHYAINCP)ppersist.h \
+  $(SOPHYAINCP)dvlist.h \
+  $(SOPHYAINCP)objfio.h \
   $(SOPHYAINCP)mutyv.h \
   $(SOPHYAINCP)timestamp.h
@@ -289,5 +367,9 @@
   $(SOPHYAINCP)rawstream.h \
   $(SOPHYAINCP)ppfnametag.h \
-  ntupintf.h $(SOPHYAINCP)dvlist.h \
+  ntupintf.h \
+  $(SOPHYAINCP)machdefs.h \
+  $(SOPHYAINCP)ppersist.h \
+  $(SOPHYAINCP)dvlist.h \
+  $(SOPHYAINCP)objfio.h \
   $(SOPHYAINCP)mutyv.h \
   $(SOPHYAINCP)timestamp.h
@@ -298,26 +380,32 @@
   ntupintf.h $(SOPHYAINCP)dvlist.h \
   $(SOPHYAINCP)objfio.h \
-  $(SOPHYAINCP)anydataobj.h \
-  $(SOPHYAINCP)ppersist.h \
-  $(SOPHYAINCP)pexceptions.h \
-  $(SOPHYAINCP)gnumd5.h \
-  $(SOPHYAINCP)ppfbinstream.h \
-  $(SOPHYAINCP)rawstream.h \
-  $(SOPHYAINCP)ppfnametag.h \
-  $(SOPHYAINCP)mutyv.h \
-  $(SOPHYAINCP)timestamp.h \
-  $(SOPHYAINCP)segdatablock.h \
-  $(SOPHYAINCP)tvector.h \
-  $(SOPHYAINCP)tmatrix.h \
-  $(SOPHYAINCP)tarray.h \
-  $(SOPHYAINCP)basarr.h \
-  $(SOPHYAINCP)ndatablock.h \
-  $(SOPHYAINCP)utilarr.h \
-  $(SOPHYAINCP)tmatrix_tsnl.h \
-  $(SOPHYAINCP)tvector_tsnl.h \
-  $(SOPHYAINCP)swsegdb.h \
+  $(SOPHYAINCP)machdefs.h \
+  $(SOPHYAINCP)anydataobj.h \
+  $(SOPHYAINCP)ppersist.h \
+  $(SOPHYAINCP)pexceptions.h \
+  $(SOPHYAINCP)gnumd5.h \
+  $(SOPHYAINCP)ppfbinstream.h \
+  $(SOPHYAINCP)rawstream.h \
+  $(SOPHYAINCP)ppfnametag.h \
+  $(SOPHYAINCP)mutyv.h \
+  $(SOPHYAINCP)timestamp.h \
+  $(SOPHYAINCP)segdatablock.h \
+  $(SOPHYAINCP)tvector.h \
+  $(SOPHYAINCP)tmatrix.h \
+  $(SOPHYAINCP)tarray.h \
+  $(SOPHYAINCP)basarr.h \
+  $(SOPHYAINCP)dvlist.h \
+  $(SOPHYAINCP)ndatablock.h \
+  $(SOPHYAINCP)utilarr.h \
+  $(SOPHYAINCP)tmatrix_tsnl.h \
+  $(SOPHYAINCP)tvector_tsnl.h \
+  $(SOPHYAINCP)swsegdb.h \
+  $(SOPHYAINCP)segdatablock.h \
   $(SOPHYAINCP)ppfswapper.h \
+  $(SOPHYAINCP)swsegdb.h \
   $(SOPHYAINCP)ppftpointerio.h \
-  $(SOPHYAINCP)sopnamsp.h
+  $(SOPHYAINCP)objfio.h \
+  $(SOPHYAINCP)sopnamsp.h \
+  $(SOPHYAINCP)pexceptions.h
 	$(CXXCOMPILE) $(CXXTEMPFLG) -o $@  swppfdtable.cc
  
@@ -331,10 +419,13 @@
   $(SOPHYAINCP)rawstream.h \
   $(SOPHYAINCP)ppfnametag.h \
+  $(SOPHYAINCP)ppersist.h \
   $(SOPHYAINCP)perrors.h xntuple.h \
-  ntupintf.h $(SOPHYAINCP)dvlist.h \
-  $(SOPHYAINCP)objfio.h \
-  $(SOPHYAINCP)anydataobj.h \
-  $(SOPHYAINCP)mutyv.h \
-  $(SOPHYAINCP)timestamp.h
+  $(SOPHYAINCP)machdefs.h \
+  ntupintf.h $(SOPHYAINCP)dvlist.h \
+  $(SOPHYAINCP)objfio.h \
+  $(SOPHYAINCP)anydataobj.h \
+  $(SOPHYAINCP)mutyv.h \
+  $(SOPHYAINCP)timestamp.h \
+  $(SOPHYAINCP)objfio.h
 	$(CXXCOMPILE) $(CXXTEMPFLG) -o $@  xntuple.cc
  
