Ignore:
Timestamp:
02/26/04 13:31:07 (21 years ago)
Author:
tbretz
Message:
*** empty log message ***
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/merpp.cc

    r3137 r3328  
    66
    77#include "MRawFileRead.h"
     8#include "MSqlInsertRun.h"
    89#include "MRawFileWrite.h"
    910
     
    6061    gLog << all << endl;
    6162    gLog << "Sorry the usage is:" << endl;
    62     gLog << "   merpp [-h] [-?] [-a0] [-vn] [-cn] [-u1]" << endl;
     63    gLog << "   merpp [-h] [-?] [-a] [-vn] [-cn] [-u]" << endl;
    6364    gLog << "         inputfile[.rep,[.raw],[.txt]] [outputfile[.root]]" << endl << endl;
    6465    gLog << "     inputfile.raw:  Magic DAQ binary file." << endl;
     
    7071    gLog << "     -u, --update:                    Update file" << endl;
    7172    gLog << "     -a, --no-colors:                 Do not use Ansii color codes" << endl;
     73    gLog << "     --sql=mysql://user:password@url  Insert run into database <raw data only>" << endl;
    7274    gLog << "     --start=yyyy-mm-dd/hh:mm:ss.mmm: Start event time for merpping report files" << endl;
    7375    gLog << "     --stop=yyyy-mm-dd/hh:mm:ss.mmm:  Stop  event time for merpping report files" << endl;
    74     gLog << "     --run=#:                         Only merpp data corresponding to this run number" << endl;
     76    gLog << "     --run=#:                         Only data corresponding to this run number" << endl;
    7577    gLog << "     -?, -h, --help:                  This help" << endl << endl;
    7678    gLog << "   REMARK: At the moment you can process a .raw _or_ a .rep file, only!" << endl << endl;
    7779}
    7880
    79 // FIXME: Move to MTime (maybe 'InterpreteCmdline'
     81// FIXME: Move to MTime (maybe 'InterpreteCmdline')
    8082MTime AnalyseTime(TString str)
    8183{
     
    118120    kTimeStop.SetName("MTimeStop");
    119121
    120     const Int_t kRunNumber = arg.HasOption("--run=") ? arg.GetIntAndRemove("--run=") : -1;
     122    const Int_t   kRunNumber   = arg.HasOption("--run=") ? arg.GetIntAndRemove("--run=") : -1;
     123    const TString kSqlDataBase(arg.GetStringAndRemove("--sql="));
    121124
    122125    if (kTimeStart)
     
    142145    const Bool_t isreport = kNamein.EndsWith(".rep");
    143146    const Bool_t isdc     = kNamein.EndsWith(".txt");
    144 
    145     if (!kNamein.EndsWith(".raw") && !isreport && !isdc)
     147    const Bool_t israw    = !isreport && !israw;
     148
     149    if (!kNamein.EndsWith(".raw") && israw)
    146150        kNamein += ".raw";
    147151
     
    151155    if (!kNameout.EndsWith(".root"))
    152156        kNameout += ".root";
     157
     158    if (!kSqlDataBase.IsNull() && !israw)
     159        gLog << warn << "WARNING - Option '--sql=' only valid for raw-files... ignored." << endl;
    153160
    154161    //
     
    292299    if (filter)
    293300        tasks.AddToList(filter);
     301    if (israw && !kSqlDataBase.IsNull())
     302    {
     303        MSqlInsertRun *ins = new MSqlInsertRun(kSqlDataBase);
     304        ins->SetUpdate();
     305        tasks.AddToList(ins);
     306    }
    294307    tasks.AddToList(write);
    295308
     
    319332    return 0;
    320333}
    321 
    322 
Note: See TracChangeset for help on using the changeset viewer.