Index: trunk/SophyaLib/BaseTools/Makefile
===================================================================
--- trunk/SophyaLib/BaseTools/Makefile	(revision 918)
+++ trunk/SophyaLib/BaseTools/Makefile	(revision 919)
@@ -3,7 +3,7 @@
 all: $(LIB)libSysTools.a
 clean:
-	rm -f $(OBJ)ctimer.o $(OBJ)datacards.o $(OBJ)dvlist.o $(OBJ)fiondblock.o $(OBJ)ndatablock.o $(OBJ)pdlmgr.o $(OBJ)periodic.o $(OBJ)pexceptions.o $(OBJ)ppersist.o $(OBJ)psighand.o $(OBJ)sophyainit.o $(OBJ)gnumd5.o $(OBJ)strutil.o $(OBJ)timing.o
+	rm -f $(OBJ)ctimer.o $(OBJ)datacards.o $(OBJ)dvlist.o $(OBJ)fiondblock.o $(OBJ)ndatablock.o $(OBJ)pdlmgr.o $(OBJ)periodic.o $(OBJ)pexceptions.o $(OBJ)ppersist.o $(OBJ)psighand.o $(OBJ)sophyainit.o $(OBJ)utils.o $(OBJ)gnumd5.o $(OBJ)srandgen.o $(OBJ)strutil.o $(OBJ)timing.o
 	rm -f $(LIB)libSysTools.a
-$(LIB)libSysTools.a : $(OBJ)ctimer.o $(OBJ)datacards.o $(OBJ)dvlist.o $(OBJ)fiondblock.o $(OBJ)gnumd5.o $(OBJ)ndatablock.o $(OBJ)pdlmgr.o $(OBJ)periodic.o $(OBJ)pexceptions.o $(OBJ)ppersist.o $(OBJ)psighand.o $(OBJ)sophyainit.o $(OBJ)strutil.o $(OBJ)timing.o
+$(LIB)libSysTools.a : $(OBJ)ctimer.o $(OBJ)datacards.o $(OBJ)dvlist.o $(OBJ)fiondblock.o $(OBJ)gnumd5.o $(OBJ)ndatablock.o $(OBJ)pdlmgr.o $(OBJ)periodic.o $(OBJ)pexceptions.o $(OBJ)ppersist.o $(OBJ)psighand.o $(OBJ)sophyainit.o $(OBJ)srandgen.o $(OBJ)strutil.o $(OBJ)timing.o $(OBJ)utils.o
 	$(ARCXX) $(ARCXXFLAGS) $@ $?
 ifeq ($(CXX),cxx)
@@ -11,39 +11,24 @@
 endif 
  
-$(OBJ)ctimer.o: ctimer.cc machdefs.h \
- $(INC)pclassids.h ctimer.h
-$(OBJ)datacards.o: datacards.cc machdefs.h \
- $(INC)pclassids.h datacards.h \
- $(INC)peida.h \
- $(INC)machdefs.h \
- $(INC)utils.h \
- $(INC)perrors.h \
- $(INC)pexceptions.h \
- $(INC)fmath.h pexceptions.h
-$(OBJ)dvlist.o: dvlist.cc machdefs.h \
- $(INC)pclassids.h dvlist.h objfio.h \
- anydataobj.h ppersist.h pexceptions.h gnumd5.h strutil.h
-$(OBJ)fiondblock.o: fiondblock.cc machdefs.h \
- $(INC)pclassids.h pexceptions.h fiondblock.h \
+$(OBJ)ctimer.o: ctimer.cc machdefs.h ctimer.h
+$(OBJ)datacards.o: datacards.cc machdefs.h datacards.h pexceptions.h
+$(OBJ)dvlist.o: dvlist.cc machdefs.h dvlist.h objfio.h anydataobj.h \
+ ppersist.h pexceptions.h gnumd5.h strutil.h
+$(OBJ)fiondblock.o: fiondblock.cc machdefs.h pexceptions.h fiondblock.h \
  ppersist.h gnumd5.h ndatablock.h anydataobj.h piocmplx.h
-$(OBJ)ndatablock.o: ndatablock.cc machdefs.h \
- $(INC)pclassids.h pexceptions.h ndatablock.h \
+$(OBJ)ndatablock.o: ndatablock.cc machdefs.h pexceptions.h ndatablock.h \
  anydataobj.h
-$(OBJ)pdlmgr.o: pdlmgr.cc pdlmgr.h machdefs.h \
- $(INC)pclassids.h
-$(OBJ)periodic.o: periodic.cc machdefs.h \
- $(INC)pclassids.h periodic.h
-$(OBJ)pexceptions.o: pexceptions.cc pexceptions.h machdefs.h \
- $(INC)pclassids.h
-$(OBJ)ppersist.o: ppersist.cc machdefs.h \
- $(INC)pclassids.h pexceptions.h ppersist.h \
- gnumd5.h anydataobj.h
-$(OBJ)psighand.o: psighand.cc psighand.h machdefs.h \
- $(INC)pclassids.h pexceptions.h
-$(OBJ)sophyainit.o: sophyainit.cc machdefs.h \
- $(INC)pclassids.h sophyainit.h pexceptions.h \
+$(OBJ)pdlmgr.o: pdlmgr.cc pdlmgr.h machdefs.h
+$(OBJ)periodic.o: periodic.cc machdefs.h periodic.h
+$(OBJ)pexceptions.o: pexceptions.cc pexceptions.h machdefs.h
+$(OBJ)ppersist.o: ppersist.cc machdefs.h pexceptions.h ppersist.h gnumd5.h \
+ anydataobj.h
+$(OBJ)psighand.o: psighand.cc psighand.h machdefs.h pexceptions.h
+$(OBJ)sophyainit.o: sophyainit.cc machdefs.h sophyainit.h pexceptions.h \
  ppersist.h gnumd5.h fiondblock.h ndatablock.h anydataobj.h dvlist.h \
  objfio.h sversion.h
+$(OBJ)utils.o: utils.cc machdefs.h utils.h pexceptions.h
 $(OBJ)gnumd5.o: gnumd5.c machdefs.h bithelp.h gnumd5.h
+$(OBJ)srandgen.o: srandgen.c machdefs.h srandgen.h smathconst.h
 $(OBJ)strutil.o: strutil.c strutil.h
 $(OBJ)timing.o: timing.c
Index: trunk/SophyaLib/BaseTools/objlist.list
===================================================================
--- trunk/SophyaLib/BaseTools/objlist.list	(revision 918)
+++ trunk/SophyaLib/BaseTools/objlist.list	(revision 919)
@@ -11,4 +11,6 @@
 psighand.o
 sophyainit.o
+srandgen.o
 strutil.o
 timing.o
+utils.o
Index: trunk/SophyaLib/HiStats/Makefile
===================================================================
--- trunk/SophyaLib/HiStats/Makefile	(revision 918)
+++ trunk/SophyaLib/HiStats/Makefile	(revision 919)
@@ -12,6 +12,5 @@
  
 $(OBJ)hisprof.o: hisprof.cc $(INC)machdefs.h \
- $(INC)pclassids.h hisprof.h \
- $(INC)peida.h \
+ hisprof.h $(INC)peida.h \
  $(INC)utils.h \
  $(INC)perrors.h \
@@ -30,6 +29,5 @@
  $(INC)utilarr.h histos.h
 $(OBJ)histinit.o: histinit.cc $(INC)machdefs.h \
- $(INC)pclassids.h histinit.h \
- $(INC)ntoolsinit.h \
+ histinit.h $(INC)ntoolsinit.h \
  $(INC)tarrinit.h \
  $(INC)sophyainit.h histos.h \
@@ -51,6 +49,5 @@
  $(INC)utilarr.h histos2.h hisprof.h ntuple.h \
  $(INC)ntupintf.h xntuple.h
-$(OBJ)histos.o: histos.cc $(INC)machdefs.h \
- $(INC)pclassids.h histos.h \
+$(OBJ)histos.o: histos.cc $(INC)machdefs.h histos.h \
  $(INC)objfio.h \
  $(INC)anydataobj.h \
@@ -75,6 +72,5 @@
  $(INC)ntupintf.h
 $(OBJ)histos2.o: histos2.cc $(INC)machdefs.h \
- $(INC)pclassids.h histos2.h \
- $(INC)peida.h \
+ histos2.h $(INC)peida.h \
  $(INC)utils.h \
  $(INC)perrors.h \
@@ -99,6 +95,5 @@
  $(INC)perrors.h \
  $(INC)pexceptions.h \
- $(INC)machdefs.h \
- $(INC)pclassids.h ntuple.h \
+ $(INC)machdefs.h ntuple.h \
  $(INC)objfio.h \
  $(INC)anydataobj.h \
@@ -109,5 +104,4 @@
 $(OBJ)xntuple.o: xntuple.cc $(INC)ppersist.h \
  $(INC)machdefs.h \
- $(INC)pclassids.h \
  $(INC)pexceptions.h \
  $(INC)gnumd5.h \
Index: trunk/SophyaLib/NTools/Makefile
===================================================================
--- trunk/SophyaLib/NTools/Makefile	(revision 918)
+++ trunk/SophyaLib/NTools/Makefile	(revision 919)
@@ -3,7 +3,7 @@
 all: $(LIB)libNTools.a
 clean:
-	rm -f $(OBJ)cimage.o $(OBJ)cspline.o $(OBJ)datatypes.o $(OBJ)dates.o $(OBJ)difeq.o $(OBJ)dynccd.o $(OBJ)fct1dfit.o $(OBJ)fct2dfit.o $(OBJ)fftmserver.o $(OBJ)fftpserver.o $(OBJ)fftserver.o $(OBJ)fftservintf.o $(OBJ)generaldata.o $(OBJ)generalfit.o $(OBJ)imageop.o $(OBJ)integ.o $(OBJ)median.o $(OBJ)ntoolsinit.o $(OBJ)ntupintf.o $(OBJ)objfitter.o $(OBJ)perandom.o $(OBJ)poly.o $(OBJ)rk4cdifeq.o $(OBJ)rzimage.o $(OBJ)simplesort.o $(OBJ)tabmath.o $(OBJ)utils.o $(OBJ)datime.o $(OBJ)fftmayer_r4.o $(OBJ)fftmayer_r8.o $(OBJ)fftpackc.o $(OBJ)matxop.o $(OBJ)nbmath.o $(OBJ)nbrandom.o $(OBJ)nbtri.o
+	rm -f $(OBJ)cimage.o $(OBJ)cspline.o $(OBJ)datatypes.o $(OBJ)dates.o $(OBJ)difeq.o $(OBJ)dynccd.o $(OBJ)fct1dfit.o $(OBJ)fct2dfit.o $(OBJ)fftmserver.o $(OBJ)fftpserver.o $(OBJ)fftserver.o $(OBJ)fftservintf.o $(OBJ)generaldata.o $(OBJ)generalfit.o $(OBJ)imageop.o $(OBJ)integ.o $(OBJ)median.o $(OBJ)ntoolsinit.o $(OBJ)ntupintf.o $(OBJ)objfitter.o $(OBJ)perandom.o $(OBJ)poly.o $(OBJ)rk4cdifeq.o $(OBJ)rzimage.o $(OBJ)simplesort.o $(OBJ)tabmath.o $(OBJ)datime.o $(OBJ)fftmayer_r4.o $(OBJ)fftmayer_r8.o $(OBJ)fftpackc.o $(OBJ)matxop.o $(OBJ)nbmath.o $(OBJ)nbtri.o
 	rm -f $(LIB)libNTools.a
-$(LIB)libNTools.a : $(OBJ)cimage.o $(OBJ)cspline.o $(OBJ)datatypes.o $(OBJ)dates.o $(OBJ)datime.o $(OBJ)difeq.o $(OBJ)dynccd.o $(OBJ)fct1dfit.o $(OBJ)fct2dfit.o $(OBJ)fftmayer_r4.o $(OBJ)fftmayer_r8.o $(OBJ)fftmserver.o $(OBJ)fftpackc.o $(OBJ)fftpserver.o $(OBJ)fftserver.o $(OBJ)fftservintf.o $(OBJ)generaldata.o $(OBJ)generalfit.o $(OBJ)imageop.o $(OBJ)integ.o $(OBJ)matxop.o $(OBJ)median.o $(OBJ)nbmath.o $(OBJ)nbrandom.o $(OBJ)nbtri.o $(OBJ)ntoolsinit.o $(OBJ)ntupintf.o $(OBJ)objfitter.o $(OBJ)perandom.o $(OBJ)poly.o $(OBJ)rk4cdifeq.o $(OBJ)rzimage.o $(OBJ)simplesort.o $(OBJ)tabmath.o $(OBJ)utils.o
+$(LIB)libNTools.a : $(OBJ)cimage.o $(OBJ)cspline.o $(OBJ)datatypes.o $(OBJ)dates.o $(OBJ)datime.o $(OBJ)difeq.o $(OBJ)dynccd.o $(OBJ)fct1dfit.o $(OBJ)fct2dfit.o $(OBJ)fftmayer_r4.o $(OBJ)fftmayer_r8.o $(OBJ)fftmserver.o $(OBJ)fftpackc.o $(OBJ)fftpserver.o $(OBJ)fftserver.o $(OBJ)fftservintf.o $(OBJ)generaldata.o $(OBJ)generalfit.o $(OBJ)imageop.o $(OBJ)integ.o $(OBJ)matxop.o $(OBJ)median.o $(OBJ)nbmath.o $(OBJ)nbtri.o $(OBJ)ntoolsinit.o $(OBJ)ntupintf.o $(OBJ)objfitter.o $(OBJ)perandom.o $(OBJ)poly.o $(OBJ)rk4cdifeq.o $(OBJ)rzimage.o $(OBJ)simplesort.o $(OBJ)tabmath.o
 	$(ARCXX) $(ARCXXFLAGS) $@ $?
 ifeq ($(CXX),cxx)
@@ -12,5 +12,4 @@
  
 $(OBJ)cimage.o: cimage.cc $(INC)machdefs.h \
- $(INC)pclassids.h \
  $(INC)perrors.h \
  $(INC)pexceptions.h cimage.h rzimage.h \
@@ -26,19 +25,15 @@
  $(INC)ndatablock.h \
  $(INC)utilarr.h generaldata.h ntupintf.h \
- poly.h peida.h utils.h fmath.h \
+ poly.h peida.h $(INC)utils.h fmath.h \
  $(INC)histos.h \
  $(INC)peida.h nbconst.h
 $(OBJ)cspline.o: cspline.cc $(INC)machdefs.h \
- $(INC)pclassids.h nbtri.h cspline.h \
- $(INC)pexceptions.h
+ nbtri.h cspline.h $(INC)pexceptions.h
 $(OBJ)datatypes.o: datatypes.cc datatypes.h \
- $(INC)machdefs.h \
- $(INC)pclassids.h
+ $(INC)machdefs.h
 $(OBJ)dates.o: dates.cc $(INC)machdefs.h \
- $(INC)pclassids.h \
  $(INC)perrors.h \
  $(INC)pexceptions.h dates.h
 $(OBJ)difeq.o: difeq.cc difeq.h $(INC)machdefs.h \
- $(INC)pclassids.h \
  $(INC)pexceptions.h \
  $(INC)tvector.h \
@@ -54,7 +49,6 @@
  $(INC)utilarr.h \
  $(INC)ctimer.h
-$(OBJ)dynccd.o: dynccd.cc $(INC)machdefs.h \
- $(INC)pclassids.h fmath.h perandom.h \
- $(INC)histos.h \
+$(OBJ)dynccd.o: dynccd.cc $(INC)machdefs.h fmath.h \
+ perandom.h $(INC)histos.h \
  $(INC)objfio.h \
  $(INC)anydataobj.h \
@@ -72,41 +66,40 @@
  $(INC)dvlist.h \
  $(INC)ndatablock.h \
- $(INC)utilarr.h nbrandom.h cimage.h \
- rzimage.h rzvect.h datatypes.h dynccd.h
+ $(INC)utilarr.h nbrandom.h \
+ $(INC)srandgen.h cimage.h rzimage.h rzvect.h \
+ datatypes.h dynccd.h
 $(OBJ)fct1dfit.o: fct1dfit.cc $(INC)machdefs.h \
- $(INC)pclassids.h fct1dfit.h generalfit.h \
- $(INC)pexceptions.h \
- $(INC)tvector.h \
- $(INC)tmatrix.h \
- $(INC)tarray.h \
- $(INC)basarr.h \
- $(INC)anydataobj.h \
- $(INC)dvlist.h \
- $(INC)objfio.h \
- $(INC)ppersist.h \
- $(INC)gnumd5.h \
- $(INC)ndatablock.h \
- $(INC)utilarr.h generaldata.h ntupintf.h \
- poly.h peida.h utils.h $(INC)perrors.h \
- fmath.h nbconst.h tabmath.h
+ fct1dfit.h generalfit.h $(INC)pexceptions.h \
+ $(INC)tvector.h \
+ $(INC)tmatrix.h \
+ $(INC)tarray.h \
+ $(INC)basarr.h \
+ $(INC)anydataobj.h \
+ $(INC)dvlist.h \
+ $(INC)objfio.h \
+ $(INC)ppersist.h \
+ $(INC)gnumd5.h \
+ $(INC)ndatablock.h \
+ $(INC)utilarr.h generaldata.h ntupintf.h \
+ poly.h peida.h $(INC)utils.h \
+ $(INC)perrors.h fmath.h nbconst.h tabmath.h
 $(OBJ)fct2dfit.o: fct2dfit.cc $(INC)machdefs.h \
- $(INC)pclassids.h fct2dfit.h generalfit.h \
- $(INC)pexceptions.h \
- $(INC)tvector.h \
- $(INC)tmatrix.h \
- $(INC)tarray.h \
- $(INC)basarr.h \
- $(INC)anydataobj.h \
- $(INC)dvlist.h \
- $(INC)objfio.h \
- $(INC)ppersist.h \
- $(INC)gnumd5.h \
- $(INC)ndatablock.h \
- $(INC)utilarr.h generaldata.h ntupintf.h \
- poly.h peida.h utils.h $(INC)perrors.h \
- fmath.h nbconst.h tabmath.h simps2d.h
+ fct2dfit.h generalfit.h $(INC)pexceptions.h \
+ $(INC)tvector.h \
+ $(INC)tmatrix.h \
+ $(INC)tarray.h \
+ $(INC)basarr.h \
+ $(INC)anydataobj.h \
+ $(INC)dvlist.h \
+ $(INC)objfio.h \
+ $(INC)ppersist.h \
+ $(INC)gnumd5.h \
+ $(INC)ndatablock.h \
+ $(INC)utilarr.h generaldata.h ntupintf.h \
+ poly.h peida.h $(INC)utils.h \
+ $(INC)perrors.h fmath.h nbconst.h tabmath.h \
+ simps2d.h
 $(OBJ)fftmserver.o: fftmserver.cc fftmserver.h fftservintf.h \
  $(INC)machdefs.h \
- $(INC)pclassids.h \
  $(INC)pexceptions.h \
  $(INC)tmatrix.h \
@@ -123,5 +116,4 @@
 $(OBJ)fftpserver.o: fftpserver.cc fftpserver.h fftservintf.h \
  $(INC)machdefs.h \
- $(INC)pclassids.h \
  $(INC)pexceptions.h \
  $(INC)tmatrix.h \
@@ -140,5 +132,4 @@
  $(INC)tmatrix.h \
  $(INC)machdefs.h \
- $(INC)pclassids.h \
  $(INC)tarray.h \
  $(INC)basarr.h \
@@ -153,5 +144,4 @@
 $(OBJ)fftservintf.o: fftservintf.cc fftservintf.h \
  $(INC)machdefs.h \
- $(INC)pclassids.h \
  $(INC)pexceptions.h \
  $(INC)tmatrix.h \
@@ -168,5 +158,4 @@
 $(OBJ)generaldata.o: generaldata.cc \
  $(INC)machdefs.h \
- $(INC)pclassids.h \
  $(INC)strutil.h nbtri.h generalfit.h \
  $(INC)pexceptions.h \
@@ -182,8 +171,7 @@
  $(INC)ndatablock.h \
  $(INC)utilarr.h generaldata.h ntupintf.h \
- poly.h peida.h utils.h $(INC)perrors.h \
- fmath.h
+ poly.h peida.h $(INC)utils.h \
+ $(INC)perrors.h fmath.h
 $(OBJ)generalfit.o: generalfit.cc $(INC)machdefs.h \
- $(INC)pclassids.h \
  $(INC)pexceptions.h generalfit.h \
  $(INC)tvector.h \
@@ -198,9 +186,10 @@
  $(INC)ndatablock.h \
  $(INC)utilarr.h generaldata.h ntupintf.h \
- poly.h peida.h utils.h $(INC)perrors.h \
- fmath.h $(INC)sopemtx.h
+ poly.h peida.h $(INC)utils.h \
+ $(INC)perrors.h fmath.h \
+ $(INC)sopemtx.h
 $(OBJ)imageop.o: imageop.cc $(INC)machdefs.h \
- $(INC)pclassids.h simplesort.h peida.h \
- utils.h $(INC)perrors.h \
+ simplesort.h peida.h $(INC)utils.h \
+ $(INC)perrors.h \
  $(INC)pexceptions.h fmath.h nbmath.h \
  $(INC)smathconst.h \
@@ -220,5 +209,4 @@
  cimage.h rzimage.h rzvect.h cspline.h dynccd.h nbtri.h
 $(OBJ)integ.o: integ.cc integ.h $(INC)machdefs.h \
- $(INC)pclassids.h \
  $(INC)pexceptions.h generalfit.h \
  $(INC)tvector.h \
@@ -233,10 +221,9 @@
  $(INC)ndatablock.h \
  $(INC)utilarr.h generaldata.h ntupintf.h \
- poly.h peida.h utils.h $(INC)perrors.h \
- fmath.h
+ poly.h peida.h $(INC)utils.h \
+ $(INC)perrors.h fmath.h
 $(OBJ)median.o: median.cc
 $(OBJ)ntoolsinit.o: ntoolsinit.cc $(INC)machdefs.h \
- $(INC)pclassids.h ntoolsinit.h \
- $(INC)tarrinit.h \
+ ntoolsinit.h $(INC)tarrinit.h \
  $(INC)sophyainit.h poly.h \
  $(INC)objfio.h \
@@ -244,5 +231,6 @@
  $(INC)ppersist.h \
  $(INC)pexceptions.h \
- $(INC)gnumd5.h peida.h utils.h \
+ $(INC)gnumd5.h peida.h \
+ $(INC)utils.h \
  $(INC)perrors.h fmath.h \
  $(INC)tvector.h \
@@ -256,9 +244,7 @@
  datime.h
 $(OBJ)ntupintf.o: ntupintf.cc ntupintf.h \
- $(INC)machdefs.h \
- $(INC)pclassids.h
+ $(INC)machdefs.h
 $(OBJ)objfitter.o: objfitter.cc objfitter.h \
  $(INC)machdefs.h \
- $(INC)pclassids.h \
  $(INC)tmatrix.h \
  $(INC)tarray.h \
@@ -273,8 +259,7 @@
  $(INC)utilarr.h \
  $(INC)tvector.h generalfit.h generaldata.h \
- ntupintf.h poly.h peida.h utils.h \
+ ntupintf.h poly.h peida.h $(INC)utils.h \
  $(INC)perrors.h fmath.h
 $(OBJ)perandom.o: perandom.cc $(INC)machdefs.h \
- $(INC)pclassids.h \
  $(INC)pexceptions.h perandom.h \
  $(INC)histos.h \
@@ -293,12 +278,13 @@
  $(INC)dvlist.h \
  $(INC)ndatablock.h \
- $(INC)utilarr.h nbrandom.h pemath.h
-$(OBJ)poly.o: poly.cc $(INC)machdefs.h \
- $(INC)pclassids.h poly.h \
- $(INC)objfio.h \
- $(INC)anydataobj.h \
- $(INC)ppersist.h \
- $(INC)pexceptions.h \
- $(INC)gnumd5.h peida.h utils.h \
+ $(INC)utilarr.h nbrandom.h \
+ $(INC)srandgen.h pemath.h
+$(OBJ)poly.o: poly.cc $(INC)machdefs.h poly.h \
+ $(INC)objfio.h \
+ $(INC)anydataobj.h \
+ $(INC)ppersist.h \
+ $(INC)pexceptions.h \
+ $(INC)gnumd5.h peida.h \
+ $(INC)utils.h \
  $(INC)perrors.h fmath.h \
  $(INC)tvector.h \
@@ -312,6 +298,5 @@
  $(INC)fioarr.h
 $(OBJ)rk4cdifeq.o: rk4cdifeq.cc $(INC)machdefs.h \
- $(INC)pclassids.h rk4cdifeq.h difeq.h \
- $(INC)pexceptions.h \
+ rk4cdifeq.h difeq.h $(INC)pexceptions.h \
  $(INC)tvector.h \
  $(INC)tmatrix.h \
@@ -327,6 +312,5 @@
  $(INC)ctimer.h
 $(OBJ)rzimage.o: rzimage.cc $(INC)machdefs.h \
- $(INC)pclassids.h rzimage.h rzvect.h \
- $(INC)pexceptions.h \
+ rzimage.h rzvect.h $(INC)pexceptions.h \
  $(INC)perrors.h datatypes.h \
  $(INC)ppersist.h \
@@ -341,16 +325,13 @@
  $(INC)ndatablock.h \
  $(INC)utilarr.h generaldata.h ntupintf.h \
- poly.h peida.h utils.h fmath.h
+ poly.h peida.h $(INC)utils.h fmath.h
 $(OBJ)simplesort.o: simplesort.cc $(INC)machdefs.h \
- $(INC)pclassids.h simplesort.h peida.h \
- utils.h $(INC)perrors.h \
+ simplesort.h peida.h $(INC)utils.h \
+ $(INC)perrors.h \
  $(INC)pexceptions.h fmath.h
 $(OBJ)tabmath.o: tabmath.cc $(INC)machdefs.h \
- $(INC)pclassids.h tabmath.h peida.h utils.h \
+ tabmath.h peida.h $(INC)utils.h \
  $(INC)perrors.h \
  $(INC)pexceptions.h fmath.h nbconst.h
-$(OBJ)utils.o: utils.cc $(INC)machdefs.h \
- $(INC)pclassids.h utils.h \
- $(INC)pexceptions.h
 $(OBJ)datime.o: datime.c $(INC)machdefs.h \
  $(INC)strutil.h nbconst.h datime.h
@@ -367,5 +348,3 @@
  $(INC)smathconst.h matxop.h nbinteg.h \
  nbtri.h
-$(OBJ)nbrandom.o: nbrandom.c $(INC)machdefs.h \
- nbmath.h $(INC)smathconst.h nbrandom.h
 $(OBJ)nbtri.o: nbtri.c nbtri.h $(INC)machdefs.h
Index: trunk/SophyaLib/NTools/objlist.list
===================================================================
--- trunk/SophyaLib/NTools/objlist.list	(revision 918)
+++ trunk/SophyaLib/NTools/objlist.list	(revision 919)
@@ -22,5 +22,4 @@
 median.o
 nbmath.o
-nbrandom.o
 nbtri.o
 ntoolsinit.o
@@ -33,3 +32,2 @@
 simplesort.o
 tabmath.o
-utils.o
Index: trunk/SophyaLib/Samba/Makefile
===================================================================
--- trunk/SophyaLib/Samba/Makefile	(revision 918)
+++ trunk/SophyaLib/Samba/Makefile	(revision 919)
@@ -12,6 +12,6 @@
  
 $(OBJ)alm.o: alm.cc alm.h $(INC)nbrandom.h \
+ $(INC)srandgen.h \
  $(INC)machdefs.h \
- $(INC)pclassids.h \
  $(INC)nbmath.h \
  $(INC)smathconst.h \
@@ -31,6 +31,6 @@
 $(OBJ)bruit.o: bruit.cc $(INC)fmath.h bruit.h \
  $(INC)nbrandom.h \
- $(INC)machdefs.h \
- $(INC)pclassids.h
+ $(INC)srandgen.h \
+ $(INC)machdefs.h
 $(OBJ)circle.o: circle.cc circle.h $(INC)vector3d.h \
  $(INC)longlat.h \
@@ -40,5 +40,4 @@
  $(INC)ndatablock.h \
  $(INC)machdefs.h \
- $(INC)pclassids.h \
  $(INC)anydataobj.h \
  $(INC)tvector.h \
@@ -53,4 +52,5 @@
  $(INC)utilarr.h alm.h \
  $(INC)nbrandom.h \
+ $(INC)srandgen.h \
  $(INC)nbmath.h \
  $(INC)smathconst.h \
@@ -61,5 +61,4 @@
  $(INC)smathconst.h \
  $(INC)machdefs.h \
- $(INC)pclassids.h \
  $(INC)pixelmap.h \
  $(INC)ppersist.h \
@@ -83,11 +82,9 @@
 $(OBJ)sambainit.o: sambainit.cc sambainit.h \
  $(INC)skymapinit.h \
- $(INC)tarrinit.h \
  $(INC)sophyainit.h \
  $(INC)machdefs.h \
- $(INC)pclassids.h \
- $(INC)ntoolsinit.h
-$(OBJ)scan.o: scan.cc $(INC)machdefs.h \
- $(INC)pclassids.h scan.h \
+ $(INC)ntoolsinit.h \
+ $(INC)tarrinit.h
+$(OBJ)scan.o: scan.cc $(INC)machdefs.h scan.h \
  $(INC)ppersist.h \
  $(INC)pexceptions.h \
@@ -101,6 +98,5 @@
  $(INC)smathconst.h
 $(OBJ)sphericaltransformserver.o: sphericaltransformserver.cc \
- $(INC)machdefs.h \
- $(INC)pclassids.h sphericaltransformserver.h \
+ $(INC)machdefs.h sphericaltransformserver.h \
  $(INC)sphericalmap.h \
  $(INC)smathconst.h \
@@ -123,8 +119,8 @@
  $(INC)ndatablock.h \
  $(INC)utilarr.h \
- $(INC)spheregorski.h \
  $(INC)fftservintf.h \
  $(INC)fftpserver.h alm.h \
  $(INC)nbrandom.h \
+ $(INC)srandgen.h \
  $(INC)nbmath.h \
  $(INC)triangmtx.h lambdaBuilder.h
Index: trunk/SophyaLib/SkyMap/Makefile
===================================================================
--- trunk/SophyaLib/SkyMap/Makefile	(revision 918)
+++ trunk/SophyaLib/SkyMap/Makefile	(revision 919)
@@ -3,7 +3,7 @@
 all: $(LIB)libSkyMap.a
 clean:
-	rm -f $(OBJ)localmap.o $(OBJ)longlat.o $(OBJ)skymapinit.o $(OBJ)spheregorski.o $(OBJ)spherepos.o $(OBJ)spherethetaphi.o $(OBJ)unitvector.o $(OBJ)utilgeom.o $(OBJ)vector3d.o
+	rm -f $(OBJ)fiolocalmap.o $(OBJ)fiospherehealpix.o $(OBJ)fiospherethetaphi.o $(OBJ)localmap.o $(OBJ)longlat.o $(OBJ)skymapinit.o $(OBJ)spherehealpix.o $(OBJ)spherepos.o $(OBJ)spherethetaphi.o $(OBJ)unitvector.o $(OBJ)utilgeom.o $(OBJ)vector3d.o
 	rm -f $(LIB)libSkyMap.a
-$(LIB)libSkyMap.a : $(OBJ)localmap.o $(OBJ)longlat.o $(OBJ)skymapinit.o $(OBJ)spheregorski.o $(OBJ)spherepos.o $(OBJ)spherethetaphi.o $(OBJ)unitvector.o $(OBJ)utilgeom.o $(OBJ)vector3d.o
+$(LIB)libSkyMap.a : $(OBJ)fiolocalmap.o $(OBJ)fiospherehealpix.o $(OBJ)fiospherethetaphi.o $(OBJ)localmap.o $(OBJ)longlat.o $(OBJ)skymapinit.o $(OBJ)spherehealpix.o $(OBJ)spherepos.o $(OBJ)spherethetaphi.o $(OBJ)unitvector.o $(OBJ)utilgeom.o $(OBJ)vector3d.o
 	$(ARCXX) $(ARCXXFLAGS) $@ $?
 ifeq ($(CXX),cxx)
@@ -11,8 +11,58 @@
 endif 
  
+$(OBJ)fiolocalmap.o: fiolocalmap.cc fiolocalmap.h sphericalmap.h \
+ $(INC)smathconst.h \
+ $(INC)machdefs.h pixelmap.h \
+ $(INC)ppersist.h \
+ $(INC)pexceptions.h \
+ $(INC)gnumd5.h \
+ $(INC)dvlist.h \
+ $(INC)objfio.h \
+ $(INC)anydataobj.h spherepos.h unitvector.h \
+ vector3d.h longlat.h utilgeom.h \
+ $(INC)tvector.h \
+ $(INC)tmatrix.h \
+ $(INC)tarray.h \
+ $(INC)basarr.h \
+ $(INC)ndatablock.h \
+ $(INC)utilarr.h localmap.h \
+ $(INC)fiondblock.h
+$(OBJ)fiospherehealpix.o: fiospherehealpix.cc fiospherehealpix.h \
+ sphericalmap.h $(INC)smathconst.h \
+ $(INC)machdefs.h pixelmap.h \
+ $(INC)ppersist.h \
+ $(INC)pexceptions.h \
+ $(INC)gnumd5.h \
+ $(INC)dvlist.h \
+ $(INC)objfio.h \
+ $(INC)anydataobj.h spherepos.h unitvector.h \
+ vector3d.h longlat.h utilgeom.h \
+ $(INC)tvector.h \
+ $(INC)tmatrix.h \
+ $(INC)tarray.h \
+ $(INC)basarr.h \
+ $(INC)ndatablock.h \
+ $(INC)utilarr.h spherehealpix.h \
+ $(INC)fiondblock.h
+$(OBJ)fiospherethetaphi.o: fiospherethetaphi.cc fiospherethetaphi.h \
+ sphericalmap.h $(INC)smathconst.h \
+ $(INC)machdefs.h pixelmap.h \
+ $(INC)ppersist.h \
+ $(INC)pexceptions.h \
+ $(INC)gnumd5.h \
+ $(INC)dvlist.h \
+ $(INC)objfio.h \
+ $(INC)anydataobj.h spherepos.h unitvector.h \
+ vector3d.h longlat.h utilgeom.h \
+ $(INC)tvector.h \
+ $(INC)tmatrix.h \
+ $(INC)tarray.h \
+ $(INC)basarr.h \
+ $(INC)ndatablock.h \
+ $(INC)utilarr.h spherethetaphi.h \
+ $(INC)fiondblock.h
 $(OBJ)localmap.o: localmap.cc localmap.h pixelmap.h \
  $(INC)ppersist.h \
  $(INC)machdefs.h \
- $(INC)pclassids.h \
  $(INC)pexceptions.h \
  $(INC)gnumd5.h \
@@ -31,10 +81,8 @@
  $(INC)fiondblock.h
 $(OBJ)longlat.o: longlat.cc longlat.h utilgeom.h
-$(OBJ)skymapinit.o: skymapinit.cc skymapinit.h \
- $(INC)tarrinit.h \
- $(INC)sophyainit.h \
- $(INC)machdefs.h \
- $(INC)pclassids.h spherethetaphi.h \
- sphericalmap.h $(INC)smathconst.h pixelmap.h \
+$(OBJ)skymapinit.o: skymapinit.cc $(INC)machdefs.h \
+ skymapinit.h $(INC)sophyainit.h \
+ spherethetaphi.h sphericalmap.h \
+ $(INC)smathconst.h pixelmap.h \
  $(INC)ppersist.h \
  $(INC)pexceptions.h \
@@ -49,8 +97,8 @@
  $(INC)basarr.h \
  $(INC)ndatablock.h \
- $(INC)utilarr.h spheregorski.h localmap.h
-$(OBJ)spheregorski.o: spheregorski.cc \
+ $(INC)utilarr.h fiospherehealpix.h \
+ spherehealpix.h fiospherethetaphi.h fiolocalmap.h localmap.h
+$(OBJ)spherehealpix.o: spherehealpix.cc \
  $(INC)machdefs.h \
- $(INC)pclassids.h \
  $(INC)pexceptions.h \
  $(INC)fiondblock.h \
@@ -58,5 +106,5 @@
  $(INC)gnumd5.h \
  $(INC)ndatablock.h \
- $(INC)anydataobj.h spheregorski.h \
+ $(INC)anydataobj.h spherehealpix.h \
  sphericalmap.h $(INC)smathconst.h pixelmap.h \
  $(INC)dvlist.h \
@@ -71,5 +119,4 @@
 $(OBJ)spherepos.o: spherepos.cc spherepos.h \
  $(INC)machdefs.h \
- $(INC)pclassids.h \
  $(INC)ppersist.h \
  $(INC)pexceptions.h \
@@ -78,6 +125,5 @@
 $(OBJ)spherethetaphi.o: spherethetaphi.cc spherethetaphi.h sphericalmap.h \
  $(INC)smathconst.h \
- $(INC)machdefs.h \
- $(INC)pclassids.h pixelmap.h \
+ $(INC)machdefs.h pixelmap.h \
  $(INC)ppersist.h \
  $(INC)pexceptions.h \
@@ -99,5 +145,4 @@
 $(OBJ)utilgeom.o: utilgeom.cc utilgeom.h
 $(OBJ)vector3d.o: vector3d.cc $(INC)machdefs.h \
- $(INC)pclassids.h \
  $(INC)pexceptions.h vector3d.h longlat.h \
  utilgeom.h
Index: trunk/SophyaLib/SkyMap/objlist.list
===================================================================
--- trunk/SophyaLib/SkyMap/objlist.list	(revision 918)
+++ trunk/SophyaLib/SkyMap/objlist.list	(revision 919)
@@ -1,6 +1,9 @@
+fiolocalmap.o
+fiospherehealpix.o
+fiospherethetaphi.o
 localmap.o
 longlat.o
 skymapinit.o
-spheregorski.o
+spherehealpix.o
 spherepos.o
 spherethetaphi.o
Index: trunk/SophyaLib/SkyT/Makefile
===================================================================
--- trunk/SophyaLib/SkyT/Makefile	(revision 918)
+++ trunk/SophyaLib/SkyT/Makefile	(revision 919)
@@ -3,7 +3,7 @@
 all: $(LIB)libSkyT.a
 clean:
-	rm -f $(OBJ)blackbody.o $(OBJ)convtools.o $(OBJ)gaussfilt.o $(OBJ)nupower.o $(OBJ)radspec.o $(OBJ)radspecvector.o $(OBJ)skyinit.o $(OBJ)specresp.o $(OBJ)specrespvector.o $(OBJ)squarefilt.o $(OBJ)trianglefilt.o
+	rm -f $(OBJ)blackbody.o $(OBJ)convtools.o $(OBJ)derivblackbody.o $(OBJ)gaussfilt.o $(OBJ)nupower.o $(OBJ)radspec.o $(OBJ)radspecvector.o $(OBJ)skyinit.o $(OBJ)specresp.o $(OBJ)specrespvector.o $(OBJ)squarefilt.o $(OBJ)trianglefilt.o
 	rm -f $(LIB)libSkyT.a
-$(LIB)libSkyT.a : $(OBJ)blackbody.o $(OBJ)convtools.o $(OBJ)gaussfilt.o $(OBJ)nupower.o $(OBJ)radspec.o $(OBJ)radspecvector.o $(OBJ)skyinit.o $(OBJ)specresp.o $(OBJ)specrespvector.o $(OBJ)squarefilt.o $(OBJ)trianglefilt.o
+$(LIB)libSkyT.a : $(OBJ)blackbody.o $(OBJ)convtools.o $(OBJ)derivblackbody.o $(OBJ)gaussfilt.o $(OBJ)nupower.o $(OBJ)radspec.o $(OBJ)radspecvector.o $(OBJ)skyinit.o $(OBJ)specresp.o $(OBJ)specrespvector.o $(OBJ)squarefilt.o $(OBJ)trianglefilt.o
 	$(ARCXX) $(ARCXXFLAGS) $@ $?
 ifeq ($(CXX),cxx)
@@ -12,5 +12,14 @@
  
 $(OBJ)blackbody.o: blackbody.cc $(INC)machdefs.h \
- $(INC)pclassids.h blackbody.h radspec.h \
+ blackbody.h radspec.h specresp.h \
+ $(INC)anydataobj.h \
+ $(INC)objfio.h \
+ $(INC)ppersist.h \
+ $(INC)pexceptions.h \
+ $(INC)gnumd5.h convtools.h
+$(OBJ)convtools.o: convtools.cc convtools.h \
+ $(INC)machdefs.h
+$(OBJ)derivblackbody.o: derivblackbody.cc \
+ $(INC)machdefs.h derivblackbody.h radspec.h \
  specresp.h $(INC)anydataobj.h \
  $(INC)objfio.h \
@@ -18,8 +27,6 @@
  $(INC)pexceptions.h \
  $(INC)gnumd5.h convtools.h
-$(OBJ)convtools.o: convtools.cc convtools.h
 $(OBJ)gaussfilt.o: gaussfilt.cc $(INC)machdefs.h \
- $(INC)pclassids.h gaussfilt.h specresp.h \
- $(INC)anydataobj.h \
+ gaussfilt.h specresp.h $(INC)anydataobj.h \
  $(INC)objfio.h \
  $(INC)ppersist.h \
@@ -27,6 +34,6 @@
  $(INC)gnumd5.h
 $(OBJ)nupower.o: nupower.cc $(INC)machdefs.h \
- $(INC)pclassids.h nupower.h radspec.h \
- specresp.h $(INC)anydataobj.h \
+ nupower.h radspec.h specresp.h \
+ $(INC)anydataobj.h \
  $(INC)objfio.h \
  $(INC)ppersist.h \
@@ -34,6 +41,5 @@
  $(INC)gnumd5.h convtools.h
 $(OBJ)radspec.o: radspec.cc $(INC)machdefs.h \
- $(INC)pclassids.h radspec.h specresp.h \
- $(INC)anydataobj.h \
+ radspec.h specresp.h $(INC)anydataobj.h \
  $(INC)objfio.h \
  $(INC)ppersist.h \
@@ -42,6 +48,5 @@
  $(INC)integ.h
 $(OBJ)radspecvector.o: radspecvector.cc \
- $(INC)machdefs.h \
- $(INC)pclassids.h radspecvector.h radspec.h \
+ $(INC)machdefs.h radspecvector.h radspec.h \
  specresp.h $(INC)anydataobj.h \
  $(INC)objfio.h \
@@ -61,5 +66,4 @@
  $(INC)sophyainit.h \
  $(INC)machdefs.h \
- $(INC)pclassids.h \
  $(INC)ppersist.h \
  $(INC)pexceptions.h \
@@ -76,5 +80,4 @@
 $(OBJ)specresp.o: specresp.cc specresp.h \
  $(INC)machdefs.h \
- $(INC)pclassids.h \
  $(INC)anydataobj.h \
  $(INC)integ.h \
@@ -91,7 +94,6 @@
  $(INC)utilarr.h
 $(OBJ)specrespvector.o: specrespvector.cc \
- $(INC)machdefs.h \
- $(INC)pclassids.h specrespvector.h \
- specresp.h $(INC)anydataobj.h \
+ $(INC)machdefs.h specrespvector.h specresp.h \
+ $(INC)anydataobj.h \
  $(INC)tvector.h \
  $(INC)tmatrix.h \
@@ -107,8 +109,6 @@
  $(INC)fioarr.h
 $(OBJ)squarefilt.o: squarefilt.cc $(INC)machdefs.h \
- $(INC)pclassids.h squarefilt.h specresp.h \
+ squarefilt.h specresp.h $(INC)anydataobj.h
+$(OBJ)trianglefilt.o: trianglefilt.cc \
+ $(INC)machdefs.h trianglefilt.h specresp.h \
  $(INC)anydataobj.h
-$(OBJ)trianglefilt.o: trianglefilt.cc \
- $(INC)machdefs.h \
- $(INC)pclassids.h trianglefilt.h specresp.h \
- $(INC)anydataobj.h
Index: trunk/SophyaLib/SkyT/objlist.list
===================================================================
--- trunk/SophyaLib/SkyT/objlist.list	(revision 918)
+++ trunk/SophyaLib/SkyT/objlist.list	(revision 919)
@@ -1,4 +1,5 @@
 blackbody.o
 convtools.o
+derivblackbody.o
 gaussfilt.o
 nupower.o
Index: trunk/SophyaLib/TArray/Makefile
===================================================================
--- trunk/SophyaLib/TArray/Makefile	(revision 918)
+++ trunk/SophyaLib/TArray/Makefile	(revision 919)
@@ -12,5 +12,4 @@
  
 $(OBJ)basarr.o: basarr.cc $(INC)machdefs.h \
- $(INC)pclassids.h \
  $(INC)pexceptions.h basarr.h \
  $(INC)anydataobj.h \
@@ -21,5 +20,4 @@
 $(OBJ)fioarr.o: fioarr.cc $(INC)pexceptions.h \
  $(INC)machdefs.h \
- $(INC)pclassids.h \
  $(INC)fiondblock.h \
  $(INC)ppersist.h \
@@ -30,6 +28,6 @@
  $(INC)objfio.h utilarr.h tmatrix.h tvector.h
 $(OBJ)matharr.o: matharr.cc $(INC)machdefs.h \
- $(INC)pclassids.h matharr.h tarray.h \
- basarr.h $(INC)anydataobj.h \
+ matharr.h tarray.h basarr.h \
+ $(INC)anydataobj.h \
  $(INC)dvlist.h \
  $(INC)objfio.h \
@@ -37,8 +35,9 @@
  $(INC)pexceptions.h \
  $(INC)gnumd5.h \
- $(INC)ndatablock.h utilarr.h
+ $(INC)ndatablock.h utilarr.h \
+ gcc_arrmath_pb.h
 $(OBJ)sopemtx.o: sopemtx.cc $(INC)machdefs.h \
- $(INC)pclassids.h sopemtx.h tmatrix.h \
- tarray.h basarr.h $(INC)anydataobj.h \
+ sopemtx.h tmatrix.h tarray.h basarr.h \
+ $(INC)anydataobj.h \
  $(INC)dvlist.h \
  $(INC)objfio.h \
@@ -49,5 +48,4 @@
  $(INC)smathconst.h
 $(OBJ)tarray.o: tarray.cc $(INC)machdefs.h \
- $(INC)pclassids.h \
  $(INC)pexceptions.h tarray.h basarr.h \
  $(INC)anydataobj.h \
@@ -58,7 +56,6 @@
  $(INC)ndatablock.h utilarr.h
 $(OBJ)tarrinit.o: tarrinit.cc $(INC)machdefs.h \
- $(INC)pclassids.h tarrinit.h \
- $(INC)sophyainit.h fioarr.h tarray.h \
- basarr.h $(INC)anydataobj.h \
+ tarrinit.h $(INC)sophyainit.h fioarr.h \
+ tarray.h basarr.h $(INC)anydataobj.h \
  $(INC)dvlist.h \
  $(INC)objfio.h \
@@ -69,5 +66,4 @@
  tvector.h
 $(OBJ)tmatrix.o: tmatrix.cc $(INC)machdefs.h \
- $(INC)pclassids.h \
  $(INC)pexceptions.h tmatrix.h tarray.h \
  basarr.h $(INC)anydataobj.h \
@@ -78,5 +74,4 @@
  $(INC)ndatablock.h utilarr.h
 $(OBJ)tvector.o: tvector.cc $(INC)machdefs.h \
- $(INC)pclassids.h \
  $(INC)pexceptions.h tvector.h tmatrix.h \
  tarray.h basarr.h $(INC)anydataobj.h \
@@ -87,3 +82,3 @@
  $(INC)ndatablock.h utilarr.h
 $(OBJ)utilarr.o: utilarr.cc $(INC)machdefs.h \
- $(INC)pclassids.h utilarr.h
+ utilarr.h $(INC)srandgen.h
