Changeset 1089 in Sophya for trunk/SophyaLib/HiStats/hisprof.cc
- Timestamp:
- Jul 25, 2000, 12:20:43 PM (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaLib/HiStats/hisprof.cc
r1058 r1089 57 57 memcpy(SumW, H.SumW, bins*sizeof(double)); 58 58 } 59 UpdateHisto(); 59 60 END_CONSTRUCTOR 60 61 } … … 127 128 et dispersion/erreur sur la moyenne). 128 129 */ 129 void HProf:: UpdateHisto() const130 void HProf::updatehisto() const 130 131 { 131 132 float m,e2; 132 if(bins<=0) return; 133 for(int i=0;i<bins;i++) { 133 if(bins>0) for(int i=0;i<bins;i++) { 134 134 if(SumW[i]<=0.) { 135 135 m = e2 = 0.; … … 142 142 err2[i] = e2; 143 143 } 144 // Attention, a cause de "WriteSelf const" UpdateHisto doit etre "const". 144 Ok = true; 145 // Attention, a cause de "WriteSelf const" updatehisto doit etre "const". 145 146 // Comme on veut modifier Ok, on est oblige de faire cette entourloupe: 146 147 HProf *buff = (HProf *) this; … … 224 225 Histo *hthis = (Histo *) this; 225 226 *hthis += (Histo) a; 226 for(int i=0;i<bins;i++) {227 if(bins>0) for(int i=0;i<bins;i++) { 227 228 SumY[i] += a.SumY[i]; 228 229 SumY2[i] += a.SumY2[i]; 229 230 SumW[i] += a.SumW[i]; 230 231 } 231 Ok = false;232 updatehisto(); 232 233 233 234 return *this; … … 283 284 } 284 285 // On synchronise les tableaux Sum?? et l'Histogramme 285 UpdateHisto();286 updatehisto(); 286 287 } 287 288 … … 303 304 is.GetLine(strg,255); 304 305 305 // Ecriture des valeurs306 // Lecture des valeurs 306 307 is.Get(dobj->bins); 307 308 is.Get(dobj->YMin); … … 310 311 dobj->Ok = true; 311 312 312 // Ecriture des donnees propres a l'histogramme de profil.313 // Lecture des donnees propres a l'histogramme de profil. 313 314 is.GetLine(strg,255); 314 315 dobj->SumY = new double[dobj->bins]; … … 319 320 is.Get(dobj->SumW, dobj->bins); 320 321 321 // Ecriture de l'histogramme322 // Lecture de l'histogramme 322 323 is >> (Histo&)(*dobj); 323 324 return; … … 329 330 char strg[256]; 330 331 331 if(!(dobj->IsOk()))dobj->UpdateHisto();332 dobj->UpdateHisto(); 332 333 333 334 // Ecriture entete pour identifier facilement
Note:
See TracChangeset
for help on using the changeset viewer.