Changeset 3198 in Sophya for trunk/SophyaLib/HiStats


Ignore:
Timestamp:
Apr 3, 2007, 5:15:11 PM (18 years ago)
Author:
cmv
Message:

add methods Sum(),Sum2(),SumN() in HistoErr cmv 03/04/2007

Location:
trunk/SophyaLib/HiStats
Files:
2 edited

Legend:

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

    r3156 r3198  
    193193/********* Methode *********/
    194194/*!
     195  Return the sum of bin value
     196*/
     197double HistoErr::Sum(void)
     198{
     199 double s = 0.;
     200 for(int_4 i=0;i<nx_;i++) {
     201   if(ndata_(i)<1.) continue;
     202   s += data_(i);
     203 }
     204 return s;
     205}
     206
     207/********* Methode *********/
     208/*!
     209  Return the sum of the bin value squared
     210*/
     211double HistoErr::Sum2(void)
     212{
     213 double s = 0.;
     214 for(int_4 i=0;i<nx_;i++) {
     215   if(ndata_(i)<1.) continue;
     216   s += data_(i)*data_(i);
     217 }
     218 return s;
     219}
     220
     221/********* Methode *********/
     222/*!
     223  Return the sum of the number of entries
     224*/
     225double HistoErr::SumN(void)
     226{
     227 double s = 0.;
     228 for(int_4 i=0;i<nx_;i++) {
     229   if(ndata_(i)<1.) continue;
     230   s += ndata_(i);
     231 }
     232 return s;
     233}
     234
     235/********* Methode *********/
     236/*!
    195237  Operateur egal HistoErr = HistoErr
    196238*/
  • trunk/SophyaLib/HiStats/histerr.h

    r3156 r3198  
    136136  void GetNData(TVector<r_8>& ndata) {ndata = ndata_;}
    137137
     138  //! Recuperation d'information
     139  double Sum(void);
     140  double Sum2(void);
     141  double SumN(void);
     142
    138143  // Operators
    139144  HistoErr& operator = (const HistoErr& h);
Note: See TracChangeset for help on using the changeset viewer.