Fork me on GitHub

source: git/examples/ProcessingTime.C@ 501f858

ImprovedOutputFile Timing dual_readout llp
Last change on this file since 501f858 was 501f858, checked in by pavel <pavel@…>, 11 years ago

add comment to processing time plot

  • Property mode set to 100644
File size: 3.0 KB
Line 
1/*
2root -l examples/ProcessingTime.C\(\"delphes_output.root\"\)
3*/
4
5static const Font_t kExRootFont = 42;
6static const Float_t kExRootFontSize = 0.04;
7static const Color_t kExRootBackgroundColor = 10;
8
9//------------------------------------------------------------------------------
10
11TGraphErrors gr;
12TPaveText comment(0.20, 0.72, 0.50, 0.81, "brNDC");
13
14TCanvas *canvas;
15
16//------------------------------------------------------------------------------
17
18void ProcessingTime(const char *inputFile)
19{
20 TChain *chain = new TChain("Delphes");
21 chain->Add(inputFile);
22
23 TH1F hist("time", "time", 50, 0, 0.01);
24 Int_t i;
25
26 TDirectory *currentDirectory = gDirectory;
27
28 // Graphics style parameters to avoid grey background on figures
29 gStyle->SetCanvasColor(kExRootBackgroundColor);
30 gStyle->SetStatColor(kExRootBackgroundColor);
31 // gStyle->SetTitleColor(kExRootBackgroundColor);
32 gStyle->SetPadColor(kExRootBackgroundColor);
33
34 gStyle->SetPadTopMargin(0.10);
35 gStyle->SetPadRightMargin(0.10);
36 gStyle->SetPadBottomMargin(0.15);
37 gStyle->SetPadLeftMargin(0.15);
38
39 gStyle->SetStatFont(kExRootFont);
40 gStyle->SetStatFontSize(kExRootFontSize);
41
42 gStyle->SetTitleFont(kExRootFont, "");
43 gStyle->SetTitleFont(kExRootFont, "X");
44 gStyle->SetTitleFont(kExRootFont, "Y");
45 gStyle->SetTitleFont(kExRootFont, "Z");
46 gStyle->SetTitleSize(kExRootFontSize, "");
47 gStyle->SetTitleSize(kExRootFontSize, "X");
48 gStyle->SetTitleSize(kExRootFontSize, "Y");
49 gStyle->SetTitleSize(kExRootFontSize, "Z");
50
51 gStyle->SetLabelFont(kExRootFont, "X");
52 gStyle->SetLabelFont(kExRootFont, "Y");
53 gStyle->SetLabelFont(kExRootFont, "Z");
54 gStyle->SetLabelSize(kExRootFontSize, "X");
55 gStyle->SetLabelSize(kExRootFontSize, "Y");
56 gStyle->SetLabelSize(kExRootFontSize, "Z");
57
58 gStyle->SetPadTickX(1);
59 gStyle->SetPadTickY(1);
60
61 gStyle->SetTextFont(kExRootFont);
62 gStyle->SetTextSize(kExRootFontSize);
63
64 gStyle->SetOptStat(111110);
65 // gStyle->SetOptFit(101);
66
67 canvas = static_cast<TCanvas*>(gROOT->FindObject("c1"));
68 if(canvas)
69 {
70 canvas->Clear();
71 canvas->UseCurrentStyle();
72 canvas->SetWindowSize(800, 650);
73 }
74 else
75 {
76 canvas = new TCanvas("c1", "c1", 800, 650);
77 }
78 canvas->SetGrid();
79 canvas->SetHighLightColor(kExRootBackgroundColor);
80
81 currentDirectory->cd();
82
83 for(i = 1; i < 9; ++i)
84 {
85 chain->Draw("Event.ProcTime >> time", TString::Format("Jet_size == %d", i+1));
86 gr.SetPoint(i, i+1, hist.GetMean()*1000);
87 gr.SetPointError(i, 0, hist.GetRMS()*1000);
88 }
89
90 gr.GetXaxis()->SetLimits(1.0, 10.0);
91 gr.GetXaxis()->SetTitleOffset(1.5);
92 gr.GetYaxis()->SetTitleOffset(1.75);
93 gr.GetXaxis()->SetTitle("jet multiplicity");
94 gr.GetYaxis()->SetTitle("processing time per event, ms");
95 gr.SetMarkerStyle(kFullCircle);
96 gr.SetMarkerSize(1);
97 gr.SetLineWidth(2);
98 gr.Draw("AP");
99
100 comment.SetTextSize(kExRootFontSize);
101 comment.SetTextFont(kExRootFont);
102 comment.SetTextAlign(22);
103 comment.SetFillColor(kExRootBackgroundColor);
104 comment.SetBorderSize(0);
105 comment.AddText("ttbar + jets events");
106 comment.Draw();
107}
108
Note: See TracBrowser for help on using the repository browser.