]>
Commit | Line | Data |
---|---|---|
579b5046 | 1 | #if !defined(__CINT__) || defined(__MAKECINT__) |
2 | #include <TCanvas.h> | |
3 | #include <TGrid.h> | |
4 | #include <TFile.h> | |
5 | #include <TList.h> | |
6 | #include <TGridResult.h> | |
7 | #include <TPaveStats.h> | |
8 | #include <TGraph.h> | |
9 | #include <TMath.h> | |
10 | #include <TGraphErrors.h> | |
11 | #include <TH1.h> | |
12 | #include <TF1.h> | |
13 | #include <TH2.h> | |
14 | #include <TLegend.h> | |
15 | #include <TLegendEntry.h> | |
16 | #include <TLatex.h> | |
17 | #include <TString.h> | |
18 | #include <TStyle.h> | |
19 | #include <TSystem.h> | |
20 | #include <TROOT.h> | |
21 | #endif | |
22 | ||
23 | void PlotGeneral(TFile* fildat, TCanvas**& clist, Int_t& cnum); | |
24 | void PlotITSsa(TFile* fildat, TCanvas**& clist, Int_t& cnum); | |
25 | void PlotSDD(TFile* fildat, TCanvas**& clist, Int_t& cnum); | |
26 | void GetGainModuleLevelSSD(TFile* fildat, TCanvas**& clist, Int_t& cnum); | |
27 | void VertexQAMacro(TFile *fildat, TCanvas **&clist, Int_t &cnum); | |
28 | void PlotSPD(TFile* fildat, TFile* filMC, TCanvas**& clist, Int_t& cnum); | |
29 | Bool_t PlotITSTPCMatchingEff(TFile *f, TCanvas**& clist,Int_t& cnum); | |
30 | void SetDrawAtt(Int_t markerstyle,Int_t markercolor,Int_t markersize,Int_t linecolor,Int_t linewidth,TH1 *h1); | |
31 | Double_t LangausFun(Double_t *x, Double_t *par); | |
32 | void SaveC(TFile &fout, TCanvas**& clist, Int_t cnum); | |
33 | TString GetRunNumber(); | |
34 | ||
35 | // the run number is available to all the functions. Its value is set by AliITSQAchecks | |
36 | Int_t gRunNumber = 0; | |
37 | Int_t gRunNumberMC = 0; | |
38 | TString pdfFileNames=""; | |
39 | ||
40 | ||
41 | //_______________________________________________________________________ | |
42 | void AliITSQAchecks_pp(TString option="alien", | |
43 | Int_t nRun=179920, | |
44 | TString period="LHC12c", | |
45 | TString qaTrain="", | |
46 | TString filenamedata="QAresults_barrel.root", | |
47 | // TString filenameMC="../rif/QAresults_barrel.root", | |
48 | TString filenameMC="alien:///alice/data/2012/LHC12c/000179918/cpass1/QAresults_barrel.root", | |
49 | //TString filenameMC="/Users/beole/alice/QA/macros/macros_protoni/QAresults.root", | |
50 | Int_t nRunMC=179918){ | |
51 | // THIS MACRO SHOULD BE COMPILED. IT DOES NOT WORK WITH THE INTERPRETER | |
52 | // option: "local" if filenamedata is the name of a local file | |
53 | // "grid" if on alien | |
54 | // nRun: run number | |
55 | // period: LHC period (e.g. LHC11h) | |
56 | // qaTrain: QA train specifier | |
57 | // Empty string if QAresults.root is in the ESDs/pass1_HLT directory | |
58 | // filenamedata: QAresults.root is by default the file name with the results | |
59 | // filenameMC: file name for MC comparison. If the names begins with alien: | |
60 | // the file is accessed through alien, otherwise is taken as local | |
61 | // nRunMC: run number for comparison. If filenamMC begings with "alien:" | |
62 | // the run number is taken from the path. Otherwise, in case of a | |
63 | // local filenameMC, the run number must be specified here | |
64 | // Select here what you want to display | |
65 | // the complete selection string is | |
66 | // "general ITSSA SPD SDD SSD vertex ITSTPC" | |
67 | // Contact: Stefania Beole': beole@to.infn.it | |
68 | ||
69 | /* $Id$ */ | |
70 | ||
71 | gRunNumber = nRun; | |
72 | TString aux(filenameMC); | |
73 | if(aux.BeginsWith("alien:")){ | |
74 | aux=aux.Remove(0,35); | |
75 | // aux=aux.Remove(9,aux.Length()); //compare to pass2 | |
76 | aux=aux.Remove(6,aux.Length()); //compare to pass1 | |
77 | gRunNumberMC = atoi(aux.Data()); | |
78 | } | |
79 | else { | |
80 | gRunNumberMC = nRunMC; | |
81 | } | |
82 | ||
83 | TString selection("general ITSSA SPD SDD SSD vertex ITSTPC"); | |
84 | //TString selection("general ITSSA SPD SDD vertex ITSTPC"); | |
85 | ||
86 | // TString selection("vertex"); | |
87 | gROOT->SetStyle("Plain"); | |
88 | gStyle->SetOptStat(1111); | |
89 | TFile *fildat; | |
90 | TString path; | |
91 | Int_t year=2012; | |
92 | if(period.Contains("LHC11")) year=2011; | |
93 | else if(period.Contains("LHC10")) year=2010; | |
94 | ||
95 | if(option.Contains("local")){ | |
96 | fildat=new TFile(filenamedata.Data()); | |
97 | printf("Opened file %s\n",fildat->GetName()); | |
98 | }else{ | |
99 | TGrid::Connect("alien:"); | |
100 | if(qaTrain.Contains("QA")){ | |
101 | path=Form("/alice/data/%d/%s/%09d/ESDs/pass2/%s/",year,period.Data(),nRun,qaTrain.Data()); | |
102 | } else { | |
103 | path=Form("/alice/data/%d/%s/%09d/cpass1/",year,period.Data(),nRun); | |
104 | } | |
105 | filenamedata = "alien://"+path+"QAresults_barrel.root"; | |
106 | fildat=TFile::Open(filenamedata.Data()); | |
107 | } | |
108 | if(option.Contains("local") && filenameMC.Contains("alien"))TGrid::Connect("alien:"); | |
109 | TFile* filMC=TFile::Open(filenameMC.Data()); | |
110 | TCanvas** clist; | |
111 | Int_t cnum; | |
112 | char rn[10]; | |
113 | cout<<gRunNumberMC<<endl; | |
114 | sprintf(rn,"%d",gRunNumber); | |
115 | TString strRN(rn); | |
116 | TString founame="Outfil"+strRN+".root"; | |
117 | TFile fout(founame,"recreate"); | |
118 | if(selection.Contains("general")){ | |
119 | PlotGeneral(fildat,clist,cnum); | |
120 | printf("GENERAL - cnum = %d\n",cnum); | |
121 | SaveC(fout,clist,cnum); | |
122 | ||
123 | } | |
124 | if(selection.Contains("ITSSA")){ | |
125 | PlotITSsa(fildat,clist,cnum); | |
126 | printf("ITSSA - cnum = %d\n",cnum); | |
127 | SaveC(fout,clist,cnum); | |
128 | } | |
129 | if(selection.Contains("SDD")){ | |
130 | PlotSDD(fildat,clist,cnum); | |
131 | printf("SDD - cnum = %d\n",cnum); | |
132 | SaveC(fout,clist,cnum); | |
133 | } | |
134 | if(selection.Contains("SSD")){ | |
135 | GetGainModuleLevelSSD(fildat,clist,cnum); | |
136 | printf("SSD - cnum = %d\n",cnum); | |
137 | SaveC(fout,clist,cnum); | |
138 | } | |
139 | if(selection.Contains("vertex")){ | |
140 | VertexQAMacro(fildat,clist,cnum); | |
141 | printf("VERTEX - cnum = %d\n",cnum); | |
142 | SaveC(fout,clist,cnum); | |
143 | } | |
144 | if(selection.Contains("SPD")){ | |
145 | PlotSPD(fildat,filMC,clist,cnum); | |
146 | printf("SPD - cnum = %d\n",cnum); | |
147 | SaveC(fout,clist,cnum); | |
148 | } | |
149 | if(selection.Contains("ITSTPC")){ | |
150 | PlotITSTPCMatchingEff(fildat,clist,cnum); | |
151 | printf("ITSTPC - cnum = %d\n",cnum); | |
152 | SaveC(fout,clist,cnum); | |
153 | } | |
154 | ||
155 | fout.Close(); | |
156 | ||
157 | // merge the pdf files | |
158 | TString command("gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=merged"); | |
159 | command=command+strRN+".pdf "+pdfFileNames; | |
160 | gSystem->Exec(command.Data()); | |
161 | printf(" Merging the pdf file: %s \n",command.Data()); | |
162 | ||
163 | } | |
164 | ||
165 | //_______________________________________________________________________ | |
166 | void PlotGeneral(TFile* fildat, TCanvas**& clist, Int_t& cnum){ | |
167 | TDirectoryFile* df=(TDirectoryFile*)fildat->Get("SDD_Performance"); | |
168 | if(!df){ | |
169 | printf("SDD_Performance MISSING -> Exit\n"); | |
170 | return; | |
171 | } | |
172 | TList* l=(TList*)df->Get("coutputRP"); | |
173 | if(!df){ | |
174 | printf("coutputRP TList MISSING -> Exit\n"); | |
175 | return; | |
176 | } | |
177 | cnum=1; // number of canvases | |
178 | clist= new TCanvas* [1];//array of pointers to TCanvases | |
179 | gROOT->SetStyle("Plain"); | |
180 | gStyle->SetOptStat(1111); | |
181 | TH1F* hcllay=(TH1F*)l->FindObject("hCluInLay"); | |
182 | TH1F* hev=(TH1F*)l->FindObject("hNEvents"); | |
183 | Int_t nTotEvents=hev->GetBinContent(2); | |
184 | Int_t nTrigEvents=hev->GetBinContent(3); | |
185 | Int_t nEvents=nTotEvents; | |
186 | printf("---- Statistics ----\n"); | |
187 | printf("Number of Events = %d\n",nTotEvents); | |
188 | if(nTrigEvents>0){ | |
189 | printf("Number of Triggered Events = %d\n",nTrigEvents); | |
190 | nEvents=nTrigEvents; | |
191 | }else{ | |
192 | printf("No request on the trigger done when running the task\n"); | |
193 | } | |
194 | if(hcllay){ | |
195 | Double_t norm=hcllay->GetBinContent(1); | |
196 | if(norm>0.){ | |
197 | hcllay->Scale(1./norm); | |
198 | hcllay->SetTitle(""); | |
199 | hcllay->GetXaxis()->SetRange(2,7); | |
200 | hcllay->SetMinimum(0.); | |
201 | hcllay->SetMaximum(1.1); | |
202 | hcllay->SetMarkerStyle(23); | |
203 | TString ctitle=GetRunNumber()+"General checks: PointPerLayer"; | |
204 | TCanvas* ceffL=new TCanvas("ceffL",ctitle,1000,800); | |
205 | clist[0]=ceffL; | |
206 | // ceffL->Divide(1,2); | |
207 | // ceffL->cd(1); | |
208 | ceffL->SetGridy(); | |
209 | hcllay->Draw(); | |
210 | TLatex* tg=new TLatex(0.15,0.2,"Fraction of tracks with point in ITS layer"); | |
211 | tg->SetTextSize(0.04); | |
212 | tg->SetNDC(); | |
213 | tg->SetTextColor(1); | |
214 | tg->Draw(); | |
215 | TString testo="Run "+GetRunNumber(); | |
216 | TLatex* tg2 = new TLatex(0.15,0.85,testo.Data()); | |
217 | tg2->SetTextSize(0.04); | |
218 | tg2->SetNDC(); | |
219 | tg2->SetTextColor(2); | |
220 | tg2->Draw(); | |
221 | hcllay->GetXaxis()->SetTitle("Layer"); | |
222 | hcllay->GetYaxis()->SetTitle("Fraction of tracks with point in layer"); | |
223 | ceffL->Update(); | |
224 | ceffL->SaveAs("track_points_per_layer.pdf"); | |
225 | pdfFileNames+=" track_points_per_layer.pdf"; | |
226 | } | |
227 | } | |
228 | } | |
229 | ||
230 | ||
231 | //_______________________________________________________________________ | |
232 | ////////////////////////////////////////////////////////////////////// | |
233 | /// ITSsa //////////////////////////////////////////////////////////// | |
234 | ////////////////////////////////////////////////////////////////////// | |
235 | void PlotITSsa(TFile* fildat, TCanvas**& clist, Int_t& cnum){ | |
236 | TDirectoryFile* df=(TDirectoryFile*)fildat->Get("TracksITSsa"); | |
237 | if(!df) df=(TDirectoryFile*)fildat->Get("ITSsaTracks"); | |
238 | if(!df){ | |
239 | printf("ITSsa_Performance MISSING -> Exit\n"); | |
240 | return; | |
241 | } | |
242 | ||
243 | TList* l=(TList*)df->Get("clistITSsaTracks"); | |
244 | if(!df){ | |
245 | printf("clistITSsaTracks TList MISSING -> Exit\n"); | |
246 | return; | |
247 | } | |
248 | cnum=2; // number of canvases | |
249 | clist= new TCanvas* [2];//array of pointers to TCanvases | |
250 | gROOT->SetStyle("Plain"); | |
251 | gStyle->SetOptStat(1111); | |
252 | ||
253 | ||
254 | TH1F* hPtTPCITS=(TH1F*)l->FindObject("hPtTPCITS"); | |
255 | TH1F* hPtITSsa=(TH1F*)l->FindObject("hPtITSsa"); | |
256 | TH1F* hPtITSpureSA=(TH1F*)l->FindObject("hPtITSpureSA"); | |
257 | ||
258 | TH2F* hEtaPhiTPCITS=(TH2F*)l->FindObject("hEtaPhiTPCITS"); | |
259 | TH2F* hEtaPhiITSsa=(TH2F*)l->FindObject("hEtaPhiITSsa"); | |
260 | TH2F* hEtaPhiITSpureSA=(TH2F*)l->FindObject("hEtaPhiITSpureSA"); | |
261 | TH1F* hChi2TPCITS=(TH1F*)l->FindObject("hChi2TPCITS"); | |
262 | TH1F* hChi2ITSsa=(TH1F*)l->FindObject("hChi2ITSsa"); | |
263 | TH1F* hChi2ITSpureSA=(TH1F*)l->FindObject("hChi2ITSpureSA"); | |
264 | ||
265 | TH1F* hRatio=(TH1F*)hPtTPCITS->Clone("hRatio"); | |
266 | TH1F* hRatio1=(TH1F*)hPtTPCITS->Clone("hRatio1"); | |
267 | hRatio->Add(hPtITSsa); | |
268 | hRatio->Divide(hPtITSpureSA); | |
269 | hRatio->SetStats(0); | |
270 | hRatio1->Divide(hPtITSsa); | |
271 | hRatio1->SetStats(0); | |
272 | ||
273 | TString ctitle=GetRunNumber()+"ITS standalone: performance vs Pt"; | |
274 | TCanvas* cITSsa1=new TCanvas("cITSsa1",ctitle,1200,1200); | |
275 | clist[0]=cITSsa1; | |
276 | cITSsa1->Divide(1,3); | |
277 | cITSsa1->cd(1); | |
278 | hPtITSpureSA->Draw(); | |
279 | hPtITSpureSA->GetXaxis()->SetTitle("Pt (GeV/c)"); | |
280 | gPad->Update(); | |
281 | TPaveStats *st1=(TPaveStats*)hPtITSpureSA->GetListOfFunctions()->FindObject("stats"); | |
282 | st1->SetY1NDC(0.71); | |
283 | st1->SetY2NDC(0.9); | |
284 | hPtTPCITS->SetLineColor(2); | |
285 | hPtTPCITS->GetXaxis()->SetTitle("Pt (GeV/c)"); | |
286 | hPtTPCITS->Draw("sames"); | |
287 | //hPtTPCITS->Draw(); | |
288 | gPad->Update(); | |
289 | TPaveStats *st2=(TPaveStats*)hPtTPCITS->GetListOfFunctions()->FindObject("stats"); | |
290 | st2->SetY1NDC(0.71); | |
291 | st2->SetY2NDC(0.9); | |
292 | st2->SetTextColor(2); | |
293 | ||
294 | hPtITSsa->SetLineColor(4); | |
295 | hPtITSsa->Draw("sames"); | |
296 | gPad->Update(); | |
297 | TPaveStats *st3=(TPaveStats*)hPtITSsa->GetListOfFunctions()->FindObject("stats"); | |
298 | st3->SetY1NDC(0.51); | |
299 | st3->SetY2NDC(0.7); | |
300 | st3->SetTextColor(4); | |
301 | TLegend* leg=new TLegend(0.5,0.5,0.69,0.79); | |
302 | leg->SetFillColor(0); | |
303 | TLegendEntry* ent=leg->AddEntry(hPtTPCITS,"TPC+ITS","L"); | |
304 | ent->SetTextColor(hPtTPCITS->GetLineColor()); | |
305 | ent=leg->AddEntry(hPtITSsa,"ITSsa","L"); | |
306 | ent->SetTextColor(hPtITSsa->GetLineColor()); | |
307 | // to be used only with pp data (ITS pure SA) | |
308 | ent=leg->AddEntry(hPtITSpureSA,"ITS pureSA","L"); | |
309 | ent->SetTextColor(hPtITSpureSA->GetLineColor()); | |
310 | leg->Draw(); | |
311 | cITSsa1->cd(2); | |
312 | gPad->SetGridx(); | |
313 | gPad->SetGridy(); | |
314 | hRatio1->GetXaxis()->SetTitle("Pt (GeV/c)"); | |
315 | hRatio->GetXaxis()->SetTitle("Pt (GeV/c)"); | |
316 | hRatio1->GetYaxis()->SetTitle("TPCITS/ITSsa"); | |
317 | hRatio->GetYaxis()->SetTitle("(TPCITS+ITSsa)/ITSpureSA"); | |
318 | // hRatio1->DrawCopy(); | |
319 | hRatio->DrawCopy(); | |
320 | // TLatex* tratio=new TLatex(0.2,0.75,"TPC+ITS/ITSsa vs Pt"); | |
321 | TLatex* tratio=new TLatex(0.2,0.75,"TPCITS+ITSsa/ITSpureSA vs Pt"); | |
322 | tratio->SetNDC(); | |
323 | tratio->SetTextColor(1); | |
324 | tratio->Draw(); | |
325 | cITSsa1->cd(3); | |
326 | hChi2ITSpureSA->Scale(1./hChi2ITSpureSA->GetEntries()); | |
327 | hChi2ITSsa->Scale(1./hChi2ITSsa->GetEntries()); | |
328 | hChi2TPCITS->Scale(1./hChi2TPCITS->GetEntries()); | |
329 | hChi2ITSpureSA->SetLineColor(1); | |
330 | hChi2ITSpureSA->Draw(""); | |
331 | hChi2TPCITS->SetLineColor(2); | |
332 | hChi2TPCITS->Draw("sames"); | |
333 | TLatex* tchi=new TLatex(0.25,0.85,"chi2 vs Pt"); | |
334 | tchi->SetNDC(); | |
335 | tchi->SetTextColor(1); | |
336 | tchi->Draw(); | |
337 | gPad->Update(); | |
338 | TPaveStats *stc2=(TPaveStats*)hChi2TPCITS->GetListOfFunctions()->FindObject("stats"); | |
339 | stc2->SetY1NDC(0.71); | |
340 | stc2->SetY2NDC(0.9); | |
341 | stc2->SetTextColor(2); | |
342 | // c2->Update(); | |
343 | hChi2ITSsa->SetLineColor(4); | |
344 | hChi2ITSsa->Draw("sames"); | |
345 | gPad->Update(); | |
346 | TPaveStats *stc3=(TPaveStats*)hChi2ITSsa->GetListOfFunctions()->FindObject("stats"); | |
347 | stc3->SetY1NDC(0.51); | |
348 | stc3->SetY2NDC(0.7); | |
349 | stc3->SetTextColor(4); | |
350 | leg->Draw(); | |
351 | ||
352 | cITSsa1->Update(); | |
353 | cITSsa1->SaveAs("ITSsa1.pdf"); | |
354 | pdfFileNames+=" ITSsa1.pdf"; | |
355 | gStyle->SetPalette(1); | |
356 | hEtaPhiITSpureSA->SetStats(0); | |
357 | hEtaPhiITSpureSA->SetTitle("ITS pureSA"); | |
358 | hEtaPhiITSsa->SetStats(0); | |
359 | hEtaPhiITSsa->SetTitle("ITSsa tracks"); | |
360 | hEtaPhiTPCITS->SetStats(0); | |
361 | hEtaPhiTPCITS->SetTitle("TPC+ITS tracks"); | |
362 | ctitle=GetRunNumber()+"Eta-phi distribution for ITSsa and TPC+ITS tracks"; | |
363 | TCanvas* cITSsa2=new TCanvas("cITSsa2",ctitle,1200,800); | |
364 | clist[1]=cITSsa2; | |
365 | cITSsa2->Divide(3,1); //for ITSpuresa | |
366 | //cITSsa2->Divide(2,1); //for no ITSpureSA | |
367 | cITSsa2->cd(1); | |
368 | //TPad* p1=new TPad("p1","Tracking: tracks distribution in EtaPhi",0,0.5,1.,1.); | |
369 | //p1->Divide(3,1); | |
370 | //p1->cd (1); | |
371 | hEtaPhiITSpureSA->Draw("colz"); | |
372 | hEtaPhiITSpureSA->GetXaxis()->SetTitle("Eta"); | |
373 | hEtaPhiITSpureSA->GetYaxis()->SetTitle("Phi"); | |
374 | cITSsa2->cd(2); | |
375 | //p1->cd(2); | |
376 | hEtaPhiITSsa->Draw("colz"); | |
377 | hEtaPhiITSsa->GetXaxis()->SetTitle("Eta"); | |
378 | hEtaPhiITSsa->GetYaxis()->SetTitle("Phi"); | |
379 | cITSsa2->cd(3); | |
380 | //p1->cd(3); | |
381 | hEtaPhiTPCITS->Draw("colz"); | |
382 | hEtaPhiTPCITS->GetXaxis()->SetTitle("Eta"); | |
383 | hEtaPhiTPCITS->GetYaxis()->SetTitle("Phi"); | |
384 | //c4->cd(4); | |
385 | cITSsa2->SaveAs("ITSsa2.pdf"); | |
386 | pdfFileNames+=" ITSsa2.pdf"; | |
387 | } | |
388 | ||
389 | //----------------------------------------------------- | |
390 | // /////////// Plot SDD //////////// | |
391 | //_______________________________________________________________________ | |
392 | void SetDrawAtt(Int_t markerstyle,Int_t markercolor,Int_t markersize,Int_t linecolor,Int_t linewidth,TH1 *h1){ | |
393 | ||
394 | ||
395 | h1->SetMarkerStyle(markerstyle); | |
396 | h1->SetMarkerColor(markercolor); | |
397 | h1->SetMarkerSize(markersize); | |
398 | h1->SetLineColor(linecolor); | |
399 | h1->SetLineWidth(linewidth); | |
400 | } | |
401 | ||
402 | //_______________________________________________________________________ | |
403 | Double_t LangausFun(Double_t *x, Double_t *par) { | |
404 | ||
405 | //Fit parameters: | |
406 | //par[0]=Width (scale) parameter of Landau density | |
407 | //par[1]=Most Probable (MP, location) parameter of Landau density | |
408 | //par[2]=Total area (integral -inf to inf, normalization constant) | |
409 | //par[3]=Width (sigma) of convoluted Gaussian function | |
410 | // | |
411 | //In the Landau distribution (represented by the CERNLIB approximation), | |
412 | //the maximum is located at x=-0.22278298 with the location parameter=0. | |
413 | //This shift is corrected within this function, so that the actual | |
414 | //maximum is identical to the MP parameter. | |
415 | ||
416 | // Numeric constants | |
417 | Double_t invsq2pi = 0.3989422804014; // (2 pi)^(-1/2) | |
418 | Double_t mpshift = -0.22278298; // Landau maximum location | |
419 | ||
420 | // Control constants | |
421 | Double_t np = 100.0; // number of convolution steps | |
422 | Double_t sc = 5.0; // convolution extends to +-sc Gaussian sigmas | |
423 | ||
424 | // Variables | |
425 | Double_t xx; | |
426 | Double_t mpc; | |
427 | Double_t fland; | |
428 | Double_t sum = 0.0; | |
429 | Double_t xlow,xupp; | |
430 | Double_t step; | |
431 | Double_t i; | |
432 | ||
433 | ||
434 | // MP shift correction | |
435 | mpc = par[1] - mpshift * par[0]; | |
436 | ||
437 | // Range of convolution integral | |
438 | xlow = x[0] - sc * par[3]; | |
439 | xupp = x[0] + sc * par[3]; | |
440 | ||
441 | step = (xupp-xlow) / np; | |
442 | ||
443 | // Convolution integral of Landau and Gaussian by sum | |
444 | for(i=1.0; i<=np/2; i++) { | |
445 | xx = xlow + (i-.5) * step; | |
446 | fland = TMath::Landau(xx,mpc,par[0]) / par[0]; | |
447 | sum += fland * TMath::Gaus(x[0],xx,par[3]); | |
448 | ||
449 | xx = xupp - (i-.5) * step; | |
450 | fland = TMath::Landau(xx,mpc,par[0]) / par[0]; | |
451 | sum += fland * TMath::Gaus(x[0],xx,par[3]); | |
452 | } | |
453 | ||
454 | return (par[2] * step * sum * invsq2pi / par[3]); | |
455 | ||
456 | } | |
457 | //_________________________________________________________________________ | |
458 | void PlotSDD(TFile* fildat, TCanvas**& clist, Int_t& cnum){ | |
459 | TDirectoryFile* df=(TDirectoryFile*)fildat->Get("SDD_Performance"); | |
460 | if(!df){ | |
461 | printf("SDD_Performance MISSING -> Exit\n"); | |
462 | return; | |
463 | } | |
464 | TList* l=(TList*)df->Get("coutputRP"); | |
465 | if(!df){ | |
466 | printf("coutputRP TList MISSING -> Exit\n"); | |
467 | return; | |
468 | } | |
469 | cnum=1; // number of canvases | |
470 | clist= new TCanvas* [cnum];//array of pointers to TCanvases | |
471 | gROOT->SetStyle("Plain"); | |
472 | gStyle->SetOptStat(1111); | |
473 | TH1F* htimT=(TH1F*)l->FindObject("hDrTimTPAll"); | |
474 | TH1F* htimTe=(TH1F*)l->FindObject("hDrTimTPExtra"); | |
475 | TH1F* htimTne=(TH1F*)l->FindObject("hDrTimTPNoExtra"); | |
476 | htimT->Rebin(4); | |
477 | htimTe->Rebin(4); | |
478 | htimTne->Rebin(4); | |
479 | htimT->SetLineWidth(2); | |
480 | htimTe->SetLineWidth(2); | |
481 | htimTne->SetLineWidth(2); | |
482 | // TH1F* hev=(TH1F*)l->FindObject("hNEvents"); | |
483 | // Int_t nTotEvents=hev->GetBinContent(2); | |
484 | // Int_t nTrigEvents=hev->GetBinContent(3); | |
485 | // Int_t nEvents=nTotEvents; | |
486 | // printf("---- Statistics ----\n"); | |
487 | // printf("Number of Events = %d\n",nTotEvents); | |
488 | // if(nTrigEvents>0){ | |
489 | // printf("Number of Triggered Events = %d\n",nTrigEvents); | |
490 | // nEvents=nTrigEvents; | |
491 | // }else{ | |
492 | // printf("No request on the trigger done when running the task\n"); | |
493 | // } | |
494 | // if(hcllay){ | |
495 | // Double_t norm=hcllay->GetBinContent(1); | |
496 | // if(norm>0.){ | |
497 | // hcllay->Scale(1./norm); | |
498 | // hcllay->SetTitle(""); | |
499 | // hcllay->GetXaxis()->SetRange(2,7); | |
500 | // hcllay->SetMinimum(0.); | |
501 | // hcllay->SetMaximum(1.1); | |
502 | // hcllay->SetMarkerStyle(23); | |
503 | // TCanvas* ceffL=new TCanvas("ceffL","General: PointPerLayer",800,1000); | |
504 | // clist[0]=ceffL; | |
505 | // ceffL->Divide(1,2); | |
506 | // ceffL->cd(1); | |
507 | // ceffL->SetGridy(); | |
508 | // hcllay->Draw(); | |
509 | // hcllay->GetXaxis()->SetTitle("Layer"); | |
510 | // hcllay->GetYaxis()->SetTitle("Fraction of tracks with point in layer"); | |
511 | // ceffL->Update(); | |
512 | // } | |
513 | // } | |
514 | TH1F* hSigTim[8]; | |
515 | TGraphErrors* gmpv=new TGraphErrors(0); | |
516 | TGraphErrors* gsigg=new TGraphErrors(0); | |
517 | TGraphErrors* gsigl=new TGraphErrors(0); | |
518 | gmpv->SetTitle(""); | |
519 | gsigg->SetTitle(""); | |
520 | gsigl->SetTitle(""); | |
521 | Int_t iPoint=0; | |
522 | TF1 *lfun = new TF1("LangausFun",LangausFun,50.,300.,4); | |
523 | for(Int_t it=0; it<8; it++){ | |
524 | hSigTim[it]=(TH1F*)l->FindObject(Form("hSigTimeInt%d",it)); | |
525 | if(hSigTim[it]->GetEntries()>200){ | |
526 | lfun->SetLineWidth(2); | |
527 | lfun->SetParameter(0,5.); | |
528 | lfun->SetParameter(1,80.); | |
529 | lfun->SetParameter(2,hSigTim[it]->GetEntries()/10.); | |
530 | lfun->SetParameter(3,10.); | |
531 | lfun->SetParLimits(3,0.,20); | |
532 | ||
533 | // hSigTim[it]->Fit("LangausFun","QLR"); | |
534 | hSigTim[it]->Fit("LangausFun","ON"); | |
535 | hSigTim[it]->GetXaxis()->SetTitle(Form("dE/dx, time interval %d",it+1)); | |
536 | hSigTim[it]->GetYaxis()->SetTitle("Events"); | |
537 | Float_t mpv=lfun->GetParameter(1); | |
538 | Float_t empv=lfun->GetParError(1); | |
539 | Float_t sig=lfun->GetParameter(3); | |
540 | Float_t esig=lfun->GetParError(3); | |
541 | Float_t sigl=lfun->GetParameter(0); | |
542 | Float_t esigl=lfun->GetParError(0); | |
543 | gmpv->SetPoint(iPoint,(Float_t)it,mpv); | |
544 | gmpv->SetPointError(iPoint,0.,empv); | |
545 | gsigg->SetPoint(iPoint,(Float_t)it,sig); | |
546 | gsigg->SetPointError(iPoint,0.,esig); | |
547 | gsigl->SetPoint(iPoint,(Float_t)it,sigl); | |
548 | gsigl->SetPointError(iPoint,0.,esigl); | |
549 | ++iPoint; | |
550 | printf("Bin %d - MPV=%.3f \t SigmaLandau=%.3f \t SigmaGaus=%.3f\n",it,mpv,sigl,sig); | |
551 | } | |
552 | } | |
553 | TString ctitle=GetRunNumber()+"SDD: DriftTime - dE/dx"; | |
554 | TCanvas* ctim=new TCanvas("ctim",ctitle,800,1000); | |
555 | clist[0]=ctim; | |
556 | ctim->Divide(1,2); | |
557 | ctim->cd(1); | |
558 | // htimT->Draw(); | |
559 | // htimTe->SetLineColor(2); | |
560 | // htimTe->Draw("same"); | |
561 | htimTne->SetLineColor(4); | |
562 | htimTne->Draw(""); | |
563 | htimTne->GetXaxis()->SetTitle("Drift Time (ns)"); | |
564 | htimTne->GetYaxis()->SetTitle("TrackPoints"); | |
565 | htimTne->GetYaxis()->SetTitleOffset(1.2); | |
566 | // TLatex* ta=new TLatex(0.5,0.85,"All Clusters"); | |
567 | // ta->SetNDC(); | |
568 | // ta->SetTextColor(1); | |
569 | // ta->Draw(); | |
570 | // TLatex* te=new TLatex(0.5,0.8,"Extra Clusters"); | |
571 | // te->SetNDC(); | |
572 | // te->SetTextColor(2); | |
573 | // te->Draw(); | |
574 | // TLatex* tn=new TLatex(0.3,0.3,"Non-Extra Clusters"); | |
575 | TLatex* tn=new TLatex(0.3,0.3,"Clusters on SDD modules"); | |
576 | tn->SetNDC(); | |
577 | tn->SetTextColor(4); | |
578 | tn->Draw(); | |
579 | TLine* tlin3=new TLine(450.,0.,450.,htimTne->GetMaximum()); | |
580 | tlin3->SetLineColor(2); | |
581 | tlin3->SetLineWidth(2); | |
582 | tlin3->SetLineStyle(7); | |
583 | tlin3->Draw("same"); | |
584 | TLine* tlin4=new TLine(620.,0.,620.,htimTne->GetMaximum()); | |
585 | tlin4->SetLineColor(2); | |
586 | tlin4->SetLineWidth(2); | |
587 | tlin4->SetLineStyle(7); | |
588 | tlin4->Draw("same"); | |
589 | TLatex* tlimit1=new TLatex(0.2,0.5,"Range for t0"); | |
590 | tlimit1->SetNDC(); | |
591 | tlimit1->SetTextColor(2); | |
592 | tlimit1->Draw(); | |
593 | TLine* tlin5=new TLine(6200.,0.,6200.,htimTne->GetMaximum()); | |
594 | tlin5->SetLineColor(2); | |
595 | tlin5->SetLineStyle(7); | |
596 | tlin5->SetLineWidth(2); | |
597 | tlin5->Draw("same"); | |
598 | TLine* tlin6=new TLine(5150.,0.,5150.,htimTne->GetMaximum()); | |
599 | tlin6->SetLineColor(2); | |
600 | tlin6->SetLineWidth(2); | |
601 | tlin6->SetLineStyle(7); | |
602 | tlin6->Draw("same"); | |
603 | TLatex* tlimit2=new TLatex(0.6,0.5,"Range for falling edge"); | |
604 | tlimit2->SetNDC(); | |
605 | tlimit2->SetTextColor(2); | |
606 | tlimit2->Draw(); | |
607 | ||
608 | // ctim->Update(); | |
609 | // TCanvas* cpars=new TCanvas("cpars","Params",800,600); | |
610 | ctim->cd(2); | |
611 | gPad->SetLeftMargin(0.14); | |
612 | gPad->SetFrameLineWidth(2); | |
613 | gPad->SetTickx(); | |
614 | gPad->SetTicky(); | |
615 | gmpv->SetMarkerStyle(20); | |
616 | gmpv->SetMinimum(75); | |
617 | gmpv->SetMaximum(90); | |
618 | gmpv->GetXaxis()->SetLimits(-0.2,6.8); | |
619 | gmpv->Draw("AP"); | |
620 | gmpv->GetXaxis()->SetTitle("Drift Time interval number"); | |
621 | gmpv->GetYaxis()->SetTitle("Landau MPV (keV)"); | |
622 | gmpv->GetXaxis()->SetTitleSize(0.05); | |
623 | gmpv->GetYaxis()->SetTitleSize(0.05); | |
624 | gmpv->GetYaxis()->SetTitleOffset(1.2); | |
625 | TLatex* tex=new TLatex(0.2,0.75,"dE/dx MPV vs Drift time interval"); | |
626 | tex->SetNDC(); | |
627 | tex->SetTextColor(1); | |
628 | tex->Draw(); | |
629 | // cpars->Update(); | |
630 | ctim->Update(); | |
631 | ctim->SaveAs("SDD.pdf"); | |
632 | pdfFileNames+=" SDD.pdf"; | |
633 | } | |
634 | ||
635 | //_______________________________________________________________________ | |
636 | //////////////// SSD /////////////////////// | |
637 | //_______________________________________________________________________ | |
638 | void GetGainModuleLevelSSD(TFile* fildat, TCanvas**& clist, Int_t& cnum) | |
639 | { | |
640 | gROOT->SetStyle("Plain"); | |
641 | gStyle->SetOptStat(1111); | |
642 | gStyle->SetPalette(1,0); | |
643 | cnum=1; | |
644 | clist=new TCanvas*[1]; | |
645 | ||
646 | TDirectoryFile* df=(TDirectoryFile*)fildat->Get("PWGPPdEdxSSDQA"); | |
647 | TList* listin=(TList*)df->Get("SSDdEdxQA"); | |
648 | if(!listin) return; | |
649 | TH2F* fHistQ=0x0; | |
650 | fHistQ=(TH2F*)listin ->FindObject("QACharge"); | |
651 | fHistQ->SetStats(111); | |
652 | fHistQ->SetTitle("SSD Charge vs module number"); | |
653 | if(!fHistQ) return; | |
654 | TH2F* fHistCR=(TH2F*)listin ->FindObject("QAChargeRatio"); | |
655 | fHistCR->SetStats(0); | |
656 | fHistCR->SetTitle("SSD Charge Ratio vs module number"); | |
657 | ||
658 | if(!fHistCR) return; | |
659 | ||
660 | TH1F* fHistMPVs=new TH1F("SSD HistMPVS","HistMPVs;MPV;N",75,70,95); | |
661 | ||
662 | TH1F* fHistCRmean=new TH1F("SSD HistCRmean","HistCRmean;CRmean;N",200,-1,1); | |
663 | ||
664 | TH1F *fMPVGraph = new TH1F("SSD MPV","MPVgraph;Module number;MPV",1698,-0.5,1697.5); | |
665 | fMPVGraph->SetMarkerColor(kRed); | |
666 | fMPVGraph->SetMarkerSize(0.5); | |
667 | fMPVGraph->SetMarkerStyle(22); | |
668 | fMPVGraph->SetStats(111111); | |
669 | ||
670 | TH1F *fCRmeanGraph = new TH1F("SSD CRmeangraph","CRmeangraph;Module number;MPV",1698,-0.5,1697.5); | |
671 | fCRmeanGraph->SetMarkerColor(kBlue); | |
672 | fCRmeanGraph->SetMarkerSize(0.5); | |
673 | fCRmeanGraph->SetMarkerStyle(23); | |
674 | fCRmeanGraph->SetStats(111111); | |
675 | ||
676 | Float_t mpv[1698]; | |
677 | Int_t ntofit=200; | |
678 | ||
679 | // ofstream outfiletxtbad; | |
680 | //outfiletxtbad.open("QALHC11eCPass1_bis/badModules.txt"); | |
681 | for (int i =0;i<1698;i++) | |
682 | { | |
683 | // cout<<i<<endl; | |
684 | TString tmpQ("Q"); | |
685 | tmpQ+=i; | |
686 | TString tmpCR("CR"); | |
687 | tmpCR+=i; | |
688 | TH1D* fHist1DCR= fHistCR->ProjectionY(tmpCR,i+1,i+1); | |
689 | Double_t mean=fHist1DCR->GetMean(); | |
690 | if(!(TMath::Abs(mean)<1.0)||fHist1DCR->GetEntries()<10) | |
691 | continue; | |
692 | fHistCRmean->Fill(mean); | |
693 | fCRmeanGraph->SetBinContent(i+1,mean); | |
694 | fCRmeanGraph->SetBinError(i+1,fHist1DCR->GetRMS()); | |
695 | fCRmeanGraph->GetYaxis()->SetTitle("CR"); | |
696 | TH1D* fHist1DQ=fHistQ->ProjectionY(tmpQ,i+1,i+1); | |
697 | //check bad modules | |
698 | if(fHist1DQ->GetEntries()<ntofit) | |
699 | { | |
700 | //outfiletxtbad<<"Low statistic \t module= "<<i<<" netries="<<fHist1DQ->GetEntries()<<endl; | |
701 | continue; | |
702 | } | |
703 | else | |
704 | { | |
705 | tmpQ+="fit"; | |
706 | Float_t range=fHist1DQ->GetBinCenter(fHist1DQ->GetMaximumBin()); | |
707 | TF1 *f1 = new TF1(tmpQ,LangausFun,range*0.45,range*3.0,4); | |
708 | f1->SetParameters(7.0,range,1.0,5.5); | |
709 | Float_t normalization=fHist1DQ->GetEntries()*fHist1DQ->GetXaxis()->GetBinWidth(2)/f1->Integral(range*0.45,range*3.0); | |
710 | f1->SetParameters(7.0,range,normalization,5.5); | |
711 | //f1->SetParameters(7.0,range,fHist1DQ->GetMaximum(),5.5); | |
712 | f1->SetParNames("sigma Landau","MPV","N","sigma Gaus"); | |
713 | f1->SetParLimits(0,2.0,100.0); | |
714 | f1->SetParLimits(3,0.0,100.0); | |
715 | if(fHist1DQ->Fit(tmpQ,"BRQON")==0) | |
716 | { | |
717 | mpv[i]=f1->GetParameter(1); | |
718 | fHistMPVs->Fill(mpv[i]); | |
719 | fMPVGraph->SetBinContent(i+1,f1->GetParameter(1)); | |
720 | fMPVGraph->SetBinError(i+1,f1->GetParError(1)); | |
721 | if(mpv[i]<75.0) | |
722 | { | |
723 | //outfiletxtbad<<"MPV lower than 75 \t module="<<i<<endl; | |
724 | } | |
725 | if(mpv[i]>100.0) | |
726 | { | |
727 | // outfiletxtbad<<"MPV higher than 100 \t module="<<i<<endl; | |
728 | } | |
729 | if(f1->GetParError(1)>1.0) | |
730 | { | |
731 | //outfiletxtbad<<"MPV high error on MPV \t module="<<i<<endl; | |
732 | } | |
733 | } | |
734 | else | |
735 | { | |
736 | mpv[i]=1; | |
737 | //outfiletxtbad<<"BAD FIT \t module="<<i<<endl; | |
738 | continue; | |
739 | } | |
740 | } | |
741 | } | |
742 | ||
743 | TString ctitle=GetRunNumber()+"SSD Calibration 1"; | |
744 | TCanvas *c1SSD = new TCanvas("c1SSD",ctitle,1000,1000); | |
745 | clist[0]=c1SSD; | |
746 | c1SSD->Divide(2,3); | |
747 | c1SSD->cd(1); | |
748 | fHistQ->DrawCopy("colz"); | |
749 | c1SSD->cd(2); | |
750 | fHistCR->DrawCopy("colz"); | |
751 | ||
752 | // TCanvas *c2SSD = new TCanvas("c2SSD","SSD Calibration 2",1000,1000); | |
753 | //clist[1]=c2SSD; | |
754 | //c2SSD->Divide(2,2); | |
755 | c1SSD->cd(3); | |
756 | // scala plot MPV | |
757 | fMPVGraph->SetMinimum(40); | |
758 | fMPVGraph->DrawCopy(); | |
759 | TLine* tlin0=new TLine(0.,78.,1698.,78.); | |
760 | tlin0->SetLineColor(2); | |
761 | tlin0->SetLineWidth(2); | |
762 | tlin0->Draw("same"); | |
763 | TLine* tlin01=new TLine(0.,88.,1698.,88.); | |
764 | tlin01->SetLineColor(2); | |
765 | tlin01->SetLineWidth(2); | |
766 | tlin01->Draw("same"); | |
767 | c1SSD->cd(4); | |
768 | fHistMPVs->DrawCopy(); | |
769 | c1SSD->cd(5); | |
770 | fCRmeanGraph->DrawCopy(); | |
771 | TLine* tlin1=new TLine(0.,0.2,1698.,0.2); | |
772 | tlin1->SetLineColor(2); | |
773 | tlin1->SetLineWidth(2); | |
774 | tlin1->Draw("same"); | |
775 | TLine* tlin2=new TLine(0.,-0.2,1698.,-0.2); | |
776 | tlin2->SetLineColor(2); | |
777 | tlin2->SetLineWidth(2); | |
778 | tlin2->Draw("same"); | |
779 | TLatex* ta1=new TLatex(0.2,0.8,"SSD Calibration"); | |
780 | ta1->SetNDC(); | |
781 | ta1->SetTextSize(0.05); | |
782 | ta1->SetTextColor(2); | |
783 | ta1->Draw("same"); | |
784 | c1SSD->cd(6); | |
785 | fHistCRmean->DrawCopy(); | |
786 | c1SSD->Update(); | |
787 | c1SSD->SaveAs("SSD.pdf"); | |
788 | pdfFileNames+=" SSD.pdf"; | |
789 | } | |
790 | ||
791 | //_______________________________________________________________________ | |
792 | void VertexQAMacro(TFile *fildat, TCanvas **&clist, Int_t &cnum){ | |
793 | ||
794 | TDirectoryFile *dir = (TDirectoryFile*)fildat->Get("Vertex_Performance"); | |
795 | if(!dir){ | |
796 | Printf("Vertex directory not found... check!"); | |
797 | } | |
798 | ||
799 | TList *lt = (TList*)dir->Get("cOutputVtxESD"); | |
800 | ||
801 | cnum = 1; | |
802 | clist = new TCanvas*[1]; | |
803 | ||
804 | ||
805 | TH1F *xVtxSPD = (TH1F*)lt->FindObject("fhSPDVertexX"); | |
806 | TH1F *yVtxSPD = (TH1F*)lt->FindObject("fhSPDVertexY"); | |
807 | TH1F *zVtxSPD = (TH1F*)lt->FindObject("fhSPDVertexZ"); | |
808 | ||
809 | TH1F *zVtxSPD_Zonly = (TH1F*)lt->FindObject("fhSPDVertexZonly"); | |
810 | ||
811 | if(!zVtxSPD_Zonly){ | |
812 | Printf("using SPD 3D histo, Zonly not available"); | |
813 | zVtxSPD_Zonly = (TH1F*)lt->FindObject("fhSPDVertexZ"); | |
814 | } | |
815 | ||
816 | TH1F *xVtxTRK = (TH1F*)lt->FindObject("fhTRKVertexX"); | |
817 | TH1F *yVtxTRK = (TH1F*)lt->FindObject("fhTRKVertexY"); | |
818 | TH1F *zVtxTRK = (TH1F*)lt->FindObject("fhTRKVertexZ"); | |
819 | ||
820 | TH2F *hntrksSPDvsSPDcls = (TH2F*)lt->FindObject("fhntrksSPDvsSPDcls"); | |
821 | TH2F *hntrksZvsSPDcls = (TH2F*)lt->FindObject("fhntrksZvsSPDcls"); | |
822 | ||
823 | Bool_t histoCorelation = kTRUE; | |
824 | ||
825 | if(!hntrksZvsSPDcls){ | |
826 | Printf("skipping the second part, no 2D histos available"); | |
827 | histoCorelation=kFALSE; | |
828 | } | |
829 | ||
830 | TString ctitle=GetRunNumber()+"TRKandSPD3DxVtx"; | |
831 | TCanvas *TRK_SPD3D_Vtx = new TCanvas("TRKandSPD3DVtx",ctitle,1000,1000); | |
832 | TRK_SPD3D_Vtx->Divide(3,2); | |
833 | clist[0]=TRK_SPD3D_Vtx; | |
834 | gStyle->SetOptFit(111); | |
835 | ||
836 | TRK_SPD3D_Vtx->cd(1); | |
837 | xVtxSPD->SetMarkerStyle(20); | |
838 | xVtxSPD->SetLineWidth(3); | |
839 | xVtxSPD->SetMarkerColor(kBlue+2); | |
840 | TF1 *fx = new TF1("gaus", "gaus", -1, 1); | |
841 | xVtxTRK->SetMarkerStyle(20); | |
842 | xVtxTRK->SetLineWidth(4); | |
843 | xVtxTRK->SetLineColor(2); | |
844 | xVtxTRK->Draw("PE"); | |
845 | xVtxTRK->Fit("gaus", "M"); | |
846 | xVtxSPD->Draw("PE SAME"); | |
847 | xVtxTRK->GetXaxis()->SetRangeUser(-0.10, 0.25); | |
848 | xVtxSPD->GetXaxis()->SetRangeUser(-0.10, 0.25); | |
849 | ||
850 | TLatex* tVTX1=new TLatex(0.15,0.85,"VertexSPD"); | |
851 | tVTX1->SetNDC(); | |
852 | tVTX1->SetTextColor(kBlue+2); | |
853 | tVTX1->Draw(); | |
854 | TLatex* tVTX2=new TLatex(0.15,0.8,"VertexTRK"); | |
855 | tVTX2->SetNDC(); | |
856 | tVTX2->SetTextColor(2); | |
857 | tVTX2->Draw(); | |
858 | ||
859 | TRK_SPD3D_Vtx->cd(2); | |
860 | yVtxSPD->SetMarkerStyle(20); | |
861 | yVtxSPD->SetLineWidth(3); | |
862 | yVtxSPD->SetMarkerColor(kBlue+2); | |
863 | TF1 *fy = new TF1("gaus", "gaus", -1, 1); | |
864 | yVtxTRK->SetMarkerStyle(20); | |
865 | yVtxTRK->SetLineWidth(3); | |
866 | yVtxTRK->SetLineColor(2); | |
867 | yVtxTRK->Draw("PE"); | |
868 | yVtxTRK->Fit("gaus", "M"); | |
869 | yVtxSPD->Draw("PE SAME"); | |
870 | yVtxTRK->GetXaxis()->SetRangeUser(0.1, 0.5); | |
871 | yVtxSPD->GetXaxis()->SetRangeUser(0.1, 0.5); | |
872 | ||
873 | TLatex* tVTX3=new TLatex(0.15,0.85,"VertexSPD"); | |
874 | tVTX3->SetNDC(); | |
875 | tVTX3->SetTextColor(kBlue+2); | |
876 | tVTX3->Draw(); | |
877 | TLatex* tVTX4=new TLatex(0.15,0.8,"VertexTRK"); | |
878 | tVTX4->SetNDC(); | |
879 | tVTX4->SetTextColor(2); | |
880 | tVTX4->Draw(); | |
881 | ||
882 | ||
883 | ||
884 | TRK_SPD3D_Vtx->cd(3); | |
885 | ||
886 | TF1 *fz = new TF1("gaus", "gaus", -20, 20); | |
887 | zVtxTRK->SetMarkerStyle(20); | |
888 | zVtxTRK->SetLineWidth(3); | |
889 | zVtxTRK->SetMarkerColor(2); | |
890 | zVtxTRK->SetLineColor(2); | |
891 | zVtxTRK->Fit("gaus", "M"); | |
892 | zVtxSPD->SetMarkerStyle(20); | |
893 | zVtxSPD->SetLineWidth(1); | |
894 | zVtxSPD->SetLineColor(kBlue+2); | |
895 | zVtxSPD->SetMarkerColor(kBlue+2); | |
896 | zVtxSPD->SetMarkerSize(0.8); | |
897 | zVtxSPD->Draw("PE"); | |
898 | zVtxTRK->Draw("PE SAME"); | |
899 | ||
900 | TLatex* tVTX5=new TLatex(0.15,0.85,"VertexSPD"); | |
901 | tVTX5->SetNDC(); | |
902 | tVTX5->SetTextColor(kBlue+2); | |
903 | tVTX5->Draw(); | |
904 | TLatex* tVTX6=new TLatex(0.15,0.8,"VertexTRK"); | |
905 | tVTX6->SetNDC(); | |
906 | tVTX6->SetTextColor(2); | |
907 | tVTX6->Draw(); | |
908 | ||
909 | ||
910 | ||
911 | // TCanvas *corrContrSPDClusters = new TCanvas("corrContrSPDClusters", "corrContrSPDClusters"); | |
912 | // corrContrSPDClusters->Divide(3,1); | |
913 | //clist[1]=corrContrSPDClusters; | |
914 | TRK_SPD3D_Vtx->cd(4); | |
915 | // corrContrSPDClusters->cd(1); | |
916 | zVtxSPD_Zonly->SetLineWidth(3); | |
917 | zVtxSPD_Zonly->SetLineColor(kBlue+2); | |
918 | zVtxSPD_Zonly->Draw(); | |
919 | TLatex* tVTX7=new TLatex(0.15,0.8,"Vertex Z only"); | |
920 | tVTX7->SetNDC(); | |
921 | tVTX7->SetTextColor(2); | |
922 | tVTX7->Draw(); | |
923 | ||
924 | if(histoCorelation){ | |
925 | TRK_SPD3D_Vtx->cd(5); | |
926 | //corrContrSPDClusters->cd(2); | |
927 | hntrksSPDvsSPDcls->SetMarkerStyle(20); | |
928 | hntrksSPDvsSPDcls->GetXaxis()->SetRangeUser(0.,400); | |
929 | hntrksSPDvsSPDcls->GetYaxis()->SetRangeUser(0.,4500.); | |
930 | hntrksSPDvsSPDcls->Draw(); | |
931 | ||
932 | TRK_SPD3D_Vtx->cd(6); | |
933 | // corrContrSPDClusters->cd(3); | |
934 | hntrksZvsSPDcls->SetMarkerStyle(20); | |
935 | hntrksZvsSPDcls->GetXaxis()->SetRangeUser(0.,150.); | |
936 | hntrksZvsSPDcls->GetYaxis()->SetRangeUser(0.,1000.); | |
937 | hntrksZvsSPDcls->Draw(); | |
938 | } | |
939 | TRK_SPD3D_Vtx->SaveAs("vertex.pdf"); | |
940 | pdfFileNames+=" vertex.pdf"; | |
941 | delete fx; | |
942 | delete fy; | |
943 | delete fz; | |
944 | } | |
945 | ||
946 | //_______________________________________________________________________ | |
947 | void PlotSPD(TFile *fildat, TFile *filMC, TCanvas **&clist, Int_t &cnum){ | |
948 | ||
949 | gROOT->SetStyle("Plain"); | |
950 | gStyle->SetPalette(1); | |
951 | gStyle->SetOptStat(0); | |
952 | gStyle->SetOptFit(111); | |
953 | cnum=2; // number of canvases | |
954 | clist= new TCanvas* [2];//array of pointers to TCanvases | |
955 | ||
956 | TDirectoryFile *spddata = (TDirectoryFile*)fildat->Get("SPD_Performance"); | |
957 | spddata->cd(); | |
958 | TList *fListData = (TList*)spddata->Get("coutput1"); | |
959 | ||
960 | TString fTitleData = "Data"; | |
961 | TString fTitleMc = "MC"; | |
962 | ||
963 | ||
964 | Double_t nevtsData = ((TH1I*)(fListData->FindObject("hEventsProcessed")))->GetEntries(); | |
965 | printf(" #events in %s : %f \n",fTitleData.Data(),nevtsData); | |
966 | ||
967 | TDirectoryFile *spdmc = (TDirectoryFile*)filMC->Get("SPD_Performance"); | |
968 | spdmc->cd(); | |
969 | TList *fListMc = (TList*)spdmc->Get("coutput1"); | |
970 | Double_t nevtsMc = ((TH1I*)(fListMc->FindObject("hEventsProcessed")))->GetEntries(); | |
971 | printf(" #events in %s : %f \n",fTitleMc.Data(),nevtsMc); | |
972 | ||
973 | TH2F *trackData = (TH2F*)fListData->FindObject("hSPDphivsSPDeta"); | |
974 | trackData->SetTitle(Form("%s %s",trackData->GetTitle(),fTitleData.Data())); | |
975 | TH1D *trackDataPhi = trackData->ProjectionY(); | |
976 | if(!trackDataPhi) printf("NO 1 \n"); | |
977 | ||
978 | trackDataPhi->SetTitle("Tracklets vs Phi"); | |
979 | TH1D *trackDataEta = trackData->ProjectionX(); | |
980 | if(!trackDataEta) printf("NO 2 \n"); | |
981 | trackDataEta->SetTitle("Tracklets vs eta"); | |
982 | ||
983 | TH1F etaData, phiData; | |
984 | trackDataEta->Copy(etaData); | |
985 | trackDataPhi->Copy(phiData); | |
986 | ||
987 | TH1F etaFrac, phiFrac, mcEta, mcPhi; | |
988 | trackDataEta->Copy(etaFrac); | |
989 | trackDataPhi->Copy(phiFrac); | |
990 | ||
991 | TH2F *trackMc = (TH2F*)fListMc->FindObject("hSPDphivsSPDeta"); | |
992 | trackMc->SetTitle(Form("%s %s",trackMc->GetTitle(),fTitleMc.Data())); | |
993 | ||
994 | TString ctitle = GetRunNumber()+"tracklets"; | |
995 | TCanvas *tracklets = new TCanvas("tracklets",ctitle,1200,600); | |
996 | clist[0]=tracklets; | |
997 | tracklets->Divide(2,1); | |
998 | tracklets->cd(1); | |
999 | tracklets->cd(1)->SetRightMargin(0.15); | |
1000 | trackData->SetTitle(Form("Run %d",gRunNumber)); | |
1001 | trackData->DrawCopy("colz"); | |
1002 | tracklets->cd(2); | |
1003 | tracklets->cd(2)->SetRightMargin(0.15); | |
1004 | trackMc->SetTitle(Form("REF Run %d",gRunNumberMC)); | |
1005 | TH1D *h = (TH1D*)trackMc->DrawCopy("colz"); | |
1006 | tracklets->SaveAs("SPDtracklets.pdf"); | |
1007 | pdfFileNames+=" SPDtracklets.pdf"; | |
1008 | ||
1009 | TH1D *trackMcPhi = trackMc->ProjectionY(); | |
1010 | trackMcPhi->SetTitle(Form("%s",h->GetTitle())); | |
1011 | TH1D *trackMcEta = trackMc->ProjectionX(); | |
1012 | trackMcEta->SetTitle(Form("%s",h->GetTitle())); | |
1013 | ||
1014 | TH1F etaMc, phiMc; | |
1015 | trackMcEta->Copy(etaMc); | |
1016 | trackMcPhi->Copy(phiMc); | |
1017 | ||
1018 | trackMcEta->Copy(mcEta); | |
1019 | trackMcPhi->Copy(mcPhi); | |
1020 | ||
1021 | etaFrac.Scale(1./etaFrac.GetEntries()); | |
1022 | mcEta.Scale(1./mcEta.GetEntries()); | |
1023 | etaFrac.Add(&mcEta,-1); | |
1024 | etaFrac.Divide(&mcEta); | |
1025 | ||
1026 | phiFrac.Scale(1./phiFrac.GetEntries()); | |
1027 | mcPhi.Scale(1./mcPhi.GetEntries()); | |
1028 | phiFrac.Add(&mcPhi,-1); | |
1029 | phiFrac.Divide(&mcPhi); | |
1030 | ||
1031 | ctitle = GetRunNumber()+"tracklets and ratios vs eta and phi"; | |
1032 | TCanvas *track = new TCanvas("track",ctitle,1200,1200); | |
1033 | clist[1]=track; | |
1034 | track->Divide(2,2); | |
1035 | track->cd(1); | |
1036 | phiData.SetLineColor(kRed); | |
1037 | phiData.SetLineWidth(2); | |
1038 | phiData.Scale(1./phiData.GetEntries()); | |
1039 | phiData.DrawCopy(); | |
1040 | phiMc.Scale(1./phiMc.GetEntries()); | |
1041 | TLatex* tphi=new TLatex(0.15,0.15,Form("Red = %d; Blue (ref) = %d",gRunNumber,gRunNumberMC)); | |
1042 | tphi->SetNDC(); | |
1043 | tphi->SetTextSize(0.04); | |
1044 | tphi->SetTextColor(1); | |
1045 | tphi->Draw(); | |
1046 | phiMc.DrawCopy("same"); | |
1047 | track->cd(2); | |
1048 | etaData.SetLineColor(kRed); | |
1049 | etaData.SetLineWidth(2); | |
1050 | etaData.Scale(1./etaData.GetEntries()); | |
1051 | etaData.DrawCopy(); | |
1052 | etaMc.Scale(1./etaMc.GetEntries()); | |
1053 | tphi->Draw(); | |
1054 | etaMc.DrawCopy("same"); | |
1055 | track->cd(3); | |
1056 | phiFrac.SetLineColor(1); | |
1057 | TLatex* tratio=new TLatex(0.2,0.85,Form("Run %d / REF Run %d",gRunNumber,gRunNumberMC)); | |
1058 | tratio->SetNDC(); | |
1059 | tratio->SetTextColor(1); | |
1060 | phiFrac.DrawCopy(); | |
1061 | tratio->Draw(); | |
1062 | track->cd(4); | |
1063 | etaFrac.SetLineColor(1); | |
1064 | etaFrac.DrawCopy(); | |
1065 | tratio->Draw(); | |
1066 | track->SaveAs("SPD_eta_phi.pdf"); | |
1067 | pdfFileNames+=" SPD_eta_phi.pdf"; | |
1068 | } | |
1069 | ||
1070 | //_______________________________________________________________________ | |
1071 | Bool_t PlotITSTPCMatchingEff(TFile *f, TCanvas**& clist,Int_t& cnum) { | |
1072 | ||
1073 | cnum=1; | |
1074 | clist = new TCanvas*[1]; | |
1075 | ||
1076 | // clist = new TCanvas* [1]; | |
1077 | TString ctitle = GetRunNumber()+"ITS-TPC match"; | |
1078 | TCanvas* cITSTPCmatch = new TCanvas("cITSTPCmatch",ctitle,10,10,800,600); | |
1079 | clist[0]=cITSTPCmatch; | |
1080 | // cITSTPCmatch->Divide(2,1); | |
1081 | // cITSTPCmatch->cd(1); | |
1082 | gPad->SetGridy(); | |
1083 | gPad->SetLogx(); | |
1084 | // cITSTPCmatch->cd(2); | |
1085 | // gPad->SetGridy(); | |
1086 | // gPad->SetLogx(); | |
1087 | ||
1088 | // clist = cITSTPCmatch; | |
1089 | ||
1090 | if(!f) return kFALSE; | |
1091 | ||
1092 | TList *list=0; | |
1093 | TList *listSPD=0; | |
1094 | TDirectoryFile *dir=0; | |
1095 | ||
1096 | // count active SPD HSs | |
1097 | dir=(TDirectoryFile*)f->GetDirectory("SPD_Performance"); | |
1098 | if(dir) listSPD = (TList*)dir->Get("coutput1"); | |
1099 | if(!dir) return kFALSE; | |
1100 | ||
1101 | Float_t spdFrac[2]={0.,0.}; | |
1102 | TH1F *hnHSsSPD=new TH1F("hnHSsSPD","Active HSs in SPD layers 1 and 2; layer; HSs",2,0.5,2.5); | |
1103 | if(listSPD) { | |
1104 | //listSPD->Print(); | |
1105 | TH1F *hFiredChip = (TH1F*)listSPD->FindObject("hFiredChip"); | |
1106 | Int_t nHSsInner=0,nHSsOuter=0; | |
1107 | for(Int_t i=0;i<400;i++) if(hFiredChip->GetBinContent(i)>0) nHSsInner++; | |
1108 | for(Int_t i=400;i<1200;i++) if(hFiredChip->GetBinContent(i)>0) nHSsOuter++; | |
1109 | nHSsInner = (Int_t)(nHSsInner/10); | |
1110 | nHSsOuter = (Int_t)(nHSsOuter/10); | |
1111 | hnHSsSPD->SetBinContent(1,nHSsInner); | |
1112 | hnHSsSPD->SetBinContent(2,nHSsOuter); | |
1113 | spdFrac[0]=(Float_t)nHSsInner/40.; | |
1114 | spdFrac[1]=(Float_t)nHSsOuter/80.; | |
1115 | } | |
1116 | TGraph *spdFrac0=new TGraph(1); | |
1117 | spdFrac0->SetPoint(0,0.08,spdFrac[0]); | |
1118 | spdFrac0->SetMarkerColor(1); spdFrac0->SetMarkerStyle(20); | |
1119 | TGraph *spdFrac1=new TGraph(1); | |
1120 | spdFrac1->SetPoint(0,0.08,spdFrac[1]); | |
1121 | spdFrac1->SetMarkerColor(1); spdFrac1->SetMarkerStyle(24); | |
1122 | TLegend *l2=new TLegend(0.1,0.62,0.5,0.93); | |
1123 | l2->SetBorderSize(1); | |
1124 | l2->AddEntry(spdFrac0,"Frac. active SPD0","p"); | |
1125 | l2->AddEntry(spdFrac1,"Frac. active SPD1","p"); | |
1126 | ||
1127 | // | |
1128 | // Efficiencies for CENTRAL | |
1129 | // | |
1130 | dir=(TDirectoryFile*)f->GetDirectory("ITS_Performance"); | |
1131 | if(dir) list = (TList*)dir->Get("cOutputITS"); | |
1132 | if(!list) return kFALSE; | |
1133 | ||
1134 | TH1F *fHistPtTPCInAcc = (TH1F*)list->FindObject("fHistPtTPCInAcc"); | |
1135 | TH1F *fHistPtITSMI6InAcc = (TH1F*)list->FindObject("fHistPtITSMI6InAcc"); | |
1136 | TH1F *fHistPtITSMI5InAcc = (TH1F*)list->FindObject("fHistPtITSMI5InAcc"); | |
1137 | TH1F *fHistPtITSMI4InAcc = (TH1F*)list->FindObject("fHistPtITSMI4InAcc"); | |
1138 | TH1F *fHistPtITSMI3InAcc = (TH1F*)list->FindObject("fHistPtITSMI3InAcc"); | |
1139 | TH1F *fHistPtITSMI2InAcc = (TH1F*)list->FindObject("fHistPtITSMI2InAcc"); | |
1140 | TH1F *fHistPtITSMISPDInAcc = (TH1F*)list->FindObject("fHistPtITSMISPDInAcc"); | |
1141 | TH1F *fHistPtITSMIoneSPDInAcc = (TH1F*)list->FindObject("fHistPtITSMIoneSPDInAcc"); | |
1142 | TH1F *fHistPtITSTPCsel = (TH1F*)list->FindObject("fHistPtITSTPCsel"); | |
1143 | TH1F *fHistPtITSMIge2InAcc = (TH1F*)fHistPtITSMI6InAcc->Clone("fHistPtITSMIge2InAcc"); | |
1144 | fHistPtITSMIge2InAcc->Add(fHistPtITSMI5InAcc); | |
1145 | fHistPtITSMIge2InAcc->Add(fHistPtITSMI4InAcc); | |
1146 | fHistPtITSMIge2InAcc->Add(fHistPtITSMI3InAcc); | |
1147 | fHistPtITSMIge2InAcc->Add(fHistPtITSMI2InAcc); | |
1148 | ||
1149 | ||
1150 | TLegend *l3=new TLegend(0.5,0.62,0.95,0.93); | |
1151 | l3->SetBorderSize(1); | |
1152 | // cITSTPCmatch->cd(1); | |
1153 | fHistPtITSMIge2InAcc->SetTitle("Fraction of prolonged tracks with N ITS points"); | |
1154 | fHistPtITSMIge2InAcc->SetYTitle("ITS+TPC / TPC"); | |
1155 | fHistPtITSMIge2InAcc->Divide(fHistPtITSMIge2InAcc,fHistPtTPCInAcc,1,1,"B"); | |
1156 | fHistPtITSMIge2InAcc->SetMaximum(1.6); | |
1157 | fHistPtITSMIge2InAcc->SetMinimum(0); | |
1158 | fHistPtITSMIge2InAcc->GetXaxis()->SetRangeUser(0.1,30); | |
1159 | fHistPtITSMIge2InAcc->Draw(); | |
1160 | l3->AddEntry(fHistPtITSMIge2InAcc,">=2 cls","l"); | |
1161 | fHistPtITSMI6InAcc->Divide(fHistPtITSMI6InAcc,fHistPtTPCInAcc,1,1,"B"); | |
1162 | fHistPtITSMI6InAcc->SetLineColor(2); | |
1163 | l3->AddEntry(fHistPtITSMI6InAcc,"6 cls","l"); | |
1164 | fHistPtITSMI6InAcc->Draw("same"); | |
1165 | fHistPtITSMI5InAcc->Divide(fHistPtITSMI5InAcc,fHistPtTPCInAcc,1,1,"B"); | |
1166 | fHistPtITSMI5InAcc->SetLineColor(3); | |
1167 | l3->AddEntry(fHistPtITSMI5InAcc,"5 cls","l"); | |
1168 | fHistPtITSMI5InAcc->Draw("same"); | |
1169 | fHistPtITSMI4InAcc->Divide(fHistPtITSMI4InAcc,fHistPtTPCInAcc,1,1,"B"); | |
1170 | fHistPtITSMI4InAcc->SetLineColor(4); | |
1171 | l3->AddEntry(fHistPtITSMI4InAcc,"4 cls","l"); | |
1172 | fHistPtITSMI4InAcc->Draw("same"); | |
1173 | fHistPtITSMI3InAcc->Divide(fHistPtITSMI3InAcc,fHistPtTPCInAcc,1,1,"B"); | |
1174 | fHistPtITSMI3InAcc->SetLineColor(6); | |
1175 | l3->AddEntry(fHistPtITSMI3InAcc,"3 cls","l"); | |
1176 | fHistPtITSMI3InAcc->Draw("same"); | |
1177 | fHistPtITSMI2InAcc->Divide(fHistPtITSMI2InAcc,fHistPtTPCInAcc,1,1,"B"); | |
1178 | fHistPtITSMI2InAcc->SetLineColor(7); | |
1179 | l3->AddEntry(fHistPtITSMI2InAcc,"2 cls","l"); | |
1180 | fHistPtITSMI2InAcc->Draw("same"); | |
1181 | fHistPtITSMISPDInAcc->Divide(fHistPtITSMISPDInAcc,fHistPtTPCInAcc,1,1,"B"); | |
1182 | fHistPtITSMISPDInAcc->SetLineColor(9); | |
1183 | l3->AddEntry(fHistPtITSMISPDInAcc,"2SPD + any","l"); | |
1184 | fHistPtITSMISPDInAcc->Draw("same"); | |
1185 | fHistPtITSMIoneSPDInAcc->Divide(fHistPtITSMIoneSPDInAcc,fHistPtTPCInAcc,1,1,"B"); | |
1186 | fHistPtITSMIoneSPDInAcc->SetLineColor(15); | |
1187 | l3->AddEntry(fHistPtITSMIoneSPDInAcc,">=1SPD + any","l"); | |
1188 | fHistPtITSMIoneSPDInAcc->Draw("same"); | |
1189 | fHistPtITSTPCsel->Divide(fHistPtITSTPCsel,fHistPtTPCInAcc,1,1,"B"); | |
1190 | fHistPtITSTPCsel->SetLineColor(kAzure+1); | |
1191 | l3->AddEntry(fHistPtITSTPCsel,">=1SPD + any + d_{0} cut","l"); | |
1192 | fHistPtITSTPCsel->Draw("same"); | |
1193 | fHistPtITSMIge2InAcc->Draw("same"); | |
1194 | l3->Draw(); | |
1195 | l2->Draw(); | |
1196 | spdFrac0->Draw("p"); | |
1197 | spdFrac1->Draw("p"); | |
1198 | ||
1199 | // | |
1200 | // Efficiencies for PERIPHERAL | |
1201 | // | |
1202 | dir=(TDirectoryFile*)f->GetDirectory("ITS_Performance"); | |
1203 | if(dir) list = (TList*)dir->Get("cOutputITS"); | |
1204 | if(!list) return kFALSE; | |
1205 | ||
1206 | fHistPtTPCInAcc = (TH1F*)list->FindObject("fHistPtTPCInAcc"); | |
1207 | fHistPtITSMI6InAcc = (TH1F*)list->FindObject("fHistPtITSMI6InAcc"); | |
1208 | fHistPtITSMI5InAcc = (TH1F*)list->FindObject("fHistPtITSMI5InAcc"); | |
1209 | fHistPtITSMI4InAcc = (TH1F*)list->FindObject("fHistPtITSMI4InAcc"); | |
1210 | fHistPtITSMI3InAcc = (TH1F*)list->FindObject("fHistPtITSMI3InAcc"); | |
1211 | fHistPtITSMI2InAcc = (TH1F*)list->FindObject("fHistPtITSMI2InAcc"); | |
1212 | fHistPtITSMISPDInAcc = (TH1F*)list->FindObject("fHistPtITSMISPDInAcc"); | |
1213 | fHistPtITSMIoneSPDInAcc = (TH1F*)list->FindObject("fHistPtITSMIoneSPDInAcc"); | |
1214 | fHistPtITSTPCsel = (TH1F*)list->FindObject("fHistPtITSTPCsel"); | |
1215 | fHistPtITSMIge2InAcc = (TH1F*)fHistPtITSMI6InAcc->Clone("fHistPtITSMIge2InAcc"); | |
1216 | fHistPtITSMIge2InAcc->Add(fHistPtITSMI5InAcc); | |
1217 | fHistPtITSMIge2InAcc->Add(fHistPtITSMI4InAcc); | |
1218 | fHistPtITSMIge2InAcc->Add(fHistPtITSMI3InAcc); | |
1219 | fHistPtITSMIge2InAcc->Add(fHistPtITSMI2InAcc); | |
1220 | ||
1221 | ||
1222 | // cITSTPCmatch->cd(2); | |
1223 | // fHistPtITSMIge2InAcc->SetTitle("Fraction of prolonged tracks with N ITS points: peripheral"); | |
1224 | // fHistPtITSMIge2InAcc->SetYTitle("ITS+TPC / TPC"); | |
1225 | // fHistPtITSMIge2InAcc->Divide(fHistPtITSMIge2InAcc,fHistPtTPCInAcc,1,1,"B"); | |
1226 | // fHistPtITSMIge2InAcc->SetMaximum(1.6); | |
1227 | // fHistPtITSMIge2InAcc->SetMinimum(0); | |
1228 | // fHistPtITSMIge2InAcc->GetXaxis()->SetRangeUser(0.1,30); | |
1229 | // fHistPtITSMIge2InAcc->Draw(); | |
1230 | // fHistPtITSMI6InAcc->Divide(fHistPtITSMI6InAcc,fHistPtTPCInAcc,1,1,"B"); | |
1231 | // fHistPtITSMI6InAcc->SetLineColor(2); | |
1232 | // fHistPtITSMI6InAcc->Draw("same"); | |
1233 | // fHistPtITSMI5InAcc->Divide(fHistPtITSMI5InAcc,fHistPtTPCInAcc,1,1,"B"); | |
1234 | // fHistPtITSMI5InAcc->SetLineColor(3); | |
1235 | // fHistPtITSMI5InAcc->Draw("same"); | |
1236 | // fHistPtITSMI4InAcc->Divide(fHistPtITSMI4InAcc,fHistPtTPCInAcc,1,1,"B"); | |
1237 | // fHistPtITSMI4InAcc->SetLineColor(4); | |
1238 | // fHistPtITSMI4InAcc->Draw("same"); | |
1239 | // fHistPtITSMI3InAcc->Divide(fHistPtITSMI3InAcc,fHistPtTPCInAcc,1,1,"B"); | |
1240 | // fHistPtITSMI3InAcc->SetLineColor(6); | |
1241 | // fHistPtITSMI3InAcc->Draw("same"); | |
1242 | // fHistPtITSMI2InAcc->Divide(fHistPtITSMI2InAcc,fHistPtTPCInAcc,1,1,"B"); | |
1243 | // fHistPtITSMI2InAcc->SetLineColor(7); | |
1244 | // fHistPtITSMI2InAcc->Draw("same"); | |
1245 | // fHistPtITSMISPDInAcc->Divide(fHistPtITSMISPDInAcc,fHistPtTPCInAcc,1,1,"B"); | |
1246 | // fHistPtITSMISPDInAcc->SetLineColor(9); | |
1247 | // fHistPtITSMISPDInAcc->Draw("same"); | |
1248 | // fHistPtITSMIoneSPDInAcc->Divide(fHistPtITSMIoneSPDInAcc,fHistPtTPCInAcc,1,1,"B"); | |
1249 | // fHistPtITSMIoneSPDInAcc->SetLineColor(15); | |
1250 | // fHistPtITSMIoneSPDInAcc->Draw("same"); | |
1251 | // fHistPtITSTPCsel->Divide(fHistPtITSTPCsel,fHistPtTPCInAcc,1,1,"B"); | |
1252 | // fHistPtITSTPCsel->SetLineColor(kAzure+1); | |
1253 | // fHistPtITSTPCsel->Draw("same"); | |
1254 | // fHistPtITSMIge2InAcc->Draw("same"); | |
1255 | // l3->Draw(); | |
1256 | // l2->Draw(); | |
1257 | // spdFrac0->Draw("p"); | |
1258 | // spdFrac1->Draw("p"); | |
1259 | cITSTPCmatch->SaveAs("TPCITSmatching.pdf"); | |
1260 | pdfFileNames+=" TPCITSmatching.pdf"; | |
1261 | return kTRUE; | |
1262 | } | |
1263 | ||
1264 | //_______________________________________________________________________ | |
1265 | void SaveC(TFile &fout, TCanvas**& clist, Int_t cnum){ | |
1266 | TDirectory *current = gDirectory; | |
1267 | fout.cd(); | |
1268 | for(Int_t i=0;i<cnum;i++)clist[i]->Write(); | |
1269 | delete[] clist; | |
1270 | current->cd(); | |
1271 | } | |
1272 | ||
1273 | //_______________________________________________________________________ | |
1274 | TString GetRunNumber(){ | |
1275 | // returns a string with the run number | |
1276 | char rn[10]; | |
1277 | sprintf(rn,"%d ",gRunNumber); | |
1278 | TString str(rn); | |
1279 | return str; | |
1280 | } |