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