Changeset 9292 for trunk/MagicSoft


Ignore:
Timestamp:
02/03/09 13:28:09 (16 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mastro/MAstroCatalog.cc

    r8999 r9292  
    11/* ======================================================================== *\
    2 ! $Name: not supported by cvs2svn $:$Id: MAstroCatalog.cc,v 1.31 2008-07-14 19:59:08 tbretz Exp $
     2! $Name: not supported by cvs2svn $:$Id: MAstroCatalog.cc,v 1.32 2009-02-03 13:27:58 tbretz Exp $
    33! --------------------------------------------------------------------------
    44!
     
    169169using namespace std;
    170170
     171// Datacenter default path for catalogs
     172const TString MAstroCatalog::kDefaultPath="/magic/datacenter/setup";
     173
    171174// --------------------------------------------------------------------------
    172175//
     
    281284    gLog << inf << "Reading Xephem catalog: " << catalog << endl;
    282285
     286    gSystem->ExpandPathName(catalog);
     287    if (gSystem->AccessPathName(catalog, kReadPermission))
     288    {
     289        gLog << inf2 << "Searching Xephem catalog " << catalog << " in " << kDefaultPath << endl;
     290        catalog.Prepend(kDefaultPath);
     291    }
     292
    283293    MZlib fin(catalog);
    284294    if (!fin)
     
    362372    gLog << inf << "Reading NGC2000 catalog: " << catalog << endl;
    363373
     374    gSystem->ExpandPathName(catalog);
     375    if (gSystem->AccessPathName(catalog, kReadPermission))
     376    {
     377        gLog << inf2 << "Searching NGC2000 catalog " << catalog << " in " << kDefaultPath << endl;
     378        catalog.Prepend(kDefaultPath);
     379    }
     380
    364381    MZlib fin(catalog);
    365382    if (!fin)
     
    425442{
    426443    gLog << inf << "Reading Bright Star Catalog (BSC5) catalog: " << catalog << endl;
     444
     445    gSystem->ExpandPathName(catalog);
     446    if (gSystem->AccessPathName(catalog, kReadPermission))
     447    {
     448        gLog << inf2 << "Searching Bright Star catalog " << catalog << " in " << kDefaultPath << endl;
     449        catalog.Prepend(kDefaultPath);
     450    }
    427451
    428452    MZlib fin(catalog);
     
    497521{
    498522    gLog << inf << "Reading Heasarc PPM catalog: " << catalog << endl;
     523
     524    gSystem->ExpandPathName(catalog);
     525    if (gSystem->AccessPathName(catalog, kReadPermission))
     526    {
     527        gLog << inf2 << "Searching Heasarc PPM catalog " << catalog << " in " << kDefaultPath << endl;
     528        catalog.Prepend(kDefaultPath);
     529    }
    499530
    500531    MZlib fin(catalog);
     
    601632
    602633    gLog << inf << "Reading MAstroCatalog compressed catalog: " << catalog << endl;
     634
     635    gSystem->ExpandPathName(catalog);
     636    if (gSystem->AccessPathName(catalog, kReadPermission))
     637    {
     638        gLog << inf2 << "Searching MAstroCatalog comressed catalog " << catalog << " in " << kDefaultPath << endl;
     639        catalog.Prepend(kDefaultPath);
     640    }
    603641
    604642    MZlib fin(catalog);
  • trunk/MagicSoft/Mars/mastro/MAstroCatalog.h

    r8907 r9292  
    3434{
    3535private:
     36    static const TString kDefaultPath; //! Datacenter default path for catalogs
     37
    3638    Double_t   fLimMag;     // [1]   Limiting Magnitude
    3739    Double_t   fRadiusFOV;  // [deg] Radius of Field of View
  • trunk/MagicSoft/Mars/mbase/MStatusDisplay.cc

    r9195 r9292  
    11051105        fBatch->Add(c);
    11061106
     1107        *fLog << inf3 << "Adding Canvas '" << name << "' (" << c->GetWw() << "x";
     1108        *fLog << c->GetWh() << ", TCanvas=" << c << ")" << endl;
     1109
    11071110        // Remove the canvas from the global list to make sure it is
    11081111        // not found by gROOT->FindObject
  • trunk/MagicSoft/Mars/mcorsika/MCorsikaEvtHeader.h

    r9252 r9292  
    3030
    3131    Float_t  fZd;                     // [rad] Zenith distance
    32     Float_t  fAz;                     // [rad] Azimuth (north=0; west=90)
     32    Float_t  fAz;                     // [rad] Azimuth (north=0; east=90)
    3333
    3434    Float_t  fX;                      // [cm] Position of telescope on ground x / - impact parameter x
  • trunk/MagicSoft/Mars/mfileio/MWriteRootFile.cc

    r9230 r9292  
    106106// --------------------------------------------------------------------------
    107107//
    108 // Try to get the file from gROOT->GetListOfFiles.
     108// Try to get the file from gROOT->GetListOfFiles. (In case the file name
     109// is /dev/null we look for a file with name /dev/null and the given title)
    109110// If it is found fOut is set to it and returned.
    110111// Otherwise a new file is opened and returned.
     
    112113TFile *MWriteRootFile::OpenFile(const char *name, Option_t *option, const char *title, Int_t comp)
    113114{
    114     TFile *file = dynamic_cast<TFile*>(gROOT->GetListOfFiles()->FindObject(name));
    115 
    116     // If the file was not found with its name try its expanded name
     115    TFile *file = 0;
     116
     117    if (TString(name)=="/dev/null")
     118    {
     119        TIter Next(gROOT->GetListOfFiles());
     120        TObject *obj = 0;
     121        while ((obj=Next()))
     122            if (TString(obj->GetName())=="/dev/null" && TString(obj->GetTitle())==title)
     123            {
     124                *fLog << inf3 << "Found file '/dev/null' <Title=" << title << ">" << endl;
     125                file = dynamic_cast<TFile*>(obj);
     126                break;
     127            }
     128    }
     129    else
     130    {
     131        file = dynamic_cast<TFile*>(gROOT->GetListOfFiles()->FindObject(name));
     132
     133        // If the file was not found with its name try its expanded name
     134        if (!file)
     135        {
     136            TString fqp(name);
     137            gSystem->ExpandPathName(fqp);
     138            file = dynamic_cast<TFile*>(gROOT->GetListOfFiles()->FindObject(fqp));
     139        }
     140    }
     141
    117142    if (!file)
    118     {
    119         TString fqp(name);
    120         gSystem->ExpandPathName(fqp);
    121         file = dynamic_cast<TFile*>(gROOT->GetListOfFiles()->FindObject(fqp));
    122     }
    123 
    124     if (!file || TString(name)=="/dev/null")
    125143    {
    126144        file = new TFile(name, option, title, comp);
     
    130148            return NULL;
    131149        }
     150
     151        *fLog << inf3 << "New file '" << name << "' <Title=" << title << "> created." << endl;
    132152
    133153        file->SetOption(option); // IMPORTANT!
     
    143163    *fLog << inf;
    144164    *fLog << "File '" << name << "' already open... using." << endl;
     165    *fLog << inf3;
    145166    *fLog << "Make sure that you do NOT write to trees which are" << endl;
    146167    *fLog << "scheduled already by a different MWriteRootFile..." << endl;
     
    170191// ftitle:      File title stored in the file (see TFile)
    171192// name, title: Name and title of this object
     193//
     194// Until the first file is opened a dummy file with name /dev/null is
     195// opened to allow creation of trees and branches in the file.
     196// To distinguish between different /dev/null-files the given title is used.
    172197//
    173198MWriteRootFile::MWriteRootFile(const Int_t comp,
  • trunk/MagicSoft/Mars/mhflux/MHEffectiveOnTime.cc

    r9153 r9292  
    908908        {
    909909            Double_t res[7];
    910             FitH(h, res, kTRUE);
    911             PaintText(res);
     910            if (FitH(h, res, kTRUE))
     911                PaintText(res);
    912912        }
    913913        return;
  • trunk/MagicSoft/Mars/mjobs/MJStar.cc

    r9288 r9292  
    301301    // Muons needs its own to have a unique SetReadyToSave
    302302    const TString rule(Form("s/([0-9]+(_M[12])?_[0-9.]+)_Y_(.*[.]root)$/%s\\/$1_I_$3/", Esc(fPathOut).Data()));
    303     MWriteRootFile write( 2, rule, fOverwrite?"RECREATE":"NEW");
    304     MWriteRootFile writet(2, rule, fOverwrite?"RECREATE":"NEW"); // EffectiveOnTime
    305     MWriteRootFile writem(2, rule, fOverwrite?"RECREATE":"NEW"); // Muons
     303    MWriteRootFile write( 2, rule, fOverwrite?"RECREATE":"NEW", "Image parameters");
     304    MWriteRootFile writet(2, rule, fOverwrite?"RECREATE":"NEW", "Image parameters"); // EffectiveOnTime
     305    MWriteRootFile writem(2, rule, fOverwrite?"RECREATE":"NEW", "Image parameters"); // Muons
    306306    writem.SetName("WriteMuons");
    307307
  • trunk/MagicSoft/Mars/mreport/MReportCC.cc

    r9289 r9292  
    153153            str.Remove(0, pos2);
    154154
    155             // Remove a leading minus. FIXME: What is its meaning?
     155            // Remove a leading minus. The negative numbers are error codes introduced
     156            // by Arehucas. It's only meant for the GRB monitor to change the priority
     157            // of its alerts.
    156158            if (str2[0]=='-')
    157159                str2.Remove(0, 1);
     
    159161            if (!str2.IsDigit())
    160162            {
    161                 *fLog << warn << "WARNING - Wrong type of second argument: " << str2 << endl;
     163                *fLog << warn << "WARNING - Wrong type of second argument (obs. category): " << str2 << endl;
    162164                return kFALSE;
    163165            }
Note: See TracChangeset for help on using the changeset viewer.