Changeset 6890 for trunk/MagicSoft/Mars/mhflux
- Timestamp:
- 03/29/05 09:56:16 (20 years ago)
- Location:
- trunk/MagicSoft/Mars/mhflux
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mhflux/FluxLinkDef.h
r6883 r6890 10 10 #pragma link C++ class MHEnergyEst+; 11 11 #pragma link C++ class MHFalseSource+; 12 #pragma link C++ class MHEnergyEst+; 12 13 #pragma link C++ class MHEffectiveOnTime+; 13 14 -
trunk/MagicSoft/Mars/mhflux/MHAlpha.cc
r6874 r6890 138 138 MBinning binsa, binse, binst; 139 139 binsa.SetEdges(18, 0, 90); 140 binse.SetEdgesLog( 25, 10, 100000);140 binse.SetEdgesLog(15, 10, 100000); 141 141 binst.SetEdgesCos(50, 0, 60); 142 142 binse.Apply(fHEnergy); … … 467 467 468 468 alpha = hil->GetAlpha(); 469 469 470 if (fHillas) 470 471 size = fHillas->GetSize(); … … 472 473 theta = fPointPos ? fPointPos->GetZd() : 0; 473 474 } 475 476 //if (size>0) 477 // alpha /= (2.4 + 1.13*(log10((energy-14)/0.37)-5)*(log10((energy-14)/0.37)-5))/15; 474 478 475 479 // enhance histogram if necessary … … 563 567 } 564 568 } 569 else 570 hon->SetMinimum(0); 565 571 FitEnergyBins(); 566 572 FitThetaBins(); … … 748 754 Int_t n = fHAlpha.GetNbinsY(); 749 755 Int_t nc = (Int_t)(TMath::Sqrt((Float_t)n-1)+1); 750 c->Divide(nc, nc, 0,0);756 c->Divide(nc, nc, 1e-10, 1e-10); 751 757 752 758 // Do not store the 'final' result in fFit -
trunk/MagicSoft/Mars/mhflux/MHEnergyEst.cc
r6283 r6890 147 147 148 148 fChisq = 0; 149 fHEnergy.Reset(); 150 fHImpact.Reset(); 151 fHResolution.Reset(); 149 152 150 153 return kTRUE; … … 159 162 const Double_t eest = fEnergy->GetEnergy(); 160 163 const Double_t etru = fMatrix ? GetVal(0) : fMcEvt->GetEnergy(); 164 const Double_t imp = fMatrix ? GetVal(1) : fMcEvt->GetImpact()/100; 161 165 const Double_t theta = fMatrix ? GetVal(2) : fMcEvt->GetTelescopeTheta()*TMath::RadToDeg(); 162 const Double_t imp = fMatrix ? GetVal(1) : fMcEvt->GetImpact()/100;163 166 const Double_t res = (eest-etru)/etru; 164 167 165 168 fHEnergy.Fill(eest, etru, theta, w); 166 fHResolution.Fill(eest, etru, res, w); 167 fHImpact.Fill(imp, res, w); 168 169 fChisq += res*res; 169 fHResolution.Fill(eest, etru, TMath::Abs(res), w); 170 fHImpact.Fill(imp, TMath::Abs(res), w); 171 172 fChisq += TMath::Abs(res);//*res; 173 fBias += res; 170 174 171 175 return kTRUE; … … 175 179 { 176 180 fChisq /= GetNumExecutions(); 177 178 fResult->SetVal(fChisq); 179 180 *fLog << all << "Mean Energy Resoltuion: " << Form("%.1f%%", TMath::Sqrt(fChisq)*100) << endl; 181 fBias /= GetNumExecutions(); 182 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; 181 189 182 190 return kTRUE; … … 223 231 { 224 232 pad->GetPad(1)->GetPad(2)->cd(1); 225 /*h =*/ fHImpact.ProjectionX("Impact", -1, 9999, "e"); 226 227 pad->GetPad(1)->GetPad(2)->cd(2); 228 if ((hx=(TH1D*)gPad->FindObject("EnergyEst_z"))) 233 if ((hx=(TH1D*)gPad->FindObject("EnergyEst_ez"))) 229 234 { 230 TH1D *h2 = (TH1D*)fHEnergy.Project3D("dum_ z");235 TH1D *h2 = (TH1D*)fHEnergy.Project3D("dum_ez"); 231 236 hx->Reset(); 232 237 hx->Add(h2); 233 238 delete h2; 234 239 } 240 241 //pad->GetPad(1)->GetPad(2)->cd(2); 242 ///*h =*/ fHImpact.ProjectionX("Impact", -1, 9999, "e"); 235 243 } 236 244 } … … 273 281 274 282 TH1D *hx = 0; 275 if ((hx=(TH1D*)gPad->FindObject( "Prof")))283 if ((hx=(TH1D*)gPad->FindObject(Form("Prof%s", h.GetName())))) 276 284 { 277 hx = hyx->ProfileX( "Prof", -1, 9999, "s");285 hx = hyx->ProfileX(Form("Prof%s", h.GetName()), -1, 9999, "s"); 278 286 279 287 if (logy && hx->GetMaximum()>0) … … 287 295 gPad->SetLogx(); 288 296 289 gROOT->GetListOfCleanups()->Add(gPad); // WHY?297 //gROOT->GetListOfCleanups()->Add(gPad); // WHY? 290 298 291 299 TH2D *h2 = (TH2D*)h.Project3D(how); 292 TH1D *h1 = h2->ProfileX("Prof", -1, 9999, "s");293 294 h1->SetDirectory(NULL);295 //h1->SetBit(kCanDelete);296 h1->SetLineWidth(2);297 h1->SetLineColor(kRed); // PROBLEM!298 h1->SetStats(kFALSE);299 300 300 h2->SetDirectory(NULL); 301 301 h2->SetBit(kCanDelete); 302 302 h2->SetFillColor(kBlue); 303 303 304 h1->Draw("E3"); 305 h2->Draw("boxsame"); 304 TH1D *h1 = h2->ProfileX(Form("Prof%s", h.GetName()), -1, 9999, "s"); 305 h1->SetDirectory(NULL); 306 h1->SetBit(kCanDelete); 307 h1->SetLineWidth(2); 308 h1->SetLineColor(kRed); 309 h1->SetFillStyle(4000); 310 h1->SetStats(kFALSE); 311 312 313 //h1->Draw("E3"); 314 h2->Draw(); 306 315 h1->Draw("Chistsame"); 307 316 … … 323 332 324 333 pad->SetBorderMode(0); 325 pad->Divide(2, 1, 0,0);334 pad->Divide(2, 1, 1e-10, 1e-10); 326 335 327 336 TH1 *h; … … 330 339 gPad->SetBorderMode(0); 331 340 332 gPad->Divide(1, 2, 0,0);341 gPad->Divide(1, 2, 1e-10, 1e-10); 333 342 334 343 TVirtualPad *pad2 = gPad; … … 365 374 366 375 TVirtualPad *pad3 = gPad; 367 pad3->Divide(2, 1, 0,0);376 pad3->Divide(2, 1, 1e-10, 1e-10); 368 377 pad3->cd(1); 369 gPad->SetBorderMode(0); 378 gPad->SetBorderMode(0);/* 370 379 h = fHImpact.ProjectionX("Impact", -1, 9999, "e"); 371 380 h->SetBit(TH1::kNoStats); … … 374 383 h->SetXTitle("Impact [m]"); 375 384 h->SetBit(kCanDelete); 376 h->Draw(); 377 378 pad3->cd(2); 379 gPad->SetBorderMode(0); 385 h->Draw();*/ 380 386 h = fHEnergy.Project3D("ez"); 381 387 h->SetTitle("Distribution of Theta"); … … 386 392 h->Draw(); 387 393 394 pad3->cd(2); 395 gPad->SetBorderMode(0); 396 388 397 pad->cd(2); 389 398 gPad->SetBorderMode(0); 390 399 391 gPad->Divide(1, 3, 0,0);400 gPad->Divide(1, 3, 1e-10, 1e-10); 392 401 pad2 = gPad; 393 402 -
trunk/MagicSoft/Mars/mhflux/MHEnergyEst.h
r6283 r6890 35 35 36 36 Double_t fChisq; 37 Double_t fBias; 37 38 38 39 TH1 *MakePlot(TH3 &h, const char *how); -
trunk/MagicSoft/Mars/mhflux/MHFalseSource.cc
r6364 r6890 410 410 411 411 // Get projection for range 412 TH2D *p = (TH2D*)src.Project3D("yx_off ");412 TH2D *p = (TH2D*)src.Project3D("yx_off_NULL"); 413 413 414 414 // Reset range 415 415 axe.SetRange(0,9999); 416 416 417 //#if ROOT_VERSION_CODE < ROOT_VERSION(4,02,00) 417 418 // Move contents from projection to h2 418 419 h2->Reset(); … … 422 423 // Delete p 423 424 delete p; 425 /*#else 426 p->Scale(all->GetMaximum()); 427 p->Divide(all); 428 #endif*/ 424 429 425 430 // Set Minimum as minimum value Greater Than 0 … … 442 447 443 448 // Get projection for range 444 TH2D *p = (TH2D*)src.Project3D("yx_on ");449 TH2D *p = (TH2D*)src.Project3D("yx_on_NULL"); 445 450 446 451 // Reset range 447 452 axe.SetRange(0,9999); 448 453 454 //#if ROOT_VERSION_CODE < ROOT_VERSION(4,02,00) 449 455 // Move contents from projection to h3 450 456 h3->Reset(); … … 454 460 // Delete p 455 461 delete p; 462 /*#else 463 p->Scale(all->GetMaximum()); 464 p->Divide(all); 465 #endif*/ 456 466 457 467 // Set Minimum as minimum value Greater Than 0 … … 469 479 470 480 // Get projection for range 471 TH2D *p = (TH2D*)fHist.Project3D(Form("yx_%d", gRandom->Uniform(999999))); 472 p->SetDirectory(0);481 #if ROOT_VERSION_CODE < ROOT_VERSION(4,02,00) 482 TH2D *p = (TH2D*)fHist.Project3D("yx_all"); 473 483 474 484 // Move contents from projection to h3 … … 476 486 h3->Add(p); 477 487 delete p; 488 #else 489 fHist.Project3D("yx_all"); 490 #endif 478 491 479 492 // Set Minimum as minimum value Greater Than 0 … … 518 531 TH2D* h5; 519 532 520 /*521 fHistProjAll = Form("All_%p", this);522 fHistProjOn = Form("On_%p", this);523 fHistProjOff = Form("Off_%p", this);524 fHistProjDiff = Form("Diff_%p", this);525 fHistProjAll = Form("All_%p", this);526 */527 528 533 // Update projection of all-events 529 534 padsave->GetPad(2)->cd(3); … … 559 564 const Int_t nx = h4->GetXaxis()->GetNbins(); 560 565 const Int_t ny = h4->GetYaxis()->GetNbins(); 561 //const Int_t nr = nx*nx + ny*ny;562 566 563 567 Int_t maxx=nx/2; … … 566 570 Int_t max = h4->GetBin(nx, ny); 567 571 572 h4->SetEntries(0); 568 573 for (int ix=1; ix<=nx; ix++) 569 574 for (int iy=1; iy<=ny; iy++) … … 651 656 AppendPad(""); 652 657 653 pad->Divide(1, 2, 0, 0.03);658 pad->Divide(1, 2, 1e-10, 0.03); 654 659 655 660 // TObject *catalog = GetCatalog(); … … 1048 1053 gStyle->SetPalette(1, 0); 1049 1054 1050 c->Divide(3,2, 0,0);1055 c->Divide(3,2, 1e-10, 1e-10); 1051 1056 c->cd(1); 1052 1057 gPad->SetBorderMode(0);
Note:
See TracChangeset
for help on using the changeset viewer.