Ignore:
Timestamp:
05/30/05 19:12:54 (20 years ago)
Author:
Daniela Dorner
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/datacenter/macros
Files:
19 edited

Legend:

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

    r7024 r7112  
    6464Bool_t DeleteSequences(MSQLServer &serv, TString cond)
    6565{
    66     TString query(Form("SELECT fSequenceFirst FROM MyMagic.Sequences"
     66    TString query(Form("SELECT fSequenceFirst FROM Sequences"
    6767                       " WHERE %s AND fManuallyChangedKEY=1", cond.Data()));
    6868
     
    7474    while ((row=res->Next()))
    7575    {
    76         query = Form("DELETE FROM MyMagic.Calibration WHERE fSequenceFirst=%s", (*row)[0]);
     76        query = Form("DELETE FROM Calibration WHERE fSequenceFirst=%s", (*row)[0]);
    7777
    7878        TSQLResult *res = serv.Query(query);
     
    8181        delete res;
    8282
    83         query = Form("DELETE FROM MyMagic.Star WHERE fSequenceFirst=%s", (*row)[0]);
     83        query = Form("DELETE FROM Star WHERE fSequenceFirst=%s", (*row)[0]);
    8484
    8585        TSQLResult *res = serv.Query(query);
     
    8888        delete res;
    8989
    90         query = Form("DELETE FROM MyMagic.SequenceProcessStatus WHERE fSequenceFirst=%s", (*row)[0]);
     90        query = Form("DELETE FROM SequenceProcessStatus WHERE fSequenceFirst=%s", (*row)[0]);
    9191
    9292        res = serv.Query(query);
     
    9999        gSystem->Unlink(fname);
    100100
    101         query = Form("UPDATE MyMagic.RunData SET fSequenceFirst=0 WHERE fSequenceFirst=%s", (*row)[0]);
     101        query = Form("UPDATE RunData SET fSequenceFirst=0 WHERE fSequenceFirst=%s", (*row)[0]);
    102102
    103103        res = serv.Query(query);
     
    109109    delete res;
    110110
    111     query = Form("DELETE FROM MyMagic.Sequences WHERE %s AND fManuallyChangedKEY=1", cond.Data());
     111    query = Form("DELETE FROM Sequences WHERE %s AND fManuallyChangedKEY=1", cond.Data());
    112112    res = serv.Query(query);
    113113    if (!res)
     
    121121Int_t CheckOverlap(MSQLServer &serv, Int_t from, Int_t to)
    122122{
    123     TString query(Form("SELECT fSequenceFirst FROM MyMagic.Sequences WHERE"
     123    TString query(Form("SELECT fSequenceFirst FROM Sequences WHERE"
    124124                       " (%d BETWEEN fSequenceFirst AND fSequenceLast) OR "
    125125                       " (%d BETWEEN fSequenceFirst AND fSequenceLast)", from, to));
     
    173173                  " fProjectKEY, fHvSettingsKEY, fDiscriminatorThresholdTableKEY,"
    174174                  " fTriggerDelayTableKEY, fLightConditionsKEY, fTestFlagKEY"
    175                   " FROM MyMagic.RunData");
     175                  " FROM RunData");
    176176    query += Form(" WHERE fRunTypeKEY=%d AND fSourceKEY=%d AND fExcludedFDAKEY=1 AND (fRunNumber BETWEEN %d AND %d)"
    177177                  " ORDER BY fRunNumber", type, src, from, to);
     
    214214    query +=      " MIN(fZenithDistance), MAX(fZenithDistance), ";
    215215    query +=      " MIN(fAzimuth), MAX(fAzimuth) ";
    216     query += Form(" FROM MyMagic.RunData"
     216    query += Form(" FROM RunData"
    217217                  " WHERE fRunTypeKEY=2 AND fSourceKEY=%d AND (fRunNumber BETWEEN %d AND %d) AND fExcludedFDAKEY=1",
    218218                  src, from, to);
     
    239239
    240240    // ========== Request start time of sequence ==========
    241     query = Form("SELECT fRunStart FROM MyMagic.RunData WHERE fRunNumber=%d AND fSourceKEY=%d AND fExcludedFDAKEY=1", from, src);
     241    query = Form("SELECT fRunStart FROM RunData WHERE fRunNumber=%d AND fSourceKEY=%d AND fExcludedFDAKEY=1", from, src);
    242242
    243243    res = serv.Query(query);
     
    260260                 " fHvSettingsKEY, fDiscriminatorThresholdTableKEY,"
    261261                 " fTriggerDelayTableKEY, fLightConditionsKEY, fTestFlagKEY"
    262                  " FROM MyMagic.RunData"
     262                 " FROM RunData"
    263263                 " WHERE fRunTypeKEY=2 AND fSourceKEY=%d AND fExcludedFDAKEY=1 AND (fRunNumber BETWEEN %d AND %d)"
    264264                 " LIMIT 1", src, from, to);
     
    275275    }
    276276
    277     TString query1 = Form("INSERT MyMagic.Sequences SET"
     277    TString query1 = Form("INSERT Sequences SET"
    278278                          " fSequenceFirst=%d,"
    279279                          " fSequenceLast=%d,"
     
    302302                          (*row)[7]);
    303303
    304     TString query2 = Form("UPDATE MyMagic.RunData SET fSequenceFirst=%d WHERE"
     304    TString query2 = Form("UPDATE RunData SET fSequenceFirst=%d WHERE"
    305305                          "  (fRunNumber  BETWEEN %d AND %d) AND"
    306306                          "  (fRunTypeKEY BETWEEN  2 AND  4) AND"
     
    308308                          from, from, to, src, (*row)[3]);
    309309
    310     TString query3 = Form("INSERT MyMagic.SequenceProcessStatus SET fSequenceFirst=%d ",
     310    TString query3 = Form("INSERT SequenceProcessStatus SET fSequenceFirst=%d ",
    311311                          from);
    312312    delete res;
     
    364364{
    365365    TString query(Form("SELECT fSourceKEY"
    366                        " FROM MyMagic.RunData"
     366                       " FROM RunData"
    367367                       " WHERE %s AND fExcludedFDAKEY=1 AND (fRunTypeKEY BETWEEN 2 AND 4) GROUP BY fSourceKEY",
    368368                       cond.Data())
     
    392392
    393393    TString query(Form("SELECT fRunNumber, fRunTypeKEY, fRunStart, fRunStop"
    394                        " FROM MyMagic.RunData"
     394                       " FROM RunData"
    395395                       " WHERE %s AND fSourceKEY=%d AND fExcludedFDAKEY=1 AND"
    396396                       " (fRunTypeKEY BETWEEN 2 AND 4)"
  • trunk/MagicSoft/Mars/datacenter/macros/checkfileavail.C

    r6933 r7112  
    4545TString GetStatus(MSQLServer &serv, TEnv &rc, TString primary, TString table, TString column)
    4646{
    47     TString query(Form("SELECT %s FROM MyMagic.%s WHERE %s=%s",
     47    TString query(Form("SELECT %s FROM %s WHERE %s=%s",
    4848                       column.Data(), table.Data(),
    4949                       rc.GetValue(table+".Primary", ""),
     
    9090
    9191    cout << "sequ: " << sequenceno.Data() << endl;
    92     TString query(Form("SELECT fRunNumber FROM MyMagic.RunData WHERE fSequenceFirst=%s",
     92    TString query(Form("SELECT fRunNumber FROM RunData WHERE fSequenceFirst=%s",
    9393                       sequenceno.Data()));
    9494
  • trunk/MagicSoft/Mars/datacenter/macros/checkstardone.C

    r7042 r7112  
    4545TString GetStatus(MSQLServer &serv, TEnv &rc, TString primary, TString table, TString column)
    4646{
    47     TString query(Form("SELECT %s FROM MyMagic.%s WHERE %s=%s",
     47    TString query(Form("SELECT %s FROM %s WHERE %s=%s",
    4848                       column.Data(), table.Data(),
    4949                       rc.GetValue(table+".Primary", ""),
  • trunk/MagicSoft/Mars/datacenter/macros/doexclusions.C

    r6933 r7112  
    4545int GetRunNumber(MSQLServer &serv, TString date, TString value)
    4646{
    47     TString query(Form("SELECT %s(fRunNumber) FROM MyMagic.RunData ", value.Data()));
     47    TString query(Form("SELECT %s(fRunNumber) FROM RunData ", value.Data()));
    4848
    4949    if (date!="NULL")
     
    7777TString GetJoin(TString table)
    7878{
    79     TString query(Form("left join MyMagic.%s ON RunData.f%sKEY=%s.f%sKEY ",
     79    TString query(Form("left join %s ON RunData.f%sKEY=%s.f%sKEY ",
    8080                       table.Data(), table.Data(), table.Data(), table.Data()));
    8181    return query;
     
    114114    TString runcond(Form("AND fRunNumber BETWEEN %d AND %d ", startrun, stoprun));
    115115
    116     TString query="SELECT fExcludedFDAKEY from MyMagic.ExcludedFDA where fExcludedFDAAutomatic='yes'";
     116    TString query="SELECT fExcludedFDAKEY from ExcludedFDA where fExcludedFDAAutomatic='yes'";
    117117    TSQLResult *res = serv.Query(query);
    118118    if (!res)
     
    131131        TString border=rc.GetValue("key"+key+".SpecialRunCond", "");
    132132
    133         TString query(Form("SELECT fExcludedFDAImportance from MyMagic.ExcludedFDA where fExcludedFDAKEY=%s ", key.Data()));
     133        TString query(Form("SELECT fExcludedFDAImportance from ExcludedFDA where fExcludedFDAKEY=%s ", key.Data()));
    134134        TSQLResult *res = serv.Query(query);
    135135        if (!res)
     
    150150        if (!join2.IsNull())
    151151            query+=Form(", f%sName", join2.Data());
    152         query +=" FROM MyMagic.RunData ";
     152        query +=" FROM RunData ";
    153153        query +=GetJoin("ExcludedFDA");
    154154        if (!join1.IsNull())
     
    177177            if (TString((*row2)[1]).IsNull() || atoi((*row2)[1])>newimp)
    178178            {
    179                 TString query(Form("UPDATE MyMagic.RunData SET fExcludedFDAKEY=%s WHERE fRunNumber=%s",
     179                TString query(Form("UPDATE RunData SET fExcludedFDAKEY=%s WHERE fRunNumber=%s",
    180180                                   key.Data(), (*row2)[0]));
    181181                cout << "QU: " << query << endl;
  • trunk/MagicSoft/Mars/datacenter/macros/fillcalib.C

    r7089 r7112  
    235235
    236236    TString query;
    237     if (!ExistStr(serv, "fSequenceFirst", "MyMagic.Calibration", seq))
    238     {
    239         query = Form("INSERT MyMagic.Calibration SET"
     237    if (!ExistStr(serv, "fSequenceFirst", "Calibration", seq))
     238    {
     239        query = Form("INSERT Calibration SET"
    240240                     " fSequenceFirst=%d,"
    241241                     " fUnsuitableInner=%d, "
     
    261261    else
    262262    {
    263         query = Form("UPDATE MyMagic.Calibration SET"
     263        query = Form("UPDATE Calibration SET"
    264264                     " fUnsuitableInner=%d, "
    265265                     " fUnsuitableOuter=%d, "
  • trunk/MagicSoft/Mars/datacenter/macros/filldotrbk.C

    r6933 r7112  
    105105{
    106106
    107     if (ExistStr(serv, "fRunBookDate", "MyMagic.RunBook", date))
     107    if (ExistStr(serv, "fRunBookDate", "RunBook", date))
    108108        return 0;
    109109
     
    116116            entry.Remove(i--);
    117117
    118     TString query("INSERT MyMagic.RunBook (fRunBookDate, fRunBookText) VALUES (\"");
     118    TString query("INSERT RunBook (fRunBookDate, fRunBookText) VALUES (\"");
    119119    query += date;
    120120    query += "\", \"";
  • trunk/MagicSoft/Mars/datacenter/macros/filldotrun.C

    r6970 r7112  
    107107    TString query;
    108108
    109     query = Form("SELECT f%sKEY FROM MyMagic.%s WHERE f%sName='%s'", col, col, col, name);
     109    query = Form("SELECT f%sKEY FROM %s WHERE f%sName='%s'", col, col, col, name);
    110110    TSQLResult *res = serv.Query(query);
    111111    if (!res)
     
    124124        return -1;
    125125
    126     query = Form("INSERT MyMagic.%s (f%sName) VALUES (\"%s\");", col, col, name);
     126    query = Form("INSERT %s (f%sName) VALUES (\"%s\");", col, col, name);
    127127
    128128    if (dummy)
     
    213213        //cout << "RunNo: " << runnumber << " ";
    214214
    215         if (ExistStr(serv, "fRunNumber", "MyMagic.RunData", strng.Data()))
     215        if (ExistStr(serv, "fRunNumber", "RunData", strng.Data()))
    216216        {
    217217            // FIXME: Maybe we can implement an switch to update mode?
     
    528528        //assemlbe the query that is needed to insert the values of this run
    529529        TString query;
    530         query += "INSERT MyMagic.RunData SET ";
     530        query += "INSERT RunData SET ";
    531531
    532532        query += Form("fRunNumber=%d, ",  runnumber);
     
    573573
    574574        //create entry in table RunProcessStatus for this runnumber
    575         TString query2=Form("INSERT MyMagic.RunProcessStatus SET fRunNumber=%d, fTimingCorrection='1970-01-01 00:00:00'",
     575        TString query2=Form("INSERT RunProcessStatus SET fRunNumber=%d, fTimingCorrection='1970-01-01 00:00:00'",
    576576                    runnumber);
    577577        res = serv.Query(query2);
  • trunk/MagicSoft/Mars/datacenter/macros/fillsignal.C

    r7084 r7112  
    128128    cout << "  Mean Ped RMS outer [phe] " << Form("%4.1f", meano) << endl;
    129129
    130     TString query = Form("UPDATE MyMagic.Calibration SET fMeanPedRmsInner=%s, "
     130    TString query = Form("UPDATE Calibration SET fMeanPedRmsInner=%s, "
    131131                         " fMeanPedRmsOuter=%s WHERE fSequenceFirst='%d' ",
    132132                         meaninner.Data(), meanouter.Data(), seq);
  • trunk/MagicSoft/Mars/datacenter/macros/fillstar.C

    r7087 r7112  
    111111    }
    112112
    113     Float_t psf = (h1->Integral(5, 14) - 0.759)/0.027;
     113    //spline
     114//    Float_t psf = (h1->Integral(5, 14) - 0.818)/0.0276;
     115    //df
     116    Float_t psf = (h1->Integral(5, 14) - 0.736)/0.0276;
    114117    psf = TMath::Nint(psf*10)/10.;
    115118    TString PSF = Form("%5.1f", psf);
     
    124127
    125128    Float_t integral = h2->Integral(5, 14);
    126     Float_t integralmc = -33.0*psf + 10517;
     129    //spline
     130//    Float_t integralmc = -36.06*psf + 11023;
     131    //df
     132    Float_t integralmc = -26.1*psf + 9750;
    127133    Float_t ratiodatamc = (integral/integralmc)*100;
    128134    TString ratio = Form("%5.1f", ratiodatamc);
     
    171177
    172178    TString query;
    173     if (!ExistStr(serv, "fSequenceFirst", "MyMagic.Star", seq))
    174     {
    175         query = Form("INSERT MyMagic.Star SET"
     179    if (!ExistStr(serv, "fSequenceFirst", "Star", seq))
     180    {
     181        query = Form("INSERT Star SET"
    176182                     " fSequenceFirst=%d,"
    177183                     " fMeanNumberIslands=%s, "
     
    187193    else
    188194    {
    189         query = Form("UPDATE MyMagic.Star SET"
     195        query = Form("UPDATE Star SET"
    190196                     " fMeanNumberIslands=%s, "
    191197                     " fRatio=%s, "
  • trunk/MagicSoft/Mars/datacenter/macros/findcacofiles.C

    r6933 r7112  
    6060    cout << endl;
    6161
    62     TString query="SELECT fRunNumber FROM MyMagic.RunProcessStatus WHERE IsNull(fCaCoFileFound) ";
     62    TString query="SELECT fRunNumber FROM RunProcessStatus WHERE IsNull(fCaCoFileFound) ";
    6363    query+=" and fRunNumber > 10000 and not IsNull(fCCFileAvail)";
    6464
  • trunk/MagicSoft/Mars/datacenter/macros/getdolist.C

    r6933 r7112  
    8181    }
    8282
    83     TString query(Form("SELECT %s.%s FROM MyMagic.%s",
     83    TString query(Form("SELECT %s.%s FROM %s",
    8484                       table.Data(), rc.GetValue(table+".Primary", ""),
    8585                       table.Data()));
    8686
    8787    if (date!="NULL" && rc.GetValue(table+".TimerTable", "")!="")
    88         query+=Form(" left join MyMagic.%s on %s.%s=%s.%s ",
     88        query+=Form(" left join %s on %s.%s=%s.%s ",
    8989                    rc.GetValue(table+".TimerTable", ""), table.Data(),
    9090                    rc.GetValue(table+".Primary", ""),
  • trunk/MagicSoft/Mars/datacenter/macros/insertcacofile.C

    r6933 r7112  
    6161
    6262    Int_t newrunno=atoi(newrunnumber.Data());
    63     TString query(Form("UPDATE MyMagic.RunProcessStatus SET fCaCoFileAvail=Now(), fCaCoFileFound=%d WHERE fRunNumber=%s ",
     63    TString query(Form("UPDATE RunProcessStatus SET fCaCoFileAvail=Now(), fCaCoFileFound=%d WHERE fRunNumber=%s ",
    6464                       newrunno, runnumber.Data()));
    6565    cout << "qu: " << query << endl;
  • trunk/MagicSoft/Mars/datacenter/macros/insertdataset.C

    r7037 r7112  
    6363    TString query;
    6464
    65     query = Form("SELECT f%sKEY FROM MyMagic.%s WHERE f%sName='%s'", col, col, col, name);
     65    query = Form("SELECT f%sKEY FROM %s WHERE f%sName='%s'", col, col, col, name);
    6666    TSQLResult *res = serv.Query(query);
    6767    if (!res)
     
    8080        return -1;
    8181
    82     query = Form("INSERT MyMagic.%s (f%sName) VALUES (\"%s\");", col, col, name);
     82    query = Form("INSERT %s (f%sName) VALUES (\"%s\");", col, col, name);
    8383
    8484    if (dummy)
     
    130130    cout << "no:" << number << endl;
    131131
    132     if (!ExistStr(serv, "fDataSetNumber", "MyMagic.DataSets", number.Data())) // Form("%d", number)
     132    if (!ExistStr(serv, "fDataSetNumber", "DataSets", number.Data())) // Form("%d", number)
    133133    {
    134         TString query=Form("INSERT MyMagic.DataSets SET fDataSetNumber='%s', "
     134        TString query=Form("INSERT DataSets SET fDataSetNumber='%s', "
    135135                   " fSourceKEY=%d, fWobble='%s' ",
    136136                   number.Data(), sourcekey, wobble.Data());
     
    151151
    152152
    153         query=Form("INSERT MyMagic.DataSetProcessStatus SET fDataSetNumber='%s', "
     153        query=Form("INSERT DataSetProcessStatus SET fDataSetNumber='%s', "
    154154                   " fDataSetInserted=Now() ",
    155155                   number.Data());
  • trunk/MagicSoft/Mars/datacenter/macros/insertdate.C

    r6933 r7112  
    7979    cout << endl;
    8080
    81     if (!ExistStr(serv, "fDate", "MyMagic.SequenceBuildStatus", date))
     81    if (!ExistStr(serv, "fDate", "SequenceBuildStatus", date))
    8282    {
    83         TString query(Form("INSERT MyMagic.SequenceBuildStatus SET fDate='%s', fCCFilled=Now() ",
     83        TString query(Form("INSERT SequenceBuildStatus SET fDate='%s', fCCFilled=Now() ",
    8484                           date.Data()));
    8585
     
    9696        cout << date << " already exists... do update. " << endl;
    9797
    98         TString query="UPDATE MyMagic.SequenceBuildStatus SET fCCFilled=Now(), fExclusionsDone=NULL, ";
     98        TString query="UPDATE SequenceBuildStatus SET fCCFilled=Now(), fExclusionsDone=NULL, ";
    9999        query +=Form("fSequenceEntriesBuilt=NULL WHERE fDate='%s' ", date.Data());
    100100
  • trunk/MagicSoft/Mars/datacenter/macros/plotdb.C

    r7101 r7112  
    339339    cout << endl;
    340340
    341     serv.SelectDataBase("MyMagic");
    342 
    343341    MStatusDisplay *d = new MStatusDisplay;
    344342
     
    366364    cout << endl;
    367365
    368     serv.SelectDataBase("MyMagic");
    369 
    370366    MStatusDisplay *d = new MStatusDisplay;
    371367
  • trunk/MagicSoft/Mars/datacenter/macros/resetallruns.C

    r6933 r7112  
    5959    cout << endl;
    6060
    61     TString query(Form("UPDATE MyMagic.RunProcessStatus SET %s=NULL",
     61    TString query(Form("UPDATE RunProcessStatus SET %s=NULL",
    6262                       column.Data()));
    6363    if (column.Contains("CaCo"))
     
    9090            break;
    9191
    92         TString query(Form("UPDATE MyMagic.RunProcessStatus SET %s=Now()", column.Data()));
     92        TString query(Form("UPDATE RunProcessStatus SET %s=Now()", column.Data()));
    9393
    9494        if (column.Contains("CaCo"))
  • trunk/MagicSoft/Mars/datacenter/macros/resetcolumn.C

    r7102 r7112  
    9797    }
    9898
    99     TString query(Form("Update MyMagic.%s SET %s=NULL ", table.Data(), column.Data()));
     99    TString query(Form("Update %s SET %s=NULL ", table.Data(), column.Data()));
    100100
    101101    TIter Next(&l);
  • trunk/MagicSoft/Mars/datacenter/macros/setstatus.C

    r6933 r7112  
    6666TString CheckDefault(MSQLServer &serv, TEnv &rc, TString primary, TString table, TString influence)
    6767{
    68     TString query(Form("SELECT %s FROM MyMagic.%s WHERE %s=%s",
     68    TString query(Form("SELECT %s FROM %s WHERE %s=%s",
    6969                       influence.Data(), table.Data(),
    7070                       rc.GetValue(table+".Primary", ""), primary.Data()));
     
    9999    TString influences  = rc.GetValue(table+"."+column+".Influences", "");
    100100
    101     TString query(Form("UPDATE MyMagic.%s SET %s=%s",
     101    TString query(Form("UPDATE %s SET %s=%s",
    102102                       table.Data(), column.Data(), value.Data()));
    103103
  • trunk/MagicSoft/Mars/datacenter/macros/writesequencefile.C

    r6933 r7112  
    219219TString GetName(MSQLServer &serv, const char *col, const char *n)
    220220{
    221     TString query(Form("SELECT f%sName FROM MyMagic.%s WHERE f%sKEY=%s",
     221    TString query(Form("SELECT f%sName FROM %s WHERE f%sKEY=%s",
    222222                       col, col, col, n));
    223223   
     
    283283
    284284    TString query(Form("SELECT fRunNumber, fRunTypeKEY, fRunStart, fRunStop, fNumEvents"
    285                        " FROM MyMagic.RunData WHERE fSequenceFirst=%s AND fExcludedFDAKEY=1"
     285                       " FROM RunData WHERE fSequenceFirst=%s AND fExcludedFDAKEY=1"
    286286                       " ORDER BY fRunNumber",
    287287                       data[0]));
     
    328328                       " fL1TriggerTableKEY, fL2TriggerTableKEY, fHvSettingsKEY, "
    329329                       " fLightConditionsKEY, fRunStart, fNumEvents"
    330                        " FROM MyMagic.Sequences WHERE fSequenceFirst=%d", sequno));
     330                       " FROM Sequences WHERE fSequenceFirst=%d", sequno));
    331331    TSQLResult *res = serv.Query(query);
    332332
Note: See TracChangeset for help on using the changeset viewer.