Ignore:
Timestamp:
03/31/03 10:37:56 (22 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mfileio
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mfileio/MCT1ReadAscii.cc

    r1668 r1880  
    9696// Add this file as the last entry in the chain
    9797//
    98 void MCT1ReadAscii::AddFile(const char *txt)
     98Int_t MCT1ReadAscii::AddFile(const char *txt, Int_t)
    9999{
    100100    TNamed *name = new TNamed(txt, "");
    101101    fFileNames->AddLast(name);
     102    return 1;
    102103}
    103104
     
    299300    return kTRUE;
    300301}
    301 
  • trunk/MagicSoft/Mars/mfileio/MCT1ReadAscii.h

    r1381 r1880  
    3030    ~MCT1ReadAscii();
    3131
    32     void AddFile(const char *fname);
     32    Int_t AddFile(const char *fname, Int_t dummy=-1);
    3333
    3434    Bool_t PreProcess(MParList *pList);
  • trunk/MagicSoft/Mars/mfileio/MCT1ReadPreProc.cc

    r1873 r1880  
    119119// Add this file as the last entry in the chain
    120120//
    121 void MCT1ReadPreProc::AddFile(const char *txt)
     121Int_t MCT1ReadPreProc::AddFile(const char *txt, Int_t)
    122122{
    123123    const char *name = gSystem->ExpandPathName(txt);
     
    129129    {
    130130        *fLog << warn << "WARNING - Problem reading header... ignored." << endl;
    131         return;
     131        return 0;
    132132    }
    133133
     
    136136    {
    137137        *fLog << warn << "WARNING - File contains no data... ignored." << endl;
    138         return;
     138        return 0;
    139139    }
    140140
     
    144144
    145145    fFileNames->AddLast(new TNamed(txt, ""));
     146    return 1;
    146147}
    147148
  • trunk/MagicSoft/Mars/mfileio/MCT1ReadPreProc.h

    r1849 r1880  
    7777    ~MCT1ReadPreProc();
    7878
    79     void AddFile(const char *fname);
     79    Int_t AddFile(const char *fname, Int_t dummy=-1);
    8080
    8181    UInt_t GetEntries() { return fEntries; }
  • trunk/MagicSoft/Mars/mfileio/MRead.cc

    r1668 r1880  
    3939ClassImp(MRead);
    4040
     41// --------------------------------------------------------------------------
     42//
     43// Read the setup from a TEnv:
     44//   File0, File1, File2, ..., File10, ..., File100, ...
     45//
     46// Searching stops if the first key isn't found in the TEnv
     47//
     48// Enclosing quotation marks (") are removed
     49//
     50// Number of entries at the moment not supported
     51//
     52Bool_t MRead::ReadEnv(const TEnv &env, TString prefix, Bool_t print)
     53{
     54    //
     55    // Don't allow 'global' setup of files
     56    //
     57    if (prefix.IsNull())
     58        return kFALSE;
     59
     60    //
     61    // Search (beginning with 0) all keys
     62    //
     63    for (int i=0;; i++)
     64    {
     65        TString idx = "File";
     66        idx += i;
     67
     68        // Output if print set to kTRUE
     69        IsEnvDefined(env, prefix, idx, print);
     70
     71        // Try to get the file name
     72        TString name = GetEnvValue(env, prefix, idx, "");
     73        if (name.IsNull())
     74            return kTRUE;
     75
     76        if (name.BeginsWith("\"") && name.EndsWith("\""))
     77        {
     78            name.Remove(name.Last('\"'), 1);
     79            name.Remove(name.First('\"'), 1);
     80        }
     81
     82        AddFile(name);
     83    }
     84
     85    return kTRUE;
     86}
  • trunk/MagicSoft/Mars/mfileio/MRead.h

    r1668 r1880  
    2121    MFilter *GetSelector() { return fSelector; }
    2222
     23    Int_t AddFile(const char *fname, Int_t entries=-1) { return -1; }
     24
     25    Bool_t ReadEnv(const TEnv &env, TString prefix, Bool_t print);
     26
    2327    ClassDef(MRead, 0)  // Base class for a reading task
    2428};
Note: See TracChangeset for help on using the changeset viewer.