Changeset 2098 for trunk/MagicSoft/Mars/mhist
- Timestamp:
- 05/08/03 18:00:03 (22 years ago)
- Location:
- trunk/MagicSoft/Mars/mhist
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mhist/MH.cc
r2052 r2098 630 630 // Draw second histogram 631 631 // 632 ((TH1&)hist2).DrawCopy("sames");632 TH1 *h2 = ((TH1&)hist2).DrawCopy("sames"); 633 633 gPad->Update(); 634 634 … … 642 642 s2.GetY1NDC()-0.01 643 643 ); 644 l.AddEntry( (TH1*)&hist1, hist1.GetTitle());645 l.AddEntry( (TH1*)&hist2, hist2.GetTitle());644 l.AddEntry(h1, h1->GetTitle()); 645 l.AddEntry(h2, h2->GetTitle()); 646 646 l.SetTextSize(s2.GetTextSize()); 647 647 l.SetTextFont(s2.GetTextFont()); … … 749 749 // -------------------------------------------------------------------------- 750 750 // 751 // Encapsulate the TObject::Clone such, that a cloned TH1 (or derived) 752 // object is not added to the current directory, when cloned. 753 // 754 TObject *MH::Clone(const char *name) const 755 { 756 Bool_t store = TH1::AddDirectoryStatus(); 757 TH1::AddDirectory(kFALSE); 758 759 TObject *o = MParContainer::Clone(name); 760 761 TH1::AddDirectory(store); 762 763 return o; 764 } 765 766 // -------------------------------------------------------------------------- 767 // 751 768 // If the opt string contains 'nonew' or gPad is not given a new canvas 752 769 // with size w/h is created. Otherwise the object is cloned and drawn … … 763 780 gROOT->SetSelectedPad(NULL); 764 781 765 Bool_t store = TH1::AddDirectoryStatus();766 TH1::AddDirectory(kFALSE);767 768 782 TObject *o = MParContainer::DrawClone(opt); 769 783 o->SetBit(kCanDelete); 770 771 TH1::AddDirectory(store);772 773 784 return o; 774 785 } -
trunk/MagicSoft/Mars/mhist/MH.h
r2043 r2098 61 61 static void Draw(TH1 &hist1, TH1 &hist2, const TString title); 62 62 63 TObject *Clone(const char *name="") const; 64 63 65 void Draw(Option_t *o="") { MParContainer::Draw(o); } 64 66 TObject *DrawClone(Option_t *opt, Int_t w, Int_t h) const;
Note:
See TracChangeset
for help on using the changeset viewer.