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