Changeset 2628 in Sophya for trunk/SophyaLib/HiStats
- Timestamp:
- Oct 13, 2004, 6:41:33 PM (21 years ago)
- Location:
- trunk/SophyaLib/HiStats
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaLib/HiStats/histerr.cc
r2627 r2628 185 185 /********* Methode *********/ 186 186 /*! 187 Fill the histogram with an other histogram 188 */ 189 void HistoErr::FillFrHErr(HistoErr& hfrom) 190 { 191 if(mBins<=0) return; 192 if(hfrom.mBins<=0) return; 193 194 Zero(); 195 196 for(int_4 i=0;i<hfrom.mBins;i++) { 197 int numBin = FindBin(hfrom.BinCenter(i)); 198 if(numBin<0) mUnder += hfrom.mData[i]; 199 else if(numBin>=mBins) mOver += hfrom.mData[i]; 200 else { 201 mData[numBin] += hfrom.mData[i]; 202 mNData[numBin] += hfrom.mNData[i]; 203 mErr2[numBin] += hfrom.mErr2[i]; 204 nHist += hfrom.mData[i]; 205 nEntries++; 206 } 207 } 208 209 } 210 211 /********* Methode *********/ 212 /*! 187 213 Operateur egal HistoErr = HistoErr 188 214 */ -
trunk/SophyaLib/HiStats/histerr.h
r2627 r2628 44 44 void ToCorrel(void); 45 45 46 //! Fill an histogram with an histogram 47 void FillFrHErr(HistoErr& hfrom); 48 46 49 // Operators 47 50 HistoErr& operator = (const HistoErr& h); -
trunk/SophyaLib/HiStats/histos.cc
r2619 r2628 1 1 // 2 // $Id: histos.cc,v 1. 19 2004-09-15 15:36:54cmv Exp $2 // $Id: histos.cc,v 1.20 2004-10-13 16:41:33 cmv Exp $ 3 3 // 4 4 … … 75 75 mUnder = mOver = mMin = mMax = binWidth= 0.; 76 76 nHist = 0.; 77 nEntries = mBins = 0; 77 mBins = 0; 78 nEntries = 0; 78 79 } 79 80 … … 1446 1447 // Lecture entete 1447 1448 is.GetLine(strg, 255); 1449 bool nentries_en_8_bytes=false; 1450 if(strg[0]=='V' && strg[1]=='_' && strg[2]=='2') nentries_en_8_bytes=true; 1448 1451 is.GetLine(strg, 255); 1449 1452 is.GetLine(strg, 255); … … 1451 1454 // Lecture des valeurs 1452 1455 is.Get(dobj->mBins); 1453 is.Get(dobj->nEntries); 1456 if(nentries_en_8_bytes) is.Get(dobj->nEntries); 1457 else {int_4 dum; is.Get(dum); dobj->nEntries=(uint_8)dum;} 1454 1458 int_4 errok; 1455 1459 is.Get(errok); … … 1488 1492 1489 1493 // Ecriture entete pour identifier facilement 1490 sprintf(strg," mBins=%6d NEnt=%15d errok=%1d",dobj->mBins,dobj->nEntries,errok);1494 sprintf(strg,"V_2 mBins=%6d NEnt=%15d errok=%1d",dobj->mBins,dobj->nEntries,errok); 1491 1495 os.PutLine(strg); 1492 1496 sprintf(strg,"binw=%g mMin=%g mMax=%g",dobj->binWidth,dobj->mMin,dobj->mMax); -
trunk/SophyaLib/HiStats/histos.h
r2507 r2628 1 1 // This may look like C code, but it is really -*- C++ -*- 2 2 // 3 // $Id: histos.h,v 1.1 8 2004-03-15 16:47:20 ansariExp $3 // $Id: histos.h,v 1.19 2004-10-13 16:41:33 cmv Exp $ 4 4 // 5 5 … … 96 96 inline r_8 NData() const {return nHist;} 97 97 //! Retourne le nombre d'entrees 98 inline r_8 NEntries() const {return nEntries;}98 inline uint_8 NEntries() const {return nEntries;} 99 99 //! Retourne le nombre d'overflow 100 100 inline r_8 NOver() const {return mOver;} … … 156 156 r_8 mOver; //!< overflow 157 157 r_8 nHist; //!< somme ponderee des entrees 158 int_4nEntries; //!< nombre d'entrees158 uint_8 nEntries; //!< nombre d'entrees 159 159 int_4 mBins; //!< nombre de bins 160 160 r_8 mMin; //!< abscisse minimum
Note:
See TracChangeset
for help on using the changeset viewer.