Ignore:
Timestamp:
07/23/08 14:15:14 (16 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mjobs
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mjobs/MSequence.cc

    r9028 r9039  
    13941394    }
    13951395
    1396     if (!fDataPath.IsNull())
    1397         out << endl << pre << "DataPath: " << fDataPath << endl;
     1396//    if (!fDataPath.IsNull())
     1397//        out << endl << pre << "DataPath: " << fDataPath << endl;
    13981398
    13991399    if (!str.IsNull())
     
    15121512
    15131513    fPeriod = fNight.GetMagicPeriod();
     1514}
     1515
     1516// --------------------------------------------------------------------------
     1517//
     1518// Read a sequence from gDirectory. If the default is given we try
     1519// to find a sequence with name GetName. If a key with name name
     1520// exists in the file read this key. Otherwise loop over all keys
     1521// and return the first key matching the TPRegex (regular expression)
     1522// matching defined by the argument.
     1523//
     1524Int_t MSequence::Read(const char *name)
     1525{
     1526    if (!name || !gFile)
     1527        return MParContainer::Read(name);
     1528
     1529    if (!gDirectory->GetListOfKeys()->FindObject(name))
     1530        return MParContainer::Read(name);
     1531
     1532    TPRegexp regexp(name);
     1533
     1534    TIter NextK(gDirectory->GetListOfKeys());
     1535    TObject *key = 0;
     1536    while ((key=NextK()))
     1537        if (TString(key->GetName())(regexp)==key->GetName())
     1538            return MParContainer::Read(key->GetName());
     1539
     1540    *fLog << warn << "WARNING - No key in " << gDirectory->GetName() << " matching " << name << "." << endl;
     1541    return 0;
    15141542}
    15151543
  • trunk/MagicSoft/Mars/mjobs/MSequence.h

    r9023 r9039  
    131131
    132132public:
    133     MSequence() : fTelescope(0), fSequence((UInt_t)-1), fLastRun((UInt_t)-1),
     133    MSequence() : fTelescope(1), fSequence((UInt_t)-1), fLastRun((UInt_t)-1),
    134134        fNumEvents((UInt_t)-1), fPeriod((UInt_t)-1), fLightCondition(kNA), fMonteCarlo(kFALSE)
    135135    {
     
    158158
    159159    // I/O
     160    Int_t  Read(const char *name=0);
    160161    Bool_t ReadDatabase(TString sql, UInt_t seq=0, UShort_t tel=0);
    161162    Bool_t ReadFile(const char *filename, UInt_t id=(UInt_t)-1);
Note: See TracChangeset for help on using the changeset viewer.