[711] | 1 | /*
|
---|
[975] | 2 | root -l examples/ProcessingTime.C\(\"delphes_output.root\"\)
|
---|
[711] | 3 | */
|
---|
| 4 |
|
---|
[1197] | 5 | static const Font_t kExRootFont = 42;
|
---|
| 6 | static const Float_t kExRootFontSize = 0.04;
|
---|
| 7 | static const Color_t kExRootBackgroundColor = 10;
|
---|
| 8 |
|
---|
[711] | 9 | //------------------------------------------------------------------------------
|
---|
| 10 |
|
---|
[712] | 11 | TGraphErrors gr;
|
---|
[1206] | 12 | TPaveText comment(0.20, 0.72, 0.50, 0.81, "brNDC");
|
---|
[712] | 13 |
|
---|
[1197] | 14 | TCanvas *canvas;
|
---|
| 15 |
|
---|
[712] | 16 | //------------------------------------------------------------------------------
|
---|
| 17 |
|
---|
[711] | 18 | void ProcessingTime(const char *inputFile)
|
---|
[707] | 19 | {
|
---|
[711] | 20 | TChain *chain = new TChain("Delphes");
|
---|
| 21 | chain->Add(inputFile);
|
---|
| 22 |
|
---|
[707] | 23 | TH1F hist("time", "time", 50, 0, 0.01);
|
---|
| 24 | Int_t i;
|
---|
| 25 |
|
---|
[1197] | 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 |
|
---|
[1206] | 83 | for(i = 1; i < 9; ++i)
|
---|
[707] | 84 | {
|
---|
[843] | 85 | chain->Draw("Event.ProcTime >> time", TString::Format("Jet_size == %d", i+1));
|
---|
[707] | 86 | gr.SetPoint(i, i+1, hist.GetMean()*1000);
|
---|
| 87 | gr.SetPointError(i, 0, hist.GetRMS()*1000);
|
---|
| 88 | }
|
---|
| 89 |
|
---|
[1206] | 90 | gr.GetXaxis()->SetLimits(1.0, 10.0);
|
---|
[1197] | 91 | gr.GetXaxis()->SetTitleOffset(1.5);
|
---|
| 92 | gr.GetYaxis()->SetTitleOffset(1.75);
|
---|
[1206] | 93 | gr.GetXaxis()->SetTitle("jet multiplicity");
|
---|
[707] | 94 | gr.GetYaxis()->SetTitle("processing time per event, ms");
|
---|
[1206] | 95 | gr.SetMarkerStyle(kFullCircle);
|
---|
| 96 | gr.SetMarkerSize(1);
|
---|
| 97 | gr.SetLineWidth(2);
|
---|
[707] | 98 | gr.Draw("AP");
|
---|
[1206] | 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();
|
---|
[707] | 107 | }
|
---|
| 108 |
|
---|