30 #if !defined(__CINT__) || defined(__MAKECINT__) 31 #include "THnSparse.h" 41 #include "TProfile3D.h" 48 #include "AliTPCcalibCosmic.h" 50 #include "TPostScript.h" 54 #include "TEntryList.h" 59 class AliTPCcalibCosmic;
64 const char *
chsign[3]={
"all",
"Positive",
"Negative"};
66 void SetRangeAll(Int_t axis, Float_t xmin, Float_t xmax);
85 TFile fcalib(
"TPCCosmicObjects.root");
86 cosmicScan = ( AliTPCcalibCosmic *)fcalib.Get(
"cosmicTPC");
88 axisName[0] =
"#Delta"; axisName[1] =
"N_{cl}";
89 axisName[2] =
"DCA_{r}(cm)";
90 axisName[3] =
"z (cm)"; axisName[4] =
"sin(#phi)";
91 axisName[5] =
"tan(#theta)"; axisName[6] =
"1/p_{t} (1/GeV)";
92 axisName[7] =
"p_{t} (GeV)"; axisName[8] =
"alpha";
95 for (Int_t ivar=0;ivar<6;ivar++){
96 for (Int_t ivar2=0;ivar2<9;ivar2++){
97 cosmicScan->fHistoDelta[ivar]->GetAxis(ivar2)->SetName(axisName[ivar2].Data());
98 cosmicScan->fHistoDelta[ivar]->GetAxis(ivar2)->SetTitle(axisName[ivar2].Data());
99 cosmicScan->fHistoPull[ivar]->GetAxis(ivar2)->SetName(axisName[ivar2].Data());
100 cosmicScan->fHistoPull[ivar]->GetAxis(ivar2)->SetTitle(axisName[ivar2].Data());
108 for (Int_t i=0;i<6;i++){
110 cosmicScan->fHistoDelta[i]->GetAxis(axis)->SetRangeUser(xmin,xmax);
111 cosmicScan->fHistoPull[i]->GetAxis(axis)->SetRangeUser(xmin,xmax);
117 for (Int_t i=0;i<6;i++){
120 cosmicScan->fHistoDelta[i]->GetAxis(1)->SetRangeUser(130,200);
121 cosmicScan->fHistoPull[i]->GetAxis(1)->SetRangeUser(130,200);
123 cosmicScan->fHistoDelta[i]->GetAxis(2)->SetRangeUser(0,15);
124 cosmicScan->fHistoPull[i]->GetAxis(2)->SetRangeUser(0,15);
126 cosmicScan->fHistoDelta[i]->GetAxis(3)->SetRangeUser(-20,20);
127 cosmicScan->fHistoPull[i]->GetAxis(3)->SetRangeUser(-20,20);
129 cosmicScan->fHistoDelta[0]->GetAxis(0)->SetRangeUser(-1,1);
130 cosmicScan->fHistoDelta[1]->GetAxis(0)->SetRangeUser(-1,1);
131 cosmicScan->fHistoDelta[4]->GetAxis(0)->SetRangeUser(-0.1,0.1);
135 TH2 * his =
cosmicScan->fHistoDelta[type]->Projection(0,var);
136 his->SetXTitle(
cosmicScan->fHistoDelta[type]->GetAxis(var)->GetName());
137 his->SetYTitle(
cosmicScan->fHistoDelta[type]->GetAxis(0)->GetName());
142 TH1*
GetFit2D(Int_t type, Int_t var, Bool_t resol){
144 TH2 * his =
cosmicScan->fHistoDelta[type]->Projection(0,var);
145 his->SetXTitle(
cosmicScan->fHistoDelta[type]->GetAxis(var)->GetName());
146 his->SetYTitle(
cosmicScan->fHistoDelta[type]->GetAxis(0)->GetName());
147 his->FitSlicesY(0,0,-1,0,
"QNR",&
fitArr);
149 if (resol) hres = (TH1*)(
fitArr.At(2)->Clone());
150 if (!resol) hres = (TH1*)(
fitArr.At(1)->Clone());
151 hres->SetMarkerStyle(20);
152 hres->SetMarkerColor(2);
153 hres->GetYaxis()->SetTitleOffset(1.8);
154 hres->GetYaxis()->SetDecimals(kTRUE);
160 TH1 * his =
cosmicScan->fHistoDelta[type]->Projection(0);
161 his->SetXTitle(
cosmicScan->fHistoDelta[type]->GetAxis(0)->GetName());
166 TH2 * his =
cosmicScan->fHistoPull[type]->Projection(0,var);
167 his->SetXTitle(
cosmicScan->fHistoPull[type]->GetAxis(var)->GetName());
168 his->SetYTitle(
cosmicScan->fHistoPull[type]->GetAxis(0)->GetName());
174 TH2 * his =
cosmicScan->fHistoPull[type]->Projection(0,var);
175 his->SetXTitle(
cosmicScan->fHistoPull[type]->GetAxis(var)->GetName());
176 his->SetYTitle(
cosmicScan->fHistoPull[type]->GetAxis(0)->GetName());
177 his->FitSlicesY(0,0,-1,0,
"QNR",&
fitArr);
178 TH1 * hres = (TH1*)(
fitArr.At(2)->Clone());
185 TH1 * his =
cosmicScan->fHistoPull[type]->Projection(0);
186 his->SetXTitle(
cosmicScan->fHistoPull[type]->GetAxis(0)->GetName());
194 Int_t
kmicolors[10]={1,2,3,6,7,8,9,10,11,12};
195 Int_t
kmimarkers[10]={21,22,23,24,25,26,27,28,29,30};
201 for (Int_t ipad=0;ipad<4;ipad++){
202 cosmicScan->fHistodEdxTot[ipad]->GetAxis(4)->SetRangeUser(-0.6,0.6);
203 cosmicScan->fHistodEdxMax[ipad]->GetAxis(4)->SetRangeUser(-0.6,0.6);
205 cosmicScan->fHistodEdxTot[0]->GetAxis(1)->SetRangeUser(30,62);
206 cosmicScan->fHistodEdxTot[1]->GetAxis(1)->SetRangeUser(30,62);
207 cosmicScan->fHistodEdxTot[2]->GetAxis(1)->SetRangeUser(10,35);
208 cosmicScan->fHistodEdxTot[3]->GetAxis(1)->SetRangeUser(10,150);
209 cosmicScan->fHistodEdxMax[0]->GetAxis(1)->SetRangeUser(30,62);
210 cosmicScan->fHistodEdxMax[1]->GetAxis(1)->SetRangeUser(30,62);
211 cosmicScan->fHistodEdxMax[2]->GetAxis(1)->SetRangeUser(10,35);
212 cosmicScan->fHistodEdxMax[3]->GetAxis(1)->SetRangeUser(10,150);
215 for (Int_t ipad=0;ipad<4;ipad++){
216 htemp =
cosmicScan->fHistodEdxTot[ipad]->Projection(0,1);
217 htemp->FitSlicesY(0,0,-1,0,
"QNR",&arr);
218 hResolTot[ipad] = (TH1*)(arr.At(2)->Clone());
222 hResolTot[ipad]->Scale(1./TMath::Sqrt(2.));
224 htemp =
cosmicScan->fHistodEdxMax[ipad]->Projection(0,1);
225 htemp->FitSlicesY(0,0,-1,0,
"QNR",&arr);
226 hResolMax[ipad] = (TH1*)(arr.At(2)->Clone());
230 hResolMax[ipad]->Scale(1./TMath::Sqrt(2.));
232 hResolTot[3]->GetXaxis()->SetRangeUser(0,160);
233 hResolTot[3]->SetXTitle(
"N_{cl}");
234 hResolTot[3]->SetYTitle(
"#sigma(dEdx/dEdx_{d})/#sqrt{2.}");
235 hResolTot[3]->SetTitle(
"Relative dEdx resolution");
236 for (Int_t ipad=3;ipad>=0;ipad--){
237 hResolTot[ipad]->SetMaximum(0.1);
238 hResolTot[ipad]->SetMinimum(0.);
239 hResolTot[ipad]->SetMarkerColor(kmicolors[ipad]+0);
240 hResolTot[ipad]->SetMarkerStyle(kmimarkers[ipad]+1);
241 if (ipad==3) hResolTot[ipad]->Draw();
242 hResolTot[ipad]->Draw(
"same");
244 hResolMax[ipad]->SetMaximum(0.1);
245 hResolMax[ipad]->SetMinimum(0.);
246 hResolMax[ipad]->SetMarkerColor(kmicolors[ipad]+0);
247 hResolMax[ipad]->SetMarkerStyle(kmimarkers[ipad]+4);
248 hResolMax[ipad]->Draw(
"same");
256 TCanvas *cStat =
new TCanvas(Form(
"Cosmic stat%d",coord), Form(
"CosmicStat%d",coord),1000,800);
257 Float_t mx0=0.2, mx1=0.05, my0=0.15, my1=0.1;
258 cStat->SetMargin(mx0,mx1,my0,my1);
260 for (Int_t i=1; i<8; i++){
262 cosmicScan->fHistoDelta[0]->Projection(i)->Draw();
268 Float_t mx0=0.2, mx1=0.05, my0=0.15, my1=0.1;
269 pad->SetMargin(mx0,mx1,my0,my1);
278 TCanvas *cptRes =
new TCanvas(
"TPCPtResol",
"TPCPtResol",900,600);
283 TLegend *legend =
new TLegend(0.2,0.7,0.6,0.9,
"");
288 for (Int_t i=0; i<3; i++){
289 if (i==0)
cosmicScan->fHistoDelta[5]->GetAxis(6)->SetRangeUser(-1,1);
290 if (i==1)
cosmicScan->fHistoDelta[5]->GetAxis(6)->SetRangeUser(0.001,1);
291 if (i==2)
cosmicScan->fHistoDelta[5]->GetAxis(6)->SetRangeUser(-1,-0.001);
292 hisRes = (TH1*)
GetFit2D(5,7,kTRUE)->Clone();
293 hisMean = (TH1*)
GetFit2D(5,7,kFALSE)->Clone();
294 hisMean->SetName(Form(
"#Deltap_{t}/p_{t} %s",
chsign[i]));
295 hisRes->SetName(Form(
"#sigma_{p_{t}}/p_{t} %s",
chsign[i]));
296 hisMean->SetTitle(Form(
"#Delta_{p_{t}}/p_{t} %s",
chsign[i]));
297 hisRes->SetTitle(Form(
"#sigma_{p_{t}}/p_{t} %s",
chsign[i]));
299 hisRes->SetMarkerStyle(20);
300 hisMean->SetMarkerStyle(20);
301 hisRes->SetMarkerColor(
colors[i]);
302 hisMean->SetMarkerColor(
colors[i]);
305 hisRes->SetMaximum(30);
306 hisRes->SetMinimum(0);
307 hisMean->SetMaximum(20);
308 hisMean->SetMinimum(-20);
309 hisRes->SetYTitle(
"#sigma_{p_{t}}/p_{t} (%)");
310 hisMean->SetYTitle(
"#Delta_{p_{t}}/p_{t} (%)");
311 hisRes->GetXaxis()->SetRangeUser(0,50);
312 hisMean->GetXaxis()->SetRangeUser(0,50);
314 hisRes->Draw(
"same");
315 if (i==0) hisRes->Draw(
"");
317 hisMean->Draw(
"same");
318 if (i==0) hisMean->Draw(
"");
319 legend->AddEntry(hisMean);
322 if (array) array->AddLast(cptRes);
329 TCanvas *cptRes =
new TCanvas(
"TPCP4Resol",
"TPCP4Resol",900,600);
334 TLegend *legend =
new TLegend(0.2,0.7,0.6,0.9,
"");
340 for (Int_t i=0; i<3; i++){
341 if (i==0)
cosmicScan->fHistoDelta[4]->GetAxis(6)->SetRangeUser(-1,1);
342 if (i==1)
cosmicScan->fHistoDelta[4]->GetAxis(6)->SetRangeUser(0.001,1);
343 if (i==2)
cosmicScan->fHistoDelta[4]->GetAxis(6)->SetRangeUser(-1,-0.001);
344 hisRes = (TH1*)
GetFit2D(4,7,kTRUE)->Clone();
345 hisMean = (TH1*)
GetFit2D(4,7,kFALSE)->Clone();
346 hisMean->SetName(Form(
"#Delta_{1/p_{t}} %s",
chsign[i]));
347 hisRes->SetName(Form(
"#sigma_{1/p_{t}} %s",
chsign[i]));
348 hisMean->SetTitle(Form(
"#Delta_{1/p_{t}} %s",
chsign[i]));
349 hisRes->SetTitle(Form(
"#sigma_{1/p_{t}} %s",
chsign[i]));
351 hisRes->SetMarkerStyle(20+i);
352 hisMean->SetMarkerStyle(20+i);
353 hisMean->SetMarkerColor(
colors[i]);
354 hisRes->SetMarkerColor(
colors[i]);
355 hisRes->SetMaximum(0.02);
356 hisRes->SetMinimum(-0.0);
357 hisMean->SetMaximum(0.02);
358 hisMean->SetMinimum(-0.02);
359 hisRes->SetYTitle(
"#sigma_{1/pt} (1/GeV)");
360 hisMean->SetYTitle(
"#Delta_{1/pt} (1/GeV)");
361 hisMean->SetXTitle(
"p_{t} (GeV)");
362 hisRes->SetXTitle(
"p_{t} (GeV)");
363 hisRes->GetXaxis()->SetRangeUser(0,50);
364 hisMean->GetXaxis()->SetRangeUser(0,50);
366 hisRes->Draw(
"same");
367 if (i==0) hisRes->Draw(
"");
369 hisMean->Draw(
"same");
370 if (i==0) hisMean->Draw(
"");
371 legend->AddEntry(hisMean);
374 if (array) array->AddLast(cptRes);
385 TCanvas *cptRes =
new TCanvas(
"TPCPosResolY",
"TPCPosResolY",900,600);
390 TLegend *legend =
new TLegend(0.2,0.7,0.6,0.9,
"");
395 for (Int_t i=0; i<3; i++){
396 if (i==1)
cosmicScan->fHistoDelta[0]->GetAxis(6)->SetRangeUser(0.0001,1);
397 if (i==2)
cosmicScan->fHistoDelta[0]->GetAxis(6)->SetRangeUser(-1,-0.0001);
398 if (i==0)
cosmicScan->fHistoDelta[0]->GetAxis(6)->SetRangeUser(-1,1);
399 hisRes = (TH1*)
GetFit2D(0,7,kTRUE)->Clone();
400 hisMean = (TH1*)
GetFit2D(0,7,kFALSE)->Clone();
401 hisMean->SetName(Form(
"#Delta_{r#phi} %s",
chsign[i]));
402 hisRes->SetName(Form(
"#sigma_{r#phi} %s",
chsign[i]));
403 hisMean->SetTitle(Form(
"#Delta_{r#phi} %s",
chsign[i]));
404 hisRes->SetTitle(Form(
"#sigma_{r#phi} %s",
chsign[i]));
406 hisRes->SetMarkerStyle(20+i);
407 hisMean->SetMarkerStyle(20+i);
408 hisMean->SetMarkerColor(
colors[i]);
409 hisRes->SetMarkerColor(
colors[i]);
412 hisRes->SetMaximum(0.4);
413 hisRes->SetMinimum(0.0);
414 hisMean->SetMaximum(0.4);
415 hisMean->SetMinimum(-0.4);
416 hisRes->SetName(
"Y resol");
417 hisRes->SetName(
"Y resolution");
418 hisRes->SetYTitle(
"#sigma_{y} (cm)");
419 hisMean->SetYTitle(
"#Delta_{y} (cm)");
420 hisRes->GetXaxis()->SetRangeUser(0,50);
421 hisMean->GetXaxis()->SetRangeUser(0,50);
423 hisRes->Draw(
"same");
424 if (i==0) hisRes->Draw(
"");
426 hisMean->Draw(
"same");
427 if (i==0) hisMean->Draw(
"");
428 legend->AddEntry(hisMean);
431 if (array) array->AddLast(cptRes);
437 TCanvas *cptRes =
new TCanvas(
"TPCSnp",
"TPCSnp",900,600);
442 TLegend *legend =
new TLegend(0.2,0.7,0.6,0.9,
"");
447 for (Int_t i=0; i<3; i++){
448 if (i==1)
cosmicScan->fHistoDelta[2]->GetAxis(6)->SetRangeUser(0.0001,1);
449 if (i==2)
cosmicScan->fHistoDelta[2]->GetAxis(6)->SetRangeUser(-1,-0.0001);
450 if (i==0)
cosmicScan->fHistoDelta[2]->GetAxis(6)->SetRangeUser(-1,1);
451 hisRes = (TH1*)
GetFit2D(2,7,kTRUE)->Clone();
452 hisMean = (TH1*)
GetFit2D(2,7,kFALSE)->Clone();
453 hisMean->SetName(Form(
"#Delta_{#phi} %s",
chsign[i]));
454 hisRes->SetName(Form(
"#sigma_{#phi} %s",
chsign[i]));
455 hisMean->SetTitle(Form(
"#Delta_{#phi} %s",
chsign[i]));
456 hisRes->SetTitle(Form(
"#sigma_{#phi} %s",
chsign[i]));
458 hisRes->SetMarkerStyle(20+i);
459 hisMean->SetMarkerStyle(20+i);
460 hisMean->SetMarkerColor(
colors[i]);
461 hisRes->SetMarkerColor(
colors[i]);
464 hisRes->SetMaximum(4);
465 hisRes->SetMinimum(4);
466 hisMean->SetMaximum(4);
467 hisMean->SetMinimum(-4);
468 hisRes->SetYTitle(
"#sigma_{#phi} (mrad)");
469 hisMean->SetYTitle(
"#Delta_{#phi} (mrad)");
470 hisRes->GetXaxis()->SetRangeUser(0,50);
471 hisMean->GetXaxis()->SetRangeUser(0,50);
473 hisRes->Draw(
"same");
474 if (i==0) hisRes->Draw(
"");
476 hisMean->Draw(
"same");
477 if (i==0) hisMean->Draw(
"");
478 legend->AddEntry(hisMean);
481 if (array) array->AddLast(cptRes);
486 TCanvas *cptRes =
new TCanvas(
"TPCtgl",
"TPCtgl",900,600);
491 TLegend *legend =
new TLegend(0.2,0.7,0.6,0.9,
"");
496 for (Int_t i=0; i<3; i++){
497 if (i==1)
cosmicScan->fHistoDelta[3]->GetAxis(6)->SetRangeUser(0.0001,1);
498 if (i==2)
cosmicScan->fHistoDelta[3]->GetAxis(6)->SetRangeUser(-1,-0.0001);
499 if (i==0)
cosmicScan->fHistoDelta[3]->GetAxis(6)->SetRangeUser(-1,1);
500 hisRes = (TH1*)
GetFit2D(3,7,kTRUE)->Clone();
501 hisMean = (TH1*)
GetFit2D(3,7,kFALSE)->Clone();
502 hisMean->SetName(Form(
"#Delta_{#theta} %s",
chsign[i]));
503 hisRes->SetName(Form(
"#sigma_{#theta} %s",
chsign[i]));
504 hisMean->SetTitle(Form(
"#Delta_{#theta} %s",
chsign[i]));
505 hisRes->SetTitle(Form(
"#sigma_{#theta} %s",
chsign[i]));
507 hisRes->SetMarkerStyle(20+i);
508 hisMean->SetMarkerStyle(20+i);
509 hisMean->SetMarkerColor(
colors[i]);
510 hisRes->SetMarkerColor(
colors[i]);
513 hisRes->SetMaximum(4);
514 hisRes->SetMinimum(4);
515 hisMean->SetMaximum(4);
516 hisMean->SetMinimum(-4);
517 hisRes->SetYTitle(
"#sigma_{#theta} (mrad)");
518 hisMean->SetYTitle(
"#Delta_{#theta} (mrad)");
519 hisRes->GetXaxis()->SetRangeUser(0,50);
520 hisMean->GetXaxis()->SetRangeUser(0,50);
522 hisRes->Draw(
"same");
523 if (i==0) hisRes->Draw(
"");
525 hisMean->Draw(
"same");
526 if (i==0) hisMean->Draw(
"");
527 legend->AddEntry(hisMean);
530 if (array) array->AddLast(cptRes);
536 TCanvas *cptRes =
new TCanvas(
"TPCPosResolZ",
"TPCPosResolZ",900,600);
541 TLegend *legend =
new TLegend(0.2,0.7,0.6,0.9,
"");
546 for (Int_t i=0; i<3; i++){
547 if (i==1)
cosmicScan->fHistoDelta[1]->GetAxis(6)->SetRangeUser(0.001,1.);
548 if (i==2)
cosmicScan->fHistoDelta[1]->GetAxis(6)->SetRangeUser(-1,-0.001);
549 if (i==0)
cosmicScan->fHistoDelta[1]->GetAxis(6)->SetRangeUser(-1,1);
551 hisRes = (TH1*)
GetFit2D(1,7,kTRUE)->Clone();
552 hisMean = (TH1*)
GetFit2D(1,7,kFALSE)->Clone();
553 hisMean->SetName(Form(
"#Delta_{z} %s",
chsign[i]));
554 hisRes->SetName(Form(
"#sigma_{z} %s",
chsign[i]));
555 hisMean->SetTitle(Form(
"#Delta_{z} %s",
chsign[i]));
556 hisRes->SetTitle(Form(
"#sigma_{z} %s",
chsign[i]));
559 hisRes->SetMaximum(0.4);
560 hisRes->SetMinimum(0.0);
561 hisMean->SetMaximum(0.2);
562 hisMean->SetMinimum(-0.2);
563 hisRes->SetMarkerStyle(20);
564 hisMean->SetMarkerStyle(20);
565 hisRes->SetMarkerColor(
colors[i]);
566 hisMean->SetMarkerColor(
colors[i]);
568 hisRes->SetName(
"Z resol");
569 hisRes->SetName(
"Z resolution");
570 hisRes->SetYTitle(
"#sigma_{z} (cm)");
571 hisMean->SetYTitle(
"#Delta_{z} (cm)");
572 hisRes->GetXaxis()->SetRangeUser(0,50);
573 hisMean->GetXaxis()->SetRangeUser(0,50);
575 hisRes->Draw(
"same");
576 if (i==0) hisRes->Draw();
578 hisMean->Draw(
"same");
579 if (i==0) hisMean->Draw();
580 legend->AddEntry(hisMean);
583 if (array) array->AddLast(cptRes);
601 TFile
f(
"cosmicPlots.root",
"recreate");
602 picArray->Write(
"CosmicPlots",TObject::kSingleKey);
604 TPostScript *ps=
new TPostScript(
"cosmicPerformance.ps", 112);
606 for (Int_t ipad=0;ipad<
picArray->GetEntries();ipad++){
607 TCanvas *c =
dynamic_cast<TCanvas*
> (
picArray->At(ipad));
AliTPCcalibCosmic * cosmicScan
void DrawStat(Int_t coord, TObjArray *array=0)
TH1 * GetPull(Int_t type)
void MakePlotPosZ(TObjArray *array)
void SetRangeAll(Int_t axis, Float_t xmin, Float_t xmax)
void MakePlotPosY(TObjArray *array)
void MakePlotSnp(TObjArray *array)
TH1 * GetFit2D(Int_t type, Int_t var, Bool_t resol)
TH1 * GetPull2DSigma(Int_t type, Int_t var)
TH2 * GetPull2D(Int_t type, Int_t var)
void MakePlotTgl(TObjArray *array)
void SetStylePad(TVirtualPad *pad)
TH1 * GetDelta(Int_t type)
TH2 * GetDelta2D(Int_t type, Int_t var)
void MakePlotPt(TObjArray *array)
void MakePlotP4(TObjArray *array)