RecoParams with 3 latencies
[u/mrichter/AliRoot.git] / PWG1 / AliAnalysisTaskQASym.cxx
CommitLineData
50dbca26 1/**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
15
16/* $Id$ */
17
18//------------------------------
19// Analysis task for quality-assurance of central tarcking
20// mainly based on fundamental symmetries
21//
22// contact eva.sicking@cern.ch
23// authors
24// Authors: Jan Fiete Grosse-Oetringhaus, Christian Klein-Boesing,
25// Andreas Morsch, Eva Sicking
26
27
9f9631f3 28#include "TChain.h"
29#include "TTree.h"
30#include "TH1F.h"
31#include "TH2F.h"
32#include "TCanvas.h"
33#include "TList.h"
34#include "TParticle.h"
35#include "TParticlePDG.h"
36#include "TProfile.h"
37#include "TNtuple.h"
38#include "TFile.h"
39
40#include "AliAnalysisTask.h"
41#include "AliAnalysisManager.h"
42
43#include "AliESDEvent.h"
e4ab7356 44#include "AliLog.h"
9f9631f3 45#include "AliESDVertex.h"
46#include "AliESDInputHandler.h"
47#include "AliESDtrackCuts.h"
48#include "AliMultiplicity.h"
49
50
51#include "AliAnalysisTaskQASym.h"
52#include "AliExternalTrackParam.h"
53#include "AliTrackReference.h"
54
55#include "AliHeader.h"
56#include "AliGenEventHeader.h"
57#include "AliGenDPMjetEventHeader.h"
58
9f9631f3 59ClassImp(AliAnalysisTaskQASym)
60
2efff183 61AliAnalysisTaskQASym::AliAnalysisTaskQASym()
62 : AliAnalysisTaskSE()
63 ,fFieldOn(kTRUE)
64 ,fHists(0)
65 ,fHistRECpt(0)
66 ,fEta(0)
67 ,fEtaPhi(0)
68 ,fEtaPt(0)
69 ,fQPt(0)
70 ,fDca(0)
71 ,fqRec(0)
72 ,fsigmaPt(0)
73
74 ,fRecPtPos(0)
75 ,fRecPtNeg(0)
76 ,fRecPhiPos(0)
77 ,fRecPhiNeg(0)
78 ,fRecEtaPos(0)
79 ,fRecEtaNeg(0)
80 ,fRecEtaPtPos(0)
81 ,fRecEtaPtNeg(0)
82 ,fRecDcaPos(0)
83 ,fRecDcaNeg(0)
84 ,fRecDcaNegInv(0)
85 ,fRecDPos(0)
86 ,fRecDNeg(0)
87
88
89 ,fRecQPtPosEta(0)
90 ,fRecQPtNegEta(0)
91 ,fRecPtPosEta(0)
92 ,fRecPtNegEta(0)
93 ,fRecPhiPosEta(0)
94 ,fRecPhiNegEta(0)
95 ,fRecDcaPosEta(0)
96 ,fRecDcaNegEta(0)
97 ,fRecDPosEta(0)
98 ,fRecDNegEta(0)
99
100 ,fRecPtPosVz(0)
101 ,fRecPtNegVz(0)
102 ,fRecEtaPosVz(0)
103 ,fRecEtaNegVz(0)
104 ,fRecPhiPosVz(0)
105 ,fRecPhiNegVz(0)
106 ,fSignedDcaPosVz(0)
107 ,fSignedDcaNegVz(0)
108 ,fRecQPtPosEtaVz(0)
109 ,fRecQPtNegEtaVz(0)
110 ,fRecEtaPtPosVz(0)
111 ,fRecEtaPtNegVz(0)
112
113
114 ,fDeltaPhiAll(0)
115 ,fDeltaPhiLeading(0)
116 ,fDiffDcaD(0)
117 ,fPhiRec(0)
118 ,fThetaRec(0)
119 ,fNumber(0)
120 ,fVx(0)
121 ,fVy(0)
122 ,fVz(0)
123 ,fCuts(0)
124
125{
126 // Constructor
127 //
128 for(Int_t i = 0; i < 18; ++i){
129 fRecPtTpcSector[i] = 0;
130 fRecEtaTpcSector[i] = 0;
131 fSignedDcaTpcSector[i] = 0;
132 fRecQPtTpcSector[i] = 0;
133 fRecEtaPtTpcSector[i] = 0;
134 }
135
136 for(Int_t i = 0; i< 7; ++i){
137 fRecPtPosLadder[i] = 0;
138 fRecPtNegLadder[i] = 0;
139 fRecPhiPosLadder[i] = 0;
140 fRecPhiNegLadder[i] = 0;
141 fRecEtaPosLadder[i] = 0;
142 fRecEtaNegLadder[i] = 0;
143 fSignDcaPos[i] = 0;
144 fSignDcaNeg[i] = 0;
145 fSignDcaNegInv[i] = 0;
146 fPtSigmaPos[i] =0;
147 fPtSigmaNeg[i] =0;
148 fqPtRec[i] =0;
149 fDcaSigmaPos[i] =0;
150 fDcaSigmaNeg[i] =0;
151 }
152}
153
9f9631f3 154//________________________________________________________________________
155AliAnalysisTaskQASym::AliAnalysisTaskQASym(const char *name)
156 : AliAnalysisTaskSE(name)
157 ,fFieldOn(kTRUE)
158 ,fHists(0)
159 ,fHistRECpt(0)
160 ,fEta(0)
e4ab7356 161 ,fEtaPhi(0)
9f9631f3 162 ,fEtaPt(0)
163 ,fQPt(0)
164 ,fDca(0)
165 ,fqRec(0)
166 ,fsigmaPt(0)
167
168 ,fRecPtPos(0)
169 ,fRecPtNeg(0)
170 ,fRecPhiPos(0)
171 ,fRecPhiNeg(0)
172 ,fRecEtaPos(0)
173 ,fRecEtaNeg(0)
174 ,fRecEtaPtPos(0)
175 ,fRecEtaPtNeg(0)
176 ,fRecDcaPos(0)
177 ,fRecDcaNeg(0)
178 ,fRecDcaNegInv(0)
179 ,fRecDPos(0)
180 ,fRecDNeg(0)
181
e4ab7356 182
9f9631f3 183 ,fRecQPtPosEta(0)
184 ,fRecQPtNegEta(0)
185 ,fRecPtPosEta(0)
186 ,fRecPtNegEta(0)
187 ,fRecPhiPosEta(0)
188 ,fRecPhiNegEta(0)
189 ,fRecDcaPosEta(0)
190 ,fRecDcaNegEta(0)
191 ,fRecDPosEta(0)
192 ,fRecDNegEta(0)
193
194 ,fRecPtPosVz(0)
195 ,fRecPtNegVz(0)
196 ,fRecEtaPosVz(0)
197 ,fRecEtaNegVz(0)
198 ,fRecPhiPosVz(0)
199 ,fRecPhiNegVz(0)
200 ,fSignedDcaPosVz(0)
201 ,fSignedDcaNegVz(0)
202 ,fRecQPtPosEtaVz(0)
203 ,fRecQPtNegEtaVz(0)
204 ,fRecEtaPtPosVz(0)
205 ,fRecEtaPtNegVz(0)
206
207
208 ,fDeltaPhiAll(0)
209 ,fDeltaPhiLeading(0)
210 ,fDiffDcaD(0)
211 ,fPhiRec(0)
212 ,fThetaRec(0)
213 ,fNumber(0)
214 ,fVx(0)
215 ,fVy(0)
216 ,fVz(0)
9f9631f3 217 ,fCuts(0)
9f9631f3 218
219{
220 // Constructor
50dbca26 221 //
9f9631f3 222 for(Int_t i = 0;i<18;++i){
223 fRecPtTpcSector[i] = 0;
224 fRecEtaTpcSector[i] = 0;
225 fSignedDcaTpcSector[i] = 0;
226 fRecQPtTpcSector[i] = 0;
227 fRecEtaPtTpcSector[i] = 0;
228 }
229
230 for(Int_t i = 0;i< 7;++i){
231 fRecPtPosLadder[i] = 0;
232 fRecPtNegLadder[i] = 0;
233 fRecPhiPosLadder[i] = 0;
234 fRecPhiNegLadder[i] = 0;
235 fRecEtaPosLadder[i] = 0;
236 fRecEtaNegLadder[i] = 0;
237 fSignDcaPos[i] = 0;
238 fSignDcaNeg[i] = 0;
239 fSignDcaNegInv[i] = 0;
240 fPtSigmaPos[i] =0;
241 fPtSigmaNeg[i] =0;
242 fqPtRec[i] =0;
243 fDcaSigmaPos[i] =0;
244 fDcaSigmaNeg[i] =0;
245 }
246
247 DefineOutput(1, TList::Class());
248
249
250
251}
252
253
254//________________________________________________________________________
255void AliAnalysisTaskQASym::UserCreateOutputObjects()
256{
257 // Create histograms
258 // Called once
259
e4ab7356 260 Double_t range = 1.;
9f9631f3 261 Double_t pt = 20.;
262
263 fHists = new TList();
2efff183 264
9f9631f3 265 fHistRECpt = new TH1F("fHistRECpt",
266 " p_{T}",
267 100, 0., pt);
268 fEta = new TH1F("fEta",
269 " #eta",
270 200, -2., 2.);
e4ab7356 271 fEtaPhi = new TH2F("fEtaPhi",
272 " #eta - #phi",
273 200, -2., 2., 128, 0., 2. * TMath::Pi());
274
9f9631f3 275 fThetaRec = new TH1F("fThetaRec",
276 " #theta",
277 180, 0., TMath::Pi());
278 fPhiRec = new TH1F("fPhiRec",
279 " #phi",
280 180, 0., 2*TMath::Pi());
281 fNumber = new TH1F("fNumber",
282 "number of tracks per event",
283 50, 0.5, 49.5);
284 fVx = new TH1F("fVx",
285 "X of vertex",
e4ab7356 286 100, -5., 5.);
9f9631f3 287 fVy = new TH1F("fVy",
288 "Y of vertex",
e4ab7356 289 100, -5., 5.);
9f9631f3 290 fVz = new TH1F("fVz",
291 "Z of vertex",
e4ab7356 292 500, -50., 50.);
9f9631f3 293
294 fEtaPt = new TH1F("fEtaPt",
295 " #eta/p_{T} ",
296 100, -1., 1.);
297
298 fQPt = new TH1F("fQPt",
299 " charge/p_{T} ",
300 100, -1., 1.);
301
302 fDca = new TH1F("fDca",
303 " dca ",
304 200, -range, range);
305
306
307 fqRec = new TH1F("fqRec",
308 " charge all reconstructed particle",
309 21, -9.5, 10.5);
310
311 fsigmaPt = new TH1F("fsigmaPt",
312 "Log_{10}(#sigma_{p_{T}})",
313 200, -2., 8.);
314
315
316
317
318 //------------
319 for(Int_t ITSlayer_case=0;ITSlayer_case<7;ITSlayer_case++){
320
321 fSignDcaPos[ITSlayer_case] = new TH1F(Form("fSignDcaPos%d", ITSlayer_case),
322 " Signed dca",
323 200, -range, range);
324 fSignDcaPos[ITSlayer_case]->GetXaxis()->SetTitle("dca");
325 fSignDcaPos[ITSlayer_case]->GetYaxis()->SetTitle("");
326
327
328 fSignDcaNeg[ITSlayer_case] = new TH1F(Form("fSignDcaNeg%d", ITSlayer_case),
329 " Signed dcas",
330 200, -range, range);
331 fSignDcaNeg[ITSlayer_case]->GetXaxis()->SetTitle("dca");
332 fSignDcaNeg[ITSlayer_case]->GetYaxis()->SetTitle("");
333
334 fSignDcaNegInv[ITSlayer_case] = new TH1F(Form("fSignDcaNegInv%d", ITSlayer_case),
335 " inverse Signed dca ",
336 200, -range, range);
337 fSignDcaNegInv[ITSlayer_case]->GetXaxis()->SetTitle("-dca");
338 fSignDcaNegInv[ITSlayer_case]->GetYaxis()->SetTitle("");
339
340
341
342
343 fPtSigmaPos[ITSlayer_case] = new TH1F(Form("fPtSigmaPos%d", ITSlayer_case),
344 " #sigma_{pT} ",
345 208, -2., 8.);
346 fPtSigmaPos[ITSlayer_case]->GetXaxis()->SetTitle("Log_{10}(#sigma_{pT})");
347 fPtSigmaPos[ITSlayer_case]->GetYaxis()->SetTitle("");
348
349
350 fPtSigmaNeg[ITSlayer_case] = new TH1F(Form("fPtSigmaNeg%d",ITSlayer_case),
351 " #sigma_{pT}",
352 208, -2., 8.);
353 fPtSigmaNeg[ITSlayer_case]->GetXaxis()->SetTitle("Log_{10}(#sigma_{pT})");
354 fPtSigmaNeg[ITSlayer_case]->GetYaxis()->SetTitle("");
355
356
357
358
359
360 fqPtRec[ITSlayer_case] = new TH1F(Form("fqPtRec%d",ITSlayer_case),
361 "q/ p_{T}",
362 200, -100., 100.);
363 fqPtRec[ITSlayer_case]->GetXaxis()->SetTitle("q_{tr}/p_{T, tr} (GeV/c)");
364 fqPtRec[ITSlayer_case]->GetYaxis()->SetTitle("");
365
366
367
368
369
370 fDcaSigmaPos[ITSlayer_case] = new TH2F(Form("fDcaSigmaPos%d", ITSlayer_case),
371 " p_{T} shift vs #sigma_{pT} ",
372 200, -range, range,200, -4., 4. );
373 fDcaSigmaPos[ITSlayer_case]->GetXaxis()->SetTitle("signed DCA)");
374 fDcaSigmaPos[ITSlayer_case]->GetYaxis()->SetTitle("log_{10}(#sigma_{pT})");
375
376
377 fDcaSigmaNeg[ITSlayer_case] = new TH2F(Form("fDcaSigmaNeg%d", ITSlayer_case),
378 " p_{T} shift vs #sigma_{pT} ",
379 200, -range, range,200, -4., 4. );
380 fDcaSigmaNeg[ITSlayer_case]->GetXaxis()->SetTitle("signed DCA");
381 fDcaSigmaNeg[ITSlayer_case]->GetYaxis()->SetTitle("log_{10}(#sigma_{pT})");
2efff183 382 }
383
9f9631f3 384
385
386
387
388 // YIELDs---------- positive and negative particles
389
390 fRecPtPos = new TH1F("fRecPtPos",
391 " p_{T}",
392 100, 0.,pt);
393 fRecPtPos->GetXaxis()->SetTitle("p_{T} (GeV/c)");
394 fRecPtNeg = new TH1F("fRecPtNeg",
395 " p_{T} ",
396 100, 0., pt);
397 fRecPtNeg->GetXaxis()->SetTitle("p_{T} (GeV/c)");
398
399
400 fRecPhiPos = new TH1F("fRecPhiPos",
401 "#phi",
402 361, 0., 360.);
403 fRecPhiPos->GetXaxis()->SetTitle("#phi (deg)");
404
405 fRecPhiNeg = new TH1F("fRecPhiNeg",
406 "#phi ",
407 361, 0., 360.);
408 fRecPhiNeg->GetXaxis()->SetTitle("#phi (deg)");
409
410 fRecEtaPos = new TH1F("fRecEtaPos",
411 "#eta",
412 200, -2., 2.);
413 fRecEtaPos->GetXaxis()->SetTitle("#eta");
414
415 fRecEtaNeg = new TH1F("fRecEtaNeg",
416 "#eta",
417 200, -2., 2.);
418 fRecEtaNeg->GetXaxis()->SetTitle("#eta");
419
420 fRecEtaPtPos = new TH1F("fRecEtaPtPos",
421 "#eta/p_{T}",
422 200, -0.1, .1);
423 fRecEtaPtPos->GetXaxis()->SetTitle("#eta/p_{T}");
424
425 fRecEtaPtNeg = new TH1F("fRecEtaPtNeg",
426 "#eta/p_{T}",
427 200, -.1, .1);
428 fRecEtaPtNeg->GetXaxis()->SetTitle("#eta/p_{T}");
429
430 fRecDcaPos = new TH1F("fRecDcaPos",
431 " dca",
432 100, -range, range);
433 fRecDcaPos->GetXaxis()->SetTitle("dca (cm)");
434 fRecDcaNeg = new TH1F("fRecDcaNeg",
435 " dca",
436 100, -range, range);
437 fRecDcaNeg->GetXaxis()->SetTitle("dca (cm)");
438
439 fRecDcaNegInv = new TH1F("fRecDcaNegInv",
440 " dca",
441 100, -range, range);
442 fRecDcaNegInv->GetXaxis()->SetTitle("dca (cm)");
443
444
445 fRecDPos = new TH1F("fRecDPos",
446 " d",
447 100, -range, range);
448 fRecDPos->GetXaxis()->SetTitle("d (cm)");
449 fRecDNeg = new TH1F("fRecDNeg",
450 "d",
451 100, -range, range);
452 fRecDNeg->GetXaxis()->SetTitle("d (cm)");
453
454
455 // YIELDs ---------------- positive and negative eta
456
457
458 fRecQPtPosEta = new TH1F("fRecQPtPosEta",
459 "q/p_{T}",
460 200, -0.5, 0.5);
461 fRecQPtPosEta->GetXaxis()->SetTitle("q/p_{T} ");
462
463 fRecQPtNegEta = new TH1F("fRecQPtNegEta",
464 "q/p_{T}",
465 200, -0.5, 0.5);
466 fRecQPtNegEta->GetXaxis()->SetTitle("q/p_{T}");
467
468 fRecPtPosEta = new TH1F("fRecPtPosEta",
469 " p_{T} ",
470 100, 0., pt);
471 fRecPtPosEta->GetXaxis()->SetTitle("p_{T} (GeV/c)");
472
473 fRecPtNegEta = new TH1F("fRecPtNegEta",
474 " p_{T}",
475 100, 0., pt);
476 fRecPtNegEta->GetXaxis()->SetTitle("p_{T} (GeV/c)");
477
478 fRecPhiPosEta = new TH1F("fRecPhiPosEta",
479 "#phi",
480 361, 0., 360);
481 fRecPhiPosEta->GetXaxis()->SetTitle("#phi (deg)");
482
483 fRecPhiNegEta = new TH1F("fRecPhiNegEta",
484 "#phi ",
485 361, 0, 360);
486 fRecPhiNegEta->GetXaxis()->SetTitle("#phi (deg)");
487
488 fRecDcaPosEta = new TH1F("fRecDcaPosEta",
489 " dca ",
490 100, -range, range);
491 fRecDcaPosEta->GetXaxis()->SetTitle("dca (cm)");
492 fRecDcaNegEta = new TH1F("fRecDcaNegEta",
493 " dca",
494 100, -range, range);
495 fRecDcaNegEta->GetXaxis()->SetTitle("dca (cm)");
496
497 fRecDPosEta = new TH1F("fRecDPosEta",
498 " d",
499 100, -range, range);
500 fRecDPosEta->GetXaxis()->SetTitle("d (cm)");
501 fRecDNegEta = new TH1F("fRecDNegEta",
502 "d",
503 100, -5., 5.);
504 fRecDNegEta->GetXaxis()->SetTitle("d (cm)");
505
506
507
508 // YIELDs ---------------- for TPC sectors
509 for(Int_t sector=0; sector<18;sector++){
510
511
2efff183 512 fRecPtTpcSector[sector] = new TH1F(Form("fRecPtTpcSector%02d",sector),
513 Form("p_{T} distribution: TPC sector %d",
514 sector),100, 0., pt);
515 fRecPtTpcSector[sector]->GetXaxis()->SetTitle("p_{T} (GeV/c)");
516
517 fRecEtaTpcSector[sector] = new TH1F(Form("fRecEtaTpcSector%02d",sector),
518 Form("#eta distribution: TPC sector %d",
519 sector),200, -2., 2.);
520 fRecEtaTpcSector[sector]->GetXaxis()->SetTitle("p_{T} (GeV/c)");
521
522
523 fSignedDcaTpcSector[sector] = new TH1F(Form("fSignedDcaTpcSector%02d",sector),
524 Form("dca distribution: TPC sector %d",
525 sector),200, -range, range );
526 fSignedDcaTpcSector[sector]->GetXaxis()->SetTitle("dca");
527
528 fRecQPtTpcSector[sector] = new TH1F(Form("fRecQPtTpcSector%02d",sector),
529 Form("Q/ p_{T} distribution: TPC sector %d",
530 sector),100, -1., 1.);
531 fRecQPtTpcSector[sector]->GetXaxis()->SetTitle("Q/p_{T} (GeV/c)");
532
533 fRecEtaPtTpcSector[sector] = new TH1F(Form("fRecEtaPtTpcSector%02d",sector),
534 Form("#eta/ p_{T} distribution: TPC sector %d",
535 sector),100, -1., 1.);
536 fRecEtaPtTpcSector[sector]->GetXaxis()->SetTitle("#eta/p_{T} (GeV/c)");
537
9f9631f3 538 }
539 // YIELDS ITS ladder
540 for(Int_t i=0;i<7;i++){
2efff183 541 fRecPtPosLadder[i] = new TH1F(Form("fRecPtPosLadder%d", i),
542 " p_{T} distribution",
543 100, 0., pt);
544 fRecPtPosLadder[i]->GetXaxis()->SetTitle("p_{T} (GeV/c)");
545 fRecPtNegLadder[i] = new TH1F(Form("fRecPtNegLadder%d",i),
546 " p_{T} distribution ",
547 100, 0., pt);
548 fRecPtNegLadder[i]->GetXaxis()->SetTitle("p_{T} (GeV/c)");
549
550
551 fRecPhiPosLadder[i] = new TH1F(Form("fRecPhiPosLadder%d",i),
552 "#phi distribution: all pos eta",
553 361, 0., 360);
554 fRecPhiPosLadder[i]->GetXaxis()->SetTitle("#phi (deg)");
555
556 fRecPhiNegLadder[i] = new TH1F(Form("fRecPhiNegLadder%d", i),
557 "#phi distribution: all neg eta",
558 361, 0, 360);
559 fRecPhiNegLadder[i]->GetXaxis()->SetTitle("#phi (deg)");
560
561
562
563 fRecEtaPosLadder[i] = new TH1F(Form("fRecEtaPosLadder%d",i),
564 "#eta distribution",
565 200, -2., 2.);
566 fRecEtaPosLadder[i]->GetXaxis()->SetTitle("#eta)");
567
568 fRecEtaNegLadder[i] = new TH1F(Form("fRecEtaNegLadder%d", i),
569 "#eta distribution",
570 200, -2., 2.);
571 fRecEtaNegLadder[i]->GetXaxis()->SetTitle("#eta");
9f9631f3 572 }
2efff183 573
9f9631f3 574 Double_t vzmax = 30;
2efff183 575
9f9631f3 576 fRecPtPosVz = new TH2F("fRecPtPosVz",
577 "p_{T} distribution vs Vz()",
578 100, -1., 2., 200,-vzmax,vzmax);
579 fRecPtPosVz->GetXaxis()->SetTitle("log_{10}(p_{T})");
580
581 fRecPtNegVz = new TH2F("fRecPtNegVz",
582 "p_{T} distribution vs Vz()",
583 100, -1., 2.,200,-vzmax,vzmax);
584 fRecPtNegVz->GetXaxis()->SetTitle("Log_{10}(p_{T})");
585
586
587 fRecEtaPosVz= new TH2F("fRecEtaPosVz",
588 "#eta distribution vs Vz()",
589 100, -2., 2., 200,-vzmax,vzmax);
590 fRecEtaPosVz->GetXaxis()->SetTitle("#eta");
591 fRecEtaNegVz = new TH2F("fRecEtaNegVz",
592 "#eta distribution vs Vz()",
593 100, -2., 2.,200,-vzmax,vzmax);
594 fRecEtaNegVz->GetXaxis()->SetTitle("#eta");
595
596 fRecPhiPosVz= new TH2F("fRecPhiPosVz",
597 "#eta distribution vs Vz()",
598 361, 0., 360., 200,-vzmax,vzmax);
599 fRecPhiPosVz->GetXaxis()->SetTitle("#phi (deg)");
600 fRecPhiNegVz = new TH2F("fRecPhiNegVz",
601 "dca vs Vz()",
602 361, 0., 360.,200,-vzmax,vzmax);
603 fRecPhiNegVz->GetXaxis()->SetTitle("#phi (deg)");
604
605 fSignedDcaPosVz= new TH2F("fSignedDcaPosVz",
606 "#eta distribution vs Vz()",
607 200, -range, range, 200,-vzmax,vzmax);
608 fSignedDcaPosVz->GetXaxis()->SetTitle("dca (cm)");
609 fSignedDcaNegVz = new TH2F("fSignedDcaNegVz",
610 "dca vs Vz()",
611 200, -range, range,200,-vzmax,vzmax);
612 fSignedDcaNegVz->GetXaxis()->SetTitle("dca (cm)");
613
614 fRecQPtPosEtaVz= new TH2F("fRecQPtPosEtaVz",
615 " Q/p_{T} distribution vs Vz()",
616 100, -1., 1., 200,-vzmax,vzmax);
617 fRecQPtPosEtaVz->GetXaxis()->SetTitle("Q/p_{T}");
618 fRecQPtNegEtaVz = new TH2F("fRecQPtNegEtaVz",
619 " Q/p_{T} distribution vs Vz()",
620 100, -1., 1.,200,-vzmax,vzmax);
621 fRecQPtNegEtaVz->GetXaxis()->SetTitle("Q/p_{T}");
622
623
624 fRecEtaPtPosVz= new TH2F("fRecEtaPtPosVz",
625 " #eta/p_{T} distribution vs Vz()",
626 100, -1., 1., 200,-vzmax,vzmax);
627 fRecEtaPtPosVz->GetXaxis()->SetTitle("#eta/p_{T");
628 fRecEtaPtNegVz = new TH2F("fRecEtaPtNegVz",
629 " #eta/p_{T} distribution vs Vz()",
630 100, -1., 1.,200,-vzmax,vzmax);
631 fRecEtaPtNegVz->GetXaxis()->SetTitle("#eta/p_{T}");
632
633 //new
634 fDeltaPhiAll = new TH1F("fDeltaPhiAll",
635 " #Delta #phi",200,-360,360);
636 fDeltaPhiAll->GetXaxis()->SetTitle("#Delta #phi");
637
638
639 fDeltaPhiLeading = new TH2F("fDeltaPhiLeading",
640 " #Delta #phi",361,-360,360, 361,0, 360);
641 fDeltaPhiLeading->GetXaxis()->SetTitle("#Delta #phi (deg.)");
642 fDeltaPhiLeading->GetYaxis()->SetTitle("#phi_{leading particle} (deg.)");
643
644 fDiffDcaD = new TH1F("fDiffDcaD",
645 "dca-d",
646 200, -5., 5.);
647
9f9631f3 648
649 fHists->SetOwner();
650
9f9631f3 651 fHists->Add(fHistRECpt);
652 fHists->Add(fEta);
e4ab7356 653 fHists->Add(fEtaPhi);
9f9631f3 654 fHists->Add(fThetaRec);
655 fHists->Add(fPhiRec);
656 fHists->Add(fNumber);
657 fHists->Add(fVx);
658 fHists->Add(fVy);
659 fHists->Add(fVz);
660
661 fHists->Add(fEtaPt);
662 fHists->Add(fQPt);
663 fHists->Add(fDca);
664
665 fHists->Add(fDeltaPhiAll);
666 fHists->Add(fDeltaPhiLeading);
667 fHists->Add(fDiffDcaD);
668
669 fHists->Add(fqRec);
670 fHists->Add(fsigmaPt);
671
672 fHists->Add(fRecPtPos);
673 fHists->Add(fRecPtNeg);
674 fHists->Add(fRecPhiPos);
675 fHists->Add(fRecPhiNeg);
676 fHists->Add(fRecEtaPos);
677 fHists->Add(fRecEtaNeg);
678 fHists->Add(fRecEtaPtPos);
679 fHists->Add(fRecEtaPtNeg);
680 fHists->Add(fRecDcaPos);
681 fHists->Add(fRecDcaNeg);
682 fHists->Add(fRecDcaNegInv);
683 fHists->Add(fRecDPos);
684 fHists->Add(fRecDNeg);
685
686
687 fHists->Add(fRecQPtPosEta);
688 fHists->Add(fRecQPtNegEta);
689 fHists->Add(fRecPtPosEta);
690 fHists->Add(fRecPtNegEta);
691 fHists->Add(fRecPhiPosEta);
692 fHists->Add(fRecPhiNegEta);
693 fHists->Add(fRecDcaPosEta);
694 fHists->Add(fRecDcaNegEta);
695 fHists->Add(fRecDPosEta);
696 fHists->Add(fRecDNegEta);
697
698
699 for(Int_t i=0;i<18;i++){
700 fHists->Add(fRecPtTpcSector[i]);
701 fHists->Add(fRecEtaTpcSector[i]);
702 fHists->Add(fSignedDcaTpcSector[i]);
703 fHists->Add(fRecQPtTpcSector[i]);
704 fHists->Add(fRecEtaPtTpcSector[i]);
705 }
706
707 for(Int_t i=0;i<7;i++){
708 fHists->Add(fRecPtPosLadder[i]);
709 fHists->Add(fRecPtNegLadder[i]);
710 fHists->Add(fRecPhiPosLadder[i]);
711 fHists->Add(fRecPhiNegLadder[i]);
712 fHists->Add(fRecEtaPosLadder[i]);
713 fHists->Add(fRecEtaNegLadder[i]);
714 }
715
716 fHists->Add(fRecPtPosVz);
717 fHists->Add(fRecPtNegVz);
718 fHists->Add(fRecEtaPosVz);
719 fHists->Add(fRecEtaNegVz);
720 fHists->Add(fRecPhiPosVz);
721 fHists->Add(fRecPhiNegVz);
722 fHists->Add(fSignedDcaPosVz);
723 fHists->Add(fSignedDcaNegVz);
724 fHists->Add(fRecQPtPosEtaVz);
725 fHists->Add(fRecQPtNegEtaVz);
726 fHists->Add(fRecEtaPtPosVz);
727 fHists->Add(fRecEtaPtNegVz);
728
729
730 for(Int_t i=0;i<7;i++){
731 fHists->Add(fSignDcaPos[i]);
732 fHists->Add(fSignDcaNeg[i]);
733 fHists->Add(fSignDcaNegInv[i]);
734
735 fHists->Add(fPtSigmaPos[i]);
736 fHists->Add(fPtSigmaNeg[i]);
737 fHists->Add(fqPtRec[i]);
738
739 fHists->Add(fDcaSigmaPos[i]);
740 fHists->Add(fDcaSigmaNeg[i]);
741
742
743 }
744
745
746
747 for (Int_t i=0; i<fHists->GetEntries(); ++i) {
748 TH1 *h1 = dynamic_cast<TH1*>(fHists->At(i));
749 if (h1){
750 // Printf("%s ",h1->GetName());
751 h1->Sumw2();
752 }
753 }
754 // BKC
755
756
757}
758
759//__________________________________________________________
760
761void AliAnalysisTaskQASym::UserExec(Option_t *)
762{
763 AliVEvent *event = InputEvent();
764 if (!event) {
765 Printf("ERROR: Could not retrieve event");
766 return;
767 }
768
769
770 if(Entry()==0){
771 AliESDEvent* esd = dynamic_cast<AliESDEvent*>(event);
772 if(esd){
773 Printf("We are reading from ESD");
774 }
775
776 }
777
9f9631f3 778
50dbca26 779 Int_t leadingTrack = 0;
780 Float_t leadingEnergy = -20.;
781 Float_t leadingPhi = 0;//TMath::Pi();
9f9631f3 782
783
784 if(event->GetNumberOfTracks()!=0) fNumber->Fill(event->GetNumberOfTracks());
785
e4ab7356 786 const AliVVertex* vertex = event->GetPrimaryVertex();
787 Float_t vz = vertex->GetZ();
788 if (TMath::Abs(vz) > 10.) return;
789
9f9631f3 790 for (Int_t iTrack = 0; iTrack < event->GetNumberOfTracks(); iTrack++) {
791
792
793 AliVParticle *track = event->GetTrack(iTrack);
794 AliESDtrack *esdtrack = dynamic_cast<AliESDtrack*>(track);
795 if (!track) {
796 Printf("ERROR: Could not receive track %d", iTrack);
797 continue;
798 }
799
e4ab7356 800 //if (!fCuts->AcceptTrack(esdtrack)) continue;
801 const AliExternalTrackParam * tpcPSO = esdtrack->GetTPCInnerParam();
802 const AliExternalTrackParam * tpcP = esdtrack;
9f9631f3 803 if (!tpcP) continue;
804
e4ab7356 805
806 if (tpcP->Pt() > 50. && tpcPSO) {
807 printf("High Pt %5d %5d %13.3f %13.3f \n", event->GetPeriodNumber(), event->GetOrbitNumber(),
808 tpcPSO->Pt(), esdtrack->Pt());
809 // AliFatal("Jet");
810 }
9f9631f3 811
e4ab7356 812// if (tpcPSO) fRecPt12->Fill(tpcPSO->Pt(), esdtrack->Pt());
813
50dbca26 814 if(tpcP->E()>leadingEnergy){
815 leadingTrack=iTrack;
816 leadingEnergy=tpcP->E();
817 leadingPhi=tpcP->Phi();
9f9631f3 818 }
819
820
821
822
823 //propagate to dca
824 esdtrack->PropagateToDCA(event->GetPrimaryVertex(),
825 event->GetMagneticField(), 10000.);
826
827
828 // if(tpcP->Pt()<2.)continue;
829
830
831 fqRec->Fill(tpcP->Charge());
832
833
834 Double_t sigmapt = tpcP->GetSigma1Pt2();
835 sigmapt= sqrt(sigmapt);
836 sigmapt= sigmapt *(tpcP->Pt()*tpcP->Pt());
837
50dbca26 838 if(sigmapt < 1.e-12) continue;
9f9631f3 839 fsigmaPt->Fill(TMath::Log10(sigmapt));
840
841
9f9631f3 842 // hits in ITS layer
843 Int_t cas=-1;
844 if(esdtrack->HasPointOnITSLayer(0))
845 cas=0;
846 else if(!esdtrack->HasPointOnITSLayer(0)
847 && esdtrack->HasPointOnITSLayer(1))
848 cas=1;
849 else if(!esdtrack->HasPointOnITSLayer(0)
850 && !esdtrack->HasPointOnITSLayer(1)
851 && esdtrack->HasPointOnITSLayer(2))
852 cas=2;
853 else if(!esdtrack->HasPointOnITSLayer(0)
854 && !esdtrack->HasPointOnITSLayer(1)
855 && !esdtrack->HasPointOnITSLayer(2)
856 && esdtrack->HasPointOnITSLayer(3))
857 cas=3;
858 else if(!esdtrack->HasPointOnITSLayer(0)
859 && !esdtrack->HasPointOnITSLayer(1)
860 && !esdtrack->HasPointOnITSLayer(2)
861 && !esdtrack->HasPointOnITSLayer(3)
862 && esdtrack->HasPointOnITSLayer(4))
863 cas=4;
864 else if( !esdtrack->HasPointOnITSLayer(0)
865 && !esdtrack->HasPointOnITSLayer(1)
866 && !esdtrack->HasPointOnITSLayer(2)
867 && !esdtrack->HasPointOnITSLayer(3)
868 && !esdtrack->HasPointOnITSLayer(4)
869 && esdtrack->HasPointOnITSLayer(5))
870 cas=5;
871 else
872 cas=6;
873
874
875
876 //-------------------
877
50dbca26 878 Double_t sdcatr = (tpcP->Py()*tpcP->Xv()
9f9631f3 879 - tpcP->Px()*tpcP->Yv())/tpcP->Pt();
880
881
882
883 fqPtRec[cas]->Fill(tpcP->Charge()/tpcP->Pt());
884
9f9631f3 885 fHistRECpt->Fill(tpcP->Pt());
886 fEta->Fill(tpcP->Eta());
887 fThetaRec->Fill(tpcP->Theta());
888 fPhiRec->Fill(tpcP->Phi());
889 fVx->Fill(tpcP->Xv());
890 fVy->Fill(tpcP->Yv());
891 fVz->Fill(tpcP->Zv());
892
893
894 fEtaPt->Fill(tpcP->Eta()/tpcP->Pt());
895 fQPt->Fill(tpcP->Charge()/tpcP->Pt());
50dbca26 896 fDca->Fill(sdcatr);
9f9631f3 897
898
899
50dbca26 900 Float_t xy, z;
9f9631f3 901 esdtrack->GetImpactParameters(xy,z);
50dbca26 902 fDiffDcaD->Fill(sdcatr+xy);
9f9631f3 903
904
905 //for positive particles
e4ab7356 906
9f9631f3 907 if(tpcP->Charge()>0){
908 fRecPtPos->Fill(tpcP->Pt());
909 fRecPtPosLadder[cas]->Fill(tpcP->Pt());
910 fRecPtPosVz->Fill(TMath::Log10(tpcP->Pt()),tpcP->Zv());
911 fRecPhiPos->Fill(TMath::RadToDeg()*tpcP->Phi());
912
913
914 fRecPhiPosLadder[cas]->Fill(TMath::RadToDeg()*tpcP->Phi());
915 fRecPhiPosVz->Fill(TMath::RadToDeg()*tpcP->Phi(),tpcP->Zv());
50dbca26 916 fSignedDcaPosVz->Fill(sdcatr,tpcP->Zv());
9f9631f3 917
918 fRecEtaPos->Fill(tpcP->Eta());
919 fRecEtaPosLadder[cas]->Fill(tpcP->Eta());
920 fRecEtaPtPos->Fill(tpcP->Eta()/tpcP->Pt());
921 fRecEtaPosVz->Fill(tpcP->Eta(),tpcP->Zv());
922 fRecEtaPtPosVz->Fill(tpcP->Eta()/tpcP->Pt(),tpcP->Zv());
923
50dbca26 924 fRecDcaPos->Fill(sdcatr);
9f9631f3 925 fRecDPos->Fill(xy);
50dbca26 926 fSignDcaPos[cas]->Fill(sdcatr);
9f9631f3 927
928
50dbca26 929 fDcaSigmaPos[cas]->Fill(sdcatr, TMath::Log10(sigmapt));
9f9631f3 930
931 fPtSigmaPos[cas]->Fill(TMath::Log10(sigmapt));
932 }
933 //and negative particles
934 else {
935 fRecPtNeg->Fill(tpcP->Pt());
936 fRecPtNegLadder[cas]->Fill(tpcP->Pt());
937 fRecPtNegVz->Fill(TMath::Log10(tpcP->Pt()),tpcP->Zv());
938
939 fRecPhiNeg->Fill(TMath::RadToDeg()*tpcP->Phi());
940 fRecPhiNegLadder[cas]->Fill(TMath::RadToDeg()*tpcP->Phi());
941 fRecPhiNegVz->Fill(TMath::RadToDeg()*tpcP->Phi(),tpcP->Zv());
50dbca26 942 fSignedDcaNegVz->Fill(sdcatr,tpcP->Zv());
9f9631f3 943 fRecEtaPtNegVz->Fill(tpcP->Eta()/tpcP->Pt(),tpcP->Zv());
944
945 fRecEtaNeg->Fill(tpcP->Eta());
946 fRecEtaNegLadder[cas]->Fill(tpcP->Eta());
947 fRecEtaPtNeg->Fill(tpcP->Eta()/tpcP->Pt());
948 fRecEtaNegVz->Fill(tpcP->Eta(),tpcP->Zv());
949
50dbca26 950 fRecDcaNeg->Fill(sdcatr);
951 fRecDcaNegInv->Fill(-sdcatr);
9f9631f3 952 fRecDNeg->Fill(xy);
50dbca26 953 fSignDcaNeg[cas]->Fill(sdcatr);
954 fSignDcaNegInv[cas]->Fill(-sdcatr);
9f9631f3 955
956
50dbca26 957 fDcaSigmaNeg[cas]->Fill(sdcatr,TMath::Log10(sigmapt));
9f9631f3 958
959 fPtSigmaNeg[cas]->Fill(TMath::Log10(sigmapt));
960 }
961
962
963
964 //all particles with positive eta
965 if(tpcP->Eta()>0){
966 fRecQPtPosEta->Fill(tpcP->Charge()/tpcP->Pt());
967 fRecPtPosEta->Fill(tpcP->Pt());
968 fRecPhiPosEta->Fill(TMath::RadToDeg()*tpcP->Phi());
969 fRecQPtPosEtaVz->Fill(tpcP->Charge()/tpcP->Pt(),tpcP->Zv());
50dbca26 970 fRecDcaPosEta->Fill(sdcatr);
9f9631f3 971 fRecDPosEta->Fill(xy);
972 }
973 //all particles with negative eta (and eta==0)
974 else{
975 fRecQPtNegEta->Fill(tpcP->Charge()/tpcP->Pt());
976 fRecPtNegEta->Fill(tpcP->Pt());
977 fRecPhiNegEta->Fill(TMath::RadToDeg()*tpcP->Phi());
978 fRecQPtNegEtaVz->Fill(tpcP->Charge()/tpcP->Pt(),tpcP->Zv());
50dbca26 979 fRecDcaNegEta->Fill(sdcatr);
9f9631f3 980 fRecDNegEta->Fill(xy);
981
982 }
983
984
985 //spectren detected by TPC sectors
986 //pt cut on 1 GeV/c ?!
987 // if(tpcP->Pt()<1.) continue;
988 fRecPtTpcSector[Int_t(tpcP->Phi()*
989 TMath::RadToDeg()/20)]->Fill(tpcP->Pt());
990 fRecEtaTpcSector[Int_t(tpcP->Phi()*
991 TMath::RadToDeg()/20)]->Fill(tpcP->Eta());
992 fSignedDcaTpcSector[Int_t(tpcP->Phi()*
50dbca26 993 TMath::RadToDeg()/20)]->Fill(sdcatr);
9f9631f3 994 fRecQPtTpcSector[Int_t(tpcP->Phi()*
995 TMath::RadToDeg()/20)]->Fill(tpcP->Charge()/tpcP->Pt());
996 fRecEtaPtTpcSector[Int_t(tpcP->Phi()*
997 TMath::RadToDeg()/20)]->Fill(tpcP->Eta()/tpcP->Pt());
998
999
1000
1001
1002
1003
1004 // another track loop
1005 for (Int_t iTrack2 = 0; iTrack2 < event->GetNumberOfTracks(); iTrack2++) {
1006
50dbca26 1007 if(leadingTrack==iTrack2) continue;
9f9631f3 1008
1009 AliVParticle *track2 = event->GetTrack(iTrack2);
1010 AliESDtrack* esdtrack2 = dynamic_cast<AliESDtrack*>(track2);
1011 if (!track2) {
1012 Printf("ERROR: Could not receive track %d", iTrack);
1013 continue;
1014 }
1015 if (!fCuts->AcceptTrack(esdtrack2)) continue;
1016 //propagate to dca
1017 esdtrack2->PropagateToDCA(event->GetPrimaryVertex(),
1018 event->GetMagneticField(), 10000.);
1019
50dbca26 1020 fDeltaPhiLeading->Fill((leadingPhi-esdtrack2->Phi())*TMath::RadToDeg(),
1021 leadingPhi*TMath::RadToDeg() );
9f9631f3 1022
1023
1024
1025 }//second track loop
1026 }//first track loop
1027
1028
1029
1030
1031 // Post output data.
1032 // PostData(1, fHistPt);
1033 PostData(1, fHists);
1034}
1035
1036
1037
1038
1039
1040//________________________________________________________________________
1041void AliAnalysisTaskQASym::Terminate(Option_t *)
1042{
50dbca26 1043 // Terminate
9f9631f3 1044
1045}
1046
1047
1048
1049
1050