]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGLF/STRANGENESS/Hypernuclei/AliAnalysisTaskNucleiv2.cxx
Merge branch 'feature-movesplit'
[u/mrichter/AliRoot.git] / PWGLF / STRANGENESS / Hypernuclei / AliAnalysisTaskNucleiv2.cxx
CommitLineData
858fc78e 1/**************************************************************************
2 * Contributors are not mentioned at all. *
3 * *
4 * Permission to use, copy, modify and distribute this software and its *
5 * documentation strictly for non-commercial purposes is hereby granted *
6 * without fee, provided that the above copyright noticxse appears in all *
7 * copies and that both the copyright notice and this permission notice *
8 * appear in the supporting documentation. The authors make no claims *
9 * about the suitability of this software for any purpose. It is *
10 * provided "as is" without express or implied warranty. *
11 **************************************************************************/
12//-----------------------------------------------------------------
13// AliAnalysisTaskNucleiv2 class
14//-----------------------------------------------------------------
15
16class TTree;
17class TParticle;
18class TVector3;
19
20#include "AliAnalysisManager.h"
21#include <AliMCEventHandler.h>
22#include <AliMCEvent.h>
23#include <AliStack.h>
24
25class AliESDVertex;
26class AliAODVertex;
27class AliESDv0;
28class AliAODv0;
29class AliCascadeVertexer;
30
31#include <iostream>
32
33#include "TList.h"
34#include "TH1.h"
35#include "TH2.h"
36#include "TH3.h"
37#include "TNtuple.h"
38#include "TGraph.h"
39#include "TF1.h"
40#include "TCanvas.h"
41#include "TMath.h"
42#include "TChain.h"
43#include "Riostream.h"
44#include "AliLog.h"
45#include "AliCascadeVertexer.h"
46#include "AliESDEvent.h"
47#include "AliESDtrack.h"
48#include "AliExternalTrackParam.h"
49#include "AliAODEvent.h"
50#include "AliInputEventHandler.h"
51#include "AliESDcascade.h"
52#include "AliAODcascade.h"
53#include "AliAnalysisTaskNucleiv2.h"
54#include "AliESDtrackCuts.h"
55#include "AliCentrality.h"
56
57ClassImp(AliAnalysisTaskNucleiv2)
533b220a 58
59using std::cout;
60using std::endl;
858fc78e 61
62//________________________________________________________________________
63AliAnalysisTaskNucleiv2::AliAnalysisTaskNucleiv2()
64: AliAnalysisTaskSE(),
862ec7a1 65 fAnalysisType("ESD"),
858fc78e 66 fCollidingSystems(0),
862ec7a1 67 fDataType("REAL"),
68 fFillNtuple(kFALSE),
69 fListHistCascade(0),
858fc78e 70 fHistEventMultiplicity(0),
71 fHistTrackMultiplicity(0),
72 fHistTrackMultiplicityCentral(0),
73 fHistTrackMultiplicitySemiCentral(0),
74 fHistTrackMultiplicityMB(0),
75 fhBB(0),
76 fhBBDeu(0),
77 fhPtDeu(0),
78 fhTOF(0),
79 fhMassTOF(0),
862ec7a1 80 hRPangleTPCvsCentrality(0), //RESOLUTION Histrograms
81 hPlaneResoTPCvsCentrality(0),
82 hRPangleVZEROvsCentrality(0),
83 hRPangleVZEROAvsCentrality(0),
84 hRPangleVZEROCvsCentrality(0),
85 hPlaneResoVZEROvsCentrality(0),
86 hPlaneResoVZEROAvsCentrality(0),
87 hPlaneResoVZEROCvsCentrality(0),
88 hCosPhivsPt(0),
89 hSinPhivsPt(0),
90 hPhivsPt(0),
91 hAntiCosPhivsPt(0),
92 hAntiSinPhivsPt(0),
93 hAntiPhivsPt(0),
94 hCosDeltaPhivsPt075(0),
95 hSinDeltaPhivsPt075(0),
96 hDeltaPhivsPt075(0),
97 hCosDeltaPhiVZEROvsPt075(0),
98 hSinDeltaPhiVZEROvsPt075(0),
99 hDeltaPhiVZEROvsPt075(0),
100 hCosDeltaPhivsPt1530(0),
101 hSinDeltaPhivsPt1530(0),
102 hDeltaPhivsPt1530(0),
103 hCosDeltaPhiVZEROvsPt1530(0),
104 hSinDeltaPhiVZEROvsPt1530(0),
105 hDeltaPhiVZEROvsPt1530(0),
106 hCosDeltaPhivsPt3050(0),
107 hSinDeltaPhivsPt3050(0),
108 hDeltaPhivsPt3050(0),
109 hCosDeltaPhiVZEROvsPt3050(0),
110 hSinDeltaPhiVZEROvsPt3050(0),
111 hDeltaPhiVZEROvsPt3050(0),
112 hCosDeltaPhivsPt1550(0),
113 hSinDeltaPhivsPt1550(0),
114 hDeltaPhivsPt1550(0),
115 hCosDeltaPhiVZEROvsPt1550(0),
116 hSinDeltaPhiVZEROvsPt1550(0),
117 hDeltaPhiVZEROvsPt1550(0),
118 hAntiCosDeltaPhivsPt075(0),
119 hAntiSinDeltaPhivsPt075(0),
120 hAntiDeltaPhivsPt075(0),
121 hAntiCosDeltaPhiVZEROvsPt075(0),
122 hAntiSinDeltaPhiVZEROvsPt075(0),
123 hAntiDeltaPhiVZEROvsPt075(0),
124 hAntiCosDeltaPhivsPt1530(0),
125 hAntiSinDeltaPhivsPt1530(0),
126 hAntiDeltaPhivsPt1530(0),
127 hAntiCosDeltaPhiVZEROvsPt1530(0),
128 hAntiSinDeltaPhiVZEROvsPt1530(0),
129 hAntiDeltaPhiVZEROvsPt1530(0),
130 hAntiCosDeltaPhivsPt3050(0),
131 hAntiSinDeltaPhivsPt3050(0),
132 hAntiDeltaPhivsPt3050(0),
133 hAntiCosDeltaPhiVZEROvsPt3050(0),
134 hAntiSinDeltaPhiVZEROvsPt3050(0),
135 hAntiDeltaPhiVZEROvsPt3050(0),
136 hAntiCosDeltaPhivsPt1550(0),
137 hAntiSinDeltaPhivsPt1550(0),
138 hAntiDeltaPhivsPt1550(0),
139 hAntiCosDeltaPhiVZEROvsPt1550(0),
140 hAntiSinDeltaPhiVZEROvsPt1550(0),
141 hAntiDeltaPhiVZEROvsPt1550(0),
858fc78e 142 fESDtrackCuts(0),
143 fPIDResponse(0),
144 fNtuple1(0),
862ec7a1 145 tCentrality(0),
146 tTPCMomentum(0),
147 tdEdx(0),
148 tEta(0),
149 tITSclustermap(0),
150 tCharge(0),
151 tPtCorr(0),
858fc78e 152 tPhi(0),
153 trpangleTPC(0),
154 tPDGCode(0),
155 tPDGCodeMum(0),
156 tIsPrimaryTr(0),
157 fNtuple2(0) ,
158 tCentralityMC(0),
159 tPDGCodeMC(0),
160 tPDGCodeMumMC(0),
161 tIsPrimary(0),
162 tEtaMC(0),
163 tPtMC(0),
164 tYMC(0)
165{
166 // Dummy Constructor
167 fESDtrackCuts = new AliESDtrackCuts("AliESDtrackCuts","AliESDtrackCuts");
168 //
169 Initialize();
170}
171
172//________________________________________________________________________
862ec7a1 173AliAnalysisTaskNucleiv2::AliAnalysisTaskNucleiv2(const char *name,const char *datatype,Bool_t filltree)
174 : AliAnalysisTaskSE(name),
175 fAnalysisType("ESD"),
176 fCollidingSystems(0),
177 fDataType(datatype),
178 fFillNtuple(filltree),
179 fListHistCascade(0),
180 fHistEventMultiplicity(0),
181 fHistTrackMultiplicity(0),
182 fHistTrackMultiplicityCentral(0),
183 fHistTrackMultiplicitySemiCentral(0),
184 fHistTrackMultiplicityMB(0),
185 fhBB(0),
186 fhBBDeu(0),
187 fhPtDeu(0),
188 fhTOF(0),
189 fhMassTOF(0),
190 hRPangleTPCvsCentrality(0), //RESOLUTION Histrograms
191 hPlaneResoTPCvsCentrality(0),
192 hRPangleVZEROvsCentrality(0),
193 hRPangleVZEROAvsCentrality(0),
194 hRPangleVZEROCvsCentrality(0),
195 hPlaneResoVZEROvsCentrality(0),
196 hPlaneResoVZEROAvsCentrality(0),
197 hPlaneResoVZEROCvsCentrality(0),
198 hCosPhivsPt(0),
199 hSinPhivsPt(0),
200 hPhivsPt(0),
201 hAntiCosPhivsPt(0),
202 hAntiSinPhivsPt(0),
203 hAntiPhivsPt(0),
204 hCosDeltaPhivsPt075(0),
205 hSinDeltaPhivsPt075(0),
206 hDeltaPhivsPt075(0),
207 hCosDeltaPhiVZEROvsPt075(0),
208 hSinDeltaPhiVZEROvsPt075(0),
209 hDeltaPhiVZEROvsPt075(0),
210 hCosDeltaPhivsPt1530(0),
211 hSinDeltaPhivsPt1530(0),
212 hDeltaPhivsPt1530(0),
213 hCosDeltaPhiVZEROvsPt1530(0),
214 hSinDeltaPhiVZEROvsPt1530(0),
215 hDeltaPhiVZEROvsPt1530(0),
216 hCosDeltaPhivsPt3050(0),
217 hSinDeltaPhivsPt3050(0),
218 hDeltaPhivsPt3050(0),
219 hCosDeltaPhiVZEROvsPt3050(0),
220 hSinDeltaPhiVZEROvsPt3050(0),
221 hDeltaPhiVZEROvsPt3050(0),
222 hCosDeltaPhivsPt1550(0),
223 hSinDeltaPhivsPt1550(0),
224 hDeltaPhivsPt1550(0),
225 hCosDeltaPhiVZEROvsPt1550(0),
226 hSinDeltaPhiVZEROvsPt1550(0),
227 hDeltaPhiVZEROvsPt1550(0),
228 hAntiCosDeltaPhivsPt075(0),
229 hAntiSinDeltaPhivsPt075(0),
230 hAntiDeltaPhivsPt075(0),
231 hAntiCosDeltaPhiVZEROvsPt075(0),
232 hAntiSinDeltaPhiVZEROvsPt075(0),
233 hAntiDeltaPhiVZEROvsPt075(0),
234 hAntiCosDeltaPhivsPt1530(0),
235 hAntiSinDeltaPhivsPt1530(0),
236 hAntiDeltaPhivsPt1530(0),
237 hAntiCosDeltaPhiVZEROvsPt1530(0),
238 hAntiSinDeltaPhiVZEROvsPt1530(0),
239 hAntiDeltaPhiVZEROvsPt1530(0),
240 hAntiCosDeltaPhivsPt3050(0),
241 hAntiSinDeltaPhivsPt3050(0),
242 hAntiDeltaPhivsPt3050(0),
243 hAntiCosDeltaPhiVZEROvsPt3050(0),
244 hAntiSinDeltaPhiVZEROvsPt3050(0),
245 hAntiDeltaPhiVZEROvsPt3050(0),
246 hAntiCosDeltaPhivsPt1550(0),
247 hAntiSinDeltaPhivsPt1550(0),
248 hAntiDeltaPhivsPt1550(0),
249 hAntiCosDeltaPhiVZEROvsPt1550(0),
250 hAntiSinDeltaPhiVZEROvsPt1550(0),
251 hAntiDeltaPhiVZEROvsPt1550(0),
252 fESDtrackCuts(0),
253 fPIDResponse(0),
254 fNtuple1(0),
255 tCentrality(0),
256 tTPCMomentum(0),
257 tdEdx(0),
258 tEta(0),
259 tITSclustermap(0),
260 tCharge(0),
261 tPtCorr(0),
262 tPhi(0),
263 trpangleTPC(0),
264 tPDGCode(0),
265 tPDGCodeMum(0),
266 tIsPrimaryTr(0),
267 fNtuple2(0) ,
268 tCentralityMC(0),
269 tPDGCodeMC(0),
270 tPDGCodeMumMC(0),
271 tIsPrimary(0),
272 tEtaMC(0),
273 tPtMC(0),
274 tYMC(0)
275
858fc78e 276{
277 // Define input and output slots here
278 // Input slot #0 works with a TChain
279 //DefineInput(0, TChain::Class());
862ec7a1 280 // Output slot #0 writes into a TList container (Cascade)
858fc78e 281
282 //
283 // create track cuts
284 //
285 fESDtrackCuts = new AliESDtrackCuts("AliESDtrackCuts","AliESDtrackCuts");
286 //
287 Initialize();
862ec7a1 288 SetDataType(datatype);
289 SetFillTree(filltree);
858fc78e 290
291 DefineInput(0, TChain::Class());
292
293 DefineOutput(1, TList::Class());
294 DefineOutput(2, TTree::Class());
295 DefineOutput(3, TTree::Class());
862ec7a1 296
858fc78e 297}
298
299void AliAnalysisTaskNucleiv2::Initialize()
300{
301 //
302 // updating parameters in case of changes
303 //
95a079a9 304 fESDtrackCuts = AliESDtrackCuts::GetStandardITSTPCTrackCuts2011(kTRUE,kTRUE);
858fc78e 305 fESDtrackCuts->SetMaxDCAToVertexXY(3);
306 fESDtrackCuts->SetMaxDCAToVertexZ(2);
307 fESDtrackCuts->SetEtaRange(-0.8,0.8);
308 //
309 //
95a079a9 310
858fc78e 311 // Printf("Initizialize\n");
312
313}
314
315//________________________________________________________________________
316Float_t AliAnalysisTaskNucleiv2::GetPhi0Pi(Float_t phi){
317 // Sets the phi angle in the range 0-pi
318 Float_t result=phi;
319 while(result<0){
320 result=result+TMath::Pi();
321 }
322 while(result>TMath::Pi()){
323 result=result-TMath::Pi();
324 }
325 return result;
326}
327
862ec7a1 328
858fc78e 329//==================DEFINITION OF OUTPUT OBJECTS==============================
330
331void AliAnalysisTaskNucleiv2::UserCreateOutputObjects()
332{
862ec7a1 333 fListHistCascade = new TList();
334 fListHistCascade->SetOwner(); // IMPORTANT!
858fc78e 335
336 if(! fHistEventMultiplicity ){
337
338 fHistEventMultiplicity = new TH1F( "fHistEventMultiplicity" , "Nb of Events" , 12 , -0.5,11.5);
339
340 fHistEventMultiplicity->GetXaxis()->SetBinLabel(1,"All Events");
341 fHistEventMultiplicity->GetXaxis()->SetBinLabel(2,"Events w/PV");
342 fHistEventMultiplicity->GetXaxis()->SetBinLabel(3,"Events w/|Vz|<10cm");
343 fHistEventMultiplicity->GetXaxis()->SetBinLabel(4,"Central Events");
344 fHistEventMultiplicity->GetXaxis()->SetBinLabel(5,"Semi-Central Events");
345 fHistEventMultiplicity->GetXaxis()->SetBinLabel(6,"MB Events");
346 //from HF
347 fHistEventMultiplicity->GetXaxis()->SetBinLabel(7,"nEventsAnal");
348 fHistEventMultiplicity->GetXaxis()->SetBinLabel(8,"nEvSelected");
349 fHistEventMultiplicity->GetXaxis()->SetBinLabel(9,"nCandidatesSelected");
350 fHistEventMultiplicity->GetXaxis()->SetBinLabel(10,"out of pt bounds");
351 fHistEventMultiplicity->GetXaxis()->SetBinLabel(11,"mismatch lab");
352 fHistEventMultiplicity->GetXaxis()->SetBinLabel(12,"non valid TPC EP");
862ec7a1 353 fListHistCascade->Add(fHistEventMultiplicity);
858fc78e 354 }
355
356 if(! fHistTrackMultiplicity ){
357 fHistTrackMultiplicity = new TH2F( "fHistTrackMultiplicity", "Nb of Tracks MB Events |Vz| < 10", 25000,0, 25000,105,-0.5,104.5);
358 fHistTrackMultiplicity->GetXaxis()->SetTitle("Number of tracks");
359 fHistTrackMultiplicity->GetYaxis()->SetTitle("Percentile");
862ec7a1 360 fListHistCascade->Add(fHistTrackMultiplicity);
858fc78e 361 }
362
363 if(! fHistTrackMultiplicityCentral ){
364 fHistTrackMultiplicityCentral = new TH2F( "fHistTrackMultiplicityCentral", "Nb of Tracks MB Events |Vz| < 10", 25000,0, 25000,105,-0.5,104.5);
365 fHistTrackMultiplicityCentral->GetXaxis()->SetTitle("Number of tracks");
366 fHistTrackMultiplicityCentral->GetYaxis()->SetTitle("Percentile");
862ec7a1 367 fListHistCascade->Add(fHistTrackMultiplicityCentral);
858fc78e 368 }
369 if(! fHistTrackMultiplicitySemiCentral ){
370 fHistTrackMultiplicitySemiCentral = new TH2F( "fHistTrackMultiplicitySemiCentral", "Nb of Tracks MB Events |Vz| < 10", 25000,0, 25000,105,-0.5,104.5);
371 fHistTrackMultiplicitySemiCentral->GetXaxis()->SetTitle("Number of tracks");
372 fHistTrackMultiplicitySemiCentral->GetYaxis()->SetTitle("Percentile");
862ec7a1 373 fListHistCascade->Add(fHistTrackMultiplicitySemiCentral);
858fc78e 374 }
375 if(! fHistTrackMultiplicityMB ){
376 fHistTrackMultiplicityMB = new TH2F( "fHistTrackMultiplicityMB", "Nb of Tracks MB Events |Vz| < 10", 25000,0, 25000,105,-0.5,104.5);
377 fHistTrackMultiplicityMB->GetXaxis()->SetTitle("Number of tracks");
378 fHistTrackMultiplicityMB->GetYaxis()->SetTitle("Percentile");
862ec7a1 379 fListHistCascade->Add(fHistTrackMultiplicityMB);
858fc78e 380 }
381
382 if(! fhBB ){
383 fhBB = new TH2F( "fhBB" , "BetheBlochTPC" , 240,-6,6,1000,0,1000);
862ec7a1 384 fListHistCascade->Add(fhBB);
858fc78e 385 }
386
387 if(! fhBBDeu ){
388 fhBBDeu = new TH2F( "fhBBDeu" , "BetheBlochTPC - Deuteron" , 240,-6,6,1000,0,1000);
862ec7a1 389 fListHistCascade->Add(fhBBDeu);
858fc78e 390 }
391
392 if(!fhPtDeu ){
393 fhPtDeu = new TH2F( "fhPtDeu" , "pt corretto vs pt track - Deuteron" , 120,0,6,120,0,6);
862ec7a1 394 fListHistCascade->Add(fhPtDeu);
858fc78e 395 }
396
397 if(! fhTOF ){
398 fhTOF = new TH2F( "fhTOF" , "Scatter Plot TOF" , 240,-6,6,1000,0,1.2);
862ec7a1 399 fListHistCascade->Add(fhTOF);
858fc78e 400 }
401 if(! fhMassTOF){
402 fhMassTOF=new TH1F ("fhMassTOF","Particle Mass - TOF", 300,-5 ,5);
862ec7a1 403 fListHistCascade->Add(fhMassTOF);
858fc78e 404 }
95a079a9 405
862ec7a1 406 if(!hRPangleTPCvsCentrality){
407 hRPangleTPCvsCentrality = new TH2F("hRPangleTPCvsCentrality" ,"hRPangleTPCvsCentrality" ,100,0,TMath::Pi(),210,-0.5,105.5);
408 fListHistCascade->Add(hRPangleTPCvsCentrality);
409 }
410 if(!hPlaneResoTPCvsCentrality){
411 hPlaneResoTPCvsCentrality = new TH2F("hPlaneResoTPCvsCentrality" ,"hPlaneResoTPCvsCentrality" ,500,-1,1,210,-0.5,105.5);
412 fListHistCascade->Add(hPlaneResoTPCvsCentrality);
413 }
414 if(!hRPangleVZEROvsCentrality){
415 hRPangleVZEROvsCentrality = new TH2F("hRPangleVZEROvsCentrality" ,"hRPangleVZEROvsCentrality" ,100,0,TMath::Pi(),210,-0.5,105.5);
416 fListHistCascade->Add(hRPangleVZEROvsCentrality);
417 }
95a079a9 418
862ec7a1 419 if(!hRPangleVZEROAvsCentrality){
420 hRPangleVZEROAvsCentrality = new TH2F("hRPangleVZEROAvsCentrality" ,"hRPangleVZEROAvsCentrality" ,100,0,TMath::Pi(),210,-0.5,105.5);
421 fListHistCascade->Add(hRPangleVZEROAvsCentrality);
422 }
95a079a9 423
862ec7a1 424 if(!hRPangleVZEROCvsCentrality){
425 hRPangleVZEROCvsCentrality = new TH2F("hRPangleVZEROCvsCentrality" ,"hRPangleVZEROCvsCentrality" ,100,0,TMath::Pi(),210,-0.5,105.5);
426 fListHistCascade->Add(hRPangleVZEROCvsCentrality);
427 }
428
429 if(!hPlaneResoVZEROvsCentrality){
430 hPlaneResoVZEROvsCentrality = new TH2F("hPlaneResoVZEROvsCentrality","hPlaneResoVZEROvsCentrality",500,-1,1,210,-0.5,105.5);
431 fListHistCascade->Add(hPlaneResoVZEROvsCentrality);
432 }
433
434 if(!hPlaneResoVZEROAvsCentrality){
435 hPlaneResoVZEROAvsCentrality = new TH2F("hPlaneResoVZEROAvsCentrality","hPlaneResoVZEROAvsCentrality",500,-1,1,210,-0.5,105.5);
436 fListHistCascade->Add(hPlaneResoVZEROAvsCentrality);
437 }
95a079a9 438
862ec7a1 439 if(!hPlaneResoVZEROCvsCentrality){
440 hPlaneResoVZEROCvsCentrality = new TH2F("hPlaneResoVZEROCvsCentrality","hPlaneResoVZEROCvsCentrality",500,-1,1,210,-0.5,105.5);
441 fListHistCascade->Add(hPlaneResoVZEROCvsCentrality);
442 }
84bef463 443
862ec7a1 444 hCosPhivsPt = new TH2F("hCosPhivsPt","hCosPhivsPt",200,-1,1,60,0,3.0);
445 hSinPhivsPt = new TH2F("hSinPhivsPt","hSinPhivsPt",100, 0,1,60,0,3.0);
446 hPhivsPt = new TH2F("hPhivsPt","hPhivsPt" ,36, 0,2*TMath::Pi(),60,0,3.0);
447
448 hAntiCosPhivsPt = new TH2F("hAntiCosPhivsPt","hAntiCosPhivsPt",200,-1,1,60,0,3.0);
449 hAntiSinPhivsPt = new TH2F("hAntiSinPhivsPt","hAntiSinPhivsPt",100, 0,1,60,0,3.0);
450 hAntiPhivsPt = new TH2F("hAntiPhivsPt","hAntiPhivsPt" ,36, 0,2*TMath::Pi(),60,0,3.0);
95a079a9 451
95a079a9 452
862ec7a1 453 hCosDeltaPhivsPt075 = new TH2F("hCosDeltaPhivsPt075","hCosDeltaPhivsPt075",200,-1,1,60,0,3.0);
454 hSinDeltaPhivsPt075 = new TH2F("hSinDeltaPhivsPt075","hSinDeltaPhivsPt075",100, 0,1,60,0,3.0);
455 hDeltaPhivsPt075 = new TH2F("hDeltaPhivsPt075","hDeltaPhivsPt075" ,36, 0,2*TMath::Pi(),60,0,3.0);
456
457 hCosDeltaPhiVZEROvsPt075 = new TH2F("hCosDeltaPhiVZEROvsPt075","hCosDeltaPhiVZEROvsPt075",200,-1,1,60,0,3.0);
458 hSinDeltaPhiVZEROvsPt075 = new TH2F("hSinDeltaPhiVZEROvsPt075","hSinDeltaPhiVZEROvsPt075",100, 0,1,60,0,3.0);
459 hDeltaPhiVZEROvsPt075 = new TH2F("hDeltaPhiVZEROvsPt075","hDeltaPhiVZEROvsPt075" ,36, 0,2*TMath::Pi(),60,0,3.0);
84bef463 460
862ec7a1 461 hCosDeltaPhivsPt1530 = new TH2F("hCosDeltaPhivsPt1530","hCosDeltaPhivsPt1530",200,-1,1,60,0,3.0);
462 hSinDeltaPhivsPt1530 = new TH2F("hSinDeltaPhivsPt1530","hSinDeltaPhivsPt1530",100, 0,1,60,0,3.0);
463 hDeltaPhivsPt1530 = new TH2F("hDeltaPhivsPt1530","hDeltaPhivsPt1530" ,36, 0,2*TMath::Pi(),60,0,3.0);
464
465 hCosDeltaPhiVZEROvsPt1530 = new TH2F("hCosDeltaPhiVZEROvsPt1530","hCosDeltaPhiVZEROvsPt1530",200,-1,1,60,0,3.0);
466 hSinDeltaPhiVZEROvsPt1530 = new TH2F("hSinDeltaPhiVZEROvsPt1530","hSinDeltaPhiVZEROvsPt1530",100, 0,1,60,0,3.0);
467 hDeltaPhiVZEROvsPt1530 = new TH2F("hDeltaPhiVZEROvsPt1530","hDeltaPhiVZEROvsPt1530" ,36, 0,2*TMath::Pi(),60,0,3.0);
468
469 hCosDeltaPhivsPt3050 = new TH2F("hCosDeltaPhivsPt3050","hCosDeltaPhivsPt3050",200,-1,1,60,0,3.0);
470 hSinDeltaPhivsPt3050 = new TH2F("hSinDeltaPhivsPt3050","hSinDeltaPhivsPt3050",100, 0,1,60,0,3.0);
471 hDeltaPhivsPt3050 = new TH2F("hDeltaPhivsPt3050","hDeltaPhivsPt3050" ,36, 0,2*TMath::Pi(),60,0,3.0);
472
473 hCosDeltaPhiVZEROvsPt3050 = new TH2F("hCosDeltaPhiVZEROvsPt3050","hCosDeltaPhiVZEROvsPt3050",200,-1,1,60,0,3.0);
474 hSinDeltaPhiVZEROvsPt3050 = new TH2F("hSinDeltaPhiVZEROvsPt3050","hSinDeltaPhiVZEROvsPt3050",100, 0,1,60,0,3.0);
475 hDeltaPhiVZEROvsPt3050 = new TH2F("hDeltaPhiVZEROvsPt3050","hDeltaPhiVZEROvsPt3050" ,36, 0,2*TMath::Pi(),60,0,3.0);
476
477 hCosDeltaPhivsPt1550 = new TH2F("hCosDeltaPhivsPt1550","hCosDeltaPhivsPt1550",200,-1,1,60,0,3.0);
478 hSinDeltaPhivsPt1550 = new TH2F("hSinDeltaPhivsPt1550","hSinDeltaPhivsPt1550",100, 0,1,60,0,3.0);
479 hDeltaPhivsPt1550 = new TH2F("hDeltaPhivsPt1550","hDeltaPhivsPt1550" ,36, 0,2*TMath::Pi(),60,0,3.0);
480
481 hCosDeltaPhiVZEROvsPt1550 = new TH2F("hCosDeltaPhiVZEROvsPt1550","hCosDeltaPhiVZEROvsPt1550",200,-1,1,60,0,3.0);
482 hSinDeltaPhiVZEROvsPt1550 = new TH2F("hSinDeltaPhiVZEROvsPt1550","hSinDeltaPhiVZEROvsPt1550",100, 0,1,60,0,3.0);
483 hDeltaPhiVZEROvsPt1550 = new TH2F("hDeltaPhiVZEROvsPt1550","hDeltaPhiVZEROvsPt1550" ,36, 0,2*TMath::Pi(),60,0,3.0);
484
485
486 hAntiCosDeltaPhivsPt075 = new TH2F("hAntiCosDeltaPhivsPt075","hAntiCosDeltaPhivsPt075",200,-1,1,60,0,3.0);
487 hAntiSinDeltaPhivsPt075 = new TH2F("hAntiSinDeltaPhivsPt075","hAntiSinDeltaPhivsPt075",100, 0,1,60,0,3.0);
488 hAntiDeltaPhivsPt075 = new TH2F("hAntiDeltaPhivsPt075","hAntiDeltaPhivsPt075" ,36, 0,2*TMath::Pi(),60,0,3.0);
489
490 hAntiCosDeltaPhiVZEROvsPt075 = new TH2F("hAntiCosDeltaPhiVZEROvsPt075","hAntiCosDeltaPhiVZEROvsPt075",200,-1,1,60,0,3.0);
491 hAntiSinDeltaPhiVZEROvsPt075 = new TH2F("hAntiSinDeltaPhiVZEROvsPt075","hAntiSinDeltaPhiVZEROvsPt075",100, 0,1,60,0,3.0);
492 hAntiDeltaPhiVZEROvsPt075 = new TH2F("hAntiDeltaPhiVZEROvsPt075","hAntiDeltaPhiVZEROvsPt075" ,36, 0,2*TMath::Pi(),60,0,3.0);
493
494 hAntiCosDeltaPhivsPt1530 = new TH2F("hAntiCosDeltaPhivsPt1530","hAntiCosDeltaPhivsPt1530",200,-1,1,60,0,3.0);
495 hAntiSinDeltaPhivsPt1530 = new TH2F("hAntiSinDeltaPhivsPt1530","hAntiSinDeltaPhivsPt1530",100, 0,1,60,0,3.0);
496 hAntiDeltaPhivsPt1530 = new TH2F("hAntiDeltaPhivsPt1530","hAntiDeltaPhivsPt1530" ,36, 0,2*TMath::Pi(),60,0,3.0);
497
498 hAntiCosDeltaPhiVZEROvsPt1530 = new TH2F("hAntiCosDeltaPhiVZEROvsPt1530","hAntiCosDeltaPhiVZEROvsPt1530",200,-1,1,60,0,3.0);
499 hAntiSinDeltaPhiVZEROvsPt1530 = new TH2F("hAntiSinDeltaPhiVZEROvsPt1530","hAntiSinDeltaPhiVZEROvsPt1530",100, 0,1,60,0,3.0);
500 hAntiDeltaPhiVZEROvsPt1530 = new TH2F("hAntiDeltaPhiVZEROvsPt1530","hAntiDeltaPhiVZEROvsPt1530" ,36, 0,2*TMath::Pi(),60,0,3.0);
501
502 hAntiCosDeltaPhivsPt3050 = new TH2F("hAntiCosDeltaPhivsPt3050","hAntiCosDeltaPhivsPt3050",200,-1,1,60,0,3.0);
503 hAntiSinDeltaPhivsPt3050 = new TH2F("hAntiSinDeltaPhivsPt3050","hAntiSinDeltaPhivsPt3050",100, 0,1,60,0,3.0);
504 hAntiDeltaPhivsPt3050 = new TH2F("hAntiDeltaPhivsPt3050","hAntiDeltaPhivsPt3050" ,36, 0,2*TMath::Pi(),60,0,3.0);
505
506 hAntiCosDeltaPhiVZEROvsPt3050 = new TH2F("hAntiCosDeltaPhiVZEROvsPt3050","hAntiCosDeltaPhiVZEROvsPt3050",200,-1,1,60,0,3.0);
507 hAntiSinDeltaPhiVZEROvsPt3050 = new TH2F("hAntiSinDeltaPhiVZEROvsPt3050","hAntiSinDeltaPhiVZEROvsPt3050",100, 0,1,60,0,3.0);
508 hAntiDeltaPhiVZEROvsPt3050 = new TH2F("hAntiDeltaPhiVZEROvsPt3050","hAntiDeltaPhiVZEROvsPt3050" ,36, 0,2*TMath::Pi(),60,0,3.0);
509
510 hAntiCosDeltaPhivsPt1550 = new TH2F("hAntiCosDeltaPhivsPt1550","hAntiCosDeltaPhivsPt1550",200,-1,1,60,0,3.0);
511 hAntiSinDeltaPhivsPt1550 = new TH2F("hAntiSinDeltaPhivsPt1550","hAntiSinDeltaPhivsPt1550",100, 0,1,60,0,3.0);
512 hAntiDeltaPhivsPt1550 = new TH2F("hAntiDeltaPhivsPt1550","hAntiDeltaPhivsPt1550" ,36, 0,2*TMath::Pi(),60,0,3.0);
513
514 hAntiCosDeltaPhiVZEROvsPt1550 = new TH2F("hAntiCosDeltaPhiVZEROvsPt1550","hAntiCosDeltaPhiVZEROvsPt1550",200,-1,1,60,0,3.0);
515 hAntiSinDeltaPhiVZEROvsPt1550 = new TH2F("hAntiSinDeltaPhiVZEROvsPt1550","hAntiSinDeltaPhiVZEROvsPt1550",100, 0,1,60,0,3.0);
516 hAntiDeltaPhiVZEROvsPt1550 = new TH2F("hAntiDeltaPhiVZEROvsPt1550","hAntiDeltaPhiVZEROvsPt1550" ,36, 0,2*TMath::Pi(),60,0,3.0);
517
518 //--------------
519 fListHistCascade->Add(hCosPhivsPt);
520 fListHistCascade->Add(hSinPhivsPt);
521 fListHistCascade->Add(hPhivsPt);
522 fListHistCascade->Add(hAntiCosPhivsPt);
523 fListHistCascade->Add(hAntiSinPhivsPt);
524 fListHistCascade->Add(hAntiPhivsPt);
525 fListHistCascade->Add(hCosDeltaPhivsPt075);
526 fListHistCascade->Add(hSinDeltaPhivsPt075);
527 fListHistCascade->Add(hDeltaPhivsPt075);
528 fListHistCascade->Add(hCosDeltaPhiVZEROvsPt075);
529 fListHistCascade->Add(hSinDeltaPhiVZEROvsPt075);
530 fListHistCascade->Add(hDeltaPhiVZEROvsPt075);
531 fListHistCascade->Add(hCosDeltaPhivsPt1530);
532 fListHistCascade->Add(hSinDeltaPhivsPt1530);
533 fListHistCascade->Add(hDeltaPhivsPt1530);
534 fListHistCascade->Add(hCosDeltaPhiVZEROvsPt1530);
535 fListHistCascade->Add(hSinDeltaPhiVZEROvsPt1530);
536 fListHistCascade->Add(hDeltaPhiVZEROvsPt1530);
537 fListHistCascade->Add(hCosDeltaPhivsPt3050);
538 fListHistCascade->Add(hSinDeltaPhivsPt3050);
539 fListHistCascade->Add(hDeltaPhivsPt3050);
540 fListHistCascade->Add(hCosDeltaPhiVZEROvsPt3050);
541 fListHistCascade->Add(hSinDeltaPhiVZEROvsPt3050);
542 fListHistCascade->Add(hDeltaPhiVZEROvsPt3050);
543 fListHistCascade->Add(hCosDeltaPhivsPt1550);
544 fListHistCascade->Add(hSinDeltaPhivsPt1550);
545 fListHistCascade->Add(hDeltaPhivsPt1550);
546 fListHistCascade->Add(hCosDeltaPhiVZEROvsPt1550);
547 fListHistCascade->Add(hSinDeltaPhiVZEROvsPt1550);
548 fListHistCascade->Add(hDeltaPhiVZEROvsPt1550);
549 fListHistCascade->Add(hAntiCosDeltaPhivsPt075);
550 fListHistCascade->Add(hAntiSinDeltaPhivsPt075);
551 fListHistCascade->Add(hAntiDeltaPhivsPt075);
552 fListHistCascade->Add(hAntiCosDeltaPhiVZEROvsPt075);
553 fListHistCascade->Add(hAntiSinDeltaPhiVZEROvsPt075);
554 fListHistCascade->Add(hAntiDeltaPhiVZEROvsPt075);
555 fListHistCascade->Add(hAntiCosDeltaPhivsPt1530);
556 fListHistCascade->Add(hAntiSinDeltaPhivsPt1530);
557 fListHistCascade->Add(hAntiDeltaPhivsPt1530);
558 fListHistCascade->Add(hAntiCosDeltaPhiVZEROvsPt1530);
559 fListHistCascade->Add(hAntiSinDeltaPhiVZEROvsPt1530);
560 fListHistCascade->Add(hAntiDeltaPhiVZEROvsPt1530);
561 fListHistCascade->Add(hAntiCosDeltaPhivsPt3050);
562 fListHistCascade->Add(hAntiSinDeltaPhivsPt3050);
563 fListHistCascade->Add(hAntiDeltaPhivsPt3050);
564 fListHistCascade->Add(hAntiCosDeltaPhiVZEROvsPt3050);
565 fListHistCascade->Add(hAntiSinDeltaPhiVZEROvsPt3050);
566 fListHistCascade->Add(hAntiDeltaPhiVZEROvsPt3050);
567 fListHistCascade->Add(hAntiCosDeltaPhivsPt1550);
568 fListHistCascade->Add(hAntiSinDeltaPhivsPt1550);
569 fListHistCascade->Add(hAntiDeltaPhivsPt1550);
570 fListHistCascade->Add(hAntiCosDeltaPhiVZEROvsPt1550);
571 fListHistCascade->Add(hAntiSinDeltaPhiVZEROvsPt1550);
572 fListHistCascade->Add(hAntiDeltaPhiVZEROvsPt1550);
858fc78e 573
574 if(! fNtuple1 ) {
575
576 fNtuple1 = new TTree("fNtuple1","fNtuple1");
577
862ec7a1 578 fNtuple1->Branch("tEventNumber" ,&tEventNumber ,"tEventNumber[7]/D");
579 fNtuple1->Branch("tCentrality" ,&tCentrality ,"tCentrality/D" );
580 fNtuple1->Branch("tVertexCoord" ,&tVertexCoord ,"tVertexCoord[3]/D");
581 fNtuple1->Branch("tPIDITS" ,&tPIDITS ,"tPIDITS[9]/D" );
582 fNtuple1->Branch("tPIDTPC" ,&tPIDTPC ,"tPIDTPC[9]/D" );
583 fNtuple1->Branch("tPIDTOF" ,&tPIDTOF ,"tPIDTOF[9]/D" );
584 fNtuple1->Branch("tPulls" ,&tPulls ,"tPulls[2]/D" );
585 fNtuple1->Branch("tMomentum" ,&tMomentum ,"tMomentum[3]/D" );
586 fNtuple1->Branch("tTPCMomentum" ,&tTPCMomentum ,"tTPCMomentum/D" );
587 fNtuple1->Branch("tdEdx" ,&tdEdx ,"tdEdx/D" );
588 fNtuple1->Branch("tEta" ,&tEta ,"tEta/D" );
858fc78e 589 fNtuple1->Branch("tDCA" ,&tDCA ,"tDCA[2]/D" );
862ec7a1 590 fNtuple1->Branch("tTracksTPC" ,&tTracksTPC ,"tTracksTPC[2]/D" );
591 fNtuple1->Branch("tITSclustermap",&tITSclustermap,"tITSclustermap" );
592 fNtuple1->Branch("tITSsample" ,&tITSsample ,"tITSsample[4]/D" );
593 fNtuple1->Branch("tisTOF[2]" ,&tisTOF ,"tisTOF[2]/I" );
858fc78e 594 fNtuple1->Branch("tTOFtrack" ,&tTOFtrack ,"tTOFtrack[3]/D" );
595 fNtuple1->Branch("tCharge" ,&tCharge ,"tCharge/I" );
862ec7a1 596 fNtuple1->Branch("tPtCorr" ,&tPtCorr ,"tPtCorr/D" );
858fc78e 597 fNtuple1->Branch("tPhi" ,&tPhi ,"tPhi/D" );
598 fNtuple1->Branch("trpangleTPC" ,&trpangleTPC ,"trpangleTPC/D" );
599 fNtuple1->Branch("trpangleVZERO" ,&trpangleVZERO ,"trpangleVZERO[3]/D" );
600
601 if(fDataType == "SIM"){
602 fNtuple1->Branch("tPDGCode" ,&tPDGCode ,"tPDGCode/D" );
603 fNtuple1->Branch("tPDGCodeMum" ,&tPDGCode ,"tPDGCodeMum/D" );
604 fNtuple1->Branch("tIsPrimaryTr" ,&tIsPrimaryTr ,"tIsPrimaryTr/D" );
605 fNtuple1->Branch("tIsSecondaryTr",&tIsSecondaryTr,"tIsSecondaryTr[2]/D" );
606 }
607
608 }
862ec7a1 609
610
858fc78e 611
612
613 if(fDataType == "SIM"){
614
615 if(! fNtuple2 ) {
616
617 fNtuple2 = new TTree("fNtuple2","fNtuple2");
618
862ec7a1 619 fNtuple2->Branch("tEventNumberMC" ,&tEventNumberMC ,"tEventNumberMC[6]/D");
858fc78e 620 fNtuple2->Branch("tCentralityMC" ,&tCentralityMC ,"tCentralityMC/D" );
621 fNtuple2->Branch("tVertexCoordMC" ,&tVertexCoordMC ,"tVertexCoordMC[3]/D");
622 fNtuple2->Branch("tMomentumMC" ,&tMomentumMC ,"tMomentumMC[3]/D" );
623 fNtuple2->Branch("tPDGCodeMC" ,&tPDGCodeMC ,"tPDGCodeMC/D" );
624 fNtuple2->Branch("tPDGCodeMumMC" ,&tPDGCodeMC ,"tPDGCodeMumMC/D" );
625 fNtuple2->Branch("tIsPrimary" ,&tIsPrimary ,"tIsPrimary/D" );
626 fNtuple2->Branch("tIsSecondary" ,&tIsSecondary ,"tIsSecondary[2]/D" );
627 fNtuple2->Branch("tEtaMC" ,&tEtaMC ,"tEtaMC/D" );
628 fNtuple2->Branch("tPtMC" ,&tPtMC ,"tPtMC/D" );
629 fNtuple2->Branch("tYMC" ,&tYMC ,"tYMC/D" );
630
631 }
632
633 }
862ec7a1 634
635 PostData(1, fListHistCascade);
858fc78e 636 PostData(2, fNtuple1);
637 PostData(3, fNtuple2);
638}// end UserCreateOutputObjects
639
640
641//====================== USER EXEC ========================
642
643void AliAnalysisTaskNucleiv2::UserExec(Option_t *)
644{
645 // Main loop
646 // Called for EACH event
647 // cout<<"AliAnalysisTaskNucleiv2 Starting UserExec"<<endl;
648
649 Info("AliAnalysisTaskNucleiv2","Starting UserExec");
650
651 AliVEvent *event = InputEvent();
652 if (!event) { Printf("ERROR: Could not retrieve event"); return; }
653
654 AliStack *stack = 0;
655 if(fDataType == "SIM"){
862ec7a1 656
858fc78e 657 AliMCEvent *mcEvent = MCEvent();
658 if (!mcEvent) {
659 Printf("ERROR: Could not retrieve MC event");
660 return;
661 }
662 Printf("MC particles: %d", mcEvent->GetNumberOfTracks());
663 stack = mcEvent->Stack();
664 if( !stack ) {
665 Printf( "Stack not available");
666 return;
667 }
668 }
669
670 // create pointer to event
858fc78e 671
862ec7a1 672 AliESDEvent* lESDevent = dynamic_cast<AliESDEvent*>(event);
673 if (!lESDevent) {
674 AliError("Cannot get the ESD event");
675 return;
676 }
677
678 fHistEventMultiplicity->Fill(1);
679 fHistEventMultiplicity->Fill(7);
680
681 //_____________________________________________________
682 // Centrality
683
684 AliCentrality *centrality = lESDevent->GetCentrality();
685 Float_t percentile=centrality->GetCentralityPercentile("V0M");
686
687 Int_t TrackNumber = lESDevent->GetNumberOfTracks();
688 fHistTrackMultiplicity->Fill(TrackNumber,percentile); //tracce per evento
689
690 //______________________________________________________
691 // PID
692
693 AliAnalysisManager *man=AliAnalysisManager::GetAnalysisManager();
694 AliInputEventHandler* inputHandler = (AliInputEventHandler*) (man->GetInputEventHandler());
695 fPIDResponse=inputHandler->GetPIDResponse();
696
697 //=================================================================
698
699 //!*********************!//
700 //! Define variables !//
701 //!*********************!//
702
703 Double_t evNumber = 0.;
704 Double_t runNumber = 0.;
705 Double_t BCNumber = 0.;
706 Double_t OrbitNumber = 0.;
707 Double_t PeriodNumber = 0.;
708
709
710 Double_t ITSsample[4];
711 for(Int_t i=0;i<4;i++)ITSsample[i]=0;
712
713 Double_t xPrimaryVertex=0.,yPrimaryVertex=0.,zPrimaryVertex=0.;
714 Float_t impactXY=-999., impactZ=-999.;
715 Double_t pinTPC=0.,poutTPC=0.,TPCSignal=0.;
716
717 ULong_t status=0;
718 Bool_t isTPC=kFALSE;
719
84bef463 720
862ec7a1 721 // Primary vertex cut
84bef463 722
862ec7a1 723 const AliESDVertex *vtx = lESDevent->GetPrimaryVertexTracks();
724
725 if(vtx->GetNContributors()<1) {
726
727 // SPD vertex cut
728 vtx = lESDevent->GetPrimaryVertexSPD();
858fc78e 729
730 if(vtx->GetNContributors()<1) {
862ec7a1 731 Info("AliAnalysisTaskHelium3Pi","No good vertex, skip event");
732 return; // NO GOOD VERTEX, SKIP EVENT
858fc78e 733 }
862ec7a1 734 }
735
736 fHistEventMultiplicity->Fill(2); // analyzed events with PV
737
96fa4605 738 xPrimaryVertex=vtx->GetX();
739 yPrimaryVertex=vtx->GetY();
740 zPrimaryVertex=vtx->GetZ();
862ec7a1 741
742 if(TMath::Abs(zPrimaryVertex)>10) return;
743 fHistEventMultiplicity->Fill(3);
744
745 Bool_t isSelectedCentral = (((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected() & AliVEvent::kCentral);
746 Bool_t isSelectedSemiCentral = (((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected() & AliVEvent::kSemiCentral);
747 Bool_t isSelectedMB = (((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected() & AliVEvent::kMB);
748
749 fHistTrackMultiplicity->Fill(TrackNumber,percentile);
750
751 Int_t eventtype = -999;
752
753 // cout<<"ET 1: "<<eventtype<<endl;
858fc78e 754
862ec7a1 755 if(fDataType == "REAL"){
756
757 if(isSelectedCentral){
758 if(percentile<0)return;
759 if(percentile>=7.5)return;
760 fHistEventMultiplicity->Fill(4);
761 fHistTrackMultiplicityCentral->Fill(TrackNumber,percentile);
762 eventtype =1;
763 }
858fc78e 764
862ec7a1 765 if(isSelectedSemiCentral){
766 if(percentile<15)return;
767 if(percentile>=50)return;
768 fHistEventMultiplicity->Fill(5);
769 fHistTrackMultiplicitySemiCentral->Fill(TrackNumber,percentile);
770 eventtype =2;
771 }
858fc78e 772
862ec7a1 773 if(isSelectedMB){
774 if(percentile<0)return;
775 if(percentile>=80)return;
776 fHistEventMultiplicity->Fill(6);
777 fHistTrackMultiplicityMB->Fill(TrackNumber,percentile);
778 eventtype =3;
779 }
858fc78e 780
862ec7a1 781 // cout<<"ET 2: "<<eventtype<<endl;
858fc78e 782
862ec7a1 783 if(eventtype!=1 && eventtype!=2 && eventtype!=3 )return;
784 }
785
786 if(fDataType == "SIM"){
787 cout<<"Take SIM event"<<endl;
788 eventtype = -999;
789 //cout<<"ET MC: "<<eventtype<<endl;
790 if(eventtype!=-999)return;
84bef463 791
862ec7a1 792 }
793
794 evNumber = lESDevent->GetEventNumberInFile();
795 runNumber = lESDevent->GetRunNumber();
796 BCNumber = lESDevent->GetBunchCrossNumber();
797 OrbitNumber = lESDevent->GetOrbitNumber();
798 PeriodNumber= lESDevent->GetPeriodNumber();
799
800 AliEventplane *pl=lESDevent->GetEventplane();
801
802 if(fDataType == "REAL"){
84bef463 803
862ec7a1 804 if(!pl ){
805 AliError("AliAnalysisTaskSENucleiv2::UserExec:no eventplane! v2 analysis without eventplane not possible!\n");
806 fHistEventMultiplicity->Fill(12);
858fc78e 807 }
862ec7a1 808 }
858fc78e 809
862ec7a1 810 //Event plane
811
812 Double_t rpangleTPC =0;
813 Double_t rpangleVZERO =0;
814
815 Double_t rpangleeventATPC =0;
816 Double_t rpangleeventBTPC =0;
817 Double_t deltaPsiTPC =0;
818 Double_t planeresoTPC =0;
819
820 Double_t rpangleeventAVZERO =0;
821 Double_t rpangleeventBVZERO =0;
822 Double_t rpangleeventCVZERO =0;
823 Double_t deltaPsiVZERO =0;
824 Double_t planeresoVZERO =0;
825
826 //For candidate removal from TPC EP
827
828 TVector2 *qsub1=0x0;
829 TVector2 *qsub2=0x0;
830
831 rpangleTPC = pl->GetEventplane("Q");
832
833 if(fDataType == "REAL"){
834 if(rpangleTPC<0){
835 fHistEventMultiplicity->Fill(11);
836 return;
84bef463 837 }
862ec7a1 838 }
839
840 //TPC resolution
7f10316c 841
862ec7a1 842 hRPangleTPCvsCentrality->Fill(rpangleTPC,percentile);
843
844 qsub1 = pl->GetQsub1();
845 qsub2 = pl->GetQsub2();
846
847 if(fDataType == "REAL"){
848 if(!qsub1 || !qsub2){
849 AliError("AliAnalysisTaskSENucleiv2::UserExec:no qsub1 or qsub2!\n");
850 return;
858fc78e 851 }
862ec7a1 852
853 //TPC event Plane
858fc78e 854
862ec7a1 855 rpangleeventATPC = qsub1->Phi()/2.;
856 rpangleeventBTPC = qsub2->Phi()/2.;
858fc78e 857
862ec7a1 858 deltaPsiTPC =rpangleeventATPC-rpangleeventBTPC;
858fc78e 859
862ec7a1 860 if(TMath::Abs(deltaPsiTPC)>TMath::Pi()/2.){
861 if(deltaPsiTPC>0.) deltaPsiTPC-=TMath::Pi();
862 else deltaPsiTPC +=TMath::Pi();
863 } // difference of subevents reaction plane angle cannot be bigger than phi/2
858fc78e 864
862ec7a1 865 planeresoTPC = TMath::Cos(2.*deltaPsiTPC); // reaction plane resolution
858fc78e 866
862ec7a1 867 hPlaneResoTPCvsCentrality->Fill(planeresoTPC,percentile);
868
869 //VZERO event plane
870
871 rpangleVZERO = GetPhi0Pi(pl->GetEventplane("V0",lESDevent,2));
872 rpangleeventBVZERO=GetPhi0Pi(pl->GetEventplane("V0A",lESDevent,2));
873 rpangleeventCVZERO=GetPhi0Pi(pl->GetEventplane("V0C",lESDevent,2));
874
875 hRPangleVZEROvsCentrality->Fill(rpangleVZERO,percentile);
876 hRPangleVZEROAvsCentrality->Fill(rpangleeventBVZERO,percentile);
877 hRPangleVZEROCvsCentrality->Fill(rpangleeventCVZERO,percentile);
878
879 //Resolution V0 : V0M - V0A
880 rpangleeventAVZERO = rpangleVZERO;
881 deltaPsiVZERO =rpangleeventAVZERO-rpangleeventBVZERO;
882
883 if(TMath::Abs(deltaPsiVZERO)>TMath::Pi()/2.){
884 if(deltaPsiVZERO>0.) deltaPsiVZERO-=TMath::Pi();
885 else deltaPsiVZERO +=TMath::Pi();
886 } // difference of subevents reaction plane angle cannot be bigger than phi/2
887
888 planeresoVZERO = TMath::Cos(2.*deltaPsiVZERO);
95a079a9 889
862ec7a1 890 hPlaneResoVZEROvsCentrality->Fill(planeresoVZERO,percentile);
95a079a9 891
862ec7a1 892 //Resolution V0 : V0M - V0C
95a079a9 893
862ec7a1 894 deltaPsiVZERO =rpangleeventAVZERO-rpangleeventCVZERO;
895
896 if(TMath::Abs(deltaPsiVZERO)>TMath::Pi()/2.){
897 if(deltaPsiVZERO>0.) deltaPsiVZERO-=TMath::Pi();
898 else deltaPsiVZERO +=TMath::Pi();
899 } // difference of subevents reaction plane angle cannot be bigger than phi/2
858fc78e 900
862ec7a1 901 planeresoVZERO = TMath::Cos(2.*deltaPsiVZERO);
902
903 hPlaneResoVZEROAvsCentrality->Fill(planeresoVZERO,percentile);
84bef463 904
862ec7a1 905 //Resolution V0 : V0A - V0C
906
907 deltaPsiVZERO =rpangleeventBVZERO-rpangleeventCVZERO;
908
909 if(TMath::Abs(deltaPsiVZERO)>TMath::Pi()/2.){
910 if(deltaPsiVZERO>0.) deltaPsiVZERO-=TMath::Pi();
911 else deltaPsiVZERO +=TMath::Pi();
912 } // difference of subevents reaction plane angle cannot be bigger than phi/2
913
914 planeresoVZERO = TMath::Cos(2.*deltaPsiVZERO);
915
916 hPlaneResoVZEROCvsCentrality->Fill(planeresoVZERO,percentile);
917
918 //rpangleeventBVZERO
919
920 if(TMath::Abs(rpangleTPC-rpangleVZERO)>10)return;
921
922 trpangleTPC = rpangleTPC;
923 trpangleVZERO[0] = rpangleVZERO;
924 trpangleVZERO[1] = rpangleeventBVZERO;
925 trpangleVZERO[2] = rpangleeventCVZERO;
926 }
927 // cout<<"rpangle TPC: "<<rpangleTPC<<endl;
928
929 Int_t isTOF=0;
930 Int_t isoutTPC=0;
931 // cout<<"TRack number MC "<<TrackNumber<<endl;
95a079a9 932
862ec7a1 933 for (Int_t j=0; j<TrackNumber; j++) { //loop on tracks
858fc78e 934
862ec7a1 935 AliESDtrack *esdtrack=lESDevent->GetTrack(j);
936 if (!fESDtrackCuts->AcceptTrack(esdtrack)) continue;
858fc78e 937
862ec7a1 938 status = (ULong_t)esdtrack->GetStatus();
858fc78e 939
862ec7a1 940 isTPC = (((status) & AliESDtrack::kTPCin) != 0);
941 isTOF = ((((status) & AliESDtrack::kTOFout) != 0) && (((status) & AliESDtrack::kTIME) != 0));
942 isoutTPC = (((status) & AliESDtrack::kTPCout) != 0);
943
944 TPCSignal=esdtrack->GetTPCsignal();
945
946 if (TPCSignal<10)continue;
947 if (TPCSignal>1000)continue;
948 if (!isTPC)continue;
84bef463 949
862ec7a1 950 if(!esdtrack->GetTPCInnerParam())continue;
951 AliExternalTrackParam trackIn(*esdtrack->GetInnerParam());
952 pinTPC= trackIn.GetP();
858fc78e 953
862ec7a1 954 fhBB->Fill(pinTPC*esdtrack->GetSign(),TPCSignal);
858fc78e 955
862ec7a1 956 if(isTOF){
957 if(!esdtrack->GetOuterParam())continue;
958 AliExternalTrackParam trackOut(*esdtrack->GetOuterParam());
959 poutTPC = trackOut.GetP();
960 fhTOF->Fill(poutTPC*esdtrack->GetSign(),(esdtrack->GetIntegratedLength()/esdtrack->GetTOFsignal())/2.99792458e-2);
858fc78e 961
862ec7a1 962 }
858fc78e 963
862ec7a1 964 Int_t fIdxInt[200]; //dummy array
965 Int_t nClustersTPC = esdtrack->GetTPCclusters(fIdxInt);
966 Float_t chi2PerClusterTPC = esdtrack->GetTPCchi2()/(Float_t)(nClustersTPC);
858fc78e 967
862ec7a1 968 esdtrack->GetImpactParameters(impactXY, impactZ);
858fc78e 969
862ec7a1 970 Float_t deutExp = -999;
971 Float_t hel3Exp = -999;
858fc78e 972
862ec7a1 973 if(fDataType == "REAL"){
974 deutExp = AliExternalTrackParam::BetheBlochAleph(pinTPC/(0.938*2),1.45802,27.4992,4.00313e-15,2.48485,8.31768);
975 hel3Exp = 4*AliExternalTrackParam::BetheBlochAleph(2*pinTPC/(0.938*3),1.74962,27.4992,4.00313e-15,2.42485,8.31768);
976 }
858fc78e 977
862ec7a1 978 if(fDataType == "SIM"){
979 Double_t parMC[5] = {1.17329, 27.4992, 4.00313e-15, 2.1204316, 4.1373729}; // NEW!!!
980 deutExp = AliExternalTrackParam::BetheBlochAleph(pinTPC/(0.938*2),parMC[0],parMC[1],parMC[2],parMC[3],parMC[4]);
981 hel3Exp = 4*AliExternalTrackParam::BetheBlochAleph(2*pinTPC/(0.938*3),parMC[0],parMC[1],parMC[2],parMC[3],parMC[4]);
982 }
84bef463 983
862ec7a1 984 Double_t pullTPC = (TPCSignal - deutExp)/(0.07*deutExp);
985 Double_t pullTPChel3 = (TPCSignal - hel3Exp)/(0.07*hel3Exp);
986
987 tPulls[0] = pullTPC;
988 tPulls[1] = pullTPChel3;
858fc78e 989
862ec7a1 990 //Fill the tree
858fc78e 991
862ec7a1 992 tEventNumber[0] = evNumber ;
993 tEventNumber[1] = runNumber ;
994 tEventNumber[2] = BCNumber ;
995 tEventNumber[3] = OrbitNumber ;
996 tEventNumber[4] = PeriodNumber;
997 tEventNumber[5] = TrackNumber;
998 tEventNumber[6] = eventtype ;
858fc78e 999
862ec7a1 1000 tCentrality = percentile;
1001
1002 tVertexCoord[0] = xPrimaryVertex;
1003 tVertexCoord[1] = yPrimaryVertex;
1004 tVertexCoord[2] = zPrimaryVertex;
1005
1006 if(TMath::Abs(zPrimaryVertex)>10)continue;
1007
1008 // bbtheo = fPIDResponse->NumberOfSigmas((AliPIDResponse::EDetector)0,esdtrack,(AliPID::EParticleType) 7);
1009
1010 tPIDITS[0] = fPIDResponse->NumberOfSigmas((AliPIDResponse::EDetector)0,esdtrack,(AliPID::EParticleType) 0);
1011 tPIDITS[1] = fPIDResponse->NumberOfSigmas((AliPIDResponse::EDetector)0,esdtrack,(AliPID::EParticleType) 1);
1012 tPIDITS[2] = fPIDResponse->NumberOfSigmas((AliPIDResponse::EDetector)0,esdtrack,(AliPID::EParticleType) 2);
1013 tPIDITS[3] = fPIDResponse->NumberOfSigmas((AliPIDResponse::EDetector)0,esdtrack,(AliPID::EParticleType) 3);
1014 tPIDITS[4] = fPIDResponse->NumberOfSigmas((AliPIDResponse::EDetector)0,esdtrack,(AliPID::EParticleType) 4);
1015 tPIDITS[5] = fPIDResponse->NumberOfSigmas((AliPIDResponse::EDetector)0,esdtrack,(AliPID::EParticleType) 5);
1016 tPIDITS[6] = fPIDResponse->NumberOfSigmas((AliPIDResponse::EDetector)0,esdtrack,(AliPID::EParticleType) 6);
1017 tPIDITS[7] = fPIDResponse->NumberOfSigmas((AliPIDResponse::EDetector)0,esdtrack,(AliPID::EParticleType) 7);
1018 tPIDITS[8] = fPIDResponse->NumberOfSigmas((AliPIDResponse::EDetector)0,esdtrack,(AliPID::EParticleType) 8);
1019
1020 tPIDTPC[0] = fPIDResponse->NumberOfSigmas((AliPIDResponse::EDetector)1,esdtrack,(AliPID::EParticleType) 0);
1021 tPIDTPC[1] = fPIDResponse->NumberOfSigmas((AliPIDResponse::EDetector)1,esdtrack,(AliPID::EParticleType) 1);
1022 tPIDTPC[2] = fPIDResponse->NumberOfSigmas((AliPIDResponse::EDetector)1,esdtrack,(AliPID::EParticleType) 2);
1023 tPIDTPC[3] = fPIDResponse->NumberOfSigmas((AliPIDResponse::EDetector)1,esdtrack,(AliPID::EParticleType) 3);
1024 tPIDTPC[4] = fPIDResponse->NumberOfSigmas((AliPIDResponse::EDetector)1,esdtrack,(AliPID::EParticleType) 4);
1025 tPIDTPC[5] = fPIDResponse->NumberOfSigmas((AliPIDResponse::EDetector)1,esdtrack,(AliPID::EParticleType) 5);
1026 tPIDTPC[6] = fPIDResponse->NumberOfSigmas((AliPIDResponse::EDetector)1,esdtrack,(AliPID::EParticleType) 6);
1027 tPIDTPC[7] = fPIDResponse->NumberOfSigmas((AliPIDResponse::EDetector)1,esdtrack,(AliPID::EParticleType) 7);
1028 tPIDTPC[8] = fPIDResponse->NumberOfSigmas((AliPIDResponse::EDetector)1,esdtrack,(AliPID::EParticleType) 8);
1029
1030 tPIDTOF[0] = fPIDResponse->NumberOfSigmas((AliPIDResponse::EDetector)3,esdtrack,(AliPID::EParticleType) 0);
1031 tPIDTOF[1] = fPIDResponse->NumberOfSigmas((AliPIDResponse::EDetector)3,esdtrack,(AliPID::EParticleType) 1);
1032 tPIDTOF[2] = fPIDResponse->NumberOfSigmas((AliPIDResponse::EDetector)3,esdtrack,(AliPID::EParticleType) 2);
1033 tPIDTOF[3] = fPIDResponse->NumberOfSigmas((AliPIDResponse::EDetector)3,esdtrack,(AliPID::EParticleType) 3);
1034 tPIDTOF[4] = fPIDResponse->NumberOfSigmas((AliPIDResponse::EDetector)3,esdtrack,(AliPID::EParticleType) 4);
1035 tPIDTOF[5] = fPIDResponse->NumberOfSigmas((AliPIDResponse::EDetector)3,esdtrack,(AliPID::EParticleType) 5);
1036 tPIDTOF[6] = fPIDResponse->NumberOfSigmas((AliPIDResponse::EDetector)3,esdtrack,(AliPID::EParticleType) 6);
1037 tPIDTOF[7] = fPIDResponse->NumberOfSigmas((AliPIDResponse::EDetector)3,esdtrack,(AliPID::EParticleType) 7);
1038 tPIDTOF[8] = fPIDResponse->NumberOfSigmas((AliPIDResponse::EDetector)3,esdtrack,(AliPID::EParticleType) 8);
1039
1040 tMomentum[0] = esdtrack->Px();
1041 tMomentum[1] = esdtrack->Py();
1042 tMomentum[2] = esdtrack->Pz();
858fc78e 1043
862ec7a1 1044 tTPCMomentum = pinTPC;
1045 tEta = esdtrack->Eta();
1046 tdEdx = TPCSignal;
1047 tDCA[0] = impactXY;
1048 tDCA[1] = impactZ;
1049
1050 // if(nClustersTPC<80)
1051 // cout<<"!!!!! TPC cls: "<<nClustersTPC<<endl;
1052
1053 tTracksTPC[0] = chi2PerClusterTPC;
1054 tTracksTPC[1] = nClustersTPC;
1055
1056 tITSclustermap = esdtrack->GetITSClusterMap();
1057 esdtrack->GetITSdEdxSamples(ITSsample);
1058 tITSsample[0] = ITSsample[0];
1059 tITSsample[1] = ITSsample[1];
1060 tITSsample[2] = ITSsample[2];
1061 tITSsample[3] = ITSsample[3];
1062
1063 tisTOF[0] = isTOF;
1064 tisTOF[1] = isoutTPC;
84bef463 1065
862ec7a1 1066 Double_t p = esdtrack->P();
1067 Double_t tof = esdtrack->GetTOFsignal()-fPIDResponse->GetTOFResponse().GetStartTime(p);
1068
1069 tTOFtrack[0] = poutTPC;
1070 tTOFtrack[1] = tof; //esdtrack->GetTOFsignal(); //ps = Time
1071 tTOFtrack[2] = esdtrack->GetIntegratedLength(); //cm
84bef463 1072
862ec7a1 1073 tCharge = esdtrack->Charge();
1074 tPhi = esdtrack->Phi();
858fc78e 1075
862ec7a1 1076 //Corrected momentum from Alexander
858fc78e 1077
862ec7a1 1078 Double_t pT = esdtrack->Pt()/(1 - 0.333303/TMath::Power(esdtrack->Pt() + 0.651111, 5.27268));
1079 tPtCorr = pT;
1080
1081 if(fDataType == "REAL"){
1082 if(pinTPC < 3. && TMath::Abs(pullTPC) < 3){
1083 if(fFillNtuple == kTRUE)
1084 fNtuple1->Fill();
1085 fhBBDeu->Fill(pinTPC*esdtrack->GetSign(),TPCSignal);
1086 }
858fc78e 1087
862ec7a1 1088 if(pinTPC < 10. && TMath::Abs(pullTPChel3) < 3){
1089 if(fFillNtuple == kTRUE)
1090 fNtuple1->Fill();
1091 fhBBDeu->Fill(pinTPC*esdtrack->GetSign(),TPCSignal);
1092 }
84bef463 1093
862ec7a1 1094 if(TMath::Abs(pullTPC)<2){
858fc78e 1095
862ec7a1 1096 fhPtDeu->Fill(esdtrack->Pt(),pT);
858fc78e 1097
862ec7a1 1098 Float_t deltaphiTPC=2*GetPhi0Pi(tPhi-trpangleTPC);
1099 Float_t deltaphiV0 =2*GetPhi0Pi(tPhi-trpangleVZERO[0]);
95a079a9 1100
1101
862ec7a1 1102 if(tTPCMomentum < 1.0){
95a079a9 1103
862ec7a1 1104 if(tCharge > 0){
1105
1106 hCosPhivsPt ->Fill(TMath::Cos(tPhi),tPtCorr);
1107 hSinPhivsPt ->Fill(TMath::Sin(tPhi),tPtCorr);
1108 hPhivsPt ->Fill(tPhi,tPtCorr);
1109
1110 if(tCentrality>0 && tCentrality<7.5){
1111 hCosDeltaPhivsPt075 ->Fill(TMath::Cos(deltaphiTPC),tPtCorr);
1112 hSinDeltaPhivsPt075 ->Fill(TMath::Sin(deltaphiTPC),tPtCorr);
1113 hDeltaPhivsPt075 ->Fill(deltaphiTPC,tPtCorr);
1114 hCosDeltaPhiVZEROvsPt075 ->Fill(TMath::Cos(deltaphiV0),tPtCorr);
1115 hSinDeltaPhiVZEROvsPt075 ->Fill(TMath::Sin(deltaphiV0),tPtCorr);
1116 hDeltaPhiVZEROvsPt075 ->Fill(deltaphiV0,tPtCorr);
1117
1118 }
1119
1120 if(tCentrality>15 && tCentrality<30){
1121 hCosDeltaPhivsPt1530 ->Fill(TMath::Cos(deltaphiTPC),tPtCorr);
1122 hSinDeltaPhivsPt1530 ->Fill(TMath::Sin(deltaphiTPC),tPtCorr);
1123 hDeltaPhivsPt1530 ->Fill(deltaphiTPC,tPtCorr);
1124 hCosDeltaPhiVZEROvsPt1530 ->Fill(TMath::Cos(deltaphiV0),tPtCorr);
1125 hSinDeltaPhiVZEROvsPt1530 ->Fill(TMath::Sin(deltaphiV0),tPtCorr);
1126 hDeltaPhiVZEROvsPt1530 ->Fill(deltaphiV0,tPtCorr);
1127 }
1128
1129 if(tCentrality>30 && tCentrality<50){
1130 hCosDeltaPhivsPt3050 ->Fill(TMath::Cos(deltaphiTPC),tPtCorr);
1131 hSinDeltaPhivsPt3050 ->Fill(TMath::Sin(deltaphiTPC),tPtCorr);
1132 hDeltaPhivsPt3050 ->Fill(deltaphiTPC,tPtCorr);
1133 hCosDeltaPhiVZEROvsPt3050 ->Fill(TMath::Cos(deltaphiV0),tPtCorr);
1134 hSinDeltaPhiVZEROvsPt3050 ->Fill(TMath::Sin(deltaphiV0),tPtCorr);
1135 hDeltaPhiVZEROvsPt3050 ->Fill(deltaphiV0,tPtCorr);
1136 }
1137
1138 if(tCentrality>15 && tCentrality<50){
1139 hCosDeltaPhivsPt1550 ->Fill(TMath::Cos(deltaphiTPC),tPtCorr);
1140 hSinDeltaPhivsPt1550 ->Fill(TMath::Sin(deltaphiTPC),tPtCorr);
1141 hDeltaPhivsPt1550 ->Fill(deltaphiTPC,tPtCorr);
1142 hCosDeltaPhiVZEROvsPt1550 ->Fill(TMath::Cos(deltaphiV0),tPtCorr);
1143 hSinDeltaPhiVZEROvsPt1550 ->Fill(TMath::Sin(deltaphiV0),tPtCorr);
1144 hDeltaPhiVZEROvsPt1550 ->Fill(deltaphiV0,tPtCorr);
1145 }
1146 }
95a079a9 1147
862ec7a1 1148 if(tCharge < 0){
95a079a9 1149
862ec7a1 1150 hAntiCosPhivsPt ->Fill(TMath::Cos(tPhi),tPtCorr);
1151 hAntiSinPhivsPt ->Fill(TMath::Sin(tPhi),tPtCorr);
1152 hAntiPhivsPt ->Fill(tPhi,tPtCorr);
1153 if(tCentrality>0 && tCentrality<7.5){
1154 hAntiCosDeltaPhivsPt075 ->Fill(TMath::Cos(deltaphiTPC),tPtCorr);
1155 hAntiSinDeltaPhivsPt075 ->Fill(TMath::Sin(deltaphiTPC),tPtCorr);
1156 hAntiDeltaPhivsPt075 ->Fill(deltaphiTPC,tPtCorr);
1157 hAntiCosDeltaPhiVZEROvsPt075 ->Fill(TMath::Cos(deltaphiV0),tPtCorr);
1158 hAntiSinDeltaPhiVZEROvsPt075 ->Fill(TMath::Sin(deltaphiV0),tPtCorr);
1159 hAntiDeltaPhiVZEROvsPt075 ->Fill(deltaphiV0,tPtCorr);
1160 }
95a079a9 1161
862ec7a1 1162 if(tCentrality>15 && tCentrality<30){
1163 hAntiCosDeltaPhivsPt1530 ->Fill(TMath::Cos(deltaphiTPC),tPtCorr);
1164 hAntiSinDeltaPhivsPt1530 ->Fill(TMath::Sin(deltaphiTPC),tPtCorr);
1165 hAntiDeltaPhivsPt1530 ->Fill(deltaphiTPC,tPtCorr);
1166 hAntiCosDeltaPhiVZEROvsPt1530 ->Fill(TMath::Cos(deltaphiV0),tPtCorr);
1167 hAntiSinDeltaPhiVZEROvsPt1530 ->Fill(TMath::Sin(deltaphiV0),tPtCorr);
1168 hAntiDeltaPhiVZEROvsPt1530 ->Fill(deltaphiV0,tPtCorr);
1169 }
95a079a9 1170
862ec7a1 1171 if(tCentrality>30 && tCentrality<50){
1172 hAntiCosDeltaPhivsPt3050 ->Fill(TMath::Cos(deltaphiTPC),tPtCorr);
1173 hAntiSinDeltaPhivsPt3050 ->Fill(TMath::Sin(deltaphiTPC),tPtCorr);
1174 hAntiDeltaPhivsPt3050 ->Fill(deltaphiTPC,tPtCorr);
1175 hAntiCosDeltaPhiVZEROvsPt3050 ->Fill(TMath::Cos(deltaphiV0),tPtCorr);
1176 hAntiSinDeltaPhiVZEROvsPt3050 ->Fill(TMath::Sin(deltaphiV0),tPtCorr);
1177 hAntiDeltaPhiVZEROvsPt3050 ->Fill(deltaphiV0,tPtCorr);
95a079a9 1178 }
862ec7a1 1179
1180 if(tCentrality>15 && tCentrality<50){
1181 hAntiCosDeltaPhivsPt1550 ->Fill(TMath::Cos(deltaphiTPC),tPtCorr);
1182 hAntiSinDeltaPhivsPt1550 ->Fill(TMath::Sin(deltaphiTPC),tPtCorr);
1183 hAntiDeltaPhivsPt1550 ->Fill(deltaphiTPC,tPtCorr);
1184 hAntiCosDeltaPhiVZEROvsPt1550 ->Fill(TMath::Cos(deltaphiV0),tPtCorr);
1185 hAntiSinDeltaPhiVZEROvsPt1550 ->Fill(TMath::Sin(deltaphiV0),tPtCorr);
1186 hAntiDeltaPhiVZEROvsPt1550 ->Fill(deltaphiV0,tPtCorr);
1187 }
1188
1189 }
1190
1191 }
95a079a9 1192
862ec7a1 1193 if(tTPCMomentum > 1.0 && tTPCMomentum < 3.0){
1194 if(tPIDTOF[5]>2 || tPIDTOF[5]< -2)continue;
1195
1196 if(tCharge > 0){
1197
1198 hCosPhivsPt ->Fill(TMath::Cos(tPhi),tPtCorr);
1199 hSinPhivsPt ->Fill(TMath::Sin(tPhi),tPtCorr);
1200 hPhivsPt ->Fill(tPhi,tPtCorr);
1201
1202
1203 if(tCentrality>0 && tCentrality<7.5){
1204 hCosDeltaPhivsPt075 ->Fill(TMath::Cos(deltaphiTPC),tPtCorr);
1205 hSinDeltaPhivsPt075 ->Fill(TMath::Sin(deltaphiTPC),tPtCorr);
1206 hDeltaPhivsPt075 ->Fill(deltaphiTPC,tPtCorr);
1207 hCosDeltaPhiVZEROvsPt075 ->Fill(TMath::Cos(deltaphiV0),tPtCorr);
1208 hSinDeltaPhiVZEROvsPt075 ->Fill(TMath::Sin(deltaphiV0),tPtCorr);
1209 hDeltaPhiVZEROvsPt075 ->Fill(deltaphiV0,tPtCorr);
1210
95a079a9 1211 }
1212
862ec7a1 1213 if(tCentrality>15 && tCentrality<30){
1214 hCosDeltaPhivsPt1530 ->Fill(TMath::Cos(deltaphiTPC),tPtCorr);
1215 hSinDeltaPhivsPt1530 ->Fill(TMath::Sin(deltaphiTPC),tPtCorr);
1216 hDeltaPhivsPt1530 ->Fill(deltaphiTPC,tPtCorr);
1217 hCosDeltaPhiVZEROvsPt1530 ->Fill(TMath::Cos(deltaphiV0),tPtCorr);
1218 hSinDeltaPhiVZEROvsPt1530 ->Fill(TMath::Sin(deltaphiV0),tPtCorr);
1219 hDeltaPhiVZEROvsPt1530 ->Fill(deltaphiV0,tPtCorr);
95a079a9 1220 }
1221
862ec7a1 1222 if(tCentrality>30 && tCentrality<50){
1223 hCosDeltaPhivsPt3050 ->Fill(TMath::Cos(deltaphiTPC),tPtCorr);
1224 hSinDeltaPhivsPt3050 ->Fill(TMath::Sin(deltaphiTPC),tPtCorr);
1225 hDeltaPhivsPt3050 ->Fill(deltaphiTPC,tPtCorr);
1226 hCosDeltaPhiVZEROvsPt3050 ->Fill(TMath::Cos(deltaphiV0),tPtCorr);
1227 hSinDeltaPhiVZEROvsPt3050 ->Fill(TMath::Sin(deltaphiV0),tPtCorr);
1228 hDeltaPhiVZEROvsPt3050 ->Fill(deltaphiV0,tPtCorr);
1229
95a079a9 1230 }
1231
862ec7a1 1232 if(tCentrality>15 && tCentrality<50){
1233 hCosDeltaPhivsPt1550 ->Fill(TMath::Cos(deltaphiTPC),tPtCorr);
1234 hSinDeltaPhivsPt1550 ->Fill(TMath::Sin(deltaphiTPC),tPtCorr);
1235 hDeltaPhivsPt1550 ->Fill(deltaphiTPC,tPtCorr);
1236 hCosDeltaPhiVZEROvsPt1550 ->Fill(TMath::Cos(deltaphiV0),tPtCorr);
1237 hSinDeltaPhiVZEROvsPt1550 ->Fill(TMath::Sin(deltaphiV0),tPtCorr);
1238 hDeltaPhiVZEROvsPt1550 ->Fill(deltaphiV0,tPtCorr);
95a079a9 1239 }
1240 }
862ec7a1 1241
1242 if(tCharge < 0){
95a079a9 1243
862ec7a1 1244 hAntiCosPhivsPt ->Fill(TMath::Cos(tPhi),tPtCorr);
1245 hAntiSinPhivsPt ->Fill(TMath::Sin(tPhi),tPtCorr);
1246 hAntiPhivsPt ->Fill(tPhi,tPtCorr);
1247
1248 if(tCentrality>0 && tCentrality<7.5){
1249 hAntiCosDeltaPhivsPt075 ->Fill(TMath::Cos(deltaphiTPC),tPtCorr);
1250 hAntiSinDeltaPhivsPt075 ->Fill(TMath::Sin(deltaphiTPC),tPtCorr);
1251 hAntiDeltaPhivsPt075 ->Fill(deltaphiTPC,tPtCorr);
1252 hAntiCosDeltaPhiVZEROvsPt075 ->Fill(TMath::Cos(deltaphiV0),tPtCorr);
1253 hAntiSinDeltaPhiVZEROvsPt075 ->Fill(TMath::Sin(deltaphiV0),tPtCorr);
1254 hAntiDeltaPhiVZEROvsPt075 ->Fill(deltaphiV0,tPtCorr);
1255
95a079a9 1256
1257 }
1258
862ec7a1 1259 if(tCentrality>15 && tCentrality<30){
1260 hAntiCosDeltaPhivsPt1530 ->Fill(TMath::Cos(deltaphiTPC),tPtCorr);
1261 hAntiSinDeltaPhivsPt1530 ->Fill(TMath::Sin(deltaphiTPC),tPtCorr);
1262 hAntiDeltaPhivsPt1530 ->Fill(deltaphiTPC,tPtCorr);
1263 hAntiCosDeltaPhiVZEROvsPt1530 ->Fill(TMath::Cos(deltaphiV0),tPtCorr);
1264 hAntiSinDeltaPhiVZEROvsPt1530 ->Fill(TMath::Sin(deltaphiV0),tPtCorr);
1265 hAntiDeltaPhiVZEROvsPt1530 ->Fill(deltaphiV0,tPtCorr);
95a079a9 1266
862ec7a1 1267
95a079a9 1268 }
1269
862ec7a1 1270 if(tCentrality>30 && tCentrality<50){
1271 hAntiCosDeltaPhivsPt3050 ->Fill(TMath::Cos(deltaphiTPC),tPtCorr);
1272 hAntiSinDeltaPhivsPt3050 ->Fill(TMath::Sin(deltaphiTPC),tPtCorr);
1273 hAntiDeltaPhivsPt3050 ->Fill(deltaphiTPC,tPtCorr);
1274 hAntiCosDeltaPhiVZEROvsPt3050 ->Fill(TMath::Cos(deltaphiV0),tPtCorr);
1275 hAntiSinDeltaPhiVZEROvsPt3050 ->Fill(TMath::Sin(deltaphiV0),tPtCorr);
1276 hAntiDeltaPhiVZEROvsPt3050 ->Fill(deltaphiV0,tPtCorr);
1277
1278
95a079a9 1279 }
1280
862ec7a1 1281 if(tCentrality>15 && tCentrality<50){
1282 hAntiCosDeltaPhivsPt1550 ->Fill(TMath::Cos(deltaphiTPC),tPtCorr);
1283 hAntiSinDeltaPhivsPt1550 ->Fill(TMath::Sin(deltaphiTPC),tPtCorr);
1284 hAntiDeltaPhivsPt1550 ->Fill(deltaphiTPC,tPtCorr);
1285 hAntiCosDeltaPhiVZEROvsPt1550 ->Fill(TMath::Cos(deltaphiV0),tPtCorr);
1286 hAntiSinDeltaPhiVZEROvsPt1550 ->Fill(TMath::Sin(deltaphiV0),tPtCorr);
1287 hAntiDeltaPhiVZEROvsPt1550 ->Fill(deltaphiV0,tPtCorr);
1288
1289
95a079a9 1290 }
862ec7a1 1291
95a079a9 1292 }
862ec7a1 1293
1294 }
1295
1296
1297 if(tTOFtrack[1] > 0){
1298 Double_t beta = tTOFtrack[2]/(tTOFtrack[1] * 2.99792457999999984e-02);
1299 Float_t gamma = 1/TMath::Sqrt(1 - beta*beta);
1300 fhMassTOF->Fill(poutTPC/TMath::Sqrt(gamma*gamma - 1) - 1.8756);
858fc78e 1301 }
1302 }
862ec7a1 1303 }
858fc78e 1304
862ec7a1 1305 if(fDataType == "SIM"){
858fc78e 1306
862ec7a1 1307 Int_t label = TMath::Abs(esdtrack->GetLabel());
1308 TParticle * part = stack->Particle(label);
1309 Int_t PDGCode=part->GetPdgCode();
1310
1311 Int_t motherPDG=0;
858fc78e 1312
862ec7a1 1313 Int_t mumid = part->GetFirstMother();
1314 if(mumid>-1){
1315 TParticle *mother=(TParticle*)stack->Particle(mumid);
1316 motherPDG = mother->GetPdgCode();
1317 }
858fc78e 1318
862ec7a1 1319 if( PDGCode == 1000010020 || PDGCode == -1000010020 || PDGCode == 1000020030 || PDGCode == -1000020030){
858fc78e 1320
862ec7a1 1321 tPDGCode=PDGCode;
1322 tPDGCodeMum = motherPDG;
1323
1324 tIsPrimaryTr = stack->IsPhysicalPrimary(label);
1325 tIsSecondaryTr[0] = stack->IsSecondaryFromMaterial(label);
1326 tIsSecondaryTr[1] = stack->IsSecondaryFromWeakDecay(label);
1327
1328 fNtuple1->Fill();
1329 fhPtDeu->Fill(esdtrack->Pt(),pT);
858fc78e 1330
862ec7a1 1331 if(tTOFtrack[1] > 0){
1332 Double_t beta = tTOFtrack[2]/(tTOFtrack[1] * 2.99792457999999984e-02);
1333 Float_t gamma = 1/TMath::Sqrt(1 - beta*beta);
1334 fhMassTOF->Fill(poutTPC/TMath::Sqrt(gamma*gamma - 1) - 1.8756);
858fc78e 1335 }
1336 }
862ec7a1 1337 }
1338
1339 } //track
1340
1341 //==END RECONSTRUCTION==
858fc78e 1342
84bef463 1343
862ec7a1 1344 // MC truth
1345
1346 if(fDataType == "SIM"){
1347
1348 for (Int_t iMC=0; iMC<stack->GetNtrack(); iMC++){
1349
1350 const TParticle *tparticle = stack->Particle(iMC);
1351 Long_t PDGCode = tparticle->GetPdgCode();
858fc78e 1352
862ec7a1 1353 Double_t eta = tparticle->Eta();
1354 Double_t pt = tparticle->Pt();
1355 Double_t rap = tparticle->Y();
1356
1357 //check which particle it is
858fc78e 1358
862ec7a1 1359 Float_t codemoth = 0;
1360
1361 Int_t indexMoth=tparticle->GetFirstMother();
1362
1363 if(indexMoth>=0){
1364 TParticle* moth = stack->Particle(indexMoth);
1365 codemoth = TMath::Abs(moth->GetPdgCode());
1366 }
1367
1368 //d, 3He
1369
1370 if( PDGCode == 1000010020 || PDGCode == -1000010020 || PDGCode == 1000020030 || PDGCode == -1000020030){
858fc78e 1371
862ec7a1 1372 tEventNumberMC[0] = evNumber ;
1373 tEventNumberMC[1] = runNumber ;
1374 tEventNumberMC[2] = BCNumber ;
1375 tEventNumberMC[3] = OrbitNumber ;
1376 tEventNumberMC[4] = PeriodNumber;
1377 tEventNumberMC[5] = TrackNumber;
1378
1379 tCentralityMC = percentile;
858fc78e 1380
862ec7a1 1381 tVertexCoordMC[0] = xPrimaryVertex;
1382 tVertexCoordMC[1] = yPrimaryVertex;
1383 tVertexCoordMC[2] = zPrimaryVertex;
858fc78e 1384
862ec7a1 1385 tVertexCoordMC[0] = tparticle->Px();
1386 tVertexCoordMC[1] = tparticle->Py();
1387 tVertexCoordMC[2] = tparticle->Pz();
858fc78e 1388
862ec7a1 1389 tPDGCodeMC = PDGCode;
1390 tPDGCodeMumMC = codemoth;
1391 tEtaMC = eta;
858fc78e 1392
862ec7a1 1393 tPtMC = pt;
1394 tYMC = rap;
1395
1396 tIsPrimary = stack->IsPhysicalPrimary(iMC);
1397 tIsSecondary[0] = stack->IsSecondaryFromMaterial(iMC);
1398 tIsSecondary[1] = stack->IsSecondaryFromWeakDecay(iMC);
1399
858fc78e 1400
862ec7a1 1401 fNtuple2->Fill();
858fc78e 1402 }
1403 }
862ec7a1 1404
1405
1406
858fc78e 1407 }
862ec7a1 1408 PostData(1, fListHistCascade);
858fc78e 1409 PostData(2, fNtuple1);
1410 PostData(3, fNtuple2);
1411} //end userexec
1412
1413
1414//________________________________________________________________________
1415
1416void AliAnalysisTaskNucleiv2::Terminate(Option_t *)
1417{
1418 // Draw result to the screen
1419 // Called once at the end of the query
1420}
1421