Changeset 914 in Sophya for trunk/SophyaLib/HiStats/histos.h
- Timestamp:
- Apr 13, 2000, 6:04:50 PM (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaLib/HiStats/histos.h
r763 r914 1 1 // This may look like C code, but it is really -*- C++ -*- 2 2 // 3 // $Id: histos.h,v 1. 1.1.1 2000-03-02 16:51:32ansari Exp $3 // $Id: histos.h,v 1.2 2000-04-13 16:04:11 ansari Exp $ 4 4 // 5 5 … … 19 19 class GeneralFit; 20 20 21 22 /*! 23 Classe d'histogrammes 1D 24 */ 21 25 class Histo : public AnyDataObj { 22 26 friend class ObjFileIO<Histo>; … … 77 81 78 82 // INLINES 83 //! Retourne l'abscisse minimum 79 84 inline float XMin() const {return min;} 85 //! Retourne l'abscisse maximum 80 86 inline float XMax() const {return max;} 87 //! Retourne le nombre de bins 81 88 inline int_4 NBins() const {return bins;} 89 //! Retourne la largeur du bin 82 90 inline float BinWidth() const {return binWidth;} 91 //! Retourne le pointeur sur le tableaux des contenus 83 92 inline float* Bins() const {return data;} 93 //! Retourne le contenu du bin i 84 94 inline float operator()(int i) const {return data[i];} 95 //! Remplit le contenu du bin i 85 96 inline float& operator()(int i) {return data[i];} 97 //! retourne "true" si il y a des erreurs stoquees 86 98 inline bool HasErrors() { if(err2) return true; else return false;} 99 //! Retourne l'erreur du bin i 87 100 inline float Error(int i) const 88 101 {if(err2) {if(err2[i]>0.) return sqrt(err2[i]); else return 0.;} 89 102 else return 0.;} 103 //! Retourne l'erreur au carre du bin i 90 104 inline double Error2(int i) const 91 105 {if(err2) return err2[i]; else return 0.;} 106 //! Remplit l'erreur au carre du bin i 92 107 inline double& Error2(int i) {return err2[i];} 108 //! Retourne la somme ponderee 93 109 inline float NData() const {return (float) nHist;} 110 //! Retourne le nombre d'entrees 94 111 inline float NEntries() const {return nEntries;} 112 //! Retourne le nombre d'overflow 95 113 inline float NOver() const {return over;} 114 //! Retourne le nombre d'underflow 96 115 inline float NUnder() const {return under;} 97 116 117 //! Retourne l'abscisse du bord inferieur du bin i 98 118 inline float BinLowEdge(int i) const {return min + i*binWidth;} 119 //! Retourne l'abscisse du centre du bin i 99 120 inline float BinCenter(int i) const {return min + (i+0.5)*binWidth;} 121 //! Retourne l'abscisse du bord superieur du bin i 100 122 inline float BinHighEdge(int i) const {return min + (i+1)*binWidth;} 123 //! Retourne le numero du bin contenant l'abscisse x 101 124 inline int_4 FindBin(float x) const 102 125 {return (int_4) floorf((x - min) / binWidth);} … … 146 169 void Delete(); 147 170 148 float* data; 149 double* err2; 150 float under; 151 float over; 152 double nHist; 153 int_4 nEntries; 154 int_4 bins; 155 float min; 156 float max; 157 float binWidth; 171 float* data; //!< donnees 172 double* err2; //!< erreurs carrees 173 float under; //!< underflow 174 float over; //!< overflow 175 double nHist; //!< somme ponderee des entrees 176 int_4 nEntries; //!< nombre d'entrees 177 int_4 bins; //!< nombre de bins 178 float min; //!< abscisse minimum 179 float max; //!< abscisse maximum 180 float binWidth; //!< largeur du bin 158 181 }; 159 182
Note:
See TracChangeset
for help on using the changeset viewer.