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/fillsinope.C

    r7265 r7459  
    3030//
    3131// This macro is used to read the sinope output files sinope*.txt
     32// For each run sinope is run twice: once for the data events and once for the
     33// calibration events. The pulse position and height is checked. The output is
     34// stored in a sinope*.root and a sinope*.txt file. The files for data events
     35// are marked with -dat and the ones for calibration events with -cal.
     36// From the txt files the result is extracted and inserted into the database
     37// in the table DataCheck, which stores the datacheck results.
     38// As the column names in the database differ only by the addition 'Interlaced'
     39// which is given to columns corresponding to the calibration events, the
     40// files can be processed with the same function.
    3241//
    3342// Usage:
     
    8796    TEnv env(fname);
    8897
     98    //build query
    8999    TString query="UPDATE DataCheck SET ";
    90100
     101    //array with part of column names
    91102    TString values[9] = { "Events" , "HasSignal" , "HasPedestal" , "PositionSignal" , "PositionFWHM" , "PositionAsym" , "HeightSignal" , "HeightFWHM" , "HeightAsym" };
    92103
     104    //get values from the file add them to query
    93105    TString str;
    94106    for (Int_t i=0 ; i<9 ; i++)
     
    118130
    119131    cout << "Q: " << query << endl;
     132    //insert information into db
    120133    TSQLResult *res = serv.Query(query);
    121134    if (!res)
     
    146159    cout << endl;
    147160
     161    //get date of run from database
    148162    TString query(Form("SELECT DATE_FORMAT(ADDDATE(fRunStart, Interval 13 HOUR), '%%Y/%%m/%%d') FROM RunData WHERE fRunNumber=%d",
    149163                       runno));
     
    162176    delete res;
    163177
     178    //insert entry for the run into the database in the table DataCheck, if it is not yet existing
    164179    if (!ExistStr(serv, "fRunNumber", "DataCheck", Form("%d", runno)))
    165180    {
    166181        query=Form("INSERT DataCheck SET fRunNumber=%d", runno);
    167182
    168         cout << "U:" << query << endl;
    169183        res = serv.Query(query);
    170184        if (!res)
     
    175189    }
    176190
     191    //get filenames of sinope output files
    177192    TString fname(Form("%s/sinope/%s/sinope-dat%08d.txt",
    178193                       datapath.Data(), date.Data(), runno));
     
    183198
    184199    Int_t rc=0;
     200    //process dat-file
    185201    rc=Process(serv, fname, runno, kFALSE, dummy);
    186202    if (rc==0)
    187203        return rc;
    188204
     205    //process cal-file
    189206    rc=Process(serv, fnamecal, runno, kTRUE, dummy);
    190207    return rc;
Note: See TracChangeset for help on using the changeset viewer.