Changeset 7252
- Timestamp:
- 08/02/05 13:41:41 (19 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r7251 r7252 37 37 - repleced maximum deviation (45) in first muon cut by 35 38 38 it is done anyhow in a later step and doesn't change in between 39 40 * datacenter/macros/fillstar.C: 41 - now get muon data from MHMuonPar directly 42 43 * mmuon/MHMuonPar.[h,cc]: 44 - implemented the function to get the reference values 45 - updated psf reference line 46 - implemented calib reference line 39 47 40 48 -
trunk/MagicSoft/Mars/datacenter/macros/fillstar.C
r7228 r7252 105 105 } 106 106 107 TProfile *h1 = (TProfile*)arr.FindObjectInCanvas("RingBroadening", "TProfile", "MHMuonPar"); 108 if (!h1) 109 { 110 cout << "WARNING - Reading of RingBroadening failed." << endl; 111 return 0; 112 } 113 114 Float_t numerator = 0; 115 Float_t denominator = 0; 116 Float_t summe = 0; 117 118 for(Int_t i=5; i<15; i++) 119 { 120 numerator += h1->GetBinContent(i)*h1->GetBinEntries(i); 121 denominator += h1->GetBinEntries(i); 122 } 123 124 summe = numerator/denominator; 125 126 Float_t psf = (summe - 0.04816)/0.001294; 107 MHMuonPar *hmuon = (TProfile*)arr.FindObjectInCanvas("MHMuonPar", "MHMuonPar", "MHMuonPar"); 108 if (!hmuon) 109 { 110 cout << "WARNING - Reading of MHMuon failed." << endl; 111 return 0; 112 } 113 114 Float_t psf = (muon->GetMeanWidth() - 0.04816)/0.001294; 127 115 psf = TMath::Nint(psf*10)/10.; 128 116 TString PSF = Form("%5.1f", psf); 129 Int_t num = (int)h1->GetEntries(); 130 131 TProfile *h2 = (TProfile*)arr.FindObjectInCanvas("SizeVsRadius", "TProfile", "MHMuonPar"); 132 if (!h1) 133 { 134 cout << "WARNING - Reading of SizeVsRadius failed." << endl; 135 return 0; 136 } 137 138 numerator = 0; 139 denominator = 0; 140 summe = 0; 141 142 for(Int_t i=5; i<15; i++) 143 { 144 numerator += h2->GetBinContent(i)*h2->GetBinEntries(i); 145 denominator += h2->GetBinEntries(i); 146 } 147 148 summe = numerator/denominator; 117 Int_t num = (int)muon.GetEntries(); 149 118 150 119 Float_t integralmc = -1.43*psf + 1035; 151 Float_t ratiodatamc = ( summe/integralmc)*100;120 Float_t ratiodatamc = (muon->GetMeanSize()/integralmc)*100; 152 121 TString ratio = Form("%5.1f", ratiodatamc); 153 154 122 155 123 TH1 *h = (TH1*)arr.FindObjectInCanvas("Islands", "TH1F", "MHImagePar"); -
trunk/MagicSoft/Mars/mjobs/MJStar.cc
r7223 r7252 357 357 MF fmuon1("MHillas.fSize>150", "MuonPreCut"); 358 358 MF fmuon2("(MMuonSearchPar.fRadius>180) && (MMuonSearchPar.fRadius<400) &&" 359 "(MMuonSearchPar.fDeviation< 45)", "MuonSearchCut");360 MF fmuon3("(MMuonCalibPar.fArcPhi>190) && (MMuonSearchPar.fDeviation<35)&&"359 "(MMuonSearchPar.fDeviation<35)", "MuonSearchCut"); 360 MF fmuon3("(MMuonCalibPar.fArcPhi>190) &&" 361 361 "(MMuonCalibPar.fArcWidth<0.20) && (MMuonCalibPar.fArcWidth>0.04)", 362 362 "MuonFinalCut"); -
trunk/MagicSoft/Mars/mmuon/MHMuonPar.cc
r7068 r7252 65 65 using namespace std; 66 66 67 const Float_t MHMuonPar::fgIntegralLoLim = 0.7; 68 const Float_t MHMuonPar::fgIntegralUpLim = 1.2; 69 67 70 // -------------------------------------------------------------------------- 68 71 // … … 79 82 fHistRadius.SetXTitle("R [\\circ]"); 80 83 fHistRadius.SetYTitle("Counts"); 84 fHistRadius.GetXaxis()->SetTitleOffset(1.2); 81 85 fHistRadius.SetDirectory(NULL); 82 86 fHistRadius.UseCurrentStyle(); … … 86 90 fHistArcWidth.SetTitle("Distribution of ArcWidth"); 87 91 fHistArcWidth.SetXTitle("W [\\circ]"); 92 fHistArcWidth.GetXaxis()->SetTitleOffset(1.2); 88 93 fHistArcWidth.SetYTitle("Counts"); 89 94 fHistArcWidth.SetDirectory(NULL); … … 95 100 fHistBroad.SetXTitle("R [\\circ]"); 96 101 fHistBroad.SetYTitle("W/R [1]"); 102 fHistBroad.GetXaxis()->SetTitleOffset(1.2); 97 103 fHistBroad.SetDirectory(NULL); 98 104 fHistBroad.UseCurrentStyle(); … … 103 109 fHistSize.SetXTitle("R [\\circ]"); 104 110 fHistSize.SetYTitle("S [phe]"); 111 fHistSize.GetXaxis()->SetTitleOffset(1.2); 105 112 fHistSize.SetDirectory(NULL); 106 113 fHistSize.UseCurrentStyle(); … … 204 211 fHistSize.Draw(); 205 212 206 AppendPad("pad3"); 207 208 pad->cd(4); 209 gPad->SetBorderMode(0); 210 fHistBroad.Draw(); 211 212 TF1 ref("RefShape", "0.112*x*x - 0.413*x + 0.404", 0.7, 1.2); 213 TText txt; 214 txt.SetTextColor(kBlue); 215 216 TF1 ref("RefShape100%", "573*x + 430", fgIntegralLoLim, fgIntegralUpLim); 213 217 ref.SetLineColor(kBlue); 214 218 ref.SetLineWidth(1); 215 219 ref.SetLineStyle(kDashed); 216 ref.DrawCopy("same"); 220 gROOT->GetListOfFunctions()->Remove(ref.DrawCopy("same")); 221 222 txt.SetTextAlign(31); 223 txt.DrawText(fgIntegralLoLim, ref.Eval(fgIntegralLoLim+0.05), "100%"); 224 225 AppendPad("pad3"); 226 227 pad->cd(4); 228 gPad->SetBorderMode(0); 229 fHistBroad.Draw(); 230 231 ref.SetName("RefShape12mm"); 232 ref.Compile("0.0766*x*x - 0.250*x + 0.239"); 233 gROOT->GetListOfFunctions()->Remove(ref.DrawCopy("same")); 234 235 txt.SetTextAlign(11); 236 txt.DrawText(fgIntegralLoLim, ref.Eval(fgIntegralLoLim-0.05), "12mm"); 217 237 218 238 AppendPad("pad4"); 219 239 } 220 240 241 Double_t MHMuonPar::Integral(const TProfile &p, Int_t a, Int_t b) const 242 { 243 Float_t numerator = 0; 244 Float_t denominator = 0; 245 246 for (Int_t i=a; i<b; i++) 247 { 248 numerator += p.GetBinContent(i)*p.GetBinEntries(i); 249 denominator += p.GetBinEntries(i); 250 } 251 252 return denominator==0 ? 0 : numerator/denominator; 253 } 254 255 Double_t MHMuonPar::Integral(const TProfile &p, Float_t a, Float_t b) const 256 { 257 const Int_t bin1 = p.GetXaxis()->FindFixBin(a); 258 const Int_t bin2 = p.GetXaxis()->FindFixBin(b); 259 260 return Integral(p, bin1, bin2); 261 } 262 221 263 void MHMuonPar::Paint(Option_t *opt) 222 264 { 223 265 if (TString(opt)==TString("pad4")) 224 266 { 225 const Double_t lolim = 0.7; 226 const Double_t uplim = 1.2; 227 228 const Int_t bin1 = fHistBroad.GetXaxis()->FindFixBin(lolim); 229 const Int_t bin2 = fHistBroad.GetXaxis()->FindFixBin(uplim); 230 231 const TString txt = Form("\\Sigma_{%.2f\\circ}^{%.2f\\circ} = %.3f", lolim, 232 uplim, fHistBroad.Integral(bin1, bin2)); 267 const TString txt = Form("\\Sigma_{%.2f\\circ}^{%.2f\\circ} = %.3f", 268 fgIntegralLoLim, fgIntegralUpLim, Integral(fHistBroad)); 233 269 234 270 TLatex text(0.57, 0.93, txt); … … 240 276 if (TString(opt)==TString("pad3")) 241 277 { 242 const Double_t lolim = 0.7; 243 const Double_t uplim = 1.2; 244 245 const Int_t bin1 = fHistSize.GetXaxis()->FindFixBin(lolim); 246 const Int_t bin2 = fHistSize.GetXaxis()->FindFixBin(uplim); 247 248 const TString txt = Form("\\Sigma_{%.2f\\circ}^{%.2f\\circ} = %.f", lolim, 249 uplim, fHistSize.Integral(bin1, bin2)); 278 const TString txt = Form("\\Sigma_{%.2f\\circ}^{%.2f\\circ} = %.f", 279 fgIntegralLoLim, fgIntegralUpLim, Integral(fHistSize)); 250 280 251 281 TLatex text(0.47, 0.93, txt); -
trunk/MagicSoft/Mars/mmuon/MHMuonPar.h
r7015 r7252 19 19 { 20 20 private: 21 TH1F fHistRadius; // Radius 22 TH1F fHistArcWidth; // ArcWidth 23 24 TProfile fHistBroad; // ArcWidth/Radius Vs Radius 25 TProfile fHistSize; // MuonSize Vs Radius 21 static const Float_t fgIntegralLoLim; // lower limit of integral 22 static const Float_t fgIntegralUpLim; // upper limit of integral 26 23 27 24 MMuonSearchPar *fMuonSearchPar; //! 28 25 MMuonCalibPar *fMuonCalibPar; //! 29 26 27 TH1F fHistRadius; // Radius 28 TH1F fHistArcWidth; // ArcWidth 29 30 TProfile fHistBroad; // ArcWidth/Radius Vs Radius 31 TProfile fHistSize; // MuonSize Vs Radius 32 30 33 Float_t fMm2Deg; 34 35 Double_t Integral(const TProfile &p, Int_t a, Int_t b) const; 36 Double_t Integral(const TProfile &p, Float_t a=fgIntegralLoLim, Float_t b=fgIntegralUpLim) const; 31 37 32 38 public: … … 41 47 const TProfile& GetHistSize() const { return fHistSize; } 42 48 49 Double_t GetMeanSize() const { return Integral(fHistSize); } 50 Double_t GetMeanWidth() const { return Integral(fHistBroad); } 51 Stat_t GetEntries() const { return fHistBroad.GetEntries(); } 52 43 53 void Draw(Option_t *opt=""); 44 54 void Paint(Option_t *opt="");
Note:
See TracChangeset
for help on using the changeset viewer.