Changeset 9120 for trunk/MagicSoft


Ignore:
Timestamp:
08/15/08 13:14:52 (16 years ago)
Author:
Daniela Dorner
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/datacenter/macros
Files:
4 edited

Legend:

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

    r9067 r9120  
    11/* ======================================================================== *\
    2 ! $Name: not supported by cvs2svn $:$Id: plotdb.C,v 1.51 2008-08-01 13:41:57 tbretz Exp $
     2! $Name: not supported by cvs2svn $:$Id: plotdb.C,v 1.52 2008-08-15 12:14:52 dorner Exp $
    33! --------------------------------------------------------------------------
    44!
     
    720720}
    721721
    722 int plotdb(const char *ds)
     722int plotdb(const char *ds, TString path)
    723723{
    724724    MSQLMagic serv("sql.rc");
     
    744744    plot.SetRequestRange("", "");
    745745    plotalldb(plot);
    746     d->SaveAsRoot("plotdb.root");
    747     d->SaveAsPS("plotdb.ps");
     746    d->SaveAsRoot(path+"plotdb.root");
     747//    d->SaveAsPS("plotdb.ps");
     748
     749    return 1;
     750}
     751
     752int plotdb(TString path)
     753{
     754    MSQLMagic serv("sql.rc");
     755    if (!serv.IsConnected())
     756    {
     757        cout << "ERROR - Connection to database failed." << endl;
     758        return 0;
     759    }
     760
     761    cout << "plotdb" << endl;
     762    cout << "------" << endl;
     763    cout << endl;
     764    cout << "Connected to " << serv.GetName() << endl;
     765    cout << endl;
     766
     767    MStatusDisplay *d = new MStatusDisplay;
     768    d->SetWindowName(serv.GetName());
     769    d->SetTitle(serv.GetName());
     770
     771    MPlot plot(serv);
     772//    plot.SetDataSet(ds);
     773    plot.SetDisplay(d);
     774    plot.SetRequestRange("", "");
     775    plotalldb(plot);
     776    d->SaveAsRoot(path+"plotdb.root");
     777//    d->SaveAsPS("plotdb.ps");
    748778
    749779    return 1;
     
    782812int plotdb()
    783813{
    784     return plotdb("", "");
     814    return plotdb("", "", "");
    785815}
  • trunk/MagicSoft/Mars/datacenter/macros/plotoptical.C

    r8996 r9120  
    11/* ======================================================================== *\
    2 ! $Name: not supported by cvs2svn $:$Id: plotoptical.C,v 1.9 2008-07-05 19:01:42 tbretz Exp $
     2! $Name: not supported by cvs2svn $:$Id: plotoptical.C,v 1.10 2008-08-15 12:14:52 dorner Exp $
    33! --------------------------------------------------------------------------
    44!
     
    197197}
    198198
    199 int plotoptical(const char *source)
     199int plotoptical(const char *source, TString path)
    200200{
    201201    MSQLMagic serv("sql.rc");
     
    222222    plotalloptical(plot, source);
    223223    // Use this to create output plots automatically
    224     //  d->SaveAsRoot("plotoptical.root");
     224    //  d->SaveAsRoot(plot+"plotoptical.root");
    225225    //  d->SaveAsPS("plotoptical.ps");
    226226
     
    260260}
    261261
     262int plotoptical(TString path)
     263{
     264    MSQLMagic serv("sql.rc");
     265    if (!serv.IsConnected())
     266    {
     267        cout << "ERROR - Connection to database failed." << endl;
     268        return 0;
     269    }
     270
     271    cout << "plotoptical" << endl;
     272    cout << "-----------" << endl;
     273    cout << endl;
     274    cout << "Connected to " << serv.GetName() << endl;
     275    cout << endl;
     276
     277    MStatusDisplay *d = new MStatusDisplay;
     278    d->SetWindowName(serv.GetName());
     279    d->SetTitle(serv.GetName());
     280
     281    MPlot plot(serv);
     282    // plot.SetDataSet(dataset);
     283    plot.SetDisplay(d);
     284    //plot.SetRequestPeriod(period);
     285    plotalloptical(plot, 0);
     286
     287    // Use this to create output plots automatically
     288    d->SaveAsRoot(path+"plotoptical.root");
     289    //  d->SaveAsPS("plotoptical.ps");
     290
     291    return 1;
     292}
     293
    262294int plotoptical()
    263295{
  • trunk/MagicSoft/Mars/datacenter/macros/plotstat.C

    r8999 r9120  
    11/* ======================================================================== *\
    2 ! $Name: not supported by cvs2svn $:$Id: plotstat.C,v 1.8 2008-07-14 19:59:06 tbretz Exp $
     2! $Name: not supported by cvs2svn $:$Id: plotstat.C,v 1.9 2008-08-15 12:14:52 dorner Exp $
    33! --------------------------------------------------------------------------
    44!
     
    332332
    333333    // 1: All data
    334     query[1]  = "SELECTT SUM(TIME_TO_SEC(TIMEDIFF(fRunStop,fRunStart)))/3600 ";
     334    query[1]  = "SELECT SUM(TIME_TO_SEC(TIMEDIFF(fRunStop,fRunStart)))/3600 ";
    335335    query[1] += "FROM RunData WHERE fRunTypeKEY=2";
    336336
     
    696696    return 1;
    697697}
     698
     699int plotstat(TString path)
     700{
     701    MSQLServer serv("sql.rc");
     702    if (!serv.IsConnected())
     703    {
     704        cout << "ERROR - Connection to database failed." << endl;
     705        return 0;
     706    }
     707
     708    cout << "plotstat" << endl;
     709    cout << "--------" << endl;
     710    cout << endl;
     711    cout << "Connected to " << serv.GetName() << endl;
     712    cout << endl;
     713
     714    MStatusDisplay *d = new MStatusDisplay;
     715    d->SetWindowName(serv.GetName());
     716    d->SetTitle(serv.GetName());
     717
     718    plot(*d, serv, -1, -1);
     719
     720    d->SaveAsRoot(path+"plotstat.root");
     721    //d->SaveAsPS("plotstat.ps");
     722
     723    return 1;
     724}
     725
  • trunk/MagicSoft/Mars/datacenter/macros/plotusage.C

    r9119 r9120  
    11/* ======================================================================== *\
    2 ! $Name: not supported by cvs2svn $:$Id: plotusage.C,v 1.1 2008-08-14 11:20:37 dorner Exp $
     2! $Name: not supported by cvs2svn $:$Id: plotusage.C,v 1.2 2008-08-15 12:14:52 dorner Exp $
    33! --------------------------------------------------------------------------
    44!
     
    1919!
    2020!   Author(s): Thomas Bretz, 06/2008 <mailto:tbretz@astro.uni-wuerzburg.de>
     21!   Author(s): Daniela Droner, 08/2008 <mailto:tbretz@astro.uni-wuerzburg.de>
    2122!
    2223!   Copyright: MAGIC Software Development, 2000-2008
     
    3031// ===========
    3132//
    32 // This macro is used to read quality parameters from the DB and plot them.
     33// This macro is used to read parameters (condor usage of the cluster) from
     34// the DB and plot them.
    3335//
    3436// Usage:
    3537//   .x plotusage.C   --> all values in the DB are plotted
    36 // You can chose are certain period:
    37 //   .x plotusage.C(25)   --> all values from period 25 are plotted
    38 // or a time period from a certain date to a certain date
    39 //   .x plotusage.C("2004-11-14 00:00:00", "2005-02-28 00:00:00")
    40 //  --> all values from 14.11.2004 0h to 28.2.2005 0h are plotted
    4138//
    4239// Make sure, that database and password are corretly set in a resource
     
    8178}
    8279
    83 int plotusage(TString from, TString to, const char *dataset=0)
     80int plotusage(TString path="")
    8481{
    8582    MSQLMagic serv("sql.rc");
     
    10198
    10299    MPlot plot(serv);
    103     plot.SetDataSet(dataset);
    104100    plot.SetDisplay(d);
    105     plot.SetRequestRange(from, to);
    106101
    107102    plotallusage(plot);
    108103
    109     d->SaveAsRoot("plotusage.root");
    110 //    d->SaveAsPS("plotdb.ps");
     104    d->SaveAsRoot(path+"plotusage.root");
     105//    d->SaveAsPS("plotusage.ps");
    111106
    112107    return 1;
    113108}
    114109
    115 int plotusage(const char *ds)
    116 {
    117     MSQLMagic serv("sql.rc");
    118     if (!serv.IsConnected())
    119     {
    120         cout << "ERROR - Connection to database failed." << endl;
    121         return 0;
    122     }
    123 
    124     cout << "plotusage" << endl;
    125     cout << "---------" << endl;
    126     cout << endl;
    127     cout << "Connected to " << serv.GetName() << endl;
    128     cout << endl;
    129 
    130     MStatusDisplay *d = new MStatusDisplay;
    131     d->SetWindowName(serv.GetName());
    132     d->SetTitle(serv.GetName());
    133 
    134     MPlot plot(serv);
    135     plot.SetDataSet(ds);
    136     plot.SetDisplay(d);
    137     plot.SetRequestRange("", "");
    138 
    139     plotallusage(plot);
    140 
    141     d->SaveAsRoot("plotusage.root");
    142 //    d->SaveAsPS("plotdb.ps");
    143 
    144     return 1;
    145 }
    146 
    147 int plotusage(Int_t period, const char *dataset="")
    148 {
    149     MSQLMagic serv("sql.rc");
    150     if (!serv.IsConnected())
    151     {
    152         cout << "ERROR - Connection to database failed." << endl;
    153         return 0;
    154     }
    155 
    156     cout << "plotusage" << endl;
    157     cout << "---------" << endl;
    158     cout << endl;
    159     cout << "Connected to " << serv.GetName() << endl;
    160     cout << endl;
    161 
    162     MStatusDisplay *d = new MStatusDisplay;
    163     d->SetWindowName(serv.GetName());
    164     d->SetTitle(serv.GetName());
    165 
    166     MPlot plot(serv);
    167     plot.SetDataSet(dataset);
    168     plot.SetDisplay(d);
    169     plot.SetRequestPeriod(period);
    170 
    171     plotallusage(plot);
    172 
    173     d->SaveAsRoot("plotusage.root");
    174 //    d->SaveAsPS("plotdb.ps");
    175 
    176     return 1;
    177 }
    178 
    179 int plotusage()
    180 {
    181     return plotusage("", "");
    182 }
Note: See TracChangeset for help on using the changeset viewer.