Changeset 3147 in Sophya for trunk/SophyaLib/HiStats/hist2err.h


Ignore:
Timestamp:
Jan 18, 2007, 7:20:16 PM (19 years ago)
Author:
cmv
Message:

correct bug, intro ToVariance et changement nom ToCorrel->ToMean cmv 18/01/2007

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaLib/HiStats/hist2err.h

    r3136 r3147  
    8383    {i=(int_4) floor((x-xmin_)/dx_); j=(int_4) floor((y-ymin_)/dy_);}
    8484
    85   //! Addition du contenu de l'histo pour abscisse x poids w et l'erreur e
     85  //! Addition du contenu de l'histo pour abscisse x poids w et l'erreur e2
    8686  inline void Add(r_8 x, r_8 y, r_8 w, r_8 e)
    8787    {
     
    9090    data_(i,j) += w; ndata_(i,j) += 1.; err2_(i,j) += e*e;
    9191    }
    92   inline void Add(r_8 x,r_8 y, r_8 w) {Add(x,y,w,1.);}
    93   inline void Add(r_8 x,r_8 y) {Add(x,y,1.,1.);}
     92  inline void Add(r_8 x,r_8 y, r_8 w) {Add(x,y,w,w);}
    9493
    9594  //! Addition du contenu de l'histo pour le bin numBin poids w et l'erreur e
     
    9998    data_(i,j) += w; ndata_(i,j) += 1.; err2_(i,j) += e*e;
    10099    }
    101   inline void AddBin(int_4 i,int_4 j, r_8 w) {AddBin(i,j,w,1.);}
    102   inline void AddBin(int_4 i,int_4 j) {AddBin(i,j,1.,1.);}
     100  inline void AddBin(int_4 i,int_4 j, r_8 w) {AddBin(i,j,w,w);}
    103101
    104102  //! remplissage contenu de l'histo pour le bin i poids w et l'erreur e
     
    110108    ndata_(i,j) = nb;
    111109    }
    112   inline void SetBin(int_4 i,int_4 j, r_8 w, r_8 e) {SetBin(i,j,w,e,1.);}
    113   inline void SetBin(int_4 i,int_4 j, r_8 w) {SetBin(i,j,w,1.,1.);}
    114   inline void SetBin(int_4 i,int_4 j) {SetBin(i,j,1.,1.,1.);}
     110  //! remplissage de la valeur pour le bin i
     111  inline void SetBin(int_4 i,int_4 j, r_8 w)
     112    {
     113    if(i<0 || i>=nx_ || j<0 || j>=ny_) return;
     114    data_(i,j) = w;
     115    }
    115116  //! remplissage de l'erreur carree pour le bin i
    116117  void SetErr2(int_4 i,int_4 j, r_8 e2)
     
    126127    }
    127128
    128   //! Compute the correlation histogram
    129   void ToCorrel(void);
    130   void FromCorrel(void);
    131   int_4 NCorrel(void) {return mCorrel;}
    132   void SetCorrel(int_4 mcorrel) {mCorrel = mcorrel;}
     129  //! Compute the Mean histogram
     130  void ToMean(void);
     131  void FromMean(void);
     132  int_4 NMean(void) {return mMean;}
     133  void SetMean(int_4 nmean) {mMean = nmean;}
     134
     135  //! Replace the errors by the variance
     136  void ToVariance(void);
     137  void FromVariance(void);
    133138
    134139  //! Fill an histogram with an histogram
     
    156161  TMatrix<r_8> err2_;
    157162  TMatrix<r_8> ndata_;
    158   int_4 mCorrel;  //!< Nombre d'appels a ToCorrel(+1) ou FromCorrel(-1)
     163  int_4 mMean;  //!< Nombre d'appels a ToMean/Variance(+1) ou FromMean/Variance(-1)
    159164};
    160165
Note: See TracChangeset for help on using the changeset viewer.