Changeset 6924 for trunk/MagicSoft/Mars/mhflux
- Timestamp:
- 04/11/05 16:15:08 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mhflux/MHEnergyEst.cc
r6917 r6924 78 78 fHResolution.SetDirectory(NULL); 79 79 fHResolution.SetName("EnergyRes"); 80 fHResolution.SetTitle("Histogram in \\frac{\\Delta E}{E_{mc}} vs E_{est} and E_{mc}");80 fHResolution.SetTitle("Histogram in \\frac{\\Delta lg(E)}{lg(E_{mc})} vs E_{est} and E_{mc}"); 81 81 fHResolution.SetXTitle("E_{est} [GeV]"); 82 82 fHResolution.SetYTitle("E_{mc} [GeV]"); 83 fHResolution.SetZTitle("\\frac{ E_{est} - E_{mc}}{E_{mc}}");83 fHResolution.SetZTitle("\\frac{lg(E_{est}) - lg(E_{mc})}{lg(E_{mc})}"); 84 84 85 85 fHImpact.SetDirectory(NULL); 86 86 fHImpact.SetName("Impact"); 87 fHImpact.SetTitle("\\frac{\\Delta E}{E} vs Impact parameter");87 fHImpact.SetTitle("\\frac{\\Delta lg(E)}{lg(E)} vs Impact parameter"); 88 88 fHImpact.SetXTitle("Impact parameter [m]"); 89 fHImpact.SetYTitle("\\frac{ E_{est} - E_{mc}}{E_{mc}}");89 fHImpact.SetYTitle("\\frac{lg(E_{est}) - lg(E_{mc})}{lg(E_{mc})}"); 90 90 91 91 fHEnergy.Sumw2(); … … 97 97 binst.SetEdgesCos(50, 0, 60); 98 98 binsi.SetEdges(10, 0, 400); 99 binsr.SetEdges( 10, 0, 1);99 binsr.SetEdges(50, -1.3, 1.3); 100 100 101 101 SetBinning(&fHEnergy, &binse, &binse, &binst); … … 164 164 const Double_t imp = fMatrix ? GetVal(1) : fMcEvt->GetImpact()/100; 165 165 const Double_t theta = fMatrix ? GetVal(2) : fMcEvt->GetTelescopeTheta()*TMath::RadToDeg(); 166 const Double_t res = (eest-etru)/etru; 166 const Double_t res = (log10(eest)-log10(etru));///log10(etru); 167 const Double_t resE = (eest-etru)/etru; 167 168 168 169 fHEnergy.Fill(eest, etru, theta, w); 169 fHResolution.Fill(eest, etru, TMath::Abs(res), w);170 fHImpact.Fill(imp, TMath::Abs(res), w);171 172 fChisq += TMath::Abs(res);//*res;170 fHResolution.Fill(eest, etru, resE, w); 171 fHImpact.Fill(imp, resE, w); 172 173 fChisq += res*res; 173 174 fBias += res; 174 175 … … 181 182 fBias /= GetNumExecutions(); 182 183 183 Double_t res = fChisq; //TMath::Sqrt(fChisq - fBias*fBias); 184 185 fResult->SetVal(TMath::IsNaN(res)?0:res);/// GetNumExecutions()); 186 187 *fLog << all << "Mean Energy Resoltuion: " << Form("%.1f%%", fResult->GetVal()*100) << endl; 188 *fLog << all << "Energy Bias at: " << Form("%.1f%%", fBias*100) << endl; 184 Double_t sigma = TMath::Sqrt(fChisq);//+TMath::Abs(fBias); 185 fResult->SetVal(sigma); 186 187 *fLog << all << "Mean log10(Energy) Resoltion: " << Form("%.1f%%", TMath::Sqrt(fChisq-fBias*fBias)*100) << endl; 188 *fLog << all << "Mean log10(Energy) Bias: " << Form("%.1f%%", fBias*100) << endl; 189 189 190 190 return kTRUE; … … 239 239 } 240 240 241 //pad->GetPad(1)->GetPad(2)->cd(2); 241 pad->GetPad(1)->GetPad(2)->cd(2); 242 /*=*/fHResolution.ProjectionZ("Resolution"); 242 243 ///*h =*/ fHImpact.ProjectionX("Impact", -1, 9999, "e"); 243 244 } … … 294 295 gPad->SetBorderMode(0); 295 296 gPad->SetLogx(); 297 gPad->SetGridx(); 298 gPad->SetGridy(); 296 299 297 300 //gROOT->GetListOfCleanups()->Add(gPad); // WHY? … … 301 304 h2->SetBit(kCanDelete); 302 305 h2->SetFillColor(kBlue); 306 h2->SetLineColor(kRed); 303 307 304 308 TH1D *h1 = h2->ProfileX(Form("Prof%s", h.GetName()), -1, 9999, "s"); … … 310 314 h1->SetStats(kFALSE); 311 315 312 313 //h1->Draw("E3"); 314 h2->Draw(); 316 h2->Draw(""); 317 h1->Draw("E3same"); 315 318 h1->Draw("Chistsame"); 316 319 … … 346 349 gPad->SetBorderMode(0); 347 350 351 gPad->SetGridx(); 352 gPad->SetGridy(); 348 353 gPad->SetLogx(); 349 354 h = (TH1D*)fHEnergy.Project3D("ey"); … … 376 381 pad3->Divide(2, 1, 1e-10, 1e-10); 377 382 pad3->cd(1); 378 gPad->SetBorderMode(0);/* 383 gPad->SetBorderMode(0); 384 gPad->SetGridx(); 385 gPad->SetGridy(); 386 h = fHEnergy.Project3D("ez"); 387 h->SetTitle("Zenith Angle Distribution"); 388 h->SetBit(TH1::kNoStats); 389 h->SetDirectory(NULL); 390 h->SetXTitle("\\Theta [\\circ]"); 391 h->SetBit(kCanDelete); 392 h->Draw(); 393 394 pad3->cd(2); 395 gPad->SetBorderMode(0); 396 gPad->SetGridx(); 397 gPad->SetGridy(); 398 /* 379 399 h = fHImpact.ProjectionX("Impact", -1, 9999, "e"); 380 400 h->SetBit(TH1::kNoStats); … … 384 404 h->SetBit(kCanDelete); 385 405 h->Draw();*/ 386 h = fHEnergy.Project3D("ez"); 387 h->SetTitle("Distribution of Theta"); 388 h->SetBit(TH1::kNoStats); 406 // ---------------------------------------- 407 h = fHResolution.ProjectionZ("Resolution"); 408 //h->SetXTitle("\\frac{lg(E_{est}) - lg(E_{mc})}{lg(E_{mc})}"); 409 h->SetYTitle("Counts"); 410 h->SetTitle("Distribution of \\Delta lg(E) / lg(E_{mc})"); 389 411 h->SetDirectory(NULL); 390 h->SetXTitle("\\Theta [\\circ]");391 412 h->SetBit(kCanDelete); 392 h->Draw(); 393 394 pad3->cd(2); 395 gPad->SetBorderMode(0); 413 h->GetXaxis()->SetRangeUser(-1.3, 1.3); 414 h->Draw(""); 415 // ---------------------------------------- 396 416 397 417 pad->cd(2); … … 413 433 h = MakePlot(fHResolution, "zy"); 414 434 h->SetXTitle("E_{mc} [GeV]"); 415 h->SetYTitle("\\frac{ E_{est} - E_{mc}}{E_{mc}}");416 h->SetTitle("Energy resolution \\Delta E / Evs Monte Carlo energy E_{mc}");417 h->SetMinimum( 0);418 h->SetMaximum(1 );435 h->SetYTitle("\\frac{lg(E_{est}) - lg(E_{mc})}{lg(E_{mc})}"); 436 h->SetTitle("Energy resolution \\Delta lg(E) / lg(E) vs Monte Carlo energy E_{mc}"); 437 h->SetMinimum(-1.3); 438 h->SetMaximum(1.3); 419 439 420 440 pad2->cd(3); 421 441 h = MakePlot(fHResolution, "zx"); 422 442 h->SetXTitle("E_{est} [GeV]"); 423 h->SetYTitle("\\frac{ E_{est} - E_{mc}}{E_{mc}}");424 h->SetTitle("Energy Resolution \\Delta E / Evs estimated Energy E_{est}");425 h->SetMinimum( 0);426 h->SetMaximum(1 );443 h->SetYTitle("\\frac{lg(E_{est}) - lg(E_{mc})}{lg(E_{mc})}"); 444 h->SetTitle("Energy Resolution \\Delta lg(E) / lg(E) vs estimated Energy E_{est}"); 445 h->SetMinimum(-1.3); 446 h->SetMaximum(1.3); 427 447 } 428 448
Note:
See TracChangeset
for help on using the changeset viewer.