Changeset 2604 in Sophya for trunk/SophyaLib/HiStats/histerr.cc


Ignore:
Timestamp:
Sep 3, 2004, 6:24:38 PM (21 years ago)
Author:
cmv
Message:

nouvelles methode dans HistoErr cmv 3/9/04

File:
1 edited

Legend:

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

    r2603 r2604  
    8383}
    8484
     85/********* Methode *********/
     86/*!
     87 Remplissage du contenu de l'histo pour le bin numBin poids w et l'erreur e
     88*/
     89void HistoErr::SetBin(int_4 numBin, r_8 w, r_8 e, uint_4 nb)
     90{
     91Histo::SetBin(numBin,w);
     92Histo::SetErr2(numBin,e*e);
     93SetNentB(numBin,nb);
     94return;
     95}
     96
     97/********* Methode *********/
     98/*!
     99 Remplissage nombre d'entrees pour le bin numBin
     100*/
     101void HistoErr::SetNentB(int_4 numBin, uint_4 nb)
     102{
     103 if(numBin>=0 && numBin<mBins) mNData[numBin] = nb;
     104return;
     105}
     106
    85107/*!
    86108  Remplissage d'un tableau avec les nombres d'entrees dans le bin de l'histo
     
    99121void HistoErr::PutNBin(TVector<int_4> &v)
    100122{
    101 uint_4 n = (v.NElts()<(uint_4) mBins) ? v.NElts(): (uint_4) mBins;
    102 if(n>0) for(uint_4 i=0;i<n;i++) mNData[i] = v(i);
    103 return;
     123int_4 n = (v.NElts()<mBins) ? v.NElts(): mBins;
     124if(n>0) for(int_4 i=0;i<n;i++) mNData[i] = v(i);
     125return;
     126}
     127
     128
     129/********* Methode *********/
     130/*!
     131  Compute the correlation histogram.
     132  Each bin content is divided by the number of entries in that bin.
     133  Each squared error is divided by the number of entries in that bin.
     134  The number of entries by bin is set to 1
     135*/
     136void HistoErr::ToCorrel(void)
     137{
     138 if(mBins<1) return;
     139 for(int_4 i=0;i<mBins;i++) {
     140   if(mNData[i]<1) continue;
     141   mData[i] /= (r_8) mNData[i];
     142   mErr2[i] /= (r_8) mNData[i];
     143   mNData[i] = 1;
     144 }
     145 return;
    104146}
    105147
Note: See TracChangeset for help on using the changeset viewer.