Changeset 2507 in Sophya for trunk/SophyaLib/HiStats
- Timestamp:
- Mar 15, 2004, 5:47:21 PM (22 years ago)
- Location:
- trunk/SophyaLib/HiStats
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaLib/HiStats/hisprof.cc
r2341 r2507 20 20 , SumY(NULL), SumY2(NULL), SumW(NULL), Ok(false), YMin(1.), YMax(-1.), Opt(0) 21 21 { 22 END_CONSTRUCTOR23 22 } 24 23 … … 40 39 Histo::Errors(); 41 40 Zero(); 42 END_CONSTRUCTOR43 41 } 44 42 … … 56 54 Histo::Errors(); 57 55 Zero(); 58 END_CONSTRUCTOR59 56 } 60 57 … … 76 73 } 77 74 UpdateHisto(); 78 END_CONSTRUCTOR79 75 } 80 76 … … 251 247 HProf& HProf::operator += (const HProf& a) 252 248 { 253 if(mBins!=a.mBins) THROW(sizeMismatchErr);249 if(mBins!=a.mBins) throw SzMismatchError(PExcLongMessage("")); 254 250 Histo *hthis = (Histo *) this; 255 251 *hthis += (Histo) a; -
trunk/SophyaLib/HiStats/hisprof.h
r2479 r2507 98 98 inline HProf operator + (const HProf& a, const HProf& b) 99 99 { 100 if (b.NBins()!=a.NBins()) THROW(sizeMismatchErr);100 if (b.NBins()!=a.NBins()) throw SzMismatchError("HProf::operator +"); 101 101 HProf c(a); 102 102 return (c += b); -
trunk/SophyaLib/HiStats/histos.cc
r2341 r2507 1 1 // 2 // $Id: histos.cc,v 1.1 6 2003-03-10 14:10:24ansari Exp $2 // $Id: histos.cc,v 1.17 2004-03-15 16:47:20 ansari Exp $ 3 3 // 4 4 … … 26 26 binWidth(0) 27 27 { 28 END_CONSTRUCTOR29 28 } 30 29 … … 39 38 { 40 39 Zero(); 41 END_CONSTRUCTOR42 40 } 43 41 … … 52 50 { 53 51 Zero(); 54 END_CONSTRUCTOR55 52 } 56 53 … … 71 68 } 72 69 } 73 END_CONSTRUCTOR74 70 } 75 71 … … 168 164 Histo& Histo::operator /= (r_8 b) 169 165 { 170 if (b==0.) THROW(inconsistentErr);166 if (b==0.) throw ParmError(PExcLongMessage("")); 171 167 r_8 b2 = b*b; 172 168 for(int_4 i=0;i<mBins;i++) { … … 213 209 Histo& Histo::operator += (const Histo& a) 214 210 { 215 if(mBins!=a.mBins) THROW(sizeMismatchErr);211 if(mBins!=a.mBins) throw SzMismatchError(PExcLongMessage("")); 216 212 for(int_4 i=0;i<mBins;i++) { 217 213 mData[i] += a(i); … … 231 227 Histo& Histo::operator -= (const Histo& a) 232 228 { 233 if(mBins!=a.mBins) THROW(sizeMismatchErr);229 if(mBins!=a.mBins) throw SzMismatchError(PExcLongMessage("")); 234 230 for(int_4 i=0;i<mBins;i++) { 235 231 mData[i] -= a(i); … … 249 245 Histo& Histo::operator *= (const Histo& a) 250 246 { 251 if(mBins!=a.mBins) THROW(sizeMismatchErr);247 if(mBins!=a.mBins) throw SzMismatchError(PExcLongMessage("")); 252 248 nHist = 0.; 253 249 for(int_4 i=0;i<mBins;i++) { … … 269 265 Histo& Histo::operator /= (const Histo& a) 270 266 { 271 if(mBins!=a.mBins) THROW(sizeMismatchErr);267 if(mBins!=a.mBins) throw SzMismatchError(PExcLongMessage("")); 272 268 nHist = 0.; 273 269 for(int_4 i=0;i<mBins;i++) { … … 339 335 void Histo::PutValue(TVector<r_8> &v, int_4 ierr) 340 336 { 341 //if(v.NElts()<(uint_4) mBins) THROW(sizeMismatchErr);337 //if(v.NElts()<(uint_4) mBins) throw SzMismatchError(PExcLongMessage("")); 342 338 uint_4 n = (v.NElts()<(uint_4) mBins) ? v.NElts(): (uint_4) mBins; 343 339 if(n>0) for(uint_4 i=0;i<n;i++) { … … 353 349 void Histo::PutValueAdd(TVector<r_8> &v, int_4 ierr) 354 350 { 355 //if(v.NElts()<(uint_4) mBins) THROW(sizeMismatchErr);351 //if(v.NElts()<(uint_4) mBins) throw SzMismatchError(PExcLongMessage("")); 356 352 uint_4 n = (v.NElts()<(uint_4) mBins) ? v.NElts(): (uint_4) mBins; 357 353 if(n>0) for(uint_4 i=0;i<n;i++) { … … 367 363 void Histo::PutError2(TVector<r_8> &v) 368 364 { 369 //if(v.NElts()<(uint_4) mBins) THROW(sizeMismatchErr);365 //if(v.NElts()<(uint_4) mBins) throw SzMismatchError(PExcLongMessage("")); 370 366 uint_4 n = (v.NElts()<(uint_4) mBins) ? v.NElts(): (uint_4) mBins; 371 367 if(n>0) { … … 381 377 void Histo::PutError2Add(TVector<r_8> &v) 382 378 { 383 //if(v.NElts()<(uint_4) mBins) THROW(sizeMismatchErr);379 //if(v.NElts()<(uint_4) mBins) throw SzMismatchError(PExcLongMessage("")); 384 380 uint_4 n = (v.NElts()<(uint_4) mBins) ? v.NElts(): (uint_4) mBins; 385 381 if(n>0) { … … 395 391 void Histo::PutError(TVector<r_8> &v) 396 392 { 397 //if(v.NElts()<(uint_4) mBins) THROW(sizeMismatchErr);393 //if(v.NElts()<(uint_4) mBins) throw SzMismatchError(PExcLongMessage("")); 398 394 uint_4 n = (v.NElts()<(uint_4) mBins) ? v.NElts(): (uint_4) mBins; 399 395 if(n>0) { … … 955 951 cout<<"Histo::FitMax : Nb Entrees histo ="<<NEntries()<<endl; 956 952 957 if (NEntries() < 1) THROW(inconsistentErr);953 if (NEntries() < 1) throw ParmError(PExcLongMessage("")); 958 954 959 955 int_4 iMax = IMax(); … … 1021 1017 for(k=0;k<nLowHigh;k++) cout<<" "<<e2Fit(k); cout<<endl; 1022 1018 } 1023 if( ii != nLowHigh ) THROW(inconsistentErr);1019 if( ii != nLowHigh ) throw ParmError(PExcLongMessage("")); 1024 1020 Poly pol(degree); 1025 1021 TRY { … … 1049 1045 // on est dans le cas d'un fit de parabole 1050 1046 r_8 r=0; 1051 if (pol.Root1(r)==0) THROW(inconsistentErr);1047 if (pol.Root1(r)==0) throw ParmError(PExcLongMessage("")); 1052 1048 fd = r + xCenter; 1053 1049 } else if (DPolDeg == 2) { … … 1055 1051 r_8 r1=0; 1056 1052 r_8 r2=0; 1057 if (pol.Root2(r1,r2) == 0) THROW(inconsistentErr);1053 if (pol.Root2(r1,r2) == 0) throw ParmError(PExcLongMessage("")); 1058 1054 pol.Derivate(); 1059 1055 fd = (pol(r1)<0) ? r1 + xCenter : r2 + xCenter; 1060 1056 } else { 1061 1057 // on est dans un cas non prevu 1062 THROW(inconsistentErr);1058 throw ParmError(PExcLongMessage("")); 1063 1059 } 1064 1060 … … 1104 1100 << " , nbin= " << NBins() << endl; 1105 1101 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("")); 1108 1104 1109 1105 int_4 iMax = FindBin(xmax); 1110 if (iMax<0 || iMax>=NBins()) THROW(inconsistentErr);1106 if (iMax<0 || iMax>=NBins()) throw ParmError(PExcLongMessage("")); 1111 1107 r_8 hmax = mData[iMax]; 1112 1108 r_8 limit = frac*hmax; -
trunk/SophyaLib/HiStats/histos.h
r2479 r2507 1 1 // This may look like C code, but it is really -*- C++ -*- 2 2 // 3 // $Id: histos.h,v 1.1 7 2003-12-06 23:58:17ansari Exp $3 // $Id: histos.h,v 1.18 2004-03-15 16:47:20 ansari Exp $ 4 4 // 5 5 … … 240 240 inline Histo operator + (const Histo& a, const Histo& b) 241 241 { 242 if (b.NBins()!=a.NBins()) THROW(sizeMismatchErr);242 if (b.NBins()!=a.NBins()) throw SzMismatchError(PExcLongMessage("")); 243 243 Histo c(a); 244 244 return (c += b); … … 249 249 inline Histo operator - (const Histo& a, const Histo& b) 250 250 { 251 if (b.NBins()!=a.NBins()) THROW(sizeMismatchErr);251 if (b.NBins()!=a.NBins()) throw SzMismatchError(PExcLongMessage("")); 252 252 Histo c(a); 253 253 return (c -= b); … … 258 258 inline Histo operator * (const Histo& a, const Histo& b) 259 259 { 260 if (b.NBins()!=a.NBins()) THROW(sizeMismatchErr);260 if (b.NBins()!=a.NBins()) throw SzMismatchError(PExcLongMessage("")); 261 261 Histo c(a); 262 262 return (c *= b); … … 267 267 inline Histo operator / (const Histo& a, const Histo& b) 268 268 { 269 if (b.NBins()!=a.NBins()) THROW(sizeMismatchErr);269 if (b.NBins()!=a.NBins()) throw SzMismatchError(PExcLongMessage("")); 270 270 Histo c(a); 271 271 return (c /= b); -
trunk/SophyaLib/HiStats/histos2.cc
r2341 r2507 54 54 Zero(); 55 55 mB_s.H = NULL; 56 END_CONSTRUCTOR57 56 } 58 57 … … 73 72 Zero(); 74 73 mB_s.H = NULL; 75 END_CONSTRUCTOR76 74 } 77 75 … … 140 138 } 141 139 142 END_CONSTRUCTOR143 140 } 144 141 … … 156 153 for(int_4 i=0;i<3;i++) for(int_4 j=0;j<3;j++) mOver[i][j]=0.; 157 154 mB_s.H = NULL; 158 END_CONSTRUCTOR159 155 } 160 156 … … 332 328 { 333 329 int_4 i,j; 334 if (b==0.) THROW(inconsistentErr);330 if (b==0.) throw ParmError("Histo2D::operator / (0) "); 335 331 r_8 b2 = b*b; 336 332 for(i=0;i<mNxy;i++) { … … 412 408 { 413 409 int_4 i,j; 414 if(mNx!=a.mNx || mNy!=a.mNy) THROW(sizeMismatchErr);410 if(mNx!=a.mNx || mNy!=a.mNy) throw SzMismatchError("Histo2D::operator += "); 415 411 for(i=0;i<mNxy;i++) { 416 412 mData[i] += a.mData[i]; … … 435 431 { 436 432 int_4 i,j; 437 if(mNx!=a.mNx || mNy!=a.mNy) THROW(sizeMismatchErr);433 if(mNx!=a.mNx || mNy!=a.mNy) throw SzMismatchError("Histo2D::operator -= "); 438 434 for(i=0;i<mNxy;i++) { 439 435 mData[i] -= a.mData[i]; … … 458 454 { 459 455 int_4 i,j; 460 if(mNx!=a.mNx || mNy!=a.mNy) THROW(sizeMismatchErr);456 if(mNx!=a.mNx || mNy!=a.mNy) throw SzMismatchError("Histo2D::operator *= "); 461 457 nHist = 0.; 462 458 for(i=0;i<mNxy;i++) { … … 483 479 { 484 480 int_4 i,j; 485 if(mNx!=a.mNx || mNy!=a.mNy) THROW(sizeMismatchErr);481 if(mNx!=a.mNx || mNy!=a.mNy) throw SzMismatchError("Histo2D::operator /= "); 486 482 nHist = 0.; 487 483 for(i=0;i<mNxy;i++) { … … 575 571 void Histo2D::PutValue(TMatrix<r_8> &v, int_4 ierr) 576 572 { 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()"); 578 574 uint_4 nnx = (v.NRows()<(uint_4)mNx)? v.NRows(): (uint_4)mNx; 579 575 uint_4 nny = (v.NCol() <(uint_4)mNy)? v.NCol() : (uint_4)mNy; … … 590 586 void Histo2D::PutValueAdd(TMatrix<r_8> &v, int_4 ierr) 591 587 { 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 "); 593 589 uint_4 nnx = (v.NRows()<(uint_4)mNx)? v.NRows(): (uint_4)mNx; 594 590 uint_4 nny = (v.NCol() <(uint_4)mNy)? v.NCol() : (uint_4)mNy; … … 606 602 void Histo2D::PutError2(TMatrix<r_8> &v) 607 603 { 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 "); 609 605 uint_4 nnx = (v.NRows()<(uint_4)mNx)? v.NRows(): (uint_4)mNx; 610 606 uint_4 nny = (v.NCol() <(uint_4)mNy)? v.NCol() : (uint_4)mNy; … … 622 618 void Histo2D::PutError2Add(TMatrix<r_8> &v) 623 619 { 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 "); 625 621 uint_4 nnx = (v.NRows()<(uint_4)mNx)? v.NRows(): (uint_4)mNx; 626 622 uint_4 nny = (v.NCol() <(uint_4)mNy)? v.NCol() : (uint_4)mNy; … … 638 634 void Histo2D::PutError(TMatrix<r_8> &v) 639 635 { 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 "); 641 637 uint_4 nnx = (v.NRows()<(uint_4)mNx)? v.NRows(): (uint_4)mNx; 642 638 uint_4 nny = (v.NCol() <(uint_4)mNy)? v.NCol() : (uint_4)mNy; -
trunk/SophyaLib/HiStats/histos2.h
r2479 r2507 320 320 inline Histo2D operator + (const Histo2D& a, const Histo2D& b) 321 321 { 322 if (b.NBinX()!=a.NBinX() || b.NBinY()!=a.NBinY()) THROW(sizeMismatchErr);322 if (b.NBinX()!=a.NBinX() || b.NBinY()!=a.NBinY()) throw SzMismatchError(PExcLongMessage("")); 323 323 Histo2D c(a); 324 324 return (c += b); … … 329 329 inline Histo2D operator - (const Histo2D& a, const Histo2D& b) 330 330 { 331 if (b.NBinX()!=a.NBinX() || b.NBinY()!=a.NBinY()) THROW(sizeMismatchErr);331 if (b.NBinX()!=a.NBinX() || b.NBinY()!=a.NBinY()) throw SzMismatchError(PExcLongMessage("")); 332 332 Histo2D c(a); 333 333 return (c -= b); … … 338 338 inline Histo2D operator * (const Histo2D& a, const Histo2D& b) 339 339 { 340 if (b.NBinX()!=a.NBinX() || b.NBinY()!=a.NBinY()) THROW(sizeMismatchErr);340 if (b.NBinX()!=a.NBinX() || b.NBinY()!=a.NBinY()) throw SzMismatchError(PExcLongMessage("")); 341 341 Histo2D c(a); 342 342 return (c *= b); … … 347 347 inline Histo2D operator / (const Histo2D& a, const Histo2D& b) 348 348 { 349 if (b.NBinX()!=a.NBinX() || b.NBinY()!=a.NBinY()) THROW(sizeMismatchErr);349 if (b.NBinX()!=a.NBinX() || b.NBinY()!=a.NBinY()) throw SzMismatchError(PExcLongMessage("")); 350 350 Histo2D c(a); 351 351 return (c /= b); -
trunk/SophyaLib/HiStats/ntuple.cc
r2341 r2507 87 87 mNames = NULL; 88 88 mInfo = NULL; 89 if (nvar <= 0) THROW(sizeMismatchErr);89 if (nvar <= 0) throw ParmError("NTuple::NTuple(nvar<=0) "); 90 90 mNVar = nvar; 91 91 mVar = new r_4[nvar];
Note:
See TracChangeset
for help on using the changeset viewer.