Changeset 5080 for trunk/MagicSoft
- Timestamp:
- 09/16/04 17:00:50 (20 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r5070 r5080 25 25 * mhcalib/MHGausEvents.cc 26 26 - added call to gROOT->GetListOfFunctions->Remove(f) in destructor 27 27 28 28 29 … … 87 88 * star.rc: 88 89 - use scaled image cleaning by default 90 91 * mmontecarlo/MMcCollectionAreaCalc.cc: 92 - fixed some possible crashes 93 94 * mhflux/MAlphaFitter.h: 95 - remove function from global list 96 97 * mhflux/MHFalseSource.cc: 98 - added a 2D Gauss-Fit 99 100 * mimage/MHillasSrc.[h,cc]: 101 - fixed a bug in the output of DCA (wrong units) 89 102 90 103 -
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); -
trunk/MagicSoft/Mars/mimage/MHillasSrc.cc
r4826 r5080 71 71 #include <TArrayF.h> 72 72 73 #include <TLine.h> 74 #include <TMarker.h> 75 73 76 #include "MLog.h" 74 77 #include "MLogManip.h" … … 179 182 } 180 183 184 void MHillasSrc::Paint(Option_t *opt) 185 { 186 const Float_t x = fSrcPos ? fSrcPos->GetX() : 0; 187 const Float_t y = fSrcPos ? fSrcPos->GetY() : 0; 188 189 TMarker m; 190 m.SetMarkerColor(kYellow); 191 m.SetMarkerStyle(kStar); 192 m.PaintMarker(x, y); 193 /* 194 m.SetMarkerColor(kMagenta); 195 m.PaintMarker(fDist*cos((fDCADelta-fAlpha)*TMath::DegToRad()), 196 fDist*sin((fDCADelta-fAlpha)*TMath::DegToRad())); 197 198 TLine line; 199 line.SetLineWidth(1); 200 line.SetLineColor(108); 201 202 line.PaintLine(-radius, y, radius, y); 203 line.PaintLine(x, -radius, x, radius); 204 205 // COG line 206 TLine line(x, y, meanX, meanY); 207 line.SetLineWidth(1); 208 line.SetLineColor(2); 209 line.Paint();*/ 210 } 211 181 212 // -------------------------------------------------------------------------- 182 213 // … … 191 222 *fLog << " - CosDeltaAlpha = " << fCosDeltaAlpha << endl; 192 223 *fLog << " - DCA [mm] = " << fDCA << endl; 193 *fLog << " - DCA delta [deg] = " << fDCADelta *TMath::RadToDeg()<< endl;224 *fLog << " - DCA delta [deg] = " << fDCADelta << endl; 194 225 } 195 226 … … 207 238 *fLog << " - CosDeltaAlpha = " << fCosDeltaAlpha << endl; 208 239 *fLog << " - DCA [deg] = " << fDCA*geom.GetConvMm2Deg() << endl; 209 *fLog << " - DCA delta [deg] = " << fDCADelta *TMath::RadToDeg()<< endl;240 *fLog << " - DCA delta [deg] = " << fDCADelta << endl; 210 241 } 211 242 -
trunk/MagicSoft/Mars/mimage/MHillasSrc.h
r4817 r5080 36 36 void Print(Option_t *opt=NULL) const; 37 37 void Print(const MGeomCam &geom) const; 38 void Paint(Option_t *opt=NULL); 38 39 39 40 virtual Int_t Calc(const MHillas &hillas);
Note:
See TracChangeset
for help on using the changeset viewer.