Changeset 2507 in Sophya for trunk/SophyaLib/HiStats


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

Location:
trunk/SophyaLib/HiStats
Files:
7 edited

Legend:

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

    r2341 r2507  
    2020, SumY(NULL), SumY2(NULL), SumW(NULL), Ok(false), YMin(1.), YMax(-1.), Opt(0)
    2121{
    22  END_CONSTRUCTOR
    2322}
    2423
     
    4039  Histo::Errors();
    4140  Zero();
    42   END_CONSTRUCTOR
    4341}
    4442
     
    5654  Histo::Errors();
    5755  Zero();
    58   END_CONSTRUCTOR
    5956}
    6057
     
    7673  }
    7774  UpdateHisto();
    78   END_CONSTRUCTOR
    7975}
    8076
     
    251247HProf& HProf::operator += (const HProf& a)
    252248{
    253 if(mBins!=a.mBins) THROW(sizeMismatchErr);
     249if(mBins!=a.mBins) throw SzMismatchError(PExcLongMessage(""));
    254250Histo *hthis = (Histo *) this;
    255251*hthis += (Histo) a;
  • trunk/SophyaLib/HiStats/hisprof.h

    r2479 r2507  
    9898inline HProf operator + (const HProf& a, const HProf& b)
    9999{
    100 if (b.NBins()!=a.NBins()) THROW(sizeMismatchErr);
     100if (b.NBins()!=a.NBins()) throw SzMismatchError("HProf::operator +");
    101101HProf c(a);
    102102return (c += b);
  • 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;
  • trunk/SophyaLib/HiStats/histos.h

    r2479 r2507  
    11// This may look like C code, but it is really -*- C++ -*-
    22//
    3 // $Id: histos.h,v 1.17 2003-12-06 23:58:17 ansari Exp $
     3// $Id: histos.h,v 1.18 2004-03-15 16:47:20 ansari Exp $
    44//
    55
     
    240240inline Histo operator + (const Histo& a, const Histo& b)
    241241{
    242 if (b.NBins()!=a.NBins()) THROW(sizeMismatchErr);
     242if (b.NBins()!=a.NBins()) throw SzMismatchError(PExcLongMessage(""));
    243243Histo c(a);
    244244return (c += b);
     
    249249inline Histo operator - (const Histo& a, const Histo& b)
    250250{
    251 if (b.NBins()!=a.NBins()) THROW(sizeMismatchErr);
     251if (b.NBins()!=a.NBins()) throw SzMismatchError(PExcLongMessage(""));
    252252Histo c(a);
    253253return (c -= b);
     
    258258inline Histo operator * (const Histo& a, const Histo& b)
    259259{
    260 if (b.NBins()!=a.NBins()) THROW(sizeMismatchErr);
     260if (b.NBins()!=a.NBins()) throw SzMismatchError(PExcLongMessage(""));
    261261Histo c(a);
    262262return (c *= b);
     
    267267inline Histo operator / (const Histo& a, const Histo& b)
    268268{
    269 if (b.NBins()!=a.NBins()) THROW(sizeMismatchErr);
     269if (b.NBins()!=a.NBins()) throw SzMismatchError(PExcLongMessage(""));
    270270Histo c(a);
    271271return (c /= b);
  • trunk/SophyaLib/HiStats/histos2.cc

    r2341 r2507  
    5454Zero();
    5555mB_s.H = NULL;
    56 END_CONSTRUCTOR
    5756}
    5857
     
    7372Zero();
    7473mB_s.H = NULL;
    75 END_CONSTRUCTOR
    7674}
    7775
     
    140138}
    141139
    142 END_CONSTRUCTOR
    143140}
    144141
     
    156153for(int_4 i=0;i<3;i++) for(int_4 j=0;j<3;j++) mOver[i][j]=0.;
    157154mB_s.H = NULL;
    158 END_CONSTRUCTOR
    159155}
    160156
     
    332328{
    333329int_4 i,j;
    334 if (b==0.) THROW(inconsistentErr);
     330if (b==0.) throw ParmError("Histo2D::operator / (0) ");
    335331r_8 b2 = b*b;
    336332for(i=0;i<mNxy;i++) {
     
    412408{
    413409int_4 i,j;
    414 if(mNx!=a.mNx || mNy!=a.mNy) THROW(sizeMismatchErr);
     410if(mNx!=a.mNx || mNy!=a.mNy) throw SzMismatchError("Histo2D::operator += ");
    415411for(i=0;i<mNxy;i++) {
    416412  mData[i] += a.mData[i];
     
    435431{
    436432int_4 i,j;
    437 if(mNx!=a.mNx || mNy!=a.mNy) THROW(sizeMismatchErr);
     433if(mNx!=a.mNx || mNy!=a.mNy) throw SzMismatchError("Histo2D::operator -= ");
    438434for(i=0;i<mNxy;i++) {
    439435  mData[i] -= a.mData[i];
     
    458454{
    459455int_4 i,j;
    460 if(mNx!=a.mNx || mNy!=a.mNy) THROW(sizeMismatchErr);
     456if(mNx!=a.mNx || mNy!=a.mNy) throw SzMismatchError("Histo2D::operator *= ");
    461457nHist = 0.;
    462458for(i=0;i<mNxy;i++) {
     
    483479{
    484480int_4 i,j;
    485 if(mNx!=a.mNx || mNy!=a.mNy) THROW(sizeMismatchErr);
     481if(mNx!=a.mNx || mNy!=a.mNy) throw SzMismatchError("Histo2D::operator /= ");
    486482nHist = 0.;
    487483for(i=0;i<mNxy;i++) {
     
    575571void Histo2D::PutValue(TMatrix<r_8> &v, int_4 ierr)
    576572{
    577 //if(v.NRows()!=(uint_4)mNx || v.NCol()!=(uint_4)mNy) THROW(sizeMismatchErr);
     573//if(v.NRows()!=(uint_4)mNx || v.NCol()!=(uint_4)mNy) throw SzMismatchError("Histo2D::PutValue()");
    578574uint_4 nnx = (v.NRows()<(uint_4)mNx)? v.NRows(): (uint_4)mNx;
    579575uint_4 nny = (v.NCol() <(uint_4)mNy)? v.NCol() : (uint_4)mNy;
     
    590586void Histo2D::PutValueAdd(TMatrix<r_8> &v, int_4 ierr)
    591587{
    592 //if(v.NRows()!=(uint_4)mNx || v.NCol()!=(uint_4)mNy) THROW(sizeMismatchErr);
     588//if(v.NRows()!=(uint_4)mNx || v.NCol()!=(uint_4)mNy) throw SzMismatchError("Histo2D::PutValueAdd ");
    593589uint_4 nnx = (v.NRows()<(uint_4)mNx)? v.NRows(): (uint_4)mNx;
    594590uint_4 nny = (v.NCol() <(uint_4)mNy)? v.NCol() : (uint_4)mNy;
     
    606602void Histo2D::PutError2(TMatrix<r_8> &v)
    607603{
    608 //if(v.NRows()!=(uint_4)mNx || v.NCol()!=(uint_4)mNy) THROW(sizeMismatchErr);
     604//if(v.NRows()!=(uint_4)mNx || v.NCol()!=(uint_4)mNy) throw SzMismatchError("Histo2D::PutError2 ");
    609605uint_4 nnx = (v.NRows()<(uint_4)mNx)? v.NRows(): (uint_4)mNx;
    610606uint_4 nny = (v.NCol() <(uint_4)mNy)? v.NCol() : (uint_4)mNy;
     
    622618void Histo2D::PutError2Add(TMatrix<r_8> &v)
    623619{
    624 //if(v.NRows()!=(uint_4)mNx || v.NCol()!=(uint_4)mNy) THROW(sizeMismatchErr);
     620//if(v.NRows()!=(uint_4)mNx || v.NCol()!=(uint_4)mNy) throw SzMismatchError("Histo2D::PutError2Add ");
    625621uint_4 nnx = (v.NRows()<(uint_4)mNx)? v.NRows(): (uint_4)mNx;
    626622uint_4 nny = (v.NCol() <(uint_4)mNy)? v.NCol() : (uint_4)mNy;
     
    638634void Histo2D::PutError(TMatrix<r_8> &v)
    639635{
    640 //if(v.NRows()!=(uint_4)mNx || v.NCol()!=(uint_4)mNy) THROW(sizeMismatchErr);
     636//if(v.NRows()!=(uint_4)mNx || v.NCol()!=(uint_4)mNy) throw SzMismatchError("Histo2D::PutError ");
    641637uint_4 nnx = (v.NRows()<(uint_4)mNx)? v.NRows(): (uint_4)mNx;
    642638uint_4 nny = (v.NCol() <(uint_4)mNy)? v.NCol() : (uint_4)mNy;
  • trunk/SophyaLib/HiStats/histos2.h

    r2479 r2507  
    320320inline Histo2D operator + (const Histo2D& a, const Histo2D& b)
    321321{
    322 if (b.NBinX()!=a.NBinX() || b.NBinY()!=a.NBinY()) THROW(sizeMismatchErr);
     322if (b.NBinX()!=a.NBinX() || b.NBinY()!=a.NBinY()) throw SzMismatchError(PExcLongMessage(""));
    323323Histo2D c(a);
    324324return (c += b);
     
    329329inline Histo2D operator - (const Histo2D& a, const Histo2D& b)
    330330{
    331 if (b.NBinX()!=a.NBinX() || b.NBinY()!=a.NBinY()) THROW(sizeMismatchErr);
     331if (b.NBinX()!=a.NBinX() || b.NBinY()!=a.NBinY()) throw SzMismatchError(PExcLongMessage(""));
    332332Histo2D c(a);
    333333return (c -= b);
     
    338338inline Histo2D operator * (const Histo2D& a, const Histo2D& b)
    339339{
    340 if (b.NBinX()!=a.NBinX() || b.NBinY()!=a.NBinY()) THROW(sizeMismatchErr);
     340if (b.NBinX()!=a.NBinX() || b.NBinY()!=a.NBinY()) throw SzMismatchError(PExcLongMessage(""));
    341341Histo2D c(a);
    342342return (c *= b);
     
    347347inline Histo2D operator / (const Histo2D& a, const Histo2D& b)
    348348{
    349 if (b.NBinX()!=a.NBinX() || b.NBinY()!=a.NBinY()) THROW(sizeMismatchErr);
     349if (b.NBinX()!=a.NBinX() || b.NBinY()!=a.NBinY()) throw SzMismatchError(PExcLongMessage(""));
    350350Histo2D c(a);
    351351return (c /= b);
  • trunk/SophyaLib/HiStats/ntuple.cc

    r2341 r2507  
    8787mNames = NULL;
    8888mInfo = NULL;
    89 if (nvar <= 0)  THROW(sizeMismatchErr);
     89if (nvar <= 0)  throw ParmError("NTuple::NTuple(nvar<=0) ");
    9090mNVar = nvar;
    9191mVar = new r_4[nvar];
Note: See TracChangeset for help on using the changeset viewer.