Ignore:
Timestamp:
04/22/05 18:28:07 (20 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mbase
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mbase/MStatusArray.cc

    r6948 r6976  
    2929//  Helper class for MStatusDisplay
    3030//
     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//
    3143//////////////////////////////////////////////////////////////////////////////
    3244#include "MStatusArray.h"
    3345
     46#include <TH1.h>      // TH1::AddDirectoryStatus();
    3447#include <TClass.h>
    3548#include <TCanvas.h>
     
    4457using namespace std;
    4558
     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//
    4665TObject *MStatusArray::DisplayIn(Option_t *o) const
    4766{
     
    6382}
    6483
     84// --------------------------------------------------------------------------
     85//
     86// Display the contents of the given tab in the display given as argument.
     87//
    6588void MStatusArray::DisplayIn(MStatusDisplay &d, const char *tab) const
    6689{
     
    224247// --------------------------------------------------------------------------
    225248//
     249// Switch off adding histograms to current directory before reading.
     250// Switch back
     251//
     252Int_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//
    226263// Print recursively all objects in this and sub-pads. If !option.IsNull()
    227264// only objects in the corresponding pad are printed.
  • trunk/MagicSoft/Mars/mbase/MStatusArray.h

    r6948 r6976  
    3030
    3131    void Print(Option_t *o="") const;
     32    void Print(Option_t *wildcard, Option_t *option) const
     33    {
     34        Print(wildcard);
     35    }
    3236
    3337    TObject *FindObject(const char *object, const char *base) const;
     
    3539    TObject *FindObject(const TObject *o) const { return 0; }
    3640
     41    Int_t Read(const char *name=NULL);
     42
    3743    ClassDef(MStatusArray, 0) // Helper class for status display
    3844};
Note: See TracChangeset for help on using the changeset viewer.