Changeset 195 in svn for trunk/routines
- Timestamp:
- Jan 26, 2009, 9:33:27 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/routines/plot_performances.C
r194 r195 5 5 #include "TText.h" 6 6 #include "TLegend.h" 7 #include "TPie.h" 7 8 8 9 void plot_performances() { … … 50 51 time->Fit("fit",""); 51 52 53 52 54 TGaxis *sizeaxis = new TGaxis(gPad->GetUxmax(),gPad->GetUymin(), gPad->GetUxmax(), gPad->GetUymax(),mg->GetYaxis()->GetXmin()*1.5,mg->GetYaxis()->GetXmax()*1.5); 53 55 sizeaxis->SetLineColor(kRed); … … 58 60 pave->AddText("Delphes performances"); 59 61 char text[500]; 60 sprintf(text,"1 0kevts in %.2f s",fit->GetParameter(1));62 sprintf(text,"1 kevts in %.2f s",fit->GetParameter(1)); 61 63 pave->AddText(text); 62 64 pave->AddText("pp #rightarrow t #bar{t} X"); … … 76 78 leg->Draw(); 77 79 } 80 81 82 void plot_filesize() { 83 setTDRStyle(); 84 gROOT->Reset(); 85 TMultiGraph * mg = new TMultiGraph(); 86 87 const int N = 6; 88 float * n = new float[N]; 89 n[0] = 5; n[1] = 10; n[2] = 20; 90 n[3] = 30; n[4] = 40; n[5] = 50; 91 92 float * s = new float[N]; 93 s[0]=119.; s[1]=236.; s[2]=496.; 94 s[3]=702.; s[4]=936.; s[5]=1198.; 95 TGraph * size = new TGraph(N,n,s); 96 size->SetMarkerStyle(21); 97 mg->Add(size,"P"); 98 99 mg->Draw("A"); 100 mg->GetXaxis()->SetTitle("N (kevts)"); 101 mg->GetYaxis()->SetTitle("File size(MB)"); 102 mg->GetYaxis()->SetTitleOffset(1.31); 103 104 TF1 * fit = new TF1("fit","[0]+[1]*x",5,50); 105 fit->SetLineColor(kBlack); 106 fit->SetLineStyle(2); 107 fit->SetLineWidth(1); 108 size->Fit("fit","F"); 109 110 TPaveText *pave = new TPaveText(5,944,35,1200,"r"); 111 pave->AddText("Delphes performances"); 112 char text[500]; 113 sprintf(text,"1 kevts in %.2f MB",fit->GetParameter(1)); 114 pave->AddText(text); 115 pave->AddText("pp #rightarrow t #bar{t} X"); 116 pave->Draw(); 117 pave->SetBorderSize(0); 118 pave->SetFillStyle(0); 119 pave->SetTextAlign(12); 120 pave->SetTextFont(42); 121 122 } 123 124 void plot_timerepartition(float r=30.) { 125 // float s[]= {119, 236, 496, 702, 936, 1198}; 126 float vals[]= {0.74, 0.26}; 127 int nvals = sizeof(vals)/sizeof(vals[0]); 128 char * labels[] = {"Event loop","Convertor"}; 129 TPie * pie = new TPie("pie","",nvals,vals); 130 pie->Draw(); 131 132 TPaveText *pave = new TPaveText(0.1,0.7,0.5,0.97,"br"); 133 pave->AddText("Time repartition"); 134 pave->Draw(); 135 pave->SetBorderSize(0); 136 pave->SetFillStyle(0); 137 pave->SetTextAlign(12); 138 pave->SetTextFont(42); 139 140 pie->SetAngularOffset(r); 141 pie->SetEntryRadiusOffset( 1, 0.01); 142 pie->SetRadius(.15); 143 pie->SetHeight(0.04); 144 pie->SetLabels(labels); 145 pie->SetLabelsOffset(0); 146 pie->SetTextSize(0.06); 147 pie->Draw("3d"); 148 }
Note:
See TracChangeset
for help on using the changeset viewer.