Coverity (Alis)
[u/mrichter/AliRoot.git] / PWGLF / STRANGENESS / Cascades / AliAnalysisTaskExtractPerformanceCascade.cxx
CommitLineData
76029adc 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// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
17//
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.
22//
23// --- Adapted to look for lambdas as well, using code from
24// AliAnalysisTaskCheckPerformanceStrange.cxx
25//
26// --- Algorithm Description
27// 1. Loop over primaries in stack to acquire generated charged Xi
9a8f3aee 28// 2. Loop over stack to find Cascades, fill TH3Fs "PrimRawPt"s for Efficiency
76029adc 29// 3. Perform Physics Selection
30// 4. Perform Primary Vertex |z|<10cm selection
31// 5. Perform Primary Vertex NoTPCOnly vertexing selection (>0 contrib.)
32// 6. Perform Pileup Rejection
33// 7. Analysis Loops:
34// 7a. Fill TH3Fs "PrimAnalysisPt" for control purposes only
76029adc 35//
36// Please Report Any Bugs!
37//
38// --- David Dobrigkeit Chinellato
39// (david.chinellato@gmail.com)
40//
41// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
42
43class TTree;
44class TParticle;
45class TVector3;
46
47//class AliMCEventHandler;
48//class AliMCEvent;
49//class AliStack;
50
51class AliESDVertex;
52class AliAODVertex;
53class AliESDv0;
54class AliAODv0;
55
56#include <Riostream.h>
57#include "TList.h"
58#include "TH1.h"
59#include "TH2.h"
60#include "TH3.h"
61#include "TFile.h"
62#include "THnSparse.h"
63#include "TVector3.h"
64#include "TCanvas.h"
65#include "TMath.h"
66#include "TLegend.h"
67#include "AliLog.h"
68
69#include "AliESDEvent.h"
70#include "AliAODEvent.h"
71#include "AliV0vertexer.h"
72#include "AliCascadeVertexer.h"
73#include "AliESDpid.h"
74#include "AliESDtrack.h"
75#include "AliESDtrackCuts.h"
76#include "AliInputEventHandler.h"
77#include "AliAnalysisManager.h"
78#include "AliMCEventHandler.h"
79#include "AliMCEvent.h"
80#include "AliStack.h"
81
82#include "AliCFContainer.h"
83#include "AliMultiplicity.h"
84#include "AliAODMCParticle.h"
85#include "AliESDcascade.h"
86#include "AliAODcascade.h"
87#include "AliESDUtils.h"
2add50c1 88#include "AliAnalysisUtils.h"
76029adc 89#include "AliGenEventHeader.h"
90
91#include "AliAnalysisTaskExtractPerformanceCascade.h"
92
93using std::cout;
94using std::endl;
95
96ClassImp(AliAnalysisTaskExtractPerformanceCascade)
97
98AliAnalysisTaskExtractPerformanceCascade::AliAnalysisTaskExtractPerformanceCascade()
2add50c1 99 : AliAnalysisTaskSE(), fListHist(0), fTreeCascade(0), fPIDResponse(0), fESDtrackCuts(0), fUtils(0),
76029adc 100 fkIsNuclear ( kFALSE ),
2213f6fc 101 fkSwitchINT7 ( kFALSE ),
da3539d8 102 fpArapidityShift ( 0.465 ),
103 fCentralityEstimator("V0M"),
2add50c1 104 fkpAVertexSelection( kFALSE ),
2213f6fc 105//------------------------------------------------
106// Tree Variables
107//------------------------------------------------
108
109 fTreeCascVarCharge(0),
110 fTreeCascVarMassAsXi(0),
111 fTreeCascVarMassAsOmega(0),
112 fTreeCascVarPt(0),
113 fTreeCascVarPtMC(0),
114 fTreeCascVarRapMC(0),
115 fTreeCascVarRapXi(0),
116 fTreeCascVarRapOmega(0),
117 fTreeCascVarNegEta(0),
118 fTreeCascVarPosEta(0),
119 fTreeCascVarBachEta(0),
120 fTreeCascVarDCACascDaughters(0),
121 fTreeCascVarDCABachToPrimVtx(0),
122 fTreeCascVarDCAV0Daughters(0),
123 fTreeCascVarDCAV0ToPrimVtx(0),
124 fTreeCascVarDCAPosToPrimVtx(0),
125 fTreeCascVarDCANegToPrimVtx(0),
126 fTreeCascVarCascCosPointingAngle(0),
127 fTreeCascVarCascRadius(0),
128 fTreeCascVarV0Mass(0),
129 fTreeCascVarV0CosPointingAngle(0),
130 fTreeCascVarV0Radius(0),
131 fTreeCascVarLeastNbrClusters(0),
132 fTreeCascVarMultiplicity(0),
aa06bcc8 133 fTreeCascVarMultiplicityV0A(0),
134 fTreeCascVarMultiplicityZNA(0),
135 fTreeCascVarMultiplicityTRK(0),
136 fTreeCascVarMultiplicitySPD(0),
2213f6fc 137 fTreeCascVarDistOverTotMom(0),
138 fTreeCascVarPID(0),
139 fTreeCascVarPIDBachelor(0),
140 fTreeCascVarPIDNegative(0),
141 fTreeCascVarPIDPositive(0),
142 fTreeCascVarPosTransMom(0),
143 fTreeCascVarNegTransMom(0),
144 fTreeCascVarPosTransMomMC(0),
145 fTreeCascVarNegTransMomMC(0),
146 fTreeCascVarNegNSigmaPion(0),
147 fTreeCascVarNegNSigmaProton(0),
148 fTreeCascVarPosNSigmaPion(0),
149 fTreeCascVarPosNSigmaProton(0),
150 fTreeCascVarBachNSigmaPion(0),
151 fTreeCascVarBachNSigmaKaon(0),
76029adc 152
153//------------------------------------------------
154// HISTOGRAMS
155// --- Filled on an Event-by-event basis
156//------------------------------------------------
157 fHistV0MultiplicityBeforeTrigSel(0),
158 fHistV0MultiplicityForTrigEvt(0),
159 fHistV0MultiplicityForSelEvt(0),
160 fHistV0MultiplicityForSelEvtNoTPCOnly(0),
161 fHistV0MultiplicityForSelEvtNoTPCOnlyNoPileup(0),
162 fHistMultiplicityBeforeTrigSel(0),
163 fHistMultiplicityForTrigEvt(0),
164 fHistMultiplicity(0),
165 fHistMultiplicityNoTPCOnly(0),
166 fHistMultiplicityNoTPCOnlyNoPileup(0),
167
aa06bcc8 168//V0A Centrality
169fHistMultiplicityV0ABeforeTrigSel(0),
170fHistMultiplicityV0AForTrigEvt(0),
171fHistMultiplicityV0A(0),
172fHistMultiplicityV0ANoTPCOnly(0),
173fHistMultiplicityV0ANoTPCOnlyNoPileup(0),
174
175//ZNA Centrality
176fHistMultiplicityZNABeforeTrigSel(0),
177fHistMultiplicityZNAForTrigEvt(0),
178fHistMultiplicityZNA(0),
179fHistMultiplicityZNANoTPCOnly(0),
180fHistMultiplicityZNANoTPCOnlyNoPileup(0),
181
182//TRK Centrality
183fHistMultiplicityTRKBeforeTrigSel(0),
184fHistMultiplicityTRKForTrigEvt(0),
185fHistMultiplicityTRK(0),
186fHistMultiplicityTRKNoTPCOnly(0),
187fHistMultiplicityTRKNoTPCOnlyNoPileup(0),
188
189//SPD Centrality
190fHistMultiplicitySPDBeforeTrigSel(0),
191fHistMultiplicitySPDForTrigEvt(0),
192fHistMultiplicitySPD(0),
193fHistMultiplicitySPDNoTPCOnly(0),
194fHistMultiplicitySPDNoTPCOnlyNoPileup(0),
195
196
76029adc 197//------------------------------------------------
198// PARTICLE HISTOGRAMS
199// --- Filled on a Particle-by-Particle basis
200//------------------------------------------------
201 f3dHistGenPtVsYVsMultXiMinus(0),
202 f3dHistGenPtVsYVsMultXiPlus(0),
203 f3dHistGenPtVsYVsMultOmegaMinus(0),
204 f3dHistGenPtVsYVsMultOmegaPlus(0),
205 f3dHistGenSelectedPtVsYVsMultXiMinus(0),
206 f3dHistGenSelectedPtVsYVsMultXiPlus(0),
207 f3dHistGenSelectedPtVsYVsMultOmegaMinus(0),
208 f3dHistGenSelectedPtVsYVsMultOmegaPlus(0),
da3539d8 209 f3dHistGenPtVsYCMSVsMultXiMinus(0),
210 f3dHistGenPtVsYCMSVsMultXiPlus(0),
211 f3dHistGenPtVsYCMSVsMultOmegaMinus(0),
212 f3dHistGenPtVsYCMSVsMultOmegaPlus(0),
213 f3dHistGenSelectedPtVsYCMSVsMultXiMinus(0),
214 f3dHistGenSelectedPtVsYCMSVsMultXiPlus(0),
215 f3dHistGenSelectedPtVsYCMSVsMultOmegaMinus(0),
216 f3dHistGenSelectedPtVsYCMSVsMultOmegaPlus(0),
76029adc 217 fHistPVx(0),
218 fHistPVy(0),
219 fHistPVz(0),
220 fHistPVxAnalysis(0),
221 fHistPVyAnalysis(0),
222 fHistPVzAnalysis(0)
223{
224 // Dummy Constructor
225}
226
227AliAnalysisTaskExtractPerformanceCascade::AliAnalysisTaskExtractPerformanceCascade(const char *name)
2add50c1 228 : AliAnalysisTaskSE(name), fListHist(0), fTreeCascade(0), fPIDResponse(0), fESDtrackCuts(0), fUtils(0),
76029adc 229 fkIsNuclear ( kFALSE ),
2213f6fc 230 fkSwitchINT7 ( kFALSE ),
da3539d8 231 fpArapidityShift ( 0.465 ),
232 fCentralityEstimator("V0M"),
2add50c1 233 fkpAVertexSelection( kFALSE ),
76029adc 234//------------------------------------------------
2213f6fc 235// Tree Variables
236//------------------------------------------------
237
238 fTreeCascVarCharge(0),
239 fTreeCascVarMassAsXi(0),
240 fTreeCascVarMassAsOmega(0),
241 fTreeCascVarPt(0),
242 fTreeCascVarPtMC(0),
243 fTreeCascVarRapMC(0),
244 fTreeCascVarRapXi(0),
245 fTreeCascVarRapOmega(0),
246 fTreeCascVarNegEta(0),
247 fTreeCascVarPosEta(0),
248 fTreeCascVarBachEta(0),
249 fTreeCascVarDCACascDaughters(0),
250 fTreeCascVarDCABachToPrimVtx(0),
251 fTreeCascVarDCAV0Daughters(0),
252 fTreeCascVarDCAV0ToPrimVtx(0),
253 fTreeCascVarDCAPosToPrimVtx(0),
254 fTreeCascVarDCANegToPrimVtx(0),
255 fTreeCascVarCascCosPointingAngle(0),
256 fTreeCascVarCascRadius(0),
257 fTreeCascVarV0Mass(0),
258 fTreeCascVarV0CosPointingAngle(0),
259 fTreeCascVarV0Radius(0),
260 fTreeCascVarLeastNbrClusters(0),
261 fTreeCascVarMultiplicity(0),
aa06bcc8 262 fTreeCascVarMultiplicityV0A(0),
263 fTreeCascVarMultiplicityZNA(0),
264 fTreeCascVarMultiplicityTRK(0),
265 fTreeCascVarMultiplicitySPD(0),
2213f6fc 266 fTreeCascVarDistOverTotMom(0),
267 fTreeCascVarPID(0),
268 fTreeCascVarPIDBachelor(0),
269 fTreeCascVarPIDNegative(0),
270 fTreeCascVarPIDPositive(0),
271 fTreeCascVarPosTransMom(0),
272 fTreeCascVarNegTransMom(0),
273 fTreeCascVarPosTransMomMC(0),
274 fTreeCascVarNegTransMomMC(0),
275 fTreeCascVarNegNSigmaPion(0),
276 fTreeCascVarNegNSigmaProton(0),
277 fTreeCascVarPosNSigmaPion(0),
278 fTreeCascVarPosNSigmaProton(0),
279 fTreeCascVarBachNSigmaPion(0),
280 fTreeCascVarBachNSigmaKaon(0),
281
282//------------------------------------------------
76029adc 283// HISTOGRAMS
284// --- Filled on an Event-by-event basis
285//------------------------------------------------
286 fHistV0MultiplicityBeforeTrigSel(0),
287 fHistV0MultiplicityForTrigEvt(0),
288 fHistV0MultiplicityForSelEvt(0),
289 fHistV0MultiplicityForSelEvtNoTPCOnly(0),
290 fHistV0MultiplicityForSelEvtNoTPCOnlyNoPileup(0),
291 fHistMultiplicityBeforeTrigSel(0),
292 fHistMultiplicityForTrigEvt(0),
293 fHistMultiplicity(0),
294 fHistMultiplicityNoTPCOnly(0),
295 fHistMultiplicityNoTPCOnlyNoPileup(0),
296
aa06bcc8 297//V0A Centrality
298fHistMultiplicityV0ABeforeTrigSel(0),
299fHistMultiplicityV0AForTrigEvt(0),
300fHistMultiplicityV0A(0),
301fHistMultiplicityV0ANoTPCOnly(0),
302fHistMultiplicityV0ANoTPCOnlyNoPileup(0),
303
304//ZNA Centrality
305fHistMultiplicityZNABeforeTrigSel(0),
306fHistMultiplicityZNAForTrigEvt(0),
307fHistMultiplicityZNA(0),
308fHistMultiplicityZNANoTPCOnly(0),
309fHistMultiplicityZNANoTPCOnlyNoPileup(0),
310
311//TRK Centrality
312fHistMultiplicityTRKBeforeTrigSel(0),
313fHistMultiplicityTRKForTrigEvt(0),
314fHistMultiplicityTRK(0),
315fHistMultiplicityTRKNoTPCOnly(0),
316fHistMultiplicityTRKNoTPCOnlyNoPileup(0),
317
318//SPD Centrality
319fHistMultiplicitySPDBeforeTrigSel(0),
320fHistMultiplicitySPDForTrigEvt(0),
321fHistMultiplicitySPD(0),
322fHistMultiplicitySPDNoTPCOnly(0),
323fHistMultiplicitySPDNoTPCOnlyNoPileup(0),
76029adc 324
325//------------------------------------------------
326// PARTICLE HISTOGRAMS
327// --- Filled on a Particle-by-Particle basis
328//------------------------------------------------
329 f3dHistGenPtVsYVsMultXiMinus(0),
330 f3dHistGenPtVsYVsMultXiPlus(0),
331 f3dHistGenPtVsYVsMultOmegaMinus(0),
332 f3dHistGenPtVsYVsMultOmegaPlus(0),
333 f3dHistGenSelectedPtVsYVsMultXiMinus(0),
334 f3dHistGenSelectedPtVsYVsMultXiPlus(0),
335 f3dHistGenSelectedPtVsYVsMultOmegaMinus(0),
336 f3dHistGenSelectedPtVsYVsMultOmegaPlus(0),
da3539d8 337 f3dHistGenPtVsYCMSVsMultXiMinus(0),
338 f3dHistGenPtVsYCMSVsMultXiPlus(0),
339 f3dHistGenPtVsYCMSVsMultOmegaMinus(0),
340 f3dHistGenPtVsYCMSVsMultOmegaPlus(0),
341 f3dHistGenSelectedPtVsYCMSVsMultXiMinus(0),
342 f3dHistGenSelectedPtVsYCMSVsMultXiPlus(0),
343 f3dHistGenSelectedPtVsYCMSVsMultOmegaMinus(0),
344 f3dHistGenSelectedPtVsYCMSVsMultOmegaPlus(0),
76029adc 345 fHistPVx(0),
346 fHistPVy(0),
347 fHistPVz(0),
348 fHistPVxAnalysis(0),
349 fHistPVyAnalysis(0),
350 fHistPVzAnalysis(0)
351{
352 // Constructor
d8841e95 353
354 //Set Variables for re-running the cascade vertexers (as done for MS paper)
355
356 // New Loose : 1st step for the 7 TeV pp analysis
b68d5ca6 357 /*
d8841e95 358 fV0Sels[0] = 33. ; // max allowed chi2
359 fV0Sels[1] = 0.02; // min allowed impact parameter for the 1st daughter (LHC09a4 : 0.05)
360 fV0Sels[2] = 0.02; // min allowed impact parameter for the 2nd daughter (LHC09a4 : 0.05)
361 fV0Sels[3] = 2.0 ; // max allowed DCA between the daughter tracks (LHC09a4 : 0.5)
362 fV0Sels[4] = 0.95; // min allowed cosine of V0's pointing angle (LHC09a4 : 0.99)
363 fV0Sels[5] = 1.0 ; // min radius of the fiducial volume (LHC09a4 : 0.2)
364 fV0Sels[6] = 100. ; // max radius of the fiducial volume (LHC09a4 : 100.0)
365
366 fCascSels[0] = 33. ; // max allowed chi2 (same as PDC07)
367 fCascSels[1] = 0.05 ; // min allowed V0 impact parameter (PDC07 : 0.05 / LHC09a4 : 0.025 )
368 fCascSels[2] = 0.010; // "window" around the Lambda mass (PDC07 : 0.008 / LHC09a4 : 0.010 )
369 fCascSels[3] = 0.03 ; // min allowed bachelor's impact parameter (PDC07 : 0.035 / LHC09a4 : 0.025 )
370 fCascSels[4] = 2.0 ; // max allowed DCA between the V0 and the bachelor (PDC07 : 0.1 / LHC09a4 : 0.2 )
371 fCascSels[5] = 0.95 ; // min allowed cosine of the cascade pointing angle (PDC07 : 0.9985 / LHC09a4 : 0.998 )
372 fCascSels[6] = 0.4 ; // min radius of the fiducial volume (PDC07 : 0.9 / LHC09a4 : 0.2 )
373 fCascSels[7] = 100. ; // max radius of the fiducial volume (PDC07 : 100 / LHC09a4 : 100 )
b68d5ca6 374 */
76029adc 375 // Output slot #0 writes into a TList container (Cascade)
376 DefineOutput(1, TList::Class());
377 DefineOutput(2, TTree::Class());
378}
379
380
381AliAnalysisTaskExtractPerformanceCascade::~AliAnalysisTaskExtractPerformanceCascade()
382{
383//------------------------------------------------
384// DESTRUCTOR
385//------------------------------------------------
386
387 if (fListHist){
388 delete fListHist;
389 fListHist = 0x0;
390 }
391 if (fTreeCascade){
392 delete fTreeCascade;
393 fTreeCascade = 0x0;
394 }
395 //cleanup esd track cuts object too...
396 if (fESDtrackCuts){
397 delete fESDtrackCuts;
398 fESDtrackCuts = 0x0;
399 }
2add50c1 400 if (fUtils){
401 delete fUtils;
402 fUtils = 0x0;
403 }
76029adc 404
405}
406
407//________________________________________________________________________
408void AliAnalysisTaskExtractPerformanceCascade::UserCreateOutputObjects()
409{
410 OpenFile(2);
411 // Called once
412
413//------------------------------------------------
414
415 fTreeCascade = new TTree("fTreeCascade","CascadeCandidates");
416
417//------------------------------------------------
418// fTreeCascade Branch definitions - Cascade Tree
419//------------------------------------------------
420
421//------------------------------------------------
422// fTreeCascade Branch definitions
423//------------------------------------------------
424
425//-----------BASIC-INFO---------------------------
426/* 1*/ fTreeCascade->Branch("fTreeCascVarCharge",&fTreeCascVarCharge,"fTreeCascVarCharge/I");
427/* 2*/ fTreeCascade->Branch("fTreeCascVarMassAsXi",&fTreeCascVarMassAsXi,"fTreeCascVarMassAsXi/F");
428/* 3*/ fTreeCascade->Branch("fTreeCascVarMassAsOmega",&fTreeCascVarMassAsOmega,"fTreeCascVarMassAsOmega/F");
429/* 4*/ fTreeCascade->Branch("fTreeCascVarPt",&fTreeCascVarPt,"fTreeCascVarPt/F");
430/* 5*/ fTreeCascade->Branch("fTreeCascVarPtMC",&fTreeCascVarPtMC,"fTreeCascVarPtMC/F");
431/* 6*/ fTreeCascade->Branch("fTreeCascVarRapXi",&fTreeCascVarRapXi,"fTreeCascVarRapXi/F");
432/* 7*/ fTreeCascade->Branch("fTreeCascVarRapMC",&fTreeCascVarRapMC,"fTreeCascVarRapMC/F");
433/* 8*/ fTreeCascade->Branch("fTreeCascVarRapOmega",&fTreeCascVarRapOmega,"fTreeCascVarRapOmega/F");
434/* 9*/ fTreeCascade->Branch("fTreeCascVarNegEta",&fTreeCascVarNegEta,"fTreeCascVarNegEta/F");
435/*10*/ fTreeCascade->Branch("fTreeCascVarPosEta",&fTreeCascVarPosEta,"fTreeCascVarPosEta/F");
436/*11*/ fTreeCascade->Branch("fTreeCascVarBachEta",&fTreeCascVarBachEta,"fTreeCascVarBachEta/F");
437//-----------INFO-FOR-CUTS------------------------
438/*12*/ fTreeCascade->Branch("fTreeCascVarDCACascDaughters",&fTreeCascVarDCACascDaughters,"fTreeCascVarDCACascDaughters/F");
439/*13*/ fTreeCascade->Branch("fTreeCascVarDCABachToPrimVtx",&fTreeCascVarDCABachToPrimVtx,"fTreeCascVarDCABachToPrimVtx/F");
440/*14*/ fTreeCascade->Branch("fTreeCascVarDCAV0Daughters",&fTreeCascVarDCAV0Daughters,"fTreeCascVarDCAV0Daughters/F");
441/*15*/ fTreeCascade->Branch("fTreeCascVarDCAV0ToPrimVtx",&fTreeCascVarDCAV0ToPrimVtx,"fTreeCascVarDCAV0ToPrimVtx/F");
442/*16*/ fTreeCascade->Branch("fTreeCascVarDCAPosToPrimVtx",&fTreeCascVarDCAPosToPrimVtx,"fTreeCascVarDCAPosToPrimVtx/F");
443/*17*/ fTreeCascade->Branch("fTreeCascVarDCANegToPrimVtx",&fTreeCascVarDCANegToPrimVtx,"fTreeCascVarDCANegToPrimVtx/F");
444/*18*/ fTreeCascade->Branch("fTreeCascVarCascCosPointingAngle",&fTreeCascVarCascCosPointingAngle,"fTreeCascVarCascCosPointingAngle/F");
445/*19*/ fTreeCascade->Branch("fTreeCascVarCascRadius",&fTreeCascVarCascRadius,"fTreeCascVarCascRadius/F");
446/*20*/ fTreeCascade->Branch("fTreeCascVarV0Mass",&fTreeCascVarV0Mass,"fTreeCascVarV0Mass/F");
447/*21*/ fTreeCascade->Branch("fTreeCascVarV0CosPointingAngle",&fTreeCascVarV0CosPointingAngle,"fTreeCascVarV0CosPointingAngle/F");
448/*22*/ fTreeCascade->Branch("fTreeCascVarV0Radius",&fTreeCascVarV0Radius,"fTreeCascVarV0Radius/F");
449/*23*/ fTreeCascade->Branch("fTreeCascVarLeastNbrClusters",&fTreeCascVarLeastNbrClusters,"fTreeCascVarLeastNbrClusters/I");
450//-----------MULTIPLICITY-INFO--------------------
451/*24*/ fTreeCascade->Branch("fTreeCascVarMultiplicity",&fTreeCascVarMultiplicity,"fTreeCascVarMultiplicity/I");
aa06bcc8 452/*24*/ fTreeCascade->Branch("fTreeCascVarMultiplicityV0A",&fTreeCascVarMultiplicityV0A,"fTreeCascVarMultiplicityV0A/I");
453/*24*/ fTreeCascade->Branch("fTreeCascVarMultiplicityZNA",&fTreeCascVarMultiplicityZNA,"fTreeCascVarMultiplicityZNA/I");
454/*24*/ fTreeCascade->Branch("fTreeCascVarMultiplicityTRK",&fTreeCascVarMultiplicityTRK,"fTreeCascVarMultiplicityTRK/I");
455/*24*/ fTreeCascade->Branch("fTreeCascVarMultiplicitySPD",&fTreeCascVarMultiplicitySPD,"fTreeCascVarMultiplicitySPD/I");
76029adc 456//-----------DECAY-LENGTH-INFO--------------------
457/*25*/ fTreeCascade->Branch("fTreeCascVarDistOverTotMom",&fTreeCascVarDistOverTotMom,"fTreeCascVarDistOverTotMom/F");
458//-----------MC-PID-------------------------------
459/*26*/ fTreeCascade->Branch("fTreeCascVarPID",&fTreeCascVarPID,"fTreeCascVarPID/I");
460/*27*/ fTreeCascade->Branch("fTreeCascVarPIDBachelor",&fTreeCascVarPIDBachelor,"fTreeCascVarPIDBachelor/I");
461/*28*/ fTreeCascade->Branch("fTreeCascVarPIDNegative",&fTreeCascVarPIDNegative,"fTreeCascVarPIDNegative/I");
462/*29*/ fTreeCascade->Branch("fTreeCascVarPIDPositive",&fTreeCascVarPIDPositive,"fTreeCascVarPIDPositive/I");
463/*30*/ fTreeCascade->Branch("fTreeCascVarPosTransMom",&fTreeCascVarPosTransMom,"fTreeCascVarPosTransMom/F");
464/*31*/ fTreeCascade->Branch("fTreeCascVarNegTransMom",&fTreeCascVarNegTransMom,"fTreeCascVarNegTransMom/F");
465/*32*/ fTreeCascade->Branch("fTreeCascVarPosTransMomMC",&fTreeCascVarPosTransMomMC,"fTreeCascVarPosTransMomMC/F");
466/*33*/ fTreeCascade->Branch("fTreeCascVarNegTransMomMC",&fTreeCascVarNegTransMomMC,"fTreeCascVarNegTransMomMC/F");
467//------------------------------------------------
468/*34*/ fTreeCascade->Branch("fTreeCascVarNegNSigmaPion",&fTreeCascVarNegNSigmaPion,"fTreeCascVarNegNSigmaPion/F");
469/*35*/ fTreeCascade->Branch("fTreeCascVarNegNSigmaProton",&fTreeCascVarNegNSigmaProton,"fTreeCascVarNegNSigmaProton/F");
470/*36*/ fTreeCascade->Branch("fTreeCascVarPosNSigmaPion",&fTreeCascVarPosNSigmaPion,"fTreeCascVarPosNSigmaPion/F");
471/*37*/ fTreeCascade->Branch("fTreeCascVarPosNSigmaProton",&fTreeCascVarPosNSigmaProton,"fTreeCascVarPosNSigmaProton/F");
472/*38*/ fTreeCascade->Branch("fTreeCascVarBachNSigmaPion",&fTreeCascVarBachNSigmaPion,"fTreeCascVarBachNSigmaPion/F");
473/*39*/ fTreeCascade->Branch("fTreeCascVarBachNSigmaKaon",&fTreeCascVarBachNSigmaKaon,"fTreeCascVarBachNSigmaKaon/F");
474
475//------------------------------------------------
476// Particle Identification Setup
477//------------------------------------------------
478
479 AliAnalysisManager *man=AliAnalysisManager::GetAnalysisManager();
480 AliInputEventHandler* inputHandler = (AliInputEventHandler*) (man->GetInputEventHandler());
481 fPIDResponse = inputHandler->GetPIDResponse();
482
483// Multiplicity
484
2add50c1 485 if(! fESDtrackCuts ){
486 fESDtrackCuts = new AliESDtrackCuts();
487 }
488 if(! fUtils ){
489 fUtils = new AliAnalysisUtils();
490 }
76029adc 491
492//------------------------------------------------
493// V0 Multiplicity Histograms
494//------------------------------------------------
495
496 // Create histograms
497 OpenFile(1);
498 fListHist = new TList();
499 fListHist->SetOwner(); // See http://root.cern.ch/root/html/TCollection.html#TCollection:SetOwner
500
501
502 if(! fHistV0MultiplicityBeforeTrigSel) {
503 fHistV0MultiplicityBeforeTrigSel = new TH1F("fHistV0MultiplicityBeforeTrigSel",
504 "V0s per event (before Trig. Sel.);Nbr of V0s/Evt;Events",
505 25, 0, 25);
506 fListHist->Add(fHistV0MultiplicityBeforeTrigSel);
507 }
508
509 if(! fHistV0MultiplicityForTrigEvt) {
510 fHistV0MultiplicityForTrigEvt = new TH1F("fHistV0MultiplicityForTrigEvt",
511 "V0s per event (for triggered evt);Nbr of V0s/Evt;Events",
512 25, 0, 25);
513 fListHist->Add(fHistV0MultiplicityForTrigEvt);
514 }
515
516 if(! fHistV0MultiplicityForSelEvt) {
517 fHistV0MultiplicityForSelEvt = new TH1F("fHistV0MultiplicityForSelEvt",
518 "V0s per event;Nbr of V0s/Evt;Events",
519 25, 0, 25);
520 fListHist->Add(fHistV0MultiplicityForSelEvt);
521 }
522
523 if(! fHistV0MultiplicityForSelEvtNoTPCOnly) {
524 fHistV0MultiplicityForSelEvtNoTPCOnly = new TH1F("fHistV0MultiplicityForSelEvtNoTPCOnly",
525 "V0s per event;Nbr of V0s/Evt;Events",
526 25, 0, 25);
527 fListHist->Add(fHistV0MultiplicityForSelEvtNoTPCOnly);
528 }
529 if(! fHistV0MultiplicityForSelEvtNoTPCOnlyNoPileup) {
530 fHistV0MultiplicityForSelEvtNoTPCOnlyNoPileup = new TH1F("fHistV0MultiplicityForSelEvtNoTPCOnlyNoPileup",
531 "V0s per event;Nbr of V0s/Evt;Events",
532 25, 0, 25);
533 fListHist->Add(fHistV0MultiplicityForSelEvtNoTPCOnlyNoPileup);
534 }
535
536//------------------------------------------------
537// Track Multiplicity Histograms
538//------------------------------------------------
539
540 if(! fHistMultiplicityBeforeTrigSel) {
541 fHistMultiplicityBeforeTrigSel = new TH1F("fHistMultiplicityBeforeTrigSel",
542 "Tracks per event;Nbr of Tracks;Events",
543 200, 0, 200);
544 fListHist->Add(fHistMultiplicityBeforeTrigSel);
545 }
546 if(! fHistMultiplicityForTrigEvt) {
547 fHistMultiplicityForTrigEvt = new TH1F("fHistMultiplicityForTrigEvt",
548 "Tracks per event;Nbr of Tracks;Events",
549 200, 0, 200);
550 fListHist->Add(fHistMultiplicityForTrigEvt);
551 }
552 if(! fHistMultiplicity) {
553 fHistMultiplicity = new TH1F("fHistMultiplicity",
554 "Tracks per event;Nbr of Tracks;Events",
555 200, 0, 200);
556 fListHist->Add(fHistMultiplicity);
557 }
558 if(! fHistMultiplicityNoTPCOnly) {
559 fHistMultiplicityNoTPCOnly = new TH1F("fHistMultiplicityNoTPCOnly",
560 "Tracks per event;Nbr of Tracks;Events",
561 200, 0, 200);
562 fListHist->Add(fHistMultiplicityNoTPCOnly);
563 }
564 if(! fHistMultiplicityNoTPCOnlyNoPileup) {
565 fHistMultiplicityNoTPCOnlyNoPileup = new TH1F("fHistMultiplicityNoTPCOnlyNoPileup",
566 "Tracks per event;Nbr of Tracks;Events",
567 200, 0, 200);
568 fListHist->Add(fHistMultiplicityNoTPCOnlyNoPileup);
569 }
aa06bcc8 570
571
572 //V0A Centrality (if PbPb / pPb)
573 if(! fHistMultiplicityV0ABeforeTrigSel) {
574 fHistMultiplicityV0ABeforeTrigSel = new TH1F("fHistMultiplicityV0ABeforeTrigSel",
575 "Centrality Distribution: V0A;V0A Centrality;Events",
576 200, 0, 200);
577 fListHist->Add(fHistMultiplicityV0ABeforeTrigSel);
578 }
579 if(! fHistMultiplicityV0AForTrigEvt) {
580 fHistMultiplicityV0AForTrigEvt = new TH1F("fHistMultiplicityV0AForTrigEvt",
581 "Centrality Distribution: V0A;V0A Centrality;Events",
582 200, 0, 200);
583 fListHist->Add(fHistMultiplicityV0AForTrigEvt);
584 }
585 if(! fHistMultiplicityV0A) {
586 fHistMultiplicityV0A = new TH1F("fHistMultiplicityV0A",
587 "Centrality Distribution: V0A;V0A Centrality;Events",
588 200, 0, 200);
589 fListHist->Add(fHistMultiplicityV0A);
590 }
591 if(! fHistMultiplicityV0ANoTPCOnly) {
592 fHistMultiplicityV0ANoTPCOnly = new TH1F("fHistMultiplicityV0ANoTPCOnly",
593 "Centrality Distribution: V0A;V0A Centrality;Events",
594 200, 0, 200);
595 fListHist->Add(fHistMultiplicityV0ANoTPCOnly);
596 }
597 if(! fHistMultiplicityV0ANoTPCOnlyNoPileup) {
598 fHistMultiplicityV0ANoTPCOnlyNoPileup = new TH1F("fHistMultiplicityV0ANoTPCOnlyNoPileup",
599 "Centrality Distribution: V0A;V0A Centrality;Events",
600 200, 0, 200);
601 fListHist->Add(fHistMultiplicityV0ANoTPCOnlyNoPileup);
602 }
603
604 //ZNA Centrality (if PbPb / pPb)
605 if(! fHistMultiplicityZNABeforeTrigSel) {
606 fHistMultiplicityZNABeforeTrigSel = new TH1F("fHistMultiplicityZNABeforeTrigSel",
607 "Centrality Distribution: ZNA;ZNA Centrality;Events",
608 200, 0, 200);
609 fListHist->Add(fHistMultiplicityZNABeforeTrigSel);
610 }
611 if(! fHistMultiplicityZNAForTrigEvt) {
612 fHistMultiplicityZNAForTrigEvt = new TH1F("fHistMultiplicityZNAForTrigEvt",
613 "Centrality Distribution: ZNA;ZNA Centrality;Events",
614 200, 0, 200);
615 fListHist->Add(fHistMultiplicityZNAForTrigEvt);
616 }
617 if(! fHistMultiplicityZNA) {
618 fHistMultiplicityZNA = new TH1F("fHistMultiplicityZNA",
619 "Centrality Distribution: ZNA;ZNA Centrality;Events",
620 200, 0, 200);
621 fListHist->Add(fHistMultiplicityZNA);
622 }
623 if(! fHistMultiplicityZNANoTPCOnly) {
624 fHistMultiplicityZNANoTPCOnly = new TH1F("fHistMultiplicityZNANoTPCOnly",
625 "Centrality Distribution: ZNA;ZNA Centrality;Events",
626 200, 0, 200);
627 fListHist->Add(fHistMultiplicityZNANoTPCOnly);
628 }
629 if(! fHistMultiplicityZNANoTPCOnlyNoPileup) {
630 fHistMultiplicityZNANoTPCOnlyNoPileup = new TH1F("fHistMultiplicityZNANoTPCOnlyNoPileup",
631 "Centrality Distribution: ZNA;ZNA Centrality;Events",
632 200, 0, 200);
633 fListHist->Add(fHistMultiplicityZNANoTPCOnlyNoPileup);
634 }
635
636 //TRK Centrality (if PbPb / pPb)
637 if(! fHistMultiplicityTRKBeforeTrigSel) {
638 fHistMultiplicityTRKBeforeTrigSel = new TH1F("fHistMultiplicityTRKBeforeTrigSel",
639 "Centrality Distribution: TRK;TRK Centrality;Events",
640 200, 0, 200);
641 fListHist->Add(fHistMultiplicityTRKBeforeTrigSel);
642 }
643 if(! fHistMultiplicityTRKForTrigEvt) {
644 fHistMultiplicityTRKForTrigEvt = new TH1F("fHistMultiplicityTRKForTrigEvt",
645 "Centrality Distribution: TRK;TRK Centrality;Events",
646 200, 0, 200);
647 fListHist->Add(fHistMultiplicityTRKForTrigEvt);
648 }
649 if(! fHistMultiplicityTRK) {
650 fHistMultiplicityTRK = new TH1F("fHistMultiplicityTRK",
651 "Centrality Distribution: TRK;TRK Centrality;Events",
652 200, 0, 200);
653 fListHist->Add(fHistMultiplicityTRK);
654 }
655 if(! fHistMultiplicityTRKNoTPCOnly) {
656 fHistMultiplicityTRKNoTPCOnly = new TH1F("fHistMultiplicityTRKNoTPCOnly",
657 "Centrality Distribution: TRK;TRK Centrality;Events",
658 200, 0, 200);
659 fListHist->Add(fHistMultiplicityTRKNoTPCOnly);
660 }
661 if(! fHistMultiplicityTRKNoTPCOnlyNoPileup) {
662 fHistMultiplicityTRKNoTPCOnlyNoPileup = new TH1F("fHistMultiplicityTRKNoTPCOnlyNoPileup",
663 "Centrality Distribution: TRK;TRK Centrality;Events",
664 200, 0, 200);
665 fListHist->Add(fHistMultiplicityTRKNoTPCOnlyNoPileup);
666 }
667
668 //SPD Centrality (if PbPb / pPb)
669 if(! fHistMultiplicitySPDBeforeTrigSel) {
670 fHistMultiplicitySPDBeforeTrigSel = new TH1F("fHistMultiplicitySPDBeforeTrigSel",
671 "Centrality Distribution: SPD;SPD Centrality;Events",
672 200, 0, 200);
673 fListHist->Add(fHistMultiplicitySPDBeforeTrigSel);
674 }
675 if(! fHistMultiplicitySPDForTrigEvt) {
676 fHistMultiplicitySPDForTrigEvt = new TH1F("fHistMultiplicitySPDForTrigEvt",
677 "Centrality Distribution: SPD;SPD Centrality;Events",
678 200, 0, 200);
679 fListHist->Add(fHistMultiplicitySPDForTrigEvt);
680 }
681 if(! fHistMultiplicitySPD) {
682 fHistMultiplicitySPD = new TH1F("fHistMultiplicitySPD",
683 "Centrality Distribution: SPD;SPD Centrality;Events",
684 200, 0, 200);
685 fListHist->Add(fHistMultiplicitySPD);
686 }
687 if(! fHistMultiplicitySPDNoTPCOnly) {
688 fHistMultiplicitySPDNoTPCOnly = new TH1F("fHistMultiplicitySPDNoTPCOnly",
689 "Centrality Distribution: SPD;SPD Centrality;Events",
690 200, 0, 200);
691 fListHist->Add(fHistMultiplicitySPDNoTPCOnly);
692 }
693 if(! fHistMultiplicitySPDNoTPCOnlyNoPileup) {
694 fHistMultiplicitySPDNoTPCOnlyNoPileup = new TH1F("fHistMultiplicitySPDNoTPCOnlyNoPileup",
695 "Centrality Distribution: SPD;SPD Centrality;Events",
696 200, 0, 200);
697 fListHist->Add(fHistMultiplicitySPDNoTPCOnlyNoPileup);
698 }
699
700
701
76029adc 702
703//------------------------------------------------
704// Generated Particle Histograms
705//------------------------------------------------
706
707 Int_t lCustomNBins = 200;
708 Double_t lCustomPtUpperLimit = 20;
709 Int_t lCustomNBinsMultiplicity = 100;
710
711//----------------------------------
712// Raw Generated (Pre-physics-selection)
713//----------------------------------
714
715//--------------------------------------------------------------------------------------
716//--- 3D Histo (Pt, Y, Multiplicity) for generated XiMinus/Plus, all generated
717
718 if(! f3dHistGenPtVsYVsMultXiMinus) {
719 f3dHistGenPtVsYVsMultXiMinus = new TH3F( "f3dHistGenPtVsYVsMultXiMinus", "Pt_{#Xi} Vs Y_{#Xi} Vs Multiplicity; Pt_{cascade} (GeV/c); Y_{#Xi} ; Mult", lCustomNBins, 0., lCustomPtUpperLimit, 48, -1.2,1.2,lCustomNBinsMultiplicity,0,lCustomNBinsMultiplicity);
720 fListHist->Add(f3dHistGenPtVsYVsMultXiMinus);
721 }
722 if(! f3dHistGenPtVsYVsMultXiPlus) {
723 f3dHistGenPtVsYVsMultXiPlus = new TH3F( "f3dHistGenPtVsYVsMultXiPlus", "Pt_{#Xi} Vs Y_{#Xi} Vs Multiplicity; Pt_{cascade} (GeV/c); Y_{#Xi} ; Mult", lCustomNBins, 0., lCustomPtUpperLimit, 48, -1.2,1.2,lCustomNBinsMultiplicity,0,lCustomNBinsMultiplicity);
724 fListHist->Add(f3dHistGenPtVsYVsMultXiPlus);
725 }
726//--- 3D Histo (Pt, Y, Multiplicity) for generated OmegaMinus/Plus
727
728 if(! f3dHistGenPtVsYVsMultOmegaMinus) {
729 f3dHistGenPtVsYVsMultOmegaMinus = new TH3F( "f3dHistGenPtVsYVsMultOmegaMinus", "Pt_{#Omega} Vs Y_{#Omega} Vs Multiplicity; Pt_{cascade} (GeV/c); Y_{#Omega} ; Mult", lCustomNBins, 0., lCustomPtUpperLimit, 48, -1.2,1.2,lCustomNBinsMultiplicity,0,lCustomNBinsMultiplicity);
730 fListHist->Add(f3dHistGenPtVsYVsMultOmegaMinus);
731 }
732 if(! f3dHistGenPtVsYVsMultOmegaPlus) {
733 f3dHistGenPtVsYVsMultOmegaPlus = new TH3F( "f3dHistGenPtVsYVsMultOmegaPlus", "Pt_{#Omega} Vs Y_{#Omega} Vs Multiplicity; Pt_{cascade} (GeV/c); Y_{#Omega} ; Mult", lCustomNBins, 0., lCustomPtUpperLimit, 48, -1.2,1.2,lCustomNBinsMultiplicity,0,lCustomNBinsMultiplicity);
734 fListHist->Add(f3dHistGenPtVsYVsMultOmegaPlus);
735 }
736
da3539d8 737//All generated cascades, YCMS
738
739 if(! f3dHistGenPtVsYCMSVsMultXiMinus) {
740 f3dHistGenPtVsYCMSVsMultXiMinus = new TH3F( "f3dHistGenPtVsYCMSVsMultXiMinus", "Pt_{#Xi} Vs Y_{#Xi} Vs Multiplicity; Pt_{cascade} (GeV/c); Y_{#Xi} ; Mult", lCustomNBins, 0., lCustomPtUpperLimit, 48, -1.2,1.2,lCustomNBinsMultiplicity,0,lCustomNBinsMultiplicity);
741 fListHist->Add(f3dHistGenPtVsYCMSVsMultXiMinus);
742 }
743 if(! f3dHistGenPtVsYCMSVsMultXiPlus) {
744 f3dHistGenPtVsYCMSVsMultXiPlus = new TH3F( "f3dHistGenPtVsYCMSVsMultXiPlus", "Pt_{#Xi} Vs Y_{#Xi} Vs Multiplicity; Pt_{cascade} (GeV/c); Y_{#Xi} ; Mult", lCustomNBins, 0., lCustomPtUpperLimit, 48, -1.2,1.2,lCustomNBinsMultiplicity,0,lCustomNBinsMultiplicity);
745 fListHist->Add(f3dHistGenPtVsYCMSVsMultXiPlus);
746 }
747//--- 3D Histo (Pt, Y, Multiplicity) for generated OmegaMinus/Plus
748
749 if(! f3dHistGenPtVsYCMSVsMultOmegaMinus) {
750 f3dHistGenPtVsYCMSVsMultOmegaMinus = new TH3F( "f3dHistGenPtVsYCMSVsMultOmegaMinus", "Pt_{#Omega} Vs Y_{#Omega} Vs Multiplicity; Pt_{cascade} (GeV/c); Y_{#Omega} ; Mult", lCustomNBins, 0., lCustomPtUpperLimit, 48, -1.2,1.2,lCustomNBinsMultiplicity,0,lCustomNBinsMultiplicity);
751 fListHist->Add(f3dHistGenPtVsYCMSVsMultOmegaMinus);
752 }
753 if(! f3dHistGenPtVsYCMSVsMultOmegaPlus) {
754 f3dHistGenPtVsYCMSVsMultOmegaPlus = new TH3F( "f3dHistGenPtVsYCMSVsMultOmegaPlus", "Pt_{#Omega} Vs Y_{#Omega} Vs Multiplicity; Pt_{cascade} (GeV/c); Y_{#Omega} ; Mult", lCustomNBins, 0., lCustomPtUpperLimit, 48, -1.2,1.2,lCustomNBinsMultiplicity,0,lCustomNBinsMultiplicity);
755 fListHist->Add(f3dHistGenPtVsYCMSVsMultOmegaPlus);
756 }
757
758
76029adc 759//--------------------------------------------------------------------------------------
760//--- 3D Histo (Pt, Y, Multiplicity) for generated XiMinus/Plus, at selected analysis evts
761
762 if(! f3dHistGenSelectedPtVsYVsMultXiMinus) {
763 f3dHistGenSelectedPtVsYVsMultXiMinus = new TH3F( "f3dHistGenSelectedPtVsYVsMultXiMinus", "Pt_{#Xi} Vs Y_{#Xi} Vs Multiplicity; Pt_{cascade} (GeV/c); Y_{#Xi} ; Mult", lCustomNBins, 0., lCustomPtUpperLimit, 48, -1.2,1.2,lCustomNBinsMultiplicity,0,lCustomNBinsMultiplicity);
764 fListHist->Add(f3dHistGenSelectedPtVsYVsMultXiMinus);
765 }
766 if(! f3dHistGenSelectedPtVsYVsMultXiPlus) {
767 f3dHistGenSelectedPtVsYVsMultXiPlus = new TH3F( "f3dHistGenSelectedPtVsYVsMultXiPlus", "Pt_{#Xi} Vs Y_{#Xi} Vs Multiplicity; Pt_{cascade} (GeV/c); Y_{#Xi} ; Mult", lCustomNBins, 0., lCustomPtUpperLimit, 48, -1.2,1.2,lCustomNBinsMultiplicity,0,lCustomNBinsMultiplicity);
768 fListHist->Add(f3dHistGenSelectedPtVsYVsMultXiPlus);
769 }
770//--- 3D Histo (Pt, Y, Multiplicity) for generated OmegaMinus/Plus
771
772 if(! f3dHistGenSelectedPtVsYVsMultOmegaMinus) {
773 f3dHistGenSelectedPtVsYVsMultOmegaMinus = new TH3F( "f3dHistGenSelectedPtVsYVsMultOmegaMinus", "Pt_{#Omega} Vs Y_{#Omega} Vs Multiplicity; Pt_{cascade} (GeV/c); Y_{#Omega} ; Mult", lCustomNBins, 0., lCustomPtUpperLimit, 48, -1.2,1.2,lCustomNBinsMultiplicity,0,lCustomNBinsMultiplicity);
774 fListHist->Add(f3dHistGenSelectedPtVsYVsMultOmegaMinus);
775 }
776 if(! f3dHistGenSelectedPtVsYVsMultOmegaPlus) {
777 f3dHistGenSelectedPtVsYVsMultOmegaPlus = new TH3F( "f3dHistGenSelectedPtVsYVsMultOmegaPlus", "Pt_{#Omega} Vs Y_{#Omega} Vs Multiplicity; Pt_{cascade} (GeV/c); Y_{#Omega} ; Mult", lCustomNBins, 0., lCustomPtUpperLimit, 48, -1.2,1.2,lCustomNBinsMultiplicity,0,lCustomNBinsMultiplicity);
778 fListHist->Add(f3dHistGenSelectedPtVsYVsMultOmegaPlus);
779 }
780
da3539d8 781//ANALYSIS level Cascades, YCMS
782
783
784 if(! f3dHistGenSelectedPtVsYCMSVsMultXiMinus) {
785 f3dHistGenSelectedPtVsYCMSVsMultXiMinus = new TH3F( "f3dHistGenSelectedPtVsYCMSVsMultXiMinus", "Pt_{#Xi} Vs Y_{#Xi} Vs Multiplicity; Pt_{cascade} (GeV/c); Y_{#Xi} ; Mult", lCustomNBins, 0., lCustomPtUpperLimit, 48, -1.2,1.2,lCustomNBinsMultiplicity,0,lCustomNBinsMultiplicity);
786 fListHist->Add(f3dHistGenSelectedPtVsYCMSVsMultXiMinus);
787 }
788 if(! f3dHistGenSelectedPtVsYCMSVsMultXiPlus) {
789 f3dHistGenSelectedPtVsYCMSVsMultXiPlus = new TH3F( "f3dHistGenSelectedPtVsYCMSVsMultXiPlus", "Pt_{#Xi} Vs Y_{#Xi} Vs Multiplicity; Pt_{cascade} (GeV/c); Y_{#Xi} ; Mult", lCustomNBins, 0., lCustomPtUpperLimit, 48, -1.2,1.2,lCustomNBinsMultiplicity,0,lCustomNBinsMultiplicity);
790 fListHist->Add(f3dHistGenSelectedPtVsYCMSVsMultXiPlus);
791 }
792//--- 3D Histo (Pt, Y, Multiplicity) for generated OmegaMinus/Plus
793
794 if(! f3dHistGenSelectedPtVsYCMSVsMultOmegaMinus) {
795 f3dHistGenSelectedPtVsYCMSVsMultOmegaMinus = new TH3F( "f3dHistGenSelectedPtVsYCMSVsMultOmegaMinus", "Pt_{#Omega} Vs Y_{#Omega} Vs Multiplicity; Pt_{cascade} (GeV/c); Y_{#Omega} ; Mult", lCustomNBins, 0., lCustomPtUpperLimit, 48, -1.2,1.2,lCustomNBinsMultiplicity,0,lCustomNBinsMultiplicity);
796 fListHist->Add(f3dHistGenSelectedPtVsYCMSVsMultOmegaMinus);
797 }
798 if(! f3dHistGenSelectedPtVsYCMSVsMultOmegaPlus) {
799 f3dHistGenSelectedPtVsYCMSVsMultOmegaPlus = new TH3F( "f3dHistGenSelectedPtVsYCMSVsMultOmegaPlus", "Pt_{#Omega} Vs Y_{#Omega} Vs Multiplicity; Pt_{cascade} (GeV/c); Y_{#Omega} ; Mult", lCustomNBins, 0., lCustomPtUpperLimit, 48, -1.2,1.2,lCustomNBinsMultiplicity,0,lCustomNBinsMultiplicity);
800 fListHist->Add(f3dHistGenSelectedPtVsYCMSVsMultOmegaPlus);
801 }
802
76029adc 803//----------------------------------
804// Primary Vertex Position Histos
805//----------------------------------
806
807 if(! fHistPVx) {
808 fHistPVx = new TH1F("fHistPVx",
809 "PV x position;Nbr of Evts;x",
810 2000, -0.5, 0.5);
811 fListHist->Add(fHistPVx);
812 }
813 if(! fHistPVy) {
814 fHistPVy = new TH1F("fHistPVy",
815 "PV y position;Nbr of Evts;y",
816 2000, -0.5, 0.5);
817 fListHist->Add(fHistPVy);
818 }
819 if(! fHistPVz) {
820 fHistPVz = new TH1F("fHistPVz",
821 "PV z position;Nbr of Evts;z",
822 400, -20, 20);
823 fListHist->Add(fHistPVz);
824 }
825
826 if(! fHistPVxAnalysis) {
827 fHistPVxAnalysis = new TH1F("fHistPVxAnalysis",
828 "PV x position;Nbr of Evts;x",
829 2000, -0.5, 0.5);
830 fListHist->Add(fHistPVxAnalysis);
831 }
832 if(! fHistPVyAnalysis) {
833 fHistPVyAnalysis = new TH1F("fHistPVyAnalysis",
834 "PV y position;Nbr of Evts;y",
835 2000, -0.5, 0.5);
836 fListHist->Add(fHistPVyAnalysis);
837 }
838 if(! fHistPVzAnalysis) {
839 fHistPVzAnalysis = new TH1F("fHistPVzAnalysis",
840 "PV z position;Nbr of Evts;z",
841 400, -20, 20);
842 fListHist->Add(fHistPVzAnalysis);
843 }
844
845 //List of Histograms: Normal
846 PostData(1, fListHist);
847
848 //TTree Object: Saved to base directory. Should cache to disk while saving.
849 //(Important to avoid excessive memory usage, particularly when merging)
850 PostData(2, fTreeCascade);
851
852}// end UserCreateOutputObjects
853
854
855//________________________________________________________________________
856void AliAnalysisTaskExtractPerformanceCascade::UserExec(Option_t *)
857{
858 // Main loop
859 // Called for each event
860
861 AliESDEvent *lESDevent = 0x0;
862 AliMCEvent *lMCevent = 0x0;
863 AliStack *lMCstack = 0x0;
864
865 Int_t lNumberOfV0s = -1;
866 Double_t lTrkgPrimaryVtxPos[3] = {-100.0, -100.0, -100.0};
867 Double_t lBestPrimaryVtxPos[3] = {-100.0, -100.0, -100.0};
868 Double_t lMagneticField = -10.;
869
870 // Connect to the InputEvent
871 // After these lines, we should have an ESD/AOD event + the number of V0s in it.
872
873 // Appropriate for ESD analysis!
874
875 lESDevent = dynamic_cast<AliESDEvent*>( InputEvent() );
876 if (!lESDevent) {
877 AliWarning("ERROR: lESDevent not available \n");
878 return;
879 }
880
881/* --- Acquisition of exact event ID
882 fTreeVariableRunNumber = lESDevent->GetRunNumber();
883 fTreeVariableEventNumber =
884 ( ( ((ULong64_t)lESDevent->GetPeriodNumber() ) << 36 ) |
885 ( ((ULong64_t)lESDevent->GetOrbitNumber () ) << 12 ) |
886 ((ULong64_t)lESDevent->GetBunchCrossNumber() ) );
887*/
888 lMCevent = MCEvent();
889 if (!lMCevent) {
890 Printf("ERROR: Could not retrieve MC event \n");
891 cout << "Name of the file with pb :" << fInputHandler->GetTree()->GetCurrentFile()->GetName() << endl;
892 return;
893 }
894
895 lMCstack = lMCevent->Stack();
896 if (!lMCstack) {
897 Printf("ERROR: Could not retrieve MC stack \n");
898 cout << "Name of the file with pb :" << fInputHandler->GetTree()->GetCurrentFile()->GetName() << endl;
899 return;
900 }
901 TArrayF mcPrimaryVtx;
902 AliGenEventHeader* mcHeader=lMCevent->GenEventHeader();
903 if(!mcHeader) return;
904 mcHeader->PrimaryVertex(mcPrimaryVtx);
905
906//------------------------------------------------
907// Multiplicity Information Acquistion
908//------------------------------------------------
909
910 //REVISED multiplicity estimator after 'multiplicity day' (2011)
aa06bcc8 911 Int_t lMultiplicity = -100;
912 Int_t lMultiplicityV0A = -100;
913 Int_t lMultiplicityZNA = -100;
914 Int_t lMultiplicityTRK = -100;
915 Int_t lMultiplicitySPD = -100;
76029adc 916
917 //testing purposes
918 if(fkIsNuclear == kFALSE) lMultiplicity = fESDtrackCuts->GetReferenceMultiplicity(lESDevent, AliESDtrackCuts::kTrackletsITSTPC,0.5);
919
920 //---> If this is a nuclear collision, then go nuclear on "multiplicity" variable...
921 //---> Warning: Experimental
922 if(fkIsNuclear == kTRUE){
923 AliCentrality* centrality;
924 centrality = lESDevent->GetCentrality();
da3539d8 925 lMultiplicity = ( ( Int_t ) ( centrality->GetCentralityPercentile( fCentralityEstimator.Data() ) ) );
aa06bcc8 926 lMultiplicityV0A = ( ( Int_t ) ( centrality->GetCentralityPercentile( "V0A" ) ) );
927 lMultiplicityZNA = ( ( Int_t ) ( centrality->GetCentralityPercentile( "ZNA" ) ) );
928 lMultiplicityTRK = ( ( Int_t ) ( centrality->GetCentralityPercentile( "TRK" ) ) );
f8bc074c 929 lMultiplicitySPD = ( ( Int_t ) ( centrality->GetCentralityPercentile( "CL1" ) ) );
76029adc 930 if (centrality->GetQuality()>1) {
931 PostData(1, fListHist);
932 PostData(2, fTreeCascade);
933 return;
934 }
935 }
936
937 //Set variable for filling tree afterwards!
938 //---> pp case......: GetReferenceMultiplicity
939 //---> Pb-Pb case...: Centrality by V0M
940
941 fTreeCascVarMultiplicity = lMultiplicity;
aa06bcc8 942 fTreeCascVarMultiplicity = lMultiplicity;
943 fTreeCascVarMultiplicityV0A = lMultiplicityV0A;
944 fTreeCascVarMultiplicityZNA = lMultiplicityZNA;
945 fTreeCascVarMultiplicityTRK = lMultiplicityTRK;
946 fTreeCascVarMultiplicitySPD = lMultiplicitySPD;
76029adc 947
948 fHistV0MultiplicityBeforeTrigSel->Fill ( lESDevent->GetNumberOfV0s() );
949 fHistMultiplicityBeforeTrigSel->Fill ( lMultiplicity );
aa06bcc8 950 fHistMultiplicityV0ABeforeTrigSel->Fill ( lMultiplicityV0A );
951 fHistMultiplicityZNABeforeTrigSel->Fill ( lMultiplicityZNA );
952 fHistMultiplicityTRKBeforeTrigSel->Fill ( lMultiplicityTRK );
953 fHistMultiplicitySPDBeforeTrigSel->Fill ( lMultiplicitySPD );
954
76029adc 955//------------------------------------------------
956// MC Information Acquistion
957//------------------------------------------------
958
959 Int_t iNumberOfPrimaries = -1;
960 iNumberOfPrimaries = lMCstack->GetNprimary();
961 if(iNumberOfPrimaries < 1) return;
962
963//------------------------------------------------
964// Variable Definition
965//------------------------------------------------
966
967 Int_t lNbMCPrimary = 0;
968
76029adc 969 Double_t lPtCurrentPart = 0;
970
971 //Int_t lComeFromSigma = 0;
972
973 // current mc particle 's mother
974 //Int_t iCurrentMother = 0;
975 lNbMCPrimary = lMCstack->GetNprimary();
976
977//------------------------------------------------
978// Pre-Physics Selection
979//------------------------------------------------
980
981//----- Loop on primary Xi, Omega --------------------------------------------------------------
982 for (Int_t iCurrentLabelStack = 0; iCurrentLabelStack < lNbMCPrimary; iCurrentLabelStack++)
983 {// This is the begining of the loop on primaries
984
985 TParticle* lCurrentParticlePrimary = 0x0;
986 lCurrentParticlePrimary = lMCstack->Particle( iCurrentLabelStack );
987 if(!lCurrentParticlePrimary){
988 Printf("Cascade loop %d - MC TParticle pointer to current stack particle = 0x0 ! Skip ...\n", iCurrentLabelStack );
989 continue;
990 }
991 if ( TMath::Abs(lCurrentParticlePrimary->GetPdgCode()) == 3312 || TMath::Abs(lCurrentParticlePrimary->GetPdgCode()) == 3334 ) {
992 Double_t lRapXiMCPrimary = -100;
993 if( (lCurrentParticlePrimary->Energy() - lCurrentParticlePrimary->Pz() +1.e-13) != 0 ) {
994 if ( (lCurrentParticlePrimary->Energy() + lCurrentParticlePrimary->Pz()) / (lCurrentParticlePrimary->Energy() - lCurrentParticlePrimary->Pz() +1.e-13) !=0 ){
995 lRapXiMCPrimary = 0.5*TMath::Log( (lCurrentParticlePrimary->Energy() + lCurrentParticlePrimary->Pz()) / (lCurrentParticlePrimary->Energy() - lCurrentParticlePrimary->Pz() +1.e-13) );
996 }
997 }
998
999 //=================================================================================
1000 // Xi Histograms
1001 if( lCurrentParticlePrimary->GetPdgCode() == 3312 ){
1002 lPtCurrentPart = lCurrentParticlePrimary->Pt();
1003 f3dHistGenPtVsYVsMultXiMinus->Fill(lPtCurrentPart, lRapXiMCPrimary, lMultiplicity);
da3539d8 1004 f3dHistGenPtVsYCMSVsMultXiMinus->Fill(lPtCurrentPart, lRapXiMCPrimary+fpArapidityShift, lMultiplicity);
76029adc 1005 }
1006 if( lCurrentParticlePrimary->GetPdgCode() == -3312 ){
1007 lPtCurrentPart = lCurrentParticlePrimary->Pt();
1008 f3dHistGenPtVsYVsMultXiPlus->Fill(lPtCurrentPart, lRapXiMCPrimary, lMultiplicity);
da3539d8 1009 f3dHistGenPtVsYCMSVsMultXiPlus->Fill(lPtCurrentPart, lRapXiMCPrimary+fpArapidityShift, lMultiplicity);
76029adc 1010 }
1011 // Omega Histograms
1012 if( lCurrentParticlePrimary->GetPdgCode() == 3334 ){
1013 lPtCurrentPart = lCurrentParticlePrimary->Pt();
1014 f3dHistGenPtVsYVsMultOmegaMinus->Fill(lPtCurrentPart, lRapXiMCPrimary, lMultiplicity);
da3539d8 1015 f3dHistGenPtVsYCMSVsMultOmegaMinus->Fill(lPtCurrentPart, lRapXiMCPrimary+fpArapidityShift, lMultiplicity);
76029adc 1016 }
1017 if( lCurrentParticlePrimary->GetPdgCode() == -3334 ){
1018 lPtCurrentPart = lCurrentParticlePrimary->Pt();
1019 f3dHistGenPtVsYVsMultOmegaPlus->Fill(lPtCurrentPart, lRapXiMCPrimary, lMultiplicity);
da3539d8 1020 f3dHistGenPtVsYCMSVsMultOmegaPlus->Fill(lPtCurrentPart, lRapXiMCPrimary+fpArapidityShift, lMultiplicity);
76029adc 1021 }
1022 }
1023 }
1024//----- End Loop on primary Xi, Omega ----------------------------------------------------------
1025
1026// ---> Set Variables to Zero again
1027// ---> Variable Definition
1028
76029adc 1029 lPtCurrentPart = 0;
1030
1031//------------------------------------------------
1032// Physics Selection
1033//------------------------------------------------
1034
1035 UInt_t maskIsSelected = ((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected();
1036 Bool_t isSelected = 0;
1037 isSelected = (maskIsSelected & AliVEvent::kMB) == AliVEvent::kMB;
1038
2213f6fc 1039 //pA triggering: CINT7
1040 if( fkSwitchINT7 ) isSelected = (maskIsSelected & AliVEvent::kINT7) == AliVEvent::kINT7;
1041
76029adc 1042 //Standard Min-Bias Selection
1043 if ( ! isSelected ) {
1044 PostData(1, fListHist);
1045 PostData(2, fTreeCascade);
1046 return;
1047 }
1048
1049//------------------------------------------------
d8841e95 1050// Rerun cascade vertexer!
1051//------------------------------------------------
2213f6fc 1052/*
d8841e95 1053 lESDevent->ResetCascades();
1054 lESDevent->ResetV0s();
1055
1056 AliV0vertexer lV0vtxer;
1057 AliCascadeVertexer lCascVtxer;
1058
1059 lV0vtxer.SetDefaultCuts(fV0Sels);
1060 lCascVtxer.SetDefaultCuts(fCascSels);
1061
1062 lV0vtxer.Tracks2V0vertices(lESDevent);
1063 lCascVtxer.V0sTracks2CascadeVertices(lESDevent);
2213f6fc 1064*/
d8841e95 1065//------------------------------------------------
76029adc 1066// After Trigger Selection
1067//------------------------------------------------
1068
1069 lNumberOfV0s = lESDevent->GetNumberOfV0s();
1070
1071 //Set variable for filling tree afterwards!
1072 fHistV0MultiplicityForTrigEvt->Fill(lNumberOfV0s);
1073 fHistMultiplicityForTrigEvt->Fill ( lMultiplicity );
aa06bcc8 1074 fHistMultiplicityV0AForTrigEvt ->Fill( lMultiplicityV0A );
1075 fHistMultiplicityZNAForTrigEvt ->Fill( lMultiplicityZNA );
1076 fHistMultiplicityTRKForTrigEvt ->Fill( lMultiplicityTRK );
1077 fHistMultiplicitySPDForTrigEvt ->Fill( lMultiplicitySPD );
76029adc 1078
1079//------------------------------------------------
1080// Getting: Primary Vertex + MagField Info
1081//------------------------------------------------
1082
1083 const AliESDVertex *lPrimaryTrackingESDVtx = lESDevent->GetPrimaryVertexTracks();
1084 // get the vtx stored in ESD found with tracks
1085 lPrimaryTrackingESDVtx->GetXYZ( lTrkgPrimaryVtxPos );
1086
1087 const AliESDVertex *lPrimaryBestESDVtx = lESDevent->GetPrimaryVertex();
1088 // get the best primary vertex available for the event
1089 // As done in AliCascadeVertexer, we keep the one which is the best one available.
1090 // between : Tracking vertex > SPD vertex > TPC vertex > default SPD vertex
1091 // This one will be used for next calculations (DCA essentially)
1092 lPrimaryBestESDVtx->GetXYZ( lBestPrimaryVtxPos );
1093
1094 Double_t lPrimaryVtxPosition[3];
1095 const AliVVertex *primaryVtx = lESDevent->GetPrimaryVertex();
1096 lPrimaryVtxPosition[0] = primaryVtx->GetX();
1097 lPrimaryVtxPosition[1] = primaryVtx->GetY();
1098 lPrimaryVtxPosition[2] = primaryVtx->GetZ();
1099 fHistPVx->Fill( lPrimaryVtxPosition[0] );
1100 fHistPVy->Fill( lPrimaryVtxPosition[1] );
1101 fHistPVz->Fill( lPrimaryVtxPosition[2] );
1102
1103//------------------------------------------------
1104// Primary Vertex Z position: SKIP
1105//------------------------------------------------
2add50c1 1106
1107 if(TMath::Abs(lBestPrimaryVtxPos[2]) > 10.0 && fkpAVertexSelection==kFALSE) {
1108 AliWarning("Pb / | Z position of Best Prim Vtx | > 10.0 cm ... return !");
1109 PostData(1, fListHist);
1110 PostData(2, fTreeCascade);
1111 return;
1112 }
1113 if(fkpAVertexSelection==kTRUE && fUtils->IsFirstEventInChunk(lESDevent)) {
1114 AliWarning("Pb / | This is the first event in the chunk!");
1115 PostData(1, fListHist);
1116 PostData(2, fTreeCascade);
1117 return;
1118 }
1119 if(fkpAVertexSelection==kTRUE && !fUtils->IsVertexSelected2013pA(lESDevent)) {
1120 AliWarning("Pb / | Vertex not selected by 2013 pA criteria!");
1121 PostData(1, fListHist);
1122 PostData(2, fTreeCascade);
1123 return;
1124 }
1125
1126 lMagneticField = lESDevent->GetMagneticField( );
1127 fHistV0MultiplicityForSelEvt ->Fill( lNumberOfV0s );
1128 fHistMultiplicity->Fill(lMultiplicity);
aa06bcc8 1129 fHistMultiplicityV0A->Fill(lMultiplicityV0A);
1130 fHistMultiplicityZNA->Fill(lMultiplicityZNA);
1131 fHistMultiplicityTRK->Fill(lMultiplicityTRK);
1132 fHistMultiplicitySPD->Fill(lMultiplicitySPD);
76029adc 1133
1134//------------------------------------------------
1135// SKIP: Events with well-established PVtx
1136//------------------------------------------------
1137
1138 const AliESDVertex *lPrimaryTrackingESDVtxCheck = lESDevent->GetPrimaryVertexTracks();
1139 const AliESDVertex *lPrimarySPDVtx = lESDevent->GetPrimaryVertexSPD();
2add50c1 1140 if (!lPrimarySPDVtx->GetStatus() && !lPrimaryTrackingESDVtxCheck->GetStatus() && fkpAVertexSelection==kFALSE ){
76029adc 1141 AliWarning("Pb / No SPD prim. vertex nor prim. Tracking vertex ... return !");
1142 PostData(1, fListHist);
1143 PostData(2, fTreeCascade);
1144 return;
1145 }
1146 fHistV0MultiplicityForSelEvtNoTPCOnly ->Fill( lNumberOfV0s );
1147 fHistMultiplicityNoTPCOnly->Fill(lMultiplicity);
aa06bcc8 1148 fHistMultiplicityV0ANoTPCOnly->Fill(lMultiplicityV0A);
1149 fHistMultiplicityZNANoTPCOnly->Fill(lMultiplicityZNA);
1150 fHistMultiplicityTRKNoTPCOnly->Fill(lMultiplicityTRK);
1151 fHistMultiplicitySPDNoTPCOnly->Fill(lMultiplicitySPD);
76029adc 1152
1153//------------------------------------------------
1154// Pileup Rejection Studies
1155//------------------------------------------------
1156
1157 // FIXME : quality selection regarding pile-up rejection
1158 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
1159 AliWarning("Pb / This is tagged as Pileup from SPD... return !");
1160 PostData(1, fListHist);
1161 PostData(2, fTreeCascade);
1162 return;
1163 }
1164 fHistV0MultiplicityForSelEvtNoTPCOnlyNoPileup ->Fill( lNumberOfV0s );
1165 fHistMultiplicityNoTPCOnlyNoPileup->Fill(lMultiplicity);
aa06bcc8 1166 fHistMultiplicityV0ANoTPCOnlyNoPileup->Fill(lMultiplicityV0A);
1167 fHistMultiplicityZNANoTPCOnlyNoPileup->Fill(lMultiplicityZNA);
1168 fHistMultiplicityTRKNoTPCOnlyNoPileup->Fill(lMultiplicityTRK);
1169 fHistMultiplicitySPDNoTPCOnlyNoPileup->Fill(lMultiplicitySPD);
76029adc 1170
1171 //Do control histograms without the IsFromVertexerZ events, but consider them in analysis...
1172 if( ! (lESDevent->GetPrimaryVertex()->IsFromVertexerZ() ) ){
1173 fHistPVxAnalysis->Fill( lPrimaryVtxPosition[0] );
1174 fHistPVyAnalysis->Fill( lPrimaryVtxPosition[1] );
1175 fHistPVzAnalysis->Fill( lPrimaryVtxPosition[2] );
1176 }
1177
1178//------------------------------------------------
1179// stack loop starts here
1180//------------------------------------------------
1181
1182//----- Loop on primary Xi, Omega --------------------------------------------------------------
1183 for (Int_t iCurrentLabelStack = 0; iCurrentLabelStack < lNbMCPrimary; iCurrentLabelStack++)
1184 {// This is the begining of the loop on primaries
1185
1186 TParticle* lCurrentParticlePrimary = 0x0;
1187 lCurrentParticlePrimary = lMCstack->Particle( iCurrentLabelStack );
1188 if(!lCurrentParticlePrimary){
1189 Printf("Cascade loop %d - MC TParticle pointer to current stack particle = 0x0 ! Skip ...\n", iCurrentLabelStack );
1190 continue;
1191 }
1192 if ( TMath::Abs(lCurrentParticlePrimary->GetPdgCode()) == 3312 || TMath::Abs(lCurrentParticlePrimary->GetPdgCode()) == 3334 ) {
1193 Double_t lRapXiMCPrimary = -100;
1194 if( (lCurrentParticlePrimary->Energy() - lCurrentParticlePrimary->Pz() +1.e-13) != 0 ) {
1195 if ( (lCurrentParticlePrimary->Energy() + lCurrentParticlePrimary->Pz()) / (lCurrentParticlePrimary->Energy() - lCurrentParticlePrimary->Pz() +1.e-13) !=0 ){
1196 lRapXiMCPrimary = 0.5*TMath::Log( (lCurrentParticlePrimary->Energy() + lCurrentParticlePrimary->Pz()) / (lCurrentParticlePrimary->Energy() - lCurrentParticlePrimary->Pz() +1.e-13) );
1197 }
1198 }
1199
1200 //=================================================================================
1201 // Xi Histograms
1202 if( lCurrentParticlePrimary->GetPdgCode() == 3312 ){
1203 lPtCurrentPart = lCurrentParticlePrimary->Pt();
1204 f3dHistGenSelectedPtVsYVsMultXiMinus->Fill(lPtCurrentPart, lRapXiMCPrimary, lMultiplicity);
da3539d8 1205 f3dHistGenSelectedPtVsYCMSVsMultXiMinus->Fill(lPtCurrentPart, lRapXiMCPrimary+fpArapidityShift, lMultiplicity);
76029adc 1206 }
1207 if( lCurrentParticlePrimary->GetPdgCode() == -3312 ){
1208 lPtCurrentPart = lCurrentParticlePrimary->Pt();
1209 f3dHistGenSelectedPtVsYVsMultXiPlus->Fill(lPtCurrentPart, lRapXiMCPrimary, lMultiplicity);
da3539d8 1210 f3dHistGenSelectedPtVsYCMSVsMultXiPlus->Fill(lPtCurrentPart, lRapXiMCPrimary+fpArapidityShift, lMultiplicity);
76029adc 1211 }
1212 // Omega Histograms
1213 if( lCurrentParticlePrimary->GetPdgCode() == 3334 ){
1214 lPtCurrentPart = lCurrentParticlePrimary->Pt();
1215 f3dHistGenSelectedPtVsYVsMultOmegaMinus->Fill(lPtCurrentPart, lRapXiMCPrimary, lMultiplicity);
da3539d8 1216 f3dHistGenSelectedPtVsYCMSVsMultOmegaMinus->Fill(lPtCurrentPart, lRapXiMCPrimary+fpArapidityShift, lMultiplicity);
76029adc 1217 }
1218 if( lCurrentParticlePrimary->GetPdgCode() == -3334 ){
1219 lPtCurrentPart = lCurrentParticlePrimary->Pt();
1220 f3dHistGenSelectedPtVsYVsMultOmegaPlus->Fill(lPtCurrentPart, lRapXiMCPrimary, lMultiplicity);
da3539d8 1221 f3dHistGenSelectedPtVsYCMSVsMultOmegaPlus->Fill(lPtCurrentPart, lRapXiMCPrimary+fpArapidityShift, lMultiplicity);
76029adc 1222 }
1223 }
1224 }
1225//----- End Loop on primary Xi, Omega ----------------------------------------------------------
1226
1227//------------------------------------------------
1228// MAIN CASCADE LOOP STARTS HERE
1229//------------------------------------------------
1230// Code Credit: Antonin Maire (thanks^100)
1231// ---> This is an adaptation
1232
1233 Long_t ncascades = 0;
1234 ncascades = lESDevent->GetNumberOfCascades();
1235
1236
1237 for (Int_t iXi = 0; iXi < ncascades; iXi++){
1238 //------------------------------------------------
1239 // Initializations
1240 //------------------------------------------------
1241 //Double_t lTrkgPrimaryVtxRadius3D = -500.0;
1242 //Double_t lBestPrimaryVtxRadius3D = -500.0;
1243
1244 // - 1st part of initialisation : variables needed to store AliESDCascade data members
1245 Double_t lEffMassXi = 0. ;
1246 //Double_t lChi2Xi = -1. ;
1247 Double_t lDcaXiDaughters = -1. ;
1248 Double_t lXiCosineOfPointingAngle = -1. ;
1249 Double_t lPosXi[3] = { -1000.0, -1000.0, -1000.0 };
1250 Double_t lXiRadius = -1000. ;
1251
1252 // - 2nd part of initialisation : Nbr of clusters within TPC for the 3 daughter cascade tracks
1253 Int_t lPosTPCClusters = -1; // For ESD only ...//FIXME : wait for availability in AOD
1254 Int_t lNegTPCClusters = -1; // For ESD only ...
1255 Int_t lBachTPCClusters = -1; // For ESD only ...
1256
1257 // - 3rd part of initialisation : about V0 part in cascades
1258 Double_t lInvMassLambdaAsCascDghter = 0.;
1259 //Double_t lV0Chi2Xi = -1. ;
1260 Double_t lDcaV0DaughtersXi = -1.;
1261
1262 Double_t lDcaBachToPrimVertexXi = -1., lDcaV0ToPrimVertexXi = -1.;
1263 Double_t lDcaPosToPrimVertexXi = -1.;
1264 Double_t lDcaNegToPrimVertexXi = -1.;
1265 Double_t lV0CosineOfPointingAngleXi = -1. ;
1266 Double_t lPosV0Xi[3] = { -1000. , -1000., -1000. }; // Position of VO coming from cascade
1267 Double_t lV0RadiusXi = -1000.0;
1268 Double_t lV0quality = 0.;
1269
1270 // - 4th part of initialisation : Effective masses
1271 Double_t lInvMassXiMinus = 0.;
1272 Double_t lInvMassXiPlus = 0.;
1273 Double_t lInvMassOmegaMinus = 0.;
1274 Double_t lInvMassOmegaPlus = 0.;
1275
1276 // - 6th part of initialisation : extra info for QA
1277 Double_t lXiMomX = 0. , lXiMomY = 0., lXiMomZ = 0.;
1278 Double_t lXiTransvMom = 0. ;
1279 Double_t lXiTransvMomMC= 0. ;
1280 Double_t lXiTotMom = 0. ;
1281
1282 Double_t lBachMomX = 0., lBachMomY = 0., lBachMomZ = 0.;
1283 //Double_t lBachTransvMom = 0.;
1284 //Double_t lBachTotMom = 0.;
1285
1286 fTreeCascVarNegNSigmaPion = -100;
1287 fTreeCascVarNegNSigmaProton = -100;
1288 fTreeCascVarPosNSigmaPion = -100;
1289 fTreeCascVarPosNSigmaProton = -100;
1290 fTreeCascVarBachNSigmaPion = -100;
1291 fTreeCascVarBachNSigmaKaon = -100;
1292
1293 Short_t lChargeXi = -2;
1294 //Double_t lV0toXiCosineOfPointingAngle = 0. ;
1295
1296 Double_t lRapXi = -20.0, lRapOmega = -20.0, lRapMC = -20.0; // lEta = -20.0, lTheta = 360., lPhi = 720. ;
1297 //Double_t lAlphaXi = -200., lPtArmXi = -200.0;
1298
1299 // -------------------------------------
1300 // II.ESD - Calculation Part dedicated to Xi vertices (ESD)
1301
1302 AliESDcascade *xi = lESDevent->GetCascade(iXi);
1303 if (!xi) continue;
1304
1305
1306 // - II.Step 1 : around primary vertex
1307 //-------------
1308 //lTrkgPrimaryVtxRadius3D = TMath::Sqrt( lTrkgPrimaryVtxPos[0] * lTrkgPrimaryVtxPos[0] +
1309 // lTrkgPrimaryVtxPos[1] * lTrkgPrimaryVtxPos[1] +
1310 // lTrkgPrimaryVtxPos[2] * lTrkgPrimaryVtxPos[2] );
1311
1312 //lBestPrimaryVtxRadius3D = TMath::Sqrt( lBestPrimaryVtxPos[0] * lBestPrimaryVtxPos[0] +
1313 // lBestPrimaryVtxPos[1] * lBestPrimaryVtxPos[1] +
1314 // lBestPrimaryVtxPos[2] * lBestPrimaryVtxPos[2] );
1315
1316 // - II.Step 2 : Assigning the necessary variables for specific AliESDcascade data members (ESD)
1317 //-------------
1318 lV0quality = 0.;
1319 xi->ChangeMassHypothesis(lV0quality , 3312); // default working hypothesis : cascade = Xi- decay
1320
1321 lEffMassXi = xi->GetEffMassXi();
1322 //lChi2Xi = xi->GetChi2Xi();
1323 lDcaXiDaughters = xi->GetDcaXiDaughters();
1324 lXiCosineOfPointingAngle = xi->GetCascadeCosineOfPointingAngle( lBestPrimaryVtxPos[0],
1325 lBestPrimaryVtxPos[1],
1326 lBestPrimaryVtxPos[2] );
1327 // Take care : the best available vertex should be used (like in AliCascadeVertexer)
1328
1329 xi->GetXYZcascade( lPosXi[0], lPosXi[1], lPosXi[2] );
1330 lXiRadius = TMath::Sqrt( lPosXi[0]*lPosXi[0] + lPosXi[1]*lPosXi[1] );
1331
1332 // - II.Step 3 : around the tracks : Bach + V0 (ESD)
1333 // ~ Necessary variables for ESDcascade data members coming from the ESDv0 part (inheritance)
1334 //-------------
1335
1336 UInt_t lIdxPosXi = (UInt_t) TMath::Abs( xi->GetPindex() );
1337 UInt_t lIdxNegXi = (UInt_t) TMath::Abs( xi->GetNindex() );
1338 UInt_t lBachIdx = (UInt_t) TMath::Abs( xi->GetBindex() );
1339 // Care track label can be negative in MC production (linked with the track quality)
1340 // However = normally, not the case for track index ...
1341
1342 // FIXME : rejection of a double use of a daughter track (nothing but just a crosscheck of what is done in the cascade vertexer)
1343 if(lBachIdx == lIdxNegXi) {
1344 AliWarning("Pb / Idx(Bach. track) = Idx(Neg. track) ... continue!"); continue;
1345 }
1346 if(lBachIdx == lIdxPosXi) {
1347 AliWarning("Pb / Idx(Bach. track) = Idx(Pos. track) ... continue!"); continue;
1348 }
1349
1350 AliESDtrack *pTrackXi = lESDevent->GetTrack( lIdxPosXi );
1351 AliESDtrack *nTrackXi = lESDevent->GetTrack( lIdxNegXi );
1352 AliESDtrack *bachTrackXi = lESDevent->GetTrack( lBachIdx );
1353
1354 if (!pTrackXi || !nTrackXi || !bachTrackXi ) {
1355 AliWarning("ERROR: Could not retrieve one of the 3 ESD daughter tracks of the cascade ...");
1356 continue;
1357 }
1358
1359 fTreeCascVarPosEta = pTrackXi->Eta();
1360 fTreeCascVarNegEta = nTrackXi->Eta();
1361 fTreeCascVarBachEta = bachTrackXi->Eta();
1362
1363 //------------------------------------------------
1364 // TPC dEdx information
1365 //------------------------------------------------
1366 fTreeCascVarNegNSigmaPion = fPIDResponse->NumberOfSigmasTPC( nTrackXi, AliPID::kPion );
1367 fTreeCascVarNegNSigmaProton = fPIDResponse->NumberOfSigmasTPC( nTrackXi, AliPID::kProton );
1368 fTreeCascVarPosNSigmaPion = fPIDResponse->NumberOfSigmasTPC( pTrackXi, AliPID::kPion );
1369 fTreeCascVarPosNSigmaProton = fPIDResponse->NumberOfSigmasTPC( pTrackXi, AliPID::kProton );
1370 fTreeCascVarBachNSigmaPion = fPIDResponse->NumberOfSigmasTPC( bachTrackXi, AliPID::kPion );
1371 fTreeCascVarBachNSigmaKaon = fPIDResponse->NumberOfSigmasTPC( bachTrackXi, AliPID::kKaon );
1372
1373 //------------------------------------------------
1374 // TPC Number of clusters info
1375 // --- modified to save the smallest number
1376 // --- of TPC clusters for the 3 tracks
1377 //------------------------------------------------
1378
1379 lPosTPCClusters = pTrackXi->GetTPCNcls();
1380 lNegTPCClusters = nTrackXi->GetTPCNcls();
1381 lBachTPCClusters = bachTrackXi->GetTPCNcls();
1382
1383 // 1 - Poor quality related to TPCrefit
1384 ULong_t pStatus = pTrackXi->GetStatus();
1385 ULong_t nStatus = nTrackXi->GetStatus();
1386 ULong_t bachStatus = bachTrackXi->GetStatus();
1387 if ((pStatus&AliESDtrack::kTPCrefit) == 0) { AliWarning("Pb / V0 Pos. track has no TPCrefit ... continue!"); continue; }
1388 if ((nStatus&AliESDtrack::kTPCrefit) == 0) { AliWarning("Pb / V0 Neg. track has no TPCrefit ... continue!"); continue; }
1389 if ((bachStatus&AliESDtrack::kTPCrefit) == 0) { AliWarning("Pb / Bach. track has no TPCrefit ... continue!"); continue; }
1390 // 2 - Poor quality related to TPC clusters: lowest cut of 70 clusters
1391 if(lPosTPCClusters < 70) { AliWarning("Pb / V0 Pos. track has less than 70 TPC clusters ... continue!"); continue; }
1392 if(lNegTPCClusters < 70) { AliWarning("Pb / V0 Neg. track has less than 70 TPC clusters ... continue!"); continue; }
1393 if(lBachTPCClusters < 70) { AliWarning("Pb / Bach. track has less than 70 TPC clusters ... continue!"); continue; }
1394 Int_t leastnumberofclusters = 1000;
1395 if( lPosTPCClusters < leastnumberofclusters ) leastnumberofclusters = lPosTPCClusters;
1396 if( lNegTPCClusters < leastnumberofclusters ) leastnumberofclusters = lNegTPCClusters;
1397 if( lBachTPCClusters < leastnumberofclusters ) leastnumberofclusters = lBachTPCClusters;
1398
1399 lInvMassLambdaAsCascDghter = xi->GetEffMass();
1400 // This value shouldn't change, whatever the working hyp. is : Xi-, Xi+, Omega-, Omega+
1401 lDcaV0DaughtersXi = xi->GetDcaV0Daughters();
1402 //lV0Chi2Xi = xi->GetChi2V0();
1403
1404 lV0CosineOfPointingAngleXi = xi->GetV0CosineOfPointingAngle( lBestPrimaryVtxPos[0],
1405 lBestPrimaryVtxPos[1],
1406 lBestPrimaryVtxPos[2] );
1407
1408 lDcaV0ToPrimVertexXi = xi->GetD( lBestPrimaryVtxPos[0],
1409 lBestPrimaryVtxPos[1],
1410 lBestPrimaryVtxPos[2] );
1411
1412 lDcaBachToPrimVertexXi = TMath::Abs( bachTrackXi->GetD( lBestPrimaryVtxPos[0],
1413 lBestPrimaryVtxPos[1],
1414 lMagneticField ) );
1415 // Note : AliExternalTrackParam::GetD returns an algebraic value ...
1416
1417 xi->GetXYZ( lPosV0Xi[0], lPosV0Xi[1], lPosV0Xi[2] );
1418 lV0RadiusXi = TMath::Sqrt( lPosV0Xi[0]*lPosV0Xi[0] + lPosV0Xi[1]*lPosV0Xi[1] );
1419
1420 lDcaPosToPrimVertexXi = TMath::Abs( pTrackXi ->GetD( lBestPrimaryVtxPos[0],
1421 lBestPrimaryVtxPos[1],
1422 lMagneticField ) );
1423
1424 lDcaNegToPrimVertexXi = TMath::Abs( nTrackXi ->GetD( lBestPrimaryVtxPos[0],
1425 lBestPrimaryVtxPos[1],
1426 lMagneticField ) );
1427
1428 // - II.Step 4 : around effective masses (ESD)
1429 // ~ change mass hypotheses to cover all the possibilities : Xi-/+, Omega -/+
1430
1431 if( bachTrackXi->Charge() < 0 ) {
1432 lV0quality = 0.;
1433 xi->ChangeMassHypothesis(lV0quality , 3312);
1434 // Calculate the effective mass of the Xi- candidate.
1435 // pdg code 3312 = Xi-
1436 lInvMassXiMinus = xi->GetEffMassXi();
1437
1438 lV0quality = 0.;
1439 xi->ChangeMassHypothesis(lV0quality , 3334);
1440 // Calculate the effective mass of the Xi- candidate.
1441 // pdg code 3334 = Omega-
1442 lInvMassOmegaMinus = xi->GetEffMassXi();
1443
1444 lV0quality = 0.;
1445 xi->ChangeMassHypothesis(lV0quality , 3312); // Back to default hyp.
1446 }// end if negative bachelor
1447
1448
1449 if( bachTrackXi->Charge() > 0 ){
1450 lV0quality = 0.;
1451 xi->ChangeMassHypothesis(lV0quality , -3312);
1452 // Calculate the effective mass of the Xi+ candidate.
1453 // pdg code -3312 = Xi+
1454 lInvMassXiPlus = xi->GetEffMassXi();
1455
1456 lV0quality = 0.;
1457 xi->ChangeMassHypothesis(lV0quality , -3334);
1458 // Calculate the effective mass of the Xi+ candidate.
1459 // pdg code -3334 = Omega+
1460 lInvMassOmegaPlus = xi->GetEffMassXi();
1461
1462 lV0quality = 0.;
1463 xi->ChangeMassHypothesis(lV0quality , -3312); // Back to "default" hyp.
1464 }// end if positive bachelor
1465 // - II.Step 6 : extra info for QA (ESD)
1466 // miscellaneous pieces of info that may help regarding data quality assessment.
1467 //-------------
1468
1469 xi->GetPxPyPz( lXiMomX, lXiMomY, lXiMomZ );
1470 lXiTransvMom = TMath::Sqrt( lXiMomX*lXiMomX + lXiMomY*lXiMomY );
1471 lXiTotMom = TMath::Sqrt( lXiMomX*lXiMomX + lXiMomY*lXiMomY + lXiMomZ*lXiMomZ );
1472
1473 xi->GetBPxPyPz( lBachMomX, lBachMomY, lBachMomZ );
1474 //lBachTransvMom = TMath::Sqrt( lBachMomX*lBachMomX + lBachMomY*lBachMomY );
1475 //lBachTotMom = TMath::Sqrt( lBachMomX*lBachMomX + lBachMomY*lBachMomY + lBachMomZ*lBachMomZ );
1476
1477 lChargeXi = xi->Charge();
1478
1479 //lV0toXiCosineOfPointingAngle = xi->GetV0CosineOfPointingAngle( lPosXi[0], lPosXi[1], lPosXi[2] );
1480
1481 lRapXi = xi->RapXi();
1482 lRapOmega = xi->RapOmega();
1483 //lEta = xi->Eta();
1484 //lTheta = xi->Theta() *180.0/TMath::Pi();
1485 //lPhi = xi->Phi() *180.0/TMath::Pi();
1486 //lAlphaXi = xi->AlphaXi();
1487 //lPtArmXi = xi->PtArmXi();
1488
1489//------------------------------------------------
1490// Associate Cascade Candidates to Monte Carlo!
1491//------------------------------------------------
1492
1493//Warning: Not using Continues... Need to fill tree later!
1494
1495 Int_t lPDGCodeCascade = 0;
1496
1497 Int_t lPID_BachMother = 0;
1498 Int_t lPID_NegMother = 0;
1499 Int_t lPID_PosMother = 0;
1500
1501
1502 fTreeCascVarPIDPositive = 0;
1503 fTreeCascVarPIDNegative = 0;
1504 fTreeCascVarPIDBachelor = 0;
1505
1506
1507 if(fDebug > 5)
1508 cout << "MC EventNumber : " << lMCevent->Header()->GetEvent()
1509 << " / MC event Number in Run : " << lMCevent->Header()->GetEventNrInRun() << endl;
1510
1511 // - Step 4.1 : level of the V0 daughters
1512
1513//----------------------------------------
1514// Regular MC ASSOCIATION STARTS HERE
1515//----------------------------------------
1516
1517 Int_t lblPosV0Dghter = (Int_t) TMath::Abs( pTrackXi->GetLabel() );
1518 // Abs value = needed ! question of quality track association ...
1519 Int_t lblNegV0Dghter = (Int_t) TMath::Abs( nTrackXi->GetLabel() );
1520 Int_t lblBach = (Int_t) TMath::Abs( bachTrackXi->GetLabel() );
1521
1522 TParticle* mcPosV0Dghter = lMCstack->Particle( lblPosV0Dghter );
1523 TParticle* mcNegV0Dghter = lMCstack->Particle( lblNegV0Dghter );
1524 TParticle* mcBach = lMCstack->Particle( lblBach );
1525
1526 fTreeCascVarPosTransMomMC = mcPosV0Dghter->Pt();
1527 fTreeCascVarNegTransMomMC = mcNegV0Dghter->Pt();
1528
1529 fTreeCascVarPIDPositive = mcPosV0Dghter -> GetPdgCode();
1530 fTreeCascVarPIDNegative = mcNegV0Dghter -> GetPdgCode();
1531 fTreeCascVarPIDBachelor = mcBach->GetPdgCode();
1532
1533 // - Step 4.2 : level of the Xi daughters
1534
1535 Int_t lblMotherPosV0Dghter = mcPosV0Dghter->GetFirstMother() ;
1536 Int_t lblMotherNegV0Dghter = mcNegV0Dghter->GetFirstMother();
1537
1538 //Rather uncivilized: Open brackets for each 'continue'
1539 if(! (lblMotherPosV0Dghter != lblMotherNegV0Dghter) ) { // same mother
1540 if(! (lblMotherPosV0Dghter < 0) ) { // mother != primary (!= -1)
1541 if(! (lblMotherNegV0Dghter < 0) ) {
1542
1543 // mothers = Lambda candidate ... a priori
1544
1545 TParticle* mcMotherPosV0Dghter = lMCstack->Particle( lblMotherPosV0Dghter );
1546 TParticle* mcMotherNegV0Dghter = lMCstack->Particle( lblMotherNegV0Dghter );
1547
1548 // - Step 4.3 : level of Xi candidate
1549
1550 Int_t lblGdMotherPosV0Dghter = mcMotherPosV0Dghter->GetFirstMother() ;
1551 Int_t lblGdMotherNegV0Dghter = mcMotherNegV0Dghter->GetFirstMother() ;
1552
1553 if(! (lblGdMotherPosV0Dghter != lblGdMotherNegV0Dghter) ) {
1554 if(! (lblGdMotherPosV0Dghter < 0) ) { // primary lambda ...
1555 if(! (lblGdMotherNegV0Dghter < 0) ) { // primary lambda ...
1556
1557 // Gd mothers = Xi candidate ... a priori
1558
1559 TParticle* mcGdMotherPosV0Dghter = lMCstack->Particle( lblGdMotherPosV0Dghter );
1560 TParticle* mcGdMotherNegV0Dghter = lMCstack->Particle( lblGdMotherNegV0Dghter );
1561
1562 Int_t lblMotherBach = (Int_t) TMath::Abs( mcBach->GetFirstMother() );
1563
1564 // if( lblMotherBach != lblGdMotherPosV0Dghter ) continue; //same mother for bach and V0 daughters
1565 if(!(lblMotherBach != lblGdMotherPosV0Dghter)) { //same mother for bach and V0 daughters
1566
1567 TParticle* mcMotherBach = lMCstack->Particle( lblMotherBach );
1568
1569 lPID_BachMother = mcMotherBach->GetPdgCode();
1570 lPID_NegMother = mcGdMotherPosV0Dghter->GetPdgCode();
1571 lPID_PosMother = mcGdMotherNegV0Dghter->GetPdgCode();
1572
1573 if(lPID_BachMother==lPID_NegMother && lPID_BachMother==lPID_PosMother){
1574 lPDGCodeCascade = lPID_BachMother;
1575 lXiTransvMomMC = mcMotherBach->Pt();
1576 if ( (mcMotherBach->Energy() + mcMotherBach->Pz()) / (mcMotherBach->Energy() - mcMotherBach->Pz() +1.e-13) !=0 ){
1577 lRapMC = 0.5*TMath::Log( (mcMotherBach->Energy() + mcMotherBach->Pz()) / (mcMotherBach->Energy() - mcMotherBach->Pz() +1.e-13) );
1578 }
1579 }
1580
1581 }}}}}}} //Ends all conditionals above...
1582
1583 //----------------------------------------
1584 // Regular MC ASSOCIATION ENDS HERE
1585 //----------------------------------------
1586
1587 //------------------------------------------------
1588 // Set Variables for adding to tree
1589 //------------------------------------------------
1590
1591/* 1*/ fTreeCascVarCharge = lChargeXi;
1592/* 2*/ if(lInvMassXiMinus!=0) fTreeCascVarMassAsXi = lInvMassXiMinus;
1593/* 2*/ if(lInvMassXiPlus!=0) fTreeCascVarMassAsXi = lInvMassXiPlus;
1594/* 3*/ if(lInvMassOmegaMinus!=0) fTreeCascVarMassAsOmega = lInvMassOmegaMinus;
1595/* 3*/ if(lInvMassOmegaPlus!=0) fTreeCascVarMassAsOmega = lInvMassOmegaPlus;
1596/* 4*/ fTreeCascVarPt = lXiTransvMom;
1597/* 4*/ fTreeCascVarPtMC = lXiTransvMomMC;
1598/* 5*/ fTreeCascVarRapXi = lRapXi ;
1599/* 5*/ fTreeCascVarRapMC = lRapMC ;
1600/* 6*/ fTreeCascVarRapOmega = lRapOmega ;
1601/* 7*/ fTreeCascVarDCACascDaughters = lDcaXiDaughters;
1602/* 8*/ fTreeCascVarDCABachToPrimVtx = lDcaBachToPrimVertexXi;
1603/* 9*/ fTreeCascVarDCAV0Daughters = lDcaV0DaughtersXi;
1604/*10*/ fTreeCascVarDCAV0ToPrimVtx = lDcaV0ToPrimVertexXi;
1605/*11*/ fTreeCascVarDCAPosToPrimVtx = lDcaPosToPrimVertexXi;
1606/*12*/ fTreeCascVarDCANegToPrimVtx = lDcaNegToPrimVertexXi;
1607/*13*/ fTreeCascVarCascCosPointingAngle = lXiCosineOfPointingAngle;
1608/*14*/ fTreeCascVarCascRadius = lXiRadius;
1609/*15*/ fTreeCascVarV0Mass = lInvMassLambdaAsCascDghter;
1610/*16*/ fTreeCascVarV0CosPointingAngle = lV0CosineOfPointingAngleXi;
1611/*17*/ fTreeCascVarV0Radius = lV0RadiusXi;
1612/*20*/ fTreeCascVarLeastNbrClusters = leastnumberofclusters;
1613/*21*/ fTreeCascVarMultiplicity = lMultiplicity; //multiplicity, whatever that may be
1614
1615/*23*/ fTreeCascVarDistOverTotMom = TMath::Sqrt(
1616 TMath::Power( lPosXi[0] - lBestPrimaryVtxPos[0] , 2) +
1617 TMath::Power( lPosXi[1] - lBestPrimaryVtxPos[1] , 2) +
1618 TMath::Power( lPosXi[2] - lBestPrimaryVtxPos[2] , 2)
1619 );
1620/*23*/ fTreeCascVarDistOverTotMom /= (lXiTotMom+1e-13);
1621/*24*/ //Not specified here, it has been set already (TRunNumber)
1622/*25*/ fTreeCascVarPID = lPDGCodeCascade;
1623
1624//------------------------------------------------
1625// Fill Tree!
1626//------------------------------------------------
1627
1628// The conditional is meant to decrease excessive
1629// memory usage! Be careful when loosening the
1630// cut!
1631
1632 //Xi Mass window: 150MeV wide
1633 //Omega mass window: 150MeV wide
1634
1635 if( (fTreeCascVarMassAsXi<1.32+0.075&&fTreeCascVarMassAsXi>1.32-0.075) ||
1636 (fTreeCascVarMassAsOmega<1.68+0.075&&fTreeCascVarMassAsOmega>1.68-0.075) ){
1637 fTreeCascade->Fill();
1638 }
1639
1640//------------------------------------------------
1641// Fill tree over.
1642//------------------------------------------------
1643
1644 }// end of the Cascade loop (ESD or AOD)
1645
1646 // Post output data.
1647 PostData(1, fListHist);
1648 PostData(2, fTreeCascade);
1649}
1650
1651//________________________________________________________________________
1652void AliAnalysisTaskExtractPerformanceCascade::Terminate(Option_t *)
1653{
1654 // Draw result to the screen
1655 // Called once at the end of the query
1656
1657 TList *cRetrievedList = 0x0;
1658 cRetrievedList = (TList*)GetOutputData(1);
1659 if(!cRetrievedList){
1660 Printf("ERROR - AliAnalysisTaskExtractCascade : ouput data container list not available\n");
1661 return;
1662 }
1663
1664 fHistV0MultiplicityForTrigEvt = dynamic_cast<TH1F*> ( cRetrievedList->FindObject("fHistV0MultiplicityForTrigEvt") );
1665 if (!fHistV0MultiplicityForTrigEvt) {
1666 Printf("ERROR - AliAnalysisTaskExtractCascade : fHistV0MultiplicityForTrigEvt not available");
1667 return;
1668 }
1669
1670 TCanvas *canCheck = new TCanvas("AliAnalysisTaskExtractCascade","V0 Multiplicity",10,10,510,510);
1671 canCheck->cd(1)->SetLogy();
1672
1673 fHistV0MultiplicityForTrigEvt->SetMarkerStyle(22);
1674 fHistV0MultiplicityForTrigEvt->DrawCopy("E");
1675}
1676
1677//----------------------------------------------------------------------------
1678
1679Double_t AliAnalysisTaskExtractPerformanceCascade::MyRapidity(Double_t rE, Double_t rPz) const
1680{
1681 // Local calculation for rapidity
1682 Double_t ReturnValue = -100;
1683 if( (rE-rPz+1.e-13) != 0 && (rE+rPz) != 0 ){
1684 ReturnValue = 0.5*TMath::Log((rE+rPz)/(rE-rPz+1.e-13));
1685 }
1686 return ReturnValue;
1687}