Changeset 1089 in Sophya for trunk/SophyaLib/HiStats/hisprof.h
- Timestamp:
- Jul 25, 2000, 12:20:43 PM (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaLib/HiStats/hisprof.h
r1058 r1089 22 22 23 23 // UPDATING or SETTING 24 void UpdateHisto() const; 24 //! Calcul la partie histogramme du profile si elle n'est pas a jour. 25 virtual inline void UpdateHisto(bool force=false) const 26 {if(!Ok || force) updatehisto();} 25 27 void SetErrOpt(bool spread = true); 26 28 void Zero(); … … 29 31 30 32 // Acces a l information 31 //! Retourne true si l'histogramme est a jours, false sinon.32 inline bool IsOk() const {return Ok;}33 33 //! Retourne l'histogramme de profil. 34 34 inline Histo GetHisto() 35 { if(!Ok)UpdateHisto(); return (Histo) *this;}35 {UpdateHisto(); return (Histo) *this;} 36 36 //! Retourne le contenu de la moyenne dans le vecteur v 37 37 inline void GetValue(TVector<r_8>& v) 38 { if(!Ok)UpdateHisto(); Histo::GetValue(v);}38 {UpdateHisto(); Histo::GetValue(v);} 39 39 //! Retourne le contenu au carre de la dispersion/erreur dans le vecteur v 40 40 inline void GetError2(TVector<r_8>& v) 41 { if(!Ok)UpdateHisto(); Histo::GetError2(v);}41 {UpdateHisto(); Histo::GetError2(v);} 42 42 //! Retourne le contenu au carre de la dispersion/erreur dans le vecteur v 43 43 inline void GetError(TVector<r_8>& v) 44 { if(!Ok)UpdateHisto(); Histo::GetError(v);}44 {UpdateHisto(); Histo::GetError(v);} 45 45 //! Retourne le contenu du bin i 46 46 inline float operator()(int i) const 47 { if(!Ok)UpdateHisto(); return data[i];}47 {UpdateHisto(); return data[i];} 48 48 //! Retourne le carre de la dispersion/erreur du bin i 49 49 inline double Error2(int i) const 50 {if(!Ok)UpdateHisto(); return (float) err2[i];}50 {UpdateHisto(); return (float) err2[i];} 51 51 //! Retourne la dispersion/erreur du bin i 52 52 inline float Error(int i) const 53 {if(!Ok)UpdateHisto();54 return (err2[i]>0.) ? (float) sqrt(err2[i]) : 0.f;}53 {UpdateHisto(); 54 return (err2[i]>0.) ? (float) sqrt(err2[i]) : 0.f;} 55 55 56 56 // Operators … … 64 64 //! Fit du profile par ``gfit''. 65 65 inline int Fit(GeneralFit& gfit) 66 { if(!Ok)UpdateHisto(); return Histo::Fit(gfit,0);}66 {UpdateHisto(); return Histo::Fit(gfit,0);} 67 67 //! Retourne l'Histogramme des residus par ``gfit''. 68 68 inline Histo FitResidus(GeneralFit& gfit) 69 { if(!Ok)UpdateHisto(); return Histo::FitResidus(gfit);}69 {UpdateHisto(); return Histo::FitResidus(gfit);} 70 70 //! Retourne l'Histogramme de la fonction fittee par ``gfit''. 71 71 inline Histo FitFunction(GeneralFit& gfit) 72 { if(!Ok)UpdateHisto(); return Histo::FitFunction(gfit);}72 {UpdateHisto(); return Histo::FitFunction(gfit);} 73 73 74 74 // Print … … 76 76 inline void Print(int dyn=100,float hmin=1.,float hmax=-1. 77 77 ,int pflag=0,int il=1,int ih=-1) 78 { if(!Ok)UpdateHisto(); Histo::Print(dyn,hmin,hmax,pflag,il,ih);}78 {UpdateHisto(); Histo::Print(dyn,hmin,hmax,pflag,il,ih);} 79 79 //! PrintF, voir detail dans Histo::PrintF 80 80 inline void PrintF(FILE * fp,int dyn=100,float hmin=1.,float hmax=-1. 81 81 ,int pflag=0,int il=1,int ih=-1) 82 { if(!Ok)UpdateHisto(); Histo::PrintF(fp,dyn,hmin,hmax,pflag,il,ih);}82 {UpdateHisto(); Histo::PrintF(fp,dyn,hmin,hmax,pflag,il,ih);} 83 83 84 84 protected: 85 85 void Delete(); 86 void updatehisto() const; 86 87 87 88 double* SumY; //!< somme 88 89 double* SumY2; //!< somme des carres 89 90 double* SumW; //!< somme des poids 90 boolOk; //!< true if update fait91 mutable bool Ok; //!< true if update fait 91 92 float YMin; //!< limite minimum Y pour somme 92 93 float YMax; //!< limite maximum Y pour somme
Note:
See TracChangeset
for help on using the changeset viewer.