1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
16 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
18 // Modified version of AliAnalysisTaskCheckCascade.cxx.
19 // This is a 'hybrid' output version, in that it uses a classic TTree
20 // ROOT object to store the candidates, plus a couple of histograms filled on
21 // a per-event basis for storing variables too numerous to put in a tree.
24 // --- Algorithm Description
25 // 1. Loop over primaries in stack to acquire generated charged Xi
26 // 2. Loop over stack to find Cascades, fill TH3Fs "PrimRawPt"s for Efficiency
27 // 3. Perform Physics Selection
28 // 4. Perform Primary Vertex |z|<10cm selection
29 // 5. Perform Primary Vertex NoTPCOnly vertexing selection
30 // 6. Perform Pileup Rejection
32 // 7a. Fill TH3Fs "PrimAnalysisPt" for control purposes only
34 // Please Report Any Bugs!
36 // --- David Dobrigkeit Chinellato
37 // (david.chinellato@gmail.com)
39 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
45 //class AliMCEventHandler;
54 #include <Riostream.h>
60 #include "THnSparse.h"
67 #include "AliESDEvent.h"
68 #include "AliAODEvent.h"
69 #include "AliESDpid.h"
70 #include "AliESDtrack.h"
71 #include "AliESDtrackCuts.h"
72 #include "AliInputEventHandler.h"
73 #include "AliAnalysisManager.h"
74 #include "AliMCEventHandler.h"
75 #include "AliMCEvent.h"
78 #include "AliLightV0vertexer.h"
79 #include "AliLightCascadeVertexer.h"
81 #include "AliCFContainer.h"
82 #include "AliMultiplicity.h"
83 #include "AliAODMCParticle.h"
84 #include "AliESDcascade.h"
85 #include "AliAODcascade.h"
86 #include "AliESDUtils.h"
87 #include "AliGenEventHeader.h"
88 #include "AliAnalysisUtils.h"
90 #include "AliAnalysisTaskExtractCascade.h"
95 ClassImp(AliAnalysisTaskExtractCascade)
97 AliAnalysisTaskExtractCascade::AliAnalysisTaskExtractCascade()
98 : AliAnalysisTaskSE(), fListHist(0), fTreeCascade(0), fPIDResponse(0), fESDtrackCuts(0), fUtils(0),
99 fkIsNuclear ( kFALSE ),
100 fkSwitchINT7 ( kFALSE ),
101 fCentralityEstimator("V0M"),
102 fkpAVertexSelection( kFALSE ),
104 fkRunVertexers ( kFALSE ),
106 fkSelectCentrality (kFALSE),
110 //------------------------------------------------
112 //------------------------------------------------
114 fTreeCascVarCharge(0),
115 fTreeCascVarMassAsXi(0),
116 fTreeCascVarMassAsOmega(0),
119 fTreeCascVarRapMC(0),
120 fTreeCascVarRapXi(0),
121 fTreeCascVarRapOmega(0),
122 fTreeCascVarNegEta(0),
123 fTreeCascVarPosEta(0),
124 fTreeCascVarBachEta(0),
125 fTreeCascVarDCACascDaughters(0),
126 fTreeCascVarDCABachToPrimVtx(0),
127 fTreeCascVarDCAV0Daughters(0),
128 fTreeCascVarDCAV0ToPrimVtx(0),
129 fTreeCascVarDCAPosToPrimVtx(0),
130 fTreeCascVarDCANegToPrimVtx(0),
131 fTreeCascVarCascCosPointingAngle(0),
132 fTreeCascVarCascRadius(0),
133 fTreeCascVarV0Mass(0),
134 fTreeCascVarV0CosPointingAngle(0),
135 fTreeCascVarV0CosPointingAngleSpecial(0),
136 fTreeCascVarV0Radius(0),
137 fTreeCascVarLeastNbrClusters(0),
138 fTreeCascVarMultiplicity(0),
139 fTreeCascVarMultiplicityV0A(0),
140 fTreeCascVarMultiplicityZNA(0),
141 fTreeCascVarMultiplicityTRK(0),
142 fTreeCascVarMultiplicitySPD(0),
143 fTreeCascVarDistOverTotMom(0),
145 fTreeCascVarPIDBachelor(0),
146 fTreeCascVarPIDNegative(0),
147 fTreeCascVarPIDPositive(0),
148 fTreeCascVarBachTransMom(0),
149 fTreeCascVarPosTransMom(0),
150 fTreeCascVarNegTransMom(0),
151 fTreeCascVarPosTransMomMC(0),
152 fTreeCascVarNegTransMomMC(0),
153 fTreeCascVarNegNSigmaPion(0),
154 fTreeCascVarNegNSigmaProton(0),
155 fTreeCascVarPosNSigmaPion(0),
156 fTreeCascVarPosNSigmaProton(0),
157 fTreeCascVarBachNSigmaPion(0),
158 fTreeCascVarBachNSigmaKaon(0),
160 fTreeCascVarkITSRefitBachelor(0),
161 fTreeCascVarkITSRefitNegative(0),
162 fTreeCascVarkITSRefitPositive(0),
165 //Part A: EbyE info, Run number
166 fTreeCascVarRunNumber(0),
167 fTreeCascVarEventNumber(0),
169 //Part B: Shared Clusters
170 fTreeCascVarNegClusters(0),
171 fTreeCascVarPosClusters(0),
172 fTreeCascVarBachClusters(0),
173 fTreeCascVarNegSharedClusters(0),
174 fTreeCascVarPosSharedClusters(0),
175 fTreeCascVarBachSharedClusters(0),
177 //Part C: All momenta
178 fTreeCascVarNegPx(0),
179 fTreeCascVarNegPy(0),
180 fTreeCascVarNegPz(0),
181 fTreeCascVarPosPx(0),
182 fTreeCascVarPosPy(0),
183 fTreeCascVarPosPz(0),
184 fTreeCascVarBachPx(0),
185 fTreeCascVarBachPy(0),
186 fTreeCascVarBachPz(0),
188 fTreeCascVarV0DecayX(0),
189 fTreeCascVarV0DecayY(0),
190 fTreeCascVarV0DecayZ(0),
192 fTreeCascVarCascadeDecayX(0),
193 fTreeCascVarCascadeDecayY(0),
194 fTreeCascVarCascadeDecayZ(0),
196 fTreeCascVarBadCascadeJai(0),
197 fTreeCascVarDeltaDCA(0),
199 //------------------------------------------------
201 // --- Filled on an Event-by-event basis
202 //------------------------------------------------
203 fHistV0MultiplicityBeforeTrigSel(0),
204 fHistV0MultiplicityForTrigEvt(0),
205 fHistV0MultiplicityForSelEvt(0),
206 fHistV0MultiplicityForSelEvtNoTPCOnly(0),
207 fHistV0MultiplicityForSelEvtNoTPCOnlyNoPileup(0),
208 fHistMultiplicityBeforeTrigSel(0),
209 fHistMultiplicityForTrigEvt(0),
210 fHistMultiplicity(0),
211 fHistMultiplicityNoTPCOnly(0),
212 fHistMultiplicityNoTPCOnlyNoPileup(0),
215 fHistMultiplicityV0ABeforeTrigSel(0),
216 fHistMultiplicityV0AForTrigEvt(0),
217 fHistMultiplicityV0A(0),
218 fHistMultiplicityV0ANoTPCOnly(0),
219 fHistMultiplicityV0ANoTPCOnlyNoPileup(0),
222 fHistMultiplicityZNABeforeTrigSel(0),
223 fHistMultiplicityZNAForTrigEvt(0),
224 fHistMultiplicityZNA(0),
225 fHistMultiplicityZNANoTPCOnly(0),
226 fHistMultiplicityZNANoTPCOnlyNoPileup(0),
229 fHistMultiplicityTRKBeforeTrigSel(0),
230 fHistMultiplicityTRKForTrigEvt(0),
231 fHistMultiplicityTRK(0),
232 fHistMultiplicityTRKNoTPCOnly(0),
233 fHistMultiplicityTRKNoTPCOnlyNoPileup(0),
236 fHistMultiplicitySPDBeforeTrigSel(0),
237 fHistMultiplicitySPDForTrigEvt(0),
238 fHistMultiplicitySPD(0),
239 fHistMultiplicitySPDNoTPCOnly(0),
240 fHistMultiplicitySPDNoTPCOnlyNoPileup(0),
251 fkSuperLight(kFALSE),
253 fCut_CascRadius(0.6),
256 fCut_CascCosPA(0.97),
257 fCut_DCANegToPV(0.03),
258 fCut_DCAPosToPV(0.03),
259 fCut_DCABachToPV(0.04),
260 fCut_DCAV0Daughters(1.5),
261 fCut_DCACascDaughters(1.3),
262 fCut_DCAV0ToPV(0.06),
264 f2dHist_MassVsPt_XiMinus(0),
265 f2dHist_MassVsPt_XiPlus(0),
266 f2dHist_MassVsPt_OmegaMinus(0),
267 f2dHist_MassVsPt_OmegaPlus(0)
272 AliAnalysisTaskExtractCascade::AliAnalysisTaskExtractCascade(const char *name)
273 : AliAnalysisTaskSE(name), fListHist(0), fTreeCascade(0), fPIDResponse(0), fESDtrackCuts(0), fUtils(0),
274 fkIsNuclear ( kFALSE ),
275 fkSwitchINT7 ( kFALSE ),
276 fCentralityEstimator("V0M"),
277 fkpAVertexSelection( kFALSE ),
279 fkRunVertexers ( kFALSE ),
281 fkSelectCentrality (kFALSE),
285 //------------------------------------------------
287 //------------------------------------------------
289 fTreeCascVarCharge(0),
290 fTreeCascVarMassAsXi(0),
291 fTreeCascVarMassAsOmega(0),
294 fTreeCascVarRapMC(0),
295 fTreeCascVarRapXi(0),
296 fTreeCascVarRapOmega(0),
297 fTreeCascVarNegEta(0),
298 fTreeCascVarPosEta(0),
299 fTreeCascVarBachEta(0),
300 fTreeCascVarDCACascDaughters(0),
301 fTreeCascVarDCABachToPrimVtx(0),
302 fTreeCascVarDCAV0Daughters(0),
303 fTreeCascVarDCAV0ToPrimVtx(0),
304 fTreeCascVarDCAPosToPrimVtx(0),
305 fTreeCascVarDCANegToPrimVtx(0),
306 fTreeCascVarCascCosPointingAngle(0),
307 fTreeCascVarCascRadius(0),
308 fTreeCascVarV0Mass(0),
309 fTreeCascVarV0CosPointingAngle(0),
310 fTreeCascVarV0CosPointingAngleSpecial(0),
311 fTreeCascVarV0Radius(0),
312 fTreeCascVarLeastNbrClusters(0),
313 fTreeCascVarMultiplicity(0),
314 fTreeCascVarMultiplicityV0A(0),
315 fTreeCascVarMultiplicityZNA(0),
316 fTreeCascVarMultiplicityTRK(0),
317 fTreeCascVarMultiplicitySPD(0),
318 fTreeCascVarDistOverTotMom(0),
320 fTreeCascVarPIDBachelor(0),
321 fTreeCascVarPIDNegative(0),
322 fTreeCascVarPIDPositive(0),
323 fTreeCascVarBachTransMom(0),
324 fTreeCascVarPosTransMom(0),
325 fTreeCascVarNegTransMom(0),
326 fTreeCascVarPosTransMomMC(0),
327 fTreeCascVarNegTransMomMC(0),
328 fTreeCascVarNegNSigmaPion(0),
329 fTreeCascVarNegNSigmaProton(0),
330 fTreeCascVarPosNSigmaPion(0),
331 fTreeCascVarPosNSigmaProton(0),
332 fTreeCascVarBachNSigmaPion(0),
333 fTreeCascVarBachNSigmaKaon(0),
335 fTreeCascVarkITSRefitBachelor(0),
336 fTreeCascVarkITSRefitNegative(0),
337 fTreeCascVarkITSRefitPositive(0),
340 //Part A: EbyE info, Run number
341 fTreeCascVarRunNumber(0),
342 fTreeCascVarEventNumber(0),
344 //Part B: Shared Clusters
345 fTreeCascVarNegClusters(0),
346 fTreeCascVarPosClusters(0),
347 fTreeCascVarBachClusters(0),
348 fTreeCascVarNegSharedClusters(0),
349 fTreeCascVarPosSharedClusters(0),
350 fTreeCascVarBachSharedClusters(0),
352 //Part C: All momenta
353 fTreeCascVarNegPx(0),
354 fTreeCascVarNegPy(0),
355 fTreeCascVarNegPz(0),
356 fTreeCascVarPosPx(0),
357 fTreeCascVarPosPy(0),
358 fTreeCascVarPosPz(0),
359 fTreeCascVarBachPx(0),
360 fTreeCascVarBachPy(0),
361 fTreeCascVarBachPz(0),
363 fTreeCascVarV0DecayX(0),
364 fTreeCascVarV0DecayY(0),
365 fTreeCascVarV0DecayZ(0),
367 fTreeCascVarCascadeDecayX(0),
368 fTreeCascVarCascadeDecayY(0),
369 fTreeCascVarCascadeDecayZ(0),
371 fTreeCascVarBadCascadeJai(0),
372 fTreeCascVarDeltaDCA(0),
375 //------------------------------------------------
377 // --- Filled on an Event-by-event basis
378 //------------------------------------------------
379 fHistV0MultiplicityBeforeTrigSel(0),
380 fHistV0MultiplicityForTrigEvt(0),
381 fHistV0MultiplicityForSelEvt(0),
382 fHistV0MultiplicityForSelEvtNoTPCOnly(0),
383 fHistV0MultiplicityForSelEvtNoTPCOnlyNoPileup(0),
384 fHistMultiplicityBeforeTrigSel(0),
385 fHistMultiplicityForTrigEvt(0),
386 fHistMultiplicity(0),
387 fHistMultiplicityNoTPCOnly(0),
388 fHistMultiplicityNoTPCOnlyNoPileup(0),
391 fHistMultiplicityV0ABeforeTrigSel(0),
392 fHistMultiplicityV0AForTrigEvt(0),
393 fHistMultiplicityV0A(0),
394 fHistMultiplicityV0ANoTPCOnly(0),
395 fHistMultiplicityV0ANoTPCOnlyNoPileup(0),
398 fHistMultiplicityZNABeforeTrigSel(0),
399 fHistMultiplicityZNAForTrigEvt(0),
400 fHistMultiplicityZNA(0),
401 fHistMultiplicityZNANoTPCOnly(0),
402 fHistMultiplicityZNANoTPCOnlyNoPileup(0),
405 fHistMultiplicityTRKBeforeTrigSel(0),
406 fHistMultiplicityTRKForTrigEvt(0),
407 fHistMultiplicityTRK(0),
408 fHistMultiplicityTRKNoTPCOnly(0),
409 fHistMultiplicityTRKNoTPCOnlyNoPileup(0),
412 fHistMultiplicitySPDBeforeTrigSel(0),
413 fHistMultiplicitySPDForTrigEvt(0),
414 fHistMultiplicitySPD(0),
415 fHistMultiplicitySPDNoTPCOnly(0),
416 fHistMultiplicitySPDNoTPCOnlyNoPileup(0),
427 fkSuperLight(kFALSE),
429 fCut_CascRadius(0.6),
432 fCut_CascCosPA(0.97),
433 fCut_DCANegToPV(0.03),
434 fCut_DCAPosToPV(0.03),
435 fCut_DCABachToPV(0.04),
436 fCut_DCAV0Daughters(1.5),
437 fCut_DCACascDaughters(1.3),
438 fCut_DCAV0ToPV(0.06),
440 f2dHist_MassVsPt_XiMinus(0),
441 f2dHist_MassVsPt_XiPlus(0),
442 f2dHist_MassVsPt_OmegaMinus(0),
443 f2dHist_MassVsPt_OmegaPlus(0)
448 //Set Variables for re-running the cascade vertexers (as done for MS paper)
450 // New Loose : 1st step for the 7 TeV pp analysis
452 fV0VertexerSels[0] = 33. ; // max allowed chi2
453 fV0VertexerSels[1] = 0.02; // min allowed impact parameter for the 1st daughter (LHC09a4 : 0.05)
454 fV0VertexerSels[2] = 0.02; // min allowed impact parameter for the 2nd daughter (LHC09a4 : 0.05)
455 fV0VertexerSels[3] = 2.0 ; // max allowed DCA between the daughter tracks (LHC09a4 : 0.5)
456 fV0VertexerSels[4] = 0.95; // min allowed cosine of V0's pointing angle (LHC09a4 : 0.99)
457 fV0VertexerSels[5] = 1.0 ; // min radius of the fiducial volume (LHC09a4 : 0.2)
458 fV0VertexerSels[6] = 200. ; // max radius of the fiducial volume (LHC09a4 : 100.0)
460 fCascadeVertexerSels[0] = 33. ; // max allowed chi2 (same as PDC07)
461 fCascadeVertexerSels[1] = 0.05 ; // min allowed V0 impact parameter (PDC07 : 0.05 / LHC09a4 : 0.025 )
462 fCascadeVertexerSels[2] = 0.010; // "window" around the Lambda mass (PDC07 : 0.008 / LHC09a4 : 0.010 )
463 fCascadeVertexerSels[3] = 0.03 ; // min allowed bachelor's impact parameter (PDC07 : 0.035 / LHC09a4 : 0.025 )
464 fCascadeVertexerSels[4] = 2.0 ; // max allowed DCA between the V0 and the bachelor (PDC07 : 0.1 / LHC09a4 : 0.2 )
465 fCascadeVertexerSels[5] = 0.95 ; // min allowed cosine of the cascade pointing angle (PDC07 : 0.9985 / LHC09a4 : 0.998 )
466 fCascadeVertexerSels[6] = 0.4 ; // min radius of the fiducial volume (PDC07 : 0.9 / LHC09a4 : 0.2 )
467 fCascadeVertexerSels[7] = 100. ; // max radius of the fiducial volume (PDC07 : 100 / LHC09a4 : 100 )
469 // Output slot #0 writes into a TList container (Cascade)
470 DefineOutput(1, TList::Class());
471 DefineOutput(2, TTree::Class());
475 AliAnalysisTaskExtractCascade::~AliAnalysisTaskExtractCascade()
477 //------------------------------------------------
479 //------------------------------------------------
489 //cleanup esd track cuts object too...
491 delete fESDtrackCuts;
501 //________________________________________________________________________
502 void AliAnalysisTaskExtractCascade::UserCreateOutputObjects()
507 //------------------------------------------------
509 fTreeCascade = new TTree("fTreeCascade","CascadeCandidates");
511 //------------------------------------------------
512 // fTreeCascade Branch definitions - Cascade Tree
513 //------------------------------------------------
515 //------------------------------------------------
516 // fTreeCascade Branch definitions
517 //------------------------------------------------
519 //-----------BASIC-INFO---------------------------
520 /* 1*/ fTreeCascade->Branch("fTreeCascVarCharge",&fTreeCascVarCharge,"fTreeCascVarCharge/I");
521 /* 2*/ fTreeCascade->Branch("fTreeCascVarMassAsXi",&fTreeCascVarMassAsXi,"fTreeCascVarMassAsXi/F");
522 /* 3*/ fTreeCascade->Branch("fTreeCascVarMassAsOmega",&fTreeCascVarMassAsOmega,"fTreeCascVarMassAsOmega/F");
523 /* 4*/ fTreeCascade->Branch("fTreeCascVarPt",&fTreeCascVarPt,"fTreeCascVarPt/F");
524 /* 5*/ fTreeCascade->Branch("fTreeCascVarRapXi",&fTreeCascVarRapXi,"fTreeCascVarRapXi/F");
525 /* 6*/ fTreeCascade->Branch("fTreeCascVarRapOmega",&fTreeCascVarRapOmega,"fTreeCascVarRapOmega/F");
526 /* 7*/ fTreeCascade->Branch("fTreeCascVarNegEta",&fTreeCascVarNegEta,"fTreeCascVarNegEta/F");
527 /* 8*/ fTreeCascade->Branch("fTreeCascVarPosEta",&fTreeCascVarPosEta,"fTreeCascVarPosEta/F");
528 /* 9*/ fTreeCascade->Branch("fTreeCascVarBachEta",&fTreeCascVarBachEta,"fTreeCascVarBachEta/F");
529 //-----------INFO-FOR-CUTS------------------------
530 /*10*/ fTreeCascade->Branch("fTreeCascVarDCACascDaughters",&fTreeCascVarDCACascDaughters,"fTreeCascVarDCACascDaughters/F");
531 /*11*/ fTreeCascade->Branch("fTreeCascVarDCABachToPrimVtx",&fTreeCascVarDCABachToPrimVtx,"fTreeCascVarDCABachToPrimVtx/F");
532 /*12*/ fTreeCascade->Branch("fTreeCascVarDCAV0Daughters",&fTreeCascVarDCAV0Daughters,"fTreeCascVarDCAV0Daughters/F");
533 /*13*/ fTreeCascade->Branch("fTreeCascVarDCAV0ToPrimVtx",&fTreeCascVarDCAV0ToPrimVtx,"fTreeCascVarDCAV0ToPrimVtx/F");
534 /*14*/ fTreeCascade->Branch("fTreeCascVarDCAPosToPrimVtx",&fTreeCascVarDCAPosToPrimVtx,"fTreeCascVarDCAPosToPrimVtx/F");
535 /*15*/ fTreeCascade->Branch("fTreeCascVarDCANegToPrimVtx",&fTreeCascVarDCANegToPrimVtx,"fTreeCascVarDCANegToPrimVtx/F");
536 /*16*/ fTreeCascade->Branch("fTreeCascVarCascCosPointingAngle",&fTreeCascVarCascCosPointingAngle,"fTreeCascVarCascCosPointingAngle/F");
537 /*17*/ fTreeCascade->Branch("fTreeCascVarCascRadius",&fTreeCascVarCascRadius,"fTreeCascVarCascRadius/F");
538 /*18*/ fTreeCascade->Branch("fTreeCascVarV0Mass",&fTreeCascVarV0Mass,"fTreeCascVarV0Mass/F");
539 /*19*/ fTreeCascade->Branch("fTreeCascVarV0CosPointingAngle",&fTreeCascVarV0CosPointingAngle,"fTreeCascVarV0CosPointingAngle/F");
540 /*19*/ fTreeCascade->Branch("fTreeCascVarV0CosPointingAngleSpecial",&fTreeCascVarV0CosPointingAngleSpecial,"fTreeCascVarV0CosPointingAngleSpecial/F");
541 /*20*/ fTreeCascade->Branch("fTreeCascVarV0Radius",&fTreeCascVarV0Radius,"fTreeCascVarV0Radius/F");
542 /*21*/ fTreeCascade->Branch("fTreeCascVarLeastNbrClusters",&fTreeCascVarLeastNbrClusters,"fTreeCascVarLeastNbrClusters/I");
543 //-----------MULTIPLICITY-INFO--------------------
544 /*22*/ fTreeCascade->Branch("fTreeCascVarMultiplicity",&fTreeCascVarMultiplicity,"fTreeCascVarMultiplicity/I");
545 /*22*/ fTreeCascade->Branch("fTreeCascVarMultiplicityV0A",&fTreeCascVarMultiplicityV0A,"fTreeCascVarMultiplicityV0A/I");
546 /*22*/ fTreeCascade->Branch("fTreeCascVarMultiplicityZNA",&fTreeCascVarMultiplicityZNA,"fTreeCascVarMultiplicityZNA/I");
547 /*22*/ fTreeCascade->Branch("fTreeCascVarMultiplicityTRK",&fTreeCascVarMultiplicityTRK,"fTreeCascVarMultiplicityTRK/I");
548 /*22*/ fTreeCascade->Branch("fTreeCascVarMultiplicitySPD",&fTreeCascVarMultiplicitySPD,"fTreeCascVarMultiplicitySPD/I");
549 //-----------DECAY-LENGTH-INFO--------------------
550 /*23*/ fTreeCascade->Branch("fTreeCascVarDistOverTotMom",&fTreeCascVarDistOverTotMom,"fTreeCascVarDistOverTotMom/F");
551 //------------------------------------------------
552 /*24*/ fTreeCascade->Branch("fTreeCascVarNegNSigmaPion",&fTreeCascVarNegNSigmaPion,"fTreeCascVarNegNSigmaPion/F");
553 /*25*/ fTreeCascade->Branch("fTreeCascVarNegNSigmaProton",&fTreeCascVarNegNSigmaProton,"fTreeCascVarNegNSigmaProton/F");
554 /*26*/ fTreeCascade->Branch("fTreeCascVarPosNSigmaPion",&fTreeCascVarPosNSigmaPion,"fTreeCascVarPosNSigmaPion/F");
555 /*27*/ fTreeCascade->Branch("fTreeCascVarPosNSigmaProton",&fTreeCascVarPosNSigmaProton,"fTreeCascVarPosNSigmaProton/F");
556 /*28*/ fTreeCascade->Branch("fTreeCascVarBachNSigmaPion",&fTreeCascVarBachNSigmaPion,"fTreeCascVarBachNSigmaPion/F");
557 /*29*/ fTreeCascade->Branch("fTreeCascVarBachNSigmaKaon",&fTreeCascVarBachNSigmaKaon,"fTreeCascVarBachNSigmaKaon/F");
559 //Commented out: not needed since all momenta provided! (less info)
560 /*30*/ //fTreeCascade->Branch("fTreeCascVarBachTransMom",&fTreeCascVarBachTransMom,"fTreeCascVarBachTransMom/F");
561 /*30*/ //fTreeCascade->Branch("fTreeCascVarPosTransMom",&fTreeCascVarPosTransMom,"fTreeCascVarPosTransMom/F");
562 /*31*/ //fTreeCascade->Branch("fTreeCascVarNegTransMom",&fTreeCascVarNegTransMom,"fTreeCascVarNegTransMom/F");
564 /*29*/ fTreeCascade->Branch("fTreeCascVarkITSRefitBachelor",&fTreeCascVarkITSRefitBachelor,"fTreeCascVarkITSRefitBachelor/O");
565 /*29*/ fTreeCascade->Branch("fTreeCascVarkITSRefitNegative",&fTreeCascVarkITSRefitNegative,"fTreeCascVarkITSRefitNegative/O");
566 /*29*/ fTreeCascade->Branch("fTreeCascVarkITSRefitPositive",&fTreeCascVarkITSRefitPositive,"fTreeCascVarkITSRefitPositive/O");
568 //-----------Debugging information----------------
571 //Only save this if requested - can be turned off
573 //Part A: Event-by-event, run-by-run debugging
574 fTreeCascade->Branch("fTreeCascVarRunNumber",&fTreeCascVarRunNumber,"fTreeCascVarRunNumber/I");
575 fTreeCascade->Branch("fTreeCascVarEventNumber",&fTreeCascVarEventNumber,"fTreeCascVarEventNumber/l");
577 //Part B: Shared Clusters for all daughter tracks
578 fTreeCascade->Branch("fTreeCascVarNegClusters",&fTreeCascVarNegClusters,"fTreeCascVarNegClusters/I");
579 fTreeCascade->Branch("fTreeCascVarPosClusters",&fTreeCascVarPosClusters,"fTreeCascVarPosClusters/I");
580 fTreeCascade->Branch("fTreeCascVarBachClusters",&fTreeCascVarBachClusters,"fTreeCascVarBachClusters/I");
581 fTreeCascade->Branch("fTreeCascVarNegSharedClusters",&fTreeCascVarNegSharedClusters,"fTreeCascVarNegSharedClusters/I");
582 fTreeCascade->Branch("fTreeCascVarPosSharedClusters",&fTreeCascVarPosSharedClusters,"fTreeCascVarPosSharedClusters/I");
583 fTreeCascade->Branch("fTreeCascVarBachSharedClusters",&fTreeCascVarBachSharedClusters,"fTreeCascVarBachSharedClusters/I");
585 //Part C: All Momenta of all daughters
586 fTreeCascade->Branch("fTreeCascVarNegPx",&fTreeCascVarNegPx,"fTreeCascVarNegPx/F");
587 fTreeCascade->Branch("fTreeCascVarNegPy",&fTreeCascVarNegPy,"fTreeCascVarNegPy/F");
588 fTreeCascade->Branch("fTreeCascVarNegPz",&fTreeCascVarNegPz,"fTreeCascVarNegPz/F");
589 fTreeCascade->Branch("fTreeCascVarPosPx",&fTreeCascVarPosPx,"fTreeCascVarPosPx/F");
590 fTreeCascade->Branch("fTreeCascVarPosPy",&fTreeCascVarPosPy,"fTreeCascVarPosPy/F");
591 fTreeCascade->Branch("fTreeCascVarPosPz",&fTreeCascVarPosPz,"fTreeCascVarPosPz/F");
592 fTreeCascade->Branch("fTreeCascVarBachPx",&fTreeCascVarBachPx,"fTreeCascVarBachPx/F");
593 fTreeCascade->Branch("fTreeCascVarBachPy",&fTreeCascVarBachPy,"fTreeCascVarBachPy/F");
594 fTreeCascade->Branch("fTreeCascVarBachPz",&fTreeCascVarBachPz,"fTreeCascVarBachPz/F");
596 //Part D: Decay positions
597 fTreeCascade->Branch("fTreeCascVarV0DecayX",&fTreeCascVarV0DecayX,"fTreeCascVarV0DecayX/F");
598 fTreeCascade->Branch("fTreeCascVarV0DecayY",&fTreeCascVarV0DecayY,"fTreeCascVarV0DecayY/F");
599 fTreeCascade->Branch("fTreeCascVarV0DecayZ",&fTreeCascVarV0DecayZ,"fTreeCascVarV0DecayZ/F");
600 fTreeCascade->Branch("fTreeCascVarCascadeDecayX",&fTreeCascVarCascadeDecayX,"fTreeCascVarCascadeDecayX/F");
601 fTreeCascade->Branch("fTreeCascVarCascadeDecayY",&fTreeCascVarCascadeDecayY,"fTreeCascVarCascadeDecayY/F");
602 fTreeCascade->Branch("fTreeCascVarCascadeDecayZ",&fTreeCascVarCascadeDecayZ,"fTreeCascVarCascadeDecayZ/F");
604 fTreeCascade->Branch("fTreeCascVarBadCascadeJai",&fTreeCascVarBadCascadeJai,"fTreeCascVarBadCascadeJai/O");
605 fTreeCascade->Branch("fTreeCascVarDeltaDCA",&fTreeCascVarDeltaDCA,"fTreeCascVarDeltaDCA/F");
606 //------------------------------------------------
609 //------------------------------------------------
610 // Particle Identification Setup
611 //------------------------------------------------
613 AliAnalysisManager *man=AliAnalysisManager::GetAnalysisManager();
614 AliInputEventHandler* inputHandler = (AliInputEventHandler*) (man->GetInputEventHandler());
615 fPIDResponse = inputHandler->GetPIDResponse();
619 if(! fESDtrackCuts ){
620 fESDtrackCuts = new AliESDtrackCuts();
623 fUtils = new AliAnalysisUtils();
626 //------------------------------------------------
627 // V0 Multiplicity Histograms
628 //------------------------------------------------
632 fListHist = new TList();
633 fListHist->SetOwner(); // See http://root.cern.ch/root/html/TCollection.html#TCollection:SetOwner
636 if(! fHistV0MultiplicityBeforeTrigSel) {
637 fHistV0MultiplicityBeforeTrigSel = new TH1F("fHistV0MultiplicityBeforeTrigSel",
638 "V0s per event (before Trig. Sel.);Nbr of V0s/Evt;Events",
640 fListHist->Add(fHistV0MultiplicityBeforeTrigSel);
643 if(! fHistV0MultiplicityForTrigEvt) {
644 fHistV0MultiplicityForTrigEvt = new TH1F("fHistV0MultiplicityForTrigEvt",
645 "V0s per event (for triggered evt);Nbr of V0s/Evt;Events",
647 fListHist->Add(fHistV0MultiplicityForTrigEvt);
650 if(! fHistV0MultiplicityForSelEvt) {
651 fHistV0MultiplicityForSelEvt = new TH1F("fHistV0MultiplicityForSelEvt",
652 "V0s per event;Nbr of V0s/Evt;Events",
654 fListHist->Add(fHistV0MultiplicityForSelEvt);
657 if(! fHistV0MultiplicityForSelEvtNoTPCOnly) {
658 fHistV0MultiplicityForSelEvtNoTPCOnly = new TH1F("fHistV0MultiplicityForSelEvtNoTPCOnly",
659 "V0s per event;Nbr of V0s/Evt;Events",
661 fListHist->Add(fHistV0MultiplicityForSelEvtNoTPCOnly);
663 if(! fHistV0MultiplicityForSelEvtNoTPCOnlyNoPileup) {
664 fHistV0MultiplicityForSelEvtNoTPCOnlyNoPileup = new TH1F("fHistV0MultiplicityForSelEvtNoTPCOnlyNoPileup",
665 "V0s per event;Nbr of V0s/Evt;Events",
667 fListHist->Add(fHistV0MultiplicityForSelEvtNoTPCOnlyNoPileup);
670 //------------------------------------------------
671 // Track Multiplicity Histograms
672 //------------------------------------------------
674 if(! fHistMultiplicityBeforeTrigSel) {
675 fHistMultiplicityBeforeTrigSel = new TH1F("fHistMultiplicityBeforeTrigSel",
676 "Tracks per event;Nbr of Tracks;Events",
678 fListHist->Add(fHistMultiplicityBeforeTrigSel);
680 if(! fHistMultiplicityForTrigEvt) {
681 fHistMultiplicityForTrigEvt = new TH1F("fHistMultiplicityForTrigEvt",
682 "Tracks per event;Nbr of Tracks;Events",
684 fListHist->Add(fHistMultiplicityForTrigEvt);
686 if(! fHistMultiplicity) {
687 fHistMultiplicity = new TH1F("fHistMultiplicity",
688 "Tracks per event;Nbr of Tracks;Events",
690 fListHist->Add(fHistMultiplicity);
692 if(! fHistMultiplicityNoTPCOnly) {
693 fHistMultiplicityNoTPCOnly = new TH1F("fHistMultiplicityNoTPCOnly",
694 "Tracks per event;Nbr of Tracks;Events",
696 fListHist->Add(fHistMultiplicityNoTPCOnly);
698 if(! fHistMultiplicityNoTPCOnlyNoPileup) {
699 fHistMultiplicityNoTPCOnlyNoPileup = new TH1F("fHistMultiplicityNoTPCOnlyNoPileup",
700 "Tracks per event;Nbr of Tracks;Events",
702 fListHist->Add(fHistMultiplicityNoTPCOnlyNoPileup);
706 //V0A Centrality (if PbPb / pPb)
707 if(! fHistMultiplicityV0ABeforeTrigSel) {
708 fHistMultiplicityV0ABeforeTrigSel = new TH1F("fHistMultiplicityV0ABeforeTrigSel",
709 "Centrality Distribution: V0A;V0A Centrality;Events",
711 fListHist->Add(fHistMultiplicityV0ABeforeTrigSel);
713 if(! fHistMultiplicityV0AForTrigEvt) {
714 fHistMultiplicityV0AForTrigEvt = new TH1F("fHistMultiplicityV0AForTrigEvt",
715 "Centrality Distribution: V0A;V0A Centrality;Events",
717 fListHist->Add(fHistMultiplicityV0AForTrigEvt);
719 if(! fHistMultiplicityV0A) {
720 fHistMultiplicityV0A = new TH1F("fHistMultiplicityV0A",
721 "Centrality Distribution: V0A;V0A Centrality;Events",
723 fListHist->Add(fHistMultiplicityV0A);
725 if(! fHistMultiplicityV0ANoTPCOnly) {
726 fHistMultiplicityV0ANoTPCOnly = new TH1F("fHistMultiplicityV0ANoTPCOnly",
727 "Centrality Distribution: V0A;V0A Centrality;Events",
729 fListHist->Add(fHistMultiplicityV0ANoTPCOnly);
731 if(! fHistMultiplicityV0ANoTPCOnlyNoPileup) {
732 fHistMultiplicityV0ANoTPCOnlyNoPileup = new TH1F("fHistMultiplicityV0ANoTPCOnlyNoPileup",
733 "Centrality Distribution: V0A;V0A Centrality;Events",
735 fListHist->Add(fHistMultiplicityV0ANoTPCOnlyNoPileup);
738 //ZNA Centrality (if PbPb / pPb)
739 if(! fHistMultiplicityZNABeforeTrigSel) {
740 fHistMultiplicityZNABeforeTrigSel = new TH1F("fHistMultiplicityZNABeforeTrigSel",
741 "Centrality Distribution: ZNA;ZNA Centrality;Events",
743 fListHist->Add(fHistMultiplicityZNABeforeTrigSel);
745 if(! fHistMultiplicityZNAForTrigEvt) {
746 fHistMultiplicityZNAForTrigEvt = new TH1F("fHistMultiplicityZNAForTrigEvt",
747 "Centrality Distribution: ZNA;ZNA Centrality;Events",
749 fListHist->Add(fHistMultiplicityZNAForTrigEvt);
751 if(! fHistMultiplicityZNA) {
752 fHistMultiplicityZNA = new TH1F("fHistMultiplicityZNA",
753 "Centrality Distribution: ZNA;ZNA Centrality;Events",
755 fListHist->Add(fHistMultiplicityZNA);
757 if(! fHistMultiplicityZNANoTPCOnly) {
758 fHistMultiplicityZNANoTPCOnly = new TH1F("fHistMultiplicityZNANoTPCOnly",
759 "Centrality Distribution: ZNA;ZNA Centrality;Events",
761 fListHist->Add(fHistMultiplicityZNANoTPCOnly);
763 if(! fHistMultiplicityZNANoTPCOnlyNoPileup) {
764 fHistMultiplicityZNANoTPCOnlyNoPileup = new TH1F("fHistMultiplicityZNANoTPCOnlyNoPileup",
765 "Centrality Distribution: ZNA;ZNA Centrality;Events",
767 fListHist->Add(fHistMultiplicityZNANoTPCOnlyNoPileup);
770 //TRK Centrality (if PbPb / pPb)
771 if(! fHistMultiplicityTRKBeforeTrigSel) {
772 fHistMultiplicityTRKBeforeTrigSel = new TH1F("fHistMultiplicityTRKBeforeTrigSel",
773 "Centrality Distribution: TRK;TRK Centrality;Events",
775 fListHist->Add(fHistMultiplicityTRKBeforeTrigSel);
777 if(! fHistMultiplicityTRKForTrigEvt) {
778 fHistMultiplicityTRKForTrigEvt = new TH1F("fHistMultiplicityTRKForTrigEvt",
779 "Centrality Distribution: TRK;TRK Centrality;Events",
781 fListHist->Add(fHistMultiplicityTRKForTrigEvt);
783 if(! fHistMultiplicityTRK) {
784 fHistMultiplicityTRK = new TH1F("fHistMultiplicityTRK",
785 "Centrality Distribution: TRK;TRK Centrality;Events",
787 fListHist->Add(fHistMultiplicityTRK);
789 if(! fHistMultiplicityTRKNoTPCOnly) {
790 fHistMultiplicityTRKNoTPCOnly = new TH1F("fHistMultiplicityTRKNoTPCOnly",
791 "Centrality Distribution: TRK;TRK Centrality;Events",
793 fListHist->Add(fHistMultiplicityTRKNoTPCOnly);
795 if(! fHistMultiplicityTRKNoTPCOnlyNoPileup) {
796 fHistMultiplicityTRKNoTPCOnlyNoPileup = new TH1F("fHistMultiplicityTRKNoTPCOnlyNoPileup",
797 "Centrality Distribution: TRK;TRK Centrality;Events",
799 fListHist->Add(fHistMultiplicityTRKNoTPCOnlyNoPileup);
802 //SPD Centrality (if PbPb / pPb)
803 if(! fHistMultiplicitySPDBeforeTrigSel) {
804 fHistMultiplicitySPDBeforeTrigSel = new TH1F("fHistMultiplicitySPDBeforeTrigSel",
805 "Centrality Distribution: SPD;SPD Centrality;Events",
807 fListHist->Add(fHistMultiplicitySPDBeforeTrigSel);
809 if(! fHistMultiplicitySPDForTrigEvt) {
810 fHistMultiplicitySPDForTrigEvt = new TH1F("fHistMultiplicitySPDForTrigEvt",
811 "Centrality Distribution: SPD;SPD Centrality;Events",
813 fListHist->Add(fHistMultiplicitySPDForTrigEvt);
815 if(! fHistMultiplicitySPD) {
816 fHistMultiplicitySPD = new TH1F("fHistMultiplicitySPD",
817 "Centrality Distribution: SPD;SPD Centrality;Events",
819 fListHist->Add(fHistMultiplicitySPD);
821 if(! fHistMultiplicitySPDNoTPCOnly) {
822 fHistMultiplicitySPDNoTPCOnly = new TH1F("fHistMultiplicitySPDNoTPCOnly",
823 "Centrality Distribution: SPD;SPD Centrality;Events",
825 fListHist->Add(fHistMultiplicitySPDNoTPCOnly);
827 if(! fHistMultiplicitySPDNoTPCOnlyNoPileup) {
828 fHistMultiplicitySPDNoTPCOnlyNoPileup = new TH1F("fHistMultiplicitySPDNoTPCOnlyNoPileup",
829 "Centrality Distribution: SPD;SPD Centrality;Events",
831 fListHist->Add(fHistMultiplicitySPDNoTPCOnlyNoPileup);
835 //----------------------------------
836 // Primary Vertex Position Histos
837 //----------------------------------
840 fHistPVx = new TH1F("fHistPVx",
841 "PV x position;Nbr of Evts;x",
843 fListHist->Add(fHistPVx);
846 fHistPVy = new TH1F("fHistPVy",
847 "PV y position;Nbr of Evts;y",
849 fListHist->Add(fHistPVy);
852 fHistPVz = new TH1F("fHistPVz",
853 "PV z position;Nbr of Evts;z",
855 fListHist->Add(fHistPVz);
858 if(! fHistPVxAnalysis) {
859 fHistPVxAnalysis = new TH1F("fHistPVxAnalysis",
860 "PV x position;Nbr of Evts;x",
862 fListHist->Add(fHistPVxAnalysis);
864 if(! fHistPVyAnalysis) {
865 fHistPVyAnalysis = new TH1F("fHistPVyAnalysis",
866 "PV y position;Nbr of Evts;y",
868 fListHist->Add(fHistPVyAnalysis);
870 if(! fHistPVzAnalysis) {
871 fHistPVzAnalysis = new TH1F("fHistPVzAnalysis",
872 "PV z position;Nbr of Evts;z",
874 fListHist->Add(fHistPVzAnalysis);
877 //Superlight analysis output for cross-checking
878 if(! f2dHist_MassVsPt_XiMinus) {
879 f2dHist_MassVsPt_XiMinus = new TH2F("f2dHist_MassVsPt_XiMinus","",
880 800,1.321-0.100,1.321+0.100,
882 fListHist->Add(f2dHist_MassVsPt_XiMinus);
884 if(! f2dHist_MassVsPt_XiPlus) {
885 f2dHist_MassVsPt_XiPlus = new TH2F("f2dHist_MassVsPt_XiPlus","",
886 800,1.321-0.100,1.321+0.100,
888 fListHist->Add(f2dHist_MassVsPt_XiPlus);
890 if(! f2dHist_MassVsPt_OmegaMinus) {
891 f2dHist_MassVsPt_OmegaMinus = new TH2F("f2dHist_MassVsPt_OmegaMinus","",
892 800,1.672-0.100,1.672+0.100,
894 fListHist->Add(f2dHist_MassVsPt_OmegaMinus);
896 if(! f2dHist_MassVsPt_OmegaPlus) {
897 f2dHist_MassVsPt_OmegaPlus = new TH2F("f2dHist_MassVsPt_OmegaPlus","",
898 800,1.672-0.100,1.672+0.100,
900 fListHist->Add(f2dHist_MassVsPt_OmegaPlus);
903 //List of Histograms: Normal
904 PostData(1, fListHist);
906 //TTree Object: Saved to base directory. Should cache to disk while saving.
907 //(Important to avoid excessive memory usage, particularly when merging)
908 PostData(2, fTreeCascade);
910 }// end UserCreateOutputObjects
913 //________________________________________________________________________
914 void AliAnalysisTaskExtractCascade::UserExec(Option_t *)
917 // Called for each event
919 AliESDEvent *lESDevent = 0x0;
921 Int_t lNumberOfV0s = -1;
922 Double_t lTrkgPrimaryVtxPos[3] = {-100.0, -100.0, -100.0};
923 Double_t lBestPrimaryVtxPos[3] = {-100.0, -100.0, -100.0};
924 Double_t lMagneticField = -10.;
926 // Connect to the InputEvent
927 // After these lines, we should have an ESD/AOD event + the number of V0s in it.
929 // Appropriate for ESD analysis!
931 lESDevent = dynamic_cast<AliESDEvent*>( InputEvent() );
933 AliWarning("ERROR: lESDevent not available \n");
937 //--- Acquisition of exact event ID
938 fTreeCascVarRunNumber = lESDevent->GetRunNumber();
939 fTreeCascVarEventNumber =
940 ( ( ((ULong64_t)lESDevent->GetPeriodNumber() ) << 36 ) |
941 ( ((ULong64_t)lESDevent->GetOrbitNumber () ) << 12 ) |
942 ((ULong64_t)lESDevent->GetBunchCrossNumber() ) );
945 //------------------------------------------------
946 // Multiplicity Information Acquistion
947 //------------------------------------------------
949 //REVISED multiplicity estimator after 'multiplicity day' (2011)
950 Int_t lMultiplicity = -100;
951 Int_t lMultiplicityV0A = -100;
952 Int_t lMultiplicityZNA = -100;
953 Int_t lMultiplicityTRK = -100;
954 Int_t lMultiplicitySPD = -100;
957 if(fkIsNuclear == kFALSE) lMultiplicity = fESDtrackCuts->GetReferenceMultiplicity(lESDevent, AliESDtrackCuts::kTrackletsITSTPC, fEtaRefMult );
959 //---> If this is a nuclear collision, then go nuclear on "multiplicity" variable...
960 //---> Warning: Experimental
961 if(fkIsNuclear == kTRUE){
962 AliCentrality* centrality;
963 centrality = lESDevent->GetCentrality();
964 lMultiplicity = ( ( Int_t ) ( centrality->GetCentralityPercentile( fCentralityEstimator.Data() ) ) );
965 lMultiplicityV0A = ( ( Int_t ) ( centrality->GetCentralityPercentile( "V0A" ) ) );
966 lMultiplicityZNA = ( ( Int_t ) ( centrality->GetCentralityPercentile( "ZNA" ) ) );
967 lMultiplicityTRK = ( ( Int_t ) ( centrality->GetCentralityPercentile( "TRK" ) ) );
968 lMultiplicitySPD = ( ( Int_t ) ( centrality->GetCentralityPercentile( "CL1" ) ) );
969 if (centrality->GetQuality()>1) {
970 PostData(1, fListHist);
971 PostData(2, fTreeCascade);
976 if( fkSelectCentrality ){
977 if( lMultiplicity < fCentSel_Low || lMultiplicity >= fCentSel_High ){
978 //Event is outside desired centrality centrality in V0M!
979 PostData(1, fListHist);
980 PostData(2, fTreeCascade);
985 //Set variable for filling tree afterwards!
986 //---> pp case......: GetReferenceMultiplicity
987 //---> Pb-Pb case...: Centrality by V0M
989 fTreeCascVarMultiplicity = lMultiplicity;
990 fTreeCascVarMultiplicityV0A = lMultiplicityV0A;
991 fTreeCascVarMultiplicityZNA = lMultiplicityZNA;
992 fTreeCascVarMultiplicityTRK = lMultiplicityTRK;
993 fTreeCascVarMultiplicitySPD = lMultiplicitySPD;
995 fHistV0MultiplicityBeforeTrigSel->Fill ( lESDevent->GetNumberOfV0s() );
996 fHistMultiplicityBeforeTrigSel->Fill ( lMultiplicity );
997 fHistMultiplicityV0ABeforeTrigSel->Fill ( lMultiplicityV0A );
998 fHistMultiplicityZNABeforeTrigSel->Fill ( lMultiplicityZNA );
999 fHistMultiplicityTRKBeforeTrigSel->Fill ( lMultiplicityTRK );
1000 fHistMultiplicitySPDBeforeTrigSel->Fill ( lMultiplicitySPD );
1002 //------------------------------------------------
1003 // Physics Selection
1004 //------------------------------------------------
1006 UInt_t maskIsSelected = ((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected();
1007 Bool_t isSelected = 0;
1008 isSelected = (maskIsSelected & AliVEvent::kMB) == AliVEvent::kMB;
1010 //pA triggering: CINT7
1011 if( fkSwitchINT7 ) isSelected = (maskIsSelected & AliVEvent::kINT7) == AliVEvent::kINT7;
1013 //Standard Min-Bias Selection
1014 if ( ! isSelected ) {
1015 PostData(1, fListHist);
1016 PostData(2, fTreeCascade);
1020 //------------------------------------------------
1021 // Rerun cascade vertexer!
1022 //------------------------------------------------
1024 if( fkRunVertexers ){
1025 lESDevent->ResetCascades();
1026 lESDevent->ResetV0s();
1028 AliLightV0vertexer lV0vtxer;
1029 AliLightCascadeVertexer lCascVtxer;
1031 lV0vtxer.SetDefaultCuts(fV0VertexerSels);
1032 lCascVtxer.SetDefaultCuts(fCascadeVertexerSels);
1034 lV0vtxer.Tracks2V0vertices(lESDevent);
1035 lCascVtxer.V0sTracks2CascadeVertices(lESDevent);
1037 //------------------------------------------------
1038 // After Trigger Selection
1039 //------------------------------------------------
1041 lNumberOfV0s = lESDevent->GetNumberOfV0s();
1043 //Set variable for filling tree afterwards!
1044 fHistV0MultiplicityForTrigEvt->Fill(lNumberOfV0s);
1045 fHistMultiplicityForTrigEvt->Fill ( lMultiplicity );
1046 fHistMultiplicityV0AForTrigEvt ->Fill( lMultiplicityV0A );
1047 fHistMultiplicityZNAForTrigEvt ->Fill( lMultiplicityZNA );
1048 fHistMultiplicityTRKForTrigEvt ->Fill( lMultiplicityTRK );
1049 fHistMultiplicitySPDForTrigEvt ->Fill( lMultiplicitySPD );
1051 //------------------------------------------------
1052 // Getting: Primary Vertex + MagField Info
1053 //------------------------------------------------
1055 const AliESDVertex *lPrimaryTrackingESDVtx = lESDevent->GetPrimaryVertexTracks();
1056 // get the vtx stored in ESD found with tracks
1057 lPrimaryTrackingESDVtx->GetXYZ( lTrkgPrimaryVtxPos );
1059 const AliESDVertex *lPrimaryBestESDVtx = lESDevent->GetPrimaryVertex();
1060 // get the best primary vertex available for the event
1061 // As done in AliCascadeVertexer, we keep the one which is the best one available.
1062 // between : Tracking vertex > SPD vertex > TPC vertex > default SPD vertex
1063 // This one will be used for next calculations (DCA essentially)
1064 lPrimaryBestESDVtx->GetXYZ( lBestPrimaryVtxPos );
1066 Double_t lPrimaryVtxPosition[3];
1067 const AliVVertex *primaryVtx = lESDevent->GetPrimaryVertex();
1068 lPrimaryVtxPosition[0] = primaryVtx->GetX();
1069 lPrimaryVtxPosition[1] = primaryVtx->GetY();
1070 lPrimaryVtxPosition[2] = primaryVtx->GetZ();
1071 fHistPVx->Fill( lPrimaryVtxPosition[0] );
1072 fHistPVy->Fill( lPrimaryVtxPosition[1] );
1073 fHistPVz->Fill( lPrimaryVtxPosition[2] );
1075 //------------------------------------------------
1076 // Primary Vertex Requirements Section:
1077 // ---> pp and PbPb: Only requires |z|<10cm
1078 // ---> pPb: all requirements checked at this stage
1079 //------------------------------------------------
1081 //Roberto's PV selection criteria, implemented 17th April 2013
1083 /* vertex selection */
1084 Bool_t fHasVertex = kFALSE;
1086 const AliESDVertex *vertex = lESDevent->GetPrimaryVertexTracks();
1087 if (vertex->GetNContributors() < 1) {
1088 vertex = lESDevent->GetPrimaryVertexSPD();
1089 if (vertex->GetNContributors() < 1) fHasVertex = kFALSE;
1090 else fHasVertex = kTRUE;
1091 TString vtxTyp = vertex->GetTitle();
1092 Double_t cov[6]={0};
1093 vertex->GetCovarianceMatrix(cov);
1094 Double_t zRes = TMath::Sqrt(cov[5]);
1095 if (vtxTyp.Contains("vertexer:Z") && (zRes>0.25)) fHasVertex = kFALSE;
1097 else fHasVertex = kTRUE;
1099 //Is First event in chunk rejection: Still present!
1100 if(fkpAVertexSelection==kTRUE && fHasVertex == kFALSE) {
1101 AliWarning("Pb / | PV does not satisfy selection criteria!");
1102 PostData(1, fListHist);
1103 PostData(2, fTreeCascade);
1107 //Is First event in chunk rejection: Still present!
1108 if(fkpAVertexSelection==kTRUE && fUtils->IsFirstEventInChunk(lESDevent)) {
1109 AliWarning("Pb / | This is the first event in the chunk!");
1110 PostData(1, fListHist);
1111 PostData(2, fTreeCascade);
1115 //17 April Fix: Always do primary vertex Z selection, after pA vertex selection from Roberto
1116 if(TMath::Abs(lBestPrimaryVtxPos[2]) > 10.0) {
1117 AliWarning("Pb / | Z position of Best Prim Vtx | > 10.0 cm ... return !");
1118 PostData(1, fListHist);
1119 PostData(2, fTreeCascade);
1124 lMagneticField = lESDevent->GetMagneticField( );
1125 fHistV0MultiplicityForSelEvt ->Fill( lNumberOfV0s );
1126 fHistMultiplicity->Fill(lMultiplicity);
1127 fHistMultiplicityV0A->Fill(lMultiplicityV0A);
1128 fHistMultiplicityZNA->Fill(lMultiplicityZNA);
1129 fHistMultiplicityTRK->Fill(lMultiplicityTRK);
1130 fHistMultiplicitySPD->Fill(lMultiplicitySPD);
1132 //------------------------------------------------
1133 // SKIP: Events with well-established PVtx
1134 //------------------------------------------------
1136 const AliESDVertex *lPrimaryTrackingESDVtxCheck = lESDevent->GetPrimaryVertexTracks();
1137 const AliESDVertex *lPrimarySPDVtx = lESDevent->GetPrimaryVertexSPD();
1138 if (!lPrimarySPDVtx->GetStatus() && !lPrimaryTrackingESDVtxCheck->GetStatus() && fkpAVertexSelection==kFALSE ){
1139 AliWarning("Pb / No SPD prim. vertex nor prim. Tracking vertex ... return !");
1140 PostData(1, fListHist);
1141 PostData(2, fTreeCascade);
1144 fHistV0MultiplicityForSelEvtNoTPCOnly ->Fill( lNumberOfV0s );
1145 fHistMultiplicityNoTPCOnly->Fill(lMultiplicity);
1146 fHistMultiplicityV0ANoTPCOnly->Fill(lMultiplicityV0A);
1147 fHistMultiplicityZNANoTPCOnly->Fill(lMultiplicityZNA);
1148 fHistMultiplicityTRKNoTPCOnly->Fill(lMultiplicityTRK);
1149 fHistMultiplicitySPDNoTPCOnly->Fill(lMultiplicitySPD);
1151 //------------------------------------------------
1152 // Pileup Rejection Studies
1153 //------------------------------------------------
1155 // FIXME : quality selection regarding pile-up rejection
1156 if(lESDevent->IsPileupFromSPD() && !fkIsNuclear ){// minContributors=3, minZdist=0.8, nSigmaZdist=3., nSigmaDiamXY=2., nSigmaDiamZ=5. -> see http://alisoft.cern.ch/viewvc/trunk/STEER/AliESDEvent.h?root=AliRoot&r1=41914&r2=42199&pathrev=42199
1157 AliWarning("Pb / This is tagged as Pileup from SPD... return !");
1158 PostData(1, fListHist);
1159 PostData(2, fTreeCascade);
1162 fHistV0MultiplicityForSelEvtNoTPCOnlyNoPileup ->Fill( lNumberOfV0s );
1163 fHistMultiplicityNoTPCOnlyNoPileup->Fill(lMultiplicity);
1164 fHistMultiplicityV0ANoTPCOnlyNoPileup->Fill(lMultiplicityV0A);
1165 fHistMultiplicityZNANoTPCOnlyNoPileup->Fill(lMultiplicityZNA);
1166 fHistMultiplicityTRKNoTPCOnlyNoPileup->Fill(lMultiplicityTRK);
1167 fHistMultiplicitySPDNoTPCOnlyNoPileup->Fill(lMultiplicitySPD);
1169 //Do control histograms without the IsFromVertexerZ events, but consider them in analysis...
1170 if( ! (lESDevent->GetPrimaryVertex()->IsFromVertexerZ() ) ){
1171 fHistPVxAnalysis->Fill( lPrimaryVtxPosition[0] );
1172 fHistPVyAnalysis->Fill( lPrimaryVtxPosition[1] );
1173 fHistPVzAnalysis->Fill( lPrimaryVtxPosition[2] );
1176 //------------------------------------------------
1177 // MAIN CASCADE LOOP STARTS HERE
1178 //------------------------------------------------
1179 // Code Credit: Antonin Maire (thanks^100)
1180 // ---> This is an adaptation
1182 Long_t ncascades = 0;
1183 ncascades = lESDevent->GetNumberOfCascades();
1185 for (Int_t iXi = 0; iXi < ncascades; iXi++){
1186 //------------------------------------------------
1188 //------------------------------------------------
1189 //Double_t lTrkgPrimaryVtxRadius3D = -500.0;
1190 //Double_t lBestPrimaryVtxRadius3D = -500.0;
1191 fTreeCascVarBadCascadeJai = kFALSE ;
1193 // - 1st part of initialisation : variables needed to store AliESDCascade data members
1194 Double_t lEffMassXi = 0. ;
1195 //Double_t lChi2Xi = -1. ;
1196 Double_t lDcaXiDaughters = -1. ;
1197 Double_t lXiCosineOfPointingAngle = -1. ;
1198 Double_t lPosXi[3] = { -1000.0, -1000.0, -1000.0 };
1199 Double_t lXiRadius = -1000. ;
1201 // - 2nd part of initialisation : Nbr of clusters within TPC for the 3 daughter cascade tracks
1202 Int_t lPosTPCClusters = -1; // For ESD only ...//FIXME : wait for availability in AOD
1203 Int_t lNegTPCClusters = -1; // For ESD only ...
1204 Int_t lBachTPCClusters = -1; // For ESD only ...
1206 // - 3rd part of initialisation : about V0 part in cascades
1207 Double_t lInvMassLambdaAsCascDghter = 0.;
1208 //Double_t lV0Chi2Xi = -1. ;
1209 Double_t lDcaV0DaughtersXi = -1.;
1211 Double_t lDcaBachToPrimVertexXi = -1., lDcaV0ToPrimVertexXi = -1.;
1212 Double_t lDcaPosToPrimVertexXi = -1.;
1213 Double_t lDcaNegToPrimVertexXi = -1.;
1214 Double_t lV0CosineOfPointingAngleXi = -1. ;
1215 Double_t lV0CosineOfPointingAngleXiSpecial = -1. ;
1216 Double_t lPosV0Xi[3] = { -1000. , -1000., -1000. }; // Position of VO coming from cascade
1217 Double_t lV0RadiusXi = -1000.0;
1218 Double_t lV0quality = 0.;
1220 // - 4th part of initialisation : Effective masses
1221 Double_t lInvMassXiMinus = 0.;
1222 Double_t lInvMassXiPlus = 0.;
1223 Double_t lInvMassOmegaMinus = 0.;
1224 Double_t lInvMassOmegaPlus = 0.;
1226 // - 6th part of initialisation : extra info for QA
1227 Double_t lXiMomX = 0. , lXiMomY = 0., lXiMomZ = 0.;
1228 Double_t lXiTransvMom = 0. ;
1229 Double_t lXiTransvMomMC= 0. ;
1230 Double_t lXiTotMom = 0. ;
1232 Double_t lBachMomX = 0., lBachMomY = 0., lBachMomZ = 0.;
1233 //Double_t lBachTransvMom = 0.;
1234 //Double_t lBachTotMom = 0.;
1236 fTreeCascVarNegNSigmaPion = -100;
1237 fTreeCascVarNegNSigmaProton = -100;
1238 fTreeCascVarPosNSigmaPion = -100;
1239 fTreeCascVarPosNSigmaProton = -100;
1240 fTreeCascVarBachNSigmaPion = -100;
1241 fTreeCascVarBachNSigmaKaon = -100;
1243 Short_t lChargeXi = -2;
1244 //Double_t lV0toXiCosineOfPointingAngle = 0. ;
1246 Double_t lRapXi = -20.0, lRapOmega = -20.0, lRapMC = -20.0; // lEta = -20.0, lTheta = 360., lPhi = 720. ;
1247 //Double_t lAlphaXi = -200., lPtArmXi = -200.0;
1249 // -------------------------------------
1250 // II.ESD - Calculation Part dedicated to Xi vertices (ESD)
1252 AliESDcascade *xi = lESDevent->GetCascade(iXi);
1256 // - II.Step 1 : around primary vertex
1258 //lTrkgPrimaryVtxRadius3D = TMath::Sqrt( lTrkgPrimaryVtxPos[0] * lTrkgPrimaryVtxPos[0] +
1259 // lTrkgPrimaryVtxPos[1] * lTrkgPrimaryVtxPos[1] +
1260 // lTrkgPrimaryVtxPos[2] * lTrkgPrimaryVtxPos[2] );
1262 //lBestPrimaryVtxRadius3D = TMath::Sqrt( lBestPrimaryVtxPos[0] * lBestPrimaryVtxPos[0] +
1263 // lBestPrimaryVtxPos[1] * lBestPrimaryVtxPos[1] +
1264 // lBestPrimaryVtxPos[2] * lBestPrimaryVtxPos[2] );
1266 // - II.Step 2 : Assigning the necessary variables for specific AliESDcascade data members (ESD)
1269 xi->ChangeMassHypothesis(lV0quality , 3312); // default working hypothesis : cascade = Xi- decay
1271 lEffMassXi = xi->GetEffMassXi();
1272 //lChi2Xi = xi->GetChi2Xi();
1273 lDcaXiDaughters = xi->GetDcaXiDaughters();
1274 lXiCosineOfPointingAngle = xi->GetCascadeCosineOfPointingAngle( lBestPrimaryVtxPos[0],
1275 lBestPrimaryVtxPos[1],
1276 lBestPrimaryVtxPos[2] );
1277 // Take care : the best available vertex should be used (like in AliCascadeVertexer)
1279 xi->GetXYZcascade( lPosXi[0], lPosXi[1], lPosXi[2] );
1280 lXiRadius = TMath::Sqrt( lPosXi[0]*lPosXi[0] + lPosXi[1]*lPosXi[1] );
1282 fTreeCascVarCascadeDecayX = lPosXi[0];
1283 fTreeCascVarCascadeDecayY = lPosXi[1];
1284 fTreeCascVarCascadeDecayZ = lPosXi[2];
1286 // - II.Step 3 : around the tracks : Bach + V0 (ESD)
1287 // ~ Necessary variables for ESDcascade data members coming from the ESDv0 part (inheritance)
1290 UInt_t lIdxPosXi = (UInt_t) TMath::Abs( xi->GetPindex() );
1291 UInt_t lIdxNegXi = (UInt_t) TMath::Abs( xi->GetNindex() );
1292 UInt_t lBachIdx = (UInt_t) TMath::Abs( xi->GetBindex() );
1293 // Care track label can be negative in MC production (linked with the track quality)
1294 // However = normally, not the case for track index ...
1296 // FIXME : rejection of a double use of a daughter track (nothing but just a crosscheck of what is done in the cascade vertexer)
1297 if(lBachIdx == lIdxNegXi) {
1298 AliWarning("Pb / Idx(Bach. track) = Idx(Neg. track) ... continue!"); continue;
1300 if(lBachIdx == lIdxPosXi) {
1301 AliWarning("Pb / Idx(Bach. track) = Idx(Pos. track) ... continue!"); continue;
1304 AliESDtrack *pTrackXi = lESDevent->GetTrack( lIdxPosXi );
1305 AliESDtrack *nTrackXi = lESDevent->GetTrack( lIdxNegXi );
1306 AliESDtrack *bachTrackXi = lESDevent->GetTrack( lBachIdx );
1308 if (!pTrackXi || !nTrackXi || !bachTrackXi ) {
1309 AliWarning("ERROR: Could not retrieve one of the 3 ESD daughter tracks of the cascade ...");
1313 fTreeCascVarPosEta = pTrackXi->Eta();
1314 fTreeCascVarNegEta = nTrackXi->Eta();
1315 fTreeCascVarBachEta = bachTrackXi->Eta();
1317 //Save shared clusters information
1318 fTreeCascVarNegSharedClusters = nTrackXi->GetTPCnclsS(0,159);
1319 fTreeCascVarPosSharedClusters = pTrackXi->GetTPCnclsS(0,159);
1320 fTreeCascVarBachSharedClusters = bachTrackXi->GetTPCnclsS(0,159);
1322 Double_t lBMom[3], lNMom[3], lPMom[3];
1323 xi->GetBPxPyPz( lBMom[0], lBMom[1], lBMom[2] );
1324 xi->GetPPxPyPz( lPMom[0], lPMom[1], lPMom[2] );
1325 xi->GetNPxPyPz( lNMom[0], lNMom[1], lNMom[2] );
1327 //Save all momentum information
1328 fTreeCascVarNegPx = lNMom[0];
1329 fTreeCascVarNegPy = lNMom[1];
1330 fTreeCascVarNegPz = lNMom[2];
1331 fTreeCascVarPosPx = lPMom[0];
1332 fTreeCascVarPosPy = lPMom[1];
1333 fTreeCascVarPosPz = lPMom[2];
1334 fTreeCascVarBachPx = lBMom[0];
1335 fTreeCascVarBachPy = lBMom[1];
1336 fTreeCascVarBachPz = lBMom[2];
1338 fTreeCascVarBachTransMom = TMath::Sqrt( lBMom[0]*lBMom[0] + lBMom[1]*lBMom[1] );
1339 fTreeCascVarPosTransMom = TMath::Sqrt( lPMom[0]*lPMom[0] + lPMom[1]*lPMom[1] );
1340 fTreeCascVarNegTransMom = TMath::Sqrt( lNMom[0]*lNMom[0] + lNMom[1]*lNMom[1] );
1342 //------------------------------------------------
1343 // TPC dEdx information
1344 //------------------------------------------------
1345 fTreeCascVarNegNSigmaPion = fPIDResponse->NumberOfSigmasTPC( nTrackXi, AliPID::kPion );
1346 fTreeCascVarNegNSigmaProton = fPIDResponse->NumberOfSigmasTPC( nTrackXi, AliPID::kProton );
1347 fTreeCascVarPosNSigmaPion = fPIDResponse->NumberOfSigmasTPC( pTrackXi, AliPID::kPion );
1348 fTreeCascVarPosNSigmaProton = fPIDResponse->NumberOfSigmasTPC( pTrackXi, AliPID::kProton );
1349 fTreeCascVarBachNSigmaPion = fPIDResponse->NumberOfSigmasTPC( bachTrackXi, AliPID::kPion );
1350 fTreeCascVarBachNSigmaKaon = fPIDResponse->NumberOfSigmasTPC( bachTrackXi, AliPID::kKaon );
1352 //------------------------------------------------
1353 // TPC Number of clusters info
1354 // --- modified to save the smallest number
1355 // --- of TPC clusters for the 3 tracks
1356 //------------------------------------------------
1358 lPosTPCClusters = pTrackXi->GetTPCNcls();
1359 lNegTPCClusters = nTrackXi->GetTPCNcls();
1360 lBachTPCClusters = bachTrackXi->GetTPCNcls();
1362 fTreeCascVarNegClusters = lNegTPCClusters;
1363 fTreeCascVarPosClusters = lPosTPCClusters;
1364 fTreeCascVarBachClusters = lBachTPCClusters;
1366 // 1 - Poor quality related to TPCrefit
1367 ULong_t pStatus = pTrackXi->GetStatus();
1368 ULong_t nStatus = nTrackXi->GetStatus();
1369 ULong_t bachStatus = bachTrackXi->GetStatus();
1371 fTreeCascVarkITSRefitBachelor = kTRUE;
1372 fTreeCascVarkITSRefitNegative = kTRUE;
1373 fTreeCascVarkITSRefitPositive = kTRUE;
1375 if ((pStatus&AliESDtrack::kTPCrefit) == 0) { /*AliWarning("Pb / V0 Pos. track has no TPCrefit ... continue!"); */continue; }
1376 if ((nStatus&AliESDtrack::kTPCrefit) == 0) { /*AliWarning("Pb / V0 Neg. track has no TPCrefit ... continue!"); */continue; }
1377 if ((bachStatus&AliESDtrack::kTPCrefit) == 0) { /*AliWarning("Pb / Bach. track has no TPCrefit ... continue!"); */continue; }
1379 //Extra Debug Information: booleans for ITS refit
1380 if ((pStatus&AliESDtrack::kITSrefit) == 0) { fTreeCascVarkITSRefitPositive = kFALSE; }
1381 if ((nStatus&AliESDtrack::kITSrefit) == 0) { fTreeCascVarkITSRefitNegative = kFALSE; }
1382 if ((bachStatus&AliESDtrack::kITSrefit) == 0) { fTreeCascVarkITSRefitBachelor = kFALSE; }
1384 // 2 - Poor quality related to TPC clusters: lowest cut of 70 clusters
1385 if(lPosTPCClusters < 70) { /*AliWarning("Pb / V0 Pos. track has less than 70 TPC clusters ... continue!"); */continue; }
1386 if(lNegTPCClusters < 70) { /*AliWarning("Pb / V0 Neg. track has less than 70 TPC clusters ... continue!"); */continue; }
1387 if(lBachTPCClusters < 70) { /*AliWarning("Pb / Bach. track has less than 70 TPC clusters ... continue!"); */continue; }
1388 Int_t leastnumberofclusters = 1000;
1389 if( lPosTPCClusters < leastnumberofclusters ) leastnumberofclusters = lPosTPCClusters;
1390 if( lNegTPCClusters < leastnumberofclusters ) leastnumberofclusters = lNegTPCClusters;
1391 if( lBachTPCClusters < leastnumberofclusters ) leastnumberofclusters = lBachTPCClusters;
1393 lInvMassLambdaAsCascDghter = xi->GetEffMass();
1394 // This value shouldn't change, whatever the working hyp. is : Xi-, Xi+, Omega-, Omega+
1395 lDcaV0DaughtersXi = xi->GetDcaV0Daughters();
1396 //lV0Chi2Xi = xi->GetChi2V0();
1398 lV0CosineOfPointingAngleXi = xi->GetV0CosineOfPointingAngle( lBestPrimaryVtxPos[0],
1399 lBestPrimaryVtxPos[1],
1400 lBestPrimaryVtxPos[2] );
1401 //Modification: V0 CosPA wrt to Cascade decay vertex
1402 lV0CosineOfPointingAngleXiSpecial = xi->GetV0CosineOfPointingAngle( lPosXi[0],
1406 lDcaV0ToPrimVertexXi = xi->GetD( lBestPrimaryVtxPos[0],
1407 lBestPrimaryVtxPos[1],
1408 lBestPrimaryVtxPos[2] );
1410 lDcaBachToPrimVertexXi = TMath::Abs( bachTrackXi->GetD( lBestPrimaryVtxPos[0],
1411 lBestPrimaryVtxPos[1],
1413 // Note : AliExternalTrackParam::GetD returns an algebraic value ...
1415 xi->GetXYZ( lPosV0Xi[0], lPosV0Xi[1], lPosV0Xi[2] );
1416 lV0RadiusXi = TMath::Sqrt( lPosV0Xi[0]*lPosV0Xi[0] + lPosV0Xi[1]*lPosV0Xi[1] );
1418 fTreeCascVarV0DecayX = lPosV0Xi[0];
1419 fTreeCascVarV0DecayY = lPosV0Xi[1];
1420 fTreeCascVarV0DecayZ = lPosV0Xi[2];
1422 lDcaPosToPrimVertexXi = TMath::Abs( pTrackXi ->GetD( lBestPrimaryVtxPos[0],
1423 lBestPrimaryVtxPos[1],
1426 lDcaNegToPrimVertexXi = TMath::Abs( nTrackXi ->GetD( lBestPrimaryVtxPos[0],
1427 lBestPrimaryVtxPos[1],
1430 // - II.Step 4 : around effective masses (ESD)
1431 // ~ change mass hypotheses to cover all the possibilities : Xi-/+, Omega -/+
1433 if( bachTrackXi->Charge() < 0 ) {
1435 xi->ChangeMassHypothesis(lV0quality , 3312);
1436 // Calculate the effective mass of the Xi- candidate.
1437 // pdg code 3312 = Xi-
1438 lInvMassXiMinus = xi->GetEffMassXi();
1441 xi->ChangeMassHypothesis(lV0quality , 3334);
1442 // Calculate the effective mass of the Xi- candidate.
1443 // pdg code 3334 = Omega-
1444 lInvMassOmegaMinus = xi->GetEffMassXi();
1447 xi->ChangeMassHypothesis(lV0quality , 3312); // Back to default hyp.
1448 }// end if negative bachelor
1451 if( bachTrackXi->Charge() > 0 ){
1453 xi->ChangeMassHypothesis(lV0quality , -3312);
1454 // Calculate the effective mass of the Xi+ candidate.
1455 // pdg code -3312 = Xi+
1456 lInvMassXiPlus = xi->GetEffMassXi();
1459 xi->ChangeMassHypothesis(lV0quality , -3334);
1460 // Calculate the effective mass of the Xi+ candidate.
1461 // pdg code -3334 = Omega+
1462 lInvMassOmegaPlus = xi->GetEffMassXi();
1465 xi->ChangeMassHypothesis(lV0quality , -3312); // Back to "default" hyp.
1466 }// end if positive bachelor
1467 // - II.Step 6 : extra info for QA (ESD)
1468 // miscellaneous pieces of info that may help regarding data quality assessment.
1471 xi->GetPxPyPz( lXiMomX, lXiMomY, lXiMomZ );
1472 lXiTransvMom = TMath::Sqrt( lXiMomX*lXiMomX + lXiMomY*lXiMomY );
1473 lXiTotMom = TMath::Sqrt( lXiMomX*lXiMomX + lXiMomY*lXiMomY + lXiMomZ*lXiMomZ );
1475 xi->GetBPxPyPz( lBachMomX, lBachMomY, lBachMomZ );
1476 //lBachTransvMom = TMath::Sqrt( lBachMomX*lBachMomX + lBachMomY*lBachMomY );
1477 //lBachTotMom = TMath::Sqrt( lBachMomX*lBachMomX + lBachMomY*lBachMomY + lBachMomZ*lBachMomZ );
1479 lChargeXi = xi->Charge();
1481 //lV0toXiCosineOfPointingAngle = xi->GetV0CosineOfPointingAngle( lPosXi[0], lPosXi[1], lPosXi[2] );
1483 lRapXi = xi->RapXi();
1484 lRapOmega = xi->RapOmega();
1486 //lTheta = xi->Theta() *180.0/TMath::Pi();
1487 //lPhi = xi->Phi() *180.0/TMath::Pi();
1488 //lAlphaXi = xi->AlphaXi();
1489 //lPtArmXi = xi->PtArmXi();
1491 //------------------------------------------------
1492 // Jai Salzwedel's femto-cut: better V0 exists
1493 //------------------------------------------------
1495 fTreeCascVarDeltaDCA = -100;
1496 Float_t DCAV0DaughtersDiff = -100;
1497 for (Int_t iv0=0; iv0<lESDevent->GetNumberOfV0s(); iv0++) {
1498 AliESDv0 *v0 = lESDevent->GetV0(iv0);
1499 UInt_t posV0TrackIdx = (UInt_t) v0->GetPindex();
1500 UInt_t negV0TrackIdx = (UInt_t) v0->GetNindex();
1501 if ((posV0TrackIdx == lIdxPosXi) && (negV0TrackIdx == lIdxNegXi)) continue;
1502 // if both tracks are the same ones as the cascades V0 daughter tracks, then the V0 belongs to the cascade being analysed; so avoid it
1503 if ((posV0TrackIdx == lIdxPosXi) || (negV0TrackIdx == lIdxNegXi)) {
1504 DCAV0DaughtersDiff = lDcaV0DaughtersXi - v0->GetDcaV0Daughters();
1505 if( fTreeCascVarDeltaDCA < DCAV0DaughtersDiff ) fTreeCascVarDeltaDCA = DCAV0DaughtersDiff;
1506 if ( lDcaV0DaughtersXi > v0->GetDcaV0Daughters() ) { // DCA comparison criterion
1507 fTreeCascVarBadCascadeJai = kTRUE;
1508 } //end DCA comparison
1509 } // end shares a daughter check
1512 //------------------------------------------------
1513 // Set Variables for adding to tree
1514 //------------------------------------------------
1516 /* 1*/ fTreeCascVarCharge = lChargeXi;
1517 /* 2*/ if(lInvMassXiMinus!=0) fTreeCascVarMassAsXi = lInvMassXiMinus;
1518 /* 2*/ if(lInvMassXiPlus!=0) fTreeCascVarMassAsXi = lInvMassXiPlus;
1519 /* 3*/ if(lInvMassOmegaMinus!=0) fTreeCascVarMassAsOmega = lInvMassOmegaMinus;
1520 /* 3*/ if(lInvMassOmegaPlus!=0) fTreeCascVarMassAsOmega = lInvMassOmegaPlus;
1521 /* 4*/ fTreeCascVarPt = lXiTransvMom;
1522 /* 4*/ fTreeCascVarPtMC = lXiTransvMomMC;
1523 /* 5*/ fTreeCascVarRapXi = lRapXi ;
1524 /* 5*/ fTreeCascVarRapMC = lRapMC ;
1525 /* 6*/ fTreeCascVarRapOmega = lRapOmega ;
1526 /* 7*/ fTreeCascVarDCACascDaughters = lDcaXiDaughters;
1527 /* 8*/ fTreeCascVarDCABachToPrimVtx = lDcaBachToPrimVertexXi;
1528 /* 9*/ fTreeCascVarDCAV0Daughters = lDcaV0DaughtersXi;
1529 /*10*/ fTreeCascVarDCAV0ToPrimVtx = lDcaV0ToPrimVertexXi;
1530 /*11*/ fTreeCascVarDCAPosToPrimVtx = lDcaPosToPrimVertexXi;
1531 /*12*/ fTreeCascVarDCANegToPrimVtx = lDcaNegToPrimVertexXi;
1532 /*13*/ fTreeCascVarCascCosPointingAngle = lXiCosineOfPointingAngle;
1533 /*14*/ fTreeCascVarCascRadius = lXiRadius;
1534 /*15*/ fTreeCascVarV0Mass = lInvMassLambdaAsCascDghter;
1535 /*16*/ fTreeCascVarV0CosPointingAngle = lV0CosineOfPointingAngleXi;
1536 /*16*/ fTreeCascVarV0CosPointingAngleSpecial = lV0CosineOfPointingAngleXiSpecial;
1537 /*17*/ fTreeCascVarV0Radius = lV0RadiusXi;
1538 /*20*/ fTreeCascVarLeastNbrClusters = leastnumberofclusters;
1539 /*21*/ fTreeCascVarMultiplicity = lMultiplicity; //multiplicity, whatever that may be
1541 /*23*/ fTreeCascVarDistOverTotMom = TMath::Sqrt(
1542 TMath::Power( lPosXi[0] - lBestPrimaryVtxPos[0] , 2) +
1543 TMath::Power( lPosXi[1] - lBestPrimaryVtxPos[1] , 2) +
1544 TMath::Power( lPosXi[2] - lBestPrimaryVtxPos[2] , 2)
1546 /*23*/ fTreeCascVarDistOverTotMom /= (lXiTotMom+1e-13);
1548 //All vars not specified here: specified elsewhere!
1550 //------------------------------------------------
1552 //------------------------------------------------
1554 // The conditional is meant to decrease excessive
1555 // memory usage! Be careful when loosening the
1558 //Xi Mass window: 150MeV wide
1559 //Omega mass window: 150MeV wide
1561 if( (fTreeCascVarMassAsXi<1.32+0.075&&fTreeCascVarMassAsXi>1.32-0.075) ||
1562 (fTreeCascVarMassAsOmega<1.68+0.075&&fTreeCascVarMassAsOmega>1.68-0.075) ){
1564 //All inclusive: save everything (OK for p-Pb, pp, NOT OK for Pb-Pb)
1565 if( !fkLight && !fkSuperLight ) fTreeCascade->Fill();
1566 //Intermediate mode: filter on dE/dx, rapidity, eta...
1567 if( fkLight && !fkSuperLight){
1569 //This cascade is useless until proven otherwise
1570 Bool_t lSaveThisCascade = kFALSE;
1572 //Extra selections in case this is supposed to be super-filtered
1573 //Inspired on tricks used for the V0 analysis in Pb-Pb
1574 if (TMath::Abs(fTreeCascVarNegEta) < 0.8 &&
1575 TMath::Abs(fTreeCascVarPosEta) < 0.8 &&
1576 TMath::Abs(fTreeCascVarBachEta) < 0.8 &&
1577 fTreeCascVarPt > fLowPtCutoff){ //beware ptMC and ptreco differences
1579 //Extra selections applied on a case-by-case basis:
1581 if( fTreeCascVarCharge == -1 &&
1582 TMath::Abs(fTreeCascVarMassAsXi-1.321)<0.60 &&
1583 TMath::Abs(fTreeCascVarPosNSigmaProton) <= 4 &&
1584 TMath::Abs(fTreeCascVarNegNSigmaPion ) <= 4 &&
1585 TMath::Abs(fTreeCascVarBachNSigmaPion ) <= 4 &&
1586 TMath::Abs(fTreeCascVarRapXi ) <= 0.5 ){
1587 lSaveThisCascade = kTRUE;
1590 if( fTreeCascVarCharge == +1 &&
1591 TMath::Abs(fTreeCascVarMassAsXi-1.321)<0.60 &&
1592 TMath::Abs(fTreeCascVarPosNSigmaPion ) <= 4 &&
1593 TMath::Abs(fTreeCascVarNegNSigmaProton) <= 4 &&
1594 TMath::Abs(fTreeCascVarBachNSigmaPion ) <= 4 &&
1595 TMath::Abs(fTreeCascVarRapXi ) <= 0.5 ){
1596 lSaveThisCascade = kTRUE;
1599 if( fTreeCascVarCharge == -1 &&
1600 TMath::Abs(fTreeCascVarMassAsOmega-1.672)<0.60 &&
1601 TMath::Abs(fTreeCascVarPosNSigmaPion ) <= 4 &&
1602 TMath::Abs(fTreeCascVarNegNSigmaProton) <= 4 &&
1603 TMath::Abs(fTreeCascVarBachNSigmaKaon ) <= 4 &&
1604 TMath::Abs(fTreeCascVarRapOmega ) <= 0.5 ){
1605 lSaveThisCascade = kTRUE;
1608 if( fTreeCascVarCharge == +1 &&
1609 TMath::Abs(fTreeCascVarMassAsOmega-1.672)<0.60 &&
1610 TMath::Abs(fTreeCascVarPosNSigmaProton ) <= 4 &&
1611 TMath::Abs(fTreeCascVarNegNSigmaPion ) <= 4 &&
1612 TMath::Abs(fTreeCascVarBachNSigmaKaon ) <= 4 &&
1613 TMath::Abs(fTreeCascVarRapOmega ) <= 0.5 ){
1614 lSaveThisCascade = kTRUE;
1617 if (lSaveThisCascade) fTreeCascade -> Fill() ;
1622 //------------------------------------------------
1624 //------------------------------------------------
1626 //------------------------------------------------
1627 // Super-lightweight mode filling
1629 // THIS MODE OVERRIDES LIGHT MODE
1631 // If fkSuperLight is kTRUE, only histograms are saved
1633 //------------------------------------------------
1638 TMath::Abs(fTreeCascVarNegEta) > 0.8 &&
1639 TMath::Abs(fTreeCascVarPosEta) > 0.8 &&
1640 TMath::Abs(fTreeCascVarBachEta) > 0.8 &&
1641 fTreeCascVarBachClusters >= 70 &&
1642 fTreeCascVarNegClusters >= 70 &&
1643 fTreeCascVarPosClusters >= 70 &&
1644 fTreeCascVarV0Radius >= fCut_V0Radius &&
1645 fTreeCascVarCascRadius >= fCut_CascRadius &&
1646 TMath::Abs(fTreeCascVarV0Mass - 1.116) <= fCut_V0Mass &&
1647 fTreeCascVarV0CosPointingAngle >= fCut_V0CosPA &&
1648 fTreeCascVarCascCosPointingAngle >= fCut_CascCosPA &&
1649 fTreeCascVarDCANegToPrimVtx >= fCut_DCANegToPV &&
1650 fTreeCascVarDCAPosToPrimVtx >= fCut_DCAPosToPV &&
1651 fTreeCascVarDCABachToPrimVtx >= fCut_DCABachToPV &&
1652 fTreeCascVarDCAV0Daughters <= fCut_DCAV0Daughters &&
1653 fTreeCascVarDCACascDaughters <= fCut_DCACascDaughters &&
1654 fTreeCascVarDCAV0ToPrimVtx >= fCut_DCAV0ToPV
1657 //--- Case (1) - XiMinus --------------
1659 fTreeCascVarCharge == -1 &&
1660 TMath::Abs(fTreeCascVarRapXi)<0.5 &&
1661 fTreeCascVarDistOverTotMom*1.321 < fCut_CTau &&
1662 TMath::Abs( fTreeCascVarNegNSigmaPion ) < 4 &&
1663 TMath::Abs( fTreeCascVarPosNSigmaProton ) < 4 &&
1664 TMath::Abs( fTreeCascVarBachNSigmaPion ) < 4
1666 f2dHist_MassVsPt_XiMinus -> Fill ( fTreeCascVarMassAsXi , fTreeCascVarPt );
1668 //--- Case (2) - XiPlus ---------------
1670 fTreeCascVarCharge == +1 &&
1671 TMath::Abs(fTreeCascVarRapXi)<0.5 &&
1672 fTreeCascVarDistOverTotMom*1.321 < fCut_CTau &&
1673 TMath::Abs( fTreeCascVarNegNSigmaProton ) < 4 &&
1674 TMath::Abs( fTreeCascVarPosNSigmaPion ) < 4 &&
1675 TMath::Abs( fTreeCascVarBachNSigmaPion ) < 4
1677 f2dHist_MassVsPt_XiPlus -> Fill ( fTreeCascVarMassAsXi , fTreeCascVarPt );
1679 //--- Case (3) - OmegaMinus -----------
1681 fTreeCascVarCharge == -1 &&
1682 TMath::Abs(fTreeCascVarRapOmega)<0.5 &&
1683 fTreeCascVarDistOverTotMom*1.672 < fCut_CTau &&
1684 TMath::Abs( fTreeCascVarNegNSigmaPion ) < 4 &&
1685 TMath::Abs( fTreeCascVarPosNSigmaProton ) < 4 &&
1686 TMath::Abs( fTreeCascVarBachNSigmaKaon ) < 4
1688 f2dHist_MassVsPt_OmegaMinus -> Fill ( fTreeCascVarMassAsOmega , fTreeCascVarPt );
1690 //--- Case (4) - OmegaPlus ------------
1692 fTreeCascVarCharge == +1 &&
1693 TMath::Abs(fTreeCascVarRapOmega)<0.5 &&
1694 fTreeCascVarDistOverTotMom*1.672 < fCut_CTau &&
1695 TMath::Abs( fTreeCascVarNegNSigmaProton ) < 4 &&
1696 TMath::Abs( fTreeCascVarPosNSigmaPion ) < 4 &&
1697 TMath::Abs( fTreeCascVarBachNSigmaKaon ) < 4
1699 f2dHist_MassVsPt_OmegaPlus -> Fill ( fTreeCascVarMassAsOmega , fTreeCascVarPt );
1705 //------------------------------------------------
1706 // End Super-lightweight mode
1707 //------------------------------------------------
1709 }// end of the Cascade loop (ESD or AOD)
1711 // Post output data.
1712 PostData(1, fListHist);
1713 PostData(2, fTreeCascade);
1716 //________________________________________________________________________
1717 void AliAnalysisTaskExtractCascade::Terminate(Option_t *)
1719 // Draw result to the screen
1720 // Called once at the end of the query
1722 TList *cRetrievedList = 0x0;
1723 cRetrievedList = (TList*)GetOutputData(1);
1724 if(!cRetrievedList){
1725 Printf("ERROR - AliAnalysisTaskExtractCascade : ouput data container list not available\n");
1729 fHistV0MultiplicityForTrigEvt = dynamic_cast<TH1F*> ( cRetrievedList->FindObject("fHistV0MultiplicityForTrigEvt") );
1730 if (!fHistV0MultiplicityForTrigEvt) {
1731 Printf("ERROR - AliAnalysisTaskExtractCascade : fHistV0MultiplicityForTrigEvt not available");
1735 TCanvas *canCheck = new TCanvas("AliAnalysisTaskExtractCascade","V0 Multiplicity",10,10,510,510);
1736 canCheck->cd(1)->SetLogy();
1738 fHistV0MultiplicityForTrigEvt->SetMarkerStyle(22);
1739 fHistV0MultiplicityForTrigEvt->DrawCopy("E");
1742 //----------------------------------------------------------------------------
1744 Double_t AliAnalysisTaskExtractCascade::MyRapidity(Double_t rE, Double_t rPz) const
1746 // Local calculation for rapidity
1747 Double_t ReturnValue = -100;
1748 if( (rE-rPz+1.e-13) != 0 && (rE+rPz) != 0 ){
1749 ReturnValue = 0.5*TMath::Log((rE+rPz)/(rE-rPz+1.e-13));