1 #include "TCanvas.h" // needed for some reason.
4 const char* prefixToName = "imgs/";
5 const char* appendToName = ".pdf";
8 void Draw(const char* name, const char* options = "", double yFrom=0., double yTo=-1.)
10 TH1* hist = ((TH1*)file->Get(name))->Clone();
11 //hist->SetAxisRange(0, 30 );
12 hist->GetXaxis()->SetLabelSize(0.011);
13 //hist->GetXaxis()->SetTitle("Run");
14 //hist->GetXaxis()->SetRange(1, );
16 if(yFrom > hist->GetMinimum())
17 Printf("in hist %s, yFrom (%f), is larger then hist min (%f)", name, yFrom, hist->GetMinimum());
18 if(yTo < hist->GetMaximum())
19 Printf("in hist %s, yTo (%f), is smaller then hist max (%f)", name, yTo, hist->GetMaximum());
21 hist->GetYaxis()->SetRangeUser(yFrom, yTo);
24 //if( ! TString(options).Contains("same") )
25 TCanvas* canv = new TCanvas;
27 //hist->GetYaxis()->SetNdivisions(16);
31 hist->GetXaxis()->SetLabelSize(0.051);
33 if( TString(options).Contains("LINFIT") )
34 hist->Fit("pol0", "Q");
37 if( TString(name).Contains("grChi2RP") )
39 hist->GetXaxis()->SetRange(1, hist->GetNbinsX()/2);
40 hist->DrawCopy(options);
43 if( TString(name).Contains("grChi2RP") )
45 hist->GetXaxis()->SetRange(hist->GetNbinsX()/2+1,200);
46 hist->DrawCopy(options);
49 canv->SaveAs(Form("%s%s%s", prefixToName, hist->GetName(), appendToName ));
55 for(int cent=0; cent<kNCents; ++cent) {
56 TH1* grNPhotAll = (TH1*)file->Get(Form("grNPhotAll_cen%d", cent))->Clone();
57 TH1* grNPhotDisp = (TH1*)file->Get(Form("grNPhotDisp_cen%d", cent))->Clone();
58 TH1* grNPhotDisp2 = (TH1*)file->Get(Form("grNPhotDisp2_cen%d", cent))->Clone();
59 TH1* grNPhotCPV = (TH1*)file->Get(Form("grNPhotCPV_cen%d", cent))->Clone();
60 TH1* grNPhotCPV2 = (TH1*)file->Get(Form("grNPhotCPV2_cen%d", cent))->Clone();
62 grNPhotAll->GetXaxis()->SetLabelSize(0.045);
63 grNPhotAll->GetYaxis()->SetRangeUser(0, 40);
65 grNPhotAll ->SetMarkerColor(kBlack);
66 grNPhotDisp ->SetMarkerColor(kCyan+1);
67 grNPhotDisp2->SetMarkerColor(kBlue);
68 grNPhotCPV ->SetMarkerColor(kOrange+1);
69 grNPhotCPV2 ->SetMarkerColor(kRed);
71 TCanvas* canv = new TCanvas;
75 grNPhotAll->SetTitle("#LTN_{clusters}^{PID}#GT");
76 grNPhotAll->GetXaxis()->SetRange(0, kFirstBinTo);
77 grNPhotAll->DrawCopy();
78 grNPhotDisp->DrawCopy("same");
79 grNPhotDisp2->DrawCopy("same");
80 grNPhotCPV->DrawCopy("same");
81 grNPhotCPV2->DrawCopy("same");
84 grNPhotAll->SetTitle("");
85 grNPhotAll->GetXaxis()->SetRange(85, 200);
86 grNPhotAll->DrawCopy();
87 grNPhotDisp->DrawCopy("same");
88 grNPhotDisp2->DrawCopy("same");
89 grNPhotCPV->DrawCopy("same");
90 grNPhotCPV2->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("grNPhotAll_cen%d",cent),"All","lP");
97 leg->AddEntry(Form("grNPhotCPV_cen%d",cent),"CPV","lP");
98 leg->AddEntry(Form("grNPhotCPV2_cen%d",cent),"CPV2","lP");
99 leg->AddEntry(Form("grNPhotDisp_cen%d",cent),"Disp","lP");
100 leg->AddEntry(Form("grNPhotDisp2_cen%d",cent),"Disp2","lP");
103 canv->SaveAs(Form("%s%s%s", prefixToName, Form("nPhotPID_cen%d", cent), appendToName ));
109 for(int cent=0; cent<kNCents; ++cent) {
110 TH1* grNPhotAll = (TH1*)file->Get(Form("grNPhotAll_cen0", cent))->Clone();
111 TH1* grNPhotCPV = (TH1*)file->Get(Form("grNPhotCPV_cen0", cent))->Clone();
112 TH1* grNPhotCPV2 = (TH1*)file->Get(Form("grNPhotCPV2_cen0", cent))->Clone();
114 grNPhotCPV->Divide(grNPhotAll);
115 grNPhotCPV->SetTitle(Form("%s / %s", grNPhotCPV->GetTitle(), grNPhotAll->GetTitle()));
116 grNPhotCPV->GetYaxis()->SetRangeUser(0.7,0.85);
118 grNPhotCPV2->Divide(grNPhotAll);
120 TCanvas* canv = new TCanvas;
123 grNPhotCPV->GetXaxis()->SetRange(0, kFirstBinTo);
124 grNPhotCPV->DrawCopy();
127 grNPhotCPV->SetTitle("");
128 grNPhotCPV->GetXaxis()->SetRange(85, 200);
129 grNPhotCPV->DrawCopy();
131 canv->SaveAs(Form("%s%s%s", prefixToName, Form("CPVtoAllRatio_cen%d", cent), appendToName ));
135 void DrawNPhotAllAndHigh()
137 for(int cent=0; cent<kNCents; ++cent) {
138 TH1* grNPhotAll = (TH1*)file->Get(Form("grNPhotAll_cen%d", cent))->Clone();
139 TH1* grNPhotAllHigh = (TH1*)file->Get(Form("grNPhotAllHigh_cen%d", cent))->Clone();
140 TH1* grNPhotAllcoreHigh = (TH1*)file->Get(Form("grNPhotAllcoreHigh_cen%d", cent))->Clone();
142 double sizeAll = grNPhotAll->Integral();
143 double sizeAllHigh = grNPhotAllHigh->Integral();
144 int scale = TMath::Nint(sizeAll / sizeAllHigh);
145 grNPhotAllHigh->Scale(scale);
146 grNPhotAllcoreHigh->Scale(scale);
148 grNPhotAllHigh->SetMarkerColor(kRed);
149 grNPhotAllHigh->SetLineColor(kRed);
150 grNPhotAllcoreHigh->SetMarkerColor(kGreen+1);
151 grNPhotAllcoreHigh->SetLineColor(kGreen+1);
153 TCanvas* canv = new TCanvas;
157 grNPhotAll->SetTitle("#LTN_{clusters}#GT");
158 grNPhotAll->GetXaxis()->SetRange(0, kFirstBinTo);
159 grNPhotAll->GetYaxis()->SetRange(15, 40);
160 //grNPhotAll->GetYaxis()->SetRangeUser(15, 45);
161 grNPhotAll->DrawCopy();
162 grNPhotAllHigh->DrawCopy("same");
163 grNPhotAllcoreHigh->DrawCopy("same");
166 grNPhotAll->GetXaxis()->SetRange(85, 200);
167 grNPhotAll->DrawCopy();
168 grNPhotAllHigh->DrawCopy("same");
169 grNPhotAllcoreHigh->DrawCopy("same");
172 leg = new TLegend(0.8, 0.15, 0.99, 0.4);
173 leg->SetFillColor(kWhite);
174 leg->SetBorderSize(1);
175 leg->AddEntry(grNPhotAll, Form("All"),"lP");
176 leg->AddEntry(grNPhotAllHigh, Form("AllHigh * %d", scale),"lP");
177 leg->AddEntry(grNPhotAllcoreHigh, Form("AllcoreHigh * %d", scale),"lP");
180 canv->SaveAs( Form("%s%s%s", prefixToName, Form("nPhotAllAndHigh_cen%d", cent), appendToName ));
184 void DrawPIDRatiosHighCore(const char* pidNames[], int nPids, const char* high)
187 const Int_t colors[8] = {kBlack, kRed-1, kRed+1, kBlue, kCyan, kGreen+3, kYellow+1, kMagenta};
188 int currentColorID = 99999;
191 for(int cent=0; cent<kNCents; ++cent) {
192 TH1* hAll = (TH1*)file->Get( Form("grNPhot%s%s_cen%d", pidNames[0], high, cent) )->Clone();
194 leg = new TLegend(0.91,0.6,0.99,0.99);
195 leg->SetFillColor(kWhite);
196 leg->SetBorderSize(1);
198 TCanvas* canv = new TCanvas;
201 for(int ipid = 1; ipid < nPids; ++ipid) {
202 TString name(Form("grNPhot%s%s_cen%d", pidNames[ipid], high, cent));
203 TH1* hPID = (TH1*)file->Get( name.Data() )->Clone();
206 if( ++currentColorID < kNColors )
207 color = colors[currentColorID] ;
209 color = colors[ currentColorID = 0 ];
211 hPID->SetMarkerColor(color);
212 hPID->SetLineColor(color);
213 hPID->GetYaxis()->SetRangeUser(0, 1.);
215 leg->AddEntry( hPID , pidNames[ipid], "lP");
218 hPID->SetTitle( Form("#LTN_{clusters}^{PID}#GT / #LTN_{clusters}^{%s}#GT, cent=%d, %s", pidNames[0], cent, high) );
219 hPID->GetXaxis()->SetRange(0, kFirstBinTo);
220 hPID->DrawCopy(same);
224 hPID->GetXaxis()->SetRange(85, 200);
225 hPID->DrawCopy(same);
231 TString fn(Form("CPVtoAllRatio%s_cen%d", high, cent));
232 canv->SaveAs(Form("%s%s%s", prefixToName, fn.Data(), appendToName ));
240 const char* kPIDNames[nn] = {"All", "Allwou", "CPV", "CPV2", "Disp", "Disp2", "Dispwou", "Both"};
241 const char* kPIDNamesCore[nc] = {"Allcore", "CPVcore", "Dispcore", "Bothcore"};
242 const char* fillHigh[2] = {"", "High"};
243 for(int ihigh = 0; ihigh < 2; ++ihigh) {
244 DrawPIDRatiosHighCore(kPIDNames, nn, fillHigh[ihigh]);
245 DrawPIDRatiosHighCore(kPIDNamesCore, nc, fillHigh[ihigh]);
251 gStyle->SetOptStat(0);
252 gStyle->SetOptFit(1);
254 file = TFile::Open("outputQA.root", "read");
256 // Draw("grVtxZ10Cent", "", 0.7, 1.);
257 // Draw("grNCellsM1", "E");
258 // Draw("grNCellsM2");
259 // Draw("grNCellsM3");
260 // Draw("grECluster", "", 0.5, 0.7);
261 // Draw("grNCluster", "", 0, 40);
262 // Draw("grNTracks0", "", 0 , 12000);
263 // Draw("grNPhotAll_cen0", "", 0, 40);
264 // Draw("grNPhotAllcore_cen0", "", 0, 40);
265 // Draw("grNPhotAllwou_cen0", "", 0, 40);
266 // Draw("grNPhotDisp_cen0", "", 0, 40);
267 // Draw("grNPhotDisp2_cen0", "", 0, 40);
268 // Draw("grNPhotDispwou_cen0", "", 0, 40);
269 // Draw("grNPhotCPV_cen0", "", 0, 40);
270 // Draw("grNPhotCPV2_cen0", "", 0, 40);
271 // Draw("grNPhotBoth_cen0", "", 0, 40);
272 // Draw("grEnAll_cen0", "", 0.4, 0.7);
273 // Draw("grEnAllcore_cen0", "", 0.4, 0.7);
274 // Draw("grEnAllwou_cen0", "", 0.4, 0.7);
275 // Draw("grEnDisp_cen0", "", 0.4, 0.7);
276 // Draw("grEnDisp2_cen0", "", 0.4, 0.7);
277 // Draw("grEnDispcore_cen0", "", 0.4, 0.7);
278 // Draw("grEnDispwou_cen0", "", 0.4, 0.7);
279 // Draw("grEnCPV_cen0", "", 0.4, 0.7);
280 // Draw("grEnCPVcore_cen0", "", 0.4, 0.7);
281 // Draw("grEnCPV2_cen0", "", 0.4, 0.7);
282 // Draw("grEnBoth_cen0", "", 0.4, 0.7);
283 // Draw("grEnBothcore_cen0", "", 0.4, 0.7);
288 // DrawNPhotAllAndHigh();
291 // Draw("grMPi0", "LINFIT", 0.13, 0.15 );
292 // Draw("grWPi0", "LINFIT");
293 // Draw("grNPi0", "LINFIT");
295 // Draw("grSERPV0Aflat", "", 0, 0.4);
296 // Draw("grSERPV0Cflat", "", 0, 0.4);
297 // Draw("grSERPTPCflat", "", 0, 0.4);
299 // Draw("grChi2RPV0A", "", 0.1, 500);
300 // Draw("grChi2RPV0C", "", 0.1, 500);
301 // Draw("grChi2RPTPC", "", 0.1, 500);
302 // Draw("grChi2RPV0Aflat", "", 0.1, 500);
303 // Draw("grChi2RPV0Cflat", "", 0.1, 500);
304 // Draw("grChi2RPTPCflat", "", 0.1, 500);
306 Draw("grSinRPV0A1", "", 0, 0.7);
307 Draw("grSinRPV0A2", "", 0, 10);
308 Draw("grSinRPV0A3", "", -TMath::Pi(), TMath::Pi());
309 Draw("grSinRPV0C1", "", 0, 0.7);
310 Draw("grSinRPV0C2", "", 0, 10);
311 Draw("grSinRPV0C3", "", -TMath::Pi(), TMath::Pi());
312 Draw("grSinRPTPC1", "", 0, 0.7);
313 Draw("grSinRPTPC2", "", 0, 10);
314 Draw("grSinRPTPC3", "", -TMath::Pi(), TMath::Pi());