]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG2/SPECTRA/LambdaK0PbPb/AliAnalysisTaskLukeV0.cxx
Added OADB loading explicitly in StartAnalysis (M.Floris)
[u/mrichter/AliRoot.git] / PWG2 / SPECTRA / LambdaK0PbPb / AliAnalysisTaskLukeV0.cxx
CommitLineData
45b90328 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: AliAnalysisTaskLukeV0.cxx 46301 2011-01-06 14:25:27Z agheata $ */
17
18/* AliAnalysisTaskLukeV0.cxx
19 *
20 * Task analysing lambda, antilambda & K0 spectra
21 *
22 * Based on tutorial example from offline pages
23 * Edited by Arvinder Palaha
24 * Adapted by Luke Hanratty
25 *
26 */
27
28#include "AliAnalysisTaskLukeV0.h"
29
30#include "Riostream.h"
31#include "TChain.h"
32#include "TTree.h"
33#include "TH1F.h"
34#include "TH2F.h"
35#include "TCanvas.h"
36#include "TList.h"
37#include "TPDGCode.h"
38
39#include "AliAnalysisTaskSE.h"
40#include "AliAnalysisManager.h"
41#include "AliStack.h"
42#include "AliESDtrackCuts.h"
43#include "AliESDEvent.h"
44#include "AliESDv0.h"
45#include "AliESDInputHandler.h"
46#include "AliAODEvent.h"
47#include "AliMCEvent.h"
48#include "AliMCVertex.h"
49#include "AliPID.h"
50#include "AliPIDResponse.h"
51
52ClassImp(AliAnalysisTaskLukeV0)
53
54//________________________________________________________________________
55AliAnalysisTaskLukeV0::AliAnalysisTaskLukeV0() // All data members should be initialised here
56 :AliAnalysisTaskSE(),
57 fOutputList(0),
58 fTrackCuts(0),
59 fPIDResponse(0),
60 fHistPt(0),
61 fHistEta(0),
62 fHistLuke(0),
63 fHistBetaV0(0),
64 fHistCosPA(0),
65 fHistCosTheta(0),
66 fHistCosThetaPi2(0),
67 fHistCosThetaProton2(0),
68 fHistDCAV0Daughters(0),
69 fHistDecayL(0),
70 fHistDecayLxy(0),
71 fHistDeltaTheta(0),
72 fHistdNV0sdT2(0),
73 fHistEtaNTracks(0),
74 fHistEtaPTracks(0),
75 fHistEtaV0s(0),
76 fHistImpactxyN(0),
77 fHistImpactzN(0),
78 fHistImpactxyP(0),
79 fHistImpactzP(0),
80 fHistKinkIndexFalse(0),
81 fHistKinkIndexTrue(0),
82 fHistLambdaBgRapidity(0),
83 fHistLambdaBgEta(0),
84 fHistLambdaBgPt(0),
85 fHistLambdaSigRapidity(0),
86 fHistLambdaSigEta(0),
87 fHistLambdaSigPt(0),
88 fHistMagneticField(0),
89 fHistMcLog(0),
90 fHistMcNLambdaPrimary(0),
91 fHistMcNLambda(0),
92 fHistMcNAntilambda(0),
93 fHistMcNKshort(0),
94 fHistMcPtV0La(0),
95 fHistMcPtV0Lb(0),
96 fHistMcPtV0K0(0),
97 fHistMcSigmaPProton(0),
98 fHistMcSigmaPNProton(0),
99 fHistMcSLambdaEta(0),
100 fHistMcSLambdaDaughter(0),
101 fHistMcSLambdaPt(0),
102 fHistMcTPCTrackLength(0),
103 fHistMK0(0),
104 fHistMK00(0),
105 fHistMK01(0),
106 fHistMK02(0),
107 fHistMK03(0),
108 fHistMK04(0),
109 fHistMK05(0),
110 fHistMK06(0),
111 fHistMK07(0),
112 fHistMK08(0),
113 fHistMK09(0),
114 fHistMLa(0),
115 fHistMLa0(0),
116 fHistMLa1(0),
117 fHistMLa2(0),
118 fHistMLa3(0),
119 fHistMLa4(0),
120 fHistMLa5(0),
121 fHistMLa6(0),
122 fHistMLa7(0),
123 fHistMLa8(0),
124 fHistMLa9(0),
125 fHistMLb(0),
126 fHistMLb0(0),
127 fHistMLb1(0),
128 fHistMLb2(0),
129 fHistMLb3(0),
130 fHistMLb4(0),
131 fHistMLb5(0),
132 fHistMLb6(0),
133 fHistMLb7(0),
134 fHistMLb8(0),
135 fHistMLb9(0),
136 fHistNLambda(0),
137 fHistNV0(0),
138 fHistNTracks(0),
139 fHistPtV0(0),
140 fHistPVZ(0),
141 fHistTauLa(0),
142 fHistTheta(0),
143 fHistThetaPi2(0),
144 fHistThetaProton2(0),
145 fHistV0Z(0),
146 fHistZ(0),
147 fHistBetaERatio(0),
148 fHistBetaPRatio(0),
149 fHistBetaPXRatio(0),
150 fHistBetheBlochITSNeg(0),
151 fHistBetheBlochITSPos(0),
152 fHistBetheBlochTPCNeg(0),
153 fHistBetheBlochTPCPos(0),
154 fHistCosPAMLa(0),
155 fHistDCAPtPSig(0),
156 fHistDCAPtPBg(0),
157 fHistDCAPtPbarSig(0),
158 fHistDCAPtPbarBg(0),
159 fHistDecayLDCA(0),
160 fHistDecayLMLa(0),
161 fHistDeltaThetaMLa(0),
162 fHistImpactxyImpactz(0),
163 fHistImpactxyMLa(0),
164 fHistImpactzMLa(0),
165 fHistMcLamdaPProductionVertex(0),
166 fHistMcLamdaSProductionVertex(0),
167 fHistMcLamdaSDecayVertex(0),
168 fHistMcPMK0Pt(0),
169 fHistMcPMLaPt(0),
170 fHistMcPMLbPt(0),
171 fHistMcSLambdaDaughterPairs(0),
172 fHistMcV0MK0Pt(0),
173 fHistMcV0MLaPt(0),
174 fHistMcV0MLbPt(0),
175 fHistMcV0LamdaSProductionVertex(0),
176 fHistMcV0IDLamdaSProductionVertex(0),
177 fHistMK0PtArm(0),
178 fHistMK0Pt(0),
179 fHistMK0R(0),
180 fHistMLaPtArm(0),
181 fHistMLaPt(0),
182 fHistMLaR(0),
183 fHistMLbPtArm(0),
184 fHistMLbPt(0),
185 fHistMLbR(0),
186 fHistNegChi2PerClusterMLa(0),
187 fHistNegTPCRefitMLa(0),
188 fHistNTPCNegClustersMLa(0),
189 fHistNTPCPosClustersMLa(0),
190 fHistNV0sNTracks(0),
191 fHistPosChi2PerClusterMLa(0),
192 fHistPosTPCRefitMLa(0),
193 fHistPtArm(0),
194 fHistPtArmR(0),
195 fHistPtV0Z(0),
196 fHistRZ(0),
197 fHistTauLaMLa(0),
198 fHistXZ(0),
199 fHistYZ(0) // The last in the above list should not have a comma after it
200{
201 // Dummy constructor ALWAYS needed for I/O.
202}
203
204//________________________________________________________________________
205AliAnalysisTaskLukeV0::AliAnalysisTaskLukeV0(const char *name) // All data members should be initialised here
206 :AliAnalysisTaskSE(name),
207 fOutputList(0),
208 fTrackCuts(0),
209 fPIDResponse(0),
210 fHistPt(0),
211 fHistEta(0),
212 fHistLuke(0),
213 fHistBetaV0(0),
214 fHistCosPA(0),
215 fHistCosTheta(0),
216 fHistCosThetaPi2(0),
217 fHistCosThetaProton2(0),
218 fHistDCAV0Daughters(0),
219 fHistDecayL(0),
220 fHistDecayLxy(0),
221 fHistDeltaTheta(0),
222 fHistdNV0sdT2(0),
223 fHistEtaNTracks(0),
224 fHistEtaPTracks(0),
225 fHistEtaV0s(0),
226 fHistImpactxyN(0),
227 fHistImpactzN(0),
228 fHistImpactxyP(0),
229 fHistImpactzP(0),
230 fHistKinkIndexFalse(0),
231 fHistKinkIndexTrue(0),
232 fHistLambdaBgRapidity(0),
233 fHistLambdaBgEta(0),
234 fHistLambdaBgPt(0),
235 fHistLambdaSigRapidity(0),
236 fHistLambdaSigEta(0),
237 fHistLambdaSigPt(0),
238 fHistMagneticField(0),
239 fHistMcLog(0),
240 fHistMcNLambdaPrimary(0),
241 fHistMcNLambda(0),
242 fHistMcNAntilambda(0),
243 fHistMcNKshort(0),
244 fHistMcPtV0La(0),
245 fHistMcPtV0Lb(0),
246 fHistMcPtV0K0(0),
247 fHistMcSigmaPProton(0),
248 fHistMcSigmaPNProton(0),
249 fHistMcSLambdaEta(0),
250 fHistMcSLambdaDaughter(0),
251 fHistMcSLambdaPt(0),
252 fHistMcTPCTrackLength(0),
253 fHistMK0(0),
254 fHistMK00(0),
255 fHistMK01(0),
256 fHistMK02(0),
257 fHistMK03(0),
258 fHistMK04(0),
259 fHistMK05(0),
260 fHistMK06(0),
261 fHistMK07(0),
262 fHistMK08(0),
263 fHistMK09(0),
264 fHistMLa(0),
265 fHistMLa0(0),
266 fHistMLa1(0),
267 fHistMLa2(0),
268 fHistMLa3(0),
269 fHistMLa4(0),
270 fHistMLa5(0),
271 fHistMLa6(0),
272 fHistMLa7(0),
273 fHistMLa8(0),
274 fHistMLa9(0),
275 fHistMLb(0),
276 fHistMLb0(0),
277 fHistMLb1(0),
278 fHistMLb2(0),
279 fHistMLb3(0),
280 fHistMLb4(0),
281 fHistMLb5(0),
282 fHistMLb6(0),
283 fHistMLb7(0),
284 fHistMLb8(0),
285 fHistMLb9(0),
286 fHistNLambda(0),
287 fHistNV0(0),
288 fHistNTracks(0),
289 fHistPtV0(0),
290 fHistPVZ(0),
291 fHistTauLa(0),
292 fHistTheta(0),
293 fHistThetaPi2(0),
294 fHistThetaProton2(0),
295 fHistV0Z(0),
296 fHistZ(0),
297 fHistBetaERatio(0),
298 fHistBetaPRatio(0),
299 fHistBetaPXRatio(0),
300 fHistBetheBlochITSNeg(0),
301 fHistBetheBlochITSPos(0),
302 fHistBetheBlochTPCNeg(0),
303 fHistBetheBlochTPCPos(0),
304 fHistCosPAMLa(0),
305 fHistDCAPtPSig(0),
306 fHistDCAPtPBg(0),
307 fHistDCAPtPbarSig(0),
308 fHistDCAPtPbarBg(0),
309 fHistDecayLDCA(0),
310 fHistDecayLMLa(0),
311 fHistDeltaThetaMLa(0),
312 fHistImpactxyImpactz(0),
313 fHistImpactxyMLa(0),
314 fHistImpactzMLa(0),
315 fHistMcLamdaPProductionVertex(0),
316 fHistMcLamdaSProductionVertex(0),
317 fHistMcLamdaSDecayVertex(0),
318 fHistMcPMK0Pt(0),
319 fHistMcPMLaPt(0),
320 fHistMcPMLbPt(0),
321 fHistMcSLambdaDaughterPairs(0),
322 fHistMcV0MK0Pt(0),
323 fHistMcV0MLaPt(0),
324 fHistMcV0MLbPt(0),
325 fHistMcV0LamdaSProductionVertex(0),
326 fHistMcV0IDLamdaSProductionVertex(0),
327 fHistMK0PtArm(0),
328 fHistMK0Pt(0),
329 fHistMK0R(0),
330 fHistMLaPtArm(0),
331 fHistMLaPt(0),
332 fHistMLaR(0),
333 fHistMLbPtArm(0),
334 fHistMLbPt(0),
335 fHistMLbR(0),
336 fHistNegChi2PerClusterMLa(0),
337 fHistNegTPCRefitMLa(0),
338 fHistNTPCNegClustersMLa(0),
339 fHistNTPCPosClustersMLa(0),
340 fHistNV0sNTracks(0),
341 fHistPosChi2PerClusterMLa(0),
342 fHistPosTPCRefitMLa(0),
343 fHistPtArm(0),
344 fHistPtArmR(0),
345 fHistPtV0Z(0),
346 fHistRZ(0),
347 fHistTauLaMLa(0),
348 fHistXZ(0),
349 fHistYZ(0)// The last in the above list should not have a comma after it
350{
351 // Constructor
352 // Define input and output slots here (never in the dummy constructor)
353 // Input slot #0 works with a TChain - it is connected to the default input container
354 // Output slot #1 writes into a TH1 container
355 DefineOutput(1, TList::Class()); // for output list
356}
357
358//________________________________________________________________________
359AliAnalysisTaskLukeV0::~AliAnalysisTaskLukeV0()
360{
361 // Destructor. Clean-up the output list, but not the histograms that are put inside
362 // (the list is owner and will clean-up these histograms). Protect in PROOF case.
363 if (fOutputList && !AliAnalysisManager::GetAnalysisManager()->IsProofMode()) {
364 delete fOutputList;
365 }
366 if (fTrackCuts) delete fTrackCuts;
367}
368
369//________________________________________________________________________
370void AliAnalysisTaskLukeV0::UserCreateOutputObjects()
371{
372 // Create histograms
373 // Called once (on the worker node)
374
375 fOutputList = new TList();
376 fOutputList->SetOwner(); // IMPORTANT!
377
378 fTrackCuts = new AliESDtrackCuts();
379
380 AliAnalysisManager *man=AliAnalysisManager::GetAnalysisManager();
381 AliInputEventHandler* inputHandler = (AliInputEventHandler*) (man->GetInputEventHandler());
382 fPIDResponse = inputHandler->GetPIDResponse();
383
384 // Create histograms - original test histograms
385 Int_t ptBins = 15;
386 Float_t ptLow = 0.1, ptUp = 3.1;
387 fHistPt = new TH1F("fHistPt", "P_{T} distribution for reconstructed", ptBins, ptLow, ptUp);
388 Int_t etaBins = 40;
389 Float_t etaLow = -2.0, etaUp = 2.0;
390 fHistEta = new TH1F("fHistEta","#eta distribution for reconstructed",etaBins, etaLow, etaUp);
391 fHistLuke = new TH1F("fHistLuke","Lukes Histogram",100, 0, 10);
392
393 // lambda plot parameters
394 int div = 96;
395 float max = 1.2;
396 float min = 1.08;
397
398 // Create remaining histograms
399 // TH1F first
400 fHistBetaV0 = new TH1F("fHistBetaV0","Beta of the v0 candidate; Beta; NV0s",50,0,1);
401 fHistCosPA = new TH1F("fHistCosPA", "Cosine of Pointing Angle of V0s; Cos PA; N(v0s)",202,0.8,1.01);
402 fHistCosTheta = new TH1F("fHistCosTheta","Cos Theta of decay in Lambda rest frame ;Cos Theta ;N V0s",180,-1,1);
403 fHistCosThetaPi2 = new TH1F("fHistCosThetaPi2","Cos Theta of pion decay in lab frame ;Cos Theta ;N V0s",180,-1,1);
404 fHistCosThetaProton2 = new TH1F("fHistCosThetaProton2","Cos Theta proton in lab frame ;Cos Theta ;N V0s",180,-1,1);
405 fHistDCAV0Daughters = new TH1F("fHistDCAV0Daughters", "DCA between V0 daughters; DCA (cm); N V0s", 100, 0, 2);
406 fHistDecayL = new TH1F("fHistDecayL", "Distance between V0 and PV; Distance(cm); N(v0s)",200,-0.1,30);
407 fHistDecayLxy = new TH1F("fHistDecayLxy", "Distance between V0 and PV in xy plane; Distance(cm); N(v0s)",200,-0.1,30);
408 fHistDeltaTheta = new TH1F("fHistDeltaTheta","Difference in theta of Proton and Pi in lambda rest frame; Delta Theta; NV0s",180,-7,7);
409 fHistdNV0sdT2 = new TH1F("fHistdNV0sdT2", "No of V0s over No of Tracks squared; NV0s/T^2; N", 30, 0, 2e-3);
410 fHistEtaNTracks = new TH1F("fHistEtaNTracks","Eta for negative tracks; Eta; N",100,-5,5);
411 fHistEtaPTracks = new TH1F("fHistEtaPTracks","Eta for positive tracks; Eta; N",100,-5,5);
412 fHistEtaV0s = new TH1F("fHistEtaV0s","Eta for v0s; Eta; N",100,-5,5);
413 fHistImpactxyN = new TH1F("fHistImpactxyN", "RSM DCA between negative particle and primary vertex in xy plane; RSM DCA (cm); N(v0s)",100,0,1);
414 fHistImpactzN = new TH1F("fHistImpactzN", "RSM DCA between negative particle and primary vertex in z direction; RSM DCA (cm); N(v0s)",100,0,1);
415 fHistImpactxyP = new TH1F("fHistImpactxyP", "RSM DCA between positive particle and primary vertex in xy plane; RSM DCA (cm); N(v0s)",100,0,1);
416 fHistImpactzP = new TH1F("fHistImpactzP", "RSM DCA between positive particle and primary vertex in z direction; RSM DCA (cm); N(v0s)",100,0,1);
417 fHistKinkIndexFalse = new TH1F("fHistKinkIndexFalse","Lambda mass of non-kink candidates; M(p#pi^{-}) (GeV/c^{2})",96,1.08,1.2);
418 fHistKinkIndexTrue = new TH1F("fHistKinkIndexTrue","Lambda mass of kink candidates; M(p#pi^{-}) (GeV/c^{2})",96,1.08,1.2);
419 fHistLambdaBgRapidity = new TH1F("fHistLambdaBgRapidity","Rapidity of background V0s near Lambda mass; rapidity ",100,-1.5,1.5);
420 fHistLambdaBgEta = new TH1F("fHistLambdaBgEta","Psuedorapidity of background V0s near Lambda mass; Eta ",100,-1.5,1.5);
421 fHistLambdaBgPt = new TH1F("fHistLambdaBgPt","Transverse momentum of background V0s near Lambda mass; Pt(GeV/c) ",150,0,15);
422 fHistLambdaSigRapidity = new TH1F("fHistLambdaSigRapidity","Rapidity of signal V0s on Lambda mass; rapidity ",100,-1.5,1.5);
423 fHistLambdaSigEta = new TH1F("fHistLambdaSigEta","Psuedorapidity of signal V0s on Lambda mass; Eta ",100,-1.5,1.5);
424 fHistLambdaSigPt = new TH1F("fHistLambdaSigPt","Transverse momentum of signal V0s on Lambda mass; Pt(GeV/c) ",150,0,15);
425 fHistMagneticField = new TH1F("fHistMagneticField", "Magnetic Field; Magnetic Field; N",100,-100,100);
426 fHistMcLog = new TH1F("fHistMcLog", "Log: 1=P ID, 2=P nID, 3=nP ID, 4=nP nID; Code; N",21,-0.25,10.25);
427 fHistMcNLambdaPrimary = new TH1F("fHistMcNLambdaPrimary","Number of primary lambdas in MC; NLambdas; i",6,-0.25,2.25);
428 fHistMcNLambda = new TH1F("fHistMcNLambda","Number of lambdas in MC; NLambdas; i",31,-0.5,30);
429 fHistMcNAntilambda = new TH1F("fHistMcNAntilambda","Number of antilambdas in MC; NAntiLambdas; i",31,-0.5,30);
430 fHistMcNKshort = new TH1F("fHistMcNKshort","Number of K0s in MC; NKshort; i",31,-0.5,30);
431 fHistMcPtV0La = new TH1F("fHistMcPtV0La","Pt distribution of V0s confirmed as lambdas; Pt (GeV/c); dN/dydPt",200,0,10);
432 fHistMcPtV0Lb = new TH1F("fHistMcPtV0Lb","Pt distribution of V0s confirmed as antilambdas; Pt (GeV/c); dN/dydPt",200,0,10);
433 fHistMcPtV0K0 = new TH1F("fHistMcPtV0K0","Pt distribution of V0s confirmed as K0s; Pt (GeV/c); dN/dydPt",200,0,10);
434 fHistMcSigmaPProton = new TH1F("fHistMcSigmaPProton","Sigma of being a proton from TPC response (MC protons); N Sigma; N",200,0,10);
435 fHistMcSigmaPNProton = new TH1F("fHistMcSigmaPNProton","Sigma of being a proton from TPC response (MC not protons); N Sigma; N",200,0,10);
436 fHistMcSLambdaEta = new TH1F("fHistMcSLambdaEta","#eta distribution for MC secondary lambdas",60, -3, 3);
437 fHistMcSLambdaDaughter = new TH1F("fHistMcSLambda_Daughter","PDG code for first daughter of MC secondary lambdas",8001, -4000.5,4000.5);
438 fHistMcSLambdaPt = new TH1F("fHistMcSLambdaPt","#Pt distribution for MC secondary lambdas",500, 0, 100);
439 fHistMcTPCTrackLength = new TH1F("fHistMcTPCTrackLength","TPC track length for charged Lambda daughters",500, 0, 100);
440 fHistMK0 = new TH1F("fHistMK0","K0Short Mass; M(#pi^{+}#pi^{-}) (GeV/c^{2}); dN/dM (0.12 GeV/c^{2})^{-1}",140,0.414,0.582);
441 fHistMK00 = new TH1F("fHistMK00","K0Short Mass; M(#pi^{+}#pi^{-}) (GeV/c^{2}); dN/dM (0.12 GeV/c^{2})^{-1}",140,0.414,0.582);
442 fHistMK01 = new TH1F("fHistMK01","K0Short Mass; M(#pi^{+}#pi^{-}) (GeV/c^{2}); dN/dM (0.12 GeV/c^{2})^{-1}",140,0.414,0.582);
443 fHistMK02 = new TH1F("fHistMK02","K0Short Mass; M(#pi^{+}#pi^{-}) (GeV/c^{2}); dN/dM (0.12 GeV/c^{2})^{-1}",140,0.414,0.582);
444 fHistMK03 = new TH1F("fHistMK03","K0Short Mass; M(#pi^{+}#pi^{-}) (GeV/c^{2}); dN/dM (0.12 GeV/c^{2})^{-1}",140,0.414,0.582);
445 fHistMK04 = new TH1F("fHistMK04","K0Short Mass; M(#pi^{+}#pi^{-}) (GeV/c^{2}); dN/dM (0.12 GeV/c^{2})^{-1}",140,0.414,0.582);
446 fHistMK05 = new TH1F("fHistMK05","K0Short Mass; M(#pi^{+}#pi^{-}) (GeV/c^{2}); dN/dM (0.12 GeV/c^{2})^{-1}",140,0.414,0.582);
447 fHistMK06 = new TH1F("fHistMK06","K0Short Mass; M(#pi^{+}#pi^{-}) (GeV/c^{2}); dN/dM (0.12 GeV/c^{2})^{-1}",140,0.414,0.582);
448 fHistMK07 = new TH1F("fHistMK07","K0Short Mass; M(#pi^{+}#pi^{-}) (GeV/c^{2}); dN/dM (0.12 GeV/c^{2})^{-1}",140,0.414,0.582);
449 fHistMK08 = new TH1F("fHistMK08","K0Short Mass; M(#pi^{+}#pi^{-}) (GeV/c^{2}); dN/dM (0.12 GeV/c^{2})^{-1}",140,0.414,0.582);
450 fHistMK09 = new TH1F("fHistMK09","K0Short Mass; M(#pi^{+}#pi^{-}) (GeV/c^{2}); dN/dM (0.12 GeV/c^{2})^{-1}",140,0.414,0.582);
451 fHistMLa = new TH1F("fHistMLa","Lambda Mass; M(p#pi^{-}) (GeV/c^{2}); dN/dM (0.125 GeV/c^{2})^{-1}",div,min,max);
452 fHistMLa0 = new TH1F("fHistMLa0", "V0 Mass; M(M(p#pi^{-}) (GeV/c^{2}); dN/dM (0.12 GeV/c^{2})^{-1}",div,min,max);
453 fHistMLa1 = new TH1F("fHistMLa1", "V0 Mass; M(M(p#pi^{-}) (GeV/c^{2}); dN/dM (0.12 GeV/c^{2})^{-1}",div,min,max);
454 fHistMLa2 = new TH1F("fHistMLa2", "V0 Mass; M(M(p#pi^{-}) (GeV/c^{2}); dN/dM (0.12 GeV/c^{2})^{-1}",div,min,max);
455 fHistMLa3 = new TH1F("fHistMLa3", "V0 Mass; M(M(p#pi^{-}) (GeV/c^{2}); dN/dM (0.12 GeV/c^{2})^{-1}",div,min,max);
456 fHistMLa4 = new TH1F("fHistMLa4", "V0 Mass; M(M(p#pi^{-}) (GeV/c^{2}); dN/dM (0.12 GeV/c^{2})^{-1}",div,min,max);
457 fHistMLa5 = new TH1F("fHistMLa5", "V0 Mass; M(M(p#pi^{-}) (GeV/c^{2}); dN/dM (0.12 GeV/c^{2})^{-1}",div,min,max);
458 fHistMLa6 = new TH1F("fHistMLa6", "V0 Mass; M(M(p#pi^{-}) (GeV/c^{2}); dN/dM (0.12 GeV/c^{2})^{-1}",div,min,max);
459 fHistMLa7 = new TH1F("fHistMLa7", "V0 Mass; M(M(p#pi^{-}) (GeV/c^{2}); dN/dM (0.12 GeV/c^{2})^{-1}",div,min,max);
460 fHistMLa8 = new TH1F("fHistMLa8", "V0 Mass; M(M(p#pi^{-}) (GeV/c^{2}); dN/dM (0.12 GeV/c^{2})^{-1}",div,min,max);
461 fHistMLa9 = new TH1F("fHistMLa9", "V0 Mass; M(M(p#pi^{-}) (GeV/c^{2}); dN/dM (0.12 GeV/c^{2})^{-1}",div,min,max);
462 fHistMLb = new TH1F("fHistMLb","AntiLambda Mass; M(#bar{p}#pi^{+}) (GeV/c^{2}); dN/dM (0.125 GeV/c^{2})^{-1}",div,min,max);
463 fHistMLb0 = new TH1F("fHistMLb0", "V0 Mass; M(M(#bar{p}#pi^{+}) (GeV/c^{2}); dN/dM (0.125 GeV/c^{2})^{-1}",div,min,max);
464 fHistMLb1 = new TH1F("fHistMLb1", "V0 Mass; M(M(#bar{p}#pi^{+}) (GeV/c^{2}); dN/dM (0.125 GeV/c^{2})^{-1}",div,min,max);
465 fHistMLb2 = new TH1F("fHistMLb2", "V0 Mass; M(M(#bar{p}#pi^{+}) (GeV/c^{2}); dN/dM (0.125 GeV/c^{2})^{-1}",div,min,max);
466 fHistMLb3 = new TH1F("fHistMLb3", "V0 Mass; M(M(#bar{p}#pi^{+}) (GeV/c^{2}); dN/dM (0.125 GeV/c^{2})^{-1}",div,min,max);
467 fHistMLb4 = new TH1F("fHistMLb4", "V0 Mass; M(M(#bar{p}#pi^{+}) (GeV/c^{2}); dN/dM (0.125 GeV/c^{2})^{-1}",div,min,max);
468 fHistMLb5 = new TH1F("fHistMLb5", "V0 Mass; M(M(#bar{p}#pi^{+}) (GeV/c^{2}); dN/dM (0.125 GeV/c^{2})^{-1}",div,min,max);
469 fHistMLb6 = new TH1F("fHistMLb6", "V0 Mass; M(M(#bar{p}#pi^{+}) (GeV/c^{2}); dN/dM (0.125 GeV/c^{2})^{-1}",div,min,max);
470 fHistMLb7 = new TH1F("fHistMLb7", "V0 Mass; M(M(#bar{p}#pi^{+}) (GeV/c^{2}); dN/dM (0.125 GeV/c^{2})^{-1}",div,min,max);
471 fHistMLb8 = new TH1F("fHistMLb8", "V0 Mass; M(M(#bar{p}#pi^{+}) (GeV/c^{2}); dN/dM (0.125 GeV/c^{2})^{-1}",div,min,max);
472 fHistMLb9 = new TH1F("fHistMLb9", "V0 Mass; M(M(#bar{p}#pi^{+}) (GeV/c^{2}); dN/dM (0.125 GeV/c^{2})^{-1}",div,min,max);
473 fHistNLambda = new TH1F("fHistNLambda", "Number of lambda per event; N(lambda); N(events)",50,-0.5,49.5);
474 fHistNV0 = new TH1F("fHistNV0","V0 frequency distribution; Number of V0 Candidates",1000,0,100000);
475 fHistNTracks = new TH1F("fHistNTracks", "Track frequency distribution; Number of Tracks; N Tracks", 1000, 0, 100000);
476 fHistPtV0 = new TH1F("fHistPtV0","V0 P_{T}; P_{T} (GeV/c);dN/dP_{T} (GeV/c)^{-1}",40,0.,4.);
477 fHistPVZ = new TH1F("fHistPVZ","Z primary; Z (cm); Counts",100,-10,10);
478 fHistTauLa = new TH1F("fHistTauLa", "Lifetime under Lambda mass hypothesis; Lifetime(s); N(v0s)",200,0,100);
479 fHistTheta = new TH1F("fHistTheta","Angle of decay in Lambda rest frame ;Theta ;N V0s",180,-4,4);
480 fHistThetaPi2 = new TH1F("fHistThetaPi2","Angle of pion decay in lab frame ;Theta ;N V0s",180,-4,4);
481 fHistThetaProton2 = new TH1F("fHistThetaProton2","Angle of proton decay in lab frame;Theta ;N V0s",180,-4,4);
482 fHistV0Z = new TH1F("fHistV0Z","Z decay; Z (cm); Counts",100,-10,10);
483 fHistZ = new TH1F("fHistZ","Z decay - Z primary; Z (cm); Counts",100,-10,10);
484
485 //TH2F follow
486 fHistBetaERatio = new TH2F("fHistBetaERatio","Ratio of Energies of Pion & Proton ;Beta ;Ratio",100,0,1,100,0,1);
487 fHistBetaPRatio = new TH2F("fHistBetaPRatio","Ratio of Momentum of Pion & Proton ;Beta ;Ratio",100,0,1,100,0,2);
488 fHistBetaPXRatio = new TH2F("fHistBetaPXRatio","Ratio of Momentum in boost direction of Pion & Proton ;Beta ;Ratio",100,0,1,100,-10,10);
489 fHistBetheBlochITSNeg = new TH2F("fHistBetheBlochITSNeg","-dE/dX against Momentum for negative daughter from ITS; Log10 P (GeV); -dE/dx (keV/cm ?)",1000,-1,1,1000,0,200);
490 fHistBetheBlochITSPos = new TH2F("fHistBetheBlochITSPos","-dE/dX against Momentum for positive daughter from ITS; Log10 P (GeV); -dE/dx (keV/cm ?)",1000,-1,1,1000,0,200);
491 fHistBetheBlochTPCNeg = new TH2F("fHistBetheBlochTPCNeg","-dE/dX against Momentum for negative daughter from TPC; Log10 P (GeV); -dE/dx (keV/cm ?)",1000,-1,1,1000,0,200);
492 fHistBetheBlochTPCPos = new TH2F("fHistBetheBlochTPCPos","-dE/dX against Momentum for positive daughter from TPC; Log10 P (GeV); -dE/dx (keV/cm ?)",1000,-1,1,1000,0,200);
493 fHistCosPAMLa = new TH2F("fHistCosPAMLa", "Cosine of Pointing Angle of V0s; Cos PA; M(p#pi^{-}) (GeV/c^{2})",202,0.8,1.01,96,1.08,1.2);
494 fHistDCAPtPSig = new TH2F("fHistDCAPtPSig","DCA of proton daughter from Lambda in peak region to PV versus Pt; P_{perp} (GeV/c); DCA(cm)",200,0,10,200,0,20);
495 fHistDCAPtPBg = new TH2F("fHistDCAPtPBg","DCA of proton daughter from Lambda in sideband region to PV versus Pt; P_{perp} (GeV/c); DCA(cm)",200,0,10,200,0,20);
496 fHistDCAPtPbarSig = new TH2F("fHistDCAPtPbarSig","DCA of antiproton daughter from antiLambda in peak region to PV versus Pt; P_{perp} (GeV/c); DCA(cm)",200,0,10,200,0,20);
497 fHistDCAPtPbarBg = new TH2F("fHistDCAPtPbarBg","DCA of antiproton daughter from antiLambda in sideband region to PV versus Pt; P_{perp} (GeV/c); DCA(cm)",200,0,10,200,0,20);
498 fHistDecayLDCA = new TH2F("fHistDecayLDCA", "Distance between V0 and PV against DCA between daughter tracks; Distance(cm); DCA (cm) ",301,-0.1,30,100,0,2);
499 fHistDecayLMLa = new TH2F("fHistDecayLMLa", "Distance between V0 and PV; Distance(cm); M(p#pi^{-}) (GeV/c^{2})",301,-0.1,30,96,1.08,1.2);
500 fHistDeltaThetaMLa = new TH2F("fHistDeltaThetaMLa"," Delta theta against effective lambda mass; Delta Theta; MLa", 180, -3, 3, 96, 1.08, 1.2);
501 fHistImpactxyImpactz = new TH2F("fHistImpactxyImpactz", "RSM DCA between negative particle and primary vertex in xy plane; RSM DCA xy (cm); RSM DCA z (cm)",100,0,1,100,0,10);
502 fHistImpactxyMLa = new TH2F("fHistImpactxyMLa", "RSM DCA between negative particle and primary vertex in xy plane; RSM DCA (cm); M(p#pi^{-}) (GeV/c^{2})",100,0,1,96,1.08,1.2);
503 fHistImpactzMLa = new TH2F("fHistImpactzMLa", "RSM DCA between negative particle and primary vertex in xy plane; RSM DCA (cm); M(p#pi^{-}) (GeV/c^{2})",100,0,1,96,1.08,1.2);
504 fHistMcLamdaPProductionVertex = new TH2F("fHistMcLamdaPProductionVertex", "Production vertex of primary Lambdas in RZ plane; Zv; Rv",100,-100,100,100,0,100);
505 fHistMcLamdaSProductionVertex = new TH2F("fHistMcLamdaSProductionVertex", "Production vertex of secondary Lambdas in RZ plane; Zv; Rv",100,-100,100,100,0,100);
506 fHistMcLamdaSDecayVertex = new TH2F("fHistMcLamdaSDecayVertex", "Decay vertex of secondary Lambdas in RZ plane; Zv; Rv",100,-100,100,100,0,100);
507 fHistMcPMK0Pt = new TH2F("fHistMcPMK0Pt","Monte Carlo primary K0 Mass versus Pt; P_{perp} (GeV/c); K0 Mass (GeV/c^2)",200,0,10,140,0.414,0.582);
508 fHistMcPMLaPt = new TH2F("fHistMcPMLaPt","Monte Carlo primary (& sigma0) Lambda Mass versus Pt; P_{perp} (GeV/c); M(p#pi^{-}) (GeV/c^2)",200,0,10,96,1.08,1.2);
509 fHistMcPMLbPt = new TH2F("fHistMcPMLbPt","Monte Carlo primary (& sigma0) AntiLambda Mass versus Pt; P_{perp} (GeV/c); M(#bar{p}#pi^{+}) (GeV/c^2)",200,0,10,96,1.08,1.2);
510 fHistMcSLambdaDaughterPairs = new TH2F("fHistMcSLambdaDaughterPairs", "PDG codes of daughter particles of secondary Lambdas; Daughter1; Daughter2",21,-10.5,10.5,21,-10.5,10.5);
511 fHistMcV0MK0Pt = new TH2F("fHistMcV0MK0Pt","Monte Carlo V0s passing cuts. K0 Mass versus Pt; P_{perp} (GeV/c); K0 Mass (GeV/c^2)",200,0,10,140,0.414,0.582);
512 fHistMcV0MLaPt = new TH2F("fHistMcV0MLaPt","Monte Carlo V0s passing cuts. Lambda Mass versus Pt; P_{perp} (GeV/c); Lambda Mass (GeV/c^2)",200,0,10,96,1.08,1.2);
513 fHistMcV0MLbPt = new TH2F("fHistMcV0MLbPt","Monte Carlo V0s passing cuts. Antilambda Mass versus Pt; P_{perp} (GeV/c); Antilambda Mass (GeV/c^2)",200,0,10,96,1.08,1.2);
514 fHistMcV0LamdaSProductionVertex = new TH2F("fHistMcV0LamdaSProductionVertex", "Production vertex of V0 secondary Lambdas in RZ plane; Zv; Rv",100,-100,100,100,0,100);
515 fHistMcV0IDLamdaSProductionVertex = new TH2F("fHistMcV0IDLamdaSProductionVertex", "Production vertex of identified V0 secondary Lambdas in RZ plane; Zv; Rv",100,-100,100,100,0,100);
516 fHistMK0PtArm = new TH2F("fHistMK0PtArm","K0 Mass versus PtArm; P_{perp} (GeV/c); K0 Mass (GeV/c^2)",40,0,0.25,140,0.414,0.582);
517 fHistMK0Pt = new TH2F("fHistMK0Pt","K0 Mass versus Pt; P_{perp} (GeV/c); K0 Mass (GeV/c^2)",200,0,10,140,0.414,0.582);
518 fHistMK0R = new TH2F("fHistMK0R","K0 Mass versus R; R (cm); K0 Mass (GeV/c^2)",120,0,120,140,0.414,0.582);
519 fHistMLaPtArm = new TH2F("fHistMLaPtArm","Lambda Mass versus PtArm; P_{perp} (GeV/c); M(p#pi^{-}) (GeV/c^2)",40,0,0.25,96,1.08,1.2);
520 fHistMLaPt = new TH2F("fHistMLaPt","Lambda Mass versus Pt; P_{perp} (GeV/c); M(p#pi^{-}) (GeV/c^2)",200,0,10,96,1.08,1.2);
521 fHistMLaR = new TH2F("fHistMLaR","Lambda Mass versus R; R (cm); M(p#pi^{-}) (GeV/c^2)",120,0,120,96,1.08,1.2);
522 fHistMLbPtArm = new TH2F("fHistMLbPtArm","AntiLambda Mass versus PtArm; P_{perp} (GeV/c); M(#bar{p}#pi^{+}) (GeV/c^2)",40,0,0.25,96,1.08,1.2);
523 fHistMLbPt = new TH2F("fHistMLbPt","AntiLambda Mass versus Pt; P_{perp} (GeV/c); M(#bar{p}#pi^{+}) (GeV/c^2)",200,0,10,96,1.08,1.2);
524 fHistMLbR = new TH2F("fHistMLbR","AntiLambda Mass versus R; R (cm); M(#bar{p}#pi^{+}) (GeV/c^2)",120,0,120,96,1.08,1.2);
525 fHistNegChi2PerClusterMLa = new TH2F("fHistNegChi2PerClusterMLa","Chi Squared per cluster against Lambda mass (negative Track);Chi^2 per cluster; M(p#pi^{-}) (GeV/c^{2})",200,0,7,96,1.08,1.2);;
526 fHistNegTPCRefitMLa = new TH2F("fHistNegTPCRefitMLa","TPC refit?; TPC refit?; M(p#pi^{-}) (GeV/c^{2})",200,0,100,96,1.08,1.2);;
527 fHistNTPCNegClustersMLa = new TH2F("fHistNTPCNegClustersMLa","Number of TPC clusters per negative track against Lambda mass;Number of TPC clusters; M(p#pi^{-}) (GeV/c^{2})",200,0,200,96,1.08,1.2);;
528 fHistNTPCPosClustersMLa = new TH2F("fHistNTPCPosClustersMLa","Number of TPC clusters per positive track against Lambda mass;Number of TPC clusters; M(p#pi^{-}) (GeV/c^{2})",200,0,200,96,1.08,1.2);;
529 fHistNV0sNTracks = new TH2F("fHistNV0sNTracks", "Number of tracks squared against number of v0s; NTracks^2; NV0s", 1000, 0, 1e8, 1000, 0, 1.5e5);
530 fHistPosChi2PerClusterMLa = new TH2F("fHistPosChi2PerClusterMLa","Chi Squared per cluster against Lambda mass (positive Track);Chi^2 per cluster; M(p#pi^{-}) (GeV/c^{2})",200,0,7,96,1.08,1.2);;
531 fHistPosTPCRefitMLa = new TH2F("fHistPosTPCRefitMLa","TPC refit?; TPC refit?; M(p#pi^{-}) (GeV/c^{2})",200,0,100,96,1.08,1.2);;
532 fHistPtArm = new TH2F("fHistPtArm","Podolanski-Armenteros Plot; #alpha; P_{perp} (GeV/c)",40,-1,1,80,0,0.5);
533 fHistPtArmR = new TH2F("fHistPtArmR","PtArm versus R; R decay (cm); P_{perp}",120,0,120,50,0,0.25);
534 fHistPtV0Z = new TH2F("fHistPtV0Z","Pt of V0 vs Z position; Pt (GeV/c); Z (cm)",200,-0.1,1.9,200,-50,50);
535 fHistRZ = new TH2F("fHistRZ","R decay versus Z decay; Z (cm); R (cm)",100,-50,50,120,0,220);
536 fHistTauLaMLa = new TH2F("fHistTauLaMLa", "Lifetime under Lambda mass hypothesis; Lifetime(s); M(p#pi^{-}) (GeV/c^{2})",200,0,100,96,1.08,1.2);
537 fHistXZ = new TH2F("fHistXZ","X decay versus Z decay; Z (cm); X (cm)",100,-50,50,200,-200,200);
538 fHistYZ = new TH2F("fHistYZ","Y decay versus Z decay; Z (cm); Y (cm)",100,-50,50,200,-200,200);
539
540
541
542 // All histograms must be added to output list
543
544 fOutputList->Add(fHistPt);
545 fOutputList->Add(fHistEta);
546 fOutputList->Add(fHistLuke);
547 fOutputList->Add(fHistBetaV0);
548 fOutputList->Add(fHistCosPA);
549 fOutputList->Add(fHistCosTheta);
550 fOutputList->Add(fHistCosThetaPi2);
551 fOutputList->Add(fHistCosThetaProton2);
552 fOutputList->Add(fHistDCAV0Daughters);
553 fOutputList->Add(fHistDecayL);
554 fOutputList->Add(fHistDecayLxy);
555 fOutputList->Add(fHistDeltaTheta);
556 fOutputList->Add(fHistdNV0sdT2);
557 fOutputList->Add(fHistEtaNTracks);
558 fOutputList->Add(fHistEtaPTracks);
559 fOutputList->Add(fHistEtaV0s);
560 fOutputList->Add(fHistImpactxyN);
561 fOutputList->Add(fHistImpactzN);
562 fOutputList->Add(fHistImpactxyP);
563 fOutputList->Add(fHistImpactzP);
564 fOutputList->Add(fHistKinkIndexFalse);
565 fOutputList->Add(fHistKinkIndexTrue);
566 fOutputList->Add(fHistLambdaBgRapidity);
567 fOutputList->Add(fHistLambdaBgEta);
568 fOutputList->Add(fHistLambdaBgPt);
569 fOutputList->Add(fHistLambdaSigRapidity);
570 fOutputList->Add(fHistLambdaSigEta);
571 fOutputList->Add(fHistLambdaSigPt);
572 fOutputList->Add(fHistMagneticField);
573 fOutputList->Add(fHistMcLog);
574 fOutputList->Add(fHistMcNLambdaPrimary);
575 fOutputList->Add(fHistMcNLambda);
576 fOutputList->Add(fHistMcNAntilambda);
577 fOutputList->Add(fHistMcNKshort);
578 fOutputList->Add(fHistMcPtV0La);
579 fOutputList->Add(fHistMcPtV0Lb);
580 fOutputList->Add(fHistMcPtV0K0);
581 fOutputList->Add(fHistMcSigmaPProton);
582 fOutputList->Add(fHistMcSigmaPNProton);
583 fOutputList->Add(fHistMcSLambdaEta);
584 fOutputList->Add(fHistMcSLambdaDaughter);
585 fOutputList->Add(fHistMcSLambdaPt);
586 fOutputList->Add(fHistMcTPCTrackLength);
587 fOutputList->Add(fHistMK0);
588 fOutputList->Add(fHistMK00);
589 fOutputList->Add(fHistMK01);
590 fOutputList->Add(fHistMK02);
591 fOutputList->Add(fHistMK03);
592 fOutputList->Add(fHistMK04);
593 fOutputList->Add(fHistMK05);
594 fOutputList->Add(fHistMK06);
595 fOutputList->Add(fHistMK07);
596 fOutputList->Add(fHistMK08);
597 fOutputList->Add(fHistMK09);
598 fOutputList->Add(fHistMLa);
599 fOutputList->Add(fHistMLa0);
600 fOutputList->Add(fHistMLa1);
601 fOutputList->Add(fHistMLa2);
602 fOutputList->Add(fHistMLa3);
603 fOutputList->Add(fHistMLa4);
604 fOutputList->Add(fHistMLa5);
605 fOutputList->Add(fHistMLa6);
606 fOutputList->Add(fHistMLa7);
607 fOutputList->Add(fHistMLa8);
608 fOutputList->Add(fHistMLa9);
609 fOutputList->Add(fHistMLb);
610 fOutputList->Add(fHistMLb0);
611 fOutputList->Add(fHistMLb1);
612 fOutputList->Add(fHistMLb2);
613 fOutputList->Add(fHistMLb3);
614 fOutputList->Add(fHistMLb4);
615 fOutputList->Add(fHistMLb5);
616 fOutputList->Add(fHistMLb6);
617 fOutputList->Add(fHistMLb7);
618 fOutputList->Add(fHistMLb8);
619 fOutputList->Add(fHistMLb9);
620 fOutputList->Add(fHistNLambda);
621 fOutputList->Add(fHistNV0);
622 fOutputList->Add(fHistNTracks);
623 fOutputList->Add(fHistPtV0);
624 fOutputList->Add(fHistPVZ);
625 fOutputList->Add(fHistTauLa);
626 fOutputList->Add(fHistTheta);
627 fOutputList->Add(fHistThetaPi2);
628 fOutputList->Add(fHistThetaProton2);
629 fOutputList->Add(fHistV0Z);
630 fOutputList->Add(fHistZ);
631 fOutputList->Add(fHistBetaERatio);
632 fOutputList->Add(fHistBetaPRatio);
633 fOutputList->Add(fHistBetaPXRatio);
634 fOutputList->Add(fHistBetheBlochITSNeg);
635 fOutputList->Add(fHistBetheBlochITSPos);
636 fOutputList->Add(fHistBetheBlochTPCNeg);
637 fOutputList->Add(fHistBetheBlochTPCPos);
638 fOutputList->Add(fHistCosPAMLa);
639 fOutputList->Add(fHistDCAPtPSig);
640 fOutputList->Add(fHistDCAPtPBg);
641 fOutputList->Add(fHistDCAPtPbarSig);
642 fOutputList->Add(fHistDCAPtPbarBg);
643 fOutputList->Add(fHistDecayLDCA);
644 fOutputList->Add(fHistDecayLMLa);
645 fOutputList->Add(fHistDeltaThetaMLa);
646 fOutputList->Add(fHistImpactxyImpactz);
647 fOutputList->Add(fHistImpactxyMLa);
648 fOutputList->Add(fHistImpactzMLa);
649 fOutputList->Add(fHistMcLamdaPProductionVertex);
650 fOutputList->Add(fHistMcLamdaSProductionVertex);
651 fOutputList->Add(fHistMcLamdaSDecayVertex);
652 fOutputList->Add(fHistMcPMK0Pt);
653 fOutputList->Add(fHistMcPMLaPt);
654 fOutputList->Add(fHistMcPMLbPt);
655 fOutputList->Add(fHistMcSLambdaDaughterPairs);
656 fOutputList->Add(fHistMcV0MK0Pt);
657 fOutputList->Add(fHistMcV0MLaPt);
658 fOutputList->Add(fHistMcV0MLbPt);
659 fOutputList->Add(fHistMcV0LamdaSProductionVertex);
660 fOutputList->Add(fHistMcV0IDLamdaSProductionVertex);
661 fOutputList->Add(fHistMK0PtArm);
662 fOutputList->Add(fHistMK0Pt);
663 fOutputList->Add(fHistMK0R);
664 fOutputList->Add(fHistMLaPtArm);
665 fOutputList->Add(fHistMLaPt);
666 fOutputList->Add(fHistMLaR);
667 fOutputList->Add(fHistMLbPtArm);
668 fOutputList->Add(fHistMLbPt);
669 fOutputList->Add(fHistMLbR);
670 fOutputList->Add(fHistNegChi2PerClusterMLa);
671 fOutputList->Add(fHistNegTPCRefitMLa);
672 fOutputList->Add(fHistNTPCNegClustersMLa);
673 fOutputList->Add(fHistNTPCPosClustersMLa);
674 fOutputList->Add(fHistNV0sNTracks);
675 fOutputList->Add(fHistPosChi2PerClusterMLa);
676 fOutputList->Add(fHistPosTPCRefitMLa);
677 fOutputList->Add(fHistPtArm);
678 fOutputList->Add(fHistPtArmR);
679 fOutputList->Add(fHistPtV0Z);
680 fOutputList->Add(fHistRZ);
681 fOutputList->Add(fHistTauLaMLa);
682 fOutputList->Add(fHistXZ);
683 fOutputList->Add(fHistYZ);
684
685
686 PostData(1, fOutputList); // Post data for ALL output slots >0 here, to get at least an empty histogram
687}
688
689//________________________________________________________________________
690void AliAnalysisTaskLukeV0::UserExec(Option_t *)
691{
692 // Main loop
693 // Called for each event
694
695 // paramaters used for most cuts, to minimise editing
696 double cutCosPa(0.998), cutcTau(2);
697 double cutNImpact(-999), cutDCA(0.4);
698 double cutBetheBloch(3);
699 double cutMinNClustersTPC(70), cutMaxChi2PerClusterTPC(-999);
700 double isMonteCarlo(false);
701 double cutEta(0.8);
702
703 //Track Cuts set here
704 if(cutMinNClustersTPC != -999)
705 {(fTrackCuts->SetMinNClustersTPC(int(cutMinNClustersTPC)));}
706 if(cutMaxChi2PerClusterTPC != -999)
707 {fTrackCuts->SetMaxChi2PerClusterTPC(cutMaxChi2PerClusterTPC);}
708 fTrackCuts->SetAcceptKinkDaughters(kFALSE);
709 fTrackCuts->SetRequireTPCRefit(kTRUE);
710
711
712 // Create pointer to reconstructed event
713
714 AliVEvent *event = InputEvent();
715 if (!event) { Printf("ERROR: Could not retrieve event"); return; }
716
717 // create pointer to event
718 AliESDEvent* fESD = dynamic_cast<AliESDEvent*>(event);
719 if (!fESD) {
720 AliError("Cannot get the ESD event");
721 return;
722 }
723
724 /*********************************************************************/
725 // MONTE CARLO SECTION
726 // This section loops over all MC tracks
727
728 int nLambdaMC = 0;
729 int nAntilambdaMC = 0;
730 int nKshortMC = 0;
731
732 if(isMonteCarlo)
733 {
734
735 // If the task accesses MC info, this can be done as in the commented block below:
736
737 // Create pointer to reconstructed event
738 AliMCEvent *mcEvent = MCEvent();
739 if (!mcEvent)
740 {
741 Printf("ERROR: Could not retrieve MC event");
742 //return;
743 }
744 else
745 {
746 Printf("MC particles: %d", mcEvent->GetNumberOfTracks());
747 }
748
749 // set up a stack for use in check for primary/stable particles
750 AliStack* mcStack = mcEvent->Stack();
751 if( !mcStack ) { Printf( "Stack not available"); return; }
752
753 AliMCVertex *mcpv = (AliMCVertex *) mcEvent->GetPrimaryVertex();
754 Double_t mcpvPos[3];
755 if (mcpv != 0)
756 {
757 mcpv->GetXYZ(mcpvPos);
758 }
759 else
760 {
761 Printf("ERROR: Could not resolve MC primary vertex");
762 return;
763 }
764
765 //loop over all MC tracks
766 for(Int_t iMCtrack = 0; iMCtrack < mcEvent->GetNumberOfTracks(); iMCtrack++)
767 {
768
769 //booleans to check if track is La, Lb, K0 and primary
770 bool lambdaMC = false;
771 bool antilambdaMC = false;
772 bool kshortMC = false;
773 bool isprimaryMC = false;
774
775 AliMCParticle *mcPart = dynamic_cast<AliMCParticle *>(mcEvent->GetTrack(iMCtrack));
776
777 if(mcPart->PdgCode() == kLambda0)
778 {
779 lambdaMC = true;
780 nLambdaMC++;
781 }
782 else if(mcPart->PdgCode() == kK0Short)
783 {
784 kshortMC = true;
785 nKshortMC++;
786 }
787 else if(mcPart->PdgCode() == kLambda0Bar)
788 {
789 antilambdaMC = true;
790 nAntilambdaMC++;
791 }
792
793 //if only interested in La,Lb,K0, can use this to terminate loop for other particles
794 //if(lambdaMC == false && antilambdaMC == false && kshortMC == false)
795 //{continue;}
796
797 Int_t firstDaughterLabel = mcPart->GetFirstDaughter();
798 Int_t lastDaughterLabel = mcPart->GetLastDaughter();
799 Int_t motherLabel = mcPart->GetMother();
800
801 if(firstDaughterLabel < 0 || lastDaughterLabel < 0)
802 {continue;}
803
804 AliMCParticle *mcFirstDaughter = dynamic_cast<AliMCParticle *>(mcEvent->GetTrack(firstDaughterLabel));
805 AliMCParticle *mcLastDaughter = dynamic_cast<AliMCParticle *>(mcEvent->GetTrack(lastDaughterLabel));
806 AliMCParticle *mcMother = dynamic_cast<AliMCParticle *>(mcEvent->GetTrack(motherLabel));
807
808 double mcRadius = TMath::Sqrt((mcPart->Xv())*(mcPart->Xv())+(mcPart->Yv())*(mcPart->Yv()));
809 double mcFirstDaughterRadius = TMath::Sqrt((mcFirstDaughter->Xv())*(mcFirstDaughter->Xv())+(mcFirstDaughter->Yv())*(mcFirstDaughter->Yv()));
810 double mcLastDaughterRadius = TMath::Sqrt((mcLastDaughter->Xv())*(mcLastDaughter->Xv())+(mcLastDaughter->Yv())*(mcLastDaughter->Yv()));
811
812 double motherType = -1;
813 if(motherLabel >= 0)
814 {motherType = mcMother->PdgCode();}
815
816 // this block of code is used to include Sigma0 decays as primary lambda/antilambda
817 bool sigma0MC = false;
818 if(motherType == 3212 || motherType == -3212)
819 {
820 if(mcEvent->IsPhysicalPrimary(motherLabel))
821 {sigma0MC = true;}
822 }
823
824
825 if(mcEvent->IsPhysicalPrimary(iMCtrack) || sigma0MC)
826 {
827 isprimaryMC = true;
828 if(lambdaMC)
829 {
830 fHistMcNLambdaPrimary->Fill(1);
831 fHistMcLamdaPProductionVertex->Fill(mcPart->Zv(),mcRadius);
832
833 if(TMath::Abs(mcPart->Y())<=0.5)
834 {fHistMcPMLaPt->Fill(mcPart->Pt(),mcPart->M());}
835 }
836 if(antilambdaMC)
837 {
838 if(TMath::Abs(mcPart->Y())<=0.5)
839 {fHistMcPMLbPt->Fill(mcPart->Pt(),mcPart->M());}
840 }
841 if(kshortMC)
842 {
843 if(TMath::Abs(mcPart->Y())<=0.5)
844 {fHistMcPMK0Pt->Fill(mcPart->Pt(),mcPart->M());}
845 }
846 }
847 else
848 {
849 isprimaryMC = false;
850 if(lambdaMC)
851 {
852 fHistMcNLambdaPrimary->Fill(2);
853
854 fHistMcSLambdaDaughter->Fill(mcFirstDaughter->PdgCode());
855
856 if(motherLabel >=0)
857 {
858 if(mcMother->PdgCode() != kLambda0)
859 {fHistMcLamdaSProductionVertex->Fill(mcPart->Zv(),mcRadius);}
860 }
861 else
862 {fHistMcLamdaSProductionVertex->Fill(mcPart->Zv(),mcRadius);}
863
864 if(mcFirstDaughter->PdgCode() == kProton || mcFirstDaughter->PdgCode() == kPiMinus)
865 {fHistMcLamdaSDecayVertex->Fill(mcFirstDaughter->Zv(),mcFirstDaughterRadius);}
866
867 fHistMcSLambdaEta->Fill(mcPart->Eta());
868 fHistMcSLambdaPt->Fill(mcPart->Pt());
869 }
870 }
871
872 }
873
874
875 }
876
877
878 fHistMcNLambda->Fill(nLambdaMC);
879 fHistMcNAntilambda->Fill(nAntilambdaMC);
880 fHistMcNKshort->Fill(nKshortMC);
881
882 //END OF MONTE CARLO SECTION
883 /*********************************************************************/
884
885
886
887
888
889 // Do some fast cuts first
890 // check for good reconstructed vertex
891 if(!(fESD->GetPrimaryVertex()->GetStatus())) return;
892 // if vertex is from spd vertexZ, require more stringent cut
893 if (fESD->GetPrimaryVertex()->IsFromVertexerZ()) {
894 if (fESD->GetPrimaryVertex()->GetDispersion()>0.02 || fESD->GetPrimaryVertex()->GetZRes()>0.25 ) return; // bad vertex from VertexerZ
895 }
896
897 Double_t tV0Position[3];
898 Double_t tPVPosition[3];
899 Double_t radius;
900
901 // physics selection
902 UInt_t maskIsSelected = ((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected();
903 if(!maskIsSelected)
904 {
905 //printf("Event failed physics selection\n");
906 return;
907 }
908
909 //if additional initial cuts wanted, can set conditions here
910 bool isCut = (fESD->GetNumberOfTracks()==0);
911 if (isCut)
912 {return;}
913
914 //gets primary vertex for the event
915 const AliESDVertex *kPv = ((AliESDEvent *)fESD)->GetPrimaryVertex();
916 if ( kPv != 0 )
917 {
918 tPVPosition[0] = kPv->GetXv();
919 tPVPosition[1] = kPv->GetYv();
920 tPVPosition[2] = kPv->GetZv();
921 if( tPVPosition[2] == 0. )
922 {
923 //printf("WARNING: Primary vertex a Z = 0, aborting\n");
924 return;
925 }
926 }
927 else
928 {
929 //printf("ERROR: Primary vertex not found\n");
930 return;
931 }
932 if( !kPv->GetStatus())
933 {return;}
934
935
936
937
938 int nLambda(0);
939 int nV0s(0);
940 double lambdaLabel[fESD->GetNumberOfV0s()];
941
942 // V0 loop - runs over every v0 in the event
943 for (Int_t iV0 = 0; iV0 < fESD->GetNumberOfV0s(); iV0++)
944 {
945
946 AliESDv0 *v0 = fESD->GetV0(iV0);
947 if (!v0)
948 {
949 printf("ERROR: Could not receive v0 %d\n", iV0);
950 continue;
951 }
952
953 bool lambdaCandidate = true;
954 bool antilambdaCandidate = true;
955 bool kshortCandidate = true;
956
957 // keep only events of interest for fHistMLa plots
958
959 if (v0->GetEffMass(4,2) < 1.08 || v0->GetEffMass(4,2) > 1.2 || TMath::Abs(v0->Y(3122))>0.5 )
960 {lambdaCandidate = false;}
961 if (v0->GetEffMass(2,4) < 1.08 || v0->GetEffMass(2,4) > 1.2 || TMath::Abs(v0->Y(-3122))>0.5)
962 {antilambdaCandidate = false;}
963 if (v0->GetEffMass(2,2) < 0.414 || v0->GetEffMass(2,2) > 0.582 || TMath::Abs(v0->Y(310))>0.5)
964 {kshortCandidate = false;}
965 if (v0->GetOnFlyStatus())
966 {continue;}
967
968 if(!isMonteCarlo)
969 {if(lambdaCandidate == false && antilambdaCandidate == false && kshortCandidate == false)
970 {continue;}}
971
972
973 //gets details of the v0
974 v0->GetXYZ(tV0Position[0],tV0Position[1],tV0Position[2]);
975 radius = TMath::Sqrt(tV0Position[0]*tV0Position[0]+tV0Position[1]*tV0Position[1]);
976
977 double decayLength = (sqrt((tV0Position[0]-tPVPosition[0])*(tV0Position[0]-tPVPosition[0])+(tV0Position[1]-tPVPosition[1])*(tV0Position[1]-tPVPosition[1])+(tV0Position[2]-tPVPosition[2])*(tV0Position[2]-tPVPosition[2])));
978 double cTauLa = decayLength*(v0->GetEffMass(4,2))/(v0->P());
979 double cTauLb = decayLength*(v0->GetEffMass(2,4))/(v0->P());
980 double cTauK0 = decayLength*(v0->GetEffMass(2,2))/(v0->P());
981
982 Int_t indexP, indexN;
983 indexP = TMath::Abs(v0->GetPindex());
984 AliESDtrack *posTrack = ((AliESDEvent*)fESD)->GetTrack(indexP);
985 indexN = TMath::Abs(v0->GetNindex());
986 AliESDtrack *negTrack = ((AliESDEvent*)fESD)->GetTrack(indexN);
987
988 if(!posTrack || !negTrack)
989 {continue;}
990
991 double pTrackMomentum[3];
992 double nTrackMomentum[3];
993 double pV0x, pV0y, pV0z;
994 posTrack->GetConstrainedPxPyPz(pTrackMomentum);
995 negTrack->GetConstrainedPxPyPz(nTrackMomentum);
996 v0->GetPxPyPz(pV0x, pV0y, pV0z);
997
998 const double kMLambda = 1.115;
999 const double kMProton = 0.938;
1000 const double kMPi = 0.140;
1001
1002 double pPos2 = sqrt(pTrackMomentum[0]*pTrackMomentum[0]+pTrackMomentum[1]*pTrackMomentum[1]+pTrackMomentum[2]*pTrackMomentum[2]);
1003 double pNeg2 = sqrt(nTrackMomentum[0]*nTrackMomentum[0]+nTrackMomentum[1]*nTrackMomentum[1]+nTrackMomentum[2]*nTrackMomentum[2]);
1004 double pV02 = sqrt(pV0x*pV0x+pV0y*pV0y+pV0z*pV0z);
1005
1006 //to prevent segfaults when ratios etc taken
1007 if(pV02 < 0.01 || pPos2 <0.01 || pNeg2 <0.01)
1008 {continue;}
1009
1010 Float_t pImpactxy(0), pImpactz(0);
1011 Float_t nImpactxy(0), nImpactz(0);
1012 posTrack->GetImpactParameters(pImpactxy,pImpactz);
1013 negTrack->GetImpactParameters(nImpactxy,nImpactz);
1014 nImpactxy = sqrt((nImpactxy*nImpactxy));
1015 nImpactz = sqrt((nImpactz *nImpactz ));
1016 pImpactxy = sqrt((pImpactxy*pImpactxy));
1017 pImpactz = sqrt((pImpactz *pImpactz ));
1018
1019 /*********************************************************************/
1020 // Cuts are implemented here.
1021
1022 if(!(fTrackCuts->IsSelected(posTrack)) || !(fTrackCuts->IsSelected(negTrack)))
1023 {
1024 lambdaCandidate = false;
1025 antilambdaCandidate = false;
1026 kshortCandidate = false;
1027 }
1028
1029 //extra cut to account for difference between p2 & p1 data
1030 if(nImpactxy < 0.1 || pImpactxy < 0.1)
1031 {
1032 lambdaCandidate = false;
1033 antilambdaCandidate = false;
1034 kshortCandidate = false;
1035 }
1036
1037 //psuedorapidity cut
1038 if(cutEta != -999)
1039 {
1040 if(TMath::Abs(posTrack->Eta()) > cutEta || TMath::Abs(negTrack->Eta()) >cutEta)
1041 {
1042 lambdaCandidate = false;
1043 antilambdaCandidate = false;
1044 kshortCandidate = false;
1045 }
1046 }
1047
1048 //pointing angle cut
1049 if(cutCosPa != -999)
1050 {
1051 if (v0->GetV0CosineOfPointingAngle(tPVPosition[0],tPVPosition[1],tPVPosition[2]) < cutCosPa)
1052 {
1053 lambdaCandidate = false;
1054 antilambdaCandidate = false;
1055 kshortCandidate = false;
1056 }
1057 }
1058
1059 //lifetime cut
1060 if(cutcTau != -999)
1061 {
1062 if(cTauLa < cutcTau)
1063 {
1064 lambdaCandidate = false;
1065 }
1066 if(cTauLb < cutcTau)
1067 {
1068 antilambdaCandidate = false;
1069 }
1070 if(cTauK0 < cutcTau)
1071 {
1072 kshortCandidate = false;
1073 }
1074
1075 }
1076
1077 // Impact paramater cut (on neg particle)
1078 if(cutNImpact != -999)
1079 {
1080 if(nImpactxy < cutNImpact || nImpactz < cutNImpact)
1081 {
1082 lambdaCandidate = false;
1083 }
1084 if(pImpactxy < cutNImpact || pImpactz < cutNImpact)
1085 {
1086 antilambdaCandidate = false;
1087 }
1088 }
1089
1090
1091 // DCA between daughterscut
1092 if(cutDCA != -999)
1093 {
1094 if(v0->GetDcaV0Daughters() > cutDCA)
1095 {
1096 lambdaCandidate = false;
1097 antilambdaCandidate = false;
1098 kshortCandidate = false;
1099 }
1100 }
1101
1102 // Bethe Bloch cut. Made sightly complicated as options for crude cuts still included. Should probably reduce to just 'official' cuts
1103 if(cutBetheBloch != -999)
1104 {
1105 if(posTrack->GetTPCsignal() <0 || negTrack->GetTPCsignal()<0)
1106 {continue;}
1107
1108 if(lambdaCandidate)
1109 {
1110 if(cutBetheBloch > 0)
1111 {
1112 if(TMath::Abs(fPIDResponse->NumberOfSigmasTPC(posTrack, AliPID::kProton)) > cutBetheBloch )
1113 {lambdaCandidate = false;}
1114 if(TMath::Abs(fPIDResponse->NumberOfSigmasTPC(negTrack, AliPID::kPion)) > cutBetheBloch )
1115 {lambdaCandidate = false;}
1116 }
1117
1118 if(cutBetheBloch == -4)
1119 {
1120 if(isMonteCarlo)
1121 {
1122 double beta2 = TMath::Power((pPos2/TMath::Sqrt((pPos2*pPos2+0.9*0.9))),2);
1123 double gamma2 = 1.0/(1.0-beta2);
1124 if(posTrack->GetTPCsignal() < (2.0/beta2)*(TMath::Log(1e6*beta2*gamma2)-beta2))
1125 {lambdaCandidate = false;}
1126 }
1127 else
1128 {
1129 double beta2 = TMath::Power((pPos2/TMath::Sqrt((pPos2*pPos2+kMProton*kMProton))),2);
1130 double gamma2 = 1.0/(1.0-beta2);
1131 if(posTrack->GetTPCsignal() < (2.3/beta2)*(TMath::Log(1e6*beta2*gamma2)-beta2))
1132 {lambdaCandidate = false;}
1133 }
1134 }
1135
1136 }
1137
1138 if(antilambdaCandidate)
1139 {
1140 if(cutBetheBloch > 0)
1141 {
1142 if(TMath::Abs(fPIDResponse->NumberOfSigmasTPC(negTrack, AliPID::kProton)) > cutBetheBloch )
1143 {antilambdaCandidate = false;}
1144 if(TMath::Abs(fPIDResponse->NumberOfSigmasTPC(posTrack, AliPID::kPion)) > cutBetheBloch )
1145 {antilambdaCandidate = false;}
1146 }
1147
1148 if(cutBetheBloch == -4)
1149 {
1150 if(isMonteCarlo)
1151 {
1152 double beta2 = TMath::Power((pNeg2/TMath::Sqrt((pNeg2*pNeg2+0.9*0.9))),2);
1153 double gamma2 = 1.0/(1.0-beta2);
1154 if(negTrack->GetTPCsignal() < (2.0/beta2)*(TMath::Log(1e6*beta2*gamma2)-beta2))
1155 {antilambdaCandidate = false;}
1156 }
1157 else
1158 {
1159 double beta2 = TMath::Power((pNeg2/TMath::Sqrt((pNeg2*pNeg2+0.9*0.9))),2);
1160 double gamma2 = 1.0/(1.0-beta2);
1161 if(negTrack->GetTPCsignal() < (2.3/beta2)*(TMath::Log(1e6*beta2*gamma2)-beta2))
1162 {antilambdaCandidate = false;}
1163 }
1164 }
1165
1166 }
1167
1168 if(kshortCandidate)
1169 {
1170 if(cutBetheBloch > 0)
1171 {
1172 if(TMath::Abs(fPIDResponse->NumberOfSigmasTPC(negTrack, AliPID::kPion)) > cutBetheBloch )
1173 {kshortCandidate = false;}
1174 if(TMath::Abs(fPIDResponse->NumberOfSigmasTPC(posTrack, AliPID::kPion)) > cutBetheBloch )
1175 {kshortCandidate = false;}
1176 }
1177
1178
1179 if(cutBetheBloch == -4)
1180 {
1181 double par0 = 0.20;
1182 double par1 = 4.2;
1183 double par2 = 1000000;
1184
1185 if(isMonteCarlo)
1186 {
1187 double beta2 = TMath::Power((pNeg2/TMath::Sqrt((pNeg2*pNeg2+par0*par0))),2);
1188 double gamma2 = 1.0/(1.0-beta2);
1189 if(negTrack->GetTPCsignal() > (par1/beta2)*(TMath::Log(par2*beta2*gamma2)-beta2) && TMath::Log10(pNeg2) > -0.6)
1190 {kshortCandidate = false;}
1191
1192 beta2 = TMath::Power((pPos2/TMath::Sqrt((pPos2*pPos2+par0*par0))),2);
1193 gamma2 = 1.0/(1.0-beta2);
1194 if(posTrack->GetTPCsignal() > (par1/beta2)*(TMath::Log(par2*beta2*gamma2)-beta2) && TMath::Log10(pNeg2) > -0.6)
1195 {kshortCandidate = false;}
1196 }
1197 else
1198 {
1199 double beta2 = TMath::Power((pNeg2/TMath::Sqrt((pNeg2*pNeg2+par0*par0))),2);
1200 double gamma2 = 1.0/(1.0-beta2);
1201 if(negTrack->GetTPCsignal() > (par1/beta2)*(TMath::Log(par2*beta2*gamma2)-beta2) && TMath::Log10(pNeg2) > -0.6)
1202 {kshortCandidate = false;}
1203
1204 beta2 = TMath::Power((pPos2/TMath::Sqrt((pPos2*pPos2+par0*par0))),2);
1205 gamma2 = 1.0/(1.0-beta2);
1206 if(posTrack->GetTPCsignal() > (par1/beta2)*(TMath::Log(par2*beta2*gamma2)-beta2) && TMath::Log10(pPos2) > -0.6)
1207 {kshortCandidate = false;}
1208 }
1209 }
1210
1211 }
1212 }
1213
1214 // Selection of random cuts which I've been playing with
1215 /*if(nImpactxy > 3 || pImpactxy > 2)
1216 {
1217 lambdaCandidate = false;
1218 }*/
1219
1220 /*if(nImpactxy < 0.4 || pImpactxy < 0.4 || nImpactxy > 2.5 || pImpactxy >2.5)
1221 {
1222 antilambdaCandidate = false;
1223 } */
1224
1225 //if(decayLength > 25 )
1226 //{lambdaCandidate = false;}
1227
1228 // Cuts to look at just lowpt region of lambdas
1229 if(v0->Pt() < 0.3 || v0->Pt() > 0.7 || !lambdaCandidate)
1230 {continue;}
1231
1232 // cuts to just look at signal/background region of lambda mass
1233 //if(!((v0->GetEffMass(4,2) >= 1.096 && v0->GetEffMass(4,2) < 1.106) || (v0->GetEffMass(4,2) >= 1.126 && v0->GetEffMass(4,2) < 1.136) ))
1234 //if(!(v0->GetEffMass(4,2) >= 1.106 && v0->GetEffMass(4,2) < 1.126 ))
1235 //{continue;}
1236 /*********************************************************************/
1237
1238 /*********************************************************************/
1239 // MONTE CARLO SECTION 2
1240 // this section looks at the individual V0s
1241
1242 bool mcLambdaCandidate = true;
1243 bool mcAntilambdaCandidate = true;
1244 bool mcK0Candidate = true;
1245 bool isPrimaryMC2 = false;
1246 bool realParticle = true;
1247
1248 if(isMonteCarlo)
1249 {
1250
1251 AliMCEvent *mcEvent = MCEvent();
1252 AliStack* mcStack = mcEvent->Stack();
1253 if( !mcStack ) { Printf( "Stack not available"); return; }
1254
1255 TParticle *negParticle = mcStack->Particle( TMath::Abs(negTrack->GetLabel()));
1256 TParticle *posParticle = mcStack->Particle( TMath::Abs(posTrack->GetLabel()));
1257
1258 Int_t negParticleMotherLabel = negParticle->GetFirstMother();
1259 Int_t posParticleMotherLabel = posParticle->GetFirstMother();
1260
1261 if( negParticleMotherLabel == -1 || posParticleMotherLabel == -1)
1262 {
1263 realParticle = false;
1264 mcLambdaCandidate = false;
1265 mcAntilambdaCandidate = false;
1266 mcK0Candidate =false;
1267 }
1268
1269
1270
1271
1272
1273 if( negParticleMotherLabel != posParticleMotherLabel)
1274 {
1275 mcLambdaCandidate = false;
1276 mcAntilambdaCandidate = false;
1277 mcK0Candidate =false;
1278 }
1279
1280 if(realParticle == true)
1281 {
1282 AliMCParticle *mcPart2 = dynamic_cast<AliMCParticle *>(mcEvent->GetTrack(negParticleMotherLabel));
1283 fHistMcTPCTrackLength->Fill(mcPart2->GetNumberOfTrackReferences());
1284 Int_t firstDaughterLabel2 = mcPart2->GetFirstDaughter();
1285 Int_t lastDaughterLabel2 = mcPart2->GetLastDaughter();
1286 AliMCParticle *mcFirstDaughter2 = dynamic_cast<AliMCParticle *>(mcEvent->GetTrack(firstDaughterLabel2));
1287 AliMCParticle *mcLastDaughter2 = dynamic_cast<AliMCParticle *>(mcEvent->GetTrack(lastDaughterLabel2));
1288 fHistMcTPCTrackLength->Fill(mcFirstDaughter2->GetNumberOfTrackReferences());
1289 fHistMcTPCTrackLength->Fill(mcLastDaughter2->GetNumberOfTrackReferences());
1290
1291 if(mcPart2->PdgCode() != kLambda0)
1292 {mcLambdaCandidate = false;}
1293 if(mcPart2->PdgCode() != kLambda0Bar)
1294 {mcAntilambdaCandidate = false;}
1295 if(mcPart2->PdgCode() != kK0Short)
1296 {mcK0Candidate =false;}
1297
1298 if( mcEvent->IsPhysicalPrimary(negParticleMotherLabel) )
1299 {isPrimaryMC2 = true;}
1300
1301 Int_t motherMotherLabel2 = mcPart2->GetMother();
1302 AliMCParticle *mcMotherMother2 = dynamic_cast<AliMCParticle *>(mcEvent->GetTrack(motherMotherLabel2));
1303 if(motherMotherLabel2 >= 0)
1304 {
1305 if((mcMotherMother2->PdgCode() == 3212 && mcLambdaCandidate) || (mcMotherMother2->PdgCode() == -3212 && mcAntilambdaCandidate))
1306 {
1307 if(mcEvent->IsPhysicalPrimary(motherMotherLabel2) )
1308 {isPrimaryMC2 = true;}
1309 }
1310 }
1311
1312
1313
1314 double mcRadius = TMath::Sqrt((mcPart2->Xv())*(mcPart2->Xv())+(mcPart2->Yv())*(mcPart2->Yv()));
1315
1316 if(mcLambdaCandidate)
1317 {
1318 lambdaLabel[iV0] = negParticleMotherLabel;
1319 bool once = false;
1320 for(int j = 0; j < iV0; j++)
1321 {
1322 if(lambdaLabel[iV0] == lambdaLabel[j])
1323 {
1324 if(!once)
1325 {
1326 fHistMcLog->Fill(6);
1327 once = true;
1328 }
1329 fHistMcLog->Fill(7);
1330 }
1331 }
1332 }
1333
1334 if(mcLambdaCandidate && lambdaCandidate)
1335 {
1336 fHistMcPtV0La->Fill(v0->Pt());
1337 fHistMcV0MLaPt->Fill(v0->Pt(),v0->GetEffMass(4,2));
1338 }
1339 if(mcAntilambdaCandidate && antilambdaCandidate)
1340 {
1341 fHistMcPtV0Lb->Fill(v0->Pt());
1342 fHistMcV0MLbPt->Fill(v0->Pt(),v0->GetEffMass(2,4));
1343 }
1344 if(mcK0Candidate && kshortCandidate)
1345 {
1346 fHistMcPtV0K0->Fill(v0->Pt());
1347 fHistMcV0MK0Pt->Fill(v0->Pt(),v0->GetEffMass(2,2));
1348 }
1349
1350 if(mcLambdaCandidate && isPrimaryMC2 && lambdaCandidate)
1351 {fHistMcLog->Fill(1);}
1352 if(mcLambdaCandidate && isPrimaryMC2 && !lambdaCandidate)
1353 {fHistMcLog->Fill(2);}
1354 if(mcLambdaCandidate && !isPrimaryMC2 && lambdaCandidate)
1355 {
1356 fHistMcLog->Fill(3);
1357 fHistMcV0IDLamdaSProductionVertex->Fill(mcPart2->Zv(),mcRadius);
1358 fHistMcV0LamdaSProductionVertex->Fill(mcPart2->Zv(),mcRadius);
1359 }
1360 if(mcLambdaCandidate && !isPrimaryMC2 && !lambdaCandidate)
1361 {
1362 fHistMcLog->Fill(4);
1363 fHistMcV0LamdaSProductionVertex->Fill(mcPart2->Zv(),mcRadius);
1364 }
1365
1366
1367 }
1368
1369
1370
1371 AliMCParticle *posParticle2 = dynamic_cast<AliMCParticle *>(mcEvent->GetTrack(TMath::Abs(posTrack->GetLabel())));
1372 AliMCParticle *negParticle2 = dynamic_cast<AliMCParticle *>(mcEvent->GetTrack(TMath::Abs(negTrack->GetLabel())));
1373
1374 if(posParticle2->PdgCode() == kProton)
1375 {
1376 fHistMcSigmaPProton->Fill(TMath::Abs(fPIDResponse->NumberOfSigmasTPC(posTrack, AliPID::kProton)));
1377 }
1378 if(posParticle2->PdgCode() != kProton)
1379 {
1380 fHistMcSigmaPNProton->Fill(TMath::Abs(fPIDResponse->NumberOfSigmasTPC(posTrack, AliPID::kProton)));
1381 }
1382 }
1383
1384 // END OF MONTE CARLO SECTION 2
1385 /*********************************************************************/
1386
1387 //remove all non-candidates
1388 if(lambdaCandidate == false && antilambdaCandidate == false && kshortCandidate == false)
1389 {continue;}
1390
1391
1392 //count number of valid v0s
1393 nV0s+=1;
1394
1395 /*********************************************************************/
1396 //This section fills histograms
1397
1398 if(lambdaCandidate)
1399 {
1400 if((v0->GetEffMass(4,2) >= 1.096 && v0->GetEffMass(4,2) < 1.106) || (v0->GetEffMass(4,2) >= 1.126 && v0->GetEffMass(4,2) < 1.136) )
1401 {fHistDCAPtPBg->Fill(v0->Pt(),nImpactxy);}
1402 if(v0->GetEffMass(4,2) >= 1.106 && v0->GetEffMass(4,2) < 1.126 )
1403 {fHistDCAPtPSig->Fill(v0->Pt(),nImpactxy);}
1404 }
1405
1406 if(antilambdaCandidate)
1407 {
1408 if((v0->GetEffMass(2,4) >= 1.096 && v0->GetEffMass(2,4) < 1.106) || (v0->GetEffMass(2,4) >= 1.126 && v0->GetEffMass(2,4) < 1.136) )
1409 {fHistDCAPtPbarBg->Fill(v0->Pt(),pImpactxy);}
1410 if(v0->GetEffMass(2,4) >= 1.106 && v0->GetEffMass(2,4) < 1.126 )
1411 {fHistDCAPtPbarSig->Fill(v0->Pt(),pImpactxy);}
1412 }
1413
1414
1415
1416 fHistEtaPTracks->Fill(posTrack->Eta());
1417 fHistEtaNTracks->Fill(negTrack->Eta());
1418 fHistEtaV0s->Fill(v0->Eta());
1419
1420
1421 if(lambdaCandidate)
1422 {
1423 double laMass = v0->GetEffMass(4,2);
1424
1425 if((laMass > 1.096 && laMass < 1.106) || (laMass > 1.126 && laMass < 1.136) )
1426 {
1427 fHistLambdaBgRapidity->Fill(v0->Y(3122));
1428 fHistLambdaBgEta->Fill(v0->Eta());
1429 fHistLambdaBgPt->Fill(v0->Pt());
1430 }
1431 if(laMass > 1.106 && laMass < 1.126 )
1432 {
1433 fHistLambdaSigRapidity->Fill(v0->Y(3122));
1434 fHistLambdaSigEta->Fill(v0->Eta());
1435 fHistLambdaSigPt->Fill(v0->Pt());
1436 }
1437
1438 fHistNTPCPosClustersMLa->Fill((posTrack->GetTPCNcls()),(v0->GetEffMass(4,2)));
1439 fHistNTPCNegClustersMLa->Fill((negTrack->GetTPCNcls()),(v0->GetEffMass(4,2)));
1440 fHistPosChi2PerClusterMLa->Fill((posTrack->GetTPCchi2())/(posTrack->GetTPCNcls()),(v0->GetEffMass(4,2)));
1441 fHistNegChi2PerClusterMLa->Fill((negTrack->GetTPCchi2())/(negTrack->GetTPCNcls()),(v0->GetEffMass(4,2)));
1442 if((posTrack->GetKinkIndex(0) <= 0) && (negTrack->GetKinkIndex(0) <= 0))
1443 {fHistKinkIndexFalse->Fill((v0->GetEffMass(4,2)));}
1444 else
1445 {fHistKinkIndexTrue->Fill((v0->GetEffMass(4,2)));}
1446 UInt_t status = posTrack->GetStatus();
1447 fHistPosTPCRefitMLa->Fill((status&AliESDtrack::kTPCrefit),(v0->GetEffMass(4,2)));
1448 status = negTrack->GetStatus();
1449 fHistNegTPCRefitMLa->Fill((status&AliESDtrack::kTPCrefit),(v0->GetEffMass(4,2)));
1450 }
1451
1452 fHistDCAV0Daughters->Fill(v0->GetDcaV0Daughters());
1453 fHistDecayLDCA->Fill(decayLength,v0->GetDcaV0Daughters());
1454
1455 fHistCosPA->Fill(v0->GetV0CosineOfPointingAngle(tPVPosition[0],tPVPosition[1],tPVPosition[2]));
1456 fHistDecayL->Fill(decayLength);
1457 fHistDecayLxy->Fill(sqrt((tV0Position[0]-tPVPosition[0])*(tV0Position[0]-tPVPosition[0])+(tV0Position[1]-tPVPosition[1])*(tV0Position[1]-tPVPosition[1])));
1458 fHistTauLa->Fill(cTauLa);
1459 if(lambdaCandidate)
1460 {
1461 fHistCosPAMLa->Fill(v0->GetV0CosineOfPointingAngle(tPVPosition[0],tPVPosition[1],tPVPosition[2]),(v0->GetEffMass(4,2)));
1462 fHistDecayLMLa->Fill(decayLength,(v0->GetEffMass(4,2)));
1463 fHistTauLaMLa->Fill(cTauLa,(v0->GetEffMass(4,2)));
1464 }
1465
1466
1467 {fHistBetheBlochTPCPos->Fill(TMath::Log10(pPos2),posTrack->GetTPCsignal()); }
1468 {fHistBetheBlochTPCNeg->Fill(TMath::Log10(pNeg2),negTrack->GetTPCsignal());}
1469
1470 fHistBetheBlochITSPos->Fill(TMath::Log10(pPos2),posTrack->GetITSsignal());
1471 fHistBetheBlochITSNeg->Fill(TMath::Log10(pNeg2),negTrack->GetITSsignal());
1472
1473 fHistImpactxyN->Fill(nImpactxy);
1474 fHistImpactzN->Fill(nImpactz);
1475 fHistImpactxyP->Fill(pImpactxy);
1476 fHistImpactzP->Fill(pImpactz);
1477
1478 if(lambdaCandidate)
1479 {
1480 fHistImpactxyMLa->Fill(nImpactxy,v0->GetEffMass(4,2));
1481 fHistImpactzMLa->Fill(nImpactz,v0->GetEffMass(4,2));
1482 }
1483 fHistImpactxyImpactz->Fill(nImpactxy,nImpactz);
1484
1485 fHistV0Z->Fill(tV0Position[2]);
1486 fHistZ->Fill(tV0Position[2]-tPVPosition[2]);
1487 fHistPtArmR->Fill(radius,v0->PtArmV0());
1488
1489 fHistRZ->Fill(tV0Position[2],radius);
1490 fHistPtV0Z->Fill(v0->Pt(),tV0Position[2]);
1491
1492 fHistPtArm->Fill(v0->AlphaV0(),v0->PtArmV0());
1493 fHistXZ->Fill(tV0Position[2],tV0Position[0]);
1494 fHistYZ->Fill(tV0Position[2],tV0Position[1]);
1495 fHistPtArmR->Fill(radius,v0->PtArmV0());
1496 fHistPtV0->Fill(v0->Pt());
1497
1498 //effective mass histograms
1499
1500 //sets assumed particle type of pos/neg daughters.
1501 // 0 = electron, 1 = Muon, 2 = pion, 3 = kaon, 4 = proton.
1502 int dPos = 0;
1503 int dNeg = 0;
1504
1505 // v0->ChangeMassHypothesis(kLambda0);
1506 dPos = 4;
1507 dNeg = 2;
1508 if(v0->GetEffMass(dPos,dNeg) > 1.11 && v0->GetEffMass(dPos,dNeg) < 1.13)
1509 {
1510 if(!(v0->GetOnFlyStatus()))
1511 {
1512 nLambda++;
1513 }
1514 }
1515 if(lambdaCandidate)
1516 {
1517 fHistMLa->Fill(v0->GetEffMass(dPos,dNeg));
1518 fHistMLaR->Fill(radius,v0->GetEffMass(dPos,dNeg));
1519 fHistMLaPtArm->Fill(v0->PtArmV0(),v0->GetEffMass(dPos,dNeg));
1520 fHistMLaPt->Fill(v0->Pt(),v0->GetEffMass(dPos,dNeg));
1521 }
1522
1523 // v0->ChangeMassHypothesis(kK0Short);
1524 dPos = 2;
1525 dNeg = 2;
1526 if(kshortCandidate)
1527 {
1528 fHistMK0->Fill(v0->GetEffMass(dPos,dNeg));
1529 fHistMK0R->Fill(radius,v0->GetEffMass(dPos,dNeg));
1530 fHistMK0PtArm->Fill(v0->PtArmV0(),v0->GetEffMass(dPos,dNeg));
1531 fHistMK0Pt->Fill(v0->Pt(),v0->GetEffMass(dPos,dNeg));
1532 }
1533 // v0->ChangeMassHypothesis(kLambda0Bar);
1534 dPos = 2;
1535 dNeg = 4;
1536 if(antilambdaCandidate)
1537 {
1538 fHistMLb->Fill(v0->GetEffMass(dPos,dNeg));
1539 fHistMLbR->Fill(radius,v0->GetEffMass(dPos,dNeg));
1540 fHistMLbPtArm->Fill(v0->PtArmV0(),v0->GetEffMass(dPos,dNeg));
1541 fHistMLbPt->Fill(v0->Pt(),v0->GetEffMass(dPos,dNeg));
1542 }
1543
1544 float binMin = 0.20;
1545 float binWidth = 0.35;
1546
1547 // v0->ChangeMassHypothesis(kLambda0);
1548
1549 if(lambdaCandidate)
1550 {
1551 dPos = 4;
1552 dNeg = 2;
1553 if((v0->Pt()) < binMin || (v0->Pt())>= (binMin + 10*binWidth))
1554 continue;
1555 else if((v0->Pt()) >= binMin && (v0->Pt())< (binMin + 1*binWidth))
1556 fHistMLa0->Fill(v0->GetEffMass(dPos,dNeg));
1557 else if((v0->Pt()) >= binMin && (v0->Pt())< (binMin + 2*binWidth))
1558 fHistMLa1->Fill(v0->GetEffMass(dPos,dNeg));
1559 else if((v0->Pt()) >= binMin && (v0->Pt())< (binMin + 3*binWidth))
1560 fHistMLa2->Fill(v0->GetEffMass(dPos,dNeg));
1561 else if((v0->Pt()) >= binMin && (v0->Pt())< (binMin + 4*binWidth))
1562 fHistMLa3->Fill(v0->GetEffMass(dPos,dNeg));
1563 else if((v0->Pt()) >= binMin && (v0->Pt())< (binMin + 5*binWidth))
1564 fHistMLa4->Fill(v0->GetEffMass(dPos,dNeg));
1565 else if((v0->Pt()) >= binMin && (v0->Pt())< (binMin + 6*binWidth))
1566 fHistMLa5->Fill(v0->GetEffMass(dPos,dNeg));
1567 else if((v0->Pt()) >= binMin && (v0->Pt())< (binMin + 7*binWidth))
1568 fHistMLa6->Fill(v0->GetEffMass(dPos,dNeg));
1569 else if((v0->Pt()) >= binMin && (v0->Pt())< (binMin + 8*binWidth))
1570 fHistMLa7->Fill(v0->GetEffMass(dPos,dNeg));
1571 else if((v0->Pt()) >= binMin && (v0->Pt())< (binMin + 9*binWidth))
1572 fHistMLa8->Fill(v0->GetEffMass(dPos,dNeg));
1573 else if((v0->Pt()) >= binMin && (v0->Pt())< (binMin + 10*binWidth))
1574 fHistMLa9->Fill(v0->GetEffMass(dPos,dNeg));
1575 }
1576 // v0->ChangeMassHypothesis(kLambda0Bar);
1577
1578 if(antilambdaCandidate)
1579 {
1580 dPos = 2;
1581 dNeg = 4;
1582 if((v0->Pt()) < binMin || (v0->Pt())>= (binMin + 10*binWidth))
1583 continue;
1584 else if((v0->Pt()) >= binMin && (v0->Pt())< (binMin + 1*binWidth))
1585 fHistMLb0->Fill(v0->GetEffMass(dPos,dNeg));
1586 else if((v0->Pt()) >= binMin && (v0->Pt())< (binMin + 2*binWidth))
1587 fHistMLb1->Fill(v0->GetEffMass(dPos,dNeg));
1588 else if((v0->Pt()) >= binMin && (v0->Pt())< (binMin + 3*binWidth))
1589 fHistMLb2->Fill(v0->GetEffMass(dPos,dNeg));
1590 else if((v0->Pt()) >= binMin && (v0->Pt())< (binMin + 4*binWidth))
1591 fHistMLb3->Fill(v0->GetEffMass(dPos,dNeg));
1592 else if((v0->Pt()) >= binMin && (v0->Pt())< (binMin + 5*binWidth))
1593 fHistMLb4->Fill(v0->GetEffMass(dPos,dNeg));
1594 else if((v0->Pt()) >= binMin && (v0->Pt())< (binMin + 6*binWidth))
1595 fHistMLb5->Fill(v0->GetEffMass(dPos,dNeg));
1596 else if((v0->Pt()) >= binMin && (v0->Pt())< (binMin + 7*binWidth))
1597 fHistMLb6->Fill(v0->GetEffMass(dPos,dNeg));
1598 else if((v0->Pt()) >= binMin && (v0->Pt())< (binMin + 8*binWidth))
1599 fHistMLb7->Fill(v0->GetEffMass(dPos,dNeg));
1600 else if((v0->Pt()) >= binMin && (v0->Pt())< (binMin + 9*binWidth))
1601 fHistMLb8->Fill(v0->GetEffMass(dPos,dNeg));
1602 else if((v0->Pt()) >= binMin && (v0->Pt())< (binMin + 10*binWidth))
1603 fHistMLb9->Fill(v0->GetEffMass(dPos,dNeg));
1604 }
1605
1606 if(kshortCandidate)
1607 {
1608 dPos = 2;
1609 dNeg = 2;
1610 if((v0->Pt()) < binMin || (v0->Pt())>= (binMin + 10*binWidth))
1611 continue;
1612 else if((v0->Pt()) >= binMin && (v0->Pt())< (binMin + 1*binWidth))
1613 fHistMK00->Fill(v0->GetEffMass(dPos,dNeg));
1614 else if((v0->Pt()) >= binMin && (v0->Pt())< (binMin + 2*binWidth))
1615 fHistMK01->Fill(v0->GetEffMass(dPos,dNeg));
1616 else if((v0->Pt()) >= binMin && (v0->Pt())< (binMin + 3*binWidth))
1617 fHistMK02->Fill(v0->GetEffMass(dPos,dNeg));
1618 else if((v0->Pt()) >= binMin && (v0->Pt())< (binMin + 4*binWidth))
1619 fHistMK03->Fill(v0->GetEffMass(dPos,dNeg));
1620 else if((v0->Pt()) >= binMin && (v0->Pt())< (binMin + 5*binWidth))
1621 fHistMK04->Fill(v0->GetEffMass(dPos,dNeg));
1622 else if((v0->Pt()) >= binMin && (v0->Pt())< (binMin + 6*binWidth))
1623 fHistMK05->Fill(v0->GetEffMass(dPos,dNeg));
1624 else if((v0->Pt()) >= binMin && (v0->Pt())< (binMin + 7*binWidth))
1625 fHistMK06->Fill(v0->GetEffMass(dPos,dNeg));
1626 else if((v0->Pt()) >= binMin && (v0->Pt())< (binMin + 8*binWidth))
1627 fHistMK07->Fill(v0->GetEffMass(dPos,dNeg));
1628 else if((v0->Pt()) >= binMin && (v0->Pt())< (binMin + 9*binWidth))
1629 fHistMK08->Fill(v0->GetEffMass(dPos,dNeg));
1630 else if((v0->Pt()) >= binMin && (v0->Pt())< (binMin + 10*binWidth))
1631 fHistMK09->Fill(v0->GetEffMass(dPos,dNeg));
1632 }
1633
1634 }
1635
1636 // track loop, runs over all tracks in event
1637 int nTracks = 0;
1638 for (Int_t iTrack=0; iTrack < fESD->GetNumberOfTracks(); iTrack++)
1639 {
1640
1641 AliESDtrack* track=fESD->GetTrack(iTrack);
1642 //Float_t xy=0;
1643 //Float_t z=0;
1644 //track->GetImpactParameters(xy,z);
1645 //&&(xy<1.0)&&(z<1.0))
1646 if ( !fTrackCuts->IsSelected(track))
1647 {continue;}
1648 if (cutEta != -999 && TMath::Abs(track->Eta()) > cutEta)
1649 {continue;}
1650
1651 nTracks += 1;
1652 fHistEta->Fill(track->Eta());
1653
1654 }
1655
1656 fHistPVZ->Fill(tPVPosition[2]);
1657 fHistNV0->Fill(nV0s);
1658 fHistNTracks->Fill(nTracks);
1659 fHistNV0sNTracks->Fill(nTracks*nTracks,nV0s);
1660 fHistdNV0sdT2->Fill( (1.0*nV0s)/(nTracks*nTracks));
1661 fHistMagneticField->Fill(fESD->GetMagneticField());
1662 fHistNLambda->Fill(nLambda);
1663
1664
1665 fHistLuke->Fill(3); // test histogram
1666 // NEW HISTO should be filled before this point, as PostData puts the
1667 // information for this iteration of the UserExec in the container
1668 PostData(1, fOutputList);
1669}
1670
1671
1672//________________________________________________________________________
1673void AliAnalysisTaskLukeV0::Terminate(Option_t *)
1674{
1675 // Draw result to screen, or perform fitting, normalizations
1676 // Called once at the end of the query
1677
1678 fOutputList = dynamic_cast<TList*> (GetOutputData(1));
1679 if(!fOutputList) { Printf("ERROR: could not retrieve TList fOutputList"); return; }
1680
1681 }