1 #if !defined(__CINT__) || defined(__MAKECINT__)
6 #include <TGraphErrors.h>
15 #include "AliITSgeomTGeo.h"
18 Double_t LangausFun(Double_t *x, Double_t *par) {
21 //par[0]=Width (scale) parameter of Landau density
22 //par[1]=Most Probable (MP, location) parameter of Landau density
23 //par[2]=Total area (integral -inf to inf, normalization constant)
24 //par[3]=Width (sigma) of convoluted Gaussian function
26 //In the Landau distribution (represented by the CERNLIB approximation),
27 //the maximum is located at x=-0.22278298 with the location parameter=0.
28 //This shift is corrected within this function, so that the actual
29 //maximum is identical to the MP parameter.
32 Double_t invsq2pi = 0.3989422804014; // (2 pi)^(-1/2)
33 Double_t mpshift = -0.22278298; // Landau maximum location
36 Double_t np = 100.0; // number of convolution steps
37 Double_t sc = 5.0; // convolution extends to +-sc Gaussian sigmas
49 // MP shift correction
50 mpc = par[1] - mpshift * par[0];
52 // Range of convolution integral
53 xlow = x[0] - sc * par[3];
54 xupp = x[0] + sc * par[3];
56 step = (xupp-xlow) / np;
58 // Convolution integral of Landau and Gaussian by sum
59 for(i=1.0; i<=np/2; i++) {
60 xx = xlow + (i-.5) * step;
61 fland = TMath::Landau(xx,mpc,par[0]) / par[0];
62 sum += fland * TMath::Gaus(x[0],xx,par[3]);
64 xx = xupp - (i-.5) * step;
65 fland = TMath::Landau(xx,mpc,par[0]) / par[0];
66 sum += fland * TMath::Gaus(x[0],xx,par[3]);
69 return (par[2] * step * sum * invsq2pi / par[3]);
73 void PlotSDDPerformance(TString option="local", TString period="", Int_t nRun=0){
74 gStyle->SetOptStat(0);
75 // gStyle->SetOptTitle(0);
78 if(option.Contains("local")){
79 fileName=Form("./AnalysisResults.root");
80 //fileName=Form("./SDD.Performance.114786.root");
81 f=new TFile(fileName.Data());
83 fileName=Form("alien:///alice/data/2010/%s/%09d/ESDs/pass2/QA10/QAresults.root",period.Data(),nRun);
84 TGrid::Connect("alien:");
85 f=TFile::Open(fileName.Data());
87 TDirectoryFile* df=(TDirectoryFile*)f->Get("SDD_Performance");
89 printf("SDD_Performance MISSING -> Exit\n");
92 TList* l=(TList*)df->Get("coutputRP");
94 printf("coutputRP TList MISSING -> Exit\n");
98 TH1F* hapmod=(TH1F*)l->FindObject("hAllPmod");
99 TH1F* hgpmod=(TH1F*)l->FindObject("hGoodPmod");
100 TH1F* hmpmod=(TH1F*)l->FindObject("hMissPmod");
101 TH1F* hbrmod=(TH1F*)l->FindObject("hBadRegmod");
102 TH1F* hskmod=(TH1F*)l->FindObject("hSkippedmod");
103 TH1F* hoamod=(TH1F*)l->FindObject("hOutAccmod");
104 TH1F* hnrmod=(TH1F*)l->FindObject("hNoRefitmod");
106 TH2F* hdedx3=(TH2F*)l->FindObject("hdEdxL3VsP");
107 TH2F* hdedx4=(TH2F*)l->FindObject("hdEdxL4VsP");
108 TH2F* hdedxmod=(TH2F*)l->FindObject("hdEdxVsMod");
111 TH1F* hmodR=(TH1F*)l->FindObject("hRPMod");
112 TH1F* hmodT=(TH1F*)l->FindObject("hTPMod");
113 TH1F* hgamod=(TH1F*)l->FindObject("hGAMod");
115 TH2F* h2dmodR3=new TH2F("h2dmodR3","Rec Points, Layer 3",6,0.5,6.5,14,0.5,14.5);
116 TH2F* h2dmodR4=new TH2F("h2dmodR4","Rec Points, Layer 4",8,0.5,8.5,22,0.5,22.5);
117 TH2F* h2dmodT3=new TH2F("h2dmodT3","Track Points, Layer 3",6,0.5,6.5,14,0.5,14.5);
118 TH2F* h2dmodT4=new TH2F("h2dmodT4","Track Points, Layer 4",8,0.5,8.5,22,0.5,22.5);
119 TH2F* h2dmodR3N=new TH2F("h2dmodR3N","Rec Points/GoodAnode/Event, Layer 3",6,0.5,6.5,14,0.5,14.5);
120 TH2F* h2dmodR4N=new TH2F("h2dmodR4N","Rec Points/GoodAnode/Event, Layer 4",8,0.5,8.5,22,0.5,22.5);
121 TH2F* h2dmodT3N=new TH2F("h2dmodT3N","Track Points/GoodAnode/Event, Layer 3",6,0.5,6.5,14,0.5,14.5);
122 TH2F* h2dmodT4N=new TH2F("h2dmodT4N","Track Points/GoodAnode/Event, Layer 4",8,0.5,8.5,22,0.5,22.5);
123 TH1F* hmodRN=new TH1F("hmodRN","Normalized Rec Points per Module",260,239.5,499.5);
124 TH1F* hmodTN=new TH1F("hmodTN","Normalized Track Points per Module",260,239.5,499.5);
126 TH1F* hev=(TH1F*)l->FindObject("hNEvents");
127 Int_t nTotEvents=hev->GetBinContent(2);
128 Int_t nTrigEvents=hev->GetBinContent(3);
129 Int_t nEvents=nTotEvents;
130 printf("---- Statistics ----\n");
131 printf("Number of Events = %d\n",nTotEvents);
133 printf("Number of Triggered Events = %d\n",nTrigEvents);
136 printf("No request on the trigger done whenrunning the task\n");
139 for(Int_t iMod=0; iMod<260;iMod++){
140 Int_t gda=(Int_t)hgamod->GetBinContent(iMod+1);
141 if(gda>bestMod) bestMod=gda;
145 nChunks=(Int_t)(bestMod/512.+0.5);
147 printf("Chunks merged = %d\n",nChunks);
148 hgamod->Scale(1./nChunks);
149 TCanvas* cgan=new TCanvas("cgan","Good Anodes");
152 hgamod->SetMarkerStyle(20);
153 hgamod->SetMarkerSize(0.6);
155 hgamod->GetXaxis()->SetTitle("SDD Module Id");
156 hgamod->GetYaxis()->SetTitle("Number of good anodes");
159 printf("---- Modules with > 2%% of bad anodes ----\n");
160 for(Int_t iMod=0; iMod<260; iMod++){
161 Int_t idMod=iMod+240;
162 Float_t rps=hmodR->GetBinContent(iMod+1);
163 Float_t tps=hmodT->GetBinContent(iMod+1);
164 Float_t ga=hgamod->GetBinContent(iMod+1);
166 printf("Module %d - Good Anodes = %d\n",idMod,(Int_t)ga);
173 rpsN=rps/ga/(Float_t)nEvents;
174 tpsN=tps/ga/(Float_t)nEvents;
175 erpsN=TMath::Sqrt(rps)/ga/(Float_t)nEvents;
176 etpsN=TMath::Sqrt(tps)/ga/(Float_t)nEvents;
178 hmodRN->SetBinContent(iMod+1,rpsN);
179 hmodTN->SetBinContent(iMod+1,tpsN);
180 hmodRN->SetBinError(iMod+1,erpsN);
181 hmodTN->SetBinError(iMod+1,etpsN);
182 Int_t iLay,iLad,iDet;
183 AliITSgeomTGeo::GetModuleId(idMod,iLay,iLad,iDet);
185 h2dmodR3->SetBinContent(iDet,iLad,rps);
186 h2dmodT3->SetBinContent(iDet,iLad,tps);
187 h2dmodR3N->SetBinContent(iDet,iLad,rpsN);
188 h2dmodT3N->SetBinContent(iDet,iLad,tpsN);
191 h2dmodR4->SetBinContent(iDet,iLad,rps);
192 h2dmodT4->SetBinContent(iDet,iLad,tps);
193 h2dmodR4N->SetBinContent(iDet,iLad,rpsN);
194 h2dmodT4N->SetBinContent(iDet,iLad,tpsN);
198 gStyle->SetPalette(1);
200 if(hmodR->GetEntries()>0){
201 TCanvas* cmodR=new TCanvas("cmodR","RecPoint Occup",1200,1200);
204 gPad->SetLeftMargin(0.14);
206 hmodR->GetXaxis()->SetTitle("SDD Module Id");
207 hmodR->GetYaxis()->SetTitle("RecPoints");
208 hmodR->GetYaxis()->SetTitleOffset(1.55);
210 gPad->SetLeftMargin(0.14);
212 hmodRN->GetXaxis()->SetTitle("SDD Module Id");
213 hmodRN->GetYaxis()->SetTitle("RecPoints/GoodAnode/Event");
214 hmodRN->GetYaxis()->SetTitleOffset(1.55);
216 gPad->SetLeftMargin(0.14);
217 h2dmodR3->Draw("colz");
218 h2dmodR3->GetXaxis()->SetTitle("Detector");
219 h2dmodR3->GetYaxis()->SetTitle("Ladder");
221 gPad->SetLeftMargin(0.14);
222 h2dmodR3N->Draw("colz");
223 h2dmodR3N->GetXaxis()->SetTitle("Detector");
224 h2dmodR3N->GetYaxis()->SetTitle("Ladder");
226 gPad->SetLeftMargin(0.14);
227 h2dmodR4->Draw("colz");
228 h2dmodR4->GetXaxis()->SetTitle("Detector");
229 h2dmodR4->GetYaxis()->SetTitle("Ladder");
231 gPad->SetLeftMargin(0.14);
232 gPad->SetLeftMargin(0.14);
233 h2dmodR4N->Draw("colz");
234 h2dmodR4N->GetXaxis()->SetTitle("Detector");
235 h2dmodR4N->GetYaxis()->SetTitle("Ladder");
239 TCanvas* cmodT=new TCanvas("cmodT","TrackPoint Occup",1200,1200);
243 hmodT->GetXaxis()->SetTitle("SDD Module Id");
244 hmodT->GetYaxis()->SetTitle("TrackPoints");
245 hmodT->GetYaxis()->SetTitleOffset(1.4);
247 gPad->SetLeftMargin(0.14);
249 hmodTN->GetXaxis()->SetTitle("SDD Module Id");
250 hmodTN->GetYaxis()->SetTitle("TrackPoints");
251 hmodTN->GetYaxis()->SetTitleOffset(1.4);
253 gPad->SetLeftMargin(0.14);
254 h2dmodT3->Draw("colz");
255 h2dmodT3->GetXaxis()->SetTitle("Detector");
256 h2dmodT3->GetYaxis()->SetTitle("Ladder");
258 gPad->SetLeftMargin(0.14);
259 h2dmodT3N->Draw("colz");
260 h2dmodT3N->GetXaxis()->SetTitle("Detector");
261 h2dmodT3N->GetYaxis()->SetTitle("Ladder");
263 gPad->SetLeftMargin(0.14);
264 h2dmodT4->Draw("colz");
265 h2dmodT4->GetXaxis()->SetTitle("Detector");
266 h2dmodT4->GetYaxis()->SetTitle("Ladder");
268 gPad->SetLeftMargin(0.14);
269 h2dmodT4N->Draw("colz");
270 h2dmodT4N->GetXaxis()->SetTitle("Detector");
271 h2dmodT4N->GetYaxis()->SetTitle("Ladder");
275 TH1F* htplad3=(TH1F*)l->FindObject("hTPLad3");
276 TH1F* htplad4=(TH1F*)l->FindObject("hTPLad4");
277 TH1F* hgalad3=(TH1F*)l->FindObject("hGALad3");
278 TH1F* hgalad4=(TH1F*)l->FindObject("hGALad4");
279 TH1F* hnormOcc3=new TH1F("hnormOcc3","",14,-0.5,13.5);
280 TH1F* hnormOcc4=new TH1F("hnormOcc4","",22,-0.5,21.5);
281 for(Int_t ilad=0;ilad<14;ilad++){
284 Int_t gd3=hgalad3->GetBinContent(ilad+1);
286 occ=(Float_t)htplad3->GetBinContent(ilad+1)/(Float_t)gd3/(Float_t)nEvents;
287 eocc=TMath::Sqrt((Float_t)htplad3->GetBinContent(ilad+1))/(Float_t)gd3/(Float_t)nEvents;
289 hnormOcc3->SetBinContent(ilad+1,occ);
290 hnormOcc3->SetBinError(ilad+1,eocc);
292 for(Int_t ilad=0;ilad<22;ilad++){
295 Int_t gd4=hgalad4->GetBinContent(ilad+1);
297 occ=(Float_t)htplad4->GetBinContent(ilad+1)/(Float_t)gd4/(Float_t)nEvents;
298 eocc=TMath::Sqrt((Float_t)htplad4->GetBinContent(ilad+1))/(Float_t)gd4/(Float_t)nEvents;
300 hnormOcc4->SetBinContent(ilad+1,occ);
301 hnormOcc4->SetBinError(ilad+1,eocc);
305 TCanvas* cn0=new TCanvas("cn0","Normalized Ladder Occupancy",1400,600);
308 gPad->SetLeftMargin(0.14);
310 hnormOcc3->GetXaxis()->SetTitle("Ladder number (layer 3)");
311 hnormOcc3->GetYaxis()->SetTitle("TrackPoints/GoodAnodes/Events");
312 hnormOcc3->GetYaxis()->SetTitleOffset(1.35);
314 gPad->SetLeftMargin(0.14);
316 hnormOcc4->GetXaxis()->SetTitle("Ladder number (layer 4)");
317 hnormOcc4->GetYaxis()->SetTitle("TrackPoints/GoodAnode/Events");
318 hnormOcc4->GetYaxis()->SetTitleOffset(1.35);
323 hgpmod->SetTitle("");
324 TCanvas* ceff0=new TCanvas("ceff0","ModuleIndexInfo",1000,600);
326 hgpmod->GetXaxis()->SetTitle("SDD Module Id");
327 hgpmod->GetYaxis()->SetTitle("Number of tracks");
328 hmpmod->SetLineColor(2);
329 hmpmod->SetMarkerColor(2);
330 hmpmod->SetMarkerStyle(22);
331 hmpmod->SetMarkerSize(0.5);
332 hmpmod->Draw("psame");
333 hbrmod->SetLineColor(kGreen+1);
334 hbrmod->SetMarkerColor(kGreen+1);
335 hbrmod->SetMarkerStyle(20);
336 hbrmod->SetMarkerSize(0.5);
337 hbrmod->Draw("same");
338 hskmod->SetLineColor(kYellow);
339 hskmod->Draw("same");
340 hoamod->SetLineColor(4);
341 hoamod->Draw("same");
342 hnrmod->SetLineColor(6);
343 hnrmod->Draw("same");
344 TLatex* t1=new TLatex(0.7,0.85,"Good Point");
348 TLatex* t2=new TLatex(0.7,0.8,"Missing Point");
352 TLatex* t3=new TLatex(0.7,0.75,"Bad Region");
354 t3->SetTextColor(kGreen+1);
359 TH1F* heff=new TH1F("heff","",260,239.5,499.5);
360 for(Int_t imod=0; imod<260;imod++){
361 Float_t numer=hgpmod->GetBinContent(imod+1)+hbrmod->GetBinContent(imod+1)+hoamod->GetBinContent(imod+1)+hnrmod->GetBinContent(imod+1);
362 Float_t denom=hapmod->GetBinContent(imod+1);
367 erreff=TMath::Sqrt(eff*(1-eff)/denom);
369 heff->SetBinContent(imod+1,eff);
370 heff->SetBinError(imod+1,erreff);
373 printf("---- Modules with efficiency < 90%% ----\n");
374 TCanvas* ceff1=new TCanvas("ceff1","Efficiency",1000,600);
376 heff->GetXaxis()->SetTitle("SDD Module Id");
377 heff->GetYaxis()->SetTitle("Fraction of tracks with point in good region");
378 for(Int_t ibin=1; ibin<=heff->GetNbinsX(); ibin++){
379 Float_t e=heff->GetBinContent(ibin);
381 Int_t iMod=(Int_t)heff->GetBinCenter(ibin);
383 AliITSgeomTGeo::GetModuleId(iMod,lay,lad,det);
384 printf("Module %d - Layer %d Ladder %2d Det %d - Eff. %.3f\n",iMod,lay,lad,det,heff->GetBinContent(ibin));
389 TH1F* htimR=(TH1F*)l->FindObject("hDrTimRP");
390 TH1F* htimT=(TH1F*)l->FindObject("hDrTimTPAll");
391 TH1F* htimTe=(TH1F*)l->FindObject("hDrTimTPExtra");
392 TH1F* htimTne=(TH1F*)l->FindObject("hDrTimTPNoExtra");
393 TCanvas* ctim=new TCanvas("ctim","DriftTime",1400,600);
397 htimR->GetYaxis()->SetTitleOffset(1.2);
398 htimR->GetXaxis()->SetTitle("Drift Time (ns)");
399 htimR->GetYaxis()->SetTitle("RecPoints");
402 htimTe->SetLineColor(2);
403 htimTe->Draw("same");
404 htimTne->SetLineColor(4);
405 htimTne->Draw("same");
406 htimT->GetXaxis()->SetTitle("Drift Time (ns)");
407 htimT->GetYaxis()->SetTitle("TrackPoints");
408 htimT->GetYaxis()->SetTitleOffset(1.2);
409 TLatex* ta=new TLatex(0.5,0.85,"All Clusters");
413 TLatex* te=new TLatex(0.5,0.8,"Extra Clusters");
417 TLatex* tn=new TLatex(0.5,0.75,"Non-Extra Clusters");
423 TCanvas* cdedx=new TCanvas("cdedx","dedx",1400,600);
428 hdedx3->GetXaxis()->SetTitle("P (GeV/c)");
429 hdedx3->GetYaxis()->SetTitle("dE/dx (keV/300 #mum) Layer 3");
430 hdedx3->GetYaxis()->SetTitleOffset(1.25);
434 hdedx4->GetXaxis()->SetTitle("P (GeV/c)");
435 hdedx4->GetYaxis()->SetTitle("dE/dx (keV/300 #mum) Layer 4");
436 hdedx4->GetYaxis()->SetTitleOffset(1.25);
439 hdedxmod->Draw("col");
440 hdedxmod->GetXaxis()->SetTitle("SDD Module Id");
441 hdedxmod->GetYaxis()->SetTitle("dE/dx (keV/300 #mum)");
442 hdedxmod->GetYaxis()->SetTitleOffset(1.25);
445 printf("---- dE/dx vs.DriftTime ----\n");
446 TCanvas* csig=new TCanvas("csig","dedx vs. DriftTime",1000,700);
449 TGraphErrors* gmpv=new TGraphErrors(0);
450 TGraphErrors* gsigg=new TGraphErrors(0);
451 TGraphErrors* gsigl=new TGraphErrors(0);
456 TF1 *lfun = new TF1("LangausFun",LangausFun,50.,300.,4);
457 for(Int_t it=0; it<8; it++){
458 hSigTim[it]=(TH1F*)l->FindObject(Form("hSigTimeInt%d",it));
461 if(hSigTim[it]->GetEntries()>200){
462 lfun->SetLineWidth(2);
463 lfun->SetParameter(0,5.);
464 lfun->SetParameter(1,80.);
465 lfun->SetParameter(2,hSigTim[it]->GetEntries()/10.);
466 lfun->SetParameter(3,10.);
467 lfun->SetParLimits(3,0.,20);
469 hSigTim[it]->Fit("LangausFun","QLR");
470 hSigTim[it]->GetXaxis()->SetTitle(Form("dE/dx, time interval %d",it+1));
471 hSigTim[it]->GetYaxis()->SetTitle("Events");
472 Float_t mpv=lfun->GetParameter(1);
473 Float_t empv=lfun->GetParError(1);
474 Float_t sig=lfun->GetParameter(3);
475 Float_t esig=lfun->GetParError(3);
476 Float_t sigl=lfun->GetParameter(0);
477 Float_t esigl=lfun->GetParError(0);
478 gmpv->SetPoint(iPoint,(Float_t)it,mpv);
479 gmpv->SetPointError(iPoint,0.,empv);
480 gsigg->SetPoint(iPoint,(Float_t)it,sig);
481 gsigg->SetPointError(iPoint,0.,esig);
482 gsigl->SetPoint(iPoint,(Float_t)it,sigl);
483 gsigl->SetPointError(iPoint,0.,esigl);
486 printf("Bin %d - MPV=%.3f \t SigmaLandau=%.3f \t SigmaGaus=%.3f\n",it,mpv,sigl,sig);
491 TCanvas* cpars=new TCanvas("cpars","Params",800,900);
492 cpars->Divide(1,3,0.01,0.);
494 gPad->SetLeftMargin(0.14);
495 gPad->SetFrameLineWidth(2);
498 gmpv->SetMarkerStyle(20);
499 // gmpv->SetMinimum(0);
500 // gmpv->SetMaximum(120);
501 gmpv->GetXaxis()->SetLimits(-0.2,6.8);
503 // gmpv->GetXaxis()->SetTitle("Drift Time interval number");
504 gmpv->GetYaxis()->SetTitle("Landau MPV (keV)");
505 gmpv->GetXaxis()->SetTitleSize(0.05);
506 gmpv->GetYaxis()->SetTitleSize(0.05);
507 gmpv->GetYaxis()->SetTitleOffset(1.2);
509 gPad->SetLeftMargin(0.14);
510 gPad->SetFrameLineWidth(2);
513 gsigl->SetMarkerStyle(20);
514 gsigl->GetXaxis()->SetLimits(-0.2,6.8);
516 // gsigl->GetXaxis()->SetTitle("Drift Time interval number");
517 gsigl->GetYaxis()->SetTitle("#sigma_{Landau} (keV)");
518 gsigl->GetXaxis()->SetTitleSize(0.05);
519 gsigl->GetYaxis()->SetTitleSize(0.05);
520 gsigl->GetYaxis()->SetTitleOffset(1.2);
522 gPad->SetLeftMargin(0.14);
523 gPad->SetFrameLineWidth(2);
526 gsigg->SetMarkerStyle(20);
527 gsigg->GetXaxis()->SetLimits(-0.2,6.8);
529 gsigg->GetXaxis()->SetTitle("Drift Time interval number");
530 gsigg->GetYaxis()->SetTitle("#sigma_{Gauss} (keV)");
531 gsigg->GetXaxis()->SetTitleSize(0.05);
532 gsigg->GetYaxis()->SetTitleSize(0.05);
533 gsigg->GetYaxis()->SetTitleOffset(1.2);