Ignore:
Timestamp:
04/04/05 10:11:18 (20 years ago)
Author:
tbretz
Message:
*** empty log message ***
File:
1 edited

Legend:

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

    r6858 r6906  
    172172    }
    173173}
    174 
    175 const TString MSequence::GetStandardPath(Bool_t raw) const
    176 {
    177     TString d("/magic/data/");
    178     d += raw ? "rawfiles/" : "merpp/";
    179     return d;
    180 }
    181 
     174/*
    182175UInt_t MSequence::SetupRuns(MDirIter &iter, const TArrayI &arr, const char *path, char *id, Bool_t raw) const
    183176{
     
    187180    if (d.IsNull())
    188181    {
    189         d = GetStandardPath(raw);
     182        d = GetStandardPath();
     183        d += raw ? "rawfiles/" : "merpp/";
    190184        d += fNight.GetStringFmt("%Y/%m/%d");
    191185    }
     
    206200        n += Form(fmt, arr[i], id);
    207201        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*/
     210UInt_t MSequence::SetupRuns(MDirIter &iter, const TArrayI &arr, FileType_t type, const char *path) const
     211{
     212    TString d(path);
     213
     214    // Setup path
     215    if (d.IsNull())
     216    {
     217        d = GetStandardPath();
     218        switch (type)
     219        {
     220        case kRawDat:
     221        case kRawPed:
     222        case kRawCal:
     223        case kRawAll:
     224            d += "rawfiles/";
     225            break;
     226        case kRootDat:
     227        case kRootPed:
     228        case kRootCal:
     229        case kRootAll:
     230            d += "merpp/";
     231            break;
     232        case kCalibrated:
     233            d += "callisto/";
     234            break;
     235        case kImages:
     236            d += "star/";
     237            break;
     238        }
     239        d += fNight.GetStringFmt("%Y/%m/%d");
     240    }
     241    else
     242        gSystem->ExpandPathName(d);
     243
     244    for (int i=0; i<arr.GetSize(); i++)
     245    {
     246        // R. DeLosReyes and T. Bretz
     247        // Changes to read the DAQ numbering format. Changes takes place
     248        // between runs 35487 and 00035488 (2004_08_30)
     249        const char *fmt = arr[i]>35487 ? "%08d_%s_*_E" : "%05d_%s_*_E";
     250
     251        TString n;
     252        char *id="_";
     253        switch (type)
     254        {
     255        case kRawDat:
     256        case kRootDat:
     257            id = "D";
     258            break;
     259        case kRawPed:
     260        case kRootPed:
     261            id = "P";
     262            break;
     263        case kRawCal:
     264        case kRootCal:
     265            id = "C";
     266            break;
     267        case kRawAll:
     268        case kRootAll:
     269            id = "[PCD]";
     270            break;
     271        case kCalibrated:
     272            id = "Y";
     273            break;
     274        case kImages:
     275            id = "I";
     276            break;
     277        }
     278
     279        // Create file name
     280        n =  fNight.GetStringFmt("%Y%m%d_");
     281        n += Form(fmt, arr[i], id);
     282
     283        switch (type)
     284        {
     285        case kRawDat:
     286        case kRawPed:
     287        case kRawCal:
     288        case kRawAll:
     289            n += ".raw";
     290            break;
     291        default:
     292            n += ".root";
     293        }
    208294
    209295        // Add Path/File to TIter
     
    369455// Using raw=kTRUE you get correspodning raw-files setup.
    370456// Return the number of files added.
    371 //
    372 UInt_t MSequence::SetupPedRuns(MDirIter &iter, const char *path, char *id, Bool_t raw) const
    373 {
    374     return SetupRuns(iter, fPedRuns, path, id, raw);
     457UInt_t MSequence::SetupPedRuns(MDirIter &iter, const char *path, Bool_t raw) const
     458{
     459    return SetupRuns(iter, fPedRuns, raw?kRawPed:kRootPed, path);
    375460}
    376461
     
    383468// Return the number of files added.
    384469//
    385 UInt_t MSequence::SetupDatRuns(MDirIter &iter, const char *path, char *id, Bool_t raw) const
    386 {
    387     return SetupRuns(iter, fDatRuns, path, id, raw);
     470UInt_t MSequence::SetupDatRuns(MDirIter &iter, const char *path, Bool_t raw) const
     471{
     472    return SetupRuns(iter, fDatRuns, raw?kRawPed:kRootPed, path);
    388473}
    389474
     
    396481// Return the number of files added.
    397482//
    398 UInt_t MSequence::SetupAllRuns(MDirIter &iter, const char *path, char *id, Bool_t raw) const
    399 {
    400     return SetupRuns(iter, fRuns, path, id, raw);
     483UInt_t MSequence::SetupAllRuns(MDirIter &iter, const char *path, Bool_t raw) const
     484{
     485    return SetupRuns(iter, fRuns, raw?kRawAll:kRootAll, path);
    401486}
    402487
     
    409494// Return the number of files added.
    410495//
    411 UInt_t MSequence::SetupCalRuns(MDirIter &iter, const char *path, char *id, Bool_t raw) const
    412 {
    413     return SetupRuns(iter, fCalRuns, path, id, raw);
     496UInt_t MSequence::SetupCalRuns(MDirIter &iter, const char *path, Bool_t raw) const
     497{
     498    return SetupRuns(iter, fCalRuns, raw?kRawCal:kRootCal, path);
     499}
     500
     501// --------------------------------------------------------------------------
     502//
     503// Add all data runs from the sequence to MDirIter.
     504// If path==0 the standard path of the data-center is assumed.
     505// If you have the runs locally use path="."
     506// Using raw=kTRUE you get correspodning raw-files setup.
     507// Return the number of files added.
     508//
     509UInt_t MSequence::SetupDatRuns(MDirIter &iter, FileType_t type, const char *path) const
     510{
     511    return SetupRuns(iter, fDatRuns, type, path);
    414512}
    415513
Note: See TracChangeset for help on using the changeset viewer.