1 #include "TCanvas.h" // needed for some reason.
4 const char* prefixToName = "imgs/";
7 void Draw(const char* name, const char* options = "", double yFrom=0., double yTo=-1.)
9 TH1* hist = ((TH1*)file->Get(name))->Clone();
10 //hist->SetAxisRange(0, 30 );
11 hist->GetXaxis()->SetLabelSize(0.011);
12 //hist->GetXaxis()->SetTitle("Run");
13 //hist->GetXaxis()->SetRange(1, );
15 if(yFrom > hist->GetMinimum())
16 Printf("in hist %s, yFrom (%f), is larger then hist min (%f)", name, yFrom, hist->GetMinimum());
17 if(yTo < hist->GetMaximum())
18 Printf("in hist %s, yTo (%f), is smaller then hist max (%f)", name, yTo, hist->GetMaximum());
20 hist->GetYaxis()->SetRangeUser(yFrom, yTo);
23 //if( ! TString(options).Contains("same") )
24 TCanvas* canv = new TCanvas;
26 //hist->GetYaxis()->SetNdivisions(16);
30 hist->GetXaxis()->SetLabelSize(0.051);
32 if( TString(options).Contains("LINFIT") )
33 hist->Fit("pol0", "Q");
36 if( TString(name).Contains("grChi2RP") )
38 hist->GetXaxis()->SetRange(1, hist->GetNbinsX()/2);
39 hist->DrawCopy(options);
42 if( TString(name).Contains("grChi2RP") )
44 hist->GetXaxis()->SetRange(hist->GetNbinsX()/2+1,200);
45 hist->DrawCopy(options);
48 canv->SaveAs(Form("%s%s.pdf", prefixToName, hist->GetName()));
49 canv->SaveAs(Form("%s%s.png", prefixToName, hist->GetName()));
55 for(int cent=0; cent<kNCents; ++cent) {
56 TString key = Form("nPhotPID_cen%i", cent);
58 TH1* grNPhotAllcore = (TH1*)file->Get(Form("grNPhotAllcore_cen%d", cent))->Clone();
59 TH1* grNPhotCPVcore = (TH1*)file->Get(Form("grNPhotCPVcore_cen%d", cent))->Clone();
60 TH1* grNPhotDisp2core = (TH1*)file->Get(Form("grNPhotDisp2core_cen%d", cent))->Clone();
61 TH1* grNPhotBoth2core = (TH1*)file->Get(Form("grNPhotBoth2core_cen%d", cent))->Clone();
63 grNPhotAllcore->GetXaxis()->SetLabelSize(0.045);
64 grNPhotAllcore->GetYaxis()->SetRangeUser(0, grNPhotAllcore->GetMaximum()*1.2);
66 grNPhotAllcore ->SetMarkerColor(kBlack);
67 grNPhotCPVcore ->SetMarkerColor(kCyan+1);
68 grNPhotDisp2core->SetMarkerColor(kBlue);
69 grNPhotBoth2core ->SetMarkerColor(kOrange+1);
71 TCanvas* canv = new TCanvas(key.Data(), key.Data(), 1024, 768);
75 grNPhotAllcore->SetTitle("#LTN_{clusters}^{PID}#GT");
77 grNPhotAllcore->GetXaxis()->SetRange(0, 85);
78 grNPhotAllcore->DrawCopy();
79 grNPhotCPVcore->DrawCopy("same");
80 grNPhotDisp2core->DrawCopy("same");
81 grNPhotBoth2core->DrawCopy("same");
85 grNPhotAllcore->SetTitle("");
86 grNPhotAllcore->GetXaxis()->SetRange(85, 200);
87 grNPhotAllcore->DrawCopy();
88 grNPhotCPVcore->DrawCopy("same");
89 grNPhotDisp2core->DrawCopy("same");
90 grNPhotBoth2core->DrawCopy("same");
93 leg = new TLegend(0.9,0.7,0.99,0.99);
94 leg->SetFillColor(kWhite);
95 leg->SetBorderSize(1);
96 leg->AddEntry(Form("grNPhotAllcore_cen%d",cent),"All","lP");
97 leg->AddEntry(Form("grNPhotCPVcore_cen%d",cent),"CPVcore","lP");
98 leg->AddEntry(Form("grNPhotDisp2core_cen%d",cent),"Disp2core","lP");
99 leg->AddEntry(Form("grNPhotBoth2core_cen%d",cent),"Both2core","lP");
103 canv->SaveAs(Form("%s%s_squeezed.pdf", prefixToName, key.Data()));
104 canv->SaveAs(Form("%s%s_squeezed.png", prefixToName, key.Data()));
110 for(int cent=0; cent<kNCents; ++cent) {
111 TH1* grNPhotAll = (TH1*)file->Get(Form("grNPhotAll_cen0", cent))->Clone();
112 TH1* grNPhotCPV = (TH1*)file->Get(Form("grNPhotCPV_cen0", cent))->Clone();
113 TH1* grNPhotCPV2 = (TH1*)file->Get(Form("grNPhotCPV2_cen0", cent))->Clone();
115 grNPhotCPV->Divide(grNPhotAll);
116 grNPhotCPV->SetTitle(Form("%s / %s", grNPhotCPV->GetTitle(), grNPhotAll->GetTitle()));
117 grNPhotCPV->GetYaxis()->SetRangeUser(0.7,0.85);
119 grNPhotCPV2->Divide(grNPhotAll);
121 TCanvas* canv = new TCanvas;
124 grNPhotCPV->GetXaxis()->SetRange(0, 85);
125 grNPhotCPV->DrawCopy();
128 grNPhotCPV->SetTitle("");
129 grNPhotCPV->GetXaxis()->SetRange(85, 200);
130 grNPhotCPV->DrawCopy();
132 canv->SaveAs(Form("%sCPVtoAllRatio_cen%d.pdf", prefixToName, cent));
133 canv->SaveAs(Form("%sCPVtoAllRatio_cen%d.png", prefixToName, cent));
137 void DrawNPhotAllAndHigh()
139 for(int cent=0; cent<kNCents; ++cent) {
140 TH1* grNPhotAll = (TH1*)file->Get(Form("grNPhotAll_cen%d", cent))->Clone();
141 TH1* grNPhotAllHigh = (TH1*)file->Get(Form("grNPhotAllHigh_cen%d", cent))->Clone();
142 TH1* grNPhotAllcoreHigh = (TH1*)file->Get(Form("grNPhotAllcoreHigh_cen%d", cent))->Clone();
144 double sizeAll = grNPhotAll->Integral();
145 double sizeAllHigh = grNPhotAllHigh->Integral();
146 int scale = TMath::Nint(sizeAll / sizeAllHigh);
147 grNPhotAllHigh->Scale(scale);
148 grNPhotAllcoreHigh->Scale(scale);
150 grNPhotAllHigh->SetMarkerColor(kRed);
151 grNPhotAllHigh->SetLineColor(kRed);
152 grNPhotAllcoreHigh->SetMarkerColor(kGreen+1);
153 grNPhotAllcoreHigh->SetLineColor(kGreen+1);
155 TCanvas* canv = new TCanvas;
159 grNPhotAll->SetTitle("#LTN_{clusters}#GT");
160 grNPhotAll->GetXaxis()->SetRange(0, 85);
161 grNPhotAll->GetYaxis()->SetRange(15, 40);
162 //grNPhotAll->GetYaxis()->SetRangeUser(15, 45);
163 grNPhotAll->DrawCopy();
164 grNPhotAllHigh->DrawCopy("same");
165 grNPhotAllcoreHigh->DrawCopy("same");
168 grNPhotAll->GetXaxis()->SetRange(85, 200);
169 grNPhotAll->DrawCopy();
170 grNPhotAllHigh->DrawCopy("same");
171 grNPhotAllcoreHigh->DrawCopy("same");
174 leg = new TLegend(0.8, 0.15, 0.99, 0.4);
175 leg->SetFillColor(kWhite);
176 leg->SetBorderSize(1);
177 leg->AddEntry(grNPhotAll, Form("All"),"lP");
178 leg->AddEntry(grNPhotAllHigh, Form("AllHigh * %d", scale),"lP");
179 leg->AddEntry(grNPhotAllcoreHigh, Form("AllcoreHigh * %d", scale),"lP");
182 canv->SaveAs( Form("%s%s.pdf", prefixToName, Form("nPhotAllAndHigh_cen%d", cent)));
183 canv->SaveAs( Form("%s%s.png", prefixToName, Form("nPhotAllAndHigh_cen%d", cent)));
187 void DrawPIDRatiosHighCore(const char* pidNames[], int nPids, const char* high)
190 const Int_t colors[8] = {kBlack, kRed-1, kRed+1, kBlue, kCyan, kGreen+3, kYellow+1, kMagenta};
191 int currentColorID = 99999;
194 for(int cent=0; cent<kNCents; ++cent) {
195 TH1* hAll = (TH1*)file->Get( Form("grNPhot%s%s_cen%d", pidNames[0], high, cent) )->Clone();
197 leg = new TLegend(0.91,0.6,0.99,0.99);
198 leg->SetFillColor(kWhite);
199 leg->SetBorderSize(1);
201 TCanvas* canv = new TCanvas;
204 for(int ipid = 1; ipid < nPids; ++ipid) {
205 TString name(Form("grNPhot%s%s_cen%d", pidNames[ipid], high, cent));
206 TH1* hPID = (TH1*)file->Get( name.Data() )->Clone();
209 if( ++currentColorID < kNColors )
210 color = colors[currentColorID] ;
212 color = colors[ currentColorID = 0 ];
214 hPID->SetMarkerColor(color);
215 hPID->SetLineColor(color);
216 hPID->GetYaxis()->SetRangeUser(0, 1.);
218 leg->AddEntry( hPID , pidNames[ipid], "lP");
221 hPID->SetTitle( Form("#LTN_{clusters}^{PID}#GT / #LTN_{clusters}^{%s}#GT, cent=%d, %s", pidNames[0], cent, high) );
222 hPID->GetXaxis()->SetRange(0, 85);
223 hPID->DrawCopy(same);
227 hPID->GetXaxis()->SetRange(85, 200);
228 hPID->DrawCopy(same);
234 TString fn(Form("CPVtoAllRatio%s_cen%d", high, cent));
236 canv->SaveAs(Form("%s%s.pdf", prefixToName, fn.Data()));
237 canv->SaveAs(Form("%s%s.png", prefixToName, fn.Data()));
245 const char* kPIDNames[nn] = {"All", "Allwou", "CPV", "CPV2", "Disp", "Disp2", "Dispwou", "Both"};
246 const char* kPIDNamesCore[nc] = {"Allcore", "CPVcore", "Dispcore", "Bothcore"};
247 const char* fillHigh[2] = {"", "High"};
248 for(int ihigh = 0; ihigh < 2; ++ihigh) {
249 DrawPIDRatiosHighCore(kPIDNames, nn, fillHigh[ihigh]);
250 DrawPIDRatiosHighCore(kPIDNamesCore, nc, fillHigh[ihigh]);
256 gStyle->SetOptStat(0);
257 gStyle->SetOptFit(1);
259 file = TFile::Open("outputQA.root", "read");
261 Draw("grVtxZ10Cent", "", 0.7, 1.);
262 Draw("grNCellsM1", "E");
265 Draw("grECluster", "", 0.5, 0.7);
266 Draw("grNCluster", "", 0, 40);
267 Draw("grNTracks0", "", 0 , 12000);
268 Draw("grNPhotAll_cen0", "", 0, 40);
269 Draw("grNPhotAllcore_cen0", "", 0, 40);
270 Draw("grNPhotAllwou_cen0", "", 0, 40);
271 Draw("grNPhotDisp_cen0", "", 0, 40);
272 Draw("grNPhotDisp2_cen0", "", 0, 40);
273 Draw("grNPhotDispwou_cen0", "", 0, 40);
274 Draw("grNPhotCPV_cen0", "", 0, 40);
275 Draw("grNPhotCPV2_cen0", "", 0, 40);
276 Draw("grNPhotBoth_cen0", "", 0, 40);
277 Draw("grEnAll_cen0", "", 0.4, 0.7);
278 Draw("grEnAllcore_cen0", "", 0.4, 0.7);
279 Draw("grEnAllwou_cen0", "", 0.4, 0.7);
280 Draw("grEnDisp_cen0", "", 0.4, 0.7);
281 Draw("grEnDisp2_cen0", "", 0.4, 0.7);
282 Draw("grEnDispcore_cen0", "", 0.4, 0.7);
283 Draw("grEnDispwou_cen0", "", 0.4, 0.7);
284 Draw("grEnCPV_cen0", "", 0.4, 0.7);
285 Draw("grEnCPVcore_cen0", "", 0.4, 0.7);
286 Draw("grEnCPV2_cen0", "", 0.4, 0.7);
287 Draw("grEnBoth_cen0", "", 0.4, 0.7);
288 Draw("grEnBothcore_cen0", "", 0.4, 0.7);
293 DrawNPhotAllAndHigh();
296 Draw("grMPi0", "LINFIT", 0.13, 0.15 );
297 Draw("grWPi0", "LINFIT");
298 Draw("grNPi0", "LINFIT");
300 Draw("grSERPV0Aflat", "", 0, 0.4);
301 Draw("grSERPV0Cflat", "", 0, 0.4);
302 Draw("grSERPTPCflat", "", 0, 0.4);
304 Draw("grChi2RPV0A", "", 0.1, 500);
305 Draw("grChi2RPV0C", "", 0.1, 500);
306 Draw("grChi2RPTPC", "", 0.1, 500);
307 Draw("grChi2RPV0Aflat", "", 0.1, 500);
308 Draw("grChi2RPV0Cflat", "", 0.1, 500);
309 Draw("grChi2RPTPCflat", "", 0.1, 500);
311 Draw("grSinRPV0A1", "", 0, 0.7);
312 Draw("grSinRPV0A2", "", 0, 10);
313 Draw("grSinRPV0A3", "", -TMath::Pi(), TMath::Pi());
314 Draw("grSinRPV0C1", "", 0, 0.7);
315 Draw("grSinRPV0C2", "", 0, 10);
316 Draw("grSinRPV0C3", "", -TMath::Pi(), TMath::Pi());
317 Draw("grSinRPTPC1", "", 0, 0.7);
318 Draw("grSinRPTPC2", "", 0, 10);
319 Draw("grSinRPTPC3", "", -TMath::Pi(), TMath::Pi());