AliPhysics  ec7afe5 (ec7afe5)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ShowTiming.C
Go to the documentation of this file.
1 void showParts(TProfile* p, const char* title)
2 {
3  if (!p) return;
4  Printf(title);
5 
6  Int_t n = p->GetNbinsX();
7  Double_t sum = 0;
8  for (Int_t i = 1; i < n; i++) sum += p->GetBinContent(i);
9 
10  Double_t total = p->GetBinContent(n);
11  Printf("sum %f total %f diff %f", sum, total, total-sum);
12 
13  for (Int_t i = 1; i < n; i++) {
14  Double_t cc = p->GetBinContent(i);
15  Printf(" // %-24s: fraction of sum %4.1f%% of total %4.1f%%",
16  p->GetXaxis()->GetBinLabel(i), 100*cc/sum, 100*cc/total);
17  }
18 }
19 
20 void ShowTiming(const char* filename)
21 {
22  TFile *_file0 = TFile::Open(filename);
23  new TBrowser;
24  TList* forward;
25  gDirectory->GetObject("Forward",forward);
26  TList* forwardResults;
27  gDirectory->GetObject("ForwardResults",forwardResults);
28  TProfile* t = (TProfile*)forward->FindObject("timing");
29  TList* dc = (TList*)forward->FindObject("fmdDensityCalculator");
30  TProfile* dct = (TProfile*)dc->FindObject("timing");
31  TProfile* tr = (TProfile*)forwardResults->FindObject("timing");
32 
33  showParts(t, "Full task");
34  showParts(dct, "Density calculator");
35 
36  if (t) {
37  TCanvas* c1 = new TCanvas("c1", "c1");
38  t->Draw("s text30");
39  }
40 
41  if (dct) {
42  TCanvas* c2 = new TCanvas("c2", "c2");
43  dct->Draw("s text30");
44  }
45 
46  if (tr) {
47  TCanvas* c3 = new TCanvas("c3", "c3");
48  tr->Draw("s text30");
49  }
50 
51 }
const char * filename
Definition: TestFCM.C:1
const Color_t cc[]
Definition: DrawKs.C:1
double Double_t
Definition: External.C:58
const char * title
Definition: MakeQAPdf.C:26
void showParts(TProfile *p, const char *title)
Definition: ShowTiming.C:1
int Int_t
Definition: External.C:63
void ShowTiming(const char *filename)
Definition: ShowTiming.C:20