Changeset 2627 in Sophya for trunk/SophyaLib/HiStats
- Timestamp:
- Oct 6, 2004, 6:04:27 PM (21 years ago)
- Location:
- trunk/SophyaLib/HiStats
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaLib/HiStats/histerr.cc
r2626 r2627 84 84 else if(numBin>=mBins) mOver += w; 85 85 else { 86 mData[numBin] += w; mNData[numBin] ++; mErr2[numBin] += e*e;86 mData[numBin] += w; mNData[numBin] += 1.; mErr2[numBin] += e*e; 87 87 nHist += w; nEntries++; 88 88 } … … 98 98 else if(numBin>=mBins) mOver += w; 99 99 else { 100 mData[numBin] += w; mNData[numBin] ++; mErr2[numBin] += e*e;100 mData[numBin] += w; mNData[numBin] += 1.; mErr2[numBin] += e*e; 101 101 nHist += w; nEntries++; 102 102 } … … 149 149 /*! 150 150 Recompute XMin and XMax so that 151 the center of the first bin is exactly xcmin and 152 the center of the last bin is exactly xcmax 153 */ 154 void HistoErr::ReCenterBin(r_8 xcmin,r_8 xcmax) 155 { 156 if(xcmax<=xcmin) return; 151 the CENTER of the first bin is exactly XMin and 152 the CENTER of the last bin is exactly XMax. 153 Remember that otherwise 154 XMin is the beginning of the first bin 155 and XMax is the end of the last bin 156 */ 157 void HistoErr::ReCenterBin(void) 158 { 157 159 if(mBins<=1) return; 158 160 double dx = (mMax-mMin)/(mBins-1); 159 160 161 161 mMin -= dx/2.; 162 mMax += dx/2.; 163 binWidth = (mMax-mMin)/mBins; 162 164 } 163 165 … … 174 176 if(mBins<1) return; 175 177 for(int_4 i=0;i<mBins;i++) { 176 if(mNData[i]<1 ) continue;178 if(mNData[i]<1.) continue; 177 179 mData[i] /= mNData[i]; 178 180 mErr2[i] /= mNData[i]; -
trunk/SophyaLib/HiStats/histerr.h
r2626 r2627 40 40 41 41 //! Re-center bin abscissa 42 void ReCenterBin( r_8 xcmin,r_8 xcmax);42 void ReCenterBin(void); 43 43 //! Compute the correlation histogram 44 44 void ToCorrel(void);
Note:
See TracChangeset
for help on using the changeset viewer.