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