]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
quick acces to QA histograms
authorsnelling <snelling@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 9 Nov 2010 00:00:27 +0000 (00:00 +0000)
committersnelling <snelling@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 9 Nov 2010 00:00:27 +0000 (00:00 +0000)
PWG2/FLOW/macros/plotQAflow.C [new file with mode: 0644]

diff --git a/PWG2/FLOW/macros/plotQAflow.C b/PWG2/FLOW/macros/plotQAflow.C
new file mode 100644 (file)
index 0000000..42a20c0
--- /dev/null
@@ -0,0 +1,21 @@
+
+void plotQAflow(const char* filename="")
+{
+ TFile f(filename,"read");
+ TObjArray* flowQA = dynamic_cast<TObjArray*>(f.Get("flowQA"));
+ TObjArray* before = dynamic_cast<TObjArray*>(flowQA->At(0));
+ TObjArray* after = dynamic_cast<TObjArray*>(flowQA->At(1));
+ for (Int_t i=0; i<before->GetEntries(); i++)
+ {
+   TH1* hbefore = dynamic_cast<TH1*>(before->At(i));
+   TH1* hafter = dynamic_cast<TH1*>(after->At(i));
+   TCanvas* canvas = new TCanvas(hbefore->GetName(), hbefore->GetTitle());
+   TLegend* legend = new TLegend(0.8,0.8,1.0,1.0);
+   hbefore->Draw();
+   legend->AddEntry(hbefore,"before cuts","l");
+   hafter->SetLineColor(2);
+   legend->AddEntry(hafter,"after cuts","l");
+   hafter->Draw("same");
+   legend->Draw();
+ }
+}