- Timestamp:
- 07/28/07 00:16:22 (17 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r8648 r8651 18 18 19 19 -*-*- END OF LINE -*-*- 20 21 2007/07/2 Thomas Bretz 22 23 * mjobs/MJSpectrum.[h,cc]: 24 - added CutQ 25 - added some checks for the Zenith angle distribution 26 27 20 28 21 29 2007/07/26 Daniela Dorner -
trunk/MagicSoft/Mars/mjobs/MJSpectrum.cc
r8587 r8651 86 86 87 87 MJSpectrum::MJSpectrum(const char *name, const char *title) 88 : fCut 0(0),fCut1(0), fCut2(0), fCut3(0), fEstimateEnergy(0),88 : fCutQ(0), fCut0(0),fCut1(0), fCut2(0), fCut3(0), fEstimateEnergy(0), 89 89 fCalcHadronness(0), fRefill(kFALSE), fSimpleMode(kTRUE), 90 90 fRawMc(kFALSE), fNoThetaWeights(kFALSE) … … 96 96 MJSpectrum::~MJSpectrum() 97 97 { 98 if (fCutQ) 99 delete fCutQ; 98 100 if (fCut0) 99 101 delete fCut0; … … 159 161 160 162 fLog->Separator("Used Cuts"); 163 fCutQ->Print(); 161 164 fCut0->Print(); 162 165 fCut1->Print(); … … 246 249 arr.DisplayIn(*fDisplay, "Hist"); 247 250 251 if (!ReadTask(fCutQ, "CutQ")) 252 return -1; 248 253 if (!ReadTask(fCut0, "Cut0")) 249 254 return -1; … … 375 380 // Display the final theta distribution. 376 381 // 377 voidMJSpectrum::DisplayResult(const TH2D &h2) const382 Bool_t MJSpectrum::DisplayResult(const TH2D &h2) const 378 383 { 379 384 if (!fDisplay || !fDisplay->CdCanvas("ZdDist")) … … 395 400 pad->cd(1); 396 401 TH1D *theta = (TH1D*)gPad->FindObject("Theta"); 397 if (theta) 398 { 399 proj.Scale(theta->GetMaximum()/proj.GetMaximum()); 400 theta->SetMaximum(1.05*TMath::Max(theta->GetMaximum(), proj.GetMaximum())); 401 } 402 if (!theta) 403 { 404 *fLog << err << "ERROR - Theta-Histogram vanished... cannot proceed." << endl; 405 return kFALSE; 406 } 407 408 if (proj.GetMaximum()==0) 409 { 410 *fLog << err; 411 *fLog << "ERROR - The Zenith Angle distribution of your Monte Carlos doesn't overlap"; 412 *fLog << " with the the Zenith Angle distribution of your observation."; 413 theta->SetLineColor(kRed); 414 return kFALSE;; 415 } 416 417 proj.Scale(theta->GetMaximum()/proj.GetMaximum()); 418 theta->SetMaximum(1.05*TMath::Max(theta->GetMaximum(), proj.GetMaximum())); 419 402 420 proj.Draw("same"); 421 422 // Compare both histograms 423 const Double_t prob = proj.Chi2Test(theta, ""); 424 if (prob==1) 425 return kTRUE; 426 427 if (prob>0.99) 428 { 429 *fLog << inf; 430 *fLog << "The Zenith Angle distribution of your Monte Carlos fits well"; 431 *fLog << "with the the Zenith Angle distribution of your observation."; 432 return kTRUE; 433 } 434 435 // <0.01: passen gar nicht 436 // ==1: passen perfekt 437 // >0.99: passer sehr gut 438 439 if (prob<0.01) 440 { 441 *fLog << err; 442 *fLog << "ERROR - The Zenith Angle distribution of your Monte Carlos does not fit"; 443 *fLog << " with the the Zenith Angle distribution of your observation."; 444 theta->SetLineColor(kRed); 445 return kFALSE; 446 } 447 448 *fLog << warn; 449 *fLog << "WARNING - The Zenith Angle distribution of your Monte Carlos doesn't fits well"; 450 *fLog << " with the the Zenith Angle distribution of your observation."; 451 return kTRUE; 403 452 } 404 453 … … 1131 1180 } 1132 1181 1133 DisplayResult(fSimpleMode ? hist : (TH2D&)mh1.GetHist()); 1182 if (!DisplayResult(fSimpleMode ? hist : (TH2D&)mh1.GetHist())) 1183 return kFALSE; 1134 1184 1135 1185 // ------------------------- Final loop -------------------------- … … 1245 1295 tlist2.AddToList(&fill1a); 1246 1296 tlist2.AddToList(&fill30); 1297 tlist2.AddToList(fCutQ); 1247 1298 tlist2.AddToList(fCut0); 1248 1299 tlist2.AddToList(&taskenv0); -
trunk/MagicSoft/Mars/mjobs/MJSpectrum.h
r8173 r8651 24 24 { 25 25 private: 26 MTask *fCutQ; 26 27 MTask *fCut0; 27 28 MTask *fCut1; … … 46 47 // Display Output 47 48 void PrintSetup(const MAlphaFitter &fit) const; 48 voidDisplayResult(const TH2D &mh1) const;49 Bool_t DisplayResult(const TH2D &mh1) const; 49 50 Bool_t IntermediateLoop(MParList &plist, MH3 &h1, TH1D &temp1, const MDataSet &set, MMcSpectrumWeight &w) const; 50 51 TArrayD FitSpectrum(TH1D &spectrum) const;
Note:
See TracChangeset
for help on using the changeset viewer.