Fix Coverity leaks
[u/mrichter/AliRoot.git] / PWG1 / AliAnalysisTaskQASym.cxx
1 #include "TChain.h"
2 #include "TTree.h"
3 #include "TH1F.h"
4 #include "TH2F.h"
5 #include "TH3F.h"
6 #include "TCanvas.h"
7 #include "TList.h"
8 #include "TParticle.h"
9 #include "TParticlePDG.h"
10 #include "TProfile.h"
11
12 #include "AliAnalysisTask.h"
13 #include "AliAnalysisManager.h"
14
15 #include "AliESDEvent.h"
16 #include "AliLog.h"
17 #include "AliESDVertex.h"
18 #include "AliESDInputHandler.h"
19 #include "AliESDtrackCuts.h"
20 #include "AliMultiplicity.h"
21
22 #include "AliAnalysisTaskQASym.h"
23 #include "AliExternalTrackParam.h"
24 #include "AliTrackReference.h"
25 #include "AliHeader.h"
26 #include "AliGenEventHeader.h"
27 #include "AliGenDPMjetEventHeader.h"
28
29 // Analysis Task for basic QA on the ESD
30
31 // Authors: Jan Fiete Grosse-Oetringhaus, Christian Klein-Boesing,
32 //          Andreas Morsch, Eva Sicking
33
34 ClassImp(AliAnalysisTaskQASym)
35
36   //________________________________________________________________________
37   AliAnalysisTaskQASym::AliAnalysisTaskQASym(const char *name) 
38     : AliAnalysisTaskSE(name) 
39     ,fTrackType(0)
40     ,fStandAlone(0)
41     ,fLow(0)
42     ,fHigh(100)
43     ,fFieldOn(kTRUE)
44     ,fHists(0)
45     ,fHistRECpt(0)
46     ,fEta(0)
47     ,fEtaWidth(0)
48     ,fPhiWidth(0)
49     ,fDcaWidth(0)
50     ,fPtWidth(0)
51     ,fEtaPhi(0)
52     ,fEtaPt(0)
53     ,fQPt(0)
54     ,fDca(0)
55     ,fDcaZ(0)
56     ,fqRec(0)
57     ,fSigmaPtHist(0)
58     
59     ,fRecPtPos(0)
60     ,fRecPtNeg(0)
61     ,fRecPhiPos(0)
62     ,fRecPhiNeg(0)
63     ,fRecEtaPos(0)
64     ,fRecEtaNeg(0)
65     ,fRecEtaPtPos(0)
66     ,fRecEtaPtNeg(0)
67     ,fRecDcaPos(0)
68     ,fRecDcaNeg(0)
69     ,fRecDcaNegInv(0)
70     ,fRecDPos(0)
71     ,fRecDNeg(0)
72     
73     
74     ,fRecQPtPosEta(0)
75     ,fRecQPtNegEta(0)
76     ,fRecPtPosEta(0)
77     ,fRecPtNegEta(0)
78     ,fRecPhiPosEta(0)
79     ,fRecPhiNegEta(0)
80     ,fRecDcaPosEta(0)
81     ,fRecDcaNegEta(0)
82     ,fRecDPosEta(0)
83     ,fRecDNegEta(0)
84     
85     ,fRecPtPosVz(0)
86     ,fRecPtNegVz(0)
87     ,fRecEtaPosVz(0)
88     ,fRecEtaNegVz(0)
89     ,fRecPhiPosVz(0)
90     ,fRecPhiNegVz(0)
91     ,fSignedDcaPosVz(0)
92     ,fSignedDcaNegVz(0)
93     ,fRecQPtPosEtaVz(0)
94     ,fRecQPtNegEtaVz(0)
95     ,fRecEtaPtPosVz(0)
96     ,fRecEtaPtNegVz(0)
97     
98     
99     ,fDeltaPhiAll(0)
100     ,fDeltaPhiLeading(0) 
101     ,fDiffDcaD(0)
102     
103     ,fPhiRec(0)
104     ,fThetaRec(0)
105     ,fNumber(0)
106     ,fNumberAfterCut(0)
107     ,fVx(0)
108     ,fVy(0)
109     ,fVz(0)
110     ,fNVertexSPD(0)
111     ,fNVertexTracks(0)
112     ,fRecDcaPosPhi(0)
113     ,fRecDcaNegPhi(0)
114     ,fRecPtPosPhi(0)
115     ,fRecPtNegPhi(0)
116     ,fRecEtaPosPhi(0)
117     ,fRecEtaNegPhi(0)
118     ,fRecQPtPhi(0)
119     ,fRecEtaPtPosPhi(0)
120     ,fRecEtaPtNegPhi(0)
121
122     ,fRecPtPosEtaPos(0)
123     ,fRecPtNegEtaPos(0)
124     ,fRecPtPosEtaNeg(0)
125     ,fRecPtNegEtaNeg(0)
126
127     ,fRec1PtPosEtaPos(0)
128     ,fRec1PtNegEtaPos(0)
129     ,fRec1PtPosEtaNeg(0)
130     ,fRec1PtNegEtaNeg(0)
131
132     ,fRecPhiPosEtaPos(0)
133     ,fRecPhiNegEtaPos(0)
134     ,fRecPhiPosEtaNeg(0)
135     ,fRecPhiNegEtaNeg(0)
136
137     ,fRecDcaPosPhiEtaPos(0)
138     ,fRecDcaNegPhiEtaPos(0) 
139     ,fRecDcaPosPhiEtaNeg(0)  
140     ,fRecDcaNegPhiEtaNeg(0)  
141
142     ,fRecDcaPosPtEtaPos(0)
143     ,fRecDcaNegPtEtaPos(0) 
144     ,fRecDcaPosPtEtaNeg(0)  
145     ,fRecDcaNegPtEtaNeg(0)  
146   
147     ,fRecPtPosPhiEtaPos(0)  
148     ,fRecPtNegPhiEtaPos(0)  
149     ,fRecPtPosPhiEtaNeg(0) 
150     ,fRecPtNegPhiEtaNeg(0) 
151
152
153 //    ,fRecDcaPhiPtPosEtaPos(0)
154 //    ,fRecDcaPhiPtNegEtaPos(0)
155 //    ,fRecDcaPhiPtPosEtaNeg(0)  
156 //    ,fRecDcaPhiPtNegEtaNeg(0)  
157
158     ,fEtavPt(0)  
159     ,fPhivPt(0) 
160  
161     ,fCompareTPCparam(0)
162
163     ,fITSlayer(0)
164     ,fITSlayerEta(0)
165     ,fITSlayerPhi(0)
166
167     ,fCuts(0)
168
169 {
170   // Constructor
171   for(Int_t i = 0;i<4;++i){
172     fVertexX[i]=0;
173     fVertexY[i]=0;
174     fVertexZ[i]=0;
175   }
176
177   for(Int_t i = 0;i<18;++i){
178     fRecPtTpcSector[i] = 0;
179     fRecEtaTpcSector[i] = 0;
180     fSignedDcaTpcSector[i] = 0;
181     fRecQPtTpcSector[i] = 0;
182     fRecEtaPtTpcSector[i] = 0;
183   }
184
185   for(Int_t i = 0;i< 7;++i){
186     fRecPtPosLadder[i] = 0;
187     fRecPtNegLadder[i] = 0;
188     fRecPhiPosLadder[i] = 0;
189     fRecPhiNegLadder[i] = 0;
190     fRecEtaPosLadder[i] = 0;
191     fRecEtaNegLadder[i] = 0;
192     fSignDcaPos[i] = 0;
193     fSignDcaNeg[i] = 0;
194     fSignDcaNegInv[i] = 0;
195     fPtSigmaPos[i] =0;
196     fPtSigmaNeg[i] =0;
197     fqPtRec[i] =0;
198     fDcaSigmaPos[i] =0;
199     fDcaSigmaNeg[i] =0;
200   }
201
202   for(Int_t i = 0;i< 3;i++){
203     for(Int_t j = 0;j< 2;j++){
204       fEtaBinPt[i][j]=0;
205       fPhiBinPt[i][j]=0;
206       fDcaBinPt[i][j]=0;
207       fEtaPhiBinPt[i][j]=0;
208     }
209   }
210
211   DefineOutput(1,  TList::Class()); 
212
213   
214   
215 }
216
217
218 //________________________________________________________________________
219 void AliAnalysisTaskQASym::UserCreateOutputObjects()
220 {
221   // Create histograms
222   // Called once
223
224   Bool_t oldStatus = TH1::AddDirectoryStatus();
225   TH1::AddDirectory(kFALSE);
226
227   Double_t range = 0.3;
228   Double_t pt = 20.;
229
230   fHists = new TList();
231
232   fHistRECpt   = new TH1F("fHistRECpt", 
233                           " p_{T}",
234                           200, 0., pt);
235   fEta   = new TH1F("fEta", 
236                     " #eta",
237                     200, -2., 2.);
238   fEtaWidth   = new TH1F("fEtaWidth", 
239                          " #eta",
240                          200, -2., 2.);
241   fPhiWidth   = new TH1F("fPhiWidth", 
242                          " #phi",
243                          200, 0., 2*TMath::Pi());
244   fDcaWidth   = new TH1F("fDcaWidth", 
245                          "dca",
246                          200, -range*(1+Int_t(fTrackType/2)*9), range*(1+Int_t(fTrackType/2)*9));
247   fPtWidth   = new TH1F("fPtWidth", 
248                          "p_{T}",
249                          200, 0., pt);
250   fEtavPt   = new TH2F("fEtavPt", 
251                        " #eta -p_{T}",
252                        200, -2., 2.,
253                        100, -3, 4);
254   fPhivPt   = new TH2F("fPhivPt", 
255                        " #phi -p_{T}",
256                        200, 0, 2*TMath::Pi(),
257                        100, -3, 5);
258   fCompareTPCparam   = new TH2F("fCompareTPCparam", 
259                                 "fCompareTPCparam",
260                                 100, -1., 1.,100,-5, 5);
261
262   fITSlayer   = new TH1F("fITSlayer", 
263                          "fITSlayer",
264                          8, -1.5, 6.5);
265   fITSlayerEta   = new TH2F("fITSlayerEta", 
266                          "fITSlayerEta",
267                             8, -1.5, 6.5, 200, -2.,2.);
268   fITSlayerPhi   = new TH2F("fITSlayerPhi", 
269                             "fITSlayerPhi",
270                             8, -1.5, 6.5, 200, 0,2*TMath::Pi());
271   fEtaPhi   = new TH2F("fEtaPhi", 
272                        " #eta - #phi",
273                        200, -2., 2., 128, 0., 2. * TMath::Pi());
274   fThetaRec   = new TH1F("fThetaRec", 
275                          " #theta",
276                          180, 0., TMath::Pi());
277   fPhiRec   = new TH1F("fPhiRec", 
278                        " #phi",
279                        180, 0., 2*TMath::Pi());
280   fNumber   = new TH1F("fNumber", 
281                        "number of tracks per event",
282                        500, -5, 4995);
283   fNumberAfterCut   = new TH1F("fNumberAfterCut", 
284                                "number of tracks per event after cuts",
285                                500, -5, 4995);
286   fVx   = new TH1F("fVx", 
287                    "X of first track point",
288                    100, -1., 1.);
289   fVy   = new TH1F("fVy", 
290                    "Y of first track point",
291                    100, -1., 1.);
292   fVz   = new TH1F("fVz", 
293                    "Z of first track point",
294                    200, -50., 50.);
295   fNVertexSPD   = new TH1F("fNVertexSPD", 
296                         "Number of SPD vertices",
297                         10, -0.5, 9.5);
298   fNVertexTracks   = new TH1F("fNVertexTracks", 
299                               "Number of track vertices",
300                               10, -0.5, 9.5);
301   
302   fEtaPt   = new TH1F("fEtaPt", 
303                       " #eta/p_{T} ",
304                       100, -1., 1.);
305
306   fQPt   = new TH1F("fQPt", 
307                     " charge/p_{T} ",
308                     100, -1., 1.);
309
310   fDca   = new TH1F("fDca", 
311                     " dca ",
312                     200,  -range*(1+Int_t(fTrackType/2)*9), range*(1+Int_t(fTrackType/2)*9));
313
314   fDcaZ   = new TH1F("fDcaZ", "fDcaZ ",200,  -range*50*(1+Int_t(fTrackType/2)*9), range*50*(1+Int_t(fTrackType/2)*9));
315
316
317   fqRec    = new TH1F("fqRec",   
318                       " charge all reconstructed particle",
319                       21, -9.5, 10.5);
320   
321   fSigmaPtHist    = new TH1F("fSigmaPtHist",   
322                          "Log_{10}(#sigma_{p_{T}})",
323                          200, -4., 8.);
324
325
326   TString lable[4]={"", "SPD", "Track", "TPC"};
327   for(Int_t i=0;i<4;i++){
328     fVertexX[i]   = new TH1F(Form("fVertexX%s",lable[i].Data()),
329                              Form("fVertexX%s",lable[i].Data()),
330                              100, -1., 1.);
331     fVertexY[i]   = new TH1F(Form("fVertexY%s",lable[i].Data()),
332                              Form("fVertexY%s",lable[i].Data()),
333                              100, -1., 1.);
334     if(i==1 || i==2){
335       fVertexZ[i]   = new TH1F(Form("fVertexZ%s",lable[i].Data()),
336                                Form("fVertexZ%s",lable[i].Data()),
337                                200, -5., 5.);
338     }
339     else{
340       fVertexZ[i]   = new TH1F(Form("fVertexZ%s",lable[i].Data()),
341                                Form("fVertexZ%s",lable[i].Data()),
342                                200, -50., 50.);
343     }
344   }
345
346   //------------
347   for(Int_t ITSlayer_case=0;ITSlayer_case<7;ITSlayer_case++){
348
349     fSignDcaPos[ITSlayer_case]   = new TH1F(Form("fSignDcaPos%d", ITSlayer_case),  
350                                             " Signed dca", 
351                                             200, -range*(1+Int_t(fTrackType/2)*9), range*(1+Int_t(fTrackType/2)*9));
352     fSignDcaPos[ITSlayer_case]->GetXaxis()->SetTitle("dca");
353     fSignDcaPos[ITSlayer_case]->GetYaxis()->SetTitle("");
354    
355  
356     fSignDcaNeg[ITSlayer_case]   = new TH1F(Form("fSignDcaNeg%d", ITSlayer_case),  
357                                             " Signed dcas",
358                                             200, -range*(1+Int_t(fTrackType/2)*9), range*(1+Int_t(fTrackType/2)*9));
359     fSignDcaNeg[ITSlayer_case]->GetXaxis()->SetTitle("dca");
360     fSignDcaNeg[ITSlayer_case]->GetYaxis()->SetTitle("");
361
362     fSignDcaNegInv[ITSlayer_case]   = new TH1F(Form("fSignDcaNegInv%d", ITSlayer_case),  
363                                                " inverse Signed dca ",
364                                                200, -range*(1+Int_t(fTrackType/2)*9), range*(1+Int_t(fTrackType/2)*9));
365     fSignDcaNegInv[ITSlayer_case]->GetXaxis()->SetTitle("-dca");
366     fSignDcaNegInv[ITSlayer_case]->GetYaxis()->SetTitle("");
367
368
369
370
371     fPtSigmaPos[ITSlayer_case]   = new TH1F(Form("fPtSigmaPos%d", ITSlayer_case),  
372                                             " #sigma_{pT} ",
373                                             208, -4., 8.);
374     fPtSigmaPos[ITSlayer_case]->GetXaxis()->SetTitle("Log_{10}(#sigma_{pT})");
375     fPtSigmaPos[ITSlayer_case]->GetYaxis()->SetTitle("");
376     
377     
378     fPtSigmaNeg[ITSlayer_case]   = new TH1F(Form("fPtSigmaNeg%d",ITSlayer_case),  
379                                             " #sigma_{pT}",
380                                             208, -4., 8.);
381     fPtSigmaNeg[ITSlayer_case]->GetXaxis()->SetTitle("Log_{10}(#sigma_{pT})");
382     fPtSigmaNeg[ITSlayer_case]->GetYaxis()->SetTitle("");
383
384
385
386
387
388     fqPtRec[ITSlayer_case]   = new TH1F(Form("fqPtRec%d",ITSlayer_case),  
389                                         "q/ p_{T}",
390                                         200, -100., 100.);
391     fqPtRec[ITSlayer_case]->GetXaxis()->SetTitle("q_{tr}/p_{T, tr} (GeV/c)");
392     fqPtRec[ITSlayer_case]->GetYaxis()->SetTitle("");
393
394   
395    
396
397
398     fDcaSigmaPos[ITSlayer_case]   = new TH2F(Form("fDcaSigmaPos%d", ITSlayer_case),  
399                                              " p_{T} shift vs #sigma_{pT} ",
400                                              200, -range*(1+Int_t(fTrackType/2)*9), range*(1+Int_t(fTrackType/2)*9),200, -4., 4. );
401     fDcaSigmaPos[ITSlayer_case]->GetXaxis()->SetTitle("signed DCA)");
402     fDcaSigmaPos[ITSlayer_case]->GetYaxis()->SetTitle("log_{10}(#sigma_{pT})");
403     
404     
405     fDcaSigmaNeg[ITSlayer_case]   = new TH2F(Form("fDcaSigmaNeg%d", ITSlayer_case),  
406                                              " p_{T} shift vs #sigma_{pT} ",
407                                              200, -range*(1+Int_t(fTrackType/2)*9), range*(1+Int_t(fTrackType/2)*9),200, -4., 4. );
408     fDcaSigmaNeg[ITSlayer_case]->GetXaxis()->SetTitle("signed DCA");
409     fDcaSigmaNeg[ITSlayer_case]->GetYaxis()->SetTitle("log_{10}(#sigma_{pT})");
410
411
412   }
413     
414  
415     
416   // YIELDs---------- positive and negative particles
417     
418   fRecPtPos   = new TH1F("fRecPtPos", 
419                          " p_{T}",
420                          100, 0.,pt);
421   fRecPtPos->GetXaxis()->SetTitle("p_{T} (GeV/c)");
422   fRecPtNeg   = new TH1F("fRecPtNeg", 
423                          " p_{T} ",
424                          100, 0., pt);
425   fRecPtNeg->GetXaxis()->SetTitle("p_{T} (GeV/c)");
426
427     
428   fRecPhiPos   = new TH1F("fRecPhiPos", 
429                           "#phi",
430                           361, 0., 360.);
431   fRecPhiPos->GetXaxis()->SetTitle("#phi (deg)");
432   
433   fRecPhiNeg   = new TH1F("fRecPhiNeg", 
434                           "#phi ",
435                           361, 0., 360.);
436   fRecPhiNeg->GetXaxis()->SetTitle("#phi (deg)");
437     
438   fRecEtaPos   = new TH1F("fRecEtaPos", 
439                           "#eta",
440                           200, -2., 2.);
441   fRecEtaPos->GetXaxis()->SetTitle("#eta");
442
443   fRecEtaNeg   = new TH1F("fRecEtaNeg", 
444                           "#eta",
445                           200, -2., 2.);
446   fRecEtaNeg->GetXaxis()->SetTitle("#eta");
447     
448   fRecEtaPtPos   = new TH1F("fRecEtaPtPos", 
449                             "#eta/p_{T}",
450                             200, -0.1, .1);
451   fRecEtaPtPos->GetXaxis()->SetTitle("#eta/p_{T}");
452
453   fRecEtaPtNeg   = new TH1F("fRecEtaPtNeg", 
454                             "#eta/p_{T}",
455                             200, -.1, .1);
456   fRecEtaPtNeg->GetXaxis()->SetTitle("#eta/p_{T}");
457
458   fRecDcaPos   = new TH1F("fRecDcaPos", 
459                           " dca",
460                           100, -range*(1+Int_t(fTrackType/2)*9), range*(1+Int_t(fTrackType/2)*9));
461   fRecDcaPos->GetXaxis()->SetTitle("dca (cm)");
462   fRecDcaNeg   = new TH1F("fRecDcaNeg", 
463                           " dca",
464                           100, -range*(1+Int_t(fTrackType/2)*9), range*(1+Int_t(fTrackType/2)*9));
465   fRecDcaNeg->GetXaxis()->SetTitle("dca (cm)");
466
467   fRecDcaNegInv   = new TH1F("fRecDcaNegInv", 
468                              " dca",
469                              100, -range*(1+Int_t(fTrackType/2)*9), range*(1+Int_t(fTrackType/2)*9));
470   fRecDcaNegInv->GetXaxis()->SetTitle("dca (cm)");
471
472
473   fRecDPos   = new TH1F("fRecDPos", 
474                         " d",
475                         100, -range*(1+Int_t(fTrackType/2)*9), range*(1+Int_t(fTrackType/2)*9));
476   fRecDPos->GetXaxis()->SetTitle("d (cm)");
477   fRecDNeg   = new TH1F("fRecDNeg", 
478                         "d",
479                         100, -range*(1+Int_t(fTrackType/2)*9), range*(1+Int_t(fTrackType/2)*9));
480   fRecDNeg->GetXaxis()->SetTitle("d (cm)");
481
482
483   //  YIELDs ---------------- positive and negative eta
484     
485     
486   fRecQPtPosEta   = new TH1F("fRecQPtPosEta", 
487                              "q/p_{T}",
488                              200, -0.5, 0.5);
489   fRecQPtPosEta->GetXaxis()->SetTitle("q/p_{T} ");
490
491   fRecQPtNegEta   = new TH1F("fRecQPtNegEta", 
492                              "q/p_{T}",
493                              200, -0.5, 0.5);
494   fRecQPtNegEta->GetXaxis()->SetTitle("q/p_{T}");
495     
496   fRecPtPosEta   = new TH1F("fRecPtPosEta", 
497                             " p_{T} ",
498                             100, 0., pt);
499   fRecPtPosEta->GetXaxis()->SetTitle("p_{T} (GeV/c)");
500
501   fRecPtNegEta   = new TH1F("fRecPtNegEta", 
502                             " p_{T}",
503                             100, 0., pt);
504   fRecPtNegEta->GetXaxis()->SetTitle("p_{T} (GeV/c)");
505     
506   fRecPhiPosEta   = new TH1F("fRecPhiPosEta", 
507                              "#phi",
508                              361, 0., 360);
509   fRecPhiPosEta->GetXaxis()->SetTitle("#phi (deg)");
510
511   fRecPhiNegEta   = new TH1F("fRecPhiNegEta", 
512                              "#phi ",
513                              361, 0, 360);
514   fRecPhiNegEta->GetXaxis()->SetTitle("#phi (deg)");
515
516   fRecDcaPosEta   = new TH1F("fRecDcaPosEta", 
517                              " dca ",
518                              100, -range*(1+Int_t(fTrackType/2)*9), range*(1+Int_t(fTrackType/2)*9));
519   fRecDcaPosEta->GetXaxis()->SetTitle("dca (cm)");
520   fRecDcaNegEta   = new TH1F("fRecDcaNegEta", 
521                              " dca",
522                              100, -range*(1+Int_t(fTrackType/2)*9), range*(1+Int_t(fTrackType/2)*9));
523   fRecDcaNegEta->GetXaxis()->SetTitle("dca (cm)");
524
525   fRecDPosEta   = new TH1F("fRecDPosEta", 
526                            " d",
527                            100, -range*(1+Int_t(fTrackType/2)*9), range*(1+Int_t(fTrackType/2)*9));
528   fRecDPosEta->GetXaxis()->SetTitle("d (cm)");
529   fRecDNegEta   = new TH1F("fRecDNegEta", 
530                            "d",
531                            100, -5., 5.);
532   fRecDNegEta->GetXaxis()->SetTitle("d (cm)");
533
534   fRecDcaPosPhi   = new TH2F("fRecDcaPosPhi", 
535                              " dca vs. phi",
536                              100, -range*(1+Int_t(fTrackType/2)*9), range*(1+Int_t(fTrackType/2)*9), 180, 0, TMath::Pi()*2);
537   fRecDcaPosPhi->GetXaxis()->SetTitle("dca (cm)");
538   fRecDcaPosPhi->GetYaxis()->SetTitle("#phi (rad.)");
539   fRecDcaNegPhi   = new TH2F("fRecDcaNegPhi", 
540                              " dca vs. phi",
541                              100, -range*(1+Int_t(fTrackType/2)*9), range*(1+Int_t(fTrackType/2)*9), 180, 0, TMath::Pi()*2);
542   fRecDcaNegPhi->GetXaxis()->SetTitle("dca (cm)");
543   fRecDcaNegPhi->GetYaxis()->SetTitle("#phi (rad.)");
544
545   fRecPtPosPhi   = new TH2F("fRecPtPosPhi", 
546                              " log(p_T) vs. phi",
547                              100, -2.5, 2., 180, 0, TMath::Pi()*2);
548   fRecPtPosPhi->GetXaxis()->SetTitle("log_{10}(p_{T})");
549   fRecPtPosPhi->GetYaxis()->SetTitle("#phi (rad.)");
550   fRecPtNegPhi   = new TH2F("fRecPtNegPhi", 
551                              " log(p_T) vs. phi",
552                              100,-2.5 , 2., 180, 0, TMath::Pi()*2);
553   fRecPtNegPhi->GetXaxis()->SetTitle("log_{10}(p_{T})");
554   fRecPtNegPhi->GetYaxis()->SetTitle("#phi (rad.)");
555
556   fRecEtaPosPhi   = new TH2F("fRecEtaPosPhi", 
557                              " eta vs. phi",
558                              100, -1.5, 1.5, 180, 0, TMath::Pi()*2);
559   fRecEtaPosPhi->GetXaxis()->SetTitle("#eta");
560   fRecEtaPosPhi->GetYaxis()->SetTitle("#phi (rad.)");
561   fRecEtaNegPhi   = new TH2F("fRecEtaNegPhi", 
562                              " eta vs. phi",
563                              100, -1.5, 1.5, 180, 0, TMath::Pi()*2);
564   fRecEtaNegPhi->GetXaxis()->SetTitle("#eta");
565   fRecEtaNegPhi->GetYaxis()->SetTitle("#phi (rad.)");
566
567   fRecQPtPhi   = new TH2F("fRecQPtPhi", 
568                              " charge/p_T vs. phi",
569                              100,-1. , 1., 180, 0, TMath::Pi()*2);
570   fRecQPtPhi->GetXaxis()->SetTitle("charge/p_{T}");
571   fRecQPtPhi->GetYaxis()->SetTitle("#phi (rad.)");
572
573   fRecEtaPtPosPhi   = new TH2F("fRecEtaPtPosPhi", 
574                              " eta/p_T vs. phi",
575                              100, -5, 5., 180, 0, TMath::Pi()*2);
576   fRecEtaPtPosPhi->GetXaxis()->SetTitle("#eta/p_{T}");
577   fRecEtaPtPosPhi->GetYaxis()->SetTitle("#phi (rad.)");
578   fRecEtaPtNegPhi   = new TH2F("fRecEtaPtNegPhi", 
579                              " eta/p_T vs. phi",
580                              100,-5 , 5., 180, 0, TMath::Pi()*2);
581   fRecEtaPtNegPhi->GetXaxis()->SetTitle("#eta/p_{T}");
582   fRecEtaPtNegPhi->GetYaxis()->SetTitle("#phi (rad.)");
583
584
585
586
587
588   fRecDcaPosPhiEtaPos   = new TH2F("fRecDcaPosPhiEtaPos", 
589                              " dca vs. phi",
590                              100, -range*(1+Int_t(fTrackType/2)*9), range*(1+Int_t(fTrackType/2)*9), 180, 0, TMath::Pi()*2);
591   fRecDcaPosPhiEtaPos->GetXaxis()->SetTitle("dca (cm)");
592   fRecDcaPosPhiEtaPos->GetYaxis()->SetTitle("#phi (rad.)");
593   fRecDcaNegPhiEtaPos   = new TH2F("fRecDcaNegPhiEtaPos", 
594                              " dca vs. phi",
595                              100, -range*(1+Int_t(fTrackType/2)*9), range*(1+Int_t(fTrackType/2)*9), 180, 0, TMath::Pi()*2);
596   fRecDcaNegPhiEtaPos->GetXaxis()->SetTitle("dca (cm)");
597   fRecDcaNegPhiEtaPos->GetYaxis()->SetTitle("#phi (rad.)");
598
599   fRecPtPosPhiEtaPos   = new TH2F("fRecPtPosPhiEtaPos", 
600                              " log(p_T) vs. phi",
601                              100, -2.5, 2., 180, 0, TMath::Pi()*2);
602   fRecPtPosPhiEtaPos->GetXaxis()->SetTitle("log_{10}(p_{T})");
603   fRecPtPosPhiEtaPos->GetYaxis()->SetTitle("#phi (rad.)");
604   fRecPtNegPhiEtaPos   = new TH2F("fRecPtNegPhiEtaPos", 
605                              " log(p_T) vs. phi",
606                              100,-2.5 , 2., 180, 0, TMath::Pi()*2);
607   fRecPtNegPhiEtaPos->GetXaxis()->SetTitle("log_{10}(p_{T})");
608   fRecPtNegPhiEtaPos->GetYaxis()->SetTitle("#phi (rad.)");
609
610
611   fRecDcaPosPhiEtaNeg   = new TH2F("fRecDcaPosPhiEtaNeg", 
612                              " dca vs. phi",
613                              100, -range*(1+Int_t(fTrackType/2)*9), range*(1+Int_t(fTrackType/2)*9), 180, 0, TMath::Pi()*2);
614   fRecDcaPosPhiEtaNeg->GetXaxis()->SetTitle("dca (cm)");
615   fRecDcaPosPhiEtaNeg->GetYaxis()->SetTitle("#phi (rad.)");
616   fRecDcaNegPhiEtaNeg   = new TH2F("fRecDcaNegPhiEtaNeg", 
617                              " dca vs. phi",
618                              100, -range*(1+Int_t(fTrackType/2)*9), range*(1+Int_t(fTrackType/2)*9), 180, 0, TMath::Pi()*2);
619   fRecDcaNegPhiEtaNeg->GetXaxis()->SetTitle("dca (cm)");
620   fRecDcaNegPhiEtaNeg->GetYaxis()->SetTitle("#phi (rad.)");
621
622   fRecPtPosPhiEtaNeg   = new TH2F("fRecPtPosPhiEtaNeg", 
623                              " log(p_T) vs. phi",
624                              100, -2.5, 2., 180, 0, TMath::Pi()*2);
625   fRecPtPosPhiEtaNeg->GetXaxis()->SetTitle("log_{10}(p_{T})");
626   fRecPtPosPhiEtaNeg->GetYaxis()->SetTitle("#phi (rad.)");
627   fRecPtNegPhiEtaNeg   = new TH2F("fRecPtNegPhiEtaNeg", 
628                              " log(p_T) vs. phi",
629                              100,-2.5 , 2., 180, 0, TMath::Pi()*2);
630   fRecPtNegPhiEtaNeg->GetXaxis()->SetTitle("log_{10}(p_{T})");
631   fRecPtNegPhiEtaNeg->GetYaxis()->SetTitle("#phi (rad.)");
632   
633   //new
634   fRecDcaPosPtEtaPos   = new TH2F("fRecDcaPosPtEtaPos", 
635                              " dca vs. pt",
636                              100, -range*(1+Int_t(fTrackType/2)*9), range*(1+Int_t(fTrackType/2)*9), 200, -2, 2);
637   fRecDcaPosPtEtaPos->GetXaxis()->SetTitle("dca (cm)");
638   fRecDcaPosPtEtaPos->GetYaxis()->SetTitle("log_{10}(p_{T})");
639
640   fRecDcaPosPtEtaNeg   = new TH2F("fRecDcaPosPtEtaNeg", 
641                              " dca vs. pt",
642                              100, -range*(1+Int_t(fTrackType/2)*9), range*(1+Int_t(fTrackType/2)*9), 200, -2, 2);
643   fRecDcaPosPtEtaNeg->GetXaxis()->SetTitle("dca (cm)");
644   fRecDcaPosPtEtaNeg->GetYaxis()->SetTitle("log_{10}(p_{T})");
645
646   fRecDcaNegPtEtaPos   = new TH2F("fRecDcaNegPtEtaPos", 
647                              " dca vs. pt",
648                              100, -range*(1+Int_t(fTrackType/2)*9), range*(1+Int_t(fTrackType/2)*9), 200, -2, 2);
649   fRecDcaNegPtEtaPos->GetXaxis()->SetTitle("dca (cm)");
650   fRecDcaNegPtEtaPos->GetYaxis()->SetTitle("log_{10}(p_{T})");
651
652   fRecDcaNegPtEtaNeg   = new TH2F("fRecDcaNegPtEtaNeg", 
653                              " dca vs. pt",
654                              100, -range*(1+Int_t(fTrackType/2)*9), range*(1+Int_t(fTrackType/2)*9), 200, -2, 2);
655   fRecDcaNegPtEtaNeg->GetXaxis()->SetTitle("dca (cm)");
656   fRecDcaNegPtEtaNeg->GetYaxis()->SetTitle("log_{10}(p_{T})");
657     
658
659
660   //  YIELDs ---------------- for TPC sectors
661   for(Int_t sector=0; sector<18;sector++){
662       
663
664     fRecPtTpcSector[sector]   = new TH1F(Form("fRecPtTpcSector%02d",sector), 
665                                          Form("p_{T} distribution: TPC sector %d",
666                                               sector),100, 0., pt);
667     fRecPtTpcSector[sector]->GetXaxis()->SetTitle("p_{T} (GeV/c)");
668
669     fRecEtaTpcSector[sector]   = new TH1F(Form("fRecEtaTpcSector%02d",sector), 
670                                           Form("#eta distribution: TPC sector %d",
671                                                sector),200, -2., 2.);
672     fRecEtaTpcSector[sector]->GetXaxis()->SetTitle("p_{T} (GeV/c)");
673      
674
675     fSignedDcaTpcSector[sector]   = new TH1F(Form("fSignedDcaTpcSector%02d",sector), 
676                                              Form("dca distribution: TPC sector %d",
677                                                   sector),200, -range*(1+Int_t(fTrackType/2)*9), range*(1+Int_t(fTrackType/2)*9) );
678     fSignedDcaTpcSector[sector]->GetXaxis()->SetTitle("dca");
679
680     fRecQPtTpcSector[sector]   = new TH1F(Form("fRecQPtTpcSector%02d",sector), 
681                                           Form("Q/ p_{T} distribution: TPC sector %d",
682                                                sector),100, -1., 1.);
683     fRecQPtTpcSector[sector]->GetXaxis()->SetTitle("Q/p_{T} (GeV/c)");
684
685     fRecEtaPtTpcSector[sector]   = new TH1F(Form("fRecEtaPtTpcSector%02d",sector), 
686                                             Form("#eta/ p_{T} distribution: TPC sector %d",
687                                                  sector),100, -1., 1.);
688     fRecEtaPtTpcSector[sector]->GetXaxis()->SetTitle("#eta/p_{T} (GeV/c)");
689  
690   }
691   // YIELDS ITS ladder
692   for(Int_t i=0;i<7;i++){
693     fRecPtPosLadder[i]   = new TH1F(Form("fRecPtPosLadder%d", i), 
694                                     " p_{T} distribution",
695                                     100, 0., pt);
696     fRecPtPosLadder[i]->GetXaxis()->SetTitle("p_{T} (GeV/c)");
697     fRecPtNegLadder[i]   = new TH1F(Form("fRecPtNegLadder%d",i), 
698                                     " p_{T} distribution ",
699                                     100, 0., pt);
700     fRecPtNegLadder[i]->GetXaxis()->SetTitle("p_{T} (GeV/c)");
701
702
703     fRecPhiPosLadder[i]   = new TH1F(Form("fRecPhiPosLadder%d",i), 
704                                      "#phi distribution: all pos eta",
705                                      361, 0., 360);
706     fRecPhiPosLadder[i]->GetXaxis()->SetTitle("#phi (deg)");
707       
708     fRecPhiNegLadder[i]   = new TH1F(Form("fRecPhiNegLadder%d", i),
709                                      "#phi distribution: all neg eta",
710                                      361, 0, 360);
711     fRecPhiNegLadder[i]->GetXaxis()->SetTitle("#phi (deg)");
712
713
714
715     fRecEtaPosLadder[i]   = new TH1F(Form("fRecEtaPosLadder%d",i), 
716                                      "#eta distribution",
717                                      200, -2., 2.);
718     fRecEtaPosLadder[i]->GetXaxis()->SetTitle("#eta)");
719       
720     fRecEtaNegLadder[i]   = new TH1F(Form("fRecEtaNegLadder%d", i),
721                                      "#eta distribution",
722                                      200, -2., 2.);
723     fRecEtaNegLadder[i]->GetXaxis()->SetTitle("#eta");
724   }
725
726   Double_t vzmax = 15.;
727
728   fRecPtPosVz = new TH2F("fRecPtPosVz", 
729                          "p_{T} distribution vs Vz()",
730                          100, -1., 2., 200,-vzmax,vzmax);
731   fRecPtPosVz->GetXaxis()->SetTitle("log_{10}(p_{T})");
732     
733   fRecPtNegVz = new TH2F("fRecPtNegVz",
734                          "p_{T} distribution vs Vz()",
735                          100, -1., 2.,200,-vzmax,vzmax);
736   fRecPtNegVz->GetXaxis()->SetTitle("Log_{10}(p_{T})");
737     
738    
739   fRecEtaPosVz= new TH2F("fRecEtaPosVz", 
740                          "#eta distribution vs Vz()",
741                          100, -2., 2., 200,-vzmax,vzmax);
742   fRecEtaPosVz->GetXaxis()->SetTitle("#eta");
743   fRecEtaNegVz = new TH2F("fRecEtaNegVz",
744                           "#eta distribution vs Vz()",
745                           100, -2., 2.,200,-vzmax,vzmax);
746   fRecEtaNegVz->GetXaxis()->SetTitle("#eta");
747
748   fRecPhiPosVz= new TH2F("fRecPhiPosVz", 
749                          "#eta distribution vs Vz()",
750                          361, 0., 360., 200,-vzmax,vzmax);
751   fRecPhiPosVz->GetXaxis()->SetTitle("#phi (deg)");
752   fRecPhiNegVz = new TH2F("fRecPhiNegVz",
753                           "dca vs Vz()",
754                           361, 0., 360.,200,-vzmax,vzmax);
755   fRecPhiNegVz->GetXaxis()->SetTitle("#phi (deg)");
756
757   fSignedDcaPosVz= new TH2F("fSignedDcaPosVz", 
758                             "#eta distribution vs Vz()",
759                             200, -range*(1+Int_t(fTrackType/2)*9), range*(1+Int_t(fTrackType/2)*9), 200,-vzmax,vzmax);
760   fSignedDcaPosVz->GetXaxis()->SetTitle("dca (cm)");
761   fSignedDcaNegVz = new TH2F("fSignedDcaNegVz",
762                              "dca vs Vz()",
763                              200, -range*(1+Int_t(fTrackType/2)*9), range*(1+Int_t(fTrackType/2)*9),200,-vzmax,vzmax);
764   fSignedDcaNegVz->GetXaxis()->SetTitle("dca (cm)");
765
766   fRecQPtPosEtaVz= new TH2F("fRecQPtPosEtaVz",
767                             " Q/p_{T} distribution vs Vz()",
768                             100, -1., 1., 200,-vzmax,vzmax);
769   fRecQPtPosEtaVz->GetXaxis()->SetTitle("Q/p_{T}");
770   fRecQPtNegEtaVz = new TH2F("fRecQPtNegEtaVz",
771                              " Q/p_{T} distribution vs Vz()",
772                              100, -1., 1.,200,-vzmax,vzmax);
773   fRecQPtNegEtaVz->GetXaxis()->SetTitle("Q/p_{T}");
774
775  
776   fRecEtaPtPosVz= new TH2F("fRecEtaPtPosVz",
777                            " #eta/p_{T} distribution vs Vz()",
778                            100, -1., 1., 200,-vzmax,vzmax);
779   fRecEtaPtPosVz->GetXaxis()->SetTitle("#eta/p_{T");
780   fRecEtaPtNegVz = new TH2F("fRecEtaPtNegVz",
781                             " #eta/p_{T} distribution vs Vz()",
782                             100, -1., 1.,200,-vzmax,vzmax);
783   fRecEtaPtNegVz->GetXaxis()->SetTitle("#eta/p_{T}");
784
785   //new
786   fDeltaPhiAll = new TH1F("fDeltaPhiAll",
787                           " #Delta #phi",200,-360,360);
788   fDeltaPhiAll->GetXaxis()->SetTitle("#Delta #phi");
789
790
791   fDeltaPhiLeading = new TH2F("fDeltaPhiLeading",
792                               " #Delta #phi",361,-360,360, 361,0, 360);
793   fDeltaPhiLeading->GetXaxis()->SetTitle("#Delta #phi (deg.)");
794   fDeltaPhiLeading->GetYaxis()->SetTitle("#phi_{leading particle} (deg.)");
795
796   fDiffDcaD    = new TH1F("fDiffDcaD",   
797                           "dca-d",
798                           200, -1., 1.);
799
800   
801   fRecPtPosEtaPos = new TH1F("fRecPtPosEtaPos",
802                              "p_{T} distribution",100,0,pt);
803   fRecPtPosEtaPos->GetXaxis()->SetTitle("p_{T} (GeV/c)");
804
805   fRecPtNegEtaPos = new TH1F("fRecPtNegEtaPos",
806                              "p_{T} distribution",100,0,pt);
807   fRecPtNegEtaPos->GetXaxis()->SetTitle("p_{T} (GeV/c)");
808
809   fRecPtPosEtaNeg = new TH1F("fRecPtPosEtaNeg",
810                              "p_{T} distribution",100,0,pt);
811   fRecPtPosEtaNeg->GetXaxis()->SetTitle("p_{T} (GeV/c)");
812
813   fRecPtNegEtaNeg = new TH1F("fRecPtNegEtaNeg",
814                              "p_{T} distribution",100,0,pt);
815   fRecPtNegEtaNeg->GetXaxis()->SetTitle("p_{T} (GeV/c)");
816
817
818
819   fRec1PtPosEtaPos = new TH1F("fRec1PtPosEtaPos",
820                              "1/p_{T} distribution",100,0,0.5);
821   fRec1PtPosEtaPos->GetXaxis()->SetTitle("p_{T} (c/GeV)");
822
823   fRec1PtNegEtaPos = new TH1F("fRec1PtNegEtaPos",
824                              "1/p_{T} distribution",100,0,0.5);
825   fRec1PtNegEtaPos->GetXaxis()->SetTitle("p_{T} (c/GeV)");
826
827   fRec1PtPosEtaNeg = new TH1F("fRec1PtPosEtaNeg",
828                              "1/p_{T} distribution",100,0,0.5);
829   fRec1PtPosEtaNeg->GetXaxis()->SetTitle("p_{T} (c/GeV)");
830
831   fRec1PtNegEtaNeg = new TH1F("fRec1PtNegEtaNeg",
832                              "1/p_{T} distribution",100,0,0.5);
833   fRec1PtNegEtaNeg->GetXaxis()->SetTitle("1/p_{T} (c/GeV)");
834
835
836  
837   fRecPhiPosEtaPos = new TH1F("fRecPhiPosEtaPos",
838                              "#phi",180,0,2*TMath::Pi());
839   fRecPhiPosEtaPos->GetXaxis()->SetTitle("#phi (rad.)");
840
841   fRecPhiNegEtaPos = new TH1F("fRecPhiNegEtaPos",
842                              "#phi",180,0,2*TMath::Pi());
843   fRecPhiNegEtaPos->GetXaxis()->SetTitle("#phi (rad.)");
844
845   fRecPhiPosEtaNeg = new TH1F("fRecPhiPosEtaNeg",
846                              "#phi",180,0,2*TMath::Pi());
847   fRecPhiPosEtaNeg->GetXaxis()->SetTitle("#phi (rad.)");
848
849   fRecPhiNegEtaNeg = new TH1F("fRecPhiNegEtaNeg",
850                              "#phi",180,0,2*TMath::Pi());
851   fRecPhiNegEtaNeg->GetXaxis()->SetTitle("#phi (rad.)");
852
853
854
855 //   fRecDcaPhiPtPosEtaPos = new TH3F("fRecDcaPhiPtPosEtaPos",
856 //                                 "#phi- p_{T} - DCA",
857 //                                 180,0,2*TMath::Pi(),
858 //                                 100,0,pt,
859 //                                 100, -range*(1+Int_t(fTrackType/2)*9), range*(1+Int_t(fTrackType/2)*9));
860 //   fRecDcaPhiPtPosEtaPos->GetXaxis()->SetTitle("#phi (rad.)");
861 //   fRecDcaPhiPtPosEtaPos->GetYaxis()->SetTitle("p_{T} (GeV/c)");
862 //   fRecDcaPhiPtPosEtaPos->GetZaxis()->SetTitle("dca (cm)");
863
864 //   fRecDcaPhiPtPosEtaNeg = new TH3F("fRecDcaPhiPtPosEtaNeg",
865 //                                 "#phi- p_{T} - DCA",
866 //                                 180,0,2*TMath::Pi(),
867 //                                 100,0,pt,
868 //                                 100, -range*(1+Int_t(fTrackType/2)*9), range*(1+Int_t(fTrackType/2)*9));
869 //   fRecDcaPhiPtPosEtaNeg->GetZaxis()->SetTitle("dca (cm)");
870 //   fRecDcaPhiPtPosEtaNeg->GetXaxis()->SetTitle("#phi (rad.)");
871 //   fRecDcaPhiPtPosEtaNeg->GetYaxis()->SetTitle("p_{T} (GeV/c)");
872
873 //   fRecDcaPhiPtNegEtaPos = new TH3F("fRecDcaPhiPtNegEtaPos",
874 //                                 "#phi- p_{T} - DCA",
875 //                                 180,0,2*TMath::Pi(),
876 //                                 100,0,pt,
877 //                                 100, -range*(1+Int_t(fTrackType/2)*9), range*(1+Int_t(fTrackType/2)*9));
878 //   fRecDcaPhiPtNegEtaPos->GetZaxis()->SetTitle("dca (cm)");
879 //   fRecDcaPhiPtNegEtaPos->GetXaxis()->SetTitle("#phi (rad.)");
880 //   fRecDcaPhiPtNegEtaPos->GetYaxis()->SetTitle("p_{T} (GeV/c)");
881
882 //   fRecDcaPhiPtNegEtaNeg = new TH3F("fRecDcaPhiPtNegEtaNeg",
883 //                                 "#phi- p_{T} - DCA",
884 //                                 180,0,2*TMath::Pi(),
885 //                                 100,0,pt,
886 //                                 100, -range*(1+Int_t(fTrackType/2)*9), range*(1+Int_t(fTrackType/2)*9));
887 //   fRecDcaPhiPtNegEtaNeg->GetZaxis()->SetTitle("dca (cm)");
888 //   fRecDcaPhiPtNegEtaNeg->GetYaxis()->SetTitle("#phi (rad.)");
889 //   fRecDcaPhiPtNegEtaNeg->GetXaxis()->SetTitle("p_{T} (GeV/c)");
890
891   TString charge[2];
892   charge[0]="Pos";
893   charge[1]="Neg";
894
895   for(Int_t i=0;i<3;i++){
896     for(Int_t j=0;j<2;j++){
897       fEtaBinPt[i][j]   = new TH1F(Form("fEtaBinPt%d%s", i, charge[j].Data()), 
898                                    "eta",
899                                    200, -2., 2.);
900       fPhiBinPt[i][j]   = new TH1F(Form("fPhiBinPt%d%s", i,charge[j].Data() ), 
901                                    "phi",
902                                    181, 0, 2*TMath::Pi());
903       fDcaBinPt[i][j]   = new TH1F(Form("fDcaBinPt%d%s", i, charge[j].Data()), 
904                                    "DCA",
905                                    200,-range*(1+Int_t(fTrackType/2)*9),
906                                    range*(1+Int_t(fTrackType/2)*9) );
907       fEtaPhiBinPt[i][j]= new TH2F(Form("fEtaPhiBinPt%d%s", i, charge[j].Data()), 
908                                       "eta-phi",
909                                       200, -2., 2., 200, 0.,2*TMath::Pi());
910     }
911   }
912
913
914   fHists->SetOwner();
915
916   fHists->Add(fHistRECpt);
917   fHists->Add(fEta);
918   fHists->Add(fEtaWidth);
919   fHists->Add(fPhiWidth);
920   fHists->Add(fDcaWidth);
921   fHists->Add(fPtWidth);
922   fHists->Add(fEtavPt);
923   fHists->Add(fPhivPt);
924   fHists->Add(fCompareTPCparam);
925   fHists->Add(fITSlayer);
926   fHists->Add(fITSlayerEta);
927   fHists->Add(fITSlayerPhi);
928   fHists->Add(fEtaPhi);
929   fHists->Add(fThetaRec);
930   fHists->Add(fPhiRec);
931   fHists->Add(fNumber);
932   fHists->Add(fNumberAfterCut);
933   fHists->Add(fVx);
934   fHists->Add(fVy);
935   fHists->Add(fVz);
936   fHists->Add(fNVertexSPD);
937   fHists->Add(fNVertexTracks);
938
939   fHists->Add(fEtaPt);
940   fHists->Add(fQPt);
941   fHists->Add(fDca);
942   fHists->Add(fDcaZ);
943
944   fHists->Add(fDeltaPhiAll);
945   fHists->Add(fDeltaPhiLeading);
946   fHists->Add(fDiffDcaD);
947
948   fHists->Add(fqRec);
949   fHists->Add(fSigmaPtHist);
950
951   fHists->Add(fRecPtPos);
952   fHists->Add(fRecPtNeg);
953   fHists->Add(fRecPhiPos);
954   fHists->Add(fRecPhiNeg);
955   fHists->Add(fRecEtaPos);
956   fHists->Add(fRecEtaNeg);
957   fHists->Add(fRecEtaPtPos);
958   fHists->Add(fRecEtaPtNeg);
959   fHists->Add(fRecDcaPos);
960   fHists->Add(fRecDcaNeg);
961   fHists->Add(fRecDcaNegInv);
962   fHists->Add(fRecDPos);
963   fHists->Add(fRecDNeg);
964
965
966   fHists->Add(fRecQPtPosEta);
967   fHists->Add(fRecQPtNegEta);
968   fHists->Add(fRecPtPosEta);
969   fHists->Add(fRecPtNegEta);
970   fHists->Add(fRecPhiPosEta);
971   fHists->Add(fRecPhiNegEta);
972   fHists->Add(fRecDcaPosEta);
973   fHists->Add(fRecDcaNegEta);
974   fHists->Add(fRecDPosEta);
975   fHists->Add(fRecDNegEta);
976
977   for(Int_t i=0;i<4;i++){
978     fHists->Add(fVertexX[i]);
979     fHists->Add(fVertexY[i]);
980     fHists->Add(fVertexZ[i]);
981   }
982   for(Int_t i=0;i<18;i++){
983     fHists->Add(fRecPtTpcSector[i]);
984     fHists->Add(fRecEtaTpcSector[i]);
985     fHists->Add(fSignedDcaTpcSector[i]);
986     fHists->Add(fRecQPtTpcSector[i]);
987     fHists->Add(fRecEtaPtTpcSector[i]);
988   }
989
990   for(Int_t i=0;i<7;i++){
991     fHists->Add(fRecPtPosLadder[i]);
992     fHists->Add(fRecPtNegLadder[i]);
993     fHists->Add(fRecPhiPosLadder[i]);
994     fHists->Add(fRecPhiNegLadder[i]);
995     fHists->Add(fRecEtaPosLadder[i]);
996     fHists->Add(fRecEtaNegLadder[i]);
997   }
998
999   fHists->Add(fRecPtPosVz);
1000   fHists->Add(fRecPtNegVz);
1001   fHists->Add(fRecEtaPosVz);
1002   fHists->Add(fRecEtaNegVz);
1003   fHists->Add(fRecPhiPosVz);
1004   fHists->Add(fRecPhiNegVz);
1005   fHists->Add(fSignedDcaPosVz);
1006   fHists->Add(fSignedDcaNegVz);
1007   fHists->Add(fRecQPtPosEtaVz);
1008   fHists->Add(fRecQPtNegEtaVz);
1009   fHists->Add(fRecEtaPtPosVz);
1010   fHists->Add(fRecEtaPtNegVz);
1011
1012
1013   for(Int_t i=0;i<7;i++){
1014     fHists->Add(fSignDcaPos[i]);
1015     fHists->Add(fSignDcaNeg[i]);
1016     fHists->Add(fSignDcaNegInv[i]);
1017  
1018     fHists->Add(fPtSigmaPos[i]);
1019     fHists->Add(fPtSigmaNeg[i]);
1020     fHists->Add(fqPtRec[i]);
1021   
1022     fHists->Add(fDcaSigmaPos[i]);
1023     fHists->Add(fDcaSigmaNeg[i]);
1024  
1025
1026   } 
1027   
1028   fHists->Add(fRecDcaPosPhi);
1029   fHists->Add(fRecDcaNegPhi);   
1030   fHists->Add(fRecPtPosPhi);
1031   fHists->Add(fRecPtNegPhi);   
1032   fHists->Add(fRecEtaPosPhi);
1033   fHists->Add(fRecEtaNegPhi);  
1034   fHists->Add(fRecQPtPhi);   
1035   fHists->Add(fRecEtaPtPosPhi);
1036   fHists->Add(fRecEtaPtNegPhi);   
1037
1038   fHists->Add(fRecPtPosEtaPos);   
1039   fHists->Add(fRecPtNegEtaPos);   
1040   fHists->Add(fRecPtPosEtaNeg);   
1041   fHists->Add(fRecPtNegEtaNeg); 
1042
1043   fHists->Add(fRec1PtPosEtaPos);   
1044   fHists->Add(fRec1PtNegEtaPos);   
1045   fHists->Add(fRec1PtPosEtaNeg);   
1046   fHists->Add(fRec1PtNegEtaNeg);   
1047  
1048
1049   fHists->Add(fRecPhiPosEtaPos);   
1050   fHists->Add(fRecPhiNegEtaPos);   
1051   fHists->Add(fRecPhiPosEtaNeg);   
1052   fHists->Add(fRecPhiNegEtaNeg);   
1053
1054   fHists->Add(fRecDcaPosPhiEtaPos);
1055   fHists->Add(fRecDcaNegPhiEtaPos);   
1056   fHists->Add(fRecPtPosPhiEtaPos);
1057   fHists->Add(fRecPtNegPhiEtaPos);  
1058   fHists->Add(fRecDcaPosPhiEtaNeg);
1059   fHists->Add(fRecDcaNegPhiEtaNeg);   
1060   fHists->Add(fRecPtPosPhiEtaNeg);
1061   fHists->Add(fRecPtNegPhiEtaNeg); 
1062
1063   fHists->Add(fRecDcaPosPtEtaPos);
1064   fHists->Add(fRecDcaNegPtEtaPos);
1065   fHists->Add(fRecDcaPosPtEtaNeg);
1066   fHists->Add(fRecDcaNegPtEtaNeg);
1067
1068   //  fHists->Add(fRecDcaPhiPtPosEtaPos); 
1069   //  fHists->Add(fRecDcaPhiPtPosEtaNeg); 
1070   //  fHists->Add(fRecDcaPhiPtNegEtaPos); 
1071   //  fHists->Add(fRecDcaPhiPtNegEtaNeg); 
1072
1073   for(Int_t i=0;i<3;i++){
1074     for(Int_t j=0;j<2;j++){
1075       fHists->Add(fEtaBinPt[i][j]);
1076       fHists->Add(fPhiBinPt[i][j]);
1077       fHists->Add(fDcaBinPt[i][j]);
1078       fHists->Add(fEtaPhiBinPt[i][j]);
1079     }
1080   }
1081
1082     
1083 //   for (Int_t i=0; i<fHists->GetEntries(); ++i) {
1084 //     TH1 *h1 = dynamic_cast<TH1*>(fHists->At(i));
1085 //     if (h1){
1086 //     //  Printf("%s ",h1->GetName());
1087 //       h1->Sumw2();
1088 //     }
1089 //   }
1090
1091   TH1::AddDirectory(oldStatus);
1092   PostData(1, fHists);
1093
1094 }
1095
1096 //__________________________________________________________
1097
1098 void AliAnalysisTaskQASym::UserExec(Option_t *) 
1099 {
1100   // QA of global, TPC, ITS and ITS stand alone tracks
1101   // exploiting basic symmetries
1102
1103   AliVEvent *event = InputEvent();
1104   if (!event) {
1105     Printf("ERROR: Could not retrieve event");
1106     return;
1107   }
1108
1109
1110   if(Entry()==0){
1111     AliESDEvent* esd = dynamic_cast<AliESDEvent*>(event);
1112     if(esd){
1113       Printf("We are reading from ESD");
1114     }
1115    
1116   }
1117
1118
1119
1120   if(fDebug>1)Printf("There are %d tracks in this event", event->GetNumberOfTracks());
1121
1122   
1123   Int_t   leadingTrack  =   0;
1124   Float_t leadingEnergy = -20.;
1125   Float_t leadingPhi    =   0;//TMath::Pi();
1126
1127
1128   //check vertices
1129   AliESDEvent* esd = dynamic_cast<AliESDEvent*>(event);
1130   Int_t nPileSPDVertices=1+esd->GetNumberOfPileupVerticesSPD(); // also SPD main vertex
1131   Int_t nPileTrkVertices=esd->GetNumberOfPileupVerticesTracks();
1132   fNVertexSPD->Fill(nPileSPDVertices);
1133   fNVertexTracks->Fill(nPileTrkVertices);
1134
1135   //check primary vertex
1136   Float_t vx = 0;
1137   Float_t vy = 0;
1138   Float_t vz = 0;
1139
1140   //primary vertex: contribution from different vertexers
1141   const AliVVertex* vertex = event->GetPrimaryVertex();
1142   if(vertex){
1143     vx = vertex->GetX();
1144     vy = vertex->GetY();
1145     vz = vertex->GetZ();
1146     if(vertex->GetNContributors()>0){
1147       fVertexX[0]->Fill(vx);
1148       fVertexY[0]->Fill(vy);
1149       fVertexZ[0]->Fill(vz);     
1150     }
1151   }
1152   
1153   const AliVVertex* vertexSPD = esd->GetPrimaryVertexSPD();
1154   if(vertexSPD){
1155     if(vertexSPD->GetNContributors()>0){
1156       fVertexX[1]->Fill(vertexSPD->GetX());
1157       fVertexY[1]->Fill(vertexSPD->GetX());
1158       fVertexZ[1]->Fill(vertexSPD->GetX());
1159     }
1160   }
1161
1162   const AliVVertex* vertexTrack = esd->GetPrimaryVertexTracks();
1163   if(vertexTrack){
1164     if(vertexTrack->GetNContributors()>0){
1165       fVertexX[2]->Fill(vertexTrack->GetX());
1166       fVertexY[2]->Fill(vertexTrack->GetX());
1167       fVertexZ[2]->Fill(vertexTrack->GetX());
1168     }
1169   }
1170
1171   const AliVVertex* vertexTPC = esd->GetPrimaryVertexTPC();
1172   if(vertexTPC){
1173     if(vertexTPC->GetNContributors()>0){
1174       fVertexX[3]->Fill(vertexTPC->GetX());
1175       fVertexY[3]->Fill(vertexTPC->GetX());
1176       fVertexZ[3]->Fill(vertexTPC->GetX());
1177     }
1178   }
1179
1180   //cuts on general vertex
1181   if(vertex->GetNContributors()<1) return;
1182   if (TMath::Abs(vz) > 10.) return;
1183
1184   fNumber->Fill(event->GetNumberOfTracks());
1185
1186   AliESDtrack *tpcP = 0x0;
1187   Int_t fNTracksAccepted=0;
1188   const Int_t arrSize = event->GetNumberOfTracks();
1189   Float_t * phiArray      = new Float_t[arrSize];
1190   Float_t * etaArray      = new Float_t[arrSize];
1191   Float_t * ptArray       = new Float_t[arrSize];
1192   Float_t * dcaArray      = new Float_t[arrSize];
1193   Int_t   * chargeArray   = new Int_t  [arrSize];
1194   Bool_t  * acceptedArray = new Bool_t [arrSize];
1195
1196   for (Int_t i = 0; i < event->GetNumberOfTracks(); i++) {
1197     phiArray[i]     = 0.;
1198     etaArray[i]     = 0.;
1199     ptArray[i]      = 0.;
1200     dcaArray[i]     = 0.;
1201     chargeArray[i]  = 0;
1202     acceptedArray[i]= kFALSE;
1203     
1204   }
1205
1206
1207
1208   for (Int_t iTrack = 0; iTrack < event->GetNumberOfTracks(); iTrack++) {
1209     
1210     //prevent mem leak for TPConly track
1211     if(fTrackType==2&&tpcP){
1212       delete tpcP;
1213       tpcP = 0;
1214     }
1215
1216     AliVParticle *track = event->GetTrack(iTrack);
1217     AliESDtrack *esdtrack =  dynamic_cast<AliESDtrack*>(track);
1218     esdtrack->PropagateToDCA(event->GetPrimaryVertex(),
1219                              event->GetMagneticField(), 10000.);
1220
1221     if (!track) {
1222       Printf("ERROR: Could not receive track %d", iTrack);
1223       continue;
1224     }
1225     //__________
1226     // run Task for global tracks or ITS tracks or TPC tracks
1227     const AliExternalTrackParam *tpcPin = 0x0;
1228     Double_t phiIn=0.;
1229
1230     if(fTrackType==0){
1231       //Fill all histograms with global tracks
1232       tpcP = esdtrack;
1233       phiIn = tpcP->Phi();
1234       if (!tpcP) continue;
1235       if (!fCuts->AcceptTrack(tpcP)) continue;
1236     }
1237     else if(fTrackType==1){
1238       //Fill all histograms with ITS tracks
1239       tpcP = esdtrack;
1240       phiIn = tpcP->Phi();
1241       if (!tpcP) continue;
1242       if (!fCuts->AcceptTrack(tpcP)) continue;
1243       if(fStandAlone==kTRUE) {
1244         if(!(tpcP->GetStatus()&AliESDtrack::kITSpureSA))continue;
1245       }
1246       else if(fStandAlone==kFALSE){
1247         if(tpcP->GetStatus()&AliESDtrack::kITSpureSA)continue;
1248       }
1249     }
1250     else if(fTrackType==2){     
1251       //Fill all histograms with TPC track information
1252       tpcPin = esdtrack->GetInnerParam();
1253       if (!tpcPin) continue;
1254       phiIn=tpcPin->Phi();
1255
1256       tpcP = AliESDtrackCuts::GetTPCOnlyTrack(dynamic_cast<AliESDEvent*>(event),esdtrack->GetID());
1257       if (!tpcP) continue;
1258       if (!fCuts->AcceptTrack(tpcP)) continue;
1259       if(tpcP->GetNcls(1)>160)continue;//jacek's track cut
1260       if(tpcP->GetConstrainedChi2TPC()<0)continue; // jacek's track cut
1261     }
1262     else{
1263       Printf("ERROR: wrong track type \n");
1264       continue;
1265     }
1266     //___________
1267     //
1268   
1269
1270     fNTracksAccepted++;
1271     phiArray[iTrack]     = phiIn;
1272     etaArray[iTrack]     = tpcP->Eta();
1273     ptArray[iTrack]      = tpcP->Pt();
1274     chargeArray[iTrack]  = tpcP->Charge();
1275     acceptedArray[iTrack]= kTRUE;
1276
1277  
1278     if(tpcP->E()>leadingEnergy){
1279       leadingTrack=iTrack;
1280       leadingEnergy=tpcP->E();
1281       leadingPhi=phiIn;
1282     }
1283    
1284     
1285     fqRec->Fill(tpcP->Charge());
1286   
1287
1288     Double_t fSigmaPt = tpcP->GetSigma1Pt2();
1289     fSigmaPt= sqrt(fSigmaPt);
1290     fSigmaPt= fSigmaPt *(tpcP->Pt()*tpcP->Pt()); 
1291
1292     if(TMath::Abs(fSigmaPt) < 1.e-10) continue;
1293
1294     fSigmaPtHist->Fill(TMath::Log10(fSigmaPt));
1295  
1296
1297     // hits in ITS layer
1298     Int_t cas=-1;
1299     if(tpcP->HasPointOnITSLayer(0)) 
1300       cas=0;
1301     else if(!tpcP->HasPointOnITSLayer(0)
1302             &&  tpcP->HasPointOnITSLayer(1)) 
1303       cas=1;
1304     else if(!tpcP->HasPointOnITSLayer(0)
1305             && !tpcP->HasPointOnITSLayer(1) 
1306             &&  tpcP->HasPointOnITSLayer(2)) 
1307       cas=2;
1308     else if(!tpcP->HasPointOnITSLayer(0)
1309             && !tpcP->HasPointOnITSLayer(1) 
1310             && !tpcP->HasPointOnITSLayer(2)
1311             &&  tpcP->HasPointOnITSLayer(3)) 
1312       cas=3;
1313     else if(!tpcP->HasPointOnITSLayer(0)
1314             && !tpcP->HasPointOnITSLayer(1) 
1315             && !tpcP->HasPointOnITSLayer(2)
1316             && !tpcP->HasPointOnITSLayer(3)
1317             &&  tpcP->HasPointOnITSLayer(4)) 
1318       cas=4;
1319     else if(   !tpcP->HasPointOnITSLayer(0)
1320                && !tpcP->HasPointOnITSLayer(1)
1321                && !tpcP->HasPointOnITSLayer(2)
1322                && !tpcP->HasPointOnITSLayer(3)
1323                && !tpcP->HasPointOnITSLayer(4) 
1324                &&  tpcP->HasPointOnITSLayer(5)) 
1325       cas=5;
1326     else 
1327       cas=6;
1328   
1329    
1330    
1331     //------------------- 
1332     Float_t fXVertexCor = 0.;
1333     Float_t fYVertexCor = 0.;
1334
1335     fXVertexCor = tpcP->Xv() - vertex->GetX(); // coordinate corrected for vertex position
1336     fYVertexCor = tpcP->Yv() - vertex->GetY(); // "
1337     Double_t fSignedDca = (tpcP->Py()*fXVertexCor - tpcP->Px()*fYVertexCor)/tpcP->Pt();
1338
1339
1340     fqPtRec[cas]->Fill(tpcP->Charge()/tpcP->Pt());
1341     
1342     
1343
1344     fHistRECpt->Fill(tpcP->Pt());
1345     fEta->Fill(tpcP->Eta());
1346     fEtavPt->Fill(tpcP->Eta(), TMath::Log(tpcP->Pt()));
1347     fPhivPt->Fill(phiIn, TMath::Log(tpcP->Pt()));
1348     fEtaPhi->Fill(tpcP->Eta(), phiIn);
1349     fThetaRec->Fill(tpcP->Theta());
1350     fPhiRec->Fill(phiIn);
1351     fVx->Fill(tpcP->Xv());
1352     fVy->Fill(tpcP->Yv());
1353     fVz->Fill(tpcP->Zv());
1354   
1355
1356     fEtaPt->Fill(tpcP->Eta()/tpcP->Pt());
1357     fQPt->Fill(tpcP->Charge()/tpcP->Pt());
1358     fDca->Fill(fSignedDca);
1359     dcaArray[iTrack]=fSignedDca;
1360     fRecQPtPhi->Fill(tpcP->Charge()/tpcP->Pt(), phiIn);
1361
1362     Float_t fXY = 0.;
1363     Float_t  fZ = 0.;
1364
1365     tpcP->GetImpactParameters(fXY,fZ);
1366     fDiffDcaD->Fill(fSignedDca+fXY);
1367     fDcaZ->Fill(fZ);
1368     
1369     if(fTrackType==2) fCompareTPCparam->Fill(fZ,tpcPin->GetTgl());
1370
1371     if(fTrackType!=2){//for global and ITS tracks
1372       for(Int_t itsLayer=0;itsLayer<6;itsLayer++){
1373         if(tpcP->HasPointOnITSLayer(itsLayer)){
1374           fITSlayer->Fill(itsLayer);
1375           fITSlayerEta->Fill(itsLayer, tpcP->Eta());
1376           fITSlayerPhi->Fill(itsLayer, tpcP->Phi());
1377         }
1378       }    
1379     }
1380
1381     //for positive particles
1382     
1383     if(tpcP->Charge()>0){
1384       fRecPtPos->Fill(tpcP->Pt());
1385       fRecPtPosLadder[cas]->Fill(tpcP->Pt());
1386       fRecPtPosVz->Fill(TMath::Log10(tpcP->Pt()),tpcP->Zv());
1387       fRecPhiPos->Fill(TMath::RadToDeg()*phiIn);
1388       
1389       
1390       fRecPhiPosLadder[cas]->Fill(TMath::RadToDeg()*phiIn);
1391       fRecPhiPosVz->Fill(TMath::RadToDeg()*phiIn,tpcP->Zv());
1392       fSignedDcaPosVz->Fill(fSignedDca,tpcP->Zv());
1393
1394       fRecEtaPos->Fill(tpcP->Eta());
1395       fRecEtaPosLadder[cas]->Fill(tpcP->Eta());
1396       fRecEtaPtPos->Fill(tpcP->Eta()/tpcP->Pt());
1397       fRecEtaPosVz->Fill(tpcP->Eta(),tpcP->Zv());
1398       fRecEtaPtPosVz->Fill(tpcP->Eta()/tpcP->Pt(),tpcP->Zv());
1399      
1400       fRecDcaPos->Fill(fSignedDca);
1401       fRecDcaPosPhi->Fill(fSignedDca, phiIn);
1402       fRecPtPosPhi->Fill(TMath::Log10(tpcP->Pt()), phiIn);
1403       fRecEtaPtPosPhi->Fill(tpcP->Eta()/tpcP->Pt(), phiIn);
1404       fRecEtaPosPhi->Fill(tpcP->Eta(), phiIn);
1405       fRecDPos->Fill(fXY);
1406       fSignDcaPos[cas]->Fill(fSignedDca);
1407     
1408      
1409       fDcaSigmaPos[cas]->Fill(fSignedDca, TMath::Log10(fSigmaPt));
1410     
1411       fPtSigmaPos[cas]->Fill(TMath::Log10(fSigmaPt));
1412       //pos eta
1413       if(tpcP->Eta()>0){
1414         fRecPtPosEtaPos->Fill(tpcP->Pt());
1415         fRec1PtPosEtaPos->Fill(1/tpcP->Pt());
1416         fRecPhiPosEtaPos->Fill(phiIn);
1417         fRecDcaPosPhiEtaPos->Fill(fSignedDca, phiIn);
1418         fRecDcaPosPtEtaPos->Fill(fSignedDca, TMath::Log10(tpcP->Pt()));
1419         fRecPtPosPhiEtaPos->Fill(TMath::Log10(tpcP->Pt()), phiIn);
1420         //fRecDcaPhiPtPosEtaPos->Fill(phiIn, tpcP->Pt(), fSignedDca);
1421       }
1422       //neg eta
1423       else{
1424         fRecPtPosEtaNeg->Fill(tpcP->Pt());
1425         fRec1PtPosEtaNeg->Fill(1/tpcP->Pt());
1426         fRecPhiPosEtaNeg->Fill(phiIn);
1427         fRecDcaPosPhiEtaNeg->Fill(fSignedDca, phiIn);
1428         fRecDcaPosPtEtaNeg->Fill(fSignedDca, TMath::Log10(tpcP->Pt()));
1429         fRecPtPosPhiEtaNeg->Fill(TMath::Log10(tpcP->Pt()), phiIn);
1430         //fRecDcaPhiPtPosEtaNeg->Fill(phiIn, tpcP->Pt(), fSignedDca);
1431       }
1432       
1433     }
1434     //and negative particles
1435     else {
1436       fRecPtNeg->Fill(tpcP->Pt());
1437       fRecPtNegLadder[cas]->Fill(tpcP->Pt());
1438       fRecPtNegVz->Fill(TMath::Log10(tpcP->Pt()),tpcP->Zv());
1439            
1440       fRecPhiNeg->Fill(TMath::RadToDeg()*phiIn);
1441       fRecPhiNegLadder[cas]->Fill(TMath::RadToDeg()*phiIn);
1442       fRecPhiNegVz->Fill(TMath::RadToDeg()*phiIn,tpcP->Zv());
1443       fSignedDcaNegVz->Fill(fSignedDca,tpcP->Zv());
1444       fRecEtaPtNegVz->Fill(tpcP->Eta()/tpcP->Pt(),tpcP->Zv());
1445
1446       fRecEtaNeg->Fill(tpcP->Eta());
1447       fRecEtaNegLadder[cas]->Fill(tpcP->Eta());
1448       fRecEtaPtNeg->Fill(tpcP->Eta()/tpcP->Pt());
1449       fRecEtaNegVz->Fill(tpcP->Eta(),tpcP->Zv());
1450      
1451       fRecDcaNeg->Fill(fSignedDca);
1452       fRecDcaNegInv->Fill(-fSignedDca);
1453       fRecDcaNegPhi->Fill(fSignedDca, phiIn);
1454       fRecPtNegPhi->Fill(TMath::Log10(tpcP->Pt()), phiIn);
1455       fRecEtaNegPhi->Fill(tpcP->Eta(), phiIn);
1456       fRecEtaPtNegPhi->Fill(tpcP->Eta()/tpcP->Pt(), phiIn);
1457       fRecDNeg->Fill(fXY);
1458       fSignDcaNeg[cas]->Fill(fSignedDca);
1459       fSignDcaNegInv[cas]->Fill(-fSignedDca);
1460      
1461      
1462       fDcaSigmaNeg[cas]->Fill(fSignedDca,TMath::Log10(fSigmaPt));
1463    
1464       fPtSigmaNeg[cas]->Fill(TMath::Log10(fSigmaPt));
1465       
1466       //pos eta
1467       if(tpcP->Eta()>0){
1468         fRecPtNegEtaPos->Fill(tpcP->Pt());
1469         fRec1PtNegEtaPos->Fill(1/tpcP->Pt());
1470         fRecPhiNegEtaPos->Fill(phiIn);
1471         fRecDcaNegPhiEtaPos->Fill(fSignedDca, phiIn);
1472         fRecDcaNegPtEtaPos->Fill(fSignedDca, TMath::Log10(tpcP->Pt()));
1473         fRecPtNegPhiEtaPos->Fill(TMath::Log10(tpcP->Pt()), phiIn);
1474         //fRecDcaPhiPtNegEtaPos->Fill(phiIn, tpcP->Pt(), fSignedDca);
1475       }
1476       //neg eta
1477       else{
1478         fRecPtNegEtaNeg->Fill(tpcP->Pt());
1479         fRec1PtNegEtaNeg->Fill(1/tpcP->Pt());
1480         fRecPhiNegEtaNeg->Fill(phiIn);
1481         fRecDcaNegPhiEtaNeg->Fill(fSignedDca, phiIn);
1482         fRecDcaNegPtEtaNeg->Fill(fSignedDca, TMath::Log10(tpcP->Pt()));
1483         fRecPtNegPhiEtaNeg->Fill(TMath::Log10(tpcP->Pt()), phiIn);
1484         //fRecDcaPhiPtNegEtaNeg->Fill(phiIn, tpcP->Pt(), fSignedDca);
1485       }
1486
1487     }
1488     
1489
1490
1491     //all particles with positive eta
1492     if(tpcP->Eta()>0){
1493       fRecQPtPosEta->Fill(tpcP->Charge()/tpcP->Pt());
1494       fRecPtPosEta->Fill(tpcP->Pt());
1495       fRecPhiPosEta->Fill(TMath::RadToDeg()*phiIn);
1496       fRecQPtPosEtaVz->Fill(tpcP->Charge()/tpcP->Pt(),tpcP->Zv());
1497       fRecDcaPosEta->Fill(fSignedDca);
1498       fRecDPosEta->Fill(fXY);
1499     }
1500     //all particles with negative eta (and eta==0)
1501     else{
1502       fRecQPtNegEta->Fill(tpcP->Charge()/tpcP->Pt());
1503       fRecPtNegEta->Fill(tpcP->Pt());
1504       fRecPhiNegEta->Fill(TMath::RadToDeg()*phiIn);
1505       fRecQPtNegEtaVz->Fill(tpcP->Charge()/tpcP->Pt(),tpcP->Zv());
1506       fRecDcaNegEta->Fill(fSignedDca);
1507       fRecDNegEta->Fill(fXY);
1508
1509     }
1510
1511
1512     fRecPtTpcSector[Int_t(phiIn*
1513                           TMath::RadToDeg()/20)]->Fill(tpcP->Pt());
1514     fRecEtaTpcSector[Int_t(phiIn*
1515                            TMath::RadToDeg()/20)]->Fill(tpcP->Eta());
1516     fSignedDcaTpcSector[Int_t(phiIn*
1517                               TMath::RadToDeg()/20)]->Fill(fSignedDca); 
1518     fRecQPtTpcSector[Int_t(phiIn*
1519                            TMath::RadToDeg()/20)]->Fill(tpcP->Charge()/tpcP->Pt());
1520     fRecEtaPtTpcSector[Int_t(phiIn*
1521                              TMath::RadToDeg()/20)]->Fill(tpcP->Eta()/tpcP->Pt());
1522      
1523
1524
1525 //     // another track loop
1526 //     for (Int_t iTrack2 = 0; iTrack2 < event->GetNumberOfTracks(); iTrack2++) {
1527       
1528 //       if(LeadingTrack==iTrack2) continue;
1529
1530 //       AliVParticle *track2 = event->GetTrack(iTrack2);
1531 //       AliESDtrack* esdtrack2 =  dynamic_cast<AliESDtrack*>(track2);
1532 //       if (!track2) {
1533 //      Printf("ERROR: Could not receive track %d", iTrack);
1534 //      continue;
1535 //       }
1536 //       if (!fCuts->AcceptTrack(esdtrack2)) continue;
1537 //       //propagate to dca
1538 //       esdtrack2->PropagateToDCA(event->GetPrimaryVertex(),
1539 //                              event->GetMagneticField(), 10000.);
1540  
1541 //       fDeltaPhiLeading->Fill((LeadingPhi-esdtrack2->Phi())*TMath::RadToDeg(),
1542 //                           LeadingPhi*TMath::RadToDeg() );
1543
1544      
1545
1546 //     }//second track loop
1547
1548     // if(fTrackType==2) delete tpcP; // delete in case of TPCOnlyTrack
1549
1550   }//first track loop
1551
1552   fNumberAfterCut->Fill(fNTracksAccepted);
1553   
1554   //second track loop
1555  
1556   for (Int_t iT = 0; iT < event->GetNumberOfTracks(); iT++) {
1557     if(acceptedArray[iT]){
1558       if(ptArray[iT]>0.2 && ptArray[iT]<1. ){
1559         fEtaBinPt[0][Bool_t(chargeArray[iT]>0)]->Fill(etaArray[iT]);
1560         fDcaBinPt[0][Bool_t(chargeArray[iT]>0)]->Fill(dcaArray[iT]);
1561         fPhiBinPt[0][Bool_t(chargeArray[iT]>0)]->Fill(phiArray[iT]);
1562         fEtaPhiBinPt[0][Bool_t(chargeArray[iT]>0)]->Fill(etaArray[iT], phiArray[iT]);
1563       }
1564       else if(ptArray[iT]>1. && ptArray[iT]<5.){
1565         fEtaBinPt[1][Bool_t(chargeArray[iT]>0)]->Fill(etaArray[iT]);
1566         fDcaBinPt[1][Bool_t(chargeArray[iT]>0)]->Fill(dcaArray[iT]);
1567         fPhiBinPt[1][Bool_t(chargeArray[iT]>0)]->Fill(phiArray[iT]);
1568         fEtaPhiBinPt[1][Bool_t(chargeArray[iT]>0)]->Fill(etaArray[iT], phiArray[iT]);
1569       }
1570       else if (ptArray[iT]>5.){
1571         fEtaBinPt[2][Bool_t(chargeArray[iT]>0)]->Fill(etaArray[iT]);
1572         fDcaBinPt[2][Bool_t(chargeArray[iT]>0)]->Fill(dcaArray[iT]);
1573         fPhiBinPt[2][Bool_t(chargeArray[iT]>0)]->Fill(phiArray[iT]);
1574         fEtaPhiBinPt[2][Bool_t(chargeArray[iT]>0)]->Fill(etaArray[iT], phiArray[iT]);
1575       }
1576
1577       if(fNTracksAccepted>=fLow&&fNTracksAccepted<=fHigh){
1578         fEtaWidth->Fill(etaArray[iT]);
1579         fPhiWidth->Fill(phiArray[iT]);
1580         fDcaWidth->Fill(dcaArray[iT]);
1581         fPtWidth->Fill(ptArray[iT]);
1582        }
1583      }
1584   }
1585
1586
1587   //prevent mem leak for TPConly track
1588   if(fTrackType==2&&tpcP){
1589     delete tpcP;
1590     tpcP = 0;
1591   }
1592
1593   if(phiArray){
1594     delete[] phiArray; 
1595     phiArray=0; 
1596   }
1597   
1598   if(etaArray){
1599     delete[] etaArray; 
1600     etaArray=0; 
1601   }
1602   
1603   if(dcaArray){
1604     delete[] dcaArray; 
1605     dcaArray=0; 
1606   }
1607   
1608   if(ptArray){
1609     delete[] ptArray; 
1610     ptArray=0; 
1611   }
1612   
1613   if(chargeArray){
1614     delete[] chargeArray; 
1615     chargeArray=0; 
1616   }
1617   
1618   if(acceptedArray){
1619     delete[] acceptedArray; 
1620     acceptedArray=0; 
1621   }
1622   
1623   // Post output data.
1624   // PostData(1, fHistPt);
1625   PostData(1, fHists);
1626 }      
1627
1628
1629
1630
1631
1632 //________________________________________________________________________
1633 void AliAnalysisTaskQASym::Terminate(Option_t *) 
1634 {
1635
1636
1637 }  
1638
1639
1640
1641
1642