Changeset 3307 in Sophya for trunk/SophyaLib/HiStats


Ignore:
Timestamp:
Aug 22, 2007, 10:26:33 AM (18 years ago)
Author:
cmv
Message:

methode ReCenterBinW binwidth kept, number of bin incresed cmv 22/08/2007

Location:
trunk/SophyaLib/HiStats
Files:
4 edited

Legend:

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

    r3247 r3307  
    1818/*! Constructeur par defaut */
    1919Histo2DErr::Histo2DErr(void)
    20 : xmin_(1.), xmax_(-1.), nx_(0), dx_(0.)
    21 , ymin_(1.), ymax_(-1.), ny_(0), dy_(0.)
    22 , mMean(0)
     20: xmin_(1.), xmax_(-1.), dx_(0.)
     21, ymin_(1.), ymax_(-1.), dy_(0.)
     22, nx_(0), ny_(0), mMean(0)
    2323{
    2424}
     
    8787 XMin (YMin) is the beginning of the first bin
    8888 and XMax (YMax) is the end of the last bin
     89 WARNING: number of bins is kept, bin width is changed
    8990*/
    9091void Histo2DErr::ReCenterBinX(void)
     
    110111 ReCenterBinX();
    111112 ReCenterBinY();
     113}
     114
     115/********* Methode *********/
     116/*!
     117 Recompute XMin (YMin) and XMax (YMax) so that
     118 the CENTER of the first bin is exactly XMin (YMin) and
     119 the CENTER of the last bin is exactly XMax (YMax).
     120 Remember that otherwise
     121 XMin (YMin) is the beginning of the first bin
     122 and XMax (YMax) is the end of the last bin
     123 WARNING: bin widths are kept, numbers of bins are increased by 1
     124*/
     125void Histo2DErr::ReCenterBinW(void)
     126{
     127 CreateOrResize(xmin_-dx_/2.,xmax_+dx_/2.,nx_+1,ymin_-dy_/2.,ymax_+dy_/2.,ny_+1);
    112128}
    113129
  • trunk/SophyaLib/HiStats/hist2err.h

    r3184 r3307  
    2828  void ReCenterBinY(void);
    2929  void ReCenterBin(void);
     30  void ReCenterBinW(void);
    3031  void Zero(void);
    3132
  • trunk/SophyaLib/HiStats/histerr.cc

    r3247 r3307  
    1818/*! Constructeur par defaut */
    1919HistoErr::HistoErr(void)
    20 : xmin_(1.), xmax_(-1.), nx_(0), dx_(0.)
    21 , mMean(0)
     20: xmin_(1.), xmax_(-1.), dx_(0.), nx_(0), mMean(0)
    2221{
    2322}
     
    7877/********* Methode *********/
    7978/*!
    80  Recompute XMin (and XMax so that
     79 Recompute XMin and XMax so that
    8180 the CENTER of the first bin is exactly XMin and
    8281 the CENTER of the last bin is exactly XMax.
     
    8483 XMin is the beginning of the first bin
    8584 and XMax is the end of the last bin
     85 WARNING: number of bins is kept, bin width is changed
    8686*/
    8787void HistoErr::ReCenterBin(void)
     
    9292 xmax_ += dx/2.;
    9393 dx_ = (xmax_-xmin_)/nx_;
     94}
     95
     96/********* Methode *********/
     97/*!
     98 Recompute XMin and XMax so that
     99 the CENTER of the first bin is exactly XMin and
     100 the CENTER of the last bin is exactly XMax.
     101 Remember that otherwise
     102 XMin is the beginning of the first bin
     103 and XMax is the end of the last bin
     104 WARNING: bin width is kept, number of bins is increased by 1
     105*/
     106void HistoErr::ReCenterBinW(void)
     107{
     108 if(nx_<=1) return;
     109 CreateOrResize(xmin_-dx_/2.,xmax_+dx_/2.,nx_+1);
    94110}
    95111
  • trunk/SophyaLib/HiStats/histerr.h

    r3198 r3307  
    2727  //! Updating or Setting
    2828  void ReCenterBin(void);
     29  void ReCenterBinW(void);
    2930  void Zero(void);
    3031
Note: See TracChangeset for help on using the changeset viewer.