| [763] | 1 | // | 
|---|
|  | 2 | // histogrammes 2D     cmv 2/8/96 | 
|---|
|  | 3 | // | 
|---|
|  | 4 |  | 
|---|
|  | 5 | #ifndef HISTOS2_SEEN | 
|---|
|  | 6 | #define HISTOS2_SEEN | 
|---|
|  | 7 |  | 
|---|
|  | 8 | #include "machdefs.h" | 
|---|
|  | 9 | #include <string> | 
|---|
|  | 10 |  | 
|---|
|  | 11 | #include <list> | 
|---|
|  | 12 | #if defined(__KCC__) | 
|---|
|  | 13 | #include <list.h> | 
|---|
|  | 14 | #endif | 
|---|
|  | 15 |  | 
|---|
|  | 16 | #include "peida.h" | 
|---|
|  | 17 | #include "utils.h" | 
|---|
|  | 18 | #include "histos.h" | 
|---|
|  | 19 |  | 
|---|
|  | 20 | namespace SOPHYA { | 
|---|
|  | 21 |  | 
|---|
| [926] | 22 | //! 2 dimensions histograms | 
|---|
| [763] | 23 | class Histo2D : public AnyDataObj { | 
|---|
|  | 24 | friend class ObjFileIO<Histo2D>; | 
|---|
|  | 25 | public: | 
|---|
|  | 26 |  | 
|---|
|  | 27 | // CREATOR / DESTRUCTOR | 
|---|
| [1092] | 28 | Histo2D(r_8 xMin,r_8 xMax,int_4 nxBin,r_8 yMin,r_8 yMax,int_4 nyBin); | 
|---|
|  | 29 | Histo2D(r_4 xMin,r_4 xMax,int_4 nxBin,r_4 yMin,r_4 yMax,int_4 nyBin); | 
|---|
| [763] | 30 | Histo2D(const Histo2D& h); | 
|---|
|  | 31 | Histo2D(); | 
|---|
| [1092] | 32 | virtual ~Histo2D(); | 
|---|
| [763] | 33 |  | 
|---|
|  | 34 | // OPTIONS | 
|---|
| [1092] | 35 | void Errors(); | 
|---|
| [763] | 36 |  | 
|---|
|  | 37 | // UPDATING | 
|---|
| [1092] | 38 | void Zero(); | 
|---|
|  | 39 | void Add(r_8 x, r_8 y, r_8 w = 1.); | 
|---|
| [763] | 40 |  | 
|---|
|  | 41 | // Operators | 
|---|
|  | 42 | Histo2D& operator = (const Histo2D& h); | 
|---|
| [1092] | 43 | Histo2D& operator *= (r_8 b); | 
|---|
|  | 44 | Histo2D& operator /= (r_8 b); | 
|---|
|  | 45 | Histo2D& operator += (r_8 b); | 
|---|
|  | 46 | Histo2D& operator -= (r_8 b); | 
|---|
| [763] | 47 | Histo2D& operator += (const Histo2D& a); | 
|---|
|  | 48 | Histo2D& operator -= (const Histo2D& a); | 
|---|
|  | 49 | Histo2D& operator *= (const Histo2D& a); | 
|---|
|  | 50 | Histo2D& operator /= (const Histo2D& a); | 
|---|
|  | 51 |  | 
|---|
|  | 52 | // get/put dans/depuis une matrice / vector | 
|---|
| [1109] | 53 | void GetXCoor(TVector<r_8>& v) const; | 
|---|
|  | 54 | void GetValue(TMatrix<r_8> &v) const; | 
|---|
|  | 55 | void GetYCoor(TVector<r_8>& v) const; | 
|---|
|  | 56 | void GetError2(TMatrix<r_8>& v) const; | 
|---|
|  | 57 | void GetError(TMatrix<r_8>& v) const; | 
|---|
| [1092] | 58 | void PutValue(TMatrix<r_8>& v, int_4 ierr=0); | 
|---|
|  | 59 | void PutValueAdd(TMatrix<r_8>& v, int_4 ierr=0); | 
|---|
| [943] | 60 | void PutError2(TMatrix<r_8>& v); | 
|---|
|  | 61 | void PutError2Add(TMatrix<r_8>& v); | 
|---|
|  | 62 | void PutError(TMatrix<r_8>& v); | 
|---|
| [763] | 63 |  | 
|---|
|  | 64 | // INLINES | 
|---|
| [914] | 65 | //! Retourne l'abscisse minimum. | 
|---|
| [1092] | 66 | inline r_8 XMin() const {return mXmin;} | 
|---|
| [914] | 67 | //! Retourne l'abscisse maximum. | 
|---|
| [1092] | 68 | inline r_8 XMax() const {return mXmax;} | 
|---|
| [914] | 69 | //! Retourne l'ordonnee minimum. | 
|---|
| [1092] | 70 | inline r_8 YMin() const {return mYmin;} | 
|---|
| [914] | 71 | //! Retourne l'ordonnee maximum. | 
|---|
| [1092] | 72 | inline r_8 YMax() const {return mYmax;} | 
|---|
| [914] | 73 | //! Retourne le nombre de bins selon X. | 
|---|
| [1092] | 74 | inline int_4 NBinX() const {return mNx;} | 
|---|
| [914] | 75 | //! Retourne le nombre de bins selon Y. | 
|---|
| [1092] | 76 | inline int_4 NBinY() const {return mNy;} | 
|---|
| [914] | 77 | //! Retourne la largeur du bin selon X. | 
|---|
| [1092] | 78 | inline r_8 WBinX() const {return mWBinx;} | 
|---|
| [914] | 79 | //! Retourne la largeur du bin selon Y. | 
|---|
| [1092] | 80 | inline r_8 WBinY() const {return mWBiny;} | 
|---|
| [914] | 81 | //! Retourne le pointeur sur le tableaux des contenus. | 
|---|
| [1092] | 82 | inline r_8* Bins() const  {return mData;} | 
|---|
| [914] | 83 | //! Retourne le contenu du bin i,j. | 
|---|
| [1092] | 84 | inline r_8 operator()(int_4 i,int_4 j) const {return mData[j*mNx+i];} | 
|---|
| [914] | 85 | //! Remplit le contenu du bin i,j. | 
|---|
| [1092] | 86 | inline r_8& operator()(int_4 i,int_4 j)      {return mData[j*mNx+i];} | 
|---|
| [914] | 87 | //! retourne "true" si il y a des erreurs stoquees | 
|---|
| [1109] | 88 | inline bool HasErrors() const { if(mErr2) return true; else return false;} | 
|---|
| [914] | 89 | //! Retourne l'erreur du bin i,j. | 
|---|
| [1092] | 90 | inline r_8 Error(int_4 i,int_4 j)  const | 
|---|
|  | 91 | {if(mErr2) | 
|---|
|  | 92 | {if(mErr2[j*mNx+i]>0.) return sqrt(mErr2[j*mNx+i]); else return 0.;} | 
|---|
|  | 93 | else return 0.;} | 
|---|
| [914] | 94 | //! Remplit l'erreur au carre du bin i,j. | 
|---|
| [1092] | 95 | inline r_8 Error2(int_4 i,int_4 j) const | 
|---|
|  | 96 | {if(mErr2) return mErr2[j*mNx+i]; else return 0.;} | 
|---|
| [914] | 97 | //! Remplit l'erreur au carre du bin i,j. | 
|---|
| [1092] | 98 | inline r_8& Error2(int_4 i,int_4 j) {return mErr2[j*mNx+i];} | 
|---|
| [914] | 99 | //! Retourne la somme ponderee. | 
|---|
| [1092] | 100 | inline r_8 NData() const    {return nHist;} | 
|---|
| [914] | 101 | //! Retourne le nombre d'entrees. | 
|---|
| [1092] | 102 | inline int_4 NEntries() const {return nEntries;} | 
|---|
| [914] | 103 | //! Retourne l'abscisse et l'ordonnee du coin inferieur du bin i,j. | 
|---|
| [1109] | 104 | inline void BinLowEdge(int_4 i,int_4 j,r_8& x,r_8& y) const | 
|---|
| [1092] | 105 | {x = mXmin + i*mWBinx; y = mYmin + j*mWBiny;} | 
|---|
|  | 106 | //! Retourne l'abscisse et l'ordonnee du coin inferieur du bin i,j. | 
|---|
| [1109] | 107 | inline void BinLowEdge(int_4 i,int_4 j,r_4& xf,r_4& yf) const | 
|---|
| [1092] | 108 | {r_8 x,y; BinLowEdge(i,j,x,y); xf=x; yf=y;} | 
|---|
| [914] | 109 | //! Retourne l'abscisse et l'ordonnee du centre du bin i,j. | 
|---|
| [1109] | 110 | inline void BinCenter(int_4 i,int_4 j,r_8& x,r_8& y) const | 
|---|
| [1092] | 111 | {x = mXmin + (i+0.5)*mWBinx; y = mYmin + (j+0.5)*mWBiny;} | 
|---|
|  | 112 | //! Retourne l'abscisse et l'ordonnee du centre du bin i,j. | 
|---|
| [1109] | 113 | inline void BinCenter(int_4 i,int_4 j,r_4& xf,r_4& yf) const | 
|---|
| [1092] | 114 | {r_8 x,y; BinCenter(i,j,x,y); xf=x; yf=y;} | 
|---|
| [914] | 115 | //! Retourne l'abscisse et l'ordonnee du coin superieur du bin i,j. | 
|---|
| [1109] | 116 | inline void BinHighEdge(int_4 i,int_4 j,r_8& x,r_8& y) const | 
|---|
| [1092] | 117 | {x = mXmin + (i+1)*mWBinx; y = mYmin + (j+1)*mWBiny;} | 
|---|
|  | 118 | //! Retourne l'abscisse et l'ordonnee du coin superieur du bin i,j. | 
|---|
| [1109] | 119 | inline void BinHighEdge(int_4 i,int_4 j,r_4& xf,r_4& yf) const | 
|---|
| [1092] | 120 | {r_8 x,y; BinHighEdge(i,j,x,y); xf=x; yf=y;} | 
|---|
| [914] | 121 | //! Retourne les numeros du bin contenant l'abscisse et l'ordonnee x,y. | 
|---|
| [1109] | 122 | inline void FindBin(r_8 x,r_8 y,int_4& i,int_4& j) const | 
|---|
| [1092] | 123 | {i=(int_4) floor((x-mXmin)/mWBinx); j=(int_4) floor((y-mYmin)/mWBiny);} | 
|---|
| [763] | 124 |  | 
|---|
|  | 125 | // Info, statistique et calculs sur les histogrammes | 
|---|
| [1092] | 126 | r_8   NOver(int_4 i=-1,int_4 j=-1) const; | 
|---|
|  | 127 | int_4 BinNonNul() const; | 
|---|
|  | 128 | int_4 ErrNonNul() const; | 
|---|
| [1109] | 129 | void IJMax(int_4& imax,int_4& jmax,int_4 il=1,int_4 ih= -1,int_4 jl=1,int_4 jh= -1) const; | 
|---|
|  | 130 | void IJMin(int_4& imax,int_4& jmax,int_4 il=1,int_4 ih= -1,int_4 jl=1,int_4 jh= -1) const; | 
|---|
| [1092] | 131 | r_8 VMax(int_4 il=1,int_4 ih= -1,int_4 jl=1,int_4 jh= -1) const; | 
|---|
|  | 132 | r_8 VMin(int_4 il=1,int_4 ih= -1,int_4 jl=1,int_4 jh= -1) const; | 
|---|
|  | 133 | int_4 EstimeMax(r_8& xm,r_8& ym,int_4 SzPav = 3 | 
|---|
| [1109] | 134 | ,int_4 il=1,int_4 ih= -1,int_4 jl=1,int_4 jh= -1) const; | 
|---|
|  | 135 | int_4 EstimeMax(int_4 im,int_4 jm,r_8& xm,r_8& ym,int_4 SzPav = 3) const; | 
|---|
| [1092] | 136 | int_4 FindMax(int_4& im,int_4& jm,int_4 SzPav = 3,r_8 Dz = 0. | 
|---|
| [1109] | 137 | ,int_4 il=1,int_4 ih= -1,int_4 jl=1,int_4 jh= -1) const; | 
|---|
| [763] | 138 |  | 
|---|
|  | 139 | // Print et Display ASCII | 
|---|
| [1109] | 140 | void PrintStatus() const; | 
|---|
| [1092] | 141 | void Print(r_8 min=1.,r_8 max=-1. | 
|---|
| [1109] | 142 | ,int_4 il=1,int_4 ih= -1,int_4 jl=1,int_4 jh= -1) const; | 
|---|
| [763] | 143 |  | 
|---|
|  | 144 | // PROJECTIONS | 
|---|
| [1092] | 145 | void SetProjX(); | 
|---|
|  | 146 | void SetProjY(); | 
|---|
|  | 147 | void SetProj(); | 
|---|
|  | 148 | void DelProjX(); | 
|---|
|  | 149 | void DelProjY(); | 
|---|
|  | 150 | void DelProj(); | 
|---|
|  | 151 | void ZeroProjX(); | 
|---|
|  | 152 | void ZeroProjY(); | 
|---|
|  | 153 | void ZeroProj(); | 
|---|
| [914] | 154 | //! Retourne le pointeur sur l'histo 1D de la projection selon X. | 
|---|
| [1092] | 155 | inline Histo* HProjX() const {return mHprojx;} | 
|---|
| [914] | 156 | //! Retourne le pointeur sur l'histo 1D de la projection selon Y. | 
|---|
| [1092] | 157 | inline Histo* HProjY() const {return mHprojy;} | 
|---|
| [1109] | 158 | void ShowProj() const; | 
|---|
| [763] | 159 |  | 
|---|
|  | 160 | // BANDES | 
|---|
| [914] | 161 | //! Retourne le nombre de bandes selon X | 
|---|
| [1092] | 162 | inline int_4 NBandX() const {return mLBandx.size();} | 
|---|
| [914] | 163 | //! Retourne le nombre de bandes selon Y | 
|---|
| [1092] | 164 | inline int_4 NBandY() const {return mLBandy.size();} | 
|---|
|  | 165 | int_4 SetBandX(r_8 ybmin,r_8 ybmax); | 
|---|
|  | 166 | int_4 SetBandY(r_8 xbmin,r_8 xbmax); | 
|---|
|  | 167 | void DelBandX(); | 
|---|
|  | 168 | void DelBandY(); | 
|---|
|  | 169 | void ZeroBandX(); | 
|---|
|  | 170 | void ZeroBandY(); | 
|---|
|  | 171 | Histo* HBandX(int_4 n) const; | 
|---|
|  | 172 | Histo* HBandY(int_4 n) const; | 
|---|
|  | 173 | void GetBandX(int_4 n,r_8& ybmin,r_8& ybmax) const; | 
|---|
|  | 174 | void GetBandY(int_4 n,r_8& xbmin,r_8& xbmax) const; | 
|---|
| [1109] | 175 | void ShowBand(int_4 lp = 0) const; | 
|---|
| [763] | 176 |  | 
|---|
|  | 177 | // SLICES | 
|---|
| [914] | 178 | //! Retourne le nombre de slices selon X | 
|---|
| [1092] | 179 | inline int_4 NSliX() const {return mLSlix.size();} | 
|---|
| [914] | 180 | //! Retourne le nombre de slices selon Y | 
|---|
| [1092] | 181 | inline int_4 NSliY() const {return mLSliy.size();} | 
|---|
|  | 182 | int_4 SetSliX(int_4 nsli); | 
|---|
|  | 183 | int_4 SetSliY(int_4 nsli); | 
|---|
|  | 184 | void DelSliX(); | 
|---|
|  | 185 | void DelSliY(); | 
|---|
|  | 186 | void ZeroSliX(); | 
|---|
|  | 187 | void ZeroSliY(); | 
|---|
|  | 188 | Histo* HSliX(int_4 n) const; | 
|---|
|  | 189 | Histo* HSliY(int_4 n) const; | 
|---|
| [1109] | 190 | void ShowSli(int_4 lp = 0) const; | 
|---|
| [763] | 191 |  | 
|---|
|  | 192 | #ifndef __DECCXX | 
|---|
|  | 193 | protected: | 
|---|
|  | 194 | #endif | 
|---|
| [914] | 195 | //! structure de definition des bandes | 
|---|
| [763] | 196 | struct bande_slice { | 
|---|
| [1092] | 197 | int_4 num;   //!< nombre de bandes | 
|---|
|  | 198 | r_8 min;     //!< limite minimum pour remplir la bande | 
|---|
|  | 199 | r_8 max;     //!< limite maximum pour remplir la bande | 
|---|
|  | 200 | Histo* H;    //!< pointer sur l Histo 1D de la bande | 
|---|
| [763] | 201 | STRUCTCOMP(bande_slice) | 
|---|
|  | 202 | }; | 
|---|
|  | 203 | #ifdef __DECCXX | 
|---|
|  | 204 | protected: | 
|---|
|  | 205 | #endif | 
|---|
|  | 206 |  | 
|---|
|  | 207 | void Delete(); | 
|---|
|  | 208 |  | 
|---|
| [1092] | 209 | r_8*        mData; //!< donnees | 
|---|
|  | 210 | r_8*        mErr2; //!< erreurs carrees | 
|---|
| [763] | 211 |  | 
|---|
| [1092] | 212 | r_8         mOver[3][3]; //!< overflow table | 
|---|
|  | 213 | r_8         nHist;       //!< somme ponderee des entrees | 
|---|
|  | 214 | int_4       nEntries;    //!< nombre d'entrees | 
|---|
| [763] | 215 |  | 
|---|
| [1092] | 216 | int_4       mNx;    //!< nombre de bins en X | 
|---|
|  | 217 | int_4       mNy;    //!< nombre de bins en Y | 
|---|
|  | 218 | int_4       mNxy;   //!< nombre de bins total | 
|---|
|  | 219 | r_8         mXmin;  //!< abscisse minimum | 
|---|
|  | 220 | r_8         mXmax;  //!< abscisse maximum | 
|---|
|  | 221 | r_8         mYmin;  //!< ordonnee minimum | 
|---|
|  | 222 | r_8         mYmax;  //!< ordonnee maximum | 
|---|
|  | 223 | r_8         mWBinx; //!< largeur du bin en X | 
|---|
|  | 224 | r_8         mWBiny; //!< largeur du bin en Y | 
|---|
| [763] | 225 |  | 
|---|
| [1092] | 226 | bande_slice mB_s; | 
|---|
| [763] | 227 |  | 
|---|
| [1092] | 228 | Histo*      mHprojx; //!< pointer sur Histo des proj X | 
|---|
|  | 229 | Histo*      mHprojy; //!< pointer sur Histo des proj Y | 
|---|
| [763] | 230 |  | 
|---|
| [1092] | 231 | list<bande_slice>  mLBandx; //!< liste des bandes selon X | 
|---|
|  | 232 | list<bande_slice>  mLBandy; //!< liste des bandes selon Y | 
|---|
| [763] | 233 |  | 
|---|
| [1092] | 234 | list<bande_slice>  mLSlix; //!< liste des slices selon X | 
|---|
|  | 235 | list<bande_slice>  mLSliy; //!< liste des slices selon Y | 
|---|
| [763] | 236 |  | 
|---|
|  | 237 | }; | 
|---|
|  | 238 |  | 
|---|
|  | 239 | ///////////////////////////////////////////////////////////////////////// | 
|---|
|  | 240 | // Classe pour la gestion de persistance | 
|---|
|  | 241 |  | 
|---|
| [958] | 242 | /*! \ingroup HiStats \fn operator<<(POuttPersist&,Histo2D) | 
|---|
|  | 243 | \brief Persistance management */ | 
|---|
| [763] | 244 | inline POutPersist& operator << (POutPersist& os, Histo2D & obj) | 
|---|
|  | 245 | { ObjFileIO<Histo2D> fio(&obj);  fio.Write(os);  return(os); } | 
|---|
| [958] | 246 | /*! \ingroup HiStats \fn operator<<(POuttPersist&,Histo2D) | 
|---|
|  | 247 | \brief Persistance management */ | 
|---|
| [763] | 248 | inline PInPersist& operator >> (PInPersist& is, Histo2D & obj) | 
|---|
|  | 249 | { ObjFileIO<Histo2D> fio(&obj);  fio.Read(is);  return(is); } | 
|---|
|  | 250 |  | 
|---|
|  | 251 | // Classe pour la gestion de persistance | 
|---|
|  | 252 | // ObjFileIO<Histo2D> | 
|---|
|  | 253 |  | 
|---|
| [1092] | 254 | /*! \ingroup HiStats \fn operator*(const Histo2D&,r_8) | 
|---|
| [1053] | 255 | \brief Operateur H2 = H1 * b */ | 
|---|
| [1092] | 256 | inline Histo2D operator * (const Histo2D& a, r_8 b) | 
|---|
| [1053] | 257 | { | 
|---|
|  | 258 | Histo2D result(a); | 
|---|
|  | 259 | return (result *= b); | 
|---|
|  | 260 | } | 
|---|
|  | 261 |  | 
|---|
| [1092] | 262 | /*! \ingroup HiStats \fn operator*(r_8,const Histo2D&) | 
|---|
| [1053] | 263 | \brief Operateur H2 = b * H1 */ | 
|---|
| [1092] | 264 | inline Histo2D operator * (r_8 b, const Histo2D& a) | 
|---|
| [1053] | 265 | { | 
|---|
|  | 266 | Histo2D result(a); | 
|---|
|  | 267 | return (result *= b); | 
|---|
|  | 268 | } | 
|---|
|  | 269 |  | 
|---|
| [1092] | 270 | /*! \ingroup HiStats \fn operator/(const Histo2D&,r_8) | 
|---|
| [1053] | 271 | \brief Operateur H2 = H1 / b */ | 
|---|
| [1092] | 272 | inline Histo2D operator / (const Histo2D& a, r_8 b) | 
|---|
| [1053] | 273 | { | 
|---|
|  | 274 | Histo2D result(a); | 
|---|
|  | 275 | return (result /= b); | 
|---|
|  | 276 | } | 
|---|
|  | 277 |  | 
|---|
| [1092] | 278 | /*! \ingroup HiStats \fn operator+(const Histo2D&,r_8) | 
|---|
| [1053] | 279 | \brief Operateur H2 = H1 + b */ | 
|---|
| [1092] | 280 | inline Histo2D operator + (const Histo2D& a, r_8 b) | 
|---|
| [1053] | 281 | { | 
|---|
|  | 282 | Histo2D result(a); | 
|---|
|  | 283 | return (result += b); | 
|---|
|  | 284 | } | 
|---|
|  | 285 |  | 
|---|
| [1092] | 286 | /*! \ingroup HiStats \fn operator+(r_8,const Histo2D&) | 
|---|
| [1053] | 287 | \brief Operateur H2 = b + H1 */ | 
|---|
| [1092] | 288 | inline Histo2D operator + (r_8 b, const Histo2D& a) | 
|---|
| [1053] | 289 | { | 
|---|
|  | 290 | Histo2D result(a); | 
|---|
|  | 291 | return (result += b); | 
|---|
|  | 292 | } | 
|---|
|  | 293 |  | 
|---|
| [1092] | 294 | /*! \ingroup HiStats \fn operator-(const Histo2D&,r_8) | 
|---|
| [1053] | 295 | \brief Operateur H2 = H1 - b */ | 
|---|
| [1092] | 296 | inline Histo2D operator - (const Histo2D& a, r_8 b) | 
|---|
| [1053] | 297 | { | 
|---|
|  | 298 | Histo2D result(a); | 
|---|
|  | 299 | return (result -= b); | 
|---|
|  | 300 | } | 
|---|
|  | 301 |  | 
|---|
| [1092] | 302 | /*! \ingroup HiStats \fn operator-(r_8,const Histo2D&) | 
|---|
| [1053] | 303 | \brief Operateur H2 = b - H1 */ | 
|---|
| [1092] | 304 | inline Histo2D operator - (r_8 b, const Histo2D& a) | 
|---|
| [1053] | 305 | { | 
|---|
|  | 306 | Histo2D result(a); | 
|---|
|  | 307 | result *= -1.; | 
|---|
|  | 308 | return (result += b); | 
|---|
|  | 309 | } | 
|---|
|  | 310 |  | 
|---|
|  | 311 | /*! \ingroup HiStats \fn operator+(const Histo2D&,const Histo2D&) | 
|---|
|  | 312 | \brief Operateur H = H1 + H2 */ | 
|---|
|  | 313 |  | 
|---|
|  | 314 | inline Histo2D operator + (const Histo2D& a, const Histo2D& b) | 
|---|
|  | 315 | { | 
|---|
|  | 316 | if (b.NBinX()!=a.NBinX() || b.NBinY()!=a.NBinY()) THROW(sizeMismatchErr); | 
|---|
|  | 317 | Histo2D c(a); | 
|---|
|  | 318 | return (c += b); | 
|---|
|  | 319 | } | 
|---|
|  | 320 |  | 
|---|
|  | 321 | /*! \ingroup HiStats \fn operator-(const Histo2D&,const Histo2D&) | 
|---|
|  | 322 | \brief Operateur H = H1 - H2 */ | 
|---|
|  | 323 | inline Histo2D operator - (const Histo2D& a, const Histo2D& b) | 
|---|
|  | 324 | { | 
|---|
|  | 325 | if (b.NBinX()!=a.NBinX() || b.NBinY()!=a.NBinY()) THROW(sizeMismatchErr); | 
|---|
|  | 326 | Histo2D c(a); | 
|---|
|  | 327 | return (c -= b); | 
|---|
|  | 328 | } | 
|---|
|  | 329 |  | 
|---|
|  | 330 | /*! \ingroup HiStats \fn operator*(const Histo2D&,const Histo2D&) | 
|---|
|  | 331 | \brief Operateur H = H1 * H2 */ | 
|---|
|  | 332 | inline Histo2D operator * (const Histo2D& a, const Histo2D& b) | 
|---|
|  | 333 | { | 
|---|
|  | 334 | if (b.NBinX()!=a.NBinX() || b.NBinY()!=a.NBinY()) THROW(sizeMismatchErr); | 
|---|
|  | 335 | Histo2D c(a); | 
|---|
|  | 336 | return (c *= b); | 
|---|
|  | 337 | } | 
|---|
|  | 338 |  | 
|---|
|  | 339 | /*! \ingroup HiStats \fn operator/(const Histo2D&,const Histo2D&) | 
|---|
|  | 340 | \brief Operateur H = H1 / H2 */ | 
|---|
|  | 341 | inline Histo2D operator / (const Histo2D& a, const Histo2D& b) | 
|---|
|  | 342 | { | 
|---|
|  | 343 | if (b.NBinX()!=a.NBinX() || b.NBinY()!=a.NBinY()) THROW(sizeMismatchErr); | 
|---|
|  | 344 | Histo2D c(a); | 
|---|
|  | 345 | return (c /= b); | 
|---|
|  | 346 | } | 
|---|
|  | 347 |  | 
|---|
| [763] | 348 | } // Fin du namespace | 
|---|
|  | 349 |  | 
|---|
|  | 350 | #endif // HISTOS2_SEEN | 
|---|