Changeset 5080 for trunk/MagicSoft/Mars/mhflux
- Timestamp:
- 09/16/04 17:00:50 (20 years ago)
- Location:
- trunk/MagicSoft/Mars/mhflux
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mhflux/MAlphaFitter.h
r5012 r5080 42 42 MAlphaFitter() : fFunc(new TF1("", "gaus(0) + pol1(3)", 0, 90)), fSigInt(10), fSigMax(75), fBgMin(45), fBgMax(85), fPolynomOrder(1), fCoefficients(3+fPolynomOrder+1) 43 43 { 44 gROOT->GetListOfFunctions()->Remove(fFunc); 44 45 } 45 46 … … 67 68 TF1 *fcn = f.fFunc; 68 69 f.fFunc = new TF1(*fFunc); 70 gROOT->GetListOfFunctions()->Remove(f.fFunc); 69 71 delete fcn; 70 72 } … … 74 76 void SetBackgroundFitMin(Float_t s) { fBgMin = s; } 75 77 void SetBackgroundFitMax(Float_t s) { fBgMax = s; } 76 void SetPolynomOrder(Int_t s) { fPolynomOrder = s; delete fFunc; fFunc=new TF1 ("", Form("gaus(0) + pol%d(3)", s)); fCoefficients.Set(3+s+1); fCoefficients.Reset(); } 78 void SetPolynomOrder(Int_t s) { fPolynomOrder = s; delete fFunc; fFunc=new TF1 ("", Form("gaus(0) + pol%d(3)", s)); 79 gROOT->GetListOfFunctions()->Remove(fFunc); 80 fCoefficients.Set(3+s+1); fCoefficients.Reset(); } 77 81 78 82 Double_t GetEventsExcess() const { return fEventsExcess; } -
trunk/MagicSoft/Mars/mhflux/MHFalseSource.cc
r5012 r5080 115 115 116 116 #include <TF1.h> 117 #include <TF2.h> 117 118 #include <TH2.h> 118 119 #include <TGraph.h> … … 729 730 gPad->Modified(); 730 731 gPad->cd(); 732 } 733 734 Double_t FcnGauss2d(Double_t *x, Double_t *par) 735 { 736 TVector2 v = TVector2(x[0], x[1]).Rotate(par[5]*TMath::DegToRad()); 737 738 const Double_t g0 = TMath::Gaus(v.X(), par[1], par[2]); 739 const Double_t g1 = TMath::Gaus(v.Y(), par[3], par[4]); 740 741 //Gaus(Double_t x, Double_t mean=0, Double_t sigma=1, Bool_t norm=kFALSE); 742 return par[0]*(g0+g1); 731 743 } 732 744 … … 897 909 } 898 910 911 *fLog << "Done." << endl; 912 899 913 h0a.GetXaxis()->SetRangeUser(0, maxalpha0*1.5); 900 914 h0b.GetXaxis()->SetRangeUser(0, maxalpha0*1.5); … … 926 940 hist->Draw("colz"); 927 941 hist->SetBit(kCanDelete); 942 943 944 TF2 f2d("", FcnGauss2d, -1.5, 1.5, -1.5, 1.5, 6); 945 f2d.SetParName(0, "Max sigma"); 946 f2d.SetParName(1, "Mean_1 deg"); 947 f2d.SetParName(2, "Sigma_1 deg"); 948 f2d.SetParName(3, "Mean_2 deg"); 949 f2d.SetParName(4, "Sigma_2 deg"); 950 f2d.SetParName(5, "Phi deg"); 951 f2d.SetParLimits(1, -1, 1); // mu_1 952 f2d.SetParLimits(3, -1, 1); // mu_2 953 f2d.SetParLimits(2, 0, 1); // sigma_1 954 f2d.SetParLimits(4, 0, 1); // sigma_2 955 f2d.SetParLimits(5, 0, 90); // phi 956 f2d.SetParameter(0, maxs); // A 957 f2d.SetParameter(1, 0); // mu_1 958 f2d.SetParameter(2, 0.2); // sigma_1 959 f2d.SetParameter(3, 0); // mu_2 960 f2d.SetParameter(4, 0.2); // sigma_2 961 f2d.SetParameter(5, 0); // phi 962 hist->Fit(&f2d, "IN0"); 963 //f2d.DrawClone("cont2same")->SetBit(kCanDelete); 964 965 928 966 catalog->Draw("mirror same *"); 929 967 c->cd(3);
Note:
See TracChangeset
for help on using the changeset viewer.