4 #include "franks2Histo.hh"
11 int xbins, T xmin, T xmax,
12 int ybins, T ymin, T ymax) {
19 mXstep = (xmax-xmin)/xbins;
24 mYstep = (ymax-ymin)/ybins;
28 if ( (xbins<=0 || xmax <= xmin) || (ybins<=0 || ymax <= ymin) ) {
29 cout <<
" franks2Histo<T>() can not create histogram with this parameters";
30 cout <<
" xbins=" << xbins;
31 cout <<
" xmin=" << xmin;
32 cout <<
" xmax=" << xmax;
33 cout <<
" ybins=" << ybins;
34 cout <<
" ymin=" << ymin;
35 cout <<
" ymax=" << ymax;
39 vec =
new T[xbins*ybins];
52 template<
class X,
class Y,
class Z>
54 for (
int i=0; i < mBins; i++) {
55 vec[i] = h1->vec[i]*w1 + h2->vec[i]*w2;
60 template<
class X,
class Y,
class Z>
62 for (
int i=0; i < mBins; i++) {
63 if (h2->vec[i]*w2 !=0 )
64 vec[i] = h1->vec[i]*w1 / h2->vec[i]*w2;
72 cout << c <<
" " << mC1 <<
" " << mC2 << endl;
75 T step = (max-min)/10.;
76 cout <<
" minimum=" << min <<
" maximum=" << max <<
" step=" << step << endl;
77 for (
int y=mYbins-1; y>=0; y--) {
78 for (
int x=0; x<mXbins; x++) {
79 T v = floor( (vec[x+y*mYbins]-min)/step );
88 template<
class X,
class Y,
class Z>
90 if ( x>=mXmin && x<=mXmax && y>=mYmin && y<=mYmax) {
91 mXpos = (int) floor( (x-mXmin)/mXstep );
92 mYpos = (int) floor( (y-mYmin)/mYstep );
93 if ( mXpos+mYpos*mYbins <= mBins) {
94 vec[mXpos+mYpos*mYbins] = vec[mXpos+mYpos*mYbins] + w;
102 for (
int i=0; i < mBins; i++) {
104 cout << i <<
" " << vec[i] <<
" " << Integral << endl;
112 int bin = (int) floor( (x-mXmin)/mXstep );
113 if( !(bin >=0 && bin < mXbins) ) bin=-1;
120 if ( bin >=0 && bin < mXbins)
121 center= mXmin + (0.5+bin)*mXstep;
128 for (
int i=0; i< mBins; i++)
129 mean+=vec[i]*GetBinCenter(i);
137 for (
int i=0; i< mBins; i++) {
147 for (
int i=0; i< mBins; i++) {
157 for (
int i=0; i< mBins; i++)
158 mean+=vec[i]*GetBinCenter(i);
165 for (
int i=0; i < mBins; i++)
172 for (
int i=0; i < mBins; i++)