AliRoot Core  edcc906 (edcc906)
CalibCosmic.C
Go to the documentation of this file.
1 
30 #if !defined(__CINT__) || defined(__MAKECINT__)
31 #include "THnSparse.h"
32 #include "TLatex.h"
33 #include "TCanvas.h"
34 #include "TLegend.h"
35 #include "TSystem.h"
36 #include "TFile.h"
37 #include "TChain.h"
38 #include "TCut.h"
39 #include "TH3.h"
40 #include "TH2F.h"
41 #include "TProfile3D.h"
42 #include "TMath.h"
43 #include "TVectorD.h"
44 #include "TMatrixD.h"
45 #include "TTreeStream.h"
46 #include "AliExternalTrackParam.h"
47 #include "AliESDfriend.h"
48 #include "AliTPCcalibCosmic.h"
49 #include "TROOT.h"
50 #include "TPostScript.h"
51 #include "TStyle.h"
52 #include "AliTrackerBase.h"
53 #include "AliTPCExBEffective.h"
54 #include "TEntryList.h"
55 #include "TLegend.h"
56 #endif
57 
58 
59 class AliTPCcalibCosmic;
60 AliTPCcalibCosmic * cosmicScan =0;
62 Int_t colors[3]={1,2,4};
64 const char * chsign[3]={"all", "Positive","Negative"};
65 void Init();
66 void SetRangeAll(Int_t axis, Float_t xmin, Float_t xmax);
67 void SetDefaultCut();
68 void MakeDefaultPlots();
69 
70 
71 
72 void CalibCosmic(){
74 
75  Init();
76  SetDefaultCut();
77  //
79 }
80 
81 void Init(){
83 
84  TH1::AddDirectory(0);
85  TFile fcalib("TPCCosmicObjects.root");
86  cosmicScan = ( AliTPCcalibCosmic *)fcalib.Get("cosmicTPC");
87  TString axisName[9];
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";
93 
94  {
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());
101  }
102  }
103  }
104 }
105 
106 void SetRangeAll(Int_t axis, Float_t xmin, Float_t xmax){
107 
108  for (Int_t i=0;i<6;i++){
109  //
110  cosmicScan->fHistoDelta[i]->GetAxis(axis)->SetRangeUser(xmin,xmax);
111  cosmicScan->fHistoPull[i]->GetAxis(axis)->SetRangeUser(xmin,xmax);
112  }
113 }
114 
115 
117  for (Int_t i=0;i<6;i++){
118  //
119  //cut on number of clusters
120  cosmicScan->fHistoDelta[i]->GetAxis(1)->SetRangeUser(130,200);
121  cosmicScan->fHistoPull[i]->GetAxis(1)->SetRangeUser(130,200);
122  //cut on DCA r
123  cosmicScan->fHistoDelta[i]->GetAxis(2)->SetRangeUser(0,15);
124  cosmicScan->fHistoPull[i]->GetAxis(2)->SetRangeUser(0,15);
125  //cut on z at
126  cosmicScan->fHistoDelta[i]->GetAxis(3)->SetRangeUser(-20,20);
127  cosmicScan->fHistoPull[i]->GetAxis(3)->SetRangeUser(-20,20);
128  }
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);
132 }
133 
134 TH2 * GetDelta2D(Int_t type, Int_t var){
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());
138  return his;
139 }
140 
141 
142 TH1* GetFit2D(Int_t type, Int_t var, Bool_t resol){
143 
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);
148  TH1 * hres = 0;
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);
155  return hres;
156 }
157 
158 
159 TH1 * GetDelta(Int_t type){
160  TH1 * his = cosmicScan->fHistoDelta[type]->Projection(0);
161  his->SetXTitle(cosmicScan->fHistoDelta[type]->GetAxis(0)->GetName());
162  return his;
163 }
164 
165 TH2 * GetPull2D(Int_t type, Int_t var){
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());
169  return his;
170 }
171 
172 TH1* GetPull2DSigma(Int_t type, Int_t var){
173 
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());
179  return hres;
180 }
181 
182 
183 
184 TH1 * GetPull(Int_t type){
185  TH1 * his = cosmicScan->fHistoPull[type]->Projection(0);
186  his->SetXTitle(cosmicScan->fHistoPull[type]->GetAxis(0)->GetName());
187  return his;
188 }
189 
190 
193 
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};
196  TH2 *htemp;
197  TObjArray arr;
198  TH1 * hResolMax[4];
199  TH1 * hResolTot[4];
200  //
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);
204  }
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);
213  //
214 
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());
219  delete htemp;
220  arr.SetOwner(kTRUE);
221  arr.Delete();
222  hResolTot[ipad]->Scale(1./TMath::Sqrt(2.));
223  //
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());
227  delete htemp;
228  arr.SetOwner(kTRUE);
229  arr.Delete();
230  hResolMax[ipad]->Scale(1./TMath::Sqrt(2.));
231  }
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");
243  //
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");
249  }
250 
251 }
252 
253 void DrawStat(Int_t coord, TObjArray *array=0){
255 
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);
259  cStat->Divide(3,3);
260  for (Int_t i=1; i<8; i++){
261  cStat->cd(i+1);
262  cosmicScan->fHistoDelta[0]->Projection(i)->Draw();
263  }
264  if (array) array->AddLast(cStat);
265 }
266 
267 void SetStylePad(TVirtualPad *pad){
268  Float_t mx0=0.2, mx1=0.05, my0=0.15, my1=0.1;
269  pad->SetMargin(mx0,mx1,my0,my1);
270  pad->SetTicks(1,1);
271  pad->SetGrid(1,1);
272 
273 }
274 
277 
278  TCanvas *cptRes = new TCanvas("TPCPtResol","TPCPtResol",900,600);
279  cptRes->Divide(2,1);
280  SetStylePad(cptRes->cd(1));
281  SetStylePad(cptRes->cd(2));
282  cptRes->cd(1);
283  TLegend *legend = new TLegend(0.2,0.7,0.6,0.9,"");
284 
285  //
286  TH1 * hisRes=0;
287  TH1 * hisMean=0;
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]));
298 
299  hisRes->SetMarkerStyle(20);
300  hisMean->SetMarkerStyle(20);
301  hisRes->SetMarkerColor(colors[i]);
302  hisMean->SetMarkerColor(colors[i]);
303  hisRes->Scale(100);
304  hisMean->Scale(100);
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);
313  cptRes->cd(2);
314  hisRes->Draw("same");
315  if (i==0) hisRes->Draw("");
316  cptRes->cd(1);
317  hisMean->Draw("same");
318  if (i==0) hisMean->Draw("");
319  legend->AddEntry(hisMean);
320  }
321  legend->Draw();
322  if (array) array->AddLast(cptRes);
323 }
324 
325 
328 
329  TCanvas *cptRes = new TCanvas("TPCP4Resol","TPCP4Resol",900,600);
330  cptRes->Divide(2,1);
331  SetStylePad(cptRes->cd(1));
332  SetStylePad(cptRes->cd(2));
333  cptRes->cd(1);
334  TLegend *legend = new TLegend(0.2,0.7,0.6,0.9,"");
335 
336  //
337  TH1 * hisRes =0;
338  TH1 * hisMean=0;
339 
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]));
350 
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);
365  cptRes->cd(2);
366  hisRes->Draw("same");
367  if (i==0) hisRes->Draw("");
368  cptRes->cd(1);
369  hisMean->Draw("same");
370  if (i==0) hisMean->Draw("");
371  legend->AddEntry(hisMean);
372  }
373  legend->Draw();
374  if (array) array->AddLast(cptRes);
375 }
376 
377 
378 
379 
380 
381 
384 
385  TCanvas *cptRes = new TCanvas("TPCPosResolY","TPCPosResolY",900,600);
386  cptRes->Divide(2,1);
387  SetStylePad(cptRes->cd(1));
388  SetStylePad(cptRes->cd(2));
389  cptRes->cd(1);
390  TLegend *legend = new TLegend(0.2,0.7,0.6,0.9,"");
391 
392  //
393  TH1 * hisRes=0;
394  TH1 * hisMean=0;
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]));
405 
406  hisRes->SetMarkerStyle(20+i);
407  hisMean->SetMarkerStyle(20+i);
408  hisMean->SetMarkerColor(colors[i]);
409  hisRes->SetMarkerColor(colors[i]);
410 
411  //
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);
422  cptRes->cd(2);
423  hisRes->Draw("same");
424  if (i==0) hisRes->Draw("");
425  cptRes->cd(1);
426  hisMean->Draw("same");
427  if (i==0) hisMean->Draw("");
428  legend->AddEntry(hisMean);
429  }
430  legend->Draw();
431  if (array) array->AddLast(cptRes);
432 }
433 
436 
437  TCanvas *cptRes = new TCanvas("TPCSnp","TPCSnp",900,600);
438  cptRes->Divide(2,1);
439  SetStylePad(cptRes->cd(1));
440  SetStylePad(cptRes->cd(2));
441  cptRes->cd(1);
442  TLegend *legend = new TLegend(0.2,0.7,0.6,0.9,"");
443 
444  //
445  TH1 * hisRes=0;
446  TH1 * hisMean=0;
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]));
457 
458  hisRes->SetMarkerStyle(20+i);
459  hisMean->SetMarkerStyle(20+i);
460  hisMean->SetMarkerColor(colors[i]);
461  hisRes->SetMarkerColor(colors[i]);
462 
463  //
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);
472  cptRes->cd(2);
473  hisRes->Draw("same");
474  if (i==0) hisRes->Draw("");
475  cptRes->cd(1);
476  hisMean->Draw("same");
477  if (i==0) hisMean->Draw("");
478  legend->AddEntry(hisMean);
479  }
480  legend->Draw();
481  if (array) array->AddLast(cptRes);
482 }
485 
486  TCanvas *cptRes = new TCanvas("TPCtgl","TPCtgl",900,600);
487  cptRes->Divide(2,1);
488  SetStylePad(cptRes->cd(1));
489  SetStylePad(cptRes->cd(2));
490  cptRes->cd(1);
491  TLegend *legend = new TLegend(0.2,0.7,0.6,0.9,"");
492 
493  //
494  TH1 * hisRes=0;
495  TH1 * hisMean=0;
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]));
506 
507  hisRes->SetMarkerStyle(20+i);
508  hisMean->SetMarkerStyle(20+i);
509  hisMean->SetMarkerColor(colors[i]);
510  hisRes->SetMarkerColor(colors[i]);
511 
512  //
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);
521  cptRes->cd(2);
522  hisRes->Draw("same");
523  if (i==0) hisRes->Draw("");
524  cptRes->cd(1);
525  hisMean->Draw("same");
526  if (i==0) hisMean->Draw("");
527  legend->AddEntry(hisMean);
528  }
529  legend->Draw();
530  if (array) array->AddLast(cptRes);
531 }
532 
535 
536  TCanvas *cptRes = new TCanvas("TPCPosResolZ","TPCPosResolZ",900,600);
537  cptRes->Divide(2,1);
538  SetStylePad(cptRes->cd(1));
539  SetStylePad(cptRes->cd(2));
540  cptRes->cd(1);
541  TLegend *legend = new TLegend(0.2,0.7,0.6,0.9,"");
542 
543  //
544  TH1 * hisRes=0;
545  TH1 * hisMean=0;
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);
550 
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]));
557 
558 
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]);
567 
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);
574  cptRes->cd(2);
575  hisRes->Draw("same");
576  if (i==0) hisRes->Draw();
577  cptRes->cd(1);
578  hisMean->Draw("same");
579  if (i==0) hisMean->Draw();
580  legend->AddEntry(hisMean);
581  }
582  legend->Draw();
583  if (array) array->AddLast(cptRes);
584 }
585 
586 
589 
590  gStyle->SetOptStat(1100);
591  DrawStat(0,picArray);
592  gStyle->SetOptStat(0);
599  //
600 
601  TFile f("cosmicPlots.root","recreate");
602  picArray->Write("CosmicPlots",TObject::kSingleKey);
603  f.Close();
604  TPostScript *ps=new TPostScript("cosmicPerformance.ps", 112);
605  ps->NewPage();
606  for (Int_t ipad=0;ipad<picArray->GetEntries();ipad++){
607  TCanvas *c =dynamic_cast<TCanvas*> (picArray->At(ipad));
608  if (c) {
609  c->Draw();
610  c->Update();
611  ps->NewPage();
612  }
613  }
614  ps->Close();
615  delete ps;
616 }
void DrawResoldEdx()
Definition: CalibCosmic.C:191
Int_t colors[3]
Definition: CalibCosmic.C:62
AliTPCcalibCosmic * cosmicScan
Definition: CalibCosmic.C:60
void DrawStat(Int_t coord, TObjArray *array=0)
Definition: CalibCosmic.C:253
void Init()
Definition: CalibCosmic.C:81
TStyle * gStyle
TH1 * GetPull(Int_t type)
Definition: CalibCosmic.C:184
#define TObjArray
void MakePlotPosZ(TObjArray *array)
Definition: CalibCosmic.C:533
void SetRangeAll(Int_t axis, Float_t xmin, Float_t xmax)
Definition: CalibCosmic.C:106
TObjArray * picArray
Definition: CalibCosmic.C:63
const char * chsign[3]
Definition: CalibCosmic.C:64
void MakeDefaultPlots()
Definition: CalibCosmic.C:587
void MakePlotPosY(TObjArray *array)
Definition: CalibCosmic.C:382
TObjArray * array
Definition: AnalyzeLaser.C:12
void CalibCosmic()
Definition: CalibCosmic.C:72
void MakePlotSnp(TObjArray *array)
Definition: CalibCosmic.C:434
Int_t kmicolors[10]
Definition: CalibPID.C:76
TH1 * GetFit2D(Int_t type, Int_t var, Bool_t resol)
Definition: CalibCosmic.C:142
void SetDefaultCut()
Definition: CalibCosmic.C:116
TObject * htemp
Definition: PlotSys.C:37
TF1 * f
Definition: interpolTest.C:21
TH1 * GetPull2DSigma(Int_t type, Int_t var)
Definition: CalibCosmic.C:172
TH2 * GetPull2D(Int_t type, Int_t var)
Definition: CalibCosmic.C:165
void MakePlotTgl(TObjArray *array)
Definition: CalibCosmic.C:483
Int_t kmimarkers[10]
Definition: CalibPID.C:77
void SetStylePad(TVirtualPad *pad)
Definition: CalibCosmic.C:267
TH1 * GetDelta(Int_t type)
Definition: CalibCosmic.C:159
TH2 * GetDelta2D(Int_t type, Int_t var)
Definition: CalibCosmic.C:134
TObjArray fitArr
Definition: CalibCosmic.C:61
void MakePlotPt(TObjArray *array)
Definition: CalibCosmic.C:275
void MakePlotP4(TObjArray *array)
Definition: CalibCosmic.C:326