Changeset 1003 for trunk/MagicSoft/Mars/mhist/MH.cc
- Timestamp:
- 10/29/01 11:15:53 (23 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mhist/MH.cc
r888 r1003 40 40 #include "MH.h" 41 41 42 #include <TCanvas.h> 43 42 44 ClassImp(MH); 43 45 … … 52 54 // set the name and title of this object 53 55 // 54 *fName = name ? name : "MH" ;55 *fTitle = title ? title : "Base class for Mars histograms" ;56 fName = name ? name : "MH" ; 57 fTitle = title ? title : "Base class for Mars histograms" ; 56 58 } 57 59 60 TCanvas *MH::MakeDefCanvas(const char *name, const char *title, 61 const UInt_t w, const UInt_t h) 62 { 63 const TList *list = (TList*)gROOT->GetListOfCanvases(); 64 65 const char *def = name ? name : gROOT->GetDefCanvasName(); 66 67 TCanvas *c; 68 if (list->FindObject(def)) 69 { 70 const char *n = StrDup(Form("%s <%d>", def, list->GetSize()+1)); 71 c = new TCanvas(n, title, w, h); 72 delete [] n; 73 } 74 else 75 c = new TCanvas(def, title, w, h); 76 77 return c; 78 } 79 80 TCanvas *MH::MakeDefCanvas(const TObject *obj, 81 const UInt_t w, const UInt_t h) 82 { 83 return MakeDefCanvas(obj->GetName(), obj->GetTitle(), w, h); 84 }
Note:
See TracChangeset
for help on using the changeset viewer.