Changeset 2628 in Sophya for trunk/SophyaLib/HiStats


Ignore:
Timestamp:
Oct 13, 2004, 6:41:33 PM (21 years ago)
Author:
cmv
Message:

NEntries goes from int_4 to uint_8 cmv 13/10/04

Location:
trunk/SophyaLib/HiStats
Files:
4 edited

Legend:

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

    r2627 r2628  
    185185/********* Methode *********/
    186186/*!
     187 Fill the histogram with an other histogram
     188*/
     189void HistoErr::FillFrHErr(HistoErr& hfrom)
     190{
     191 if(mBins<=0) return;
     192 if(hfrom.mBins<=0) return;
     193
     194 Zero();
     195
     196 for(int_4 i=0;i<hfrom.mBins;i++) {
     197   int numBin = FindBin(hfrom.BinCenter(i));
     198   if(numBin<0) mUnder += hfrom.mData[i];
     199   else if(numBin>=mBins) mOver += hfrom.mData[i];
     200   else {
     201     mData[numBin]  += hfrom.mData[i];
     202     mNData[numBin] += hfrom.mNData[i];
     203     mErr2[numBin]  += hfrom.mErr2[i];
     204     nHist          += hfrom.mData[i];
     205     nEntries++;
     206   }
     207 }
     208
     209}
     210
     211/********* Methode *********/
     212/*!
    187213  Operateur egal HistoErr = HistoErr
    188214*/
  • trunk/SophyaLib/HiStats/histerr.h

    r2627 r2628  
    4444  void ToCorrel(void);
    4545
     46  //! Fill an histogram with an histogram
     47  void FillFrHErr(HistoErr& hfrom);
     48
    4649  // Operators
    4750  HistoErr& operator = (const HistoErr& h);
  • trunk/SophyaLib/HiStats/histos.cc

    r2619 r2628  
    11//
    2 // $Id: histos.cc,v 1.19 2004-09-15 15:36:54 cmv Exp $
     2// $Id: histos.cc,v 1.20 2004-10-13 16:41:33 cmv Exp $
    33//
    44
     
    7575  mUnder = mOver = mMin = mMax = binWidth= 0.;
    7676  nHist = 0.;
    77   nEntries = mBins = 0;
     77  mBins = 0;
     78  nEntries = 0;
    7879}
    7980
     
    14461447// Lecture entete
    14471448is.GetLine(strg, 255);
     1449bool nentries_en_8_bytes=false;
     1450if(strg[0]=='V' && strg[1]=='_' && strg[2]=='2') nentries_en_8_bytes=true;
    14481451is.GetLine(strg, 255);
    14491452is.GetLine(strg, 255);
     
    14511454// Lecture des valeurs
    14521455is.Get(dobj->mBins);
    1453 is.Get(dobj->nEntries);
     1456if(nentries_en_8_bytes) is.Get(dobj->nEntries);
     1457 else {int_4 dum; is.Get(dum); dobj->nEntries=(uint_8)dum;}
    14541458int_4 errok;
    14551459is.Get(errok);
     
    14881492
    14891493// Ecriture entete pour identifier facilement
    1490 sprintf(strg,"mBins=%6d  NEnt=%15d  errok=%1d",dobj->mBins,dobj->nEntries,errok);
     1494sprintf(strg,"V_2 mBins=%6d  NEnt=%15d  errok=%1d",dobj->mBins,dobj->nEntries,errok);
    14911495os.PutLine(strg);
    14921496sprintf(strg,"binw=%g  mMin=%g mMax=%g",dobj->binWidth,dobj->mMin,dobj->mMax);
  • trunk/SophyaLib/HiStats/histos.h

    r2507 r2628  
    11// This may look like C code, but it is really -*- C++ -*-
    22//
    3 // $Id: histos.h,v 1.18 2004-03-15 16:47:20 ansari Exp $
     3// $Id: histos.h,v 1.19 2004-10-13 16:41:33 cmv Exp $
    44//
    55
     
    9696  inline r_8 NData() const            {return nHist;}
    9797  //! Retourne le nombre d'entrees
    98   inline r_8 NEntries() const         {return nEntries;}
     98  inline uint_8 NEntries() const         {return nEntries;}
    9999  //! Retourne le nombre d'overflow
    100100  inline r_8 NOver() const            {return mOver;}
     
    156156  r_8    mOver;    //!< overflow
    157157  r_8    nHist;    //!< somme ponderee des entrees
    158   int_4 nEntries; //!< nombre d'entrees
     158  uint_8 nEntries; //!< nombre d'entrees
    159159  int_4  mBins;    //!< nombre de bins
    160160  r_8    mMin;     //!< abscisse minimum
Note: See TracChangeset for help on using the changeset viewer.