Changeset 5994 for trunk/MagicSoft/Mars/mhbase
- Timestamp:
- 01/25/05 14:47:59 (20 years ago)
- Location:
- trunk/MagicSoft/Mars/mhbase
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mhbase/MFillH.cc
r5713 r5994 358 358 // if fDisplay is set and the MH-class overwrites the Draw function 359 359 // 360 // If the draw-option contains 'same' (case insensitive) a tab with the 361 // same name as the one which would be created is searched and the 362 // MH is drawn to this canvas. If it is not found a new tab is created. 363 // 360 364 Bool_t MFillH::DrawToDisplay() 361 365 { … … 371 375 return kTRUE; 372 376 373 fCanvas = &fDisplay->AddTab(fNameTab.IsNull() ? fH->GetName() : fNameTab.Data()); 377 const TString tabname = fNameTab.IsNull() ? fH->GetName() : fNameTab.Data(); 378 379 fCanvas = 0; 380 if (fDrawOption.Contains("same", TString::kIgnoreCase)) 381 fCanvas = fDisplay->GetCanvas(tabname); 382 if (!fCanvas) 383 fCanvas = &fDisplay->AddTab(tabname); 384 385 fCanvas->cd(); 374 386 fH->Draw(fDrawOption); 375 387 -
trunk/MagicSoft/Mars/mhbase/MH.cc
r5869 r5994 795 795 // Also layout the two statistic boxes and a legend. 796 796 // 797 void MH::DrawSame(TH1 &hist1, TH1 &hist2, const TString title )797 void MH::DrawSame(TH1 &hist1, TH1 &hist2, const TString title, Bool_t same) 798 798 { 799 799 // 800 800 // Draw first histogram 801 801 // 802 hist1.Draw( );802 hist1.Draw(same?"same":""); 803 803 gPad->SetBorderMode(0); 804 804 gPad->Update(); -
trunk/MagicSoft/Mars/mhbase/MH.h
r4991 r5994 85 85 86 86 static void DrawSameCopy(const TH1 &hist1, const TH1 &hist2, const TString title); 87 static void DrawSame(TH1 &hist1, TH1 &hist2, const TString title );87 static void DrawSame(TH1 &hist1, TH1 &hist2, const TString title, Bool_t same=kFALSE); 88 88 89 89 TObject *Clone(const char *name="") const; -
trunk/MagicSoft/Mars/mhbase/MH3.cc
r5956 r5994 103 103 // 104 104 MH3::MH3(const unsigned int dim) 105 : fDimension(dim>3?3:dim), fHist(NULL)/*, 106 fNameProfX(Form("ProfX_%p", this)), 107 fNameProfY(Form("ProfY_%p", this))*/ 105 : fDimension(dim>3?3:dim), fHist(NULL) 108 106 { 109 107 switch (fDimension) … … 205 203 // 206 204 MH3::MH3(const char *memberx, const char *membery) 207 : fDimension(2) /*, fNameProfX(Form("ProjX_%p", this)), fNameProfY(Form("ProjY_%p", this))*/205 : fDimension(2) 208 206 { 209 207 fHist = new TH2F; … … 539 537 540 538 TString str(o); 541 str = str.Strip(TString::kBoth); 542 543 Bool_t only = str.Contains("ONLY", TString::kIgnoreCase) && fDimension==2; 544 Bool_t same = str.Contains("SAME", TString::kIgnoreCase) && fDimension==2; 545 Bool_t blue = str.Contains("BLUE", TString::kIgnoreCase) && fDimension==2; 539 str.ToLower(); 540 541 const Bool_t only = str.Contains("only") && fDimension==2; 542 const Bool_t same = str.Contains("same") && fDimension==2; 543 const Bool_t blue = str.Contains("blue") && fDimension==2; 544 const Bool_t profx = str.Contains("profx") && fDimension==2; 545 const Bool_t profy = str.Contains("profy") && fDimension==2; 546 // Do NOT replace 'same'-option 547 str.ReplaceAll("only", ""); 548 str.ReplaceAll("blue", ""); 549 str.ReplaceAll("profx", ""); 550 str.ReplaceAll("profy", ""); 546 551 547 552 // FIXME: We may have to remove all our own options from str! … … 549 554 fHist->Draw(str); 550 555 551 if ( str.Contains("PROFX", TString::kIgnoreCase) && fDimension==2)556 if (profx) 552 557 { 553 558 TProfile *p = ((TH2*)fHist)->ProfileX("ProfX", -1, 9999, "s"); … … 563 568 } 564 569 } 565 if ( str.Contains("PROFY", TString::kIgnoreCase) && fDimension==2)570 if (profy) 566 571 { 567 572 TProfile *p = ((TH2*)fHist)->ProfileY("ProfY", -1, 9999, "s");
Note:
See TracChangeset
for help on using the changeset viewer.