Fork me on GitHub

source: svn/trunk/routines/plot_performances.C@ 434

Last change on this file since 434 was 298, checked in by Xavier Rouby, 16 years ago

includes performances for v1.5b

File size: 6.6 KB
Line 
1/***********************************************************************
2** **
3** /----------------------------------------------\ **
4** | Delphes, a framework for the fast simulation | **
5** | of a generic collider experiment | **
6** \----------------------------------------------/ **
7** **
8** **
9** This package uses: **
10** ------------------ **
11** FastJet algorithm: Phys. Lett. B641 (2006) [hep-ph/0512210] **
12** Hector: JINST 2:P09005 (2007) [physics.acc-ph:0707.1198v2] **
13** FROG: [hep-ex/0901.2718v1] **
14** **
15** ------------------------------------------------------------------ **
16** **
17** Main authors: **
18** ------------- **
19** **
20** Severine Ovyn Xavier Rouby **
21** severine.ovyn@uclouvain.be xavier.rouby@cern **
22** **
23** Center for Particle Physics and Phenomenology (CP3) **
24** Universite catholique de Louvain (UCL) **
25** Louvain-la-Neuve, Belgium **
26** **
27** Copyright (C) 2008-2009, **
28** All rights reserved. **
29** **
30***********************************************************************/
31
32
33#include "interface/FuncDef.h"
34#include "TGraph.h"
35#include "TMultiGraph.h"
36#include "TF1.h"
37#include "TText.h"
38#include "TLegend.h"
39#include "TPie.h"
40
41void plot_performances() {
42 setTDRStyle();
43 gROOT->Reset();
44 TMultiGraph * mg = new TMultiGraph();
45
46 const int N = 6;
47 float * n = new float[N];
48 n[0] = 5; n[1] = 10; n[2] = 20;
49 n[3] = 30; n[4] = 40; n[5] = 50;
50
51 float * t = new float[N];
52 // v1.2b
53 //t[0]= 60.44; t[1] = 124.74; t[2] = 239.38; t[3]=376.08; t[4] = 499.34; t[5] = 603.238;
54
55 // v1.5b
56 t[0]= 70.34; t[1] = 112.77; t[2] = 223.44; t[3]=332.39; t[4] = 451.85; t[5] = 555.68;
57 TGraph * time = new TGraph(N,n,t);
58 time->SetMarkerStyle(20);
59 mg->Add(time,"P");
60
61 float * t1 = new float[N];
62 // v1.2b
63 //t1[0]= 45.01; t1[1] = 93.25; t1[2] = 177.34; t1[3]=280.6; t1[4] = 369.97; t1[5] = 444.52;
64
65 // v1.5b
66 t1[0]= 38.43; t1[1] = 80.69; t1[2] = 157.83; t1[3]=227.67; t1[4] = 317.2; t1[5] = 395.74;
67 TGraph * time1 = new TGraph(N,n,t1);
68 time1->SetMarkerStyle(24);
69 mg->Add(time1,"P");
70
71
72 float * s = new float[N];
73 // v1.2b
74 //s[0]=119./1.5; s[1]=236./1.5; s[2]=496./1.5; s[3]=702./1.5; s[4]=936./1.5; s[5]=1198./1.5;
75
76 // v1.5b
77 s[0]=200/1.5; s[1]=233./1.5; s[2]=464./1.5; s[3]=694./1.5; s[4]=925./1.5; s[5]=1184./1.5;
78 TGraph * size = new TGraph(N,n,s);
79 size->SetMarkerStyle(21);
80 size->SetMarkerColor(kRed);
81// mg->Add(size,"P");
82
83 mg->Draw("A");
84 mg->GetXaxis()->SetTitle("N (kevts)");
85 mg->GetYaxis()->SetTitle("CPU time(s)");
86 mg->GetYaxis()->SetTitleOffset(1.21);
87
88 TF1 * fit = new TF1("fit","[0]+[1]*x",5,50);
89 fit->SetLineColor(kBlack);
90 fit->SetLineStyle(2);
91 fit->SetLineWidth(1);
92 time->Fit("fit","");
93
94
95 TGaxis *sizeaxis = new TGaxis(gPad->GetUxmax(),gPad->GetUymin(), gPad->GetUxmax(), gPad->GetUymax(),mg->GetYaxis()->GetXmin()*1.5,mg->GetYaxis()->GetXmax()*1.5);
96 sizeaxis->SetLineColor(kRed);
97 sizeaxis->SetLabelColor(kRed);
98// sizeaxis->Draw();
99
100 TPaveText *pave = new TPaveText(5,472,35,600,"r");
101 pave->AddText("Delphes performances");
102 char text[500];
103 sprintf(text,"1 kevts in %.2f s",fit->GetParameter(1));
104 pave->AddText(text);
105 pave->AddText("pp #rightarrow t #bar{t} X");
106 pave->Draw();
107 pave->SetBorderSize(0);
108 pave->SetFillStyle(0);
109 pave->SetTextAlign(12);
110 pave->SetTextFont(42);
111
112 //TLegend * leg = new TLegend(30,80,50,200);
113 TLegend * leg = new TLegend(0.6,0.2,0.9,0.4);
114 leg->AddEntry(time,"General","p");
115 leg->AddEntry(time1,"Event loop only","p");
116 leg->SetBorderSize(0);
117 leg->SetFillStyle(0);
118 leg->SetTextFont(42);
119 leg->Draw();
120
121 float vals[]= {0.74, 0.26};
122 int nvals = sizeof(vals)/sizeof(vals[0]);
123 char * labels[] = {"Event loop","Convertor"};
124 TPie * pie = new TPie("pie","",nvals,vals);
125 //pie->Draw();
126
127}
128
129
130void plot_filesize() {
131 setTDRStyle();
132 gROOT->Reset();
133 TMultiGraph * mg = new TMultiGraph();
134
135 const int N = 6;
136 float * n = new float[N];
137 n[0] = 5; n[1] = 10; n[2] = 20;
138 n[3] = 30; n[4] = 40; n[5] = 50;
139
140 float * s = new float[N];
141 s[0]=119.; s[1]=236.; s[2]=496.;
142 s[3]=702.; s[4]=936.; s[5]=1198.;
143 TGraph * size = new TGraph(N,n,s);
144 size->SetMarkerStyle(21);
145 mg->Add(size,"P");
146
147 mg->Draw("A");
148 mg->GetXaxis()->SetTitle("N (kevts)");
149 mg->GetYaxis()->SetTitle("File size(MB)");
150 mg->GetYaxis()->SetTitleOffset(1.31);
151
152 TF1 * fit = new TF1("fit","[0]+[1]*x",5,50);
153 fit->SetLineColor(kBlack);
154 fit->SetLineStyle(2);
155 fit->SetLineWidth(1);
156 size->Fit("fit","F");
157
158 TPaveText *pave = new TPaveText(5,944,35,1200,"r");
159 pave->AddText("Delphes performances");
160 char text[500];
161 sprintf(text,"1 kevts in %.2f MB",fit->GetParameter(1));
162 pave->AddText(text);
163 pave->AddText("pp #rightarrow t #bar{t} X");
164 pave->Draw();
165 pave->SetBorderSize(0);
166 pave->SetFillStyle(0);
167 pave->SetTextAlign(12);
168 pave->SetTextFont(42);
169
170}
171
172void plot_timerepartition(float r=30.) {
173// float s[]= {119, 236, 496, 702, 936, 1198};
174 float vals[]= {0.74, 0.26};
175 int nvals = sizeof(vals)/sizeof(vals[0]);
176 char * labels[] = {"Event loop","Convertor"};
177 TPie * pie = new TPie("pie","",nvals,vals);
178 pie->Draw();
179
180 TPaveText *pave = new TPaveText(0.1,0.7,0.5,0.97,"br");
181 pave->AddText("Time repartition");
182 pave->Draw();
183 pave->SetBorderSize(0);
184 pave->SetFillStyle(0);
185 pave->SetTextAlign(12);
186 pave->SetTextFont(42);
187
188 pie->SetAngularOffset(r);
189 pie->SetEntryRadiusOffset( 1, 0.01);
190 pie->SetRadius(.15);
191 pie->SetHeight(0.04);
192 pie->SetLabels(labels);
193 pie->SetLabelsOffset(0);
194 pie->SetTextSize(0.06);
195 pie->Draw("3d");
196}
Note: See TracBrowser for help on using the repository browser.