Ignore:
Timestamp:
01/10/06 13:44:29 (19 years ago)
Author:
Daniela Dorner
Message:
*** empty log message ***
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/datacenter/macros/checkfileavail.C

    r7457 r7459  
    2828// ================
    2929//
     30// check the availability of the files of one sequence:
     31// the script filesondisk has inserted the information (which files are on
     32// disk into the database) and with this macro this information is checked
     33// for the runs of one sequence
     34//
     35// executing the macro:
     36//  .x checkfileavail.C+("sequencefile")
     37// the sequencefile (including path) has to be given, as the macro retrieves
     38// from there the runnumbers
     39//
     40// the macro returns 0, if a file is missing, and 1 if all files are there
     41// the return value is checked by the script, that executes the macro
     42//
     43// this macro is very similar to the macro checkstardone.C
     44//
    3045/////////////////////////////////////////////////////////////////////////////
    3146
     
    4358
    4459
     60//check the value of a column for a run
     61//if a file is not available, the column contains nothing (NULL) - this value is returned
    4562TString GetStatus(MSQLServer &serv, TEnv &rc, TString primary, TString table, TString column)
    4663{
     
    89106    TEnv rc("steps.rc");
    90107
     108    //reading runnumbers from Sequencefile
    91109    TEnv sequ(sequencefile);
    92 
     110    cout << "sequ file: " << sequencefile.Data() << endl;
    93111    TString runs;
    94112    runs = sequ.GetValue("Runs", "");
     
    100118    }
    101119
    102     cout << "sequ file: " << sequencefile.Data() << endl;
     120    //getting runnumbers from database
     121    //(not neccessary anymore -> can be changed)
    103122    TString query(Form("SELECT fRunNumber FROM RunData WHERE fRunNumber in (%s)",
    104123                       runs.Data()));
     
    108127        cout << "Error - no run to check" << endl;
    109128
     129    //check for each run the availability of files from the table RunProcessStatus
     130    //the following columns have to be checked:
     131    //fCCFileAvail, fCaCoFileAvail, fCaCoFileFound, fRawFileAvail, fTimingCorrection
     132    //fTimingCorrection has to be checked, as only rawfiles with correct timing should be calibrated
    110133    TSQLRow *row=0;
    111134    while ((row = res->Next()))
     
    113136        TString runno=(*row)[0];
    114137        cout << "run#: " << runno << endl;
     138        //if one value returns "" (i.e. column is NULL), 0 is returned
    115139        if (GetStatus(serv, rc, runno, "RunProcessStatus", "fCCFileAvail")==""
    116140            || GetStatus(serv, rc, runno, "RunProcessStatus", "fCaCoFileAvail")==""
     
    121145            return 0;
    122146    }
     147    //if all values are okay (i.e. files are availabel), 1 is returned
    123148    return 1;
    124149
Note: See TracChangeset for help on using the changeset viewer.