Changeset 3119 in Sophya for trunk/SophyaLib/HiStats


Ignore:
Timestamp:
Dec 21, 2006, 4:43:15 PM (19 years ago)
Author:
cmv
Message:

intro de ReCenterBin/X/Y() cmv 21/12/06

Location:
trunk/SophyaLib/HiStats
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaLib/HiStats/histos2.cc

    r3060 r3119  
    205205 memset(mErr2,0,mNxy*sizeof(r_8));
    206206}
     207
     208///////////////////////////////////////////////////////////////////
     209/*!
     210 Recompute XMin (YMin) and XMax (YMax) so that
     211 the CENTER of the first bin is exactly XMin (YMin) and
     212 the CENTER of the last bin is exactly XMax (YMax).
     213 Remember that otherwise
     214 XMin (YMin) is the beginning of the first bin
     215 and XMax (YMax) is the end of the last bin
     216*/
     217void Histo2D::ReCenterBinX(void)
     218{
     219 if(mNx<=1) return;
     220 double dx = (mXmax-mXmin)/(mNx-1);
     221 mXmin -= dx/2.;
     222 mXmax += dx/2.;
     223 mWBinx = (mXmax-mXmin)/mNx;
     224}
     225
     226void Histo2D::ReCenterBinY(void)
     227{
     228 if(mNy<=1) return;
     229 double dy = (mYmax-mYmin)/(mNy-1);
     230 mYmin -= dy/2.;
     231 mYmax += dy/2.;
     232 mWBiny = (mYmax-mYmin)/mNy;
     233}
     234
     235void Histo2D::ReCenterBin(void)
     236{
     237 ReCenterBinX();
     238 ReCenterBinY();
     239}
     240
    207241
    208242///////////////////////////////////////////////////////////////////
  • trunk/SophyaLib/HiStats/histos2.h

    r3060 r3119  
    3737
    3838  // OPTIONS
    39   void Errors(); 
    40  
     39  void Errors();
     40  void ReCenterBinX(void);
     41  void ReCenterBinY(void);
     42  void ReCenterBin(void);
     43
    4144  // UPDATING
    4245  void Zero();
Note: See TracChangeset for help on using the changeset viewer.