- Timestamp:
- 08/15/08 13:14:52 (16 years ago)
- Location:
- trunk/MagicSoft/Mars/datacenter/macros
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/datacenter/macros/plotdb.C
r9067 r9120 1 1 /* ======================================================================== *\ 2 ! $Name: not supported by cvs2svn $:$Id: plotdb.C,v 1.5 1 2008-08-01 13:41:57 tbretzExp $2 ! $Name: not supported by cvs2svn $:$Id: plotdb.C,v 1.52 2008-08-15 12:14:52 dorner Exp $ 3 3 ! -------------------------------------------------------------------------- 4 4 ! … … 720 720 } 721 721 722 int plotdb(const char *ds )722 int plotdb(const char *ds, TString path) 723 723 { 724 724 MSQLMagic serv("sql.rc"); … … 744 744 plot.SetRequestRange("", ""); 745 745 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 752 int 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"); 748 778 749 779 return 1; … … 782 812 int plotdb() 783 813 { 784 return plotdb("", "" );814 return plotdb("", "", ""); 785 815 } -
trunk/MagicSoft/Mars/datacenter/macros/plotoptical.C
r8996 r9120 1 1 /* ======================================================================== *\ 2 ! $Name: not supported by cvs2svn $:$Id: plotoptical.C,v 1. 9 2008-07-05 19:01:42 tbretzExp $2 ! $Name: not supported by cvs2svn $:$Id: plotoptical.C,v 1.10 2008-08-15 12:14:52 dorner Exp $ 3 3 ! -------------------------------------------------------------------------- 4 4 ! … … 197 197 } 198 198 199 int plotoptical(const char *source )199 int plotoptical(const char *source, TString path) 200 200 { 201 201 MSQLMagic serv("sql.rc"); … … 222 222 plotalloptical(plot, source); 223 223 // Use this to create output plots automatically 224 // d->SaveAsRoot( "plotoptical.root");224 // d->SaveAsRoot(plot+"plotoptical.root"); 225 225 // d->SaveAsPS("plotoptical.ps"); 226 226 … … 260 260 } 261 261 262 int 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 262 294 int plotoptical() 263 295 { -
trunk/MagicSoft/Mars/datacenter/macros/plotstat.C
r8999 r9120 1 1 /* ======================================================================== *\ 2 ! $Name: not supported by cvs2svn $:$Id: plotstat.C,v 1. 8 2008-07-14 19:59:06 tbretzExp $2 ! $Name: not supported by cvs2svn $:$Id: plotstat.C,v 1.9 2008-08-15 12:14:52 dorner Exp $ 3 3 ! -------------------------------------------------------------------------- 4 4 ! … … 332 332 333 333 // 1: All data 334 query[1] = "SELECT TSUM(TIME_TO_SEC(TIMEDIFF(fRunStop,fRunStart)))/3600 ";334 query[1] = "SELECT SUM(TIME_TO_SEC(TIMEDIFF(fRunStop,fRunStart)))/3600 "; 335 335 query[1] += "FROM RunData WHERE fRunTypeKEY=2"; 336 336 … … 696 696 return 1; 697 697 } 698 699 int 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 1 1 /* ======================================================================== *\ 2 ! $Name: not supported by cvs2svn $:$Id: plotusage.C,v 1. 1 2008-08-14 11:20:37dorner Exp $2 ! $Name: not supported by cvs2svn $:$Id: plotusage.C,v 1.2 2008-08-15 12:14:52 dorner Exp $ 3 3 ! -------------------------------------------------------------------------- 4 4 ! … … 19 19 ! 20 20 ! 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> 21 22 ! 22 23 ! Copyright: MAGIC Software Development, 2000-2008 … … 30 31 // =========== 31 32 // 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. 33 35 // 34 36 // Usage: 35 37 // .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 plotted38 // or a time period from a certain date to a certain date39 // .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 plotted41 38 // 42 39 // Make sure, that database and password are corretly set in a resource … … 81 78 } 82 79 83 int plotusage(TString from, TString to, const char *dataset=0)80 int plotusage(TString path="") 84 81 { 85 82 MSQLMagic serv("sql.rc"); … … 101 98 102 99 MPlot plot(serv); 103 plot.SetDataSet(dataset);104 100 plot.SetDisplay(d); 105 plot.SetRequestRange(from, to);106 101 107 102 plotallusage(plot); 108 103 109 d->SaveAsRoot( "plotusage.root");110 // d->SaveAsPS("plot db.ps");104 d->SaveAsRoot(path+"plotusage.root"); 105 // d->SaveAsPS("plotusage.ps"); 111 106 112 107 return 1; 113 108 } 114 109 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.