hooks for PMD flow analysis
[u/mrichter/AliRoot.git] / PWG2 / FLOW / macros / plotQAflow.C
CommitLineData
d6a65834 1
2void plotQAflow(const char* filename="")
3{
4 TFile f(filename,"read");
c7d25e97 5 TKey* key = f.GetListOfKeys()->At(0);
6 if (!key) return;
7 TObjArray* flowQA = dynamic_cast<TObjArray*>(f.Get(key->GetName()));
8 if (!flowQA) return;
d6a65834 9 TObjArray* before = dynamic_cast<TObjArray*>(flowQA->At(0));
10 TObjArray* after = dynamic_cast<TObjArray*>(flowQA->At(1));
11 for (Int_t i=0; i<before->GetEntries(); i++)
12 {
13 TH1* hbefore = dynamic_cast<TH1*>(before->At(i));
14 TH1* hafter = dynamic_cast<TH1*>(after->At(i));
15 TCanvas* canvas = new TCanvas(hbefore->GetName(), hbefore->GetTitle());
1c4a5bf7 16 canvas->SetLogy();
d6a65834 17 TLegend* legend = new TLegend(0.8,0.8,1.0,1.0);
c7d25e97 18 hbefore->SetAxisRange(0.1,hbefore->GetBinContent(hbefore->GetMaximumBin()),"Y");
d6a65834 19 hbefore->Draw();
20 legend->AddEntry(hbefore,"before cuts","l");
21 hafter->SetLineColor(2);
22 legend->AddEntry(hafter,"after cuts","l");
23 hafter->Draw("same");
24 legend->Draw();
25 }
26}