Changeset 2507 in Sophya for trunk/SophyaLib/HiStats/histos.cc


Ignore:
Timestamp:
Mar 15, 2004, 5:47:21 PM (22 years ago)
Author:
ansari
Message:

Remplacement THROW par throw et suppression END_CONSTRUCTOR - Reza 15/03/2004

File:
1 edited

Legend:

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

    r2341 r2507  
    11//
    2 // $Id: histos.cc,v 1.16 2003-03-10 14:10:24 ansari Exp $
     2// $Id: histos.cc,v 1.17 2004-03-15 16:47:20 ansari Exp $
    33//
    44
     
    2626  binWidth(0)
    2727{
    28  END_CONSTRUCTOR
    2928}
    3029
     
    3938{
    4039  Zero();
    41   END_CONSTRUCTOR
    4240}
    4341
     
    5250{
    5351  Zero();
    54   END_CONSTRUCTOR
    5552}
    5653
     
    7168    }
    7269  }
    73   END_CONSTRUCTOR
    7470}
    7571
     
    168164Histo& Histo::operator /= (r_8 b)
    169165{
    170 if (b==0.) THROW(inconsistentErr);
     166if (b==0.) throw ParmError(PExcLongMessage(""));
    171167r_8 b2 = b*b;
    172168for(int_4 i=0;i<mBins;i++) {
     
    213209Histo& Histo::operator += (const Histo& a)
    214210{
    215 if(mBins!=a.mBins) THROW(sizeMismatchErr);
     211if(mBins!=a.mBins) throw SzMismatchError(PExcLongMessage(""));
    216212for(int_4 i=0;i<mBins;i++) {
    217213  mData[i] += a(i);
     
    231227Histo& Histo::operator -= (const Histo& a)
    232228{
    233 if(mBins!=a.mBins) THROW(sizeMismatchErr);
     229if(mBins!=a.mBins) throw SzMismatchError(PExcLongMessage(""));
    234230for(int_4 i=0;i<mBins;i++) {
    235231  mData[i] -= a(i);
     
    249245Histo& Histo::operator *= (const Histo& a)
    250246{
    251 if(mBins!=a.mBins) THROW(sizeMismatchErr);
     247if(mBins!=a.mBins) throw SzMismatchError(PExcLongMessage(""));
    252248nHist = 0.;
    253249for(int_4 i=0;i<mBins;i++) {
     
    269265Histo& Histo::operator /= (const Histo& a)
    270266{
    271 if(mBins!=a.mBins) THROW(sizeMismatchErr);
     267if(mBins!=a.mBins) throw SzMismatchError(PExcLongMessage(""));
    272268nHist = 0.;
    273269for(int_4 i=0;i<mBins;i++) {
     
    339335void Histo::PutValue(TVector<r_8> &v, int_4 ierr)
    340336{
    341 //if(v.NElts()<(uint_4) mBins) THROW(sizeMismatchErr);
     337//if(v.NElts()<(uint_4) mBins) throw SzMismatchError(PExcLongMessage(""));
    342338uint_4 n = (v.NElts()<(uint_4) mBins) ? v.NElts(): (uint_4) mBins;
    343339if(n>0) for(uint_4 i=0;i<n;i++) {
     
    353349void Histo::PutValueAdd(TVector<r_8> &v, int_4 ierr)
    354350{
    355 //if(v.NElts()<(uint_4) mBins) THROW(sizeMismatchErr);
     351//if(v.NElts()<(uint_4) mBins) throw SzMismatchError(PExcLongMessage(""));
    356352uint_4 n = (v.NElts()<(uint_4) mBins) ? v.NElts(): (uint_4) mBins;
    357353if(n>0) for(uint_4 i=0;i<n;i++) {
     
    367363void Histo::PutError2(TVector<r_8> &v)
    368364{
    369 //if(v.NElts()<(uint_4) mBins) THROW(sizeMismatchErr);
     365//if(v.NElts()<(uint_4) mBins) throw SzMismatchError(PExcLongMessage(""));
    370366uint_4 n = (v.NElts()<(uint_4) mBins) ? v.NElts(): (uint_4) mBins;
    371367if(n>0) {
     
    381377void Histo::PutError2Add(TVector<r_8> &v)
    382378{
    383 //if(v.NElts()<(uint_4) mBins) THROW(sizeMismatchErr);
     379//if(v.NElts()<(uint_4) mBins) throw SzMismatchError(PExcLongMessage(""));
    384380uint_4 n = (v.NElts()<(uint_4) mBins) ? v.NElts(): (uint_4) mBins;
    385381if(n>0) {
     
    395391void Histo::PutError(TVector<r_8> &v)
    396392{
    397 //if(v.NElts()<(uint_4) mBins) THROW(sizeMismatchErr);
     393//if(v.NElts()<(uint_4) mBins) throw SzMismatchError(PExcLongMessage(""));
    398394uint_4 n = (v.NElts()<(uint_4) mBins) ? v.NElts(): (uint_4) mBins;
    399395if(n>0) {
     
    955951    cout<<"Histo::FitMax : Nb Entrees histo ="<<NEntries()<<endl;
    956952
    957   if (NEntries() < 1) THROW(inconsistentErr);
     953  if (NEntries() < 1) throw ParmError(PExcLongMessage(""));
    958954
    959955  int_4 iMax = IMax();
     
    10211017    for(k=0;k<nLowHigh;k++) cout<<" "<<e2Fit(k); cout<<endl;
    10221018  }
    1023   if( ii != nLowHigh ) THROW(inconsistentErr);
     1019  if( ii != nLowHigh ) throw ParmError(PExcLongMessage(""));
    10241020  Poly pol(degree);
    10251021  TRY {
     
    10491045    // on est dans le cas d'un fit de parabole
    10501046    r_8 r=0;
    1051     if (pol.Root1(r)==0) THROW(inconsistentErr);
     1047    if (pol.Root1(r)==0) throw ParmError(PExcLongMessage(""));
    10521048    fd = r + xCenter;
    10531049  } else if (DPolDeg == 2) {
     
    10551051    r_8 r1=0;
    10561052    r_8 r2=0;
    1057     if (pol.Root2(r1,r2) == 0) THROW(inconsistentErr);
     1053    if (pol.Root2(r1,r2) == 0) throw ParmError(PExcLongMessage(""));
    10581054    pol.Derivate();
    10591055    fd = (pol(r1)<0) ? r1 + xCenter : r2 + xCenter;
    10601056  } else {
    10611057    // on est dans un cas non prevu
    1062     THROW(inconsistentErr);
     1058    throw ParmError(PExcLongMessage(""));
    10631059  }
    10641060
     
    11041100         << " , nbin= " << NBins() << endl;
    11051101
    1106   if (NEntries() < 1) THROW(inconsistentErr);
    1107   if (NBins() < 3) THROW(inconsistentErr);
     1102  if (NEntries() < 1) throw ParmError(PExcLongMessage(""));
     1103  if (NBins() < 3) throw ParmError(PExcLongMessage(""));
    11081104
    11091105  int_4 iMax = FindBin(xmax);
    1110   if (iMax<0 || iMax>=NBins()) THROW(inconsistentErr);
     1106  if (iMax<0 || iMax>=NBins()) throw ParmError(PExcLongMessage(""));
    11111107  r_8 hmax = mData[iMax];
    11121108  r_8 limit = frac*hmax;
Note: See TracChangeset for help on using the changeset viewer.