Changeset 6976 for trunk/MagicSoft/Mars/mbase
- Timestamp:
- 04/22/05 18:28:07 (20 years ago)
- Location:
- trunk/MagicSoft/Mars/mbase
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mbase/MStatusArray.cc
r6948 r6976 29 29 // Helper class for MStatusDisplay 30 30 // 31 // If you want to read a MStatusArray (normally with name MStatusDisplay) 32 // it is recommended to do it like this: 33 // TFile f("myfile.root", "read"); 34 // MStatusArray arr; 35 // arr.Read(); 36 // 37 // If you want to use TFile::Get or TFile::GetObject you should switch off 38 // addding Histograms automatically to the current directory first: 39 // TFile f("myfile.root", "read"); 40 // TH1::AddDirectory(kFALSE); 41 // f.Get("MStatusDisplay"); 42 // 31 43 ////////////////////////////////////////////////////////////////////////////// 32 44 #include "MStatusArray.h" 33 45 46 #include <TH1.h> // TH1::AddDirectoryStatus(); 34 47 #include <TClass.h> 35 48 #include <TCanvas.h> … … 44 57 using namespace std; 45 58 59 // -------------------------------------------------------------------------- 60 // 61 // If o==NULL a new status display is created, otherwise the one with name o 62 // is searched in gROOT->GetListOfSpecials(). 63 // In this display the contents of the MStatusArray is displayed. 64 // 46 65 TObject *MStatusArray::DisplayIn(Option_t *o) const 47 66 { … … 63 82 } 64 83 84 // -------------------------------------------------------------------------- 85 // 86 // Display the contents of the given tab in the display given as argument. 87 // 65 88 void MStatusArray::DisplayIn(MStatusDisplay &d, const char *tab) const 66 89 { … … 224 247 // -------------------------------------------------------------------------- 225 248 // 249 // Switch off adding histograms to current directory before reading. 250 // Switch back 251 // 252 Int_t MStatusArray::Read(const char *name) 253 { 254 const Bool_t store = TH1::AddDirectoryStatus(); 255 TH1::AddDirectory(kFALSE); 256 const Int_t rc = TObjArray::Read(name?name:"MStatusDisplay"); 257 TH1::AddDirectory(store); 258 return rc; 259 } 260 261 // -------------------------------------------------------------------------- 262 // 226 263 // Print recursively all objects in this and sub-pads. If !option.IsNull() 227 264 // only objects in the corresponding pad are printed. -
trunk/MagicSoft/Mars/mbase/MStatusArray.h
r6948 r6976 30 30 31 31 void Print(Option_t *o="") const; 32 void Print(Option_t *wildcard, Option_t *option) const 33 { 34 Print(wildcard); 35 } 32 36 33 37 TObject *FindObject(const char *object, const char *base) const; … … 35 39 TObject *FindObject(const TObject *o) const { return 0; } 36 40 41 Int_t Read(const char *name=NULL); 42 37 43 ClassDef(MStatusArray, 0) // Helper class for status display 38 44 };
Note:
See TracChangeset
for help on using the changeset viewer.