Changeset 1056 in Sophya for trunk/SophyaLib/HiStats/hisprof.h
- Timestamp:
- Jul 7, 2000, 10:41:11 AM (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaLib/HiStats/hisprof.h
r1053 r1056 22 22 23 23 // UPDATING or SETTING 24 void Zero();25 void UpdateHisto() const;26 void SetErrOpt(bool spread = true);27 void 28 void 24 void UpdateHisto() const; 25 void SetErrOpt(bool spread = true); 26 void Zero(); 27 void Add(float x, float y, float w = 1.); 28 void AddBin(int numBin, float y, float w = 1.); 29 29 30 30 // Acces a l information 31 //! Retourne true si l'histogramme est a jours, false sinon. 32 inline bool IsOk() const {return Ok;} 31 33 //! Retourne l'histogramme de profil. 32 34 inline Histo GetHisto() 33 35 {if(!Ok) UpdateHisto(); return (Histo) *this;} 34 36 //! Retourne le contenu de la moyenne dans le vecteur v 35 inline void Get Mean(TVector<r_8>& v)37 inline void GetValue(TVector<r_8>& v) 36 38 {if(!Ok) UpdateHisto(); Histo::GetValue(v);} 37 39 //! Retourne le contenu au carre de la dispersion/erreur dans le vecteur v 38 40 inline void GetError2(TVector<r_8>& v) 39 41 {if(!Ok) UpdateHisto(); Histo::GetError2(v);} 42 //! Retourne le contenu au carre de la dispersion/erreur dans le vecteur v 43 inline void GetError(TVector<r_8>& v) 44 {if(!Ok) UpdateHisto(); Histo::GetError(v);} 40 45 //! Retourne le contenu du bin i 41 46 inline float operator()(int i) const 42 47 {if(!Ok) UpdateHisto(); return data[i];} 43 48 //! Retourne le carre de la dispersion/erreur du bin i 44 inline floatError2(int i) const45 49 inline double Error2(int i) const 50 {if(!Ok) UpdateHisto(); return (float) err2[i];} 46 51 //! Retourne la dispersion/erreur du bin i 47 52 inline float Error(int i) const 48 53 {if(!Ok) UpdateHisto(); 49 return err2[i]>0.? (float) sqrt(err2[i]) : 0.f;}54 return (err2[i]>0.) ? (float) sqrt(err2[i]) : 0.f;} 50 55 51 56 // Operators … … 55 60 // Fit 56 61 //! Fit du profile par ``gfit''. 57 inline int 62 inline int Fit(GeneralFit& gfit) 58 63 {if(!Ok) UpdateHisto(); return Histo::Fit(gfit,0);} 59 64 //! Retourne l'Histogramme des residus par ``gfit''. 60 inline Histo 65 inline Histo FitResidus(GeneralFit& gfit) 61 66 {if(!Ok) UpdateHisto(); return Histo::FitResidus(gfit);} 62 67 //! Retourne l'Histogramme de la fonction fittee par ``gfit''. 63 inline Histo 68 inline Histo FitFunction(GeneralFit& gfit) 64 69 {if(!Ok) UpdateHisto(); return Histo::FitFunction(gfit);} 65 70 66 71 // Print 67 72 //! Print, voir detail dans Histo::Print 68 inline void Print(int dyn=100,float hmin=1.,float hmax=-1.,int pflag=0,int il=1,int ih=-1) 69 {if(!Ok) UpdateHisto(); Histo::Print(dyn,hmin,hmax,pflag,il,ih);} 73 inline void Print(int dyn=100,float hmin=1.,float hmax=-1. 74 ,int pflag=0,int il=1,int ih=-1) 75 {if(!Ok) UpdateHisto(); Histo::Print(dyn,hmin,hmax,pflag,il,ih);} 76 //! PrintF, voir detail dans Histo::PrintF 77 inline void PrintF(FILE * fp,int dyn=100,float hmin=1.,float hmax=-1. 78 ,int pflag=0,int il=1,int ih=-1) 79 {if(!Ok) UpdateHisto(); Histo::PrintF(fp,dyn,hmin,hmax,pflag,il,ih);} 70 80 71 81 protected: … … 75 85 double* SumY2; //!< somme des carres 76 86 double* SumW; //!< somme des poids 77 bool Ok; //!< true i siupdate fait87 bool Ok; //!< true if update fait 78 88 float YMin; //!< limite minimum Y pour somme 79 89 float YMax; //!< limite maximum Y pour somme
Note:
See TracChangeset
for help on using the changeset viewer.