Ignore:
Timestamp:
06/13/05 18:10:51 (19 years ago)
Author:
Daniela Dorner
Message:
*** empty log message ***
File:
1 edited

Legend:

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

    r7162 r7164  
    4646
    4747int createdataset(Int_t dataset, TString source, TString wobble,
    48                   TString startdate, TString stopdate,
     48                  Bool_t cal=kFALSE,
     49                  TString startdate="0000-00-00 00:00:00",
     50                  TString stopdate="3000-00-00 00:00:00",
    4951                  TString off="none",
    50                   TString offstartdate="none",
    51                   TString offstopdate="none")
     52                  TString offstartdate="0000-00-00 00:00:00",
     53                  TString offstopdate="3000-00-00 00:00:00")
    5254{
    5355    TEnv env("sql.rc");
     
    6668
    6769    TString fname(Form("/magic/datasets/%05d/dataset%08d.txt", dataset/1000, dataset));
     70    TString fhtml="/home/operator/html";
    6871    Bool_t exist=gSystem->AccessPathName(fname,kFileExists);
    6972    if (exist==0)
     
    7275        return 0;
    7376    }
     77
     78    ofstream fouthtml(fhtml, ios::app);
     79    fouthtml << "<tr><td>" << endl;
     80    fouthtml << dataset << endl;
     81    fouthtml << "</td><td>" << endl;
     82    fouthtml << source << endl;
     83    fouthtml << "</td><td>" << endl;
     84    if (startdate=="0000-00-00 00:00:00")
     85        fouthtml << "all" << endl;
     86    else
     87        fouthtml << "from " << startdate << " to " << stopdate << endl;
     88    if (cal)
     89        fouthtml << "only data processed to the imgpar is taken into account" << endl;
     90    fouthtml << "</td></tr>" << endl;
     91
    7492    ofstream fout(fname, ios::app);
    7593    cout << "writing to file " << fname << endl;
    7694    fout << "AnalysisNumber: " << dataset << endl << endl;
    7795
    78     TString query="Select fSequenceFirst from Sequences left join Source on ";
    79     query +="Sequences.fSourceKEY=Source.fSourceKEY where fSourceName like '";
    80     query +=Form("%s' and fRunStart between '%s' and '%s'",
     96    TString query="Select Sequences.fSequenceFirst from Sequences left join Source on ";
     97    query +="Sequences.fSourceKEY=Source.fSourceKEY ";
     98    if (cal)
     99        query +=" left join SequenceProcessStatus on Sequences.fSequenceFirst=SequenceProcessStatus.fSequenceFirst ";
     100    query +=Form(" where fSourceName like '%s%%' and fRunStart between '%s' and '%s'",
    81101                 source.Data(), startdate.Data(), stopdate.Data());
    82     query +=" order by fSequenceFirst ";
     102    if (cal)
     103        query +=" and not IsNull(fStar) ";
     104    query +=" order by Sequences.fSequenceFirst ";
    83105
    84106    cout << "Q: " << query << endl;
     
    112134
    113135    cout << "off: " << off << endl;
    114     query  ="Select fSequenceFirst from Sequences left join Source on ";
    115     query +=" Sequences.fSourceKEY=Source.fSourceKEY where fSourceName like '";
    116     query +=Form("%s%%' and fRunStart between '%s' and '%s'",
    117                  off.Data(), startdate.Data(), stopdate.Data());
    118     query +=" order by fSequenceFirst ";
     136    query  ="Select Sequences.fSequenceFirst from Sequences left join Source on ";
     137    query +="Sequences.fSourceKEY=Source.fSourceKEY ";
     138    if (cal)
     139        query +=" left join SequenceProcessStatus on Sequences.fSequenceFirst=SequenceProcessStatus.fSequenceFirst ";
     140    query +=Form("where fSourceName like '%s%%' and fRunStart between '%s' and '%s'",
     141                 off.Data(), offstartdate.Data(), offstopdate.Data());
     142    if (cal)
     143        query +=" and not IsNull(fStar) ";
     144    query +=" order by Sequences.fSequenceFirst ";
    119145
    120146    cout << "Q: " << query << endl;
Note: See TracChangeset for help on using the changeset viewer.