Changeset 3590 for trunk/MagicSoft/Mars
- Timestamp:
- 03/23/04 16:26:06 (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mhist/MHFalseSource.cc
r3588 r3590 148 148 fHist.SetName("Alpha"); 149 149 fHist.SetTitle("3D-plot of Alpha vs x, y"); 150 fHist.SetXTitle(" x[\\circ]");151 fHist.SetYTitle(" y[\\circ]");150 fHist.SetXTitle("y [\\circ]"); 151 fHist.SetYTitle("x [\\circ]"); 152 152 fHist.SetZTitle("\\alpha [\\circ]"); 153 153 } … … 223 223 if (fUseMmScale) 224 224 { 225 fHist.SetXTitle(" x[mm]");226 fHist.SetYTitle(" y[mm]");225 fHist.SetXTitle("y [mm]"); 226 fHist.SetYTitle("x [mm]"); 227 227 228 228 fHist.Scale(1./fMm2Deg); … … 230 230 else 231 231 { 232 fHist.SetXTitle(" x[\\circ]");233 fHist.SetYTitle(" y[\\circ]");232 fHist.SetXTitle("y [\\circ]"); 233 fHist.SetYTitle("x [\\circ]"); 234 234 235 235 fHist.Scale(1./fMm2Deg); … … 281 281 fUseMmScale = kFALSE; 282 282 283 fHist.SetXTitle(" x[\\circ]");284 fHist.SetYTitle(" y[\\circ]");283 fHist.SetXTitle("y [\\circ]"); 284 fHist.SetYTitle("x [\\circ]"); 285 285 } 286 286 … … 340 340 hsrc.SetSrcPos(&src); 341 341 342 const Int_t nx = fHist.GetNbinsX();343 const Int_t n y= fHist.GetNbinsY();344 342 // This is because a 3D histogram x and y are exchanged... 343 const Int_t nx = fHist.GetNbinsY(); 344 const Int_t ny = fHist.GetNbinsX(); 345 345 Axis_t cx[nx]; 346 346 Axis_t cy[ny]; 347 fHist.Get Xaxis()->GetCenter(cx);348 fHist.Get Yaxis()->GetCenter(cy);347 fHist.GetYaxis()->GetCenter(cx); 348 fHist.GetXaxis()->GetCenter(cy); 349 349 350 350 for (int ix=0; ix<nx; ix++) … … 371 371 372 372 const Double_t alpha = hsrc.GetAlpha(); 373 fHist.Fill(cx[ix], cy[iy], TMath::Abs(alpha), w); 373 374 // This is because a 3D histogram x and y are exchanged... 375 fHist.Fill(cy[iy], cx[ix], TMath::Abs(alpha), w); 374 376 } 375 377 } … … 502 504 if ((h1 = (TH1D*)gPad->FindObject("Alpha"))) 503 505 { 504 //h1->Reset(); 505 506 const Double_t x = fHist.GetXaxis()->GetBinCenter(maxx); 507 const Double_t y = fHist.GetYaxis()->GetBinCenter(maxy); 506 const Double_t x = h4->GetXaxis()->GetBinCenter(maxx); 507 const Double_t y = h4->GetYaxis()->GetBinCenter(maxy); 508 508 const Double_t s = h4->GetBinContent(max); 509 509 510 TH1 *h = fHist.ProjectionZ("Alpha", maxx, maxx, maxy, maxy); 510 // This is because a 3D histogram x and y are vice versa 511 // Than for their projections 512 TH1 *h = fHist.ProjectionZ("Alpha", maxy, maxy, maxx, maxx); 511 513 h->SetTitle(Form("Distribution of \\alpha for x=%.2f y=%.2f (\\sigma_{max}=%.1f)", x, y, s)); 512 514 } … … 545 547 TH1 *h2 = fHist.Project3D("xy_off"); 546 548 h2->SetDirectory(NULL); 547 h2->SetXTitle(fHist.Get Xaxis()->GetTitle());548 h2->SetYTitle(fHist.Get Yaxis()->GetTitle());549 h2->SetXTitle(fHist.GetYaxis()->GetTitle()); 550 h2->SetYTitle(fHist.GetXaxis()->GetTitle()); 549 551 h2->Draw("colz"); 550 552 h2->SetBit(kCanDelete); … … 556 558 fHist.GetZaxis()->SetRange(0,9999); 557 559 h3->SetDirectory(NULL); 558 h3->SetXTitle(fHist.Get Xaxis()->GetTitle());559 h3->SetYTitle(fHist.Get Yaxis()->GetTitle());560 h3->SetXTitle(fHist.GetYaxis()->GetTitle()); 561 h3->SetYTitle(fHist.GetXaxis()->GetTitle()); 560 562 h3->Draw("colz"); 561 563 h3->SetBit(kCanDelete); … … 568 570 h4->SetTitle("Significance"); 569 571 h4->SetDirectory(NULL); 570 h4->SetXTitle(fHist.Get Xaxis()->GetTitle());571 h4->SetYTitle(fHist.Get Yaxis()->GetTitle());572 h4->SetXTitle(fHist.GetYaxis()->GetTitle()); 573 h4->SetYTitle(fHist.GetXaxis()->GetTitle()); 572 574 h4->Draw("colz"); 573 575 h4->SetBit(kCanDelete); … … 671 673 hists->SetNameTitle("Excess", Form("Number of excess events for \\alpha<%.0f\\circ", sigint)); 672 674 histb->SetNameTitle("Background", Form("Number of background events for \\alpha<%.0f\\circ", sigint)); 673 hist->SetXTitle(fHist.Get Xaxis()->GetTitle());674 hists->SetXTitle(fHist.Get Xaxis()->GetTitle());675 histb->SetXTitle(fHist.Get Xaxis()->GetTitle());675 hist->SetXTitle(fHist.GetYaxis()->GetTitle()); 676 hists->SetXTitle(fHist.GetYaxis()->GetTitle()); 677 histb->SetXTitle(fHist.GetYaxis()->GetTitle()); 676 678 hist->SetYTitle(fHist.GetXaxis()->GetTitle()); 677 679 hists->SetYTitle(fHist.GetXaxis()->GetTitle()); … … 700 702 func.SetParLimits(3, -1, 1); 701 703 702 const Int_t nx = fHist.GetXaxis()->GetNbins();703 const Int_t ny = fHist.GetYaxis()->GetNbins();704 const Int_t nx = hist->GetXaxis()->GetNbins(); 705 const Int_t ny = hist->GetYaxis()->GetNbins(); 704 706 const Int_t nr = nx*nx+ny*ny; 705 707 … … 724 726 for (int iy=1; iy<=ny; iy++) 725 727 { 726 h = fHist.ProjectionZ("AlphaFit", ix, ix, iy, iy); 728 // This is because a 3D histogram x and y are vice versa 729 // Than for their projections 730 h = fHist.ProjectionZ("AlphaFit", iy, iy, ix, ix); 727 731 728 732 const Double_t alpha0 = h->GetBinContent(1); … … 808 812 const Double_t sig = Significance(s, b); 809 813 814 // This is because a 3D histogram x and y are exchanged... 810 815 const Int_t n = hist->GetBin(ix, iy); 811 816 hists->SetBinContent(n, s-b); … … 886 891 { 887 892 const char *title = Form(" \\alpha for x=%.2f y=%.2f (\\sigma_{max}=%.1f) ", 888 fHist.GetXaxis()->GetBinCenter(maxx),889 fHist.GetYaxis()->GetBinCenter(maxy), maxs);890 891 TH1 *result = fHist.ProjectionZ("AlphaFit", max x, maxx, maxy, maxy);893 hist->GetXaxis()->GetBinCenter(maxx), 894 hist->GetYaxis()->GetBinCenter(maxy), maxs); 895 896 TH1 *result = fHist.ProjectionZ("AlphaFit", maxy, maxy, maxx, maxx); 892 897 result->SetDirectory(NULL); 893 898 result->SetNameTitle("Result \\alpha", title);
Note:
See TracChangeset
for help on using the changeset viewer.