My Project
|
00001 /* 00002 $Id: GslHistogram.hh 2001 2009-03-16 06:28:16Z jisuzuki $ 00003 */ 00004 00005 #ifndef GSLHISTOGRAM 00006 #define GSLHISTOGRAM 00007 00008 #include "Header.hh" 00009 #include <gsl/gsl_histogram.h> 00010 #include "CppToPython.hh" 00011 00013 00027 class GslHistogram { 00028 private: 00029 gsl_histogram **h; 00030 void Set( Double *Bin, UInt4 Size ); 00031 PyObject *VtoL( vector<Double> v ); 00032 UInt4 NumOfMulTh; 00033 public: 00034 00035 GslHistogram( Double *Bin, UInt4 Size, UInt4 _NumOfMulTh=1 ); 00040 ~GslHistogram(); 00043 UInt4 PutHistSize(){ return gsl_histogram_bins( h[0] ); } 00046 PyObject *PutHistogramList(){ return VtoL( PutHistogram() );} 00050 vector<Double> PutHistogram(); 00055 vector<Double> PutHistogramErr(); 00060 PyObject *PutHistogramErrList(){ return VtoL( PutHistogramErr() ); } 00065 void Increment( Double x, UInt4 ThNum=0, Double Weight=1.0 ); 00074 void Increment( vector<Double> x, UInt4 ThNum=0 ); 00078 void Increment( vector<Int4> x, UInt4 ThNum=0 ); 00083 void Dump(){ gsl_histogram_fprintf( stdout, h[0], "%g", "%g"); } 00085 //void Reset(){ gsl_histogram_reset( h ); } 00086 void Reset(); 00089 gsl_histogram *PutHistPointer( UInt4 ThNum=0 ){ return h[ThNum]; } 00094 vector<Double> PutBin(); 00099 PyObject *PutBinList(){ return VtoL( PutBin() ); } 00105 Double PutHistogramSum(); 00109 }; 00110 00111 #endif