Ignore:
Timestamp:
02/25/06 18:31:03 (19 years ago)
Author:
Daniela Dorner
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/datacenter/macros
Files:
12 edited

Legend:

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

    r7460 r7528  
    7272// has to be removed from the database
    7373//
    74 // If nothing failes 1 is returned. In the case of an error 0 is returned.
     74// If nothing failes 1 is returned. In the case of an error 2 and if
     75// there's no connection to the database 0 is returned.
    7576// This is needed for the scripts that execute the macro.
    7677//
     
    813814    TSQLResult *res = serv.Query(query);
    814815    if (!res)
    815         return 0;
     816        return 2;
    816817
    817818    //build blocks of runs, which have the same values
     
    875876    res = serv.Query(query);
    876877    if (!res)
    877         return 0;
     878        return 2;
    878879
    879880    cout << "old sequences: " << flush;
     
    911912        cout << "sequ: " << obj->GetName() << " deleting... " << endl;
    912913        if (!DeleteSequence(serv, datapath, sequpath, atoi(obj->GetName()), dummy))
    913             return 0;
    914     }
    915 
    916     return rc ? 1 : 0;
     914            return 2;
     915    }
     916
     917    return rc ? 1 : 2;
    917918}
    918919
     
    936937    TSQLResult *res = serv.Query(query);
    937938    if (!res)
    938         return 0;
     939        return 2;
    939940
    940941    //execute buildsequenceentries for all dates
  • trunk/MagicSoft/Mars/datacenter/macros/checkfileavail.C

    r7503 r7528  
    3838// from there the runnumbers
    3939//
    40 // the macro returns 0, if a file is missing, and 1 if all files are there
     40// the macro returns 0, if there's no connection to the database, 2, if a
     41// file is missing, and 1 if all files are there
    4142// the return value is checked by the script, that executes the macro
    4243//
  • trunk/MagicSoft/Mars/datacenter/macros/checkstardone.C

    r7503 r7528  
    3636//  .x checkstardone.C+("sequencenumber")
    3737//
    38 // the macro returns 0, if for the sequence star is not done, and 1 if star
    39 // has been done
     38// the macro returns 0, if there's no connection to the database, 2, if a
     39// file is missing, and 1 if all files are there
    4040// the return value is checked by the script, that executes the macro
    4141//
  • trunk/MagicSoft/Mars/datacenter/macros/doexclusions.C

    r7486 r7528  
    5353// condition in this example), the line is commented out
    5454//
     55// Returns 2 in case of failure, 1 in case of success and 0 if the connection
     56// to the database is not working.
     57//
    5558/////////////////////////////////////////////////////////////////////////////
    5659#include <iostream>
     
    136139    if (startrun<0 || stoprun<0)
    137140    {
    138         cout << "wrong format of date" << endl;
    139         return 0;
    140     }
     141        cout << "wrong format of runno" << endl;
     142        return 2;
     143    }
     144    //if no run for date is available, GetRunNumber() returns 0
    141145    if (startrun==0 || stoprun==0)
    142146        return 1;
     
    153157    if (!res)
    154158    {
    155         cout << "Error - could not do any automatic excludes" << endl;
    156         return 0;
     159        cout << "Error - could not do any automatic excludes." << endl;
     160        return 2;
    157161    }
    158162
     
    173177        if (!res)
    174178        {
    175             cout << "Error" << endl;
    176             return 0;
     179            cout << "Error - could not get importance." << endl;
     180            return 2;
    177181        }
    178182
     
    210214        {
    211215            cout << "Error - no runs to exclude" << endl;
    212             return 0;
     216            return 2;
    213217        }
    214218
     
    227231                {
    228232                    cout << "Error - could not insert exclusion" << endl;
    229                     return 0;
     233                    return 2;
    230234                }
    231235                delete res;
  • trunk/MagicSoft/Mars/datacenter/macros/fillcalib.C

    r7460 r7528  
    5555// file called sql.rc and the resource file is found.
    5656//
    57 // Returns 0 in case of failure and 1 in case of success.
     57// Returns 2 in case of failure, 1 in case of success and 0 if the connection
     58// to the database is not working.
    5859//
    5960/////////////////////////////////////////////////////////////////////////////
     
    115116    {
    116117        cout << "ERROR - Could not find file " << fname << endl;
    117         return 0;
     118        return 2;
    118119    }
    119120
     
    121122    {
    122123        cout << "ERROR - Reading of MBadPixelsCam failed." << endl;
    123         return 0;
     124        return 2;
    124125    }
    125126
     
    147148
    148149    if (unsin<0 || unsout<0 || unrin<0 || unrout<0 || isoin<0 || isoout<0 || clumax<0)
    149         return 0;
     150    {
     151        cout << "ERROR - one of the pixel values < 0." << endl;
     152        return 2;
     153    }
    150154
    151155    //     MHCamera hist(geom);
     
    158162    MStatusArray arr;
    159163    if (arr.Read()<=0)
    160         return 0;
     164    {
     165        cout << "ERROR - could not read MStatusArray." << endl;
     166        return 2;
     167    }
    161168
    162169    TH1 *h;
     
    167174    {
    168175        cout << "WARNING - Could not find histogram HRelTimeHiGainArea0." << endl;
    169         return 0;
     176        return 2;
    170177    }
    171178
     
    183190    {
    184191        cout << "WARNING - Could not find histogram HRelTimeHiGainArea1." << endl;
    185         return 0;
     192        return 2;
    186193    }
    187194
     
    199206    {
    200207        cout << "WARNING - Could not find MHCamera TotalConv." << endl;
    201         return 0;
     208        return 2;
    202209    }
    203210
     
    221228    {
    222229        cout << "WARNING - Could get sequence# from filename: " << fname << endl;
    223         return 0;
     230        return 2;
    224231    }
    225232
     
    289296
    290297    if (dummy)
    291         return 0;
     298        return 1;
    292299
    293300    TSQLResult *res = serv.Query(query);
     
    295302    {
    296303        cout << "ERROR - Query failed: " << query << endl;
    297         return 0;
     304        return 2;
    298305    }
    299306    delete res;
  • trunk/MagicSoft/Mars/datacenter/macros/filldotraw.C

    r7460 r7528  
    5151// file called sql.rc and the resource file is found.
    5252//
    53 // Returns 0 in case of failure and 1 in case of success.
     53// Returns 2 in case of failure, 1 in case of success and 0 if the connection
     54// to the database is not working.
    5455//
    5556/////////////////////////////////////////////////////////////////////////////
     
    153154    const Int_t key = MagicNumber(serv, h);
    154155    if (key<0)
    155         return 0;
     156        return 2;
    156157
    157158    TString query(Form("UPDATE RunData SET fMagicNumberKEY=%d, fFormatVersion=%d WHERE fRunNumber=%d",
     
    162163    {
    163164        cout << "ERROR - Query failed: " << query << endl;
    164         return 0;
     165        return 2;
    165166    }
    166167
     
    215216    {
    216217        cout << "ERROR - Query failed: " << query << endl;
    217         return 0;
     218        return 2;
    218219    }
    219220
     
    247248    {
    248249        cout << "ERROR - there's are " << count << " files. " << endl;
    249         return 0;
     250        return 2;
    250251    }
    251252
  • trunk/MagicSoft/Mars/datacenter/macros/fillganymed.C

    r7486 r7528  
    4848// file called sql.rc and the resource file is found.
    4949//
    50 // Returns 0 in case of failure and 1 in case of success.
     50// Returns 2 in case of failure, 1 in case of success and 0 if the connection
     51// to the database is not working.
    5152//
    5253/////////////////////////////////////////////////////////////////////////////
     
    107108    {
    108109        cout << "ERROR - Could not find file " << fname << endl;
    109         return 0;
     110        return 2;
    110111    }
    111112
     
    117118    {
    118119        cout << "WARNING - Reading of MAlphaFitter failed." << endl;
    119         return 0;
     120        return 2;
    120121    }
    121122
     
    133134    {
    134135        cout << "ERROR - Reading of MStatusDisplay failed." << endl;
    135         return 0;
     136        return 2;
    136137    }
    137138
     
    140141    {
    141142        cout << "WARNING - Reading of Theta failed." << endl;
    142         return kFALSE;
     143        return 2;
    143144    }
    144145
     
    151152    {
    152153        cout << "WARNING - Could get dataset# from filename: " << fname << endl;
    153         return 0;
     154        return 2;
    154155    }
    155156
     
    203204    cout << "q: " << query << endl;
    204205    if (dummy)
    205         return 0;
     206        return 1;
    206207
    207208    TSQLResult *res = serv.Query(query);
     
    209210    {
    210211        cout << "ERROR - Query failed: " << query << endl;
    211         return 0;
     212        return 2;
    212213    }
    213214    return 1;
  • trunk/MagicSoft/Mars/datacenter/macros/fillsignal.C

    r7460 r7528  
    5252// file called sql.rc and the resource file is found.
    5353//
    54 // Returns 0 in case of failure and 1 in case of success.
     54// Returns 2 in case of failure, 1 in case of success and 0 if the connection
     55// to the database is not working.
    5556//
    5657/////////////////////////////////////////////////////////////////////////////
     
    7980    {
    8081        cout << "ERROR - Could not find file " << fname << endl;
    81         return 0;
     82        return 2;
    8283    }
    8384
     
    100101    {
    101102        cout << "ERROR - Reading of MStatusDisplay failed." << endl;
    102         return 0;
     103        return 2;
    103104    }
    104105
     
    107108    {
    108109        cout << "WARNING - Reading of PedRMS;avg failed." << endl;
    109         return 0;
     110        return 2;
    110111    }
    111112
     
    114115    {
    115116        cout << "WARNING - Reading of PulsePos;avg failed." << endl;
    116         return 0;
     117        return 2;
    117118    }
    118119
     
    133134        cout << "MeanPedRMS inner " << meanrmsi << endl;
    134135        cout << "MeanPedRMS outer " << meanrmso << endl;
    135         return 0;
     136        return 2;
    136137    }
    137138
     
    143144    {
    144145        cout << "WARNING - Reading of Interp'd;avg failed." << endl;
    145         return 0;
     146        return 2;
    146147    }
    147148
     
    154155        cout << "MeanInterp'd inner " << meansigi << endl;
    155156        cout << "MeanInterp'd outer " << meansigo << endl;
    156         return 0;
     157        return 2;
    157158    }
    158159
     
    168169        cout << "PulsePos'd mean " << meanpul << endl;
    169170        cout << "PulsePos'd rms  " << rmspul << endl;
    170         return 0;
     171        return 2;
    171172    }
    172173
     
    180181        cout << "WARNING - Sequ# empty" << endl;
    181182        cout << "Sequ# " << sequence << endl;
    182         return 0;
     183        return 2;
    183184    }
    184185
     
    226227
    227228    if (dummy)
    228         return 0;
     229        return 1;
    229230
    230231    TSQLResult *res = serv.Query(query);
     
    232233    {
    233234        cout << "ERROR - Query failed: " << query << endl;
    234         return 0;
     235        return 2;
    235236    }
    236237
  • trunk/MagicSoft/Mars/datacenter/macros/fillsinope.C

    r7486 r7528  
    5454// file called sql.rc and the resource file is found.
    5555//
    56 // Returns 0 in case of failure and 1 in case of success.
     56// Returns 2 in case of failure, 1 in case of success and 0 if the connection
     57// to the database is not working.
    5758//
    5859/////////////////////////////////////////////////////////////////////////////
     
    136137    {
    137138        cout << "ERROR - Query failed: " << query << endl;
    138         return kFALSE;
     139        return 2;
    139140    }
    140141    delete res;
     
    168169    {
    169170        cout << "ERROR - Query failed: " << query << endl;
    170         return 0;
     171        return 2;
    171172    }
    172173
     
    186187        {
    187188            cout << "ERROR - Query failed: " << query << endl;
    188             return 0;
     189            return 2;
    189190        }
    190191    }
     
    201202    //process dat-file
    202203    rc=Process(serv, fname, runno, kFALSE, dummy);
    203     if (rc==0)
     204    if (rc==2)
    204205        return rc;
    205206
  • trunk/MagicSoft/Mars/datacenter/macros/fillstar.C

    r7460 r7528  
    5252// file called sql.rc and the resource file is found.
    5353//
    54 // Returns 0 in case of failure and 1 in case of success.
     54// Returns 2 in case of failure, 1 in case of success and 0 if the connection
     55// to the database is not working.
    5556//
    5657/////////////////////////////////////////////////////////////////////////////
     
    113114    {
    114115        cout << "ERROR - Could not find file " << fname << endl;
    115         return 0;
     116        return 2;
    116117    }
    117118
     
    121122    {
    122123        cout << "ERROR - Reading of MStatusDisplay failed." << endl;
    123         return 0;
     124        return 2;
    124125    }
    125126
     
    128129    {
    129130        cout << "WARNING - Reading of MHHillas failed." << endl;
    130         return 0;
     131        return 2;
    131132    }
    132133
     
    135136    {
    136137        cout << "WARNING - Reading of MHMuon failed." << endl;
    137         return 0;
     138        return 2;
    138139    }
    139140
     
    165166    {
    166167        cout << "WARNING - Reading of Islands failed." << endl;
    167         return 0;
     168        return 2;
    168169    }
    169170
     
    176177    {
    177178        cout << "WARNING - Reading of EffOnTheta failed." << endl;
    178         return 0;
     179        return 2;
    179180    }
    180181
     
    189190    {
    190191        cout << "WARNING - Reading of ProjDeltaT failed." << endl;
    191         return 0;
     192        return 2;
    192193    }
    193194
     
    199200    {
    200201        cout << "WARNING - Reading of Humidity failed." << endl;
    201         return 0;
     202        return 2;
    202203    }
    203204
     
    210211    {
    211212        cout << "WARNING - Could get sequence# from filename: " << fname << endl;
    212         return 0;
     213        return 2;
    213214    }
    214215
     
    268269
    269270    if (dummy)
    270         return 0;
     271        return 1;
    271272
    272273    TSQLResult *res = serv.Query(query);
     
    274275    {
    275276        cout << "ERROR - Query failed: " << query << endl;
    276         return 0;
     277        return 2;
    277278    }
    278279
  • trunk/MagicSoft/Mars/datacenter/macros/resetcolumn.C

    r7460 r7528  
    4646// file called sql.rc and the resource file is found.
    4747//
    48 // Returns 0 in case of failure and 1 in case of success.
     48// Returns 2 in case of failure, 1 in case of success and 0 if the connection
     49// to the database is not working.
    4950//
    5051/////////////////////////////////////////////////////////////////////////////
     
    121122    TSQLResult *res = serv.Query(query);
    122123    if (!res)
    123         return 0;
     124        return 2;
    124125
    125126    delete res;
  • trunk/MagicSoft/Mars/datacenter/macros/writesequencefile.C

    r7460 r7528  
    3838// file called sql.rc and the resource file is found.
    3939//
    40 // Returns 0 in case of failure and 1 in case of success.
     40// Returns 2 in case of failure, 1 in case of success and 0 if the connection
     41// to the database is not working.
    4142//
    4243/////////////////////////////////////////////////////////////////////////////
     
    349350    while ((row = res->Next()))
    350351        if (!GetSequence(serv, *row, sequpath))
    351             return 0;
     352            return 2;
    352353
    353354    delete res;
Note: See TracChangeset for help on using the changeset viewer.