- Timestamp:
- 04/20/05 16:18:37 (20 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r6965 r6966 44 44 - print result of optimization in case MAlphaFitter is used 45 45 - store results back in initial MAlphaFitter 46 47 * mjobs/MJSpectrum.[h,cc]: 48 - implemented a faster simple mode weighting the read spectrum 49 with the theta-probability 46 50 47 51 -
trunk/MagicSoft/Mars/mjobs/MJSpectrum.cc
r6961 r6966 301 301 } 302 302 303 void MJSpectrum::DisplayResult(const MH3 &mh1) const303 void MJSpectrum::DisplayResult(const TH2D &h2) const 304 304 { 305 305 if (!fDisplay->CdCanvas("ZdDist")) 306 306 return; 307 308 const TH2D &h2 = (const TH2D&)mh1.GetHist();309 307 310 308 TH1D &proj = *h2.ProjectionX(); … … 446 444 return kFALSE; 447 445 } 448 /* 446 447 TH1D temp2(temp1); 448 if (!ReadOrigMCDistribution(set, temp2)) 449 return kFALSE; 450 451 if (!GetThetaDistribution(temp1, temp2)) 452 return kFALSE; 453 454 if (fRefill && !Refill(plist, temp2)) 455 return kFALSE; 456 449 457 TH2D hist; 458 MH3 mh1("MMcEvtBasic.fTelescopeTheta*kRad2Deg", "MMcEvtBasic.fEnergy"); 450 459 if (fSimpleMode) 451 460 { … … 455 464 return kFALSE; 456 465 457 TCanvas &c =fDisplay->AddTab("test"); 458 c.Divide(2,2); 459 c.cd(1); 460 gPad->SetLogy(); 461 hist.DrawCopy(); 462 c.cd(2); 463 hist.ProjectionX()->Draw(); 464 c.cd(3); 465 hist.ProjectionY()->Draw(); 466 467 MH3 mh1(hist); 466 for (int y=0; y<hist.GetNbinsY(); y++) 467 for (int x=0; x<hist.GetNbinsX(); x++) 468 hist.SetBinContent(x, y, hist.GetBinContent(x, y)*temp1.GetBinContent(x)); 469 } 470 else 471 { 472 MTaskList tlist1; 473 plist.Replace(&tlist1); 474 475 MReadMarsFile readmc("OriginalMC"); 476 //readmc.DisableAutoScheme(); 477 set.AddFilesOn(readmc); 478 readmc.EnableBranch("MMcEvtBasic.fTelescopeTheta"); 479 readmc.EnableBranch("MMcEvtBasic.fEnergy"); 480 468 481 mh1.SetLogy(); 469 482 mh1.SetLogz(); 470 483 mh1.SetName("ThetaE"); 471 } 472 */ 473 TH1D temp2(temp1); 474 if (!ReadOrigMCDistribution(set, temp2)) 475 return kFALSE; 476 477 if (!GetThetaDistribution(temp1, temp2)) 478 return kFALSE; 479 480 if (fRefill && !Refill(plist, temp2)) 481 return kFALSE; 482 483 // ------------------- Loop1 ---------------------------- 484 485 MTaskList tlist1; 486 plist.Replace(&tlist1); 487 488 MReadMarsFile readmc("OriginalMC"); 489 //readmc.DisableAutoScheme(); 490 set.AddFilesOn(readmc); 491 readmc.EnableBranch("MMcEvtBasic.fTelescopeTheta"); 492 readmc.EnableBranch("MMcEvtBasic.fEnergy"); 493 494 MH3 mh1("MMcEvtBasic.fTelescopeTheta*kRad2Deg", "MMcEvtBasic.fEnergy"); 495 mh1.SetLogy(); 496 mh1.SetLogz(); 497 mh1.SetName("ThetaE"); 498 499 MFillH fill0(&mh1); 500 //fill0.SetDrawOption("projx only"); 501 502 MBinning binsx(bins3, "BinningThetaEX"); 503 MBinning binsy(bins2, "BinningThetaEY"); 504 plist.AddToList(&binsx); 505 plist.AddToList(&binsy); 506 tlist1.AddToList(&readmc); 507 508 temp1.SetXTitle("MMcEvtBasic.fTelescopeTheta*kRad2Deg"); 509 MH3 mh3mc(temp1); 510 511 MFEventSelector2 sel1(mh3mc); 512 sel1.SetHistIsProbability(); 513 514 fill0.SetFilter(&sel1); 515 516 tlist1.AddToList(&sel1); 517 tlist1.AddToList(&fill0); 518 519 MEvtLoop loop1(fName); 520 loop1.SetParList(&plist); 521 loop1.SetLogStream(fLog); 522 loop1.SetDisplay(fDisplay); 523 524 if (!SetupEnv(loop1)) 525 return kFALSE; 526 527 if (!loop1.Eventloop(fMaxEvents)) 528 { 529 *fLog << err << GetDescriptor() << ": Processing of MC-data failed." << endl; 530 return kFALSE; 531 } 532 533 tlist1.PrintStatistics(); 534 535 if (!loop1.GetDisplay()) 536 { 537 *fLog << err << GetDescriptor() << ": Execution stopped by user." << endl; 538 return kFALSE; 539 } 540 541 DisplayResult(mh1); 484 485 MFillH fill0(&mh1); 486 //fill0.SetDrawOption("projx only"); 487 488 MBinning binsx(bins3, "BinningThetaEX"); 489 MBinning binsy(bins2, "BinningThetaEY"); 490 plist.AddToList(&binsx); 491 plist.AddToList(&binsy); 492 tlist1.AddToList(&readmc); 493 494 temp1.SetXTitle("MMcEvtBasic.fTelescopeTheta*kRad2Deg"); 495 MH3 mh3mc(temp1); 496 497 MFEventSelector2 sel1(mh3mc); 498 sel1.SetHistIsProbability(); 499 500 fill0.SetFilter(&sel1); 501 502 tlist1.AddToList(&sel1); 503 tlist1.AddToList(&fill0); 504 505 MEvtLoop loop1(fName); 506 loop1.SetParList(&plist); 507 loop1.SetLogStream(fLog); 508 loop1.SetDisplay(fDisplay); 509 510 if (!SetupEnv(loop1)) 511 return kFALSE; 512 513 if (!loop1.Eventloop(fMaxEvents)) 514 { 515 *fLog << err << GetDescriptor() << ": Processing of MC-data failed." << endl; 516 return kFALSE; 517 } 518 519 tlist1.PrintStatistics(); 520 521 if (!loop1.GetDisplay()) 522 { 523 *fLog << err << GetDescriptor() << ": Execution stopped by user." << endl; 524 return kFALSE; 525 } 526 } 527 528 DisplayResult(fSimpleMode ? hist : (TH2D&)mh1.GetHist()); 542 529 543 530 // ------------------------- Final loop -------------------------- … … 579 566 // Make sure to use the same binning for MHCollectionArea and MHEnergyEst 580 567 MHCollectionArea area; 581 area.SetHistAll( (TH2D&)mh1.GetHist());568 area.SetHistAll(fSimpleMode ? hist : (TH2D&)mh1.GetHist()); 582 569 MHEnergyEst hest; 583 570 -
trunk/MagicSoft/Mars/mjobs/MJSpectrum.h
r6958 r6966 8 8 class TH1; 9 9 class TH1D; 10 class TH2D; 10 11 11 12 class MH3; … … 33 34 Bool_t ReadOrigMCDistribution(const MDataSet &set, TH1 &h) const; 34 35 Bool_t GetThetaDistribution(TH1D &temp1, TH1D &temp2) const; 35 void DisplayResult(const MH3&mh1) const;36 void DisplayResult(const TH2D &mh1) const; 36 37 Bool_t Refill(MParList &plist, TH1D &h) const; 37 38
Note:
See TracChangeset
for help on using the changeset viewer.