ad0231a5319879195b754c004f91b9efaeedb619
[u/mrichter/AliRoot.git] / TPC / CalibMacros / CosmicPerformance.C
1 /*
2   .x ~/UliStyle.C
3   .x ~/rootlogon.C
4   gSystem->Load("libSTAT.so");
5   gSystem->Load("libANALYSIS");
6   gSystem->Load("libTPCcalib");
7   gSystem->Load("libSTAT.so");
8
9   gSystem->AddIncludePath("-I$ALICE_ROOT/TPC/macros");  
10   gROOT->LoadMacro("$ALICE_ROOT/TPC/macros/AliXRDPROOFtoolkit.cxx+");
11   AliXRDPROOFtoolkit tool; 
12   TChain * chainCosmic = tool.MakeChain("cosmic.txt","Track0",0,1000000);
13   chainCosmic->Lookup();
14   //chainCosmic->SetProof(kTRUE);
15
16
17 */
18
19
20 void InitCuts(){
21   //
22   // Parameters diff
23   //
24   TCut cutP0("cutP0","abs(Tr0.fP[0]+Tr1.fP[0])<10");
25   TCut cutP1("cutP1","abs(Tr0.fP[1]-Tr1.fP[1])<15"); 
26   TCut cutP2("cutP2","abs(Tr1.fAlpha-Tr0.fAlpha+pi)<0.1")
27   TCut cutP3("cutP3","abs(Tr0.fP[3]+Tr1.fP[3])<0.1");     
28   TCut cutP4("cutP4","abs(Tr0.fP[4]+Tr1.fP[4])<0.5");     
29   TCut cutP   = cutP0+cutP1+cutP2+cutP3+cutP4;
30   //
31   // Pull dif
32   //
33   TCut cutPull0("cutPull0","abs(Tr0.fP[0]+Tr1.fP[0])/sqrt(Tr0.fC[0]+Tr1.fC[0])<10");
34   TCut cutPull2("((Tr1.fAlpha-Tr0.fAlpha+pi))/sqrt(Tr0.fC[5]+Tr1.fC[5])<10");
35   TCut cutPull4("cutPull0","abs(Tr0.fP[4]+Tr1.fP[4])/sqrt(Tr0.fC[14]+Tr1.fC[14])<10");
36   TCut cutPull = cutPull0+cutPull2+cutPull4;
37   //
38   // Geometrical cut 
39   //
40   TCut cutOx("Op1.fX>240&&Op0.fX>240");
41   TCut cutOz("abs(Op1.fP[1])<240&&abs(Op0.fP[1])<240");
42   TCut cutIx("Ip1.fX<90&&Ip0.fX<90");
43   TCut cutIz("abs(Ip1.fP[1])<240&&abs(Ip0.fP[1])<240");
44   TCut cutX00("abs(x00)<70");
45   TCut cutX10("abs(x10)<70");
46   TCut cutG = cutOx+cutOz+cutIx+cutIz+cutX00+cutX10;
47   //
48   //
49   //
50   TCut cutN("cutN","min(Orig0.fTPCncls,Orig1.fTPCncls)>80");
51   TCut cutN120("cutN120","min(Orig0.fTPCncls,Orig1.fTPCncls)>120");
52   TCut cutAll = cutP+cutPull+cutG+cutN+"abs(mag)>4";
53   //
54   TCut cuthpt("abs(Tr0.fP[4])+abs(Tr1.fP[4])<0.5");  
55   TCut cutS("cutS","!crossI&&!crossO");
56   TCut cutRun("run<620600");
57   //
58   chainCosmic->Draw(">>listELP",cutAll,"entryList");
59   TEntryList *elist = (TEntryList*)gDirectory->Get("listELP");
60   chainCosmic->SetEntryList(elist);
61   //
62   chainCosmic->Draw(">>listELFit",cutAll+cuthpt+cutS+cutRun,"entryList");
63   TEntryList *elistFit = (TEntryList*)gDirectory->Get("listELFit");
64   chainCosmic->SetEntryList(elistFit);
65   //
66   //
67 }
68
69 void SetAlias(){
70
71   chainCosmic->SetAlias("dP0","(Tr0.fP[0]+Tr1.fP[0])");
72   chainCosmic->SetAlias("dP1","(Tr0.fP[1]-Tr1.fP[1])");
73   chainCosmic->SetAlias("dP2","(Tr1.fAlpha-Tr0.fAlpha+pi)");
74   chainCosmic->SetAlias("dP3","(Tr0.fP[3]+Tr1.fP[3])");
75   chainCosmic->SetAlias("dP4","(Tr0.fP[4]+Tr1.fP[4])");
76   //
77   chainCosmic->SetAlias("sP0","sqrt(Tr0.fC[0]+Tr1.fC[0])");
78   chainCosmic->SetAlias("sP1","sqrt(Tr0.fC[2]+Tr1.fC[2])");
79   chainCosmic->SetAlias("sP2","sqrt(Tr0.fC[5]+Tr0.fC[5])");
80   chainCosmic->SetAlias("sP3","sqrt(Tr0.fC[9]+Tr1.fC[9])");
81   chainCosmic->SetAlias("sP4","sqrt(Tr0.fC[14]+Tr1.fC[14])");
82   //
83   chainCosmic->SetAlias("dR","(1-abs(Tr0.fP[1]/250))");
84   chainCosmic->SetAlias("side","(-1+(Tr0.fP[1]>0)*2)");
85   chainCosmic->SetAlias("meanPt","((Tr0.Pt()+Tr1.Pt())/2.)");
86
87 }
88
89 void Correction(){
90   TStatToolkit toolkit;
91   Double_t chi2=0;
92   Int_t    npoints=0;
93   TVectorD fitParam;
94   TMatrixD covMatrix;
95   //
96   TString fstring="";
97   fstring+="side++";
98   //
99   fstring+="dR++";
100   fstring+="dR*dR++";
101   fstring+="Tr0.fP[3]++";
102   //
103   fstring+="dR*side++";
104   fstring+="dR*dR*side++";
105   fstring+="Tr0.fP[3]*side++";
106   //
107   TString * strP0 = TStatToolkit::FitPlane(chainCosmic,"dP0", fstring.Data(),"1", chi2,npoints,fitParam,covMatrix);
108   chainCosmic->SetAlias("corrP0",strP0->Data());
109
110   TString * strP1 = TStatToolkit::FitPlane(chainCosmic,"dP1", fstring.Data(),"!crossI&&!crossO", chi2,npoints,fitParam,covMatrix);
111   chainCosmic->SetAlias("corrP1",strP1->Data());
112
113   TString * strP2 = TStatToolkit::FitPlane(chainCosmic,"dP2", fstring.Data(),"1", chi2,npoints,fitParam,covMatrix);
114   chainCosmic->SetAlias("corrP2",strP2->Data());
115
116   TString * strP3 = TStatToolkit::FitPlane(chainCosmic,"dP3", fstring.Data(),"!crossI&&!crossO", chi2,npoints,fitParam,covMatrix);
117   chainCosmic->SetAlias("corrP3",strP3->Data());
118
119   TString * strP4 = TStatToolkit::FitPlane(chainCosmic,"dP4", fstring.Data(),"1", chi2,npoints,fitParam,covMatrix);
120   chainCosmic->SetAlias("corrP4",strP4->Data());
121
122 }
123
124
125
126 void DrawNClusterGeom(){
127   //
128   //
129   //
130   TH2F * hNd("hNd","hNd",50,0,190,100,10,160);
131   chainCosmic->Draw("Orig0.fTPCncls:sqrt(x00^2+x01^2)>>hNd",cutOx+cutOz+cutIx+cutIz);
132   hNd->FitSlicesY();
133   hNd_1->SetXTitle("DCA_{r} (cm)");
134   hNd_1->SetYTitle("Mean number of clusters");
135   gPad->SaveAs("pic/NCl_Radius.eps");
136   gPad->SaveAs("pic/NCl_Radius.gif");
137
138
139 }
140
141
142 void PtResolPt(){
143
144   TH2F * hdPtPt = new TH2F("hdPtPt","hdPtPt",20,0.5,50,100,-0.6,0.6);
145   TH2F * hdPtPtNoCor = new TH2F("hdPtPtNoCor","hdPtPtNoCor",20,0.5,50,100,-0.6,0.6);
146   TH2F * hdPtPtCor = new TH2F("hdPtPtCor","hdPtPtCor",20,0.5,50,100,-0.6,0.6);
147   //
148   AliTPCcalibV0::BinLogX(&hdPtPt);
149   AliTPCcalibV0::BinLogX(&hdPtPtNoCor);
150   AliTPCcalibV0::BinLogX(&hdPtPtCor);
151
152   chainCosmic->Draw("((Tr0.Pt()-Tr1.Pt())/meanPt)/sqrt(2.):meanPt>>hdPtPt",""+cutRun+cutS+cutN120,"");
153   chainCosmic->Draw("((dP4-corrP4)*meanPt)/sqrt(2.):meanPt>>hdPtPtCorr",""+cutRun+cutS+cutN120,"");
154   chainCosmic->Draw("(dP4*meanPt)/sqrt(2.):meanPt>>hdPtPtNoCorr",""+cutRun+cutS+cutN120,"");
155
156   hdPtPt->FitSlicesY();
157   hdPtPt_2->SetXTitle("p_{t} (GeV)");
158   hdPtPt_2->SetYTitle("#Deltap_{t}/p_{t} ");
159   hdPtPt_2->Draw();
160
161
162   TH2F * hdP4Pt = new TH2F("hdP4Pt","hdP4Pt",5,1,30,50,-0.05,0.05);
163   chainCosmic->Draw("(dP4-corrP4)/sqrt(2.):Tr0.Pt()>>hdP4Pt",""+cutRun+cutS+cutN120,"");
164   hdP4Pt->FitSlicesY();
165   hdP4Pt_2->SetXTitle("p_{t} (GeV)");
166   hdP4Pt_2->SetYTitle("#sigma 1/p_{t} (1/GeV)");
167   hdP4Pt_2->Draw();
168 }
169
170
171
172 void P0resolZ(){
173   //
174   //
175   //
176   TH2F * hdP0Z = new TH2F("hdP0Z","hdP0Z",10,-250,250,100,-3.05,3.05);
177   TH2F * hdP0ZNoCor = new TH2F("hdP0ZNoCor","hdP0ZNoCor",10,-250,250,100,-3.05,3.05);
178   chainCosmic->Draw("(dP0-corrP0)/sqrt(2.):x02>>hdP0Z",""+cutRun+cutS+cutN120,"");
179   chainCosmic->Draw("(dP0-0)/sqrt(2.):x02>>hdP0ZNoCor",""+cutRun+cutS+cutN120,"");
180   hdP0Z->FitSlicesY();
181   hdP0ZNoCor->FitSlicesY();
182   hdP0Z_2->SetMinimum(0);
183   hdP0Z_2->SetXTitle("Z position (cm)");
184   hdP0Z_2->SetYTitle("#sigma_{y} (cm)");
185   hdP0Z_2->SetMarkerStyle(25);  
186   hdP0ZNoCor_2->SetMarkerStyle(26);
187   hdP0Z_2->Draw();  
188   hdP0ZNoCor_2->Draw("same");
189   gPad->SaveAs("pic/SigmaY_z.gif");
190   gPad->SaveAs("pic/SigmaY_z.eps");
191   //
192   TH2F * hdPP0Z = new TH2F("hdPP0Z","hdPP0Z",8,-200,200,50,-5.05,5.05);
193   TH2F * hncdPP0Z = new TH2F("hncdPP0Z","hncdPP0Z",8,-200,200,50,-5.05,5.05);
194   chainCosmic->Draw("(dP0-corrP0)/sP0:x02>>hdPP0Z",""+cutRun+cutS+cutN120,"");
195   chainCosmic->Draw("(dP0-0)/sP0:x02>>hncdPP0Z",""+cutRun+cutS+cutN120,"");
196   hdPP0Z->FitSlicesY();
197   hncdPP0Z->FitSlicesY();
198   hdPP0Z_2->SetMarkerStyle(25);
199   hncdPP0Z_2->SetMarkerStyle(26);
200   hdPP0Z_2->SetMinimum(0);
201   hdPP0Z_2->SetXTitle("Z position (cm)");
202   hdPP0Z_2->SetYTitle("#sigma y - Pull ");
203   hdPP0Z_2->Draw();
204   hncdPP0Z_2->Draw("same");
205   gPad->SaveAs("pic/PullY_z.gif");
206   gPad->SaveAs("pic/PullY_z.eps");
207
208 }
209
210
211 void P0resol1Pt(){
212   //
213   // P0 - Y -DCA resolution as function of the 1/pt
214   //
215   TH2F * hdP01Pt = new TH2F("hdP01Pt","hdP01Pt",6,0,1.0,100,-1.05,1.05);
216   TH2F * hdP01PtNoCor = new TH2F("hdP01PtNoCor","hdP01PtNoCor",6,0,1.0,100,-1.05,1.05);
217   chainCosmic->Draw("(dP0-corrP0)/sqrt(2.):sqrt(1/meanPt)>>hdP01Pt","side>0"+cutRun+cutS,"");
218   chainCosmic->Draw("(dP0-0)/sqrt(2.):sqrt(1/meanPt)>>hdP01PtNoCor","side>0"+cutRun+cutS,"");
219   hdP01Pt->FitSlicesY();
220   hdP01PtNoCor->FitSlicesY();
221   hdP01Pt_2->SetMinimum(0);
222   hdP01Pt_2->SetXTitle("#sqrt{1/p_{t} (1/GeV)}");
223   hdP01Pt_2->SetYTitle("#sigma_{y} (cm)");
224   hdP01Pt_2->SetMarkerStyle(25);  
225   hdP01PtNoCor_2->SetMarkerStyle(26);
226   hdP01Pt_2->Draw();  
227   hdP01PtNoCor_2->Draw("same");
228   gPad->SaveAs("pic/SigmaY_1pt.gif");
229   gPad->SaveAs("pic/SigmaY_1pt.eps");
230
231   //
232   TH2F * hPullP01Pt = new TH2F("hhPullP01Pt","hhPullP01Pt",6,0,1,50,-5.05,5.05);
233   TH2F * hncPullP01Pt = new TH2F("hhncPullP01Pt","hhncPullP01Pt",6,0,1,50,-5.05,5.05);
234   chainCosmic->Draw("(dP0-corrP0)/sP0:sqrt(1/meanPt)>>hhPullP01Pt","side>0"+cutRun+cutS,"");
235   chainCosmic->Draw("(dP0-0)/sP0:sqrt(1/meanPt)>>hhncPullP01Pt","side>0"+cutRun+cutS,"");
236   hPullP01Pt->FitSlicesY();
237   hncPullP01Pt->FitSlicesY();
238   hhPullP01Pt_2->SetMarkerStyle(25);
239   hhncPullP01Pt_2->SetMarkerStyle(26);
240   hhPullP01Pt_2->SetMinimum(0);
241   hhPullP01Pt_2->SetXTitle("#sqrt{1/p_{t} (1/GeV)}");
242   hhPullP01Pt_2->SetYTitle("#sigma_{y} - Pull ");
243   hhPullP01Pt_2->Draw();
244   hhncPullP01Pt_2->Draw("same");
245   gPad->SaveAs("pic/PullY_1pt.gif");
246   gPad->SaveAs("pic/PullY_1pt.eps");
247 }
248
249
250 void P1resolZ(){
251   //
252   //
253   //
254   TH2F *hdP1Z = new TH2F("hdP1Z","hdP1Z",10,-250,250,100,-1.05,1.05);
255   TH2F *hdP1ZNoCor=new TH2F("hdP1ZNoCor","hdP1ZNoCor",10,-250,250,100,-1.05,1.05);
256   chainCosmic->Draw("(dP1-corrP1)/sqrt(2.):x02>>hdP1Z",""+cutRun+cutS+cutN120,"");
257   chainCosmic->Draw("(dP1-0)/sqrt(2.):x02>>hdP1ZNoCor",""+cutRun+cutS+cutN120,"");
258   hdP1Z->FitSlicesY();
259   hdP1ZNoCor->FitSlicesY();
260   hdP1Z_2->SetMinimum(0);
261   hdP1Z_2->SetXTitle("Z position (cm)");
262   hdP1Z_2->SetYTitle("#sigma_{z} (cm)");
263   hdP1Z_2->SetMarkerStyle(25);  
264   hdP1ZNoCor_2->SetMarkerStyle(26);
265   hdP1Z_2->Draw();  
266   hdP1ZNoCor_2->Draw("same");
267   gPad->SaveAs("pic/SigmaZ_z.gif");
268   gPad->SaveAs("pic/SigmaZ_z.eps");
269   //
270   TH2F * hdPP1Z = new TH2F("hdPP1Z","hdPP1Z",8,-200,200,50,-5.05,5.05);
271   TH2F * hncdPP1Z = new TH2F("hncdPP1Z","hncdPP1Z",8,-200,200,50,-5.05,5.05);
272   chainCosmic->Draw("(dP1-corrP1)/sP1:x02>>hdPP1Z",""+cutRun+cutS+cutN120,"");
273   chainCosmic->Draw("(dP1-0)/sP1:x02>>hncdPP1Z",""+cutRun+cutS+cutN120,"");
274   hdPP1Z->FitSlicesY();
275   hncdPP1Z->FitSlicesY();
276   hdPP1Z_2->SetMarkerStyle(25);
277   hncdPP1Z_2->SetMarkerStyle(26);
278   hdPP1Z_2->SetMinimum(0);
279   hdPP1Z_2->SetXTitle("Z position (cm)");
280   hdPP1Z_2->SetYTitle("#sigma_{z} (Unit) ");
281   hdPP1Z_2->Draw();
282   hncdPP1Z_2->Draw("same");
283   gPad->SaveAs("pic/PullZ_z.gif");
284   gPad->SaveAs("pic/PullZ_z.eps");
285
286 }
287
288
289 void P1resol1Pt(){
290   //
291   // P1 - Y -DCA resolution as function of the 1/pt
292   //
293   TH2F * hdP11Pt = new TH2F("hdP11Pt","hdP11Pt",6,0,1.0,100,-1.05,1.05);
294   TH2F * hdP11PtNoCor = new TH2F("hdP11PtNoCor","hdP11PtNoCor",6,0,1.0,100,-1.05,1.05);
295   chainCosmic->Draw("(dP1-corrP1)/sqrt(2.):sqrt(1/meanPt)>>hdP11Pt","side>0"+cutRun+cutS,"");
296   chainCosmic->Draw("(dP1-0)/sqrt(2.):sqrt(1/meanPt)>>hdP11PtNoCor","side>0"+cutRun+cutS,"");
297   hdP11Pt->FitSlicesY();
298   hdP11PtNoCor->FitSlicesY();
299   hdP11Pt_2->SetMinimum(0);
300   hdP11Pt_2->SetXTitle("#sqrt{1/p_{t} (1/GeV)}");
301   hdP11Pt_2->SetYTitle("#sigma_{z} (cm)");
302   hdP11Pt_2->SetMarkerStyle(25);  
303   hdP11PtNoCor_2->SetMarkerStyle(26);
304   hdP11Pt_2->Draw();  
305   hdP11PtNoCor_2->Draw("same");
306   gPad->SaveAs("pic/SigmaZ_1pt.gif");
307   gPad->SaveAs("pic/SigmaZ_1pt.eps");
308
309   //
310   TH2F * hPullP11Pt = new TH2F("hhPullP11Pt","hhPullP11Pt",6,0,1,50,-5.05,5.05);
311   TH2F * hncPullP11Pt = new TH2F("hhncPullP11Pt","hhncPullP11Pt",6,0,1,50,-5.05,5.05);
312   chainCosmic->Draw("(dP1-corrP1)/sP1:sqrt(1/meanPt)>>hhPullP11Pt","side>0"+cutRun+cutS,"");
313   chainCosmic->Draw("(dP1-0)/sP1:sqrt(1/meanPt)>>hhncPullP11Pt","side>0"+cutRun+cutS,"");
314   hPullP11Pt->FitSlicesY();
315   hncPullP11Pt->FitSlicesY();
316   hhPullP11Pt_2->SetMarkerStyle(25);
317   hhncPullP11Pt_2->SetMarkerStyle(26);
318   hhPullP11Pt_2->SetMinimum(0);
319   hhPullP11Pt_2->SetXTitle("#sqrt{1/p_{t} (1/GeV)}");
320   hhPullP11Pt_2->SetYTitle("#sigma_{z} - Pull ");
321   hhPullP11Pt_2->Draw();
322   hhncPullP11Pt_2->Draw("same");
323   gPad->SaveAs("pic/PullZ_1pt.gif");
324   gPad->SaveAs("pic/PullZ_1pt.eps");
325 }
326
327
328
329
330 void P4resolZ(){
331   //
332   //
333   //
334   TH2F *hdP4Z = new TH2F("hdP4Z","hdP4Z",10,-250,250,100,-0.05,0.05);
335   TH2F *hdP4ZNoCor=new TH2F("hdP4ZNoCor","hdP4ZNoCor",10,-250,250,100,-0.05,0.05);
336   chainCosmic->Draw("(dP4-corrP4)/sqrt(2.):x02>>hdP4Z",""+cutRun+cutS+cutN120,"");
337   chainCosmic->Draw("(dP4-0)/sqrt(2.):x02>>hdP4ZNoCor",""+cutRun+cutS+cutN120,"");
338   hdP4Z->FitSlicesY();
339   hdP4ZNoCor->FitSlicesY();
340   hdP4Z_2->SetMinimum(0);
341   hdP4Z_2->SetXTitle("Z position (cm)");
342   hdP4Z_2->SetYTitle("#sigma_{1/pt} (1/GeV)");
343   hdP4Z_2->SetMarkerStyle(25);  
344   hdP4ZNoCor_2->SetMarkerStyle(26);
345   hdP4Z_2->Draw();  
346   hdP4ZNoCor_2->Draw("same");
347   gPad->SaveAs("pic/Sigma1Pt_z.gif");
348   gPad->SaveAs("pic/Sigma1Pt_z.eps");
349   //
350   TH2F * hdPP4Z = new TH2F("hdPP4Z","hdPP4Z",8,-200,200,50,-5.05,5.05);
351   TH2F * hncdPP4Z = new TH2F("hncdPP4Z","hncdPP4Z",8,-200,200,50,-5.05,5.05);
352   chainCosmic->Draw("(dP4-corrP4)/sP4:x02>>hdPP4Z",""+cutRun+cutS+cutN120,"");
353   chainCosmic->Draw("(dP4-0)/sP4:x02>>hncdPP4Z",""+cutRun+cutS+cutN120,"");
354   hdPP4Z->FitSlicesY();
355   hncdPP4Z->FitSlicesY();
356   hdPP4Z_2->SetMarkerStyle(25);
357   hncdPP4Z_2->SetMarkerStyle(26);
358   hdPP4Z_2->SetMinimum(0);
359   hdPP4Z_2->SetXTitle("Z position (cm)");
360   hdPP4Z_2->SetYTitle("#sigma_{1/pt} - Pull ");
361   hdPP4Z_2->Draw();
362   hncdPP4Z_2->Draw("same");
363   gPad->SaveAs("pic/Pull1Pt_z.gif");
364   gPad->SaveAs("pic/Pull1Pt_z.eps");
365
366 }
367
368
369 void P4resol1Pt(){
370   //
371   // P4 - 1/Pt resolution as function of the 1/pt
372   //
373   TH2F * hdP41Pt = new TH2F("hdP41Pt","hdP41Pt",6,0,1.0,100,-0.05,0.05);
374   TH2F * hdP41PtNoCor = new TH2F("hdP41PtNoCor","hdP41PtNoCor",6,0,1.0,100,-0.05,0.05);
375   chainCosmic->Draw("(dP4-corrP4)/sqrt(2.):sqrt(1/meanPt)>>hdP41Pt","side>0"+cutRun+cutS+cutN120,"");
376   chainCosmic->Draw("(dP4-0)/sqrt(2.):sqrt(1/meanPt)>>hdP41PtNoCor","side>0"+cutRun+cutS+cutN120,"");
377   hdP41Pt->FitSlicesY();
378   hdP41PtNoCor->FitSlicesY();
379   hdP41Pt_2->SetMinimum(0);
380   hdP41Pt_2->SetXTitle("#sqrt{1/p_{t} (1/GeV)}");
381   hdP41Pt_2->SetYTitle("#sigma_{1/pt} (1/GeV)");
382   hdP41Pt_2->SetMarkerStyle(25);  
383   hdP41PtNoCor_2->SetMarkerStyle(26);
384   hdP41Pt_2->Draw();  
385   hdP41PtNoCor_2->Draw("same");
386   gPad->SaveAs("pic/Sigma1Pt_1pt.gif");
387   gPad->SaveAs("pic/Sigma1Pt_1pt.eps");
388
389   //
390   TH2F * hPullP41Pt = new TH2F("hhPullP41Pt","hhPullP41Pt",6,0,1,50,-5.05,5.05);
391   TH2F * hncPullP41Pt = new TH2F("hhncPullP41Pt","hhncPullP41Pt",6,0,1,50,-5.05,5.05);
392   chainCosmic->Draw("(dP4-corrP4)/sP4:sqrt(1/meanPt)>>hhPullP41Pt","side>0"+cutRun+cutS,"");
393   chainCosmic->Draw("(dP4-0)/sP4:sqrt(1/meanPt)>>hhncPullP41Pt","side>0"+cutRun+cutS,"");
394   hPullP41Pt->FitSlicesY();
395   hncPullP41Pt->FitSlicesY();
396   hhPullP41Pt_2->SetMarkerStyle(25);
397   hhncPullP41Pt_2->SetMarkerStyle(26);
398   hhPullP41Pt_2->SetMinimum(0);
399   hhPullP41Pt_2->SetXTitle("#sqrt{1/p_{t}} (1/GeV)}");
400   hhPullP41Pt_2->SetYTitle("#sigma_{1/pt} (Unit) ");
401   hhPullP41Pt_2->Draw();
402   hhncPullP41Pt_2->Draw("same");
403   gPad->SaveAs("pic/Pull1Pt_1pt.gif");
404   gPad->SaveAs("pic/Pull1Pt_1pt.eps");
405 }
406
407
408
409
410
411
412
413
414
415
416
417
418 void P2resol(){
419   //
420   //
421   //
422   TH2F * hdP2Z = new TH2F("hdP2Z","hdP2Z",10,-250,250,50,-0.02,0.02);
423   chainCosmic->Draw("(dP2-corrP2)/sqrt(2.):x02>>hdP2Z",""+cutRun+cutS+cutN120,"");
424   hdP2Z->FitSlicesY();
425   hdP2Z_2->SetXTitle("Z position (cm)");
426   hdP2Z_2->SetYTitle("#sigma phi (rad)");
427   hdP2Z_2->Draw();
428   //
429   TH2F * hdPP2Z = new TH2F("hdPP2Z","hdPP2Z",8,-200,200,50,-5.05,5.05);
430   chainCosmic->Draw("(dP2-corrP2)/sP2:x02>>hdPP2Z",""+cutRun+cutS+cutN120,"");
431   hdPP2Z->FitSlicesY();
432   hdPP2Z_2->SetXTitle("Z position (cm)");
433   hdPP2Z_2->SetYTitle("#sigma phi - Pull ");
434   hdPP2Z_2->Draw();
435 }
436
437 void P3resol(){
438   //
439   //
440   //
441   TH2F * hdP3Z("hdP3Z","hdP3Z",10,-250,250,50,-0.005,0.005);
442   chainCosmic->Draw("(dP3-corrP3)/sqrt(2.):x02>>hdP3Z",""+cutRun+cutS+cutN120,"");
443   hdP3Z->FitSlicesY();
444   hdP3Z_2->SetXTitle("Z position (cm)");
445   hdP3Z_2->SetYTitle("#sigma  (rad)");
446   hdP3Z_2->Draw();
447   //
448   TH2F * hdPP3Z("hdPP3Z","hdPP3Z",8,-200,200,50,-5.05,5.05);
449   chainCosmic->Draw("(dP3-corrP3)/sP3:x02>>hdPP3Z",""+cutRun+cutS+cutN120,"");
450   hdPP3Z->FitSlicesY();
451   hdPP3Z_2->SetXTitle("Z position (cm)");
452   hdPP3Z_2->SetYTitle("#sigma phi - Pull ");
453   hdPP3Z_2->Draw();
454 }
455
456
457
458
459
460
461
462 void PtResolN(){
463   //
464   //
465   //
466   TH2F * hdP4Ncl= new TH2F("hdp4Ncl","hdp4Ncl",5,80,160,100,-0.1,0.1);
467   chainCosmic->Draw("(dP4-corrP4)/sqrt(2.):min(Orig0.fTPCncls,Orig1.fTPCncls)>>hdp4Ncl","side>0"+cuthpt+cutRun+cutS,"");
468   hdp4Ncl->FitSlicesY();
469   hdp4Ncl_2->SetXTitle("Number of clusters");
470   hdp4Ncl_2->SetYTitle("#sigma 1/p_{t} (1/GeV)");
471   hdp4Ncl_2->Draw();
472   gPad->SaveAs("pic/Sigma1Pt_N.gif");
473   gPad->SaveAs("pic/Sigma1Pt_N.eps");
474
475   //
476   //
477   TH2F * hdP4PullNcl = new TH2F("hdP4PullNcl","hdP4PullNcl",5,80,160,100,-6.1,6.1);
478   chainCosmic->Draw("(Tr1.fP[4]+Tr0.fP[4])/sqrt(Tr1.fC[14]+Tr0.fC[14]):min(Orig0.fTPCncls,Orig1.fTPCncls)>>hdP4PullNcl","side>0"+cuthpt+cutRun+cutS,"");
479   hdP4PullNcl->FitSlicesY();
480   hdP4PullNcl_2->SetXTitle("Number of clusters");
481   hdP4PullNcl_2->SetYTitle("#sigma 1/p_{t} (Unit)");
482   hdP4PullNcl_2->Draw();
483   gPad->SaveAs("pic/Pull1Pt_N.gif");
484   gPad->SaveAs("pic/Pull1Pt_N.eps");
485
486 }
487
488
489
490
491