Changeset 9155
- Timestamp:
- 11/12/08 13:38:17 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/datacenter/macros/plotstat.C
r9120 r9155 1 1 /* ======================================================================== *\ 2 ! $Name: not supported by cvs2svn $:$Id: plotstat.C,v 1. 9 2008-08-15 12:14:52 dornerExp $2 ! $Name: not supported by cvs2svn $:$Id: plotstat.C,v 1.10 2008-11-12 13:38:17 tbretz Exp $ 3 3 ! -------------------------------------------------------------------------- 4 4 ! … … 190 190 void DrawCake(TH1F *h, Int_t p0=-1, Int_t p1=9999) 191 191 { 192 gPad->Range(-1, -0. 9, 1, 1.1);192 gPad->Range(-1, -0.84, 1, 1.16); 193 193 194 194 gPad->SetFillColor(kWhite); … … 208 208 const Double_t tot7 = h[7].Integral(p0, p1); 209 209 210 211 TPaveText *pave = new TPaveText(-0.99, 0.87, 0.99, 1.15); 212 pave->SetBorderSize(1); 213 210 214 TString title = Form("Total = %.1fh (excl=%.1fh)", tot1, tot1-tot2); 211 212 215 if (p0>0 && p1<9000 && p0==p1) 213 216 title.Prepend(Form("P%d: ", TMath::Nint(h[0].GetBinCenter(p0)))); 214 217 215 TPaveText *pave = new TPaveText(-0.99, 0.92, 0.99, 1.09);216 pave->SetBorderSize(1);217 218 pave->AddText(title)->SetTextAlign(22); 219 220 if (p0>0 && p1<9000) 221 { 222 MTime t0, t1; 223 t0.SetMagicPeriodStart(p0); 224 t1.SetMagicPeriodStart(p1+1); 225 226 pave->AddText(Form("%s 12h - %s 12h", t0.GetStringFmt("%Y/%m/%d").Data(), t1.GetStringFmt("%Y/%m/%d").Data())); 227 } 218 228 pave->SetBit(kCanDelete); 219 229 pave->Draw(); … … 286 296 } 287 297 288 voidDrawLegend(TH1F *h)298 TObject *DrawLegend(TH1F *h) 289 299 { 290 300 TLegend leg(0.01, 0.12, 0.99, 0.98, "Data Statistics"); … … 311 321 312 322 gROOT->SetSelectedPad(0); 313 leg.DrawClone()->SetBit(kCanDelete);; 323 TObject *obj = leg.DrawClone(); 324 obj->SetBit(kCanDelete);; 325 return obj; 314 326 } 315 327 … … 440 452 // -------------------------------------------- 441 453 442 TCanvas &c0 = d.AddTab("ObsDist" );454 TCanvas &c0 = d.AddTab("ObsDist", h8.GetTitle()); 443 455 c0.SetFillColor(kWhite); 444 456 … … 463 475 // -------------------------------------------- 464 476 465 TCanvas &c1 = d.AddTab("Hist" );477 TCanvas &c1 = d.AddTab("Hist", "Bar chart of the processing status of all data"); 466 478 c1.SetFillColor(kWhite); 467 479 c1.Divide(2,2); … … 536 548 // -------------------------------------------- 537 549 538 TCanvas &cx = d.AddTab("All" );550 TCanvas &cx = d.AddTab("All", "Pie charts for all periods"); 539 551 cx.SetBorderMode(0); 540 552 cx.SetFrameBorderMode(0); 541 553 cx.SetFillColor(kWhite); 542 cx.Divide( 9,5);554 cx.Divide(12,7); 543 555 cx.cd(1); 544 DrawLegend(h);545 546 for (int i= 0; i<h[0].GetNbinsX(); i++)556 TObject *leg=DrawLegend(h); 557 558 for (int i=h[0].GetNbinsX()-1; i>=40; i--) 547 559 { 548 560 const Int_t num = TMath::Nint(h[0].GetBinCenter(i+1)); 549 561 550 TCanvas &c = d.AddTab(Form("P%d", num) );562 TCanvas &c = d.AddTab(Form("P%d", num), Form("Pie char for period %d", num)); 551 563 c.SetBorderMode(0); 552 564 c.SetFrameBorderMode(0); … … 555 567 c.cd(); 556 568 557 TPad *pad1 = new TPad(Form("Pad%da", num), "", 0.05, 0, 0.55, 1); 569 TPad *pad0 = new TPad(Form("Pad%dl", num), "", 0.59, 0.5, 1, 1); 570 pad0->SetBorderMode(0); 571 pad0->SetFrameBorderMode(0); 572 pad0->SetFillColor(kWhite); 573 pad0->SetBit(kCanDelete); 574 pad0->Draw(); 575 pad0->cd(); 576 577 leg->Draw(); 578 579 c.cd(); 580 581 TPad *pad1 = new TPad(Form("Pad%da", num), "", 0.03, 0, 0.50, 1); 558 582 pad1->SetBorderMode(0); 559 583 pad1->SetFrameBorderMode(0); … … 565 589 DrawCake(h, i+1, i+1); 566 590 567 if (i<4*8) 568 { 569 cx.cd(i+2); 570 DrawCake(h, i+1, i+1); 571 } 591 cx.cd(i+2); 592 DrawCake(h, i+1, i+1); 572 593 573 594 c.cd(); 574 595 575 TPad *pad2 = new TPad(Form("Pad%db", num), "", 0. 6, 0.02, 1, 0.48);596 TPad *pad2 = new TPad(Form("Pad%db", num), "", 0.55, 0.02, 1, 0.48); 576 597 pad2->SetBorderMode(0); 577 598 pad2->SetFrameBorderMode(0); … … 719 740 720 741 d->SaveAsRoot(path+"plotstat.root"); 721 //d->SaveAsPS( "plotstat.ps");742 //d->SaveAsPS(path+"plotstat.ps"); 722 743 723 744 return 1;
Note:
See TracChangeset
for help on using the changeset viewer.