Changeset 1593 for trunk/MagicSoft/Mars
- Timestamp:
- 11/08/02 10:04:04 (22 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r1590 r1593 1 1 -*-*- END -*-*- 2 3 2002/11/7: Oscar Blanch 2 2002/11/08: Thomas Bretz 3 4 * mhist/MHMatrix.cc: 5 - implemented a zero suppression 6 7 8 9 2002/11/07: Thomas Bretz 10 11 * mfilter/Makefile, mfilter/FilterLinkDef.h: 12 - added MFEventSelector 13 14 * mfilter/MFEventSelector.[h,cc]: 15 - added 16 17 * mfilter/MF.[h,cc]: 18 - made gsDef[Name,Title] a static const member 19 20 * manalysis/MMultiDimDistCalc.cc: 21 - changed the default function to kernel 22 23 24 25 2002/11/07: Oscar Blanch 4 26 * mmc/MMcEvt.[hxx,cxx] 5 - Some new varaible from the reflector header event. 27 - Some new variable from the reflector header event. 28 29 6 30 7 31 2002/11/07: Wolfgang Wittek … … 10 34 - changed to avoid warnings : "member initializers will be re-ordered 11 35 to match declaration order" 36 12 37 13 38 -
trunk/MagicSoft/Mars/mhist/MHMatrix.cc
r1582 r1593 427 427 TMath::Sort(dists.GetSize(), dists.GetArray(), idx.GetArray(), kFALSE); 428 428 429 const Int_t n = TMath::Abs(num)<rows ? TMath::Abs(num) : rows; 429 Int_t from = 0; 430 Int_t to = TMath::Abs(num)<rows ? TMath::Abs(num) : rows; 431 // 432 // This is a zero-suppression for the case a test- and trainings 433 // sample is identical. This would result in an unwanted leading 434 // zero in the array. To suppress also numerical uncertanties of 435 // zero we cut at 1e-5. Due to Rudy this should be enough. If 436 // you encounter problems we can also use (eg) 1e-25 437 // 438 if (dists[idx[0]]<1e-5) 439 { 440 from++; 441 to ++; 442 if (to>rows) 443 to = rows; 444 } 430 445 431 446 if (num<0) … … 438 453 439 454 Double_t res = 0; 440 for (int i= 0; i<n; i++)455 for (int i=from; i<to; i++) 441 456 res += TMath::Exp(-dists[idx[i]]/hwin); 442 457 443 return -TMath::Log(res/ n);458 return -TMath::Log(res/(to-from)); 444 459 } 445 460 else … … 449 464 // 450 465 Double_t res = 0; 451 for (int i= 0; i<n; i++)466 for (int i=from; i<to; i++) 452 467 res += dists[idx[i]]; 453 468 454 return TMath::Sqrt(res/ n);469 return TMath::Sqrt(res/(to-from)); 455 470 } 456 471 }
Note:
See TracChangeset
for help on using the changeset viewer.