Ignore:
Timestamp:
07/11/05 10:34:49 (19 years ago)
Author:
tbretz
Message:
*** empty log message ***
File:
1 edited

Legend:

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

    r6964 r7179  
    3131//
    3232//  A sequence is a collection of runs which should be used together.
     33//  Any run can be contained only once.
    3334//
    3435//  Here is an example how a file describing a sequence could look like:
     
    152153// --------------------------------------------------------------------------
    153154//
    154 // Copy the run numbers from the TString runs into the TArrayI data
     155// Copy the run numbers from the TString runs into the TArrayI data.
     156// Runs which are twice in the list are only added once. In this case
     157// a warning is emitted.
    155158//
    156159void MSequence::Split(TString &runs, TArrayI &data) const
     
    165168        TString num = runs(regexp);
    166169
    167         const Int_t n = data.GetSize();
     170        const Int_t run = atoi(num.Data());
     171        const Int_t n   = data.GetSize();
     172
     173        // skip already existing entries
     174        int i;
     175        for (i=0; i<n; i++)
     176            if (data[i] == run)
     177                break;
     178
     179        if (i<n)
     180        {
     181            *fLog << warn << "WARNING - Run #" << run << " alraedy in list... skipped." << endl;
     182            continue;
     183        }
     184
     185        // set new entry
    168186        data.Set(n+1);
    169         data[n] = atoi(num.Data());
     187        data[n] = run;
    170188
    171189        runs.Remove(0, runs.First(num)+num.Length());
    172190    }
    173191}
    174 /*
    175 UInt_t MSequence::SetupRuns(MDirIter &iter, const TArrayI &arr, const char *path, char *id, Bool_t raw) const
    176 {
    177     TString d(path);
    178 
    179     // Setup path
    180     if (d.IsNull())
    181     {
    182         d = GetStandardPath();
    183         d += raw ? "rawfiles/" : "merpp/";
    184         d += fNight.GetStringFmt("%Y/%m/%d");
    185     }
    186     else
    187         gSystem->ExpandPathName(d);
    188 
    189     for (int i=0; i<arr.GetSize(); i++)
    190     {
    191         // R. DeLosReyes and T. Bretz
    192         // Changes to read the DAQ numbering format. Changes takes place
    193         // between runs 35487 and 00035488 (2004_08_30)
    194         const char *fmt = arr[i]>35487 ? "%08d_%s_*_E" : "%05d_%s_*_E";
    195 
    196         TString n;
    197 
    198         // Create file name
    199         n =  fNight.GetStringFmt("%Y%m%d_");
    200         n += Form(fmt, arr[i], id);
    201         n += raw ? ".raw" : ".root";
    202 
    203         // Add Path/File to TIter
    204         iter.AddDirectory(d, n, 0);
    205     }
    206 
    207     return iter.GetNumEntries();
    208 }
    209 */
     192
    210193UInt_t MSequence::SetupRuns(MDirIter &iter, const TArrayI &arr, FileType_t type, const char *path) const
    211194{
Note: See TracChangeset for help on using the changeset viewer.