]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGLF/SPECTRA/PiKaPr/TestAOD/AliAnalysisTaskV2AllChAOD.cxx
update from Marco
[u/mrichter/AliRoot.git] / PWGLF / SPECTRA / PiKaPr / TestAOD / AliAnalysisTaskV2AllChAOD.cxx
CommitLineData
10a99a07 1/**************************************************************************
2 * Copyright(c) 1998-2009, 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//-----------------------------------------------------------------
17// AliAnalysisTaskV2AllChAOD class
18//-----------------------------------------------------------------
19
20#include "TChain.h"
21#include "TTree.h"
22#include "TLegend.h"
23#include "TH1F.h"
24#include "TH2F.h"
25#include "THnSparse.h"
26#include "TProfile.h"
27#include "TCanvas.h"
28#include "AliAnalysisTask.h"
29#include "AliAODTrack.h"
30#include "AliAODMCParticle.h"
31#include "AliVParticle.h"
32#include "AliAODEvent.h"
33#include "AliAODInputHandler.h"
34#include "AliAnalysisTaskV2AllChAOD.h"
35#include "AliAnalysisTaskESDfilter.h"
36#include "AliAnalysisDataContainer.h"
37#include "AliSpectraAODTrackCuts.h"
38#include "AliSpectraAODEventCuts.h"
39#include "AliPIDCombined.h"
40#include "AliCentrality.h"
41#include "TProof.h"
42#include "AliVEvent.h"
43#include "AliStack.h"
44#include <TMCProcess.h>
45
46#include <iostream>
47
48using namespace std;
49
50ClassImp(AliAnalysisTaskV2AllChAOD)
51
52//________________________________________________________________________
53AliAnalysisTaskV2AllChAOD::AliAnalysisTaskV2AllChAOD(const char *name) : AliAnalysisTaskSE(name),
54 fAOD(0x0),
55 fTrackCuts(0x0),
56 fEventCuts(0x0),
57 fIsMC(0),
58 fCharge(0),
59 fVZEROside(0),
60 fOutput(0x0),
61 fOutput_lq(0x0),
62 fOutput_sq(0x0),
63 fnCentBins(20),
64 fnQvecBins(100),
65 fIsQvecCalibMode(0),
66 fQvecUpperLim(100),
67 fCutLargeQperc(90.),
68 fCutSmallQperc(10.),
69 fEtaGapMin(-0.5),
70 fEtaGapMax(0.5),
d64e71aa 71 fTrkBit(272),
72 fEtaCut(0.8),
73 fMinPt(0),
74 fMaxPt(20.0),
75 fMinTPCNcls(70),
10a99a07 76 fResSP(0),
d64e71aa 77 fQxGap1A(0),
78 fQyGap1A(0),
79 fmultGap1A(0),
80 fQxGap1B(0),
81 fQyGap1B(0),
82 fmultGap1B(0),
10a99a07 83 fResSP_lq(0),
d64e71aa 84 fQxGap1A_lq(0),
85 fQyGap1A_lq(0),
86 fmultGap1A_lq(0),
87 fQxGap1B_lq(0),
88 fQyGap1B_lq(0),
89 fmultGap1B_lq(0),
90 fResSP_sq(0),
91 fQxGap1A_sq(0),
92 fQyGap1A_sq(0),
93 fmultGap1A_sq(0),
94 fQxGap1B_sq(0),
95 fQyGap1B_sq(0),
96 fmultGap1B_sq(0)
10a99a07 97{
98
99 for (Int_t i = 0; i< 9; i++){
100 fv2SPGap1A[i] = 0;
101 fh2v2SPGap1A[i] = 0;
102 fv2SPGap1B[i] = 0;
103 fh2v2SPGap1B[i] = 0;
104
105 fSinGap1A[i] = 0;
106 fCosGap1A[i] = 0;
107 fSinGap1B[i] = 0;
108 fCosGap1B[i] = 0;
109
110 //large q
111 fv2SPGap1A_lq[i] = 0;
112 fv2SPGap1B_lq[i] = 0;
113 fSinGap1A_lq[i] = 0;
114 fCosGap1A_lq[i] = 0;
115 fSinGap1B_lq[i] = 0;
116 fCosGap1B_lq[i] = 0;
117
118 //small q
119 fv2SPGap1A_sq[i] = 0;
120 fv2SPGap1B_sq[i] = 0;
121 fSinGap1A_sq[i] = 0;
122 fCosGap1A_sq[i] = 0;
123 fSinGap1B_sq[i] = 0;
124 fCosGap1B_sq[i] = 0;
125
126 }
127
128 // Default constructor
129 DefineInput(0, TChain::Class());
130 DefineOutput(1, TList::Class());
131 DefineOutput(2, AliSpectraAODEventCuts::Class());
132 DefineOutput(3, AliSpectraAODTrackCuts::Class());
133 DefineOutput(4, TList::Class());
134 DefineOutput(5, TList::Class());
135}
136
137//________________________________________________________________________
138void AliAnalysisTaskV2AllChAOD::UserCreateOutputObjects()
139{
140 // create output objects
141 fOutput=new TList();
142 fOutput->SetOwner();
143 fOutput->SetName("fOutput");
144
145 fOutput_lq=new TList();
146 fOutput_lq->SetOwner();
147 fOutput_lq->SetName("fOutput_lq");
148
149 fOutput_sq=new TList();
150 fOutput_sq->SetOwner();
151 fOutput_sq->SetName("fOutput_sq");
152
153 if (!fTrackCuts) AliFatal("Track Cuts should be set in the steering macro");
154 if (!fEventCuts) AliFatal("Event Cuts should be set in the steering macro");
155
156 // binning common to all the THn
157 //change it according to your needs + move it to global variables -> setter/getter
158// Double_t ptBins[] = {0., 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.2, 1.4, 1.6, 1.8, 2.0, 2.4, 2.8, 3.2, 3.6, 4.0, 4.5, 5.0, 5.5, 6.0, 7.0, 8.0, 9.0, 10.0, 12.0, 14.0, 16.0, 20.0};
159// const Int_t nptBins = 31;
160 Double_t ptBins[] = {0., 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.2, 1.4, 1.6, 1.8, 2.0, 2.2, 2.4, 2.6, 3.0, 3.4, 3.8, 4.2, 4.6, 5.0, 5.5, 6.0, 7.0, 8.0, 9.0, 10.0, 12.0, 14.0, 16.0, 20.0};
161 const Int_t nptBins = 33;
162
10a99a07 163 fResSP = new TProfile("fResSP", "Resolution; centrality; Resolution", 9, -0.5, 8.5);
164 fOutput->Add(fResSP);
165
d64e71aa 166 fQxGap1A = new TProfile("fQxGap1A", "Qx mean; centrality; <Qx>", 9, -0.5, 8.5);
167 fOutput->Add(fQxGap1A);
168 fQyGap1A = new TProfile("fQyGap1A", "Qy mean; centrality; <Qy>", 9, -0.5, 8.5);
169 fOutput->Add(fQyGap1A);
170 fmultGap1A = new TProfile("fmultGap1A", " Multiplicity B; centrality; M_{A}", 9, -0.5, 8.5);
171 fOutput->Add(fmultGap1A);
172
173 fQxGap1B= new TProfile("fQxGap1B", "QxB mean; centrality; <Qx>", 9, -0.5, 8.5);
174 fOutput->Add(fQxGap1B);
175 fQyGap1B = new TProfile("fQyGap1B", "QyB mean; centrality; <Qy>", 9, -0.5, 8.5);
176 fOutput->Add(fQyGap1B);
177 fmultGap1B = new TProfile("fmultGap1B", " Multiplicity B; centrality; M_{B}", 9, -0.5, 8.5);
178 fOutput->Add(fmultGap1B);
179
10a99a07 180 //large q resolution
181 fResSP_lq = new TProfile("fResSP_lq", "Resolution; centrality; Resolution", 9, -0.5, 8.5);
182 fOutput_lq->Add(fResSP_lq);
183
d64e71aa 184 fQxGap1A_lq = new TProfile("fQxGap1A_lq", "Qx mean; centrality; <Qx>", 9, -0.5, 8.5);
185 fOutput_lq->Add(fQxGap1A_lq);
186 fQyGap1A_lq = new TProfile("fQyGap1A_lq", "Qy mean; centrality; <Qy>", 9, -0.5, 8.5);
187 fOutput_lq->Add(fQyGap1A_lq);
188 fmultGap1A_lq = new TProfile("fmultGap1A_lq", " Multiplicity B; centrality; M_{A}", 9, -0.5, 8.5);
189 fOutput_lq->Add(fmultGap1A_lq);
190
191 fQxGap1B_lq= new TProfile("fQxGap1B_lq", "QxB mean; centrality; <Qx>", 9, -0.5, 8.5);
192 fOutput_lq->Add(fQxGap1B_lq);
193 fQyGap1B_lq = new TProfile("fQyGap1B_lq", "QyB mean; centrality; <Qy>", 9, -0.5, 8.5);
194 fOutput_lq->Add(fQyGap1B_lq);
195 fmultGap1B_lq = new TProfile("fmultGap1B_lq", " Multiplicity B; centrality; M_{B}", 9, -0.5, 8.5);
196 fOutput_lq->Add(fmultGap1B_lq);
197
10a99a07 198 //small q resolution
199 fResSP_sq = new TProfile("fResSP_sq", "Resolution; centrality; Resolution", 9, -0.5, 8.5);
200 fOutput_sq->Add(fResSP_sq);
d64e71aa 201
202 fQxGap1A_sq = new TProfile("fQxGap1A_sq", "Qx mean; centrality; <Qx>", 9, -0.5, 8.5);
203 fOutput_sq->Add(fQxGap1A_sq);
204 fQyGap1A_sq = new TProfile("fQyGap1A_sq", "Qy mean; centrality; <Qy>", 9, -0.5, 8.5);
205 fOutput_sq->Add(fQyGap1A_sq);
206 fmultGap1A_sq = new TProfile("fmultGap1A_sq", " Multiplicity B; centrality; M_{A}", 9, -0.5, 8.5);
207 fOutput_sq->Add(fmultGap1A_sq);
208
209 fQxGap1B_sq= new TProfile("fQxGap1B_sq", "QxB mean; centrality; <Qx>", 9, -0.5, 8.5);
210 fOutput_sq->Add(fQxGap1B_sq);
211 fQyGap1B_sq = new TProfile("fQyGap1B_sq", "QyB mean; centrality; <Qy>", 9, -0.5, 8.5);
212 fOutput_sq->Add(fQyGap1B_sq);
213 fmultGap1B_sq = new TProfile("fmultGap1B_sq", " Multiplicity B; centrality; M_{B}", 9, -0.5, 8.5);
214 fOutput_sq->Add(fmultGap1B_sq);
10a99a07 215
216 for (Int_t iC = 0; iC < 9; iC++){
217
218 fv2SPGap1A[iC] = new TProfile(Form("fv2SPGap1A_%d", iC), "v_{2}{2} vs p_{T}; p_{T} (GeV/c); v_{2}{2}", nptBins, ptBins);
219 fOutput->Add(fv2SPGap1A[iC]);
220
221 fh2v2SPGap1A[iC] = new TH2F(Form("fh2v2SPGap1A_%d", iC), "v_{2}{2} vs p_{T}; p_{T} (GeV/c); v_{2}{2}", nptBins, ptBins,200,-10,10);
222 fOutput->Add(fh2v2SPGap1A[iC]);
223
224 fv2SPGap1B[iC] = new TProfile(Form("fv2SPGap1B_%d", iC), "v_{2}{2} vs p_{T}; p_{T} (GeV/c); v_{2}{2}", nptBins, ptBins);
225 fOutput->Add(fv2SPGap1B[iC]);
226
227 fh2v2SPGap1B[iC] = new TH2F(Form("fh2v2SPGap1B_%d", iC), "v_{2}{2} vs p_{T}; p_{T} (GeV/c); v_{2}{2}", nptBins, ptBins,200,-10,10);
228 fOutput->Add(fh2v2SPGap1B[iC]);
229
230 fSinGap1A[iC] = new TProfile(Form("fSinGap1A_%d", iC), ";p_{T} (GeV/c);#LT sin(2*#phi) #GT", nptBins, ptBins);
231 fOutput->Add(fSinGap1A[iC]);
232
233 fCosGap1A[iC] = new TProfile(Form("fCosGap1A_%d", iC), ";p_{T} (GeV/c);#LT cos(2*#phi) #GT", nptBins, ptBins);
234 fOutput->Add(fCosGap1A[iC]);
235
236 fSinGap1B[iC] = new TProfile(Form("fSinGap1B_%d", iC), ";p_{T} (GeV/c);#LT sin(2*#phi) #GT", nptBins, ptBins);
237 fOutput->Add(fSinGap1B[iC]);
238
239 fCosGap1B[iC] = new TProfile(Form("fCosGap1B_%d", iC), ";p_{T} (GeV/c);#LT cos(2*#phi) #GT", nptBins, ptBins);
240 fOutput->Add(fCosGap1B[iC]);
241
242 //large q
243 fv2SPGap1A_lq[iC] = new TProfile(Form("fv2SPGap1A_lq_%d", iC), "v_{2}{2} vs p_{T}; p_{T} (GeV/c); v_{2}{2}", nptBins, ptBins);
244 fOutput_lq->Add(fv2SPGap1A_lq[iC]);
245
246 fv2SPGap1B_lq[iC] = new TProfile(Form("fv2SPGap1B_lq_%d", iC), "v_{2}{2} vs p_{T}; p_{T} (GeV/c); v_{2}{2}", nptBins, ptBins);
247 fOutput_lq->Add(fv2SPGap1B_lq[iC]);
248
249 fSinGap1A_lq[iC] = new TProfile(Form("fSinGap1A_lq_%d", iC), ";p_{T} (GeV/c);#LT sin(2*#phi) #GT", nptBins, ptBins);
250 fOutput_lq->Add(fSinGap1A_lq[iC]);
251
252 fCosGap1A_lq[iC] = new TProfile(Form("fCosGap1A_lq_%d", iC), ";p_{T} (GeV/c);#LT cos(2*#phi) #GT", nptBins, ptBins);
253 fOutput_lq->Add(fCosGap1A_lq[iC]);
254
255 fSinGap1B_lq[iC] = new TProfile(Form("fSinGap1B_lq_%d", iC), ";p_{T} (GeV/c);#LT sin(2*#phi) #GT", nptBins, ptBins);
256 fOutput_lq->Add(fSinGap1B_lq[iC]);
257
258 fCosGap1B_lq[iC] = new TProfile(Form("fCosGap1B_lq_%d", iC), ";p_{T} (GeV/c);#LT cos(2*#phi) #GT", nptBins, ptBins);
259 fOutput_lq->Add(fCosGap1B_lq[iC]);
260
261 //small q
262 fv2SPGap1A_sq[iC] = new TProfile(Form("fv2SPGap1A_sq_%d", iC), "v_{2}{2} vs p_{T}; p_{T} (GeV/c); v_{2}{2}", nptBins, ptBins);
263 fOutput_sq->Add(fv2SPGap1A_sq[iC]);
264
265 fv2SPGap1B_sq[iC] = new TProfile(Form("fv2SPGap1B_sq_%d", iC), "v_{2}{2} vs p_{T}; p_{T} (GeV/c); v_{2}{2}", nptBins, ptBins);
266 fOutput_sq->Add(fv2SPGap1B_sq[iC]);
267
268 fSinGap1A_sq[iC] = new TProfile(Form("fSinGap1A_sq_%d", iC), ";p_{T} (GeV/c);#LT sin(2*#phi) #GT", nptBins, ptBins);
269 fOutput_sq->Add(fSinGap1A_sq[iC]);
270
271 fCosGap1A_sq[iC] = new TProfile(Form("fCosGap1A_sq_%d", iC), ";p_{T} (GeV/c);#LT cos(2*#phi) #GT", nptBins, ptBins);
272 fOutput_sq->Add(fCosGap1A_sq[iC]);
273
274 fSinGap1B_sq[iC] = new TProfile(Form("fSinGap1B_sq_%d", iC), ";p_{T} (GeV/c);#LT sin(2*#phi) #GT", nptBins, ptBins);
275 fOutput_sq->Add(fSinGap1B_sq[iC]);
276
277 fCosGap1B_sq[iC] = new TProfile(Form("fCosGap1B_sq_%d", iC), "p_{T} (GeV/c);#LT cos(2*#phi) #GT", nptBins, ptBins);
278 fOutput_sq->Add(fCosGap1B_sq[iC]);
279 };
280
281 PostData(1, fOutput );
282 PostData(2, fEventCuts);
283 PostData(3, fTrackCuts);
284 PostData(4, fOutput_lq );
285 PostData(5, fOutput_sq );
286}
287
288//________________________________________________________________________
289
290void AliAnalysisTaskV2AllChAOD::UserExec(Option_t *)
291{
292 //Printf("An event");
293 // main event loop
294 fAOD = dynamic_cast<AliAODEvent*>(fInputEvent);
295 if (!fAOD) {
296 AliWarning("ERROR: AliAODEvent not available \n");
297 return;
298 }
299
300 if (strcmp(fAOD->ClassName(), "AliAODEvent"))
301 {
302 AliFatal("Not processing AODs");
303 }
304
305 if(!fEventCuts->IsSelected(fAOD,fTrackCuts))return;//event selection
306
307 Double_t Qvec=0.;//in case of MC we save space in the memory
308 if(!fIsMC){
309 if(fIsQvecCalibMode){
310 if(fVZEROside==0)Qvec=fEventCuts->GetqV0A();
311 else if (fVZEROside==1)Qvec=fEventCuts->GetqV0C();
312 }
313 else Qvec=fEventCuts->GetQvecPercentile(fVZEROside);
314 }
315
316 Double_t Cent=fEventCuts->GetCent();
317
318 Short_t centV0 = -1;
319 if ((Cent > 0) && (Cent <= 5.0))
320 centV0 = 0;
321 else if ((Cent > 5.0) && (Cent <= 10.0))
322 centV0 = 1;
323 else if ((Cent > 10.0) && (Cent <= 20.0))
324 centV0 = 2;
325 else if ((Cent > 20.0) && (Cent <= 30.0))
326 centV0 = 3;
327 else if ((Cent > 30.0) && (Cent <= 40.0))
328 centV0 = 4;
329 else if ((Cent > 40.0) && (Cent <= 50.0))
330 centV0 = 5;
331 else if ((Cent > 50.0) && (Cent <= 60.0))
332 centV0 = 6;
333 else if ((Cent > 60.0) && (Cent <= 70.0))
334 centV0 = 7;
335 else if ((Cent > 70.0) && (Cent <= 80.0))
336 centV0 = 8;
337
338
339 Double_t QxGap1A = 0., QyGap1A = 0.;
340 Double_t QxGap1B = 0., QyGap1B = 0.;
341 Int_t multGap1A = 0, multGap1B = 0;
d57dd83f 342
343 for (Int_t loop = 0; loop < 2; loop++){
10a99a07 344
d57dd83f 345 //main loop on tracks
346 for (Int_t iTracks = 0; iTracks < fAOD->GetNumberOfTracks(); iTracks++) {
347 AliAODTrack* track = fAOD->GetTrack(iTracks);
348 if(fCharge != 0 && track->Charge() != fCharge) continue;//if fCharge != 0 only select fCharge
349 if (!fTrackCuts->IsSelected(track,kTRUE)) continue; //track selection (rapidity selection NOT in the standard cuts)
10a99a07 350
d57dd83f 351
352 if (loop == 0) {
353
354 if (track->Eta() > fEtaGapMax){
355 QxGap1A += TMath::Cos(2.*track->Phi());
356 QyGap1A += TMath::Sin(2.*track->Phi());
357 multGap1A++;
10a99a07 358
d57dd83f 359 fSinGap1A[centV0]->Fill(track->Pt(), TMath::Sin(2.*track->Phi()));
360 fCosGap1A[centV0]->Fill(track->Pt(), TMath::Cos(2.*track->Phi()));
10a99a07 361
d57dd83f 362 if (Qvec > fCutLargeQperc){
363 fSinGap1A_lq[centV0]->Fill(track->Pt(), TMath::Sin(2.*track->Phi()));
364 fCosGap1A_lq[centV0]->Fill(track->Pt(), TMath::Cos(2.*track->Phi()));
365 }
10a99a07 366
d57dd83f 367 if (Qvec < fCutSmallQperc){
368 fSinGap1A_sq[centV0]->Fill(track->Pt(), TMath::Sin(2.*track->Phi()));
369 fCosGap1A_sq[centV0]->Fill(track->Pt(), TMath::Cos(2.*track->Phi()));
370 }
371 }
372
373 if (track->Eta() < fEtaGapMin){
374 QxGap1B += TMath::Cos(2.*track->Phi());
375 QyGap1B += TMath::Sin(2.*track->Phi());
376 multGap1B++;
10a99a07 377
d57dd83f 378 fCosGap1B[centV0]->Fill(track->Pt(), TMath::Cos(2.*track->Phi()));
379 fSinGap1B[centV0]->Fill(track->Pt(), TMath::Sin(2.*track->Phi()));
10a99a07 380
d57dd83f 381 if (Qvec > fCutLargeQperc){
382 fSinGap1B_lq[centV0]->Fill(track->Pt(), TMath::Sin(2.*track->Phi()));
383 fCosGap1B_lq[centV0]->Fill(track->Pt(), TMath::Cos(2.*track->Phi()));
384 }
10a99a07 385
d57dd83f 386 if (Qvec < fCutSmallQperc){
387 fSinGap1B_sq[centV0]->Fill(track->Pt(), TMath::Sin(2.*track->Phi()));
388 fCosGap1B_sq[centV0]->Fill(track->Pt(), TMath::Cos(2.*track->Phi()));
389 }
10a99a07 390 }
10a99a07 391
d57dd83f 392 } else {
10a99a07 393
d57dd83f 394 //eval v2 scalar product
395 if (track->Eta() < fEtaGapMin && multGap1A > 0){
396 Double_t v2SPGap1A = (TMath::Cos(2.*track->Phi())*QxGap1A + TMath::Sin(2.*track->Phi())*QyGap1A)/(Double_t)multGap1A;
397 fv2SPGap1A[centV0]->Fill(track->Pt(), v2SPGap1A);
398 fh2v2SPGap1A[centV0]->Fill(track->Pt(), v2SPGap1A);
10a99a07 399
d57dd83f 400 if (Qvec > fCutLargeQperc)
401 fv2SPGap1A_lq[centV0]->Fill(track->Pt(), v2SPGap1A);
10a99a07 402
d57dd83f 403 if (Qvec < fCutSmallQperc)
404 fv2SPGap1A_sq[centV0]->Fill(track->Pt(), v2SPGap1A);
405 }
10a99a07 406
d57dd83f 407 if (track->Eta() > fEtaGapMax && multGap1B > 0){
408 Double_t v2SPGap1B = (TMath::Cos(2.*track->Phi())*QxGap1B + TMath::Sin(2.*track->Phi())*QyGap1B)/(Double_t)multGap1B;
409 fv2SPGap1B[centV0]->Fill(track->Pt(), v2SPGap1B);
410 fh2v2SPGap1B[centV0]->Fill(track->Pt(), v2SPGap1B);
10a99a07 411
d57dd83f 412 if (Qvec > fCutLargeQperc)
413 fv2SPGap1B_lq[centV0]->Fill(track->Pt(), v2SPGap1B);
414
415 if (Qvec < fCutSmallQperc)
416 fv2SPGap1B_sq[centV0]->Fill(track->Pt(), v2SPGap1B);
417 }
418 }// end else
419 } // end loop on tracks
420 } // end loop
421
10a99a07 422
423 if (multGap1A > 0 && multGap1B > 0){
424 Double_t res = (QxGap1A*QxGap1B + QyGap1A*QyGap1B)/(Double_t)multGap1A/(Double_t)multGap1B;
425 fResSP->Fill((Double_t)centV0, res);
d64e71aa 426 fQxGap1A->Fill((Double_t)centV0, QxGap1A);
427 fQyGap1A->Fill((Double_t)centV0, QyGap1A);
428 fmultGap1A->Fill((Double_t)centV0, multGap1A);
429 fQxGap1B->Fill((Double_t)centV0, QxGap1B);
430 fQyGap1B->Fill((Double_t)centV0, QyGap1B);
431 fmultGap1B->Fill((Double_t)centV0, multGap1B);
10a99a07 432
433 if (Qvec > fCutLargeQperc)
434 fResSP_lq->Fill((Double_t)centV0, res);
d64e71aa 435 fQxGap1A_lq->Fill((Double_t)centV0, QxGap1A);
436 fQyGap1A_lq->Fill((Double_t)centV0, QyGap1A);
437 fmultGap1A_lq->Fill((Double_t)centV0, multGap1A);
438 fQxGap1B_lq->Fill((Double_t)centV0, QxGap1B);
439 fQyGap1B_lq->Fill((Double_t)centV0, QyGap1B);
440 fmultGap1B_lq->Fill((Double_t)centV0, multGap1B);
10a99a07 441
442 if (Qvec < fCutSmallQperc)
443 fResSP_sq->Fill((Double_t)centV0, res);
d64e71aa 444 fQxGap1A_sq->Fill((Double_t)centV0, QxGap1A);
445 fQyGap1A_sq->Fill((Double_t)centV0, QyGap1A);
446 fmultGap1A_sq->Fill((Double_t)centV0, multGap1A);
447 fQxGap1B_sq->Fill((Double_t)centV0, QxGap1B);
448 fQyGap1B_sq->Fill((Double_t)centV0, QyGap1B);
449 fmultGap1B_sq->Fill((Double_t)centV0, multGap1B);
10a99a07 450 }
451
10a99a07 452 PostData(1, fOutput );
453 PostData(2, fEventCuts);
454 PostData(3, fTrackCuts);
455 PostData(4, fOutput_lq );
456 PostData(5, fOutput_sq );
457}
458
459//_________________________________________________________________
460Bool_t AliAnalysisTaskV2AllChAOD::GetDCA(const AliAODTrack* trk, Double_t * p){
461
462 //AliAODTrack::DCA(): for newest AOD fTrack->DCA() always gives -999. This should fix.
463 //FIXME should update EventCuts?
464 //FIXME add track->GetXYZ(p) method
465
466 double xyz[3],cov[3];
467
468 if (!trk->GetXYZ(xyz)) { // dca is not stored
469 AliExternalTrackParam etp;
470 etp.CopyFromVTrack(trk);
471 AliVEvent* ev = (AliVEvent*)trk->GetEvent();
472 if (!ev) {/*printf("Event is not connected to the track\n");*/ return kFALSE;}
473 if (!etp.PropagateToDCA(ev->GetPrimaryVertex(), ev->GetMagneticField(),999,xyz,cov)) return kFALSE; // failed, track is too far from vertex
474 }
475 p[0] = xyz[0];
476 p[1] = xyz[1];
477 return kTRUE;
478
479}
480
481//_________________________________________________________________
482void AliAnalysisTaskV2AllChAOD::Terminate(Option_t *)
483{
484 // Terminate
485}