Ignore:
Timestamp:
07/23/08 14:15:14 (16 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

    r9026 r9039  
    4444#include "MStatusArray.h"
    4545
    46 #include <TH1.h>       // TH1::AddDirectoryStatus();
     46#include <TH1.h>              // TH1::AddDirectoryStatus();
     47#include <TFile.h>            // gFile
    4748#include <TClass.h>
    4849#include <TCanvas.h>
     
    344345    Delete();
    345346
     347    const TString keyname = name?name:"MStatusDisplay";
     348
     349    // Check if key exists (to suppress an error on the console
     350    if (!gDirectory->GetListOfKeys()->FindObject(keyname))
     351    {
     352        gLog << inf << keyname << " [MStatusArray] not found." << endl;
     353        return 0;
     354    }
     355
    346356    // Make sure newly read histograms are not added to the current directory
    347357    const Bool_t store = TH1::AddDirectoryStatus();
    348358    TH1::AddDirectory(kFALSE);
    349     const Int_t rc = TObjArray::Read(name?name:"MStatusDisplay");
     359    const Int_t rc = TObjArray::Read(keyname);
    350360    TH1::AddDirectory(store);
    351361
  • trunk/MagicSoft/Mars/mbase/MStatusDisplay.cc

    r9038 r9039  
    22392239                list.Add(new TNamed(GetName(), GetTitle()));
    22402240
     2241            c->SetTitle(gFile->GetName());
    22412242            list.Add(c);
    22422243        }
     
    22462247        if (list.GetEntries()==0)
    22472248        {
    2248             *fLog << warn << "MStatusDisplay::Read: No objects read." << endl;
     2249            *fLog << warn << "MStatusDisplay::Read: No objects read from " << gFile->GetName() << endl;
    22492250            return 0;
    22502251        }
Note: See TracChangeset for help on using the changeset viewer.