Changeset 9213 for trunk/MagicSoft/Mars


Ignore:
Timestamp:
01/07/09 16:31:28 (16 years ago)
Author:
hoehne
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r9212 r9213  
    1818
    1919                                                 -*-*- END OF LINE -*-*-
     20
     21 2009/01/07 Daniel Hoehne-Moench
     22
     23   * datacenter/macros/filldotrun.C:
     24     - updated column counting numbers
     25     - included a check for the number of columns in the runfiles
     26   
     27   * datacenter/macros/buildsequenceentries.C:
     28     - implemented SumTriggerFlagKEY for sequence building
     29
     30
    2031
    2132 2009/01/06 Thomas Bretz
  • trunk/MagicSoft/Mars/datacenter/macros/buildsequenceentries.C

    r9191 r9213  
    345345        query += ", fL1TriggerTableKEY, fL2TriggerTableKEY,"
    346346            " fHvSettingsKEY, fDiscriminatorThresholdTableKEY,"
    347             " fTriggerDelayTableKEY, fObservationModeKEY "
     347            " fTriggerDelayTableKEY, fObservationModeKEY, fSumTriggerFlagKEY "
    348348            " FROM RunData WHERE fRunTypeKEY=2 AND ";
    349349        query += where;
     
    355355
    356356        row = res->Next();
    357         if (!row || res->GetFieldCount()!=8)
     357        if (!row || res->GetFieldCount()!=9)
    358358        {
    359359            cout << "ERROR - No result from query: " << query << endl;
     
    383383        query1 += Form(" fLightConditionsKEY=%s,",             light.Data());
    384384        query1 += Form(" fObservationModeKEY=%s, ",            (*row)[7]);
     385        query1 += Form(" fSumTriggerFlagKEY=%s, ",             (*row)[8]);
    385386        query1 += "fManuallyChangedKEY=1";
    386387
  • trunk/MagicSoft/Mars/datacenter/macros/filldotrun.C

    r9197 r9213  
    8787using namespace std;
    8888
    89 
    9089Int_t insert(MSQLMagic &serv, Bool_t dummy, TString filename)
    9190{
     
    9695        return -1;
    9796    }
     97    //read the file a second time for the check for number of columns
     98    ifstream fin2(filename);
    9899
    99100    TString strng;
     101    TString strng2;
     102    TObjArray *array = new TObjArray();
     103    Int_t check=0;
     104
    100105    strng.ReadLine(fin);
     106    strng2.ReadLine(fin2);
    101107    if (strng!=TString("[CC Plain Run Summary File]"))
    102108    {
     
    108114
    109115    strng.ReadLine(fin);
     116    strng2.ReadLine(fin2);
    110117    TRegexp reg("[0-9][0-9][0-9][0-9][0-9][0-9]-[0-9]");
    111118    TString arehucas = strng(reg);
     
    135142    {
    136143        strng.ReadLine(fin);
     144        strng2.ReadLine(fin2);
    137145        if (!strng.BeginsWith("Telescope M"))
    138146        {
     
    145153    {
    146154        strng.ReadLine(fin);
     155        strng2.ReadLine(fin2);
    147156        if (strng[0]!='#')
    148157        {
     
    157166    while (1)
    158167    {
     168        // ===== Check for number of columns in file =====
     169        // different arehucas versions provide a different number of columns:
     170        // 200405050 - 200405140: 18 columns
     171        // 200405180 - 200407270: 35 columns
     172        // 200411130 - 200510250: 43 columns
     173        // 200603300 - 200802200: 52 columns
     174        // 200805190 - 200809120: 54 columns
     175        // > 200812040:           55 columns
     176        //
     177
     178        strng2.ReadLine(fin2);
     179        //fill an array with the values separated by ' '
     180        array=strng2.Tokenize(" ");
     181        check=array->GetEntries();
     182        cout << check << endl;
     183        //check the number of columns for the different versions, if there is an empty line (check=0), do nothing
     184        if (check != 0)
     185        {
     186            if ((version <= 200405140 && check != 18) ||
     187                (version >  200405140 && version <= 200407270 && check != 35) ||
     188                (version >  200407270 && version <= 200510250 && check != 43) ||
     189                (version >  200510250 && version <= 200802200 && check != 52) ||
     190                (version >  200802200 && version <= 200809120 && check != 54) ||
     191                (version >  200809120 && check != 55))
     192            {
     193                strng.ReadLine(fin);
     194                cout << "ERROR - Number of columns doesn't match number of required columns." << endl;
     195                array->Delete();
     196                continue;
     197            }
     198        }
     199        array->Delete();
     200
     201
     202        // ========== Col 1: Telescope Number =========
    159203        Int_t telnumber = 1; // FIXME: "NULL"?
    160204        if (version >=200805190)
     
    181225        }
    182226
    183         // ========== Col 1: Run Number =========
     227        // ========== Col 2: Run Number =========
    184228        //Reading the line
    185229        //and converting some strings to ints/floats
     
    200244        }
    201245
     246        // ========== Col 3: Subrun Number ========= starting with version 200805190
    202247        Int_t filenumber = 0; // FIXME: "NULL"?
    203248        if (version >=200805190)
     
    217262        }
    218263
    219         // ========== Col 2: Run Type =========
     264        // ========== Col 4: Run Type =========
    220265        strng.ReadToDelim(fin, ' ');
    221266        if (strng.Contains("???"))
     
    232277        //cout << runtype << " ";
    233278
    234         // ========== Col 3,4: Start Time =========
     279        // ========== Col 5,6: Start Time =========
    235280        TString startdate, starttime;
    236281        startdate.ReadToDelim(fin, ' ');
     
    238283        //cout << startdate << " " << starttime << " ";
    239284
    240         // ========== Col 5,6: Stop Time =========
     285        // ========== Col 7,8: Stop Time =========
    241286        TString stopdate, stoptime;
    242287        stopdate.ReadToDelim(fin, ' ');
     
    253298            stoptime="00:00:00";
    254299
    255         // ========== Col 7: Source Name =========
     300        // ========== Col 9: Source Name =========
    256301        strng.ReadToDelim(fin, ' ');
    257302        if (strng.Contains("???"))
     
    266311        //cout << sourcekey << " ";
    267312
    268         // ========== Col 8,9: Local source position =========
     313        // ========== Col 10,11: Local source position =========
    269314        strng.ReadToDelim(fin, ' ');
    270315        Float_t zd = atof(strng.Data());
     
    275320        //cout << zd << " " << az << " ";
    276321
    277         // ========== Col 10: Number of Events =========
     322        // ========== Col 12: Number of Events =========
    278323        strng.ReadToDelim(fin, ' ');
    279324        Int_t evtno = atoi(strng.Data());
     
    281326        //cout << evtno << " ";
    282327
    283         // ========== Col 11: Project Name =========
     328        // ========== Col 13: Project Name =========
    284329        strng.ReadToDelim(fin, ' ');
    285330        if (strng.Contains("???"))
     
    294339        //cout << projkey << " ";
    295340
    296         // ========== Col 12: Trigger Table Name =========
    297         // starting from version 200411130: Col 12,13: Trigger Table Name =========
     341        // ========== Col 14: Trigger Table Name =========
     342        // starting from version 200411130: Col 14,15: Trigger Table Name =========
    298343        strng.ReadToDelim(fin, ' ');
    299344        if (strng.Contains("???"))
     
    401446        }
    402447
    403         // ========== Col 13-15: TrigRate, L2 UnPresc Rate, L2 Presc Rate ==========
     448        // ========== Col 16-18: TrigRate, L2 UnPresc Rate, L2 Presc Rate ==========
    404449        strng.ReadToDelim(fin, ' ');
    405450        Float_t trigrate = atof(strng.Data());
     
    411456        Float_t l2prrate = atof(strng.Data());
    412457
    413         // ========== Col 16,17: DaqRate, Storage Rate ==========
     458        // ========== Col 19,20: DaqRate, Storage Rate ==========
    414459        strng.ReadToDelim(fin, ' ');
    415460        Float_t daqrate = atof(strng.Data());
     
    418463        Float_t storerate = atof(strng.Data());
    419464
    420         // ========== Col 18: HV table =========
     465        // ========== Col 21: HV table =========
    421466        if (version==200405050 || version==200405140)
    422467            strng.ReadToDelim(fin, '\n');
     
    443488        if (version>=200411130)
    444489        {
    445             // ========== Col 19-35: DC and HV-values, mjd =========
     490            // ========== Col 22-38: DC and HV-values, mjd =========
    446491            for (int i=0 ; i<17 ; i++)
    447492            {
     
    449494            }
    450495
    451             // ========== Col 36: test-flag =========
     496            // ========== Col 39: test-flag =========
    452497            strng.ReadToDelim(fin, ' ');
    453498            if (strng.Contains("???"))
     
    461506            }
    462507
    463             // ========== Col 37: light conditions =========
     508            // ========== Col 40: light conditions =========
    464509            strng.ReadToDelim(fin, ' ');
    465510            if (strng.Contains("???"))
     
    473518            }
    474519
    475             // ========== Col 38: discriminator threshold table =========
     520            // ========== Col 41: discriminator threshold table =========
    476521            strng.ReadToDelim(fin, ' ');
    477522            if (strng.Contains("???"))
     
    485530            }
    486531
    487             // ========== Col 39: trigger delay table =========
     532            // ========== Col 42: trigger delay table =========
    488533            strng.ReadToDelim(fin, ' ');
    489534            if (strng.Contains("???"))
     
    497542            }
    498543
    499             // ========== Col 40,41: Telescope RA and Dec sent to drive =========
    500             strng.ReadToDelim(fin, ' ');
    501             strng.ReadToDelim(fin, ' ');
    502 
    503             // ========== Col 42: Calibration Script =========
     544            // ========== Col 43,44: Telescope RA and Dec sent to drive =========
     545            strng.ReadToDelim(fin, ' ');
     546            strng.ReadToDelim(fin, ' ');
     547
     548            // ========== Col 45: Calibration Script =========
    504549            if (version>=200411130 && version<=200510250)
    505550                strng.ReadToDelim(fin, '\n');
     
    521566        if (version>=200603300)
    522567        {
    523             // ========== Col 43: Observation Mode =========
     568            // ========== Col 46: Observation Mode =========
    524569            strng.ReadToDelim(fin, ' ');
    525570            if (strng.Contains("???"))
     
    533578            }
    534579
    535             // ========== Col 44-51: Source RA and Dec, DT's and IPR =========
     580            // ========== Col 47-54: Source RA and Dec, DT's and IPR =========
    536581            for (int i=0 ; i<7 ; i++)
    537582            {
     
    547592        if (version>=200812040)
    548593        {
    549             // ========= Col 52: SumTrigger flag =========
     594            // ========= Col 55: SumTrigger flag =========
    550595            strng.ReadToDelim(fin, '\n');
    551596            if (strng.Contains("???"))
Note: See TracChangeset for help on using the changeset viewer.