]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGGA/PHOSTasks/PHOS_PbPb/macros/QA/DrawQA.C
-updates
[u/mrichter/AliRoot.git] / PWGGA / PHOSTasks / PHOS_PbPb / macros / QA / DrawQA.C
CommitLineData
b5bff3e2 1TFile* file;
2const char* prefixToName = "imgs/";
3const char* appendToName = ".pdf";
4
5void Draw(const char* name, const char* options = "", double yFrom=0., double yTo=-1.)
6{
7 TH1* hist = ((TH1*)file->Get(name))->Clone();
8 //hist->SetAxisRange(0, 30 );
9 hist->GetXaxis()->SetLabelSize(0.011);
10 //hist->GetXaxis()->SetTitle("Run");
11 hist->GetXaxis()->SetRange(1,84);
12 if( yFrom < yTo )
13 hist->GetYaxis()->SetRangeUser(yFrom, yTo);
14
15
16 //if( ! TString(options).Contains("same") )
17 TCanvas* canv = new TCanvas;
18 canv->SetGrid();
19 hist->GetYaxis()->SetNdivisions(16);
20
21 canv->Divide(1,2);
22
23 hist->GetXaxis()->SetLabelSize(0.051);
24
25 canv->cd(1);
26 hist->GetXaxis()->SetRange(1,84);
27 hist->DrawCopy(options);
28
29 canv->cd(2);
30 hist->GetXaxis()->SetRange(85,200);
31 hist->DrawCopy(options);
32
33
34 canv->SaveAs(Form("%s%s%s", prefixToName, hist->GetName(), appendToName ));
35 delete hist;
36}
37
38void DrawPID()
39{
40 TH1* grNPhotAll = (TH1*)file->Get("grNPhotAll")->Clone();
41 TH1* grNPhotDisp = (TH1*)file->Get("grNPhotDisp")->Clone();
42 TH1* grNPhotDisp2 = (TH1*)file->Get("grNPhotDisp2")->Clone();
43 TH1* grNPhotCPV = (TH1*)file->Get("grNPhotCPV")->Clone();
44 TH1* grNPhotCPV2 = (TH1*)file->Get("grNPhotCPV2")->Clone();
45
46 grNPhotAll->GetXaxis()->SetLabelSize(0.045);
47 grNPhotAll->GetYaxis()->SetRangeUser(0, 40);
48
49 grNPhotAll ->SetMarkerColor(kBlack);
50 grNPhotDisp ->SetMarkerColor(kCyan+1);
51 grNPhotDisp2->SetMarkerColor(kBlue);
52 grNPhotCPV ->SetMarkerColor(kOrange+1);
53 grNPhotCPV2 ->SetMarkerColor(kRed);
54
55 bool scale = false;
56 double scaleCPV = grNPhotAll->Integral() / grNPhotCPV->Integral() *1.01;
57 double scaleCPV2 = grNPhotAll->Integral() / grNPhotCPV2->Integral() *1.02;
58 double scaleDisp = grNPhotAll->Integral() / grNPhotDisp->Integral() *0.99;
59 double scaleDisp2 = grNPhotAll->Integral() / grNPhotDisp2->Integral() *0.98;
60 if(scale) {
61 grNPhotCPV->Scale( scaleCPV );
62 grNPhotCPV2->Scale( scaleCPV2 );
63 grNPhotDisp->Scale( scaleDisp );
64 grNPhotDisp2->Scale( scaleDisp2 );
65 grNPhotAll->GetYaxis()->SetRangeUser(27, 37);
66 }
67
68 TCanvas* canv = new TCanvas;
69 canv->Divide(1,2);
70
71 canv->cd(1);
72 grNPhotAll->SetTitle("#LTN_{clusters}^{PID}#GT");
73 grNPhotAll->GetXaxis()->SetRange(0, 84);
74 grNPhotAll->DrawCopy();
75 grNPhotDisp->DrawCopy("same");
76 grNPhotDisp2->DrawCopy("same");
77 grNPhotCPV->DrawCopy("same");
78 grNPhotCPV2->DrawCopy("same");
79
80 canv->cd(2);
81 grNPhotAll->SetTitle("");
82 grNPhotAll->GetXaxis()->SetRange(85, 200);
83 grNPhotAll->DrawCopy();
84 grNPhotDisp->DrawCopy("same");
85 grNPhotDisp2->DrawCopy("same");
86 grNPhotCPV->DrawCopy("same");
87 grNPhotCPV2->DrawCopy("same");
88
89 canv->cd(1);
90 leg = new TLegend(0.9,0.7,0.99,0.99);
91 leg->SetFillColor(kWhite);
92 leg->SetBorderSize(1);
93 if( ! scale) {
94 leg->AddEntry("grNPhotAll","All","lP");
95 leg->AddEntry("grNPhotCPV","CPV","lP");
96 leg->AddEntry("grNPhotCPV2","CPV2","lP");
97 leg->AddEntry("grNPhotDisp","Disp","lP");
98 leg->AddEntry("grNPhotDisp2","Disp2","lP");
99 }
100 else {
101 leg->AddEntry("grNPhotAll",Form("All"),"lP");
102 leg->AddEntry("grNPhotCPV",Form("CPV * %f", scaleCPV),"lP");
103 leg->AddEntry("grNPhotCPV2",Form("CPV2 * %f", scaleCPV2),"lP");
104 leg->AddEntry("grNPhotDisp",Form("Disp * %f", scaleDisp),"lP");
105 leg->AddEntry("grNPhotDisp2",Form("Disp2 * %f", scaleDisp2),"lP");
106 }
107 leg->Draw();
108
109 canv->SaveAs(Form("%s%s%s", prefixToName, "nPhotPID", appendToName ));
110
111
112}
113
114void DrawCPVRatio()
115{
116 TH1* grNPhotAll = (TH1*)file->Get("grNPhotAll")->Clone();
117 TH1* grNPhotCPV = (TH1*)file->Get("grNPhotCPV")->Clone();
118 TH1* grNPhotCPV2 = (TH1*)file->Get("grNPhotCPV2")->Clone();
119
120 grNPhotCPV->Divide(grNPhotAll);
121 grNPhotCPV->SetTitle(Form("%s / %s", grNPhotCPV->GetTitle(), grNPhotAll->GetTitle()));
122 grNPhotCPV->GetYaxis()->SetRangeUser(0.7,0.85);
123
124 grNPhotCPV2->Divide(grNPhotAll);
125
126 TCanvas* canv = new TCanvas;
127 canv->Divide(1,2);
128 canv->cd(1);
129 grNPhotCPV->GetXaxis()->SetRange(0, 84);
130 grNPhotCPV->DrawCopy();
131
132 canv->cd(2);
133 grNPhotCPV->SetTitle("");
134 grNPhotCPV->GetXaxis()->SetRange(85, 200);
135 grNPhotCPV->DrawCopy();
136
137 canv->SaveAs(Form("%s%s%s", prefixToName, "CPVtoAllRatio", appendToName ));
138}
139
140const Int_t kNPID = 8+4;
141const char* kPIDNames[kNPID] = {"All", "Allwou", "Disp", "Disp2", "Dispwou", "CPV", "CPV2", "Both",
142 "Allcore", "Dispcore", "CPVcore", "Bothcore"};
143void DrawQA()
144{
145 gStyle->SetOptStat(0);
146
147 file = TFile::Open("runQA.root", "read");
148
149 Draw("grVtxZ10Cent", "", 0.7, 1.);
150 Draw("grNCellsM1", "E");
151 Draw("grNCellsM2");
152 Draw("grNCellsM3");
153 Draw("grECluster", "", 0.5, 0.7);
154 Draw("grNCluster", "", 0, 40);
155 Draw("grNTracks0", "", 0 , 12000);
156 Draw("grNPhotAll", "", 0, 40);
157 Draw("grNPhotAllcore", "", 0, 40);
158 Draw("grNPhotAllwou", "", 0, 40);
159 Draw("grNPhotDisp", "", 0, 40);
160 Draw("grNPhotDisp2", "", 0, 40);
161 Draw("grNPhotDispwou", "", 0, 40);
162 Draw("grNPhotCPV", "", 0, 40);
163 Draw("grNPhotCPV2", "", 0, 40);
164 Draw("grNPhotBoth", "", 0, 40);
165 Draw("grEnAll", "", 0.4, 0.7);
166 Draw("grEnAllcore", "", 0.4, 0.7);
167 Draw("grEnAllwou", "", 0.4, 0.7);
168 Draw("grEnDisp", "", 0.4, 0.7);
169 Draw("grEnDisp2", "", 0.4, 0.7);
170 Draw("grEnDispcore", "", 0.4, 0.7);
171 Draw("grEnDispwou", "", 0.4, 0.7);
172 Draw("grEnCPV", "", 0.4, 0.7);
173 Draw("grEnCPVcore", "", 0.4, 0.7);
174 Draw("grEnCPV2", "", 0.4, 0.7);
175 Draw("grEnBoth", "", 0.4, 0.7);
176 Draw("grEnBothcore", "", 0.4, 0.7);
177
178
179 DrawPID();
180 DrawCPVRatio();
181 file->Close();
182}