Changeset 8987 for trunk


Ignore:
Timestamp:
06/30/08 09:46:36 (16 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r8986 r8987  
    1818
    1919                                                 -*-*- END OF LINE -*-*-
     20
     21 2008/06/30 Thomas Bretz
     22
     23   * datacenter/macros/fillstar.C:
     24     - check whether graphs are empty in a more accurate way
     25
     26   * datacenter/macros/plotdb.C:
     27     - fixed some axis title
     28     - increased range of fRatePedTrigEvts
     29
     30   * msql/MSQLMagic.cc:
     31     - added ' around the where clause in UpdateInsert to allowe
     32       also for times etc
     33
     34
    2035
    2136 2008/06/21 Thomas Bretz
  • trunk/MagicSoft/Mars/datacenter/macros/fillstar.C

    r8959 r8987  
    8080using namespace std;
    8181
     82bool CheckGraph(const TGraph *g)
     83{
     84    return g && g->GetN()>0 && !(g->GetN()==1 && g->GetX()[0]==0);
     85}
     86
    8287int Process(MSQLMagic &serv, TString fname)
    8388{
     
    183188        return 2;
    184189    }
    185     TString maxhum = g->GetN()>0 ? Form("%5.1f", TMath::MaxElement(g->GetN(), g->GetY())) : "NULL";
    186     TString avghum = g->GetN()>0 ? Form("%5.1f", g->GetMean(2)) : "NULL";
     190    TString maxhum = CheckGraph(g) ? Form("%5.1f", TMath::MaxElement(g->GetN(), g->GetY())) : "NULL";
     191    TString avghum = CheckGraph(g) ? Form("%5.1f", g->GetMean(2)) : "NULL";
    187192
    188193    g = (TGraph*)arr.FindObjectInCanvas("Temperature", "TGraph", "MHWeather");
     
    192197        return 2;
    193198    }
    194     TString avgtemp = g->GetN()>0 ? Form("%5.1f", g->GetMean(2)) : "NULL";
     199    TString avgtemp = CheckGraph(g) ? Form("%5.1f", g->GetMean(2)) : "NULL";
    195200
    196201    g = (TGraph*)arr.FindObjectInCanvas("WindSpeed", "TGraph", "MHWeather");
     
    200205        return 2;
    201206    }
    202     TString avgwind = g->GetN()>0 ? Form("%5.1f", g->GetMean(2)) : "NULL";
     207    TString avgwind = CheckGraph(g) ? Form("%5.1f", g->GetMean(2)) : "NULL";
    203208
    204209    g = (TGraph*)arr.FindObjectInCanvas("Cloudiness", "TGraph", "MHWeather");
    205210    if (!g)
    206211        cout << "WARNING - Reading of Cloudiness failed." << endl;
    207     TString avgclouds = g && g->GetN()>0 ? Form("%5.1f", g->GetMean(2)) : "NULL";
    208     TString rmsclouds = g && g->GetN()>0  ? Form("%5.1f", g->GetRMS(2))  : "NULL";
     212
     213    TString avgclouds = CheckGraph(g) ? Form("%5.1f", g->GetMean(2)) : "NULL";
     214    TString rmsclouds = CheckGraph(g) ? Form("%5.1f", g->GetRMS(2))  : "NULL";
    209215
    210216    g = (TGraph*)arr.FindObjectInCanvas("TempSky", "TGraph", "MHWeather");
    211217    if (!g)
    212218        cout << "WARNING - Reading of TempSky failed." << endl;
    213     TString avgsky = g && g->GetN()>0 ? Form("%5.1f", g->GetMean(2)+200) : "NULL";
     219    TString avgsky = CheckGraph(g) ? Form("%5.1f", g->GetMean(2)+200) : "NULL";
    214220
    215221
     
    218224        cout << "WARNING - Reading of NumStars failed." << endl;
    219225
    220     TString numstarsmed = g && g->GetN()>0 ? Form("%5.1f", TMath::Median(g->GetN(), g->GetY())) : "NULL";
    221     TString numstarsrms = g && g->GetN()>0 ? Form("%5.1f", g->GetRMS(2)) : "NULL";
     226    TString numstarsmed = CheckGraph(g) ? Form("%5.1f", TMath::Median(g->GetN(), g->GetY())) : "NULL";
     227    TString numstarsrms = CheckGraph(g) ? Form("%5.1f", g->GetRMS(2)) : "NULL";
    222228
    223229    g = (TGraph*)arr.FindObjectInCanvas("NumStarsCor", "TGraph", "MHPointing");
     
    225231        cout << "WARNING - Reading of NumStarsCor failed." << endl;
    226232
    227     TString numcorsmed = g && g->GetN()>0 ? Form("%5.1f", TMath::Median(g->GetN(), g->GetY())) : "NULL";
    228     TString numcorsrms = g && g->GetN()>0 ? Form("%5.1f", g->GetRMS(2)) : "NULL";
     233    TString numcorsmed = CheckGraph(g) ? Form("%5.1f", TMath::Median(g->GetN(), g->GetY())) : "NULL";
     234    TString numcorsrms = CheckGraph(g) ? Form("%5.1f", g->GetRMS(2)) : "NULL";
    229235
    230236    g = (TGraph*)arr.FindObjectInCanvas("Brightness", "TGraph", "MHPointing");
     
    232238        cout << "WARNING - Reading of SkyBrightness failed." << endl;
    233239
    234     TString skybrightnessmed = g && g->GetN()>0 ? Form("%5.1f", TMath::Median(g->GetN(), g->GetY())) : "NULL";
    235     TString skybrightnessrms = g && g->GetN()>0 ? Form("%5.1f", g->GetRMS(2)) : "NULL";
     240    TString skybrightnessmed = CheckGraph(g) ? Form("%5.1f", TMath::Median(g->GetN(), g->GetY())) : "NULL";
     241    TString skybrightnessrms = CheckGraph(g) ? Form("%5.1f", g->GetRMS(2)) : "NULL";
    236242
    237243    TString sequence = fname(TRegexp("star[0-9]+[.]root$"));
  • trunk/MagicSoft/Mars/datacenter/macros/plotdb.C

    r8986 r8987  
    11/* ======================================================================== *\
    2 ! $Name: not supported by cvs2svn $:$Id: plotdb.C,v 1.46 2008-06-21 13:53:33 tbretz Exp $
     2! $Name: not supported by cvs2svn $:$Id: plotdb.C,v 1.47 2008-06-30 08:46:03 tbretz Exp $
    33! --------------------------------------------------------------------------
    44!
     
    539539    plot.SetDescription("RMS Arrival Time inner Camera;\\sigma_{T,I} [sl]", "RmsArrTmI");
    540540    plot.Plot("Calibration.fArrTimeRmsInner",  0, 4.5, 0.01);
    541     plot.SetDescription("Number of unsuitable pixels inner Camera;N{I}", "UnsuitI");
     541    plot.SetDescription("Number of unsuitable pixels inner Camera;N_{I}", "UnsuitI");
    542542    plot.Plot("Calibration.fUnsuitableInner",  0, 75, 1);
    543543    plot.SetDescription("Number of unsuitable pixels >50%;N", "Unsuit50");
     
    575575    plot.Plot("Calibration.fRatePedEvts", 0, 50, 1);
    576576    plot.SetDescription("Average rate of events with ped+cosmics trigger;R [Hz]", "RatePT");
    577     plot.Plot("Calibration.fRatePedTrigEvts", 0, 3.5, 0.1);
     577    plot.Plot("Calibration.fRatePedTrigEvts", 0, 4.0, 0.1);
    578578    plot.SetDescription("Average rate of events without trigger pattern;R [Hz]", "Rate0");
    579579    plot.Plot("Calibration.fRateNullEvts", 0, 3.5, 0.1);
  • trunk/MagicSoft/Mars/msql/MSQLMagic.cc

    r8942 r8987  
    290290{
    291291    return ExistStr(col, table, val) ?
    292         Update(table, vars, Form("%s=%s", col, val)) :
    293         Insert(table, vars, Form("%s=%s", col, val));
     292        Update(table, vars, Form("%s='%s'", col, val)) :
     293        Insert(table, vars, Form("%s='%s'", col, val));
    294294}
    295295
Note: See TracChangeset for help on using the changeset viewer.