Changeset 7221 for trunk/MagicSoft/Mars/mhflux
- Timestamp:
- 07/26/05 10:23:12 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mhflux/MHDisp.cc
r7217 r7221 403 403 if (rmax<TMath::Hypot(px, py)) 404 404 h2.SetBinContent(bin, 0); 405 else406 if (h2.GetBinContent(bin)==0)407 h2.SetBinContent(bin, 1e-10);405 //else 406 // if (h2.GetBinContent(bin)==0) 407 // h2.SetBinContent(bin, 1e-10); 408 408 } 409 409 } … … 418 418 const TAxis &axey = *s.GetYaxis(); 419 419 420 const Int_t nx = axex.GetNbins(); 421 const Int_t ny = axey.GetNbins(); 422 420 423 const Int_t n = TMath::Nint(0.2/axex.GetBinWidth(1)); 421 424 422 for (int x=1+n; x<=axex.GetNbins()-n; x++) 423 for (int y=1+n; y<=axey.GetNbins()-n; y++) 424 { 425 Double_t sig=0; 426 Double_t bg =0; 427 428 for (int dx=-n; dx<=n; dx++) 429 for (int dy=-n; dy<=n; dy++) 430 { 431 if (TMath::Hypot((float)dx, (float)dy)>n) 432 continue; 433 434 const Int_t bin = s.GetBin(x+dx,y+dy); 435 436 sig += h1.GetBinContent(bin); 437 bg += h2.GetBinContent(bin); 438 } 439 440 const Double_t S = sig>0 ? MMath::SignificanceLiMaSigned(sig, bg, TMath::Abs(scale)) : 0; 441 442 const Int_t bin = s.GetBin(x,y); 443 s.SetBinContent(bin, S); 425 const Double_t sc = h2.GetEntries()/fHistOff->GetEntries(); 426 427 for (int x=1; x<=nx; x++) 428 for (int y=1; y<=ny; y++) 429 { 430 Double_t S=0; 431 432 // Only calculate significances for pixels far enough 433 // from the border to get all expected pixels. 434 if (TMath::Hypot((float)x-0.5*nx, (float)y-0.5*ny)<0.5*axex.GetNbins()-n) 435 { 436 Double_t sig=0; 437 Double_t bg =0; 438 439 // Integral a region of n pixels around x/y 440 for (int dx=-n; dx<=n; dx++) 441 for (int dy=-n; dy<=n; dy++) 442 { 443 if (TMath::Hypot((float)dx, (float)dy)>n) 444 continue; 445 446 const Int_t bin = s.GetBin(x+dx,y+dy); 447 448 sig += h1.GetBinContent(bin); 449 bg += h2.GetBinContent(bin); 450 } 451 452 // Scale such, that the statistical error corresponds to 453 // the amount of off-data used to determin the background 454 // model, not to the background itself. This gives 455 // significances as calculated from the theta-sq plot. 456 S = sig>0 ? MMath::SignificanceLiMaSigned(sig, bg*scale/sc, sc) : 0; 457 } 458 459 s.SetBinContent(x, y, S); 444 460 } 445 461 } … … 456 472 hrc->Reset(); 457 473 474 //const_cast<TH2&>(h).SetMaximum(); 458 475 const Double_t max = h.GetMaximum(); 459 476 460 MBinning(5 0, -max*1.1, max*1.1).Apply(*hrc);477 MBinning(51, -max*1.1, max*1.1).Apply(*hrc); 461 478 462 479 for (int x=1; x<=h.GetXaxis()->GetNbins(); x++) … … 525 542 { 526 543 hx->SetContour(99); 527 MakeSignificance(*hx, *h1, fHistBg, scale);544 MakeSignificance(*hx, *h1, fHistBg, TMath::Abs(scale)); 528 545 MakeDot(*hx); 529 546 MakeSymmetric(hx);
Note:
See TracChangeset
for help on using the changeset viewer.