Changeset 3044 in Sophya for trunk/SophyaLib/HiStats


Ignore:
Timestamp:
Aug 7, 2006, 7:38:47 PM (19 years ago)
Author:
cmv
Message:

ReCenterBin deplace methode Histo (was HistErr) cmv 7/8/2006

Location:
trunk/SophyaLib/HiStats
Files:
4 edited

Legend:

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

    r2868 r3044  
    115115if(n>0) for(int_4 i=0;i<n;i++) mNData[i] = v(i);
    116116return;
    117 }
    118 
    119 /********* Methode *********/
    120 /*!
    121  Recompute XMin and XMax so that
    122  the CENTER of the first bin is exactly XMin and
    123  the CENTER of the last bin is exactly XMax.
    124  Remember that otherwise
    125  XMin is the beginning of the first bin
    126  and XMax is the end of the last bin
    127 */
    128 void HistoErr::ReCenterBin(void)
    129 {
    130  if(mBins<=1) return;
    131  double dx = (mMax-mMin)/(mBins-1);
    132  mMin -= dx/2.;
    133  mMax += dx/2.;
    134  binWidth = (mMax-mMin)/mBins;
    135117}
    136118
  • trunk/SophyaLib/HiStats/histerr.h

    r2819 r3044  
    6363  void PutNBin(TVector<r_8>& v);
    6464
    65   //! Re-center bin abscissa
    66   void ReCenterBin(void);
    6765  //! Compute the correlation histogram
    6866  void ToCorrel(void);
  • trunk/SophyaLib/HiStats/histos.cc

    r2868 r3044  
    11//
    2 // $Id: histos.cc,v 1.21 2006-01-03 14:20:23 ansari Exp $
     2// $Id: histos.cc,v 1.22 2006-08-07 17:38:47 cmv Exp $
    33//
    44
     
    109109 if(mErr2==NULL) mErr2 = new r_8[mBins];
    110110 memset(mErr2,0,mBins*sizeof(r_8));
     111}
     112
     113/********* Methode *********/
     114/*!
     115 Recompute XMin and XMax so that
     116 the CENTER of the first bin is exactly XMin and
     117 the CENTER of the last bin is exactly XMax.
     118 Remember that otherwise
     119 XMin is the beginning of the first bin
     120 and XMax is the end of the last bin
     121*/
     122void Histo::ReCenterBin(void)
     123{
     124 if(mBins<=1) return;
     125 double dx = (mMax-mMin)/(mBins-1);
     126 mMin -= dx/2.;
     127 mMax += dx/2.;
     128 binWidth = (mMax-mMin)/mBins;
    111129}
    112130
  • trunk/SophyaLib/HiStats/histos.h

    r2630 r3044  
    11// This may look like C code, but it is really -*- C++ -*-
    22//
    3 // $Id: histos.h,v 1.20 2004-10-26 16:26:39 cmv Exp $
     3// $Id: histos.h,v 1.21 2006-08-07 17:38:47 cmv Exp $
    44//
    55
     
    3030
    3131  // OPTIONS
    32   void Errors();
     32  void Errors(void);
     33  void ReCenterBin(void);
    3334
    3435  // UPDATING or SETTING
    35   void Zero();
     36  void Zero(void);
    3637  void Add(r_8 x, r_8 w);
    3738  inline void Add(r_8 x) {Add(x,1.);}
Note: See TracChangeset for help on using the changeset viewer.