Changeset 3597
- Timestamp:
- 03/24/04 15:08:19 (21 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r3594 r3597 18 18 19 19 -*-*- END OF LINE -*-*- 20 21 2004/03/24: Thomas Bretz 22 23 * mbase/MMath.cc: 24 - now SignificanceLiMa returns 0 in case sum==0 25 26 20 27 21 28 2004/03/23: Thomas Bretz -
trunk/MagicSoft/Mars/mbase/MMath.cc
r3595 r3597 59 59 // alpha = t_on/t_off; // t: observation time 60 60 // 61 // Returns -1 if calculation failed... 61 // Returns -1 if sum<0 or alpha<0 or the argument of sqrt<0 62 // Returns 0 if s+b==0 62 63 // 63 64 Double_t MMath::SignificanceLiMa(Double_t s, Double_t b, Double_t alpha) … … 65 66 const Double_t sum = s+b; 66 67 67 if (sum<=0 || alpha<=0) 68 if (sum==0) 69 return 0; 70 71 if (sum<0 || alpha<=0) 68 72 return -1; 69 73 … … 71 75 const Double_t m = b*TMath::Log(b/sum*(alpha+1) ); 72 76 73 return TMath::Sqrt((l+m)*2);77 return l+m<0 ? -1 : TMath::Sqrt((l+m)*2); 74 78 } -
trunk/MagicSoft/Mars/mhist/MHFalseSource.cc
r3595 r3597 148 148 fHist.SetName("Alpha"); 149 149 fHist.SetTitle("3D-plot of Alpha vs x, y"); 150 fHist.SetXTitle(" y[\\circ]");151 fHist.SetYTitle(" x[\\circ]");150 fHist.SetXTitle("x [\\circ]"); 151 fHist.SetYTitle("y [\\circ]"); 152 152 fHist.SetZTitle("\\alpha [\\circ]"); 153 153 } … … 223 223 if (fUseMmScale) 224 224 { 225 fHist.SetXTitle(" y[mm]");226 fHist.SetYTitle(" x[mm]");225 fHist.SetXTitle("x [mm]"); 226 fHist.SetYTitle("y [mm]"); 227 227 228 228 fHist.Scale(1./fMm2Deg); … … 230 230 else 231 231 { 232 fHist.SetXTitle(" y[\\circ]");233 fHist.SetYTitle(" x[\\circ]");232 fHist.SetXTitle("x [\\circ]"); 233 fHist.SetYTitle("y [\\circ]"); 234 234 235 235 fHist.Scale(1./fMm2Deg); … … 263 263 Double_t MHFalseSource::SignificanceLiMa(Double_t s, Double_t b, Double_t alpha) 264 264 { 265 Double_t lima = MMath::SignificanceLiMa(s, b);266 return lima<0 ? MMath::Significance(s, b): lima;265 const Double_t lima = MMath::SignificanceLiMa(s, b); 266 return lima<0 ? 0 : lima; 267 267 } 268 268 … … 282 282 fUseMmScale = kFALSE; 283 283 284 fHist.SetXTitle(" y[\\circ]");285 fHist.SetYTitle(" x[\\circ]");284 fHist.SetXTitle("x [\\circ]"); 285 fHist.SetYTitle("y [\\circ]"); 286 286 } 287 287 … … 474 474 const Int_t nx = h4->GetXaxis()->GetNbins(); 475 475 const Int_t ny = h4->GetYaxis()->GetNbins(); 476 const Int_t nr = nx*nx + ny*ny; 476 477 477 478 Int_t maxx=nx/2; 478 479 Int_t maxy=ny/2; 479 480 480 Int_t max = h4->GetBin( maxx, maxy);481 Int_t max = h4->GetBin(nx, ny); 481 482 482 483 for (int ix=0; ix<nx; ix++) … … 492 493 h4->SetBinContent(n, sig); 493 494 494 if (sig>h4->GetBinContent(max) && sig !=0)495 if (sig>h4->GetBinContent(max) && sig>0 && ix*ix+iy*iy<nr*nr/9) 495 496 { 496 497 max = n; … … 501 502 502 503 padsave->cd(1); 503 if ((h1 = (TH1D*)gPad->FindObject("Alpha")) )504 if ((h1 = (TH1D*)gPad->FindObject("Alpha")) && max>0) 504 505 { 505 506 const Double_t x = h4->GetXaxis()->GetBinCenter(maxx); -
trunk/MagicSoft/Mars/mhist/MHFalseSource.h
r3578 r3597 51 51 TH1 *GetHistByName(const TString name) { return &fHist; } 52 52 53 void FitSignificance(Float_t sigint=15, Float_t sigmax= 35, Float_t bgmin=40, Float_t bgmax=80, Byte_t polynom=2); //*MENU*53 void FitSignificance(Float_t sigint=15, Float_t sigmax=70, Float_t bgmin=40, Float_t bgmax=70, Byte_t polynom=1); //*MENU* 54 54 void FitSignificanceStd() { FitSignificance(); } //*MENU* 55 55
Note:
See TracChangeset
for help on using the changeset viewer.