Ignore:
Timestamp:
07/14/08 20:59:13 (17 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/datacenter/macros
Files:
2 edited

Legend:

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

    r8952 r8999  
    5959#include <iomanip>
    6060
    61 #include <TEnv.h>
    6261#include <TRegexp.h>
    6362
     
    381380int fillsignal(TString fname, Bool_t dummy=kTRUE)
    382381{
    383     TEnv env("sql.rc");
    384 
    385     MSQLMagic serv(env);
     382    MSQLMagic serv("sql.rc");
    386383    if (!serv.IsConnected())
    387384    {
  • trunk/MagicSoft/Mars/datacenter/macros/plotstat.C

    r8996 r8999  
    11/* ======================================================================== *\
    2 ! $Name: not supported by cvs2svn $:$Id: plotstat.C,v 1.7 2008-07-05 19:01:42 tbretz Exp $
     2! $Name: not supported by cvs2svn $:$Id: plotstat.C,v 1.8 2008-07-14 19:59:06 tbretz Exp $
    33! --------------------------------------------------------------------------
    44!
     
    319319
    320320    // 0: All data for which are files available
    321     query[0]  = "select SUM(TIME_TO_SEC(TIMEDIFF(fRunStop, fRunStart)))/3600 ";
    322     query[0] += "from RunData left join RunProcessStatus on RunData.fRunNumber=RunProcessStatus.fRunNumber ";
    323     query[0] += "where fRunTypeKey=2 and not ISNULL(fRawFileAvail)";
     321    query[0]  = "SELECT SUM(TIME_TO_SEC(TIMEDIFF(fRunStop, fRunStart)))/3600 ";
     322    query[0] += "FROM RunData ";
     323    query[0] += "LEFT JOIN RunProcessStatus USING (fTelescopeNumber, fRunNumber, fFileNumber) ";
     324    query[0] += "WHERE fRunTypeKey=2 AND NOT ISNULL(fRawFileAvail)";
     325    /*
     326    if (tel>0)
     327    {
     328        query[0] += " AND fTelescopeNumber=";
     329        query[0] += tel;
     330    }
     331    */
    324332
    325333    // 1: All data
    326     query[1]  = "select SUM(TIME_TO_SEC(TIMEDIFF(fRunStop,fRunStart)))/3600 ";
    327     query[1] += "from RunData where fRunTypeKEY=2";
     334    query[1]  = "SELECTT SUM(TIME_TO_SEC(TIMEDIFF(fRunStop,fRunStart)))/3600 ";
     335    query[1] += "FROM RunData WHERE fRunTypeKEY=2";
    328336
    329337    // 2: All data which is not excluded
    330     query[2]  = "select SUM(TIME_TO_SEC(TIMEDIFF(fRunStop,fRunStart)))/3600 ";
    331     query[2] += "from RunData where fRunTypeKEY=2 and fExcludedFDAKEY=1";
     338    query[2]  = "SELECT SUM(TIME_TO_SEC(TIMEDIFF(fRunStop,fRunStart)))/3600 ";
     339    query[2] += "FROM RunData WHERE fRunTypeKEY=2 AND fExcludedFDAKEY=1";
    332340
    333341    // 3: All sequences
    334     query[3]  = "select SUM(fRunTime)/3600 from Sequences";
     342    query[3]  = "SELECT SUM(fRunTime)/3600 FROM Sequences";
    335343
    336344    // 4: All sequences with callisto failed
    337     query[4]  = "select SUM(fRunTime)/3600 from Sequences left join SequenceProcessStatus on ";
    338     query[4] += "Sequences.fSequenceFirst=SequenceProcessStatus.fSequenceFirst where ";
    339     query[4] += "ISNULL(fCallisto) and not ISNULL(fFailedTime) and not ISNULL(fAllFilesAvail)";
     345    query[4]  = "SELECT SUM(fRunTime)/3600 FROM Sequences ";
     346    query[4] += "LEFT JOIN SequenceProcessStatus USING (fSequenceFirst) ";
     347    query[4] += "WHERE ISNULL(fCallisto) AND NOT ISNULL(fFailedTime) AND NOT ISNULL(fAllFilesAvail)";
    340348
    341349    // 5: All sequences with callisto=OK
    342     query[5]  = "select SUM(fRunTime)/3600 from Sequences left join SequenceProcessStatus on ";
    343     query[5] += "Sequences.fSequenceFirst=SequenceProcessStatus.fSequenceFirst where not ISNULL(fCallisto)";
     350    query[5]  = "SELECT SUM(fRunTime)/3600 FROM Sequences ";
     351    query[5] += "LEFT JOIN SequenceProcessStatus USING (fSequenceFirst) ";
     352    query[5] += "WHERE NOT ISNULL(fCallisto)";
    344353
    345354    // 6: All sequences with star failed
    346     query[6]  = "select SUM(fRunTime)/3600 from Sequences left join SequenceProcessStatus on ";
    347     query[6] += "Sequences.fSequenceFirst=SequenceProcessStatus.fSequenceFirst where ";
    348     query[6] += "ISNULL(fStar) and not ISNULL(fFailedTime) and not ISNULL(fCallisto)";
     355    query[6]  = "SELECT SUM(fRunTime)/3600 FROM Sequences ";
     356    query[6] += "LEFT JOIN SequenceProcessStatus USING (fSequenceFirst) ";
     357    query[6] += "WHERE ISNULL(fStar) AND NOT ISNULL(fFailedTime) AND NOT ISNULL(fCallisto)";
    349358
    350359    // 7: All sequences with star=OK
    351     query[7]  = "select SUM(fRunTime)/3600 from Sequences left join SequenceProcessStatus on ";
    352     query[7] += "Sequences.fSequenceFirst=SequenceProcessStatus.fSequenceFirst where not ISNULL(fStar)";
     360    query[7]  = "SELECT SUM(fRunTime)/3600 FROM Sequences ";
     361    query[7] += "LEFT JOIN SequenceProcessStatus USING (fSequenceFirst) ";
     362    query[7] += "WHERE NOT ISNULL(fStar)";
    353363
    354364    // 0: All data
Note: See TracChangeset for help on using the changeset viewer.