AliPhysics  b43479f (b43479f)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliAnalysisTaskSEXic2eleXifromAODtracks.cxx
Go to the documentation of this file.
1 /**************************************************************************
2  * Copyright(c) 1998-2009, ALICE Experiment at CERN, All rights reserved. *
3  * *
4  * Author: The ALICE Off-line Project. *
5  * Contributors are mentioned in the code where appropriate. *
6  * *
7  * Permission to use, copy, modify and distribute this software and its *
8  * documentation strictly for non-commercial purposes is hereby granted *
9  * without fee, provided that the above copyright notice appears in all *
10  * copies and that both the copyright notice and this permission notice *
11  * appeuear in the supporting documentation. The authors make no claims *
12  * about the suitability of this software for any purpose. It is *
13  * provided "as is" without express or implied warranty. *
14  **************************************************************************/
15 
16 /* $Id$ */
17 
18 //
19 //
20 // Xic->eXi analysis code
21 //
22 // Input: AOD
23 // Output: TTree or THnSparse (mass vs pT vs Centrality)
24 //
25 //-------------------------------------------------------------------------
26 //
27 // Authors: Y.S Watanabe(a)
28 // (a) CNS, the University of Tokyo
29 // Contatcs: wyosuke@cns.s.u-tokyo.ac.jp
30 //-------------------------------------------------------------------------
31 
32 #include <TSystem.h>
33 #include <TParticle.h>
34 #include <TParticlePDG.h>
35 #include <TH1F.h>
36 #include <TH1F.h>
37 #include <TH2F.h>
38 #include <THnSparse.h>
39 #include <TLorentzVector.h>
40 #include <TTree.h>
41 #include "TROOT.h"
42 #include <TDatabasePDG.h>
43 #include <AliAnalysisDataSlot.h>
44 #include <AliAnalysisDataContainer.h>
45 #include "AliStack.h"
46 #include "AliMCEvent.h"
47 #include "AliAnalysisManager.h"
48 #include "AliAODMCHeader.h"
49 #include "AliAODHandler.h"
50 #include "AliLog.h"
51 #include "AliExternalTrackParam.h"
52 #include "AliAODVertex.h"
53 #include "AliESDVertex.h"
54 #include "AliAODRecoDecay.h"
55 #include "AliAODRecoDecayHF.h"
56 #include "AliAODRecoCascadeHF.h"
57 #include "AliESDtrack.h"
58 #include "AliAODTrack.h"
59 #include "AliAODv0.h"
60 #include "AliAODcascade.h"
61 #include "AliAODMCParticle.h"
62 #include "AliAnalysisTaskSE.h"
64 #include "AliPIDResponse.h"
65 #include "AliPIDCombined.h"
66 #include "AliTOFPIDResponse.h"
67 #include "AliAODPidHF.h"
68 #include "AliInputEventHandler.h"
69 #include "AliESDtrackCuts.h"
70 #include "AliNeutralTrackParam.h"
71 #include "AliKFParticle.h"
72 #include "AliKFVertex.h"
73 #include "AliExternalTrackParam.h"
74 #include "AliESDtrack.h"
75 #include "AliCentrality.h"
76 #include "AliVertexerTracks.h"
77 #include "AliEventPoolManager.h"
79 
80 using std::cout;
81 using std::endl;
82 
86 
87 //__________________________________________________________________________
89  AliAnalysisTaskSE(),
90  fUseMCInfo(kFALSE),
91  fOutput(0),
92  fOutputAll(0),
93  fListCuts(0),
94  fCEvents(0),
95  fHTrigger(0),
96  fHCentrality(0),
97  fAnalCuts(0),
98  fIsEventSelected(kFALSE),
99  fWriteVariableTree(kFALSE),
100  fWriteEachVariableTree(kFALSE),
101  fWriteMCVariableTree(kFALSE),
102  fVariablesTree(0),
103  fEleVariablesTree(0),
104  fCascVariablesTree(0),
105  fMCVariablesTree(0),
106  fMCEleVariablesTree(0),
107  fMCCascVariablesTree(0),
108  fMCGenPairVariablesTree(0),
109  fCorrelationVariablesTree(0),
110  fReconstructPrimVert(kFALSE),
111  fIsMB(kFALSE),
112  fIsSemi(kFALSE),
113  fIsCent(kFALSE),
114  fIsINT7(kFALSE),
115  fIsEMC7(kFALSE),
116  fCandidateVariables(),
117  fCandidateEleVariables(),
118  fCandidateCascVariables(),
119  fCandidateMCVariables(),
120  fCandidateMCEleVariables(),
121  fCandidateMCCascVariables(),
122  fCandidateMCGenPairVariables(),
123  fCorrelationVariables(),
124  fVtx1(0),
125  fV1(0),
126  fVtxZ(0),
127  fBzkG(0),
128  fCentrality(0),
129  fRunNumber(0),
130  fTriggerCheck(0),
131  fUseCentralityV0M(kFALSE),
132  fEvNumberCounter(0),
133  fMCEventType(-9999),
134  fMCDoPairAnalysis(kFALSE),
135  fHistoEleXiMass(0),
136  fHistoEleXiMassRS(0),
137  fHistoEleXiMassWS(0),
138  fHistoEleXiMassRSMix(0),
139  fHistoEleXiMassWSMix(0),
140  fHistoEleXiMassRSSide(0),
141  fHistoEleXiMassWSSide(0),
142  fHistoEleXiMassRS1(0),
143  fHistoEleXiMassWS1(0),
144  fHistoEleXiMassRSMix1(0),
145  fHistoEleXiMassWSMix1(0),
146  fHistoEleXiMassRSSide1(0),
147  fHistoEleXiMassWSSide1(0),
148  fHistoEleXiMassRS2(0),
149  fHistoEleXiMassWS2(0),
150  fHistoEleXiMassRSMix2(0),
151  fHistoEleXiMassWSMix2(0),
152  fHistoEleXiMassRSSide2(0),
153  fHistoEleXiMassWSSide2(0),
154  fHistoEleXiMassAway(0),
155  fHistoEleXiMassRSAway(0),
156  fHistoEleXiMassWSAway(0),
157  fHistoEleXiMassRSMixAway(0),
158  fHistoEleXiMassWSMixAway(0),
159  fHistoEleXiMassRSSideAway(0),
160  fHistoEleXiMassWSSideAway(0),
161  fHistoEleXiMassRS1Away(0),
162  fHistoEleXiMassWS1Away(0),
163  fHistoEleXiMassRSMix1Away(0),
164  fHistoEleXiMassWSMix1Away(0),
165  fHistoEleXiMassRSSide1Away(0),
166  fHistoEleXiMassWSSide1Away(0),
167  fHistoEleXiMassRS2Away(0),
168  fHistoEleXiMassWS2Away(0),
169  fHistoEleXiMassRSMix2Away(0),
170  fHistoEleXiMassWSMix2Away(0),
171  fHistoEleXiMassRSSide2Away(0),
172  fHistoEleXiMassWSSide2Away(0),
173  fHistoEleXiMassvsElePtRS(0),
174  fHistoEleXiMassvsElePtWS(0),
175  fHistoEleXiMassvsElePtRSMix(0),
176  fHistoEleXiMassvsElePtWSMix(0),
177  fHistoEleXiMassvsElePtRSSide(0),
178  fHistoEleXiMassvsElePtWSSide(0),
179  fHistoEleXiMassvsElePtRS1(0),
180  fHistoEleXiMassvsElePtWS1(0),
181  fHistoEleXiMassvsElePtRSMix1(0),
182  fHistoEleXiMassvsElePtWSMix1(0),
183  fHistoEleXiMassvsElePtRSSide1(0),
184  fHistoEleXiMassvsElePtWSSide1(0),
185  fHistoEleXiMassvsElePtRS2(0),
186  fHistoEleXiMassvsElePtWS2(0),
187  fHistoEleXiMassvsElePtRSMix2(0),
188  fHistoEleXiMassvsElePtWSMix2(0),
189  fHistoEleXiMassvsElePtRSSide2(0),
190  fHistoEleXiMassvsElePtWSSide2(0),
191  fHistoElePtRS(0),
192  fHistoElePtWS(0),
193  fHistoElePtRSMix(0),
194  fHistoElePtWSMix(0),
195  fHistoEleXiMassMCS(0),
196  fHistoEleXiMassMCS1(0),
197  fHistoEleXiMassMCS2(0),
198  fHistoEleXiMassXibMCS(0),
199  fHistoEleXiMassXibMCS1(0),
200  fHistoEleXiMassXibMCS2(0),
201  fHistoEleXiMassPromptMCS(0),
202  fHistoEleXiMassPromptMCS1(0),
203  fHistoEleXiMassPromptMCS2(0),
204  fHistoEleXiMassBFeeddownMCS(0),
205  fHistoEleXiMassBFeeddownMCS1(0),
206  fHistoEleXiMassBFeeddownMCS2(0),
207  fHistoEleXiMassMCGen(0),
208  fHistoEleXiMassvsElePtMCS(0),
209  fHistoEleXiMassvsElePtMCGen(0),
210  fHistoEleXiMassvsElePtMCS1(0),
211  fHistoEleXiMassvsElePtMCGen1(0),
212  fHistoEleXiMassvsElePtMCS2(0),
213  fHistoEleXiMassvsElePtMCGen2(0),
214  fHistoElePtMCS(0),
215  fHistoElePtMCGen(0),
216  fHistoElePtvsEtaRS(0),
217  fHistoElePtvsEtaWS(0),
218  fHistoElePtvsEtaRSMix(0),
219  fHistoElePtvsEtaWSMix(0),
220  fHistoElePtvsEtaMCS(0),
221  fHistoElePtvsEtaMCGen(0),
222  fHistoElePtvsXiPtRS(0),
223  fHistoElePtvsXiPtWS(0),
224  fHistoElePtvsXiPtRSMix(0),
225  fHistoElePtvsXiPtWSMix(0),
226  fHistoElePtvsXiPtMCS(0),
227  fHistoElePtvsXiPtvsXicPtMCS(0),
228  fHistoElePtvsXiPtMCGen(0),
229  fHistoElePtvsXiPtvsXicPtMCGen(0),
230  fHistoElePtvsXiPtMCXicGen(0),
231  fHistoElePtvsd0RS(0),
232  fHistoElePtvsd0WS(0),
233  fHistoElePtvsd0RSMix(0),
234  fHistoElePtvsd0WSMix(0),
235  fHistoElePtvsd0MCS(0),
236  fHistoElePtvsd0PromptMCS(0),
237  fHistoElePtvsd0BFeeddownMCS(0),
238  fHistoBachPt(0),
239  fHistoBachPtMCS(0),
240  fHistoBachPtMCGen(0),
241  fHistod0Bach(0),
242  fHistoXiMassvsPt(0),
243  fHistoXiMassvsPtMCS(0),
244  fHistoXiMassvsPtMCGen(0),
245  fHistoOmegaMassvsPt(0),
246  fHistoElectronTPCPID(0),
247  fHistoElectronTOFPID(0),
248  fHistoElectronTPCSelPID(0),
249  fHistoElectronTOFSelPID(0),
250  fHistoElectronTPCPIDSelTOF(0),
251  fHistoElectronTOFPIDSelTPC(0),
252  fHistoElectronTPCPIDSelTOFSmallEta(0),
253  fHistoElectronTPCPIDSelTOFLargeEta(0),
254  fHistoMassConversionsMin(0),
255  fHistoMassConversionsSameSignMin(0),
256  fHistoElectronQovPtvsPhi(0),
257  fHistoXiQovPtvsPhi(0),
258  fHistoXicMCGen(0),
259  fHistoXicMCGen1(0),
260  fHistoXicMCGen2(0),
261  fHistoXicMCS(0),
262  fHistoXicMCS1(0),
263  fHistoXicMCS2(0),
264  fHistoXicElectronMCGen(0),
265  fHistoXicElectronMCGen1(0),
266  fHistoXicElectronMCGen2(0),
267  fHistoXicElectronMCS(0),
268  fHistoXicElectronMCS1(0),
269  fHistoXicElectronMCS2(0),
270  fHistoElectronMCGen(0),
271  fHistoBottomElectronMCGen(0),
272  fHistoCharmElectronMCGen(0),
273  fHistoXiMCGen(0),
274  fHistoLambdaPtvsDl(0),
275  fHistoLambdaPtvsDlSide(0),
276  fHistoLambdaPtvsDlMCS(0),
277  fHistoLambdaPtvsDR(0),
278  fHistoLambdaPtvsDRSide(0),
279  fHistoLambdaPtvsDRMCS(0),
280  fHistoEleXiPtvsRapidityRS(0),
281  fHistoEleXiPtvsRapidityWS(0),
282  fHistoEleXiPtvsRapidityMCS(0),
283  fHistoResponseElePt(0),
284  fHistoResponseXiPt(0),
285  fHistoResponseEleXiPt(0),
286  fHistoPi0MCGen(0),
287  fHistoElectronPi0Total(0),
288  fHistoElectronPi0Tag(0),
289  fHistoEtaMCGen(0),
290  fHistoElectronEtaTotal(0),
291  fHistoElectronEtaTag(0),
292  fCounter(0),
293  fHistonEvtvsRunNumber(0),
294  fHistonElevsRunNumber(0),
295  fHistonXivsRunNumber(0),
296  fHistoMCEventType(0),
297  fHistoMCXic0Decays(0),
298  fHistoMCDeltaPhiccbar(0),
299  fHistoMCNccbar(0),
300  fGTI(0),fGTIndex(0), fTrackBuffSize(19000),
301  fHistodPhiSdEtaSElectronProtonR125RS(0),
302  fHistodPhiSdEtaSElectronProtonR125WS(0),
303  fHistodPhiSdEtaSElectronProtonR125RSMix(0),
304  fHistodPhiSdEtaSElectronProtonR125WSMix(0),
305  fHistodPhiSdEtaSElectronPionR125RS(0),
306  fHistodPhiSdEtaSElectronPionR125WS(0),
307  fHistodPhiSdEtaSElectronPionR125RSMix(0),
308  fHistodPhiSdEtaSElectronPionR125WSMix(0),
309  fHistodPhiSdEtaSElectronBachelorR125RS(0),
310  fHistodPhiSdEtaSElectronBachelorR125WS(0),
311  fHistodPhiSdEtaSElectronBachelorR125RSMix(0),
312  fHistodPhiSdEtaSElectronBachelorR125WSMix(0),
313  fDoEventMixing(0),
314  fMixWithoutConversionFlag(kTRUE),
315  fNumberOfEventsForMixing (5),
316  fNzVtxBins (0),
317  fNCentBins (0),
318  fNOfPools(1),
319  fEventBuffer(0x0),
320  fEventInfo(0x0),
321  fElectronTracks(0x0),
322  fCascadeTracks1(0x0),
323  fCascadeTracks2(0x0),
324  fElectronCutVarsArray(0x0),
325  fCascadeCutVarsArray1(0x0),
326  fCascadeCutVarsArray2(0x0)
327 {
328  //
329  // Default Constructor.
330  //
331  for(Int_t i=0;i<23;i++){
332  fHistoElePtvsCutVarsRS[i] = 0;
333  fHistoElePtvsCutVarsWS[i] = 0;
335  }
336  for(Int_t i=0;i<8;i++){
338  }
339 }
340 
341 //___________________________________________________________________________
344  Bool_t writeVariableTree) :
345  AliAnalysisTaskSE(name),
346  fUseMCInfo(kFALSE),
347  fOutput(0),
348  fOutputAll(0),
349  fListCuts(0),
350  fCEvents(0),
351  fHTrigger(0),
352  fHCentrality(0),
353  fAnalCuts(analCuts),
354  fIsEventSelected(kFALSE),
355  fWriteVariableTree(writeVariableTree),
356  fWriteEachVariableTree(kFALSE),
357  fWriteMCVariableTree(kFALSE),
358  fVariablesTree(0),
359  fEleVariablesTree(0),
360  fCascVariablesTree(0),
361  fMCVariablesTree(0),
362  fMCEleVariablesTree(0),
363  fMCCascVariablesTree(0),
364  fMCGenPairVariablesTree(0),
365  fCorrelationVariablesTree(0),
366  fReconstructPrimVert(kFALSE),
367  fIsMB(kFALSE),
368  fIsSemi(kFALSE),
369  fIsCent(kFALSE),
370  fIsINT7(kFALSE),
371  fIsEMC7(kFALSE),
372  fCandidateVariables(),
373  fCandidateEleVariables(),
374  fCandidateCascVariables(),
375  fCandidateMCVariables(),
376  fCandidateMCEleVariables(),
377  fCandidateMCCascVariables(),
378  fCandidateMCGenPairVariables(),
379  fCorrelationVariables(),
380  fVtx1(0),
381  fV1(0),
382  fVtxZ(0),
383  fBzkG(0),
384  fCentrality(0),
385  fRunNumber(0),
386  fTriggerCheck(0),
387  fUseCentralityV0M(kFALSE),
388  fEvNumberCounter(0),
389  fMCEventType(-9999),
390  fMCDoPairAnalysis(kFALSE),
391  fHistoEleXiMass(0),
392  fHistoEleXiMassRS(0),
393  fHistoEleXiMassWS(0),
394  fHistoEleXiMassRSMix(0),
395  fHistoEleXiMassWSMix(0),
396  fHistoEleXiMassRSSide(0),
397  fHistoEleXiMassWSSide(0),
398  fHistoEleXiMassRS1(0),
399  fHistoEleXiMassWS1(0),
400  fHistoEleXiMassRSMix1(0),
401  fHistoEleXiMassWSMix1(0),
402  fHistoEleXiMassRSSide1(0),
403  fHistoEleXiMassWSSide1(0),
404  fHistoEleXiMassRS2(0),
405  fHistoEleXiMassWS2(0),
406  fHistoEleXiMassRSMix2(0),
407  fHistoEleXiMassWSMix2(0),
408  fHistoEleXiMassRSSide2(0),
409  fHistoEleXiMassWSSide2(0),
410  fHistoEleXiMassAway(0),
411  fHistoEleXiMassRSAway(0),
412  fHistoEleXiMassWSAway(0),
413  fHistoEleXiMassRSMixAway(0),
414  fHistoEleXiMassWSMixAway(0),
415  fHistoEleXiMassRSSideAway(0),
416  fHistoEleXiMassWSSideAway(0),
417  fHistoEleXiMassRS1Away(0),
418  fHistoEleXiMassWS1Away(0),
419  fHistoEleXiMassRSMix1Away(0),
420  fHistoEleXiMassWSMix1Away(0),
421  fHistoEleXiMassRSSide1Away(0),
422  fHistoEleXiMassWSSide1Away(0),
423  fHistoEleXiMassRS2Away(0),
424  fHistoEleXiMassWS2Away(0),
425  fHistoEleXiMassRSMix2Away(0),
426  fHistoEleXiMassWSMix2Away(0),
427  fHistoEleXiMassRSSide2Away(0),
428  fHistoEleXiMassWSSide2Away(0),
429  fHistoEleXiMassvsElePtRS(0),
430  fHistoEleXiMassvsElePtWS(0),
431  fHistoEleXiMassvsElePtRSMix(0),
432  fHistoEleXiMassvsElePtWSMix(0),
433  fHistoEleXiMassvsElePtRSSide(0),
434  fHistoEleXiMassvsElePtWSSide(0),
435  fHistoEleXiMassvsElePtRS1(0),
436  fHistoEleXiMassvsElePtWS1(0),
437  fHistoEleXiMassvsElePtRSMix1(0),
438  fHistoEleXiMassvsElePtWSMix1(0),
439  fHistoEleXiMassvsElePtRSSide1(0),
440  fHistoEleXiMassvsElePtWSSide1(0),
441  fHistoEleXiMassvsElePtRS2(0),
442  fHistoEleXiMassvsElePtWS2(0),
443  fHistoEleXiMassvsElePtRSMix2(0),
444  fHistoEleXiMassvsElePtWSMix2(0),
445  fHistoEleXiMassvsElePtRSSide2(0),
446  fHistoEleXiMassvsElePtWSSide2(0),
447  fHistoElePtRS(0),
448  fHistoElePtWS(0),
449  fHistoElePtRSMix(0),
450  fHistoElePtWSMix(0),
451  fHistoEleXiMassMCS(0),
452  fHistoEleXiMassMCS1(0),
453  fHistoEleXiMassMCS2(0),
454  fHistoEleXiMassXibMCS(0),
455  fHistoEleXiMassXibMCS1(0),
456  fHistoEleXiMassXibMCS2(0),
457  fHistoEleXiMassPromptMCS(0),
458  fHistoEleXiMassPromptMCS1(0),
459  fHistoEleXiMassPromptMCS2(0),
460  fHistoEleXiMassBFeeddownMCS(0),
461  fHistoEleXiMassBFeeddownMCS1(0),
462  fHistoEleXiMassBFeeddownMCS2(0),
463  fHistoEleXiMassMCGen(0),
464  fHistoEleXiMassvsElePtMCS(0),
465  fHistoEleXiMassvsElePtMCGen(0),
466  fHistoEleXiMassvsElePtMCS1(0),
467  fHistoEleXiMassvsElePtMCGen1(0),
468  fHistoEleXiMassvsElePtMCS2(0),
469  fHistoEleXiMassvsElePtMCGen2(0),
470  fHistoElePtMCS(0),
471  fHistoElePtMCGen(0),
472  fHistoElePtvsEtaRS(0),
473  fHistoElePtvsEtaWS(0),
474  fHistoElePtvsEtaRSMix(0),
475  fHistoElePtvsEtaWSMix(0),
476  fHistoElePtvsEtaMCS(0),
477  fHistoElePtvsEtaMCGen(0),
478  fHistoElePtvsXiPtRS(0),
479  fHistoElePtvsXiPtWS(0),
480  fHistoElePtvsXiPtRSMix(0),
481  fHistoElePtvsXiPtWSMix(0),
482  fHistoElePtvsXiPtMCS(0),
483  fHistoElePtvsXiPtvsXicPtMCS(0),
484  fHistoElePtvsXiPtMCGen(0),
485  fHistoElePtvsXiPtvsXicPtMCGen(0),
486  fHistoElePtvsXiPtMCXicGen(0),
487  fHistoElePtvsd0RS(0),
488  fHistoElePtvsd0WS(0),
489  fHistoElePtvsd0RSMix(0),
490  fHistoElePtvsd0WSMix(0),
491  fHistoElePtvsd0MCS(0),
492  fHistoElePtvsd0PromptMCS(0),
493  fHistoElePtvsd0BFeeddownMCS(0),
494  fHistoBachPt(0),
495  fHistoBachPtMCS(0),
496  fHistoBachPtMCGen(0),
497  fHistod0Bach(0),
498  fHistoXiMassvsPt(0),
499  fHistoXiMassvsPtMCS(0),
500  fHistoXiMassvsPtMCGen(0),
501  fHistoOmegaMassvsPt(0),
502  fHistoElectronTPCPID(0),
503  fHistoElectronTOFPID(0),
504  fHistoElectronTPCSelPID(0),
505  fHistoElectronTOFSelPID(0),
506  fHistoElectronTPCPIDSelTOF(0),
507  fHistoElectronTOFPIDSelTPC(0),
508  fHistoElectronTPCPIDSelTOFSmallEta(0),
509  fHistoElectronTPCPIDSelTOFLargeEta(0),
510  fHistoMassConversionsMin(0),
511  fHistoMassConversionsSameSignMin(0),
512  fHistoElectronQovPtvsPhi(0),
513  fHistoXiQovPtvsPhi(0),
514  fHistoXicMCGen(0),
515  fHistoXicMCGen1(0),
516  fHistoXicMCGen2(0),
517  fHistoXicMCS(0),
518  fHistoXicMCS1(0),
519  fHistoXicMCS2(0),
520  fHistoXicElectronMCGen(0),
521  fHistoXicElectronMCGen1(0),
522  fHistoXicElectronMCGen2(0),
523  fHistoXicElectronMCS(0),
524  fHistoXicElectronMCS1(0),
525  fHistoXicElectronMCS2(0),
526  fHistoElectronMCGen(0),
527  fHistoBottomElectronMCGen(0),
528  fHistoCharmElectronMCGen(0),
529  fHistoXiMCGen(0),
530  fHistoLambdaPtvsDl(0),
531  fHistoLambdaPtvsDlSide(0),
532  fHistoLambdaPtvsDlMCS(0),
533  fHistoLambdaPtvsDR(0),
534  fHistoLambdaPtvsDRSide(0),
535  fHistoLambdaPtvsDRMCS(0),
536  fHistoEleXiPtvsRapidityRS(0),
537  fHistoEleXiPtvsRapidityWS(0),
538  fHistoEleXiPtvsRapidityMCS(0),
539  fHistoResponseElePt(0),
540  fHistoResponseXiPt(0),
541  fHistoResponseEleXiPt(0),
542  fHistoPi0MCGen(0),
543  fHistoElectronPi0Total(0),
544  fHistoElectronPi0Tag(0),
545  fHistoEtaMCGen(0),
546  fHistoElectronEtaTotal(0),
547  fHistoElectronEtaTag(0),
548  fCounter(0),
549  fHistonEvtvsRunNumber(0),
550  fHistonElevsRunNumber(0),
551  fHistonXivsRunNumber(0),
552  fHistoMCEventType(0),
553  fHistoMCXic0Decays(0),
554  fHistoMCDeltaPhiccbar(0),
555  fHistoMCNccbar(0),
556  fGTI(0),fGTIndex(0), fTrackBuffSize(19000),
557  fHistodPhiSdEtaSElectronProtonR125RS(0),
558  fHistodPhiSdEtaSElectronProtonR125WS(0),
559  fHistodPhiSdEtaSElectronProtonR125RSMix(0),
560  fHistodPhiSdEtaSElectronProtonR125WSMix(0),
561  fHistodPhiSdEtaSElectronPionR125RS(0),
562  fHistodPhiSdEtaSElectronPionR125WS(0),
563  fHistodPhiSdEtaSElectronPionR125RSMix(0),
564  fHistodPhiSdEtaSElectronPionR125WSMix(0),
565  fHistodPhiSdEtaSElectronBachelorR125RS(0),
566  fHistodPhiSdEtaSElectronBachelorR125WS(0),
567  fHistodPhiSdEtaSElectronBachelorR125RSMix(0),
568  fHistodPhiSdEtaSElectronBachelorR125WSMix(0),
569  fDoEventMixing(0),
570  fMixWithoutConversionFlag(kTRUE),
571  fNumberOfEventsForMixing (5),
572  fNzVtxBins (0),
573  fNCentBins (0),
574  fNOfPools(1),
575  fEventBuffer(0x0),
576  fEventInfo(0x0),
577  fElectronTracks(0x0),
578  fCascadeTracks1(0x0),
579  fCascadeTracks2(0x0),
580  fElectronCutVarsArray(0x0),
581  fCascadeCutVarsArray1(0x0),
582  fCascadeCutVarsArray2(0x0)
583 {
584  //
585  // Constructor. Initialization of Inputs and Outputs
586  //
587  Info("AliAnalysisTaskSEXic2eleXifromAODtracks","Calling Constructor");
588 
589  for(Int_t i=0;i<23;i++){
590  fHistoElePtvsCutVarsRS[i] = 0;
591  fHistoElePtvsCutVarsWS[i] = 0;
593  }
594  for(Int_t i=0;i<8;i++){
596  }
597 
598  DefineOutput(1,TList::Class()); //conters
599  DefineOutput(2,TList::Class());
600  DefineOutput(3,TList::Class()); //conters
601  DefineOutput(4,TTree::Class()); //My private output
602  DefineOutput(5,TTree::Class()); //My private output
603  DefineOutput(6,TTree::Class()); //My private output
604  DefineOutput(7,TTree::Class()); //My private output
605  DefineOutput(8,AliNormalizationCounter::Class());
606  DefineOutput(9,TTree::Class()); //My private output
607  DefineOutput(10,TTree::Class()); //My private output
608  DefineOutput(11,TTree::Class()); //My private output
609  DefineOutput(12,TTree::Class()); //My private output
610 }
611 
612 //___________________________________________________________________________
614  //
615  // destructor
616  //
617  Info("~AliAnalysisTaskSEXic2eleXifromAODtracks","Calling Destructor");
618 
619  if (fOutput) {
620  delete fOutput;
621  fOutput = 0;
622  }
623 
624  if (fOutputAll) {
625  delete fOutputAll;
626  fOutputAll = 0;
627  }
628 
629  if (fListCuts) {
630  delete fListCuts;
631  fListCuts = 0;
632  }
633 
634 
635  if (fAnalCuts) {
636  delete fAnalCuts;
637  fAnalCuts = 0;
638  }
639 
640  if (fVariablesTree) {
641  delete fVariablesTree;
642  fVariablesTree = 0;
643  }
644  if (fEleVariablesTree) {
645  delete fEleVariablesTree;
646  fEleVariablesTree = 0;
647  }
648  if (fCascVariablesTree) {
649  delete fCascVariablesTree;
650  fCascVariablesTree = 0;
651  }
652  if (fMCVariablesTree) {
653  delete fMCVariablesTree;
654  fMCVariablesTree = 0;
655  }
656  if (fMCEleVariablesTree) {
657  delete fMCEleVariablesTree;
659  }
660  if (fMCCascVariablesTree) {
661  delete fMCCascVariablesTree;
663  }
667  }
671  }
672  if(fCounter){
673  delete fCounter;
674  fCounter = 0;
675  }
676 
677  if(fElectronTracks) fElectronTracks->Delete();
678  delete fElectronTracks;
679  if(fCascadeTracks1) fCascadeTracks1->Delete();
680  delete fCascadeTracks1;
681  if(fCascadeTracks2) fCascadeTracks2->Delete();
682  delete fCascadeTracks2;
683  if(fEventBuffer){
684  for(Int_t i=0; i<fNOfPools; i++) delete fEventBuffer[i];
685  delete fEventBuffer;
686  }
687  delete fEventInfo;
688 
690  delete fElectronCutVarsArray;
692  delete fCascadeCutVarsArray1;
694  delete fCascadeCutVarsArray2;
695 
696  if (fGTI)
697  delete[] fGTI;
698  fGTI=0;
699  if (fGTIndex)
700  delete[] fGTIndex;
701  fGTIndex=0;
702 }
703 
704 //_________________________________________________
706  //
707  // Initialization
708  //
709  //
710 
711  fIsEventSelected=kFALSE;
712 
713  if (fDebug > 1) AliInfo("Init");
714 
715  fListCuts = new TList();
716  fListCuts->SetOwner();
717  fListCuts->SetName("ListCuts");
719  PostData(2,fListCuts);
720 
721  return;
722 }
723 
724 //_________________________________________________
726 {
727  //
728  // UserExec
729  //
730 
731  if (!fInputEvent) {
732  AliError("NO EVENT FOUND!");
733  return;
734  }
735  AliAODEvent* aodEvent = dynamic_cast<AliAODEvent*>(fInputEvent);
736 
737  fCEvents->Fill(1);
739 
740  //------------------------------------------------
741  // First check if the event has proper B
742  //------------------------------------------------
743  fBzkG = (Double_t)aodEvent->GetMagneticField();
744  AliKFParticle::SetField(fBzkG);
745  if (TMath::Abs(fBzkG)<0.001) {
746  return;
747  }
748  fCEvents->Fill(2);
749 
752 
753  //------------------------------------------------
754  // MC analysis setting
755  //------------------------------------------------
756  TClonesArray *mcArray = 0;
757  AliAODMCHeader *mcHeader=0;
758  if (fUseMCInfo) {
759  // MC array need for maching
760  mcArray = dynamic_cast<TClonesArray*>(aodEvent->FindListObject(AliAODMCParticle::StdBranchName()));
761  if (!mcArray) {
762  AliError("Could not find Monte-Carlo in AOD");
763  return;
764  }
765  fCEvents->Fill(6); // in case of MC events
766 
767  // load MC header
768  mcHeader = (AliAODMCHeader*)aodEvent->GetList()->FindObject(AliAODMCHeader::StdBranchName());
769  if (!mcHeader) {
770  AliError("AliAnalysisTaskSEXic2eleXifromAODtracks::UserExec: MC header branch not found!\n");
771  return;
772  }
773  fCEvents->Fill(7); // in case of MC events
774 
775  Double_t zMCVertex = mcHeader->GetVtxZ();
776  if (TMath::Abs(zMCVertex) > fAnalCuts->GetMaxVtxZ()) {
777  AliDebug(2,Form("Event rejected: abs(zVtxMC)=%f > fAnalCuts->GetMaxVtxZ()=%f",zMCVertex,fAnalCuts->GetMaxVtxZ()));
778  return;
779  } else {
780  fCEvents->Fill(17); // in case of MC events
781  }
782  if ((TMath::Abs(zMCVertex) < fAnalCuts->GetMaxVtxZ()) && (!fAnalCuts->IsEventRejectedDuePhysicsSelection()) && (!fAnalCuts->IsEventRejectedDueToTrigger())) {
783  Bool_t selevt = MakeMCAnalysis(mcArray);
784  if(!selevt) return;
785  }
786  }
787 
788  //------------------------------------------------
789  // Event selection
790  //------------------------------------------------
791  fVtx1 = (AliAODVertex*)aodEvent->GetPrimaryVertex();
792  if (!fVtx1) return;
793 
794  Double_t pos[3],cov[6];
795  fVtx1->GetXYZ(pos);
796  fVtx1->GetCovarianceMatrix(cov);
797  fV1 = new AliESDVertex(pos,cov,100.,100,fVtx1->GetName());
798  fVtxZ = pos[2];
799 
800  Bool_t fIsTriggerNotOK = fAnalCuts->IsEventRejectedDueToTrigger();
801  Bool_t fIsPhysSelNotOK = fAnalCuts->IsEventRejectedDuePhysicsSelection();
802  Bool_t fIsNoVertex = fAnalCuts->IsEventRejectedDueToNotRecoVertex();
803  if(!fIsTriggerNotOK && !fIsPhysSelNotOK && !fIsNoVertex && fabs(fVtx1->GetZ())<fAnalCuts->GetMaxVtxZ()) fCEvents->Fill(3);
804  if(!fIsEventSelected) {
805  delete fV1;
806  return;
807  }
808  fCEvents->Fill(4);
809 
810  fIsMB=(((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected()&AliVEvent::kMB)==(AliVEvent::kMB);
811  fIsSemi=(((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected()&AliVEvent::kSemiCentral)==(AliVEvent::kSemiCentral);
812  fIsCent=(((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected()&AliVEvent::kCentral)==(AliVEvent::kCentral);
813  fIsINT7=(((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected()&AliVEvent::kINT7)==(AliVEvent::kINT7);
814  fIsEMC7=(((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected()&AliVEvent::kEMC7)==(AliVEvent::kEMC7);
816  if(fIsMB) fHTrigger->Fill(1);
817  if(fIsSemi) fHTrigger->Fill(2);
818  if(fIsCent) fHTrigger->Fill(3);
819  if(fIsINT7) fHTrigger->Fill(4);
820  if(fIsEMC7) fHTrigger->Fill(5);
821  if(fIsMB|fIsSemi|fIsCent) fHTrigger->Fill(7);
822  if(fIsINT7|fIsEMC7) fHTrigger->Fill(8);
823  if(fIsMB&fIsSemi) fHTrigger->Fill(10);
824  if(fIsMB&fIsCent) fHTrigger->Fill(11);
825  if(fIsINT7&fIsEMC7) fHTrigger->Fill(12);
826 
827  if(fUseCentralityV0M){
828  AliCentrality *cent = aodEvent->GetCentrality();
829  fCentrality = cent->GetCentralityPercentile("V0M");
830  }else{
831  fCentrality = 1.;
832  }
833  if(fCentrality<0.||fCentrality>100.-0.0000001) {
834  delete fV1;
835  return;
836  }
837  fHCentrality->Fill(fCentrality);
838  fRunNumber = aodEvent->GetRunNumber();
839 
840  Int_t runnumber_offset = 0;
841  Int_t runnumber = aodEvent->GetRunNumber();
842  if(runnumber<=131000&&runnumber>=114000){
843  runnumber_offset = 114000;//lhc10bcde
844  }else if(runnumber<=196000&&runnumber>=195000){
845  runnumber_offset = 195000;//lhc13bc
846  }else if(runnumber<=170593&&runnumber>=167902){
847  runnumber_offset = 167902;//lhc11h
848  }
849  fHistonEvtvsRunNumber->Fill(runnumber-runnumber_offset,1.);
850 
851  //------------------------------------------------
852  // Check if the event has v0 candidate
853  //------------------------------------------------
854  //Int_t nv0 = aodEvent->GetNumberOfV0s();
855  fCEvents->Fill(5);
856 
857 
858  //------------------------------------------------
859  // Main analysis done in this function
860  //------------------------------------------------
863  MakeAnalysis(aodEvent,mcArray);
864 
865 
866  PostData(1,fOutput);
867  PostData(3,fOutputAll);
868  PostData(4,fVariablesTree);
869  PostData(5,fEleVariablesTree);
870  PostData(6,fCascVariablesTree);
871  PostData(7,fMCVariablesTree);
872  PostData(8,fCounter);
873  PostData(9,fMCEleVariablesTree);
874  PostData(10,fMCCascVariablesTree);
875  PostData(11,fMCGenPairVariablesTree);
876  PostData(12,fCorrelationVariablesTree);
877 
878  fIsEventSelected=kFALSE;
879 
880  delete fV1;
881  return;
882 }
883 
884 //________________________________________ terminate ___________________________
886 {
887  // The Terminate() function is the last function to be called during
888  // a query. It always runs on the client, it can be used to present
889  // the results graphically or save the results to file.
890 
891  //AliInfo("Terminate","");
892  AliAnalysisTaskSE::Terminate();
893 
894  fOutput = dynamic_cast<TList*> (GetOutputData(1));
895  if (!fOutput) {
896  AliError("fOutput not available");
897  return;
898  }
899 
900  fOutputAll = dynamic_cast<TList*> (GetOutputData(3));
901  if (!fOutputAll) {
902  AliError("fOutputAll not available");
903  return;
904  }
905 
906  return;
907 }
908 
909 //___________________________________________________________________________
911 {
912  //
913  // UserCreateOutputObject
914  //
915  //AliInfo(Form("CreateOutputObjects of task %s\n", GetName()));
916 
917  //------------------------------------------------
918  // output object setting
919  //------------------------------------------------
920  fOutput = new TList();
921  fOutput->SetOwner();
922  fOutput->SetName("chist0");
923  DefineGeneralHistograms(); // define general histograms
924  PostData(1,fOutput);
925 
926  fOutputAll = new TList();
927  fOutputAll->SetOwner();
928  fOutputAll->SetName("anahisto");
929  DefineAnalysisHistograms(); // define general histograms
930  PostData(3,fOutputAll);
931 
933  PostData(4,fVariablesTree);
934 
936  PostData(5,fEleVariablesTree);
937 
939  PostData(6,fCascVariablesTree);
940 
942  PostData(7,fMCVariablesTree);
943 
945  PostData(9,fMCEleVariablesTree);
946 
948  PostData(10,fMCCascVariablesTree);
949 
951  PostData(11,fMCGenPairVariablesTree);
952 
954  PostData(12,fCorrelationVariablesTree);
955 
956 
957  //Counter for Normalization
958  TString normName="NormalizationCounter";
959  AliAnalysisDataContainer *cont = GetOutputSlot(8)->GetContainer();
960  if(cont)normName=(TString)cont->GetName();
961  fCounter = new AliNormalizationCounter(normName.Data());
962  fCounter->Init();
963  PostData(8,fCounter);
964 
965  if(fDoEventMixing){
966  fElectronTracks = new TObjArray();
967  fElectronTracks->SetOwner();
968  fCascadeTracks1 = new TObjArray();
969  fCascadeTracks1->SetOwner();
970  fCascadeTracks2 = new TObjArray();
971  fCascadeTracks2->SetOwner();
972  fElectronCutVarsArray = new TObjArray();
973  fElectronCutVarsArray->SetOwner();
974  fCascadeCutVarsArray1 = new TObjArray();
975  fCascadeCutVarsArray1->SetOwner();
976  fCascadeCutVarsArray2 = new TObjArray();
977  fCascadeCutVarsArray2->SetOwner();
978 
980  fEventBuffer = new TTree*[fNOfPools];
981  for(Int_t i=0; i<fNOfPools; i++){
982  fEventBuffer[i]=new TTree(Form("EventBuffer_%d",i), "Temporary buffer for event mixing");
983  fEventBuffer[i]->Branch("zVertex", &fVtxZ);
984  fEventBuffer[i]->Branch("centrality", &fCentrality);
985  fEventBuffer[i]->Branch("eventInfo", "TObjString",&fEventInfo);
986  fEventBuffer[i]->Branch("c1array", "TObjArray", &fCascadeTracks1);
987  fEventBuffer[i]->Branch("c2array", "TObjArray", &fCascadeTracks2);
988  fEventBuffer[i]->Branch("c1varsarray", "TObjArray", &fCascadeCutVarsArray1);
989  fEventBuffer[i]->Branch("c2varsarray", "TObjArray", &fCascadeCutVarsArray2);
990  }
991  }
992 
993  fGTI = new AliAODTrack *[fTrackBuffSize]; // Array of pointers
994  fGTIndex = new Int_t [fTrackBuffSize]; // Array of index
995 
996  return;
997 }
998 
999 //-------------------------------------------------------------------------------
1002  AliAODEvent *aodEvent, TClonesArray *mcArray
1003  )
1004 {
1005  //
1006  // Main Analysis part
1007  //
1008  //------------------------------------------------
1009  // Select good track before hand to save time
1010  //------------------------------------------------
1011  if(fDoEventMixing && fElectronTracks) fElectronTracks->Delete();
1012  if(fDoEventMixing && fCascadeTracks1) fCascadeTracks1->Delete();
1013  if(fDoEventMixing && fCascadeTracks2) fCascadeTracks2->Delete();
1014  if(fDoEventMixing && fCascadeCutVarsArray1) fCascadeCutVarsArray1->Delete();
1015  if(fDoEventMixing && fCascadeCutVarsArray2) fCascadeCutVarsArray2->Delete();
1016 
1017  ResetGlobalTrackReference();
1018  // ..and set it
1019  for (Int_t iTrack=0;iTrack<aodEvent->GetNumberOfTracks();iTrack++){
1020  // cast needed since the event now returns AliVTrack instead of AliAODTrack
1021  AliAODTrack *track = dynamic_cast<AliAODTrack *>(aodEvent->GetTrack(iTrack));
1022  if (!track) continue;
1023 
1024  // Store the reference of the global tracks
1025  StoreGlobalTrackReference(track,iTrack);
1026  }
1027 
1028 
1029  Int_t nCascs= aodEvent->GetNumberOfCascades();
1030  Int_t nTracks= aodEvent->GetNumberOfTracks();
1031 
1032  Bool_t seleTrkFlags[nTracks];
1033  Int_t nSeleTrks=0;
1034  SelectTrack(aodEvent,nTracks,nSeleTrks,seleTrkFlags,mcArray);
1035 
1036  Bool_t seleCascFlags[nCascs];
1037  Int_t nSeleCasc=0;
1038  SelectCascade(aodEvent,nCascs,nSeleCasc,seleCascFlags,mcArray);
1039 
1040  Int_t runnumber_offset = 0;
1041  Int_t runnumber = aodEvent->GetRunNumber();
1042  if(runnumber<=131000&&runnumber>=114000){
1043  runnumber_offset = 114000;//lhc10bcde
1044  }else if(runnumber<=196000&&runnumber>=195000){
1045  runnumber_offset = 195000;//lhc13bc
1046  }else if(runnumber<=170593&&runnumber>=167902){
1047  runnumber_offset = 167902;//lhc11h
1048  }
1049  fHistonElevsRunNumber->Fill(runnumber-runnumber_offset,nSeleTrks);
1050  fHistonXivsRunNumber->Fill(runnumber-runnumber_offset,nSeleCasc);
1051 
1052  //------------------------------------------------
1053  // Cascade loop
1054  //------------------------------------------------
1055  for (Int_t icasc = 0; icasc<nCascs; icasc++) {
1056  if(!seleCascFlags[icasc]) continue;
1057  AliAODcascade *casc = aodEvent->GetCascade(icasc);
1058  if(!casc) continue;
1059 
1060  AliAODTrack *cptrack = (AliAODTrack*)(casc->GetDaughter(0));
1061  AliAODTrack *cntrack = (AliAODTrack*)(casc->GetDaughter(1));
1062  AliAODTrack *cbtrack = (AliAODTrack*)(casc->GetDecayVertexXi()->GetDaughter(0));
1063 
1064  //------------------------------------------------
1065  // track loop
1066  //------------------------------------------------
1067  for (Int_t itrk = 0; itrk<nTracks; itrk++) {
1068  if(!seleTrkFlags[itrk]) continue;
1069  AliAODTrack *trk = (AliAODTrack*)aodEvent->GetTrack(itrk);
1070  //if(trk->GetID()<0) continue;
1071 
1072  //if(!fAnalCuts->SelectWithRoughCuts(v0,trk)) continue;
1073 
1074  //TPC only track (BIT 7) does not have PID information
1075  //In addition to that, TPC only tracks does not have good DCA resolution
1076  //(according to femtoscopy code)
1077  AliAODTrack *trkpid = 0;
1078  if(fAnalCuts->GetProdAODFilterBit()==7){
1079  trkpid = fGTI[-trk->GetID()-1];
1080  }else{
1081  trkpid = trk;
1082  }
1083 
1084  Int_t cpid = cptrack->GetID();
1085  Int_t cnid = cntrack->GetID();
1086  Int_t cbid = cbtrack->GetID();
1087  Int_t lpid = trkpid->GetID();
1088  if((cpid==lpid)||(cnid==lpid)||(cbid==lpid)) continue;
1089 
1090  AliAODVertex *secVert = ReconstructSecondaryVertex(casc,trk,aodEvent);//Fake, prim vertex is just used as secondary vertex. place holder for future
1091  if(!secVert) continue;
1092 
1093  AliAODRecoCascadeHF *exobj = MakeCascadeHF(casc,trk,trkpid,aodEvent,secVert);
1094  if(!exobj) {
1095  continue;
1096  }
1097 
1098  FillROOTObjects(exobj, casc,trk,trkpid,aodEvent,mcArray);
1099 
1100  exobj->GetSecondaryVtx()->RemoveDaughters();
1101  exobj->UnsetOwnPrimaryVtx();
1102  delete exobj;exobj=NULL;
1103  delete secVert;
1104  }
1105  }
1106 
1107  if(fDoEventMixing){
1108  fEventInfo->SetString(Form("Ev%d_esd%d_E%d_C%d",AliAnalysisManager::GetAnalysisManager()->GetNcalls(),((AliAODHeader*)aodEvent->GetHeader())->GetEventNumberESDFile(),fElectronTracks->GetEntries(),fCascadeTracks1->GetEntries()+fCascadeTracks2->GetEntries()));
1109  Int_t ind=GetPoolIndex(fVtxZ,fCentrality);
1110  if(ind>=0 && ind<fNOfPools){
1111  if(fEventBuffer[ind]->GetEntries() >= fNumberOfEventsForMixing){
1112  DoEventMixingWithPools(ind);
1113  if(fEventBuffer[ind]->GetEntries() >= 20*fNumberOfEventsForMixing){
1114  ResetPool(ind);
1115  }
1116  }
1117  fEventBuffer[ind]->Fill();
1118  }
1119  }
1120 }
1121 
1122 
1125 {
1126  //
1127  // Define tree variables
1128  //
1129 
1130  const char* nameoutput = GetOutputSlot(4)->GetContainer()->GetName();
1131  fVariablesTree = new TTree(nameoutput,"Candidates variables tree");
1132  Int_t nVar = 92;
1133  fCandidateVariables = new Float_t [nVar];
1134  TString * fCandidateVariableNames = new TString[nVar];
1135 
1136  fCandidateVariableNames[ 0]="Centrality";
1137  fCandidateVariableNames[ 1]="InvMassEleXi";
1138  fCandidateVariableNames[ 2]="EleXiPt";
1139  fCandidateVariableNames[ 3]="EleXiPx";
1140  fCandidateVariableNames[ 4]="EleXiPy";
1141  fCandidateVariableNames[ 5]="EleXiPz";
1142  fCandidateVariableNames[ 6]="ElePx";
1143  fCandidateVariableNames[ 7]="ElePy";
1144  fCandidateVariableNames[ 8]="ElePz";
1145  fCandidateVariableNames[ 9]="XiPx";
1146  fCandidateVariableNames[10]="XiPy";
1147  fCandidateVariableNames[11]="XiPz";
1148  fCandidateVariableNames[12]="XiCharge";
1149  fCandidateVariableNames[13]="MassXi";
1150  fCandidateVariableNames[14]="MassLambda";
1151  fCandidateVariableNames[15]="Eled0";
1152  fCandidateVariableNames[16]="Xid0";
1153  fCandidateVariableNames[17]="nSigmaTPCele";
1154  fCandidateVariableNames[18]="nSigmaTOFele";
1155  fCandidateVariableNames[19]="nSigmaTPCpr_etrk";
1156  fCandidateVariableNames[20]="nSigmaTOFpr_etrk";
1157  fCandidateVariableNames[21]="nSigmaTPCka_etrk";
1158  fCandidateVariableNames[22]="nSigmaTOFka_etrk";
1159  fCandidateVariableNames[23]="nSigmaTPCv0pr";
1160  fCandidateVariableNames[24]="nSigmaTOFv0pr";
1161  fCandidateVariableNames[25]="nSigmaTPCv0pi";
1162  fCandidateVariableNames[26]="nSigmaTOFv0pi";
1163  fCandidateVariableNames[27]="nSigmaTPCbachpi";
1164  fCandidateVariableNames[28]="nSigmaTOFbachpi";
1165  fCandidateVariableNames[29]="EleCharge";
1166  fCandidateVariableNames[30]="Mixing";
1167  fCandidateVariableNames[31]="DcaXiDaughters";
1168  fCandidateVariableNames[32]="DcaV0Daughters";
1169  fCandidateVariableNames[33]="DecayLengthXi";
1170  fCandidateVariableNames[34]="CosPointingAngleXi";
1171  fCandidateVariableNames[35]="DcaV0toPrimVertex";
1172  fCandidateVariableNames[36]="DcaPostoPrimVertex";
1173  fCandidateVariableNames[37]="DcaNegtoPrimVertex";
1174  fCandidateVariableNames[38]="DcaBachtoPrimVertex";
1175  fCandidateVariableNames[39]="DecayLengthV0";
1176  fCandidateVariableNames[40]="CosPointingAngleV0";
1177 
1178  fCandidateVariableNames[41]="mcpdgxic";
1179  fCandidateVariableNames[42]="mclabxic";
1180  fCandidateVariableNames[43]="mcxicpx";
1181  fCandidateVariableNames[44]="mcxicpy";
1182  fCandidateVariableNames[45]="mcxicpz";
1183  fCandidateVariableNames[46]="mcelepx";
1184  fCandidateVariableNames[47]="mcelepy";
1185  fCandidateVariableNames[48]="mcelepz";
1186  fCandidateVariableNames[49]="mccascpx";
1187  fCandidateVariableNames[50]="mccascpy";
1188  fCandidateVariableNames[51]="mccascpz";
1189 
1190  fCandidateVariableNames[52]="mcpdgele";
1191  fCandidateVariableNames[53]="mcpdgcasc";
1192  fCandidateVariableNames[54]="mcpdgmomele";
1193  fCandidateVariableNames[55]="mcpdgmomcasc";
1194  fCandidateVariableNames[56]="mcpdggrmomele";
1195  fCandidateVariableNames[57]="mcpdggrmomcasc";
1196  fCandidateVariableNames[58]="mcngenele";
1197  fCandidateVariableNames[59]="mcngencasc";
1198 
1199  fCandidateVariableNames[60]="nSigmaTPCpi_etrk";
1200  fCandidateVariableNames[61]="nSigmaTOFpi_etrk";
1201 
1202  fCandidateVariableNames[62]="V0PosPx";
1203  fCandidateVariableNames[63]="V0PosPy";
1204  fCandidateVariableNames[64]="V0PosPz";
1205  fCandidateVariableNames[65]="V0NegPx";
1206  fCandidateVariableNames[66]="V0NegPy";
1207  fCandidateVariableNames[67]="V0NegPz";
1208  fCandidateVariableNames[68]="V0VertX";
1209  fCandidateVariableNames[69]="V0VertY";
1210  fCandidateVariableNames[70]="V0VertZ";
1211  fCandidateVariableNames[71]="BachPx";
1212  fCandidateVariableNames[72]="BachPy";
1213  fCandidateVariableNames[73]="BachPz";
1214  fCandidateVariableNames[74]="XiVertX";
1215  fCandidateVariableNames[75]="XiVertY";
1216  fCandidateVariableNames[76]="XiVertZ";
1217  fCandidateVariableNames[77]="PrimVertX";
1218  fCandidateVariableNames[78]="PrimVertY";
1219  fCandidateVariableNames[79]="PrimVertZ";
1220 
1221  fCandidateVariableNames[80]="MassOmega";
1222 
1223  fCandidateVariableNames[81]= "EleITSMatch";
1224  fCandidateVariableNames[82]= "BachITSMatch";
1225  fCandidateVariableNames[83]= "V0PosITSMatch";
1226  fCandidateVariableNames[84]= "V0NegITSMatch";
1227 
1228  fCandidateVariableNames[85]= "TPCNclsF";
1229  fCandidateVariableNames[86]= "TPCNcls";
1230  fCandidateVariableNames[87]= "TPCNclsS";
1231  fCandidateVariableNames[88]= "IsXiPeakReagion";
1232 
1233 
1234  fCandidateVariableNames[89]="MagneticField";
1235  fCandidateVariableNames[90]="EvNumber";
1236  fCandidateVariableNames[91]="RunNumber";
1237 
1238  for (Int_t ivar=0; ivar<nVar; ivar++) {
1239  fVariablesTree->Branch(fCandidateVariableNames[ivar].Data(),&fCandidateVariables[ivar],Form("%s/f",fCandidateVariableNames[ivar].Data()));
1240  }
1241 
1242  return;
1243 }
1244 
1246 void AliAnalysisTaskSEXic2eleXifromAODtracks::FillROOTObjects(AliAODRecoCascadeHF *exobj, AliAODcascade *casc, AliAODTrack *trk, AliAODTrack *trkpid, AliAODEvent *event, TClonesArray *mcArray)
1247 {
1248  //
1249  // Fill histograms or tree depending on fWriteVariableTree
1250  //
1251  if(!trk) return;
1252  if(!trkpid) return;
1253  if(!casc) return;
1254 
1255  for(Int_t i=0;i<92;i++){
1256  fCandidateVariables[i] = -9999.;
1257  }
1258 
1259 
1260  AliAODTrack *cptrack = (AliAODTrack*)(casc->GetDaughter(0));
1261  AliAODTrack *cntrack = (AliAODTrack*)(casc->GetDaughter(1));
1262  AliAODTrack *cbtrack = (AliAODTrack*)(casc->GetDecayVertexXi()->GetDaughter(0));
1263 // if(cptrack->Charge()<0 && cntrack->Charge()>0){
1264 // cptrack = (AliAODTrack*)(casc->GetDaughter(1));
1265 // cntrack = (AliAODTrack*)(casc->GetDaughter(0));
1266 // }
1267 // Double_t d0z0[2],covd0z0[3];
1268 // cptrack->PropagateToDCA(fVtx1,fBzkG,kVeryBig,d0z0,covd0z0);//propagate to primary vertex for debugging
1269 // cntrack->PropagateToDCA(fVtx1,fBzkG,kVeryBig,d0z0,covd0z0);//propagate to primary vertex for debugging
1270 // cbtrack->PropagateToDCA(fVtx1,fBzkG,kVeryBig,d0z0,covd0z0);//propagate to primary vertex for debugging
1271 
1272  Double_t pxe = exobj->PxProng(0);
1273  Double_t pye = exobj->PyProng(0);
1274  Double_t pze = exobj->PzProng(0);
1275  Double_t mome = sqrt(pxe*pxe+pye*pye+pze*pze);
1276  Double_t Ee = sqrt(mome*mome+0.000510998928*0.000510998928);
1277  Double_t pxv = exobj->PxProng(1);
1278  Double_t pyv = exobj->PyProng(1);
1279  Double_t pzv = exobj->PzProng(1);
1280  Double_t momv = sqrt(pxv*pxv+pyv*pyv+pzv*pzv);
1281  Double_t Ev = sqrt(momv*momv+1.32171*1.32171);
1282  Double_t cosoa = (pxe*pxv+pye*pyv+pze*pzv)/mome/momv;
1283  Double_t Esum = Ee + Ev;
1284 
1285  Double_t uxe = pxe/mome;
1286  Double_t uye = pye/mome;
1287  Double_t uze = pze/mome;
1288  Double_t lf = -2.*(pxv*uxe+pyv*uye+pzv*uze);
1289  Double_t pxv_flip = pxv + lf * uxe;
1290  Double_t pyv_flip = pyv + lf * uye;
1291  Double_t pzv_flip = pzv + lf * uze;
1292  Double_t pxsum_flip = pxe + pxv_flip;
1293  Double_t pysum_flip = pye + pyv_flip;
1294  Double_t pzsum_flip = pze + pzv_flip;
1295  Double_t mexi_flip = sqrt(Esum*Esum-pxsum_flip*pxsum_flip-pysum_flip*pysum_flip-pzsum_flip*pzsum_flip);
1296  Double_t ptexi_flip = sqrt(pxsum_flip*pxsum_flip+pysum_flip*pysum_flip);
1297 
1298  Double_t minmass_ee = 9999.;
1299  Bool_t isconv = fAnalCuts->TagConversions(trk,fGTIndex,(AliAODEvent*)event,event->GetNumberOfTracks(),minmass_ee);
1300  Double_t minmasslike_ee = 9999.;
1301  Bool_t isconv_like = fAnalCuts->TagConversionsSameSign(trk,fGTIndex,(AliAODEvent*)event,event->GetNumberOfTracks(),minmasslike_ee);
1302 
1303 
1304  Double_t posVtx[3] = {0.,0.,0.};
1305  fVtx1->GetXYZ(posVtx);
1306 
1308  UInt_t pdgdg[2]={11,3312};
1309  fCandidateVariables[ 1] = exobj->InvMass(2,pdgdg);
1310  fCandidateVariables[ 2] = exobj->Pt();
1311  fCandidateVariables[ 3] = exobj->Px();
1312  fCandidateVariables[ 4] = exobj->Py();
1313  fCandidateVariables[ 5] = exobj->Pz();
1314  fCandidateVariables[ 6] = exobj->PxProng(0);
1315  fCandidateVariables[ 7] = exobj->PyProng(0);
1316  fCandidateVariables[ 8] = exobj->PzProng(0);
1317  fCandidateVariables[ 9] = exobj->PxProng(1);
1318  fCandidateVariables[10] = exobj->PyProng(1);
1319  fCandidateVariables[11] = exobj->PzProng(1);
1320  fCandidateVariables[12] = casc->ChargeXi();
1321  fCandidateVariables[13] = casc->MassXi();
1322  if(casc->ChargeXi()<0)
1323  fCandidateVariables[14] = casc->MassLambda();
1324  else
1325  fCandidateVariables[14] = casc->MassAntiLambda();
1326  fCandidateVariables[15] = exobj->Getd0Prong(0);
1327  fCandidateVariables[16] = exobj->Getd0Prong(1);
1328 
1329  Double_t nSigmaTPCele = -9999.;
1330  Double_t nSigmaTOFele = -9999.;
1331  if(fAnalCuts->GetIsUsePID())
1332  {
1333  nSigmaTPCele = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTPC(trkpid,AliPID::kElectron);
1334  nSigmaTOFele = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTOF(trkpid,AliPID::kElectron);
1335  fCandidateVariables[17] = nSigmaTPCele;
1336  fCandidateVariables[18] = nSigmaTOFele;
1337 
1338  Double_t nSigmaTPCpr_etrk = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTPC(trkpid,AliPID::kProton);
1339  Double_t nSigmaTOFpr_etrk = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTOF(trkpid,AliPID::kProton);
1340  Double_t nSigmaTPCka_etrk = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTPC(trkpid,AliPID::kKaon);
1341  Double_t nSigmaTOFka_etrk = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTOF(trkpid,AliPID::kKaon);
1342  Double_t nSigmaTPCpi_etrk = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTPC(trkpid,AliPID::kPion);
1343  Double_t nSigmaTOFpi_etrk = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTOF(trkpid,AliPID::kPion);
1344  fCandidateVariables[19] = nSigmaTPCpr_etrk;
1345  fCandidateVariables[20] = nSigmaTOFpr_etrk;
1346  fCandidateVariables[21] = nSigmaTPCka_etrk;
1347  fCandidateVariables[22] = nSigmaTOFka_etrk;
1348  fCandidateVariables[60] = nSigmaTPCpi_etrk;
1349  fCandidateVariables[61] = nSigmaTOFpi_etrk;
1350  }
1351 
1352  Double_t nSigmaTPCv0pr=-9999.;
1353  Double_t nSigmaTOFv0pr=-9999.;
1354  Double_t nSigmaTPCv0pi=-9999.;
1355  Double_t nSigmaTOFv0pi=-9999.;
1356  Double_t nSigmaTPCbachpi=-9999.;
1357  Double_t nSigmaTOFbachpi=-9999.;
1359  {
1360  if(casc->ChargeXi()>0){
1361  nSigmaTPCv0pr = fAnalCuts->GetPidCascPr()->GetPidResponse()->NumberOfSigmasTPC(cntrack,AliPID::kProton);
1362  nSigmaTOFv0pr = fAnalCuts->GetPidCascPr()->GetPidResponse()->NumberOfSigmasTOF(cntrack,AliPID::kProton);
1363  nSigmaTPCv0pi = fAnalCuts->GetPidCascPi()->GetPidResponse()->NumberOfSigmasTPC(cptrack,AliPID::kPion);
1364  nSigmaTOFv0pi = fAnalCuts->GetPidCascPi()->GetPidResponse()->NumberOfSigmasTOF(cptrack,AliPID::kPion);
1365  nSigmaTPCbachpi = fAnalCuts->GetPidCascPi()->GetPidResponse()->NumberOfSigmasTPC(cbtrack,AliPID::kPion);
1366  nSigmaTOFbachpi = fAnalCuts->GetPidCascPi()->GetPidResponse()->NumberOfSigmasTOF(cbtrack,AliPID::kPion);
1367  }else{
1368  nSigmaTPCv0pr = fAnalCuts->GetPidCascPr()->GetPidResponse()->NumberOfSigmasTPC(cptrack,AliPID::kProton);
1369  nSigmaTOFv0pr = fAnalCuts->GetPidCascPr()->GetPidResponse()->NumberOfSigmasTOF(cptrack,AliPID::kProton);
1370  nSigmaTPCv0pi = fAnalCuts->GetPidCascPi()->GetPidResponse()->NumberOfSigmasTPC(cntrack,AliPID::kPion);
1371  nSigmaTOFv0pi = fAnalCuts->GetPidCascPi()->GetPidResponse()->NumberOfSigmasTOF(cntrack,AliPID::kPion);
1372  nSigmaTPCbachpi = fAnalCuts->GetPidCascPi()->GetPidResponse()->NumberOfSigmasTPC(cbtrack,AliPID::kPion);
1373  nSigmaTOFbachpi = fAnalCuts->GetPidCascPi()->GetPidResponse()->NumberOfSigmasTOF(cbtrack,AliPID::kPion);
1374  }
1375  fCandidateVariables[23] = nSigmaTPCv0pr;
1376  fCandidateVariables[24] = nSigmaTOFv0pr;
1377  fCandidateVariables[25] = nSigmaTPCv0pi;
1378  fCandidateVariables[26] = nSigmaTOFv0pi;
1379  fCandidateVariables[27] = nSigmaTPCbachpi;
1380  fCandidateVariables[28] = nSigmaTOFbachpi;
1381  }
1382  fCandidateVariables[29] = trk->Charge();
1383  fCandidateVariables[30] = 0;
1384  fCandidateVariables[31] = casc->DcaXiDaughters();
1385  fCandidateVariables[32] = casc->DcaV0Daughters();
1386  fCandidateVariables[33] = casc->DecayLengthXi(posVtx[0],posVtx[1],posVtx[2]);
1387  fCandidateVariables[34] = casc->CosPointingAngleXi(posVtx[0],posVtx[1],posVtx[2]);
1388  fCandidateVariables[35] = casc->DcaV0ToPrimVertex();
1389  fCandidateVariables[36] = casc->DcaPosToPrimVertex();
1390  fCandidateVariables[37] = casc->DcaNegToPrimVertex();
1391  fCandidateVariables[38] = casc->DcaBachToPrimVertex();
1392  fCandidateVariables[39] = casc->DecayLengthV0();
1393  fCandidateVariables[40] = casc->CosPointingAngle(casc->GetDecayVertexXi());
1394 
1395  AliAODMCParticle *mcxic = 0;
1396  AliAODMCParticle *mcele = 0;
1397  AliAODMCParticle *mccasc = 0;
1398  Int_t mclabxic = 0;
1399  Int_t mcpdgele_array[100];
1400  Int_t mcpdgcasc_array[100];
1401  Int_t mclabelele_array[100];
1402  Int_t mclabelcasc_array[100];
1403  Int_t mcngen_ele = -9999;
1404  Int_t mcngen_casc = -9999;
1405 
1406  if(fUseMCInfo && mcArray){
1407  mclabxic = MatchToMC(exobj,mcArray,mcpdgele_array, mcpdgcasc_array,mclabelele_array,mclabelcasc_array,mcngen_ele,mcngen_casc);
1408 
1409  if(mclabxic>-1){
1410  mcxic = (AliAODMCParticle*) mcArray->At(mclabxic);
1411  if(mclabelele_array[0]>=0)
1412  mcele = (AliAODMCParticle*) mcArray->At(mclabelele_array[0]);
1413  if(mclabelcasc_array[0]>=0)
1414  mccasc = (AliAODMCParticle*) mcArray->At(mclabelcasc_array[0]);
1415  if(mcxic){
1416  fCandidateVariables[41] = mcxic->GetPdgCode();
1417  fCandidateVariables[42] = mcxic->Label();
1418  fCandidateVariables[43] = mcxic->Px();
1419  fCandidateVariables[44] = mcxic->Py();
1420  fCandidateVariables[45] = mcxic->Pz();
1421  }
1422  if(mcele){
1423  fCandidateVariables[46] = mcele->Px();
1424  fCandidateVariables[47] = mcele->Py();
1425  fCandidateVariables[48] = mcele->Pz();
1426  }
1427  if(mccasc){
1428  fCandidateVariables[49] = mccasc->Px();
1429  fCandidateVariables[50] = mccasc->Py();
1430  fCandidateVariables[51] = mccasc->Pz();
1431  }
1432  }
1433  fCandidateVariables[52] = mcpdgele_array[0];
1434  fCandidateVariables[53] = mcpdgcasc_array[0];
1435  fCandidateVariables[54] = mcpdgele_array[1];
1436  fCandidateVariables[55] = mcpdgcasc_array[1];
1437  fCandidateVariables[56] = mcpdgele_array[2];
1438  fCandidateVariables[57] = mcpdgcasc_array[2];
1439  fCandidateVariables[58] = mcngen_ele;
1440  fCandidateVariables[59] = mcngen_casc;
1441  }
1442  fCandidateVariables[62] = casc->MomPosX();
1443  fCandidateVariables[63] = casc->MomPosY();
1444  fCandidateVariables[64] = casc->MomPosZ();
1445  fCandidateVariables[65] = casc->MomNegX();
1446  fCandidateVariables[66] = casc->MomNegY();
1447  fCandidateVariables[67] = casc->MomNegZ();
1448  fCandidateVariables[68] = casc->DecayVertexV0X();
1449  fCandidateVariables[69] = casc->DecayVertexV0Y();
1450  fCandidateVariables[70] = casc->DecayVertexV0Z();
1451  fCandidateVariables[71] = casc->MomBachX();
1452  fCandidateVariables[72] = casc->MomBachY();
1453  fCandidateVariables[73] = casc->MomBachZ();
1454  fCandidateVariables[74] = casc->DecayVertexXiX();
1455  fCandidateVariables[75] = casc->DecayVertexXiY();
1456  fCandidateVariables[76] = casc->DecayVertexXiZ();
1457  fCandidateVariables[77] = fVtx1->GetX();
1458  fCandidateVariables[78] = fVtx1->GetY();
1459  fCandidateVariables[79] = fVtx1->GetZ();
1460 
1461  fCandidateVariables[80] = casc->MassOmega();
1462 
1463  if(trk) fCandidateVariables[81] = trk->GetITSClusterMap();
1464  if(cbtrack) fCandidateVariables[82] = cbtrack->GetITSClusterMap();
1465  if(cptrack) fCandidateVariables[83] = cptrack->GetITSClusterMap();
1466  if(cntrack) fCandidateVariables[84] = cntrack->GetITSClusterMap();
1467 
1468  fCandidateVariables[85] = trk->GetTPCNclsF();
1469  fCandidateVariables[86] = trk->GetTPCNcls();
1470  fCandidateVariables[87] = trk->GetTPCnclsS();
1472 
1473  fCandidateVariables[89] = fBzkG;
1476 
1477 
1478  if(fWriteVariableTree)
1479  fVariablesTree->Fill();
1480 
1481  Double_t dphis_ele_pr, detas_ele_pr,dphis_ele_pi, detas_ele_pi, dphis_ele_bach, detas_ele_bach;
1482  dphis_ele_pr = 9999.;detas_ele_pr = 9999.;dphis_ele_pi = 9999.;detas_ele_pi = 9999.;dphis_ele_bach=9999.;detas_ele_bach=9999.;
1483  //fAnalCuts->GetdPhiSdEtaSR125(trk,cptrack,cntrack,cbtrack,fBzkG,posVtx, dphis_ele_pr,detas_ele_pr,dphis_ele_pi,detas_ele_pi, dphis_ele_bach, detas_ele_bach);
1484 
1485 
1486  Double_t cont[4];
1487  cont[0] = exobj->InvMass(2,pdgdg);
1488  cont[1] = exobj->Pt();
1489  cont[2] = exobj->Getd0Prong(0)*trk->Charge();
1490  cont[3] = fCentrality;
1491  fHistoEleXiMass->Fill(cont);
1492 
1493  Double_t cont_flip[4];
1494  cont_flip[0] = mexi_flip;
1495  cont_flip[1] = ptexi_flip;
1496  cont_flip[2] = 0.0;
1497  cont_flip[3] = fCentrality;
1498 
1499  Double_t cont2[3];
1500  cont2[0] = exobj->InvMass(2,pdgdg);
1501  cont2[1] = trk->Pt();
1502  cont2[2] = fCentrality;
1503 
1504  Double_t cont_eleptvseta[3];
1505  cont_eleptvseta[0] = trk->Pt();
1506  cont_eleptvseta[1] = trk->Eta();
1507  cont_eleptvseta[2] = fCentrality;
1508 
1509  Double_t cont_eleptvsxipt[3];
1510  cont_eleptvsxipt[0] = trk->Pt();
1511  cont_eleptvsxipt[1] = sqrt(casc->MomXiX()*casc->MomXiX()+casc->MomXiY()*casc->MomXiY());
1512  cont_eleptvsxipt[2] = fCentrality;
1513 
1514  Double_t cont_eleptvsd0[3];
1515  cont_eleptvsd0[0] = trk->Pt();
1516  cont_eleptvsd0[1] = exobj->Getd0Prong(0)*trk->Charge();
1517  cont_eleptvsd0[2] = fCentrality;
1518 
1519  Double_t exobj_mass = exobj->InvMass(2,pdgdg);
1520  Double_t exobj_px = exobj->Px();
1521  Double_t exobj_py = exobj->Py();
1522  Double_t exobj_pz = exobj->Pz();
1523  Double_t exobj_E = sqrt(exobj_mass*exobj_mass+exobj_px*exobj_px+exobj_py*exobj_py+exobj_pz*exobj_pz);
1524  Double_t exobj_rap = 0.5*log((exobj_E+exobj_pz)/(exobj_E-exobj_pz));
1525 
1526  //
1527  // Old strategy only look at mass and pairpt
1528  //
1530  {
1531  if(trk->Charge()*casc->ChargeXi()<0){
1532  fHistoEleXiMassRS->Fill(cont);
1533  if(trk->Charge()>0) fHistoEleXiMassRS1->Fill(cont);
1534  else fHistoEleXiMassRS2->Fill(cont);
1535  fHistoEleXiMassvsElePtRS->Fill(cont2);
1536  if(trk->Charge()>0) fHistoEleXiMassvsElePtRS1->Fill(cont2);
1537  else fHistoEleXiMassvsElePtRS2->Fill(cont2);
1538  if(cont[0]<2.5){
1539  fHistoEleXiPtvsRapidityRS->Fill(exobj->Pt(),exobj_rap);
1540  fHistoElePtRS->Fill(trk->Pt(),fCentrality);
1541  fHistoElePtvsEtaRS->Fill(cont_eleptvseta);
1542  fHistoElePtvsXiPtRS->Fill(cont_eleptvsxipt);
1543  fHistoElePtvsd0RS->Fill(cont_eleptvsd0);
1544  for(Int_t ih=0;ih<23;ih++){
1545  Double_t cont_eleptvscutvars[3];
1546  cont_eleptvscutvars[0] = exobj->Pt();
1547  cont_eleptvscutvars[2] = fCentrality;
1548 
1549  if(ih==0){
1550  cont_eleptvscutvars[1] = trk->GetTPCNcls();
1551  }else if(ih==1){
1552  cont_eleptvscutvars[1] = trk->GetTPCsignalN();
1553  }else if(ih==2){
1554  cont_eleptvscutvars[1] = nSigmaTPCele;
1555  }else if(ih==3){
1556  cont_eleptvscutvars[1] = nSigmaTOFele;
1557  }else if(ih==4){
1558  cont_eleptvscutvars[1] = trk->Eta();
1559  }else if(ih==5){
1560  cont_eleptvscutvars[1] = trk->GetITSNcls();
1561  }else if(ih==6){
1562  if(casc->ChargeXi()<0)
1563  cont_eleptvscutvars[1] = casc->MassLambda();
1564  else
1565  cont_eleptvscutvars[1] = casc->MassAntiLambda();
1566  }else if(ih==7){
1567  cont_eleptvscutvars[1] = casc->MassXi();
1568  }else if(ih==8){
1569  Double_t lPosV0[3];
1570  lPosV0[0] = casc->DecayVertexV0X();
1571  lPosV0[1] = casc->DecayVertexV0Y();
1572  lPosV0[2] = casc->DecayVertexV0Z();
1573  cont_eleptvscutvars[1] = TMath::Sqrt(lPosV0[0]*lPosV0[0]+lPosV0[1]*lPosV0[1]);
1574  }else if(ih==9){
1575  Double_t lPosXi[3];
1576  lPosXi[0] = casc->DecayVertexXiX();
1577  lPosXi[1] = casc->DecayVertexXiY();
1578  lPosXi[2] = casc->DecayVertexXiZ();
1579  cont_eleptvscutvars[1] = TMath::Sqrt(lPosXi[0]*lPosXi[0]+lPosXi[1]*lPosXi[1]);
1580  }else if(ih==10){
1581  cont_eleptvscutvars[1] = casc->DcaV0Daughters();
1582  }else if(ih==11){
1583  cont_eleptvscutvars[1] = casc->DcaXiDaughters();
1584  }else if(ih==12){
1585  cont_eleptvscutvars[1] = casc->DcaBachToPrimVertex();
1586  }else if(ih==13){
1587  if(casc->ChargeXi()<0.)
1588  cont_eleptvscutvars[1] = casc->DcaPosToPrimVertex();
1589  else
1590  cont_eleptvscutvars[1] = casc->DcaNegToPrimVertex();
1591  }else if(ih==14){
1592  if(casc->ChargeXi()>0.)
1593  cont_eleptvscutvars[1] = casc->DcaPosToPrimVertex();
1594  else
1595  cont_eleptvscutvars[1] = casc->DcaNegToPrimVertex();
1596  }else if(ih==15){
1597  cont_eleptvscutvars[1] = casc->CosPointingAngle(casc->GetDecayVertexXi());
1598  }else if(ih==16){
1599  cont_eleptvscutvars[1] = casc->CosPointingAngleXi(posVtx[0],posVtx[1],posVtx[2]);
1600  }else if(ih==17){
1601  cont_eleptvscutvars[1] = nSigmaTPCv0pr;
1602  }else if(ih==18){
1603  cont_eleptvscutvars[1] = nSigmaTPCv0pi;
1604  }else if(ih==19){
1605  cont_eleptvscutvars[1] = nSigmaTPCbachpi;
1606  }else if(ih==20){
1607  cont_eleptvscutvars[1] = casc->Eta();
1608  }else if(ih==21){
1609  cont_eleptvscutvars[1] = 0.5*TMath::Log((sqrt(casc->Ptot2Xi())+casc->MomXiZ())/(sqrt(casc->Ptot2Xi())-casc->MomXiZ()));
1610  }else if(ih==22){
1611  Double_t xipx = exobj->PxProng(1);
1612  Double_t xipy = exobj->PyProng(1);
1613  Double_t xipz = exobj->PzProng(1);
1614  Double_t epx = exobj->PxProng(0);
1615  Double_t epy = exobj->PyProng(0);
1616  Double_t epz = exobj->PzProng(0);
1617  cont_eleptvscutvars[1] = acos((xipx*epx+xipy*epy+xipz*epz)/sqrt(xipx*xipx+xipy*xipy+xipz*xipz)/sqrt(epx*epx+epy*epy+epz*epz));
1618  }else{
1619  cont_eleptvscutvars[1] = -9999.;
1620  }
1621 
1622  fHistoElePtvsCutVarsRS[ih]->Fill(cont_eleptvscutvars);
1623  }
1624  }
1625  if(fUseMCInfo){
1626  if(mcxic){
1627  Int_t pdgcode = mcxic->GetPdgCode();
1628  cont2[1] = mcele->Pt();
1629  if(abs(pdgcode)==4132 && abs(mcpdgele_array[1])==4132 && abs(mcpdgcasc_array[1])==4132){
1630  Int_t labmotherxic = mcxic->GetMother();
1631  Bool_t isbottomfd = kFALSE;
1632  if(labmotherxic>=0)
1633  {
1634  AliAODMCParticle *motherxic = (AliAODMCParticle*)mcArray->At(labmotherxic);
1635  Int_t pdgmotherxic = motherxic->GetPdgCode();
1636  if(TMath::Abs(pdgmotherxic)==511||TMath::Abs(pdgmotherxic)==521||TMath::Abs(pdgmotherxic)==5122||TMath::Abs(pdgmotherxic)==5132||TMath::Abs(pdgmotherxic)==5232||TMath::Abs(pdgmotherxic)==5332){
1637  isbottomfd = kTRUE;
1638  }
1639  }
1640 
1641  fHistoEleXiMassMCS->Fill(cont);
1642  if(trk->Charge()>0) fHistoEleXiMassMCS1->Fill(cont);
1643  else fHistoEleXiMassMCS2->Fill(cont);
1644 
1645  if(isbottomfd){
1646  fHistoEleXiMassBFeeddownMCS->Fill(cont);
1647  if(trk->Charge()>0) fHistoEleXiMassBFeeddownMCS1->Fill(cont);
1648  else fHistoEleXiMassBFeeddownMCS2->Fill(cont);
1649  }else{
1650  fHistoEleXiMassPromptMCS->Fill(cont);
1651  if(trk->Charge()>0) fHistoEleXiMassPromptMCS1->Fill(cont);
1652  else fHistoEleXiMassPromptMCS2->Fill(cont);
1653  }
1654 
1655  fHistoEleXiMassvsElePtMCS->Fill(cont2);
1656  if(trk->Charge()>0) fHistoEleXiMassvsElePtMCS1->Fill(cont2);
1657  else fHistoEleXiMassvsElePtMCS2->Fill(cont2);
1658  if(cont[0]<2.5){
1659  fHistoEleXiPtvsRapidityMCS->Fill(exobj->Pt(),exobj_rap);
1660  fHistoElePtMCS->Fill(mcele->Pt(),fCentrality);
1661  fHistoElePtvsEtaMCS->Fill(cont_eleptvseta);
1662  fHistoElePtvsXiPtMCS->Fill(cont_eleptvsxipt);
1663  fHistoElePtvsd0MCS->Fill(cont_eleptvsd0);
1664 
1665  Double_t cont_xic[3];
1666  cont_xic[0] = mcxic->Pt();
1667  cont_xic[1] = mcxic->Y();
1668  cont_xic[2] = fCentrality;
1669  fHistoXicMCS->Fill(cont_xic);
1670  if(trk->Charge()>0) fHistoXicMCS1->Fill(cont_xic);
1671  else fHistoXicMCS2->Fill(cont_xic);
1672 
1673  Double_t cont_mcele[3];
1674  cont_mcele[0] = mcele->Pt();
1675  cont_mcele[1] = mcele->Eta();
1676  cont_mcele[2] = fCentrality;
1677  fHistoXicElectronMCS->Fill(cont_mcele);
1678  if(trk->Charge()>0) fHistoXicElectronMCS1->Fill(cont_mcele);
1679  else fHistoXicElectronMCS2->Fill(cont_mcele);
1680 
1681  fHistoResponseElePt->Fill(mcxic->Pt(),trk->Pt());
1682  fHistoResponseXiPt->Fill(mcxic->Pt(),sqrt(pow(casc->MomXiX(),2)+pow(casc->MomXiY(),2)));
1683  fHistoResponseEleXiPt->Fill(mcxic->Pt(),exobj->Pt());
1684 
1685  Double_t cont_eleptvsxiptvsxicpt[4];
1686  cont_eleptvsxiptvsxicpt[0] = cont_eleptvsxipt[0];
1687  cont_eleptvsxiptvsxicpt[1] = cont_eleptvsxipt[1];
1688  cont_eleptvsxiptvsxicpt[2] = mcxic->Pt();
1689  cont_eleptvsxiptvsxicpt[3] = cont_eleptvsxipt[2];
1690  fHistoElePtvsXiPtvsXicPtMCS->Fill(cont_eleptvsxiptvsxicpt);
1691 
1692  if(isbottomfd){
1693  fHistoElePtvsd0BFeeddownMCS->Fill(cont_eleptvsd0);
1694  }else{
1695  fHistoElePtvsd0PromptMCS->Fill(cont_eleptvsd0);
1696  }
1697 
1698  for(Int_t ih=0;ih<23;ih++){
1699  Double_t cont_eleptvscutvars[3];
1700  cont_eleptvscutvars[0] = exobj->Pt();
1701  cont_eleptvscutvars[2] = fCentrality;
1702 
1703  if(ih==0){
1704  cont_eleptvscutvars[1] = trk->GetTPCNcls();
1705  }else if(ih==1){
1706  cont_eleptvscutvars[1] = trk->GetTPCsignalN();
1707  }else if(ih==2){
1708  cont_eleptvscutvars[1] = nSigmaTPCele;
1709  }else if(ih==3){
1710  cont_eleptvscutvars[1] = nSigmaTOFele;
1711  }else if(ih==4){
1712  cont_eleptvscutvars[1] = trk->Eta();
1713  }else if(ih==5){
1714  cont_eleptvscutvars[1] = trk->GetITSNcls();
1715  }else if(ih==6){
1716  if(casc->ChargeXi()<0)
1717  cont_eleptvscutvars[1] = casc->MassLambda();
1718  else
1719  cont_eleptvscutvars[1] = casc->MassAntiLambda();
1720  }else if(ih==7){
1721  cont_eleptvscutvars[1] = casc->MassXi();
1722  }else if(ih==8){
1723  Double_t lPosV0[3];
1724  lPosV0[0] = casc->DecayVertexV0X();
1725  lPosV0[1] = casc->DecayVertexV0Y();
1726  lPosV0[2] = casc->DecayVertexV0Z();
1727  cont_eleptvscutvars[1] = TMath::Sqrt(lPosV0[0]*lPosV0[0]+lPosV0[1]*lPosV0[1]);
1728  }else if(ih==9){
1729  Double_t lPosXi[3];
1730  lPosXi[0] = casc->DecayVertexXiX();
1731  lPosXi[1] = casc->DecayVertexXiY();
1732  lPosXi[2] = casc->DecayVertexXiZ();
1733  cont_eleptvscutvars[1] = TMath::Sqrt(lPosXi[0]*lPosXi[0]+lPosXi[1]*lPosXi[1]);
1734  }else if(ih==10){
1735  cont_eleptvscutvars[1] = casc->DcaV0Daughters();
1736  }else if(ih==11){
1737  cont_eleptvscutvars[1] = casc->DcaXiDaughters();
1738  }else if(ih==12){
1739  cont_eleptvscutvars[1] = casc->DcaBachToPrimVertex();
1740  }else if(ih==13){
1741  if(casc->ChargeXi()<0.)
1742  cont_eleptvscutvars[1] = casc->DcaPosToPrimVertex();
1743  else
1744  cont_eleptvscutvars[1] = casc->DcaNegToPrimVertex();
1745  }else if(ih==14){
1746  if(casc->ChargeXi()>0.)
1747  cont_eleptvscutvars[1] = casc->DcaPosToPrimVertex();
1748  else
1749  cont_eleptvscutvars[1] = casc->DcaNegToPrimVertex();
1750  }else if(ih==15){
1751  cont_eleptvscutvars[1] = casc->CosPointingAngle(casc->GetDecayVertexXi());
1752  }else if(ih==16){
1753  cont_eleptvscutvars[1] = casc->CosPointingAngleXi(posVtx[0],posVtx[1],posVtx[2]);
1754  }else if(ih==17){
1755  cont_eleptvscutvars[1] = nSigmaTPCv0pr;
1756  }else if(ih==18){
1757  cont_eleptvscutvars[1] = nSigmaTPCv0pi;
1758  }else if(ih==19){
1759  cont_eleptvscutvars[1] = nSigmaTPCbachpi;
1760  }else if(ih==20){
1761  cont_eleptvscutvars[1] = casc->Eta();
1762  }else if(ih==21){
1763  cont_eleptvscutvars[1] = 0.5*TMath::Log((sqrt(casc->Ptot2Xi())+casc->MomXiZ())/(sqrt(casc->Ptot2Xi())-casc->MomXiZ()));
1764  }else if(ih==22){
1765  Double_t xipx = exobj->PxProng(1);
1766  Double_t xipy = exobj->PyProng(1);
1767  Double_t xipz = exobj->PzProng(1);
1768  Double_t epx = exobj->PxProng(0);
1769  Double_t epy = exobj->PyProng(0);
1770  Double_t epz = exobj->PzProng(0);
1771  cont_eleptvscutvars[1] = acos((xipx*epx+xipy*epy+xipz*epz)/sqrt(xipx*xipx+xipy*xipy+xipz*xipz)/sqrt(epx*epx+epy*epy+epz*epz));
1772  }else{
1773  cont_eleptvscutvars[1] = -9999.;
1774  }
1775 
1776  fHistoElePtvsCutVarsMCS[ih]->Fill(cont_eleptvscutvars);
1777  }
1778  }
1779  }
1780  }
1781  }
1782  fHistodPhiSdEtaSElectronProtonR125RS->Fill(dphis_ele_pr,detas_ele_pr);
1783  fHistodPhiSdEtaSElectronPionR125RS->Fill(dphis_ele_pi,detas_ele_pi);
1784  fHistodPhiSdEtaSElectronBachelorR125RS->Fill(dphis_ele_bach,detas_ele_bach);
1785  }else{
1786  fHistoEleXiMassWS->Fill(cont);
1787  if(trk->Charge()>0) fHistoEleXiMassWS1->Fill(cont);
1788  else fHistoEleXiMassWS2->Fill(cont);
1789  fHistoEleXiMassvsElePtWS->Fill(cont2);
1790  if(trk->Charge()>0) fHistoEleXiMassvsElePtWS1->Fill(cont2);
1791  else fHistoEleXiMassvsElePtWS2->Fill(cont2);
1792  if(cont[0]<2.5){
1793  fHistoEleXiPtvsRapidityWS->Fill(exobj->Pt(),exobj_rap);
1794  fHistoElePtWS->Fill(trk->Pt(),fCentrality);
1795  fHistoElePtvsEtaWS->Fill(cont_eleptvseta);
1796  fHistoElePtvsXiPtWS->Fill(cont_eleptvsxipt);
1797  fHistoElePtvsd0WS->Fill(cont_eleptvsd0);
1798 
1799  for(Int_t ih=0;ih<23;ih++){
1800  Double_t cont_eleptvscutvars[3];
1801  cont_eleptvscutvars[0] = exobj->Pt();
1802  cont_eleptvscutvars[2] = fCentrality;
1803 
1804  if(ih==0){
1805  cont_eleptvscutvars[1] = trk->GetTPCNcls();
1806  }else if(ih==1){
1807  cont_eleptvscutvars[1] = trk->GetTPCsignalN();
1808  }else if(ih==2){
1809  cont_eleptvscutvars[1] = nSigmaTPCele;
1810  }else if(ih==3){
1811  cont_eleptvscutvars[1] = nSigmaTOFele;
1812  }else if(ih==4){
1813  cont_eleptvscutvars[1] = trk->Eta();
1814  }else if(ih==5){
1815  cont_eleptvscutvars[1] = trk->GetITSNcls();
1816  }else if(ih==6){
1817  if(casc->ChargeXi()<0)
1818  cont_eleptvscutvars[1] = casc->MassLambda();
1819  else
1820  cont_eleptvscutvars[1] = casc->MassAntiLambda();
1821  }else if(ih==7){
1822  cont_eleptvscutvars[1] = casc->MassXi();
1823  }else if(ih==8){
1824  Double_t lPosV0[3];
1825  lPosV0[0] = casc->DecayVertexV0X();
1826  lPosV0[1] = casc->DecayVertexV0Y();
1827  lPosV0[2] = casc->DecayVertexV0Z();
1828  cont_eleptvscutvars[1] = TMath::Sqrt(lPosV0[0]*lPosV0[0]+lPosV0[1]*lPosV0[1]);
1829  }else if(ih==9){
1830  Double_t lPosXi[3];
1831  lPosXi[0] = casc->DecayVertexXiX();
1832  lPosXi[1] = casc->DecayVertexXiY();
1833  lPosXi[2] = casc->DecayVertexXiZ();
1834  cont_eleptvscutvars[1] = TMath::Sqrt(lPosXi[0]*lPosXi[0]+lPosXi[1]*lPosXi[1]);
1835  }else if(ih==10){
1836  cont_eleptvscutvars[1] = casc->DcaV0Daughters();
1837  }else if(ih==11){
1838  cont_eleptvscutvars[1] = casc->DcaXiDaughters();
1839  }else if(ih==12){
1840  cont_eleptvscutvars[1] = casc->DcaBachToPrimVertex();
1841  }else if(ih==13){
1842  if(casc->ChargeXi()<0.)
1843  cont_eleptvscutvars[1] = casc->DcaPosToPrimVertex();
1844  else
1845  cont_eleptvscutvars[1] = casc->DcaNegToPrimVertex();
1846  }else if(ih==14){
1847  if(casc->ChargeXi()>0.)
1848  cont_eleptvscutvars[1] = casc->DcaPosToPrimVertex();
1849  else
1850  cont_eleptvscutvars[1] = casc->DcaNegToPrimVertex();
1851  }else if(ih==15){
1852  cont_eleptvscutvars[1] = casc->CosPointingAngle(casc->GetDecayVertexXi());
1853  }else if(ih==16){
1854  cont_eleptvscutvars[1] = casc->CosPointingAngleXi(posVtx[0],posVtx[1],posVtx[2]);
1855  }else if(ih==17){
1856  cont_eleptvscutvars[1] = nSigmaTPCv0pr;
1857  }else if(ih==18){
1858  cont_eleptvscutvars[1] = nSigmaTPCv0pi;
1859  }else if(ih==19){
1860  cont_eleptvscutvars[1] = nSigmaTPCbachpi;
1861  }else if(ih==20){
1862  cont_eleptvscutvars[1] = casc->Eta();
1863  }else if(ih==21){
1864  cont_eleptvscutvars[1] = 0.5*TMath::Log((sqrt(casc->Ptot2Xi())+casc->MomXiZ())/(sqrt(casc->Ptot2Xi())-casc->MomXiZ()));
1865  }else if(ih==22){
1866  Double_t xipx = exobj->PxProng(1);
1867  Double_t xipy = exobj->PyProng(1);
1868  Double_t xipz = exobj->PzProng(1);
1869  Double_t epx = exobj->PxProng(0);
1870  Double_t epy = exobj->PyProng(0);
1871  Double_t epz = exobj->PzProng(0);
1872  cont_eleptvscutvars[1] = acos((xipx*epx+xipy*epy+xipz*epz)/sqrt(xipx*xipx+xipy*xipy+xipz*xipz)/sqrt(epx*epx+epy*epy+epz*epz));
1873  }else{
1874  cont_eleptvscutvars[1] = -9999.;
1875  }
1876 
1877  fHistoElePtvsCutVarsWS[ih]->Fill(cont_eleptvscutvars);
1878  }
1879  }
1880  if(fUseMCInfo){
1881  if(mcxic){
1882  Int_t pdgcode = mcxic->GetPdgCode();
1883  if(abs(pdgcode)==5132 && abs(mcpdgele_array[1])==5132 && abs(mcpdgcasc_array[1])==4132 && abs(mcpdgcasc_array[2])==5132){
1884  fHistoEleXiMassXibMCS->Fill(cont);
1885  if(trk->Charge()>0) fHistoEleXiMassXibMCS1->Fill(cont);
1886  else fHistoEleXiMassXibMCS2->Fill(cont);
1887  }
1888  if(abs(pdgcode)==5132 && abs(mcpdgele_array[1])==5132 && abs(mcpdgcasc_array[1])==4232 && abs(mcpdgcasc_array[2])==5132){
1889  fHistoEleXiMassXibMCS->Fill(cont);
1890  if(trk->Charge()>0) fHistoEleXiMassXibMCS1->Fill(cont);
1891  else fHistoEleXiMassXibMCS2->Fill(cont);
1892  }
1893  if(abs(pdgcode)==5232 && abs(mcpdgele_array[1])==5232 && abs(mcpdgcasc_array[1])==4132 && abs(mcpdgcasc_array[2])==5232){
1894  fHistoEleXiMassXibMCS->Fill(cont);
1895  if(trk->Charge()>0) fHistoEleXiMassXibMCS1->Fill(cont);
1896  else fHistoEleXiMassXibMCS2->Fill(cont);
1897  }
1898  if(abs(pdgcode)==5232 && abs(mcpdgele_array[1])==5232 && abs(mcpdgcasc_array[1])==4232 && abs(mcpdgcasc_array[2])==5232){
1899  fHistoEleXiMassXibMCS->Fill(cont);
1900  if(trk->Charge()>0) fHistoEleXiMassXibMCS1->Fill(cont);
1901  else fHistoEleXiMassXibMCS2->Fill(cont);
1902  }
1903  }
1904  }
1905  fHistodPhiSdEtaSElectronProtonR125WS->Fill(dphis_ele_pr,detas_ele_pr);
1906  fHistodPhiSdEtaSElectronPionR125WS->Fill(dphis_ele_pi,detas_ele_pi);
1907  fHistodPhiSdEtaSElectronBachelorR125WS->Fill(dphis_ele_bach,detas_ele_bach);
1908  }
1909 
1910  }
1911 
1912  //if( exobj->InvMass(2,pdgdg)<10. && cosoa < 0. && fAnalCuts->IsPeakRegion(casc))
1913  if( mexi_flip <10. && cosoa < 0. && fAnalCuts->IsPeakRegion(casc))
1914  {
1915  if(trk->Charge()*casc->ChargeXi()<0){
1916  fHistoEleXiMassRSAway->Fill(cont_flip);
1917  if(trk->Charge()>0) fHistoEleXiMassRS1Away->Fill(cont_flip);
1918  else fHistoEleXiMassRS2Away->Fill(cont_flip);
1919  }else{
1920  fHistoEleXiMassWSAway->Fill(cont_flip);
1921  if(trk->Charge()>0) fHistoEleXiMassWS1Away->Fill(cont_flip);
1922  else fHistoEleXiMassWS2Away->Fill(cont_flip);
1923  }
1924  }
1925 
1927  {
1928  if(trk->Charge()*casc->ChargeXi()<0){
1929  fHistoEleXiMassRSSide->Fill(cont);
1930  if(trk->Charge()>0) fHistoEleXiMassRSSide1->Fill(cont);
1931  else fHistoEleXiMassRSSide2->Fill(cont);
1932  fHistoEleXiMassvsElePtRSSide->Fill(cont2);
1933  if(trk->Charge()>0) fHistoEleXiMassvsElePtRSSide1->Fill(cont2);
1934  else fHistoEleXiMassvsElePtRSSide2->Fill(cont2);
1935  }else{
1936  fHistoEleXiMassWSSide->Fill(cont);
1937  if(trk->Charge()>0) fHistoEleXiMassWSSide1->Fill(cont);
1938  else fHistoEleXiMassWSSide2->Fill(cont);
1939  fHistoEleXiMassvsElePtWSSide->Fill(cont2);
1940  if(trk->Charge()>0) fHistoEleXiMassvsElePtWSSide1->Fill(cont2);
1941  else fHistoEleXiMassvsElePtWSSide2->Fill(cont2);
1942  }
1943  }
1944 
1945  //if( exobj->InvMass(2,pdgdg)<10. && cosoa < 0. && fAnalCuts->IsSideBand(casc))
1946  if( mexi_flip< 10. && cosoa < 0. && fAnalCuts->IsSideBand(casc))
1947  {
1948  if(trk->Charge()*casc->ChargeXi()<0){
1949  fHistoEleXiMassRSSideAway->Fill(cont_flip);
1950  if(trk->Charge()>0) fHistoEleXiMassRSSide1Away->Fill(cont_flip);
1951  else fHistoEleXiMassRSSide2Away->Fill(cont_flip);
1952  }else{
1953  fHistoEleXiMassWSSideAway->Fill(cont_flip);
1954  if(trk->Charge()>0) fHistoEleXiMassWSSide1Away->Fill(cont_flip);
1955  else fHistoEleXiMassWSSide2Away->Fill(cont_flip);
1956  }
1957  }
1958 
1959  //
1960  // New strategy: Fully analyze correlation
1961  //
1962  for(Int_t iv=0;iv<12;iv++){
1963  fCorrelationVariables[iv] = -9999.;
1964  }
1965 
1966  fCorrelationVariables[0] = sqrt(pow(casc->MomXiX(),2)+pow(casc->MomXiY(),2));
1967  fCorrelationVariables[1] = trk->Pt();
1968  fCorrelationVariables[2] = fAnalCuts->DeltaPhi(casc,trk);
1969  fCorrelationVariables[3] = fAnalCuts->DeltaEta(casc,trk);
1970  fCorrelationVariables[5] = exobj->Getd0Prong(0);
1971  if(!fUseMCInfo) fCorrelationVariables[6] = 0;
1972  else fCorrelationVariables[6] = 1;
1973  if(trk->Charge()>0){
1974  if(casc->ChargeXi()<0) fCorrelationVariables[7] = 0;
1975  else fCorrelationVariables[7] = 2;
1976  }else if(trk->Charge()<0){
1977  if(casc->ChargeXi()<0) fCorrelationVariables[7] = 1;
1978  else fCorrelationVariables[7] = 3;
1979  }
1980  fCorrelationVariables[8] = (Int_t)isconv + 2 * (Int_t)isconv_like;
1982  fCorrelationVariables[11] = exobj->Pt();
1983 
1984  if(fUseMCInfo && FromSemileptonicDecays(mcpdgele_array)>0){
1985  if(mcxic){
1986  Int_t pdgcode = mcxic->GetPdgCode();
1987  if(abs(pdgcode)==4132 && abs(mcpdgele_array[1])==4132 && abs(mcpdgcasc_array[1])==4132){
1988  fCorrelationVariables[9] = 1;
1989  }
1990  if(abs(pdgcode)==5132 && abs(mcpdgele_array[1])==5132 && abs(mcpdgcasc_array[1])==4132 && abs(mcpdgcasc_array[2])==5132){
1991  fCorrelationVariables[9] = 11;
1992  }
1993  if(abs(pdgcode)==5132 && abs(mcpdgele_array[1])==5132 && abs(mcpdgcasc_array[1])==4232 && abs(mcpdgcasc_array[2])==5132){
1994  fCorrelationVariables[9] = 12;
1995  }
1996  if(abs(pdgcode)==5232 && abs(mcpdgele_array[1])==5232 && abs(mcpdgcasc_array[1])==4132 && abs(mcpdgcasc_array[2])==5232){
1997  fCorrelationVariables[9] = 13;
1998  }
1999  if(abs(pdgcode)==5232 && abs(mcpdgele_array[1])==5232 && abs(mcpdgcasc_array[1])==4232 && abs(mcpdgcasc_array[2])==5232){
2000  fCorrelationVariables[9] = 14;
2001  }
2002  }
2003  if(fCorrelationVariables[9]<0){
2004  Bool_t lam_from_bottom = HaveBottomInHistory(mcpdgcasc_array);
2005  Bool_t lam_from_charm = HaveCharmInHistory(mcpdgcasc_array);
2006  if(FromSemileptonicDecays(mcpdgele_array)==1){
2007  if(lam_from_bottom) fCorrelationVariables[9] = 1011;
2008  else if(lam_from_charm) fCorrelationVariables[9] = 1012;
2009  else fCorrelationVariables[9] = 1013;
2010  }
2011  if(FromSemileptonicDecays(mcpdgele_array)==2){
2012  if(lam_from_bottom) fCorrelationVariables[9] = 1014;
2013  else if(lam_from_charm) fCorrelationVariables[9] = 1015;
2014  else fCorrelationVariables[9] = 1016;
2015  }
2016  if(FromSemileptonicDecays(mcpdgele_array)==1 && HaveBottomInHistory(mcpdgele_array)){
2017  if(lam_from_bottom) fCorrelationVariables[9] = 1017;
2018  else if(lam_from_charm) fCorrelationVariables[9] = 1018;
2019  else fCorrelationVariables[9] = 1019;
2020  }
2021  }
2022  }
2023 
2025  {
2026  fCorrelationVariablesTree->Fill();
2027  }
2028 
2029 
2030  return;
2031 }
2032 
2034 void AliAnalysisTaskSEXic2eleXifromAODtracks::FillMixROOTObjects(TLorentzVector *trke, TLorentzVector *casc, TVector *elevars, TVector *cascvars, Int_t chargexi)
2035 {
2036  //
2037  // Fill histograms or tree depending on fWriteVariableTree
2038  //
2039  if(!trke) return;
2040  if(!casc) return;
2041 
2042 
2043  for(Int_t i=0;i<90;i++){
2044  fCandidateVariables[i] = -9999.;
2045  }
2046 
2047  Double_t pxe = trke->Px();
2048  Double_t pye = trke->Py();
2049  Double_t pze = trke->Pz();
2050  Double_t mome = sqrt(pxe*pxe+pye*pye+pze*pze);
2051  Double_t Ee = sqrt(mome*mome+0.000510998928*0.000510998928);
2052 
2053  Double_t pxv = casc->Px();
2054  Double_t pyv = casc->Py();
2055  Double_t pzv = casc->Pz();
2056  Double_t momv = sqrt(pxv*pxv+pyv*pyv+pzv*pzv);
2057  Double_t Ev = sqrt(momv*momv+1.32171*1.32171);
2058 
2059  Double_t cosoa = (pxe*pxv+pye*pyv+pze*pzv)/mome/momv;
2060 
2061  Double_t pxsum = pxe + pxv;
2062  Double_t pysum = pye + pyv;
2063  Double_t pzsum = pze + pzv;
2064  Double_t Esum = Ee + Ev;
2065  Double_t mexi = sqrt(Esum*Esum-pxsum*pxsum-pysum*pysum-pzsum*pzsum);
2066 
2067  Double_t uxe = pxe/mome;
2068  Double_t uye = pye/mome;
2069  Double_t uze = pze/mome;
2070  Double_t lf = -2.*(pxv*uxe+pyv*uye+pzv*uze);
2071  Double_t pxv_flip = pxv + lf * uxe;
2072  Double_t pyv_flip = pyv + lf * uye;
2073  Double_t pzv_flip = pzv + lf * uze;
2074  Double_t pxsum_flip = pxe + pxv_flip;
2075  Double_t pysum_flip = pye + pyv_flip;
2076  Double_t pzsum_flip = pze + pzv_flip;
2077  Double_t mexi_flip = sqrt(Esum*Esum-pxsum_flip*pxsum_flip-pysum_flip*pysum_flip-pzsum_flip*pzsum_flip);
2078  Double_t ptexi_flip = sqrt(pxsum_flip*pxsum_flip+pysum_flip*pysum_flip);
2079 
2080  Double_t posVtx[3] = {0.,0.,0.};
2081  fVtx1->GetXYZ(posVtx);
2082 
2084  UInt_t pdgdg[2]={11,3312};
2085  fCandidateVariables[ 1] = mexi;
2086  fCandidateVariables[ 2] = sqrt(pxsum*pxsum+pysum*pysum);
2087  fCandidateVariables[ 3] = pxsum;
2088  fCandidateVariables[ 4] = pysum;
2089  fCandidateVariables[ 5] = pzsum;
2090  fCandidateVariables[ 6] = pxe;
2091  fCandidateVariables[ 7] = pye;
2092  fCandidateVariables[ 8] = pze;
2093  fCandidateVariables[ 9] = pxv;
2094  fCandidateVariables[10] = pyv;
2095  fCandidateVariables[11] = pzv;
2096  fCandidateVariables[12] = chargexi;
2097  fCandidateVariables[13] = casc->M();
2098  fCandidateVariables[29] = trke->T();
2099  fCandidateVariables[30] = 1;//mixing
2100  fCandidateVariables[77] = fVtx1->GetX();
2101  fCandidateVariables[78] = fVtx1->GetY();
2102  fCandidateVariables[79] = fVtx1->GetZ();
2104 
2105  if(fWriteVariableTree)
2106  fVariablesTree->Fill();
2107 
2108  Double_t cont[4];
2109  cont[0] = mexi;
2110  cont[1] = sqrt(pxsum*pxsum+pysum*pysum);
2111  cont[2] = 0.0;
2112  cont[3] = fCentrality;
2113 
2114  Double_t cont_flip[4];
2115  cont_flip[0] = mexi_flip;
2116  cont_flip[1] = ptexi_flip;
2117  cont_flip[2] = 0.0;
2118  cont_flip[3] = fCentrality;
2119 
2120  Double_t cont2[3];
2121  cont2[0] = mexi;
2122  cont2[1] = sqrt(pxe*pxe+pye*pye);
2123  cont2[2] = fCentrality;
2124 
2125  Double_t cont_eleptvseta[3];
2126  cont_eleptvseta[0] = trke->Pt();
2127  cont_eleptvseta[1] = trke->Eta();
2128  cont_eleptvseta[2] = fCentrality;
2129 
2130  Double_t cont_eleptvsxipt[3];
2131  cont_eleptvsxipt[0] = trke->Pt();
2132  cont_eleptvsxipt[1] = casc->Pt();
2133  cont_eleptvsxipt[2] = fCentrality;
2134 
2135  Double_t cont_eleptvsd0[3];
2136  cont_eleptvsd0[0] = trke->Pt();
2137  cont_eleptvsd0[1] = 0.;
2138  cont_eleptvsd0[2] = fCentrality;
2139 
2140  Double_t xyzR125_ele[3], xyzR125_pr[3], xyzR125_pi[3], xyzR125_bach[3];
2141  xyzR125_ele[0] = (*elevars)[0];
2142  xyzR125_ele[1] = (*elevars)[1];
2143  xyzR125_ele[2] = (*elevars)[2];
2144  xyzR125_pr[0] = (*cascvars)[0];
2145  xyzR125_pr[1] = (*cascvars)[1];
2146  xyzR125_pr[2] = (*cascvars)[2];
2147  xyzR125_pi[0] = (*cascvars)[3];
2148  xyzR125_pi[1] = (*cascvars)[4];
2149  xyzR125_pi[2] = (*cascvars)[5];
2150  xyzR125_bach[0] = (*cascvars)[6];
2151  xyzR125_bach[1] = (*cascvars)[7];
2152  xyzR125_bach[2] = (*cascvars)[8];
2153 
2154  Double_t rdhfcutvars[12];
2155  rdhfcutvars[0] = xyzR125_ele[0];
2156  rdhfcutvars[1] = xyzR125_ele[1];
2157  rdhfcutvars[2] = xyzR125_ele[2];
2158  rdhfcutvars[3] = xyzR125_pr[0];
2159  rdhfcutvars[4] = xyzR125_pr[1];
2160  rdhfcutvars[5] = xyzR125_pr[2];
2161  rdhfcutvars[6] = xyzR125_pi[0];
2162  rdhfcutvars[7] = xyzR125_pi[1];
2163  rdhfcutvars[8] = xyzR125_pi[2];
2164  rdhfcutvars[9] = xyzR125_bach[0];
2165  rdhfcutvars[10] = xyzR125_bach[1];
2166  rdhfcutvars[11] = xyzR125_bach[2];
2167 
2168  Double_t dphis_ele_pr = fAnalCuts->dPhiSR125(xyzR125_ele,xyzR125_pr);
2169  Double_t detas_ele_pr = fAnalCuts->dEtaSR125(xyzR125_ele,xyzR125_pr);
2170  Double_t dphis_ele_pi = fAnalCuts->dPhiSR125(xyzR125_ele,xyzR125_pi);
2171  Double_t detas_ele_pi = fAnalCuts->dEtaSR125(xyzR125_ele,xyzR125_pi);
2172  Double_t dphis_ele_bach = fAnalCuts->dPhiSR125(xyzR125_ele,xyzR125_bach);
2173  Double_t detas_ele_bach = fAnalCuts->dEtaSR125(xyzR125_ele,xyzR125_bach);
2174 
2175  //if(mexi<10. && cosoa>0. && fAnalCuts->IsPeakRegion(casc))
2176  if(fAnalCuts->IsSelected(trke,casc,rdhfcutvars,AliRDHFCuts::kCandidate) && fAnalCuts->IsPeakRegion(casc))
2177  {
2178  if(((int)trke->T())*chargexi<0){
2179  fHistoEleXiMassRSMix->Fill(cont);
2180  if(trke->T()>0) fHistoEleXiMassRSMix1->Fill(cont);
2181  else fHistoEleXiMassRSMix2->Fill(cont);
2182  fHistoEleXiMassvsElePtRSMix->Fill(cont2);
2183  if(trke->T()>0) fHistoEleXiMassvsElePtRSMix1->Fill(cont2);
2184  else fHistoEleXiMassvsElePtRSMix2->Fill(cont2);
2185  if(cont[0]<2.5){
2186  fHistoElePtRSMix->Fill(trke->Pt(),fCentrality);
2187  fHistoElePtvsEtaRSMix->Fill(cont_eleptvseta);
2188  fHistoElePtvsXiPtRSMix->Fill(cont_eleptvsxipt);
2189  fHistoElePtvsd0RSMix->Fill(cont_eleptvsd0);
2190  }
2191  fHistodPhiSdEtaSElectronProtonR125RSMix->Fill(dphis_ele_pr,detas_ele_pr);
2192  fHistodPhiSdEtaSElectronPionR125RSMix->Fill(dphis_ele_pi,detas_ele_pi);
2193  fHistodPhiSdEtaSElectronBachelorR125RSMix->Fill(dphis_ele_bach,detas_ele_bach);
2194  }else{
2195  fHistoEleXiMassWSMix->Fill(cont);
2196  if(trke->T()>0) fHistoEleXiMassWSMix1->Fill(cont);
2197  else fHistoEleXiMassWSMix2->Fill(cont);
2198  fHistoEleXiMassvsElePtWSMix->Fill(cont2);
2199  if(trke->T()>0) fHistoEleXiMassvsElePtWSMix1->Fill(cont2);
2200  else fHistoEleXiMassvsElePtWSMix2->Fill(cont2);
2201  if(cont[0]<2.5){
2202  fHistoElePtWSMix->Fill(trke->Pt(),fCentrality);
2203  fHistoElePtvsEtaWSMix->Fill(cont_eleptvseta);
2204  fHistoElePtvsXiPtWSMix->Fill(cont_eleptvsxipt);
2205  fHistoElePtvsd0WSMix->Fill(cont_eleptvsd0);
2206  }
2207  fHistodPhiSdEtaSElectronProtonR125WSMix->Fill(dphis_ele_pr,detas_ele_pr);
2208  fHistodPhiSdEtaSElectronPionR125WSMix->Fill(dphis_ele_pi,detas_ele_pi);
2209  fHistodPhiSdEtaSElectronBachelorR125WSMix->Fill(dphis_ele_bach,detas_ele_bach);
2210  }
2211  }
2212 
2213  //if(mexi < 10. && cosoa<0. && fAnalCuts->IsPeakRegion(casc))
2214  if(mexi_flip < 10. && cosoa<0. && fAnalCuts->IsPeakRegion(casc))
2215  {
2216  if(((int)trke->T())*chargexi<0){
2217  fHistoEleXiMassRSMixAway->Fill(cont_flip);
2218  if(trke->T()>0) fHistoEleXiMassRSMix1Away->Fill(cont_flip);
2219  else fHistoEleXiMassRSMix2Away->Fill(cont_flip);
2220  }else{
2221  fHistoEleXiMassWSMixAway->Fill(cont_flip);
2222  if(trke->T()>0) fHistoEleXiMassWSMix1Away->Fill(cont_flip);
2223  else fHistoEleXiMassWSMix2Away->Fill(cont_flip);
2224  }
2225  }
2226 
2227  //
2228  // New strategy: Fully analyze correlation
2229  //
2230  for(Int_t iv=0;iv<12;iv++){
2231  fCorrelationVariables[iv] = -9999.;
2232  }
2233 
2234  fCorrelationVariables[0] = casc->Pt();
2235  fCorrelationVariables[1] = trke->Pt();
2236  fCorrelationVariables[2] = TVector2::Phi_mpi_pi(casc->Phi()-trke->Phi());
2237  fCorrelationVariables[3] = casc->Eta()-trke->Eta();
2238  fCorrelationVariables[5] = (*elevars)[5];
2239  fCorrelationVariables[6] = 2;
2240  if(trke->T()>0){
2241  if(chargexi<0) fCorrelationVariables[7] = 0;
2242  else fCorrelationVariables[7] = 2;
2243  }else if(trke->T()<0){
2244  if(chargexi<0) fCorrelationVariables[7] = 1;
2245  else fCorrelationVariables[7] = 3;
2246  }
2247  fCorrelationVariables[10] = fCentrality;
2248  fCorrelationVariables[11] = sqrt(pxsum*pxsum+pysum*pysum);
2249 
2250  if(fAnalCuts->IsSelected(trke,casc,rdhfcutvars,AliRDHFCuts::kCandidate) && fAnalCuts->IsPeakRegion(casc))
2251  {
2252  fCorrelationVariablesTree->Fill();
2253  }
2254 
2255 
2256  return;
2257 }
2258 
2261 {
2262  //
2263  // Define electron tree variables
2264  //
2265 
2266  const char* nameoutput = GetOutputSlot(5)->GetContainer()->GetName();
2267  fEleVariablesTree = new TTree(nameoutput,"electron variables tree");
2268  Int_t nVar = 26;
2269  fCandidateEleVariables = new Float_t [nVar];
2270  TString * fCandidateVariableNames = new TString[nVar];
2271 
2272  fCandidateVariableNames[ 0]="ElePx";
2273  fCandidateVariableNames[ 1]="ElePy";
2274  fCandidateVariableNames[ 2]="ElePz";
2275  fCandidateVariableNames[ 3]="TPCChi2overNDF";
2276  fCandidateVariableNames[ 4]="ITSNcls";
2277  fCandidateVariableNames[ 5]="TPCNcls";
2278  fCandidateVariableNames[ 6]="TPCNclsPID";
2279  fCandidateVariableNames[ 7]="TPCNclsRatio";
2280  fCandidateVariableNames[ 8]="d0R";
2281  fCandidateVariableNames[ 9]="d0Z";
2282  fCandidateVariableNames[10]="ITSClusterMap";
2283  fCandidateVariableNames[11]="nSigmaTPCele";
2284  fCandidateVariableNames[12]="nSigmaTOFele";
2285  fCandidateVariableNames[13]="nSigmaTPCpi";
2286  fCandidateVariableNames[14]="nSigmaTPCka";
2287  fCandidateVariableNames[15]="nSigmaTPCpr";
2288  fCandidateVariableNames[16]="EvNumber";
2289  fCandidateVariableNames[17]="EleCharge";
2290  fCandidateVariableNames[18]="ElePdgCode";
2291  fCandidateVariableNames[19]="EleMotherPdgCode";
2292  fCandidateVariableNames[20]="mcelepx";
2293  fCandidateVariableNames[21]="mcelepy";
2294  fCandidateVariableNames[22]="mcelepz";
2295  fCandidateVariableNames[23]="Centrality";
2296  fCandidateVariableNames[24]="PrimVertZ";
2297  fCandidateVariableNames[25]="RunNumber";
2298 
2299  for (Int_t ivar=0; ivar<nVar; ivar++) {
2300  fEleVariablesTree->Branch(fCandidateVariableNames[ivar].Data(),&fCandidateEleVariables[ivar],Form("%s/f",fCandidateVariableNames[ivar].Data()));
2301  }
2302 
2303  return;
2304 }
2306 void AliAnalysisTaskSEXic2eleXifromAODtracks::FillElectronROOTObjects(AliAODTrack *trk, AliAODTrack *trkpid, AliAODEvent *event, TClonesArray *mcArray)
2307 {
2308  //
2309  // Fill histograms or tree depending on fWriteVariableTree
2310  //
2311 
2312  if(!trk) return;
2313 
2314  fHistoBachPt->Fill(trk->Pt());
2315  fHistoElectronQovPtvsPhi->Fill(trk->Phi(),(Double_t)trk->Charge()/trk->Pt());
2316 
2317  Double_t d0z0[2],covd0z0[3];
2318  trk->PropagateToDCA(fVtx1,fBzkG,kVeryBig,d0z0,covd0z0);
2319 
2320  if(fDoEventMixing){
2321  Double_t pv[3];
2322  pv[0] = fVtx1->GetX();
2323  pv[1] = fVtx1->GetY();
2324  pv[2] = fVtx1->GetZ();
2325  Double_t xyzR125[3] = {9999.,9999.,9999.};
2326  if(fAnalCuts->GetCuts()[2]>0. || fAnalCuts->GetCuts()[3]>0.) fAnalCuts->SetSftPosR125(trk,fBzkG,pv,xyzR125);
2327  TVector *varvec = new TVector(6);
2328  (*varvec)[0] = xyzR125[0];
2329  (*varvec)[1] = xyzR125[1];
2330  (*varvec)[2] = xyzR125[2];
2331  (*varvec)[3] = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTPC(trkpid,AliPID::kElectron);
2332  (*varvec)[4] = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTOF(trkpid,AliPID::kElectron);
2333  (*varvec)[5] = d0z0[0];
2334  fElectronTracks->AddLast(new TLorentzVector(trk->Px(),trk->Py(),trk->Pz(),trk->Charge()));
2335  fElectronCutVarsArray->AddLast(varvec);
2336  }
2337 
2338 
2339  Int_t pdgEle = -9999;
2340  Int_t pdgEleMother = -9999;
2341  Float_t mcepx = -9999;
2342  Float_t mcepy = -9999;
2343  Float_t mcepz = -9999;
2344  if(fUseMCInfo)
2345  {
2346  Int_t labEle = trk->GetLabel();
2347  if(labEle<0) return;
2348  AliAODMCParticle *mcetrk = (AliAODMCParticle*)mcArray->At(labEle);
2349  if(!mcetrk) return;
2350  pdgEle = mcetrk->GetPdgCode();
2351  mcepx = mcetrk->Px();
2352  mcepy = mcetrk->Py();
2353  mcepz = mcetrk->Pz();
2354  }
2355 
2356 
2357  if(!fWriteEachVariableTree) return;
2358 
2359 
2360  for(Int_t i=0;i<26;i++){
2361  fCandidateEleVariables[i] = -9999.;
2362  }
2363 
2364  fCandidateEleVariables[ 0] = trk->Px();
2365  fCandidateEleVariables[ 1] = trk->Py();
2366  fCandidateEleVariables[ 2] = trk->Pz();
2367  fCandidateEleVariables[ 3] = trk->Chi2perNDF();
2368  fCandidateEleVariables[ 4] = trk->GetITSNcls();
2369  fCandidateEleVariables[ 5] = trk->GetTPCncls();
2370  fCandidateEleVariables[ 6] = trk->GetTPCsignalN();
2371  if(trk->GetTPCNclsF()>0)
2372  fCandidateEleVariables[ 7] = (Float_t)trk->GetTPCncls()/(Float_t)trk->GetTPCNclsF();
2373 
2374  fCandidateEleVariables[ 8] = d0z0[0];
2375  fCandidateEleVariables[ 9] = d0z0[1];
2376  Int_t itsmap = trk->GetITSClusterMap();
2377  Int_t bit1 = 1;
2378  Int_t bit2 = 2;
2379  Bool_t spdfirst = (itsmap & bit1) == bit1;
2380  Bool_t spdsecond = (itsmap & bit2) == bit2;
2381  fCandidateEleVariables[10] = ((Int_t)spdfirst) + 2 * ((Int_t)spdsecond);
2382 
2383  if(fAnalCuts->GetIsUsePID())
2384  {
2385  Double_t nSigmaTPCele = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTPC(trk,AliPID::kElectron);
2386  Double_t nSigmaTOFele = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTOF(trk,AliPID::kElectron);
2387  Double_t nSigmaTPCpi_etrk = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTPC(trk,AliPID::kPion);
2388  Double_t nSigmaTPCka_etrk = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTPC(trk,AliPID::kKaon);
2389  Double_t nSigmaTPCpr_etrk = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTPC(trk,AliPID::kProton);
2390  fCandidateEleVariables[11] = nSigmaTPCele;
2391  fCandidateEleVariables[12] = nSigmaTOFele;
2392  fCandidateEleVariables[13] = nSigmaTPCpi_etrk;
2393  fCandidateEleVariables[14] = nSigmaTPCka_etrk;
2394  fCandidateEleVariables[15] = nSigmaTPCpr_etrk;
2395  }
2397  fCandidateEleVariables[17] = trk->Charge();
2398  fCandidateEleVariables[18] = pdgEle;
2399  fCandidateEleVariables[19] = pdgEleMother;
2400  fCandidateEleVariables[20] = mcepx;
2401  fCandidateEleVariables[21] = mcepy;
2402  fCandidateEleVariables[22] = mcepz;
2406 
2407  fHistod0Bach->Fill(d0z0[0]);
2408 
2409  fEleVariablesTree->Fill();
2410 }
2413 {
2414  //
2415  // Define V0 tree variables
2416  //
2417 
2418  const char* nameoutput = GetOutputSlot(6)->GetContainer()->GetName();
2419  fCascVariablesTree = new TTree(nameoutput,"cascade variables tree");
2420  Int_t nVar = 26;
2421  fCandidateCascVariables = new Float_t [nVar];
2422  TString * fCandidateVariableNames = new TString[nVar];
2423 
2424  fCandidateVariableNames[ 0]="Centrality";
2425  fCandidateVariableNames[ 1]="InvMassXi";
2426  fCandidateVariableNames[ 2]="XiPx";
2427  fCandidateVariableNames[ 3]="XiPy";
2428  fCandidateVariableNames[ 4]="XiPz";
2429  fCandidateVariableNames[ 5]="InvMassLambda";
2430  fCandidateVariableNames[ 6]="DcaXiDaughters";
2431  fCandidateVariableNames[ 7]="DcaV0Daughters";
2432  fCandidateVariableNames[ 8]="DecayLengthXi";
2433  fCandidateVariableNames[ 9]="CosPointingAngleXi";
2434  fCandidateVariableNames[10]="DcaV0toPrimVertex";
2435  fCandidateVariableNames[11]="DcaPostoPrimVertex";
2436  fCandidateVariableNames[12]="DcaNegtoPrimVertex";
2437  fCandidateVariableNames[13]="DcaBachtoPrimVertex";
2438  fCandidateVariableNames[14]="DecayLengthV0";
2439  fCandidateVariableNames[15]="CosPointingAngleV0";
2440  fCandidateVariableNames[16]="XiCharge";
2441  fCandidateVariableNames[17]="XiPdgCode";
2442  fCandidateVariableNames[18]="XiMotherPdgCode";
2443  fCandidateVariableNames[19]="mcxipx";
2444  fCandidateVariableNames[20]="mcxipy";
2445  fCandidateVariableNames[21]="mcxipz";
2446  fCandidateVariableNames[22]="labcasc";
2447  fCandidateVariableNames[23]="RunNumber";
2448  fCandidateVariableNames[24]="PrimVertZ";
2449  fCandidateVariableNames[25]="EvNumber";
2450 
2451  for (Int_t ivar=0; ivar<nVar; ivar++) {
2452  fCascVariablesTree->Branch(fCandidateVariableNames[ivar].Data(),&fCandidateCascVariables[ivar],Form("%s/f",fCandidateVariableNames[ivar].Data()));
2453  }
2454 
2455  return;
2456 }
2457 
2459 void AliAnalysisTaskSEXic2eleXifromAODtracks::FillCascROOTObjects(AliAODcascade *casc, TClonesArray *mcArray)
2460 {
2461  //
2462  // Fill histograms or tree depending on fWriteVariableTree (tree not implemented yet)
2463  //
2464  if(!casc) return;
2465  AliAODTrack *cptrack = (AliAODTrack*)(casc->GetDaughter(0));
2466  AliAODTrack *cntrack = (AliAODTrack*)(casc->GetDaughter(1));
2467  AliAODTrack *cbtrack = (AliAODTrack*)(casc->GetDecayVertexXi()->GetDaughter(0));
2468  if(!cptrack) return;
2469  if(!cntrack) return;
2470  if(!cbtrack) return;
2471 
2472  fHistoXiMassvsPt->Fill(casc->MassXi(),sqrt(casc->MomXiX()*casc->MomXiX()+casc->MomXiY()*casc->MomXiY()));
2473  fHistoOmegaMassvsPt->Fill(casc->MassOmega(),sqrt(casc->MomXiX()*casc->MomXiX()+casc->MomXiY()*casc->MomXiY()));
2474  Double_t momxix = casc->MomXiX();
2475  Double_t momxiy = casc->MomXiY();
2476  Double_t phi_alice = atan2(momxiy,momxix);
2477  if(phi_alice<0.) phi_alice += 2 * M_PI;
2478  fHistoXiQovPtvsPhi->Fill(phi_alice,(Double_t)casc->ChargeXi()/sqrt(momxix*momxix+momxiy*momxiy));
2479 
2480  Double_t mlamPDG = TDatabasePDG::Instance()->GetParticle(3122)->Mass();
2481  Double_t posVtx[3] = {0.,0.,0.};
2482  fVtx1->GetXYZ(posVtx);
2483  Double_t ptotlam = TMath::Sqrt(pow(casc->Px(),2)+pow(casc->Py(),2)+pow(casc->Pz(),2));
2484  Double_t dl = sqrt(pow(casc->DecayVertexV0X()-posVtx[0],2)+pow(casc->DecayVertexV0Y()-posVtx[1],2)+pow(casc->DecayVertexV0Z()-posVtx[2],2));
2485  Double_t v0propdl = dl*mlamPDG/ptotlam;
2486  if(fAnalCuts->IsPeakRegion(casc)){
2487  fHistoLambdaPtvsDl->Fill(casc->Pt(),v0propdl);
2488  fHistoLambdaPtvsDR->Fill(casc->Pt(),dl);
2489  }
2490  if(fAnalCuts->IsSideBand(casc)){
2491  fHistoLambdaPtvsDlSide->Fill(casc->Pt(),v0propdl);
2492  fHistoLambdaPtvsDRSide->Fill(casc->Pt(),dl);
2493  }
2494 
2495  Int_t xipdgcode = -9999;
2496  Int_t ximotherpdgcode = -9999;
2497  Float_t mcxipx = -9999.;
2498  Float_t mcxipy = -9999.;
2499  Float_t mcxipz = -9999.;
2500  Int_t labcasc = -9999.;
2501  if(fUseMCInfo){
2502  Int_t pdgDgcasc[2]={211,3122};
2503  Int_t pdgDgv0[2]={2212,211};
2504  labcasc = MatchToMCCascade(casc,3312,pdgDgcasc,pdgDgv0,mcArray); // the cascade
2505  if(labcasc<0) return;
2506 
2507  fHistoXiMassvsPtMCS->Fill(casc->MassXi(),sqrt(casc->MomXiX()*casc->MomXiX()+casc->MomXiY()*casc->MomXiY()));
2508 
2509  AliAODMCParticle *mccasctrk = (AliAODMCParticle*)mcArray->At(labcasc);
2510  if(!mccasctrk) return;
2511 
2512  fHistoLambdaPtvsDlMCS->Fill(casc->Pt(),v0propdl);
2513  fHistoLambdaPtvsDRMCS->Fill(casc->Pt(),dl);
2514 
2515  Bool_t hfxi_flag = kFALSE;
2516  xipdgcode = mccasctrk->GetPdgCode();
2517  Int_t labcascmother = mccasctrk->GetMother();
2518  if(labcascmother>=0){
2519  AliAODMCParticle *mothercasc = (AliAODMCParticle*)mcArray->At(labcascmother);
2520  if(mothercasc){
2521  ximotherpdgcode = mothercasc->GetPdgCode();
2522  if(abs(ximotherpdgcode)>4000&&abs(ximotherpdgcode)<4400){
2523  hfxi_flag = kTRUE;
2524  }
2525  }
2526  }
2527  if(!hfxi_flag) return;
2528  mcxipx = mccasctrk->Px();
2529  mcxipy = mccasctrk->Py();
2530  mcxipz = mccasctrk->Pz();
2531  }
2532 
2533 
2534  Double_t xyz[3], pxpypz[3], cv[21]; Short_t sign;
2535  xyz[0]=casc->DecayVertexXiX();
2536  xyz[1]=casc->DecayVertexXiY();
2537  xyz[2]=casc->DecayVertexXiZ();
2538  pxpypz[0]=casc->MomXiX();
2539  pxpypz[1]=casc->MomXiY();
2540  pxpypz[2]=casc->MomXiZ();
2541  casc->GetCovarianceXYZPxPyPz(cv);
2542  sign=casc->ChargeXi();
2543  AliExternalTrackParam *trackCasc = new AliExternalTrackParam(xyz,pxpypz,cv,sign);
2544  trackCasc->PropagateToDCA(fVtx1,fBzkG,kVeryBig);
2545  Double_t momcasc_new[3]={-9999,-9999,-9999.};
2546  trackCasc->GetPxPyPz(momcasc_new);
2547 
2548  if(fDoEventMixing){
2549  TLorentzVector *lv = new TLorentzVector();
2550  lv->SetXYZM(momcasc_new[0],momcasc_new[1],momcasc_new[2],casc->MassXi());
2551  Double_t xyzR125pr[3]={9999.,9999.,9999.};
2552  Double_t xyzR125pi[3]={9999.,9999.,9999.};
2553  Double_t xyzR125bach[3]={9999.,9999.,9999.};
2554  if(casc->ChargeXi()>0){
2555  fCascadeTracks1->AddLast(lv);
2556  if(fAnalCuts->GetCuts()[2]>0. || fAnalCuts->GetCuts()[3]>0.){
2557  fAnalCuts->SetSftPosR125(cptrack,fBzkG,posVtx,xyzR125pr);
2558  fAnalCuts->SetSftPosR125(cntrack,fBzkG,posVtx,xyzR125pi);
2559  fAnalCuts->SetSftPosR125(cbtrack,fBzkG,posVtx,xyzR125bach);
2560  }
2561  TVector *varvec = new TVector(9);
2562  (*varvec)[0] = xyzR125pr[0];
2563  (*varvec)[1] = xyzR125pr[1];
2564  (*varvec)[2] = xyzR125pr[2];
2565  (*varvec)[3] = xyzR125pi[0];
2566  (*varvec)[4] = xyzR125pi[1];
2567  (*varvec)[5] = xyzR125pi[2];
2568  (*varvec)[6] = xyzR125bach[0];
2569  (*varvec)[7] = xyzR125bach[1];
2570  (*varvec)[8] = xyzR125bach[2];
2571  fCascadeCutVarsArray1->AddLast(varvec);
2572  }else{
2573  fCascadeTracks2->AddLast(lv);
2574  if(fAnalCuts->GetCuts()[2]>0. || fAnalCuts->GetCuts()[3]>0.){
2575  fAnalCuts->SetSftPosR125(cntrack,fBzkG,posVtx,xyzR125pr);
2576  fAnalCuts->SetSftPosR125(cptrack,fBzkG,posVtx,xyzR125pi);
2577  fAnalCuts->SetSftPosR125(cbtrack,fBzkG,posVtx,xyzR125bach);
2578  }
2579  TVector *varvec = new TVector(9);
2580  (*varvec)[0] = xyzR125pr[0];
2581  (*varvec)[1] = xyzR125pr[1];
2582  (*varvec)[2] = xyzR125pr[2];
2583  (*varvec)[3] = xyzR125pi[0];
2584  (*varvec)[4] = xyzR125pi[1];
2585  (*varvec)[5] = xyzR125pi[2];
2586  (*varvec)[6] = xyzR125bach[0];
2587  (*varvec)[7] = xyzR125bach[1];
2588  (*varvec)[8] = xyzR125bach[2];
2589  fCascadeCutVarsArray2->AddLast(varvec);
2590  }
2591  }
2592 
2593  if(!fWriteEachVariableTree) return;
2594 
2595  for(Int_t i=0;i<26;i++){
2596  fCandidateCascVariables[i] = -9999.;
2597  }
2598 
2600  fCandidateCascVariables[ 1] = casc->MassXi();
2601  fCandidateCascVariables[ 2] = momcasc_new[0];//casc->MomXiX();
2602  fCandidateCascVariables[ 3] = momcasc_new[1];//casc->MomXiY();
2603  fCandidateCascVariables[ 4] = momcasc_new[2];//casc->MomXiZ();
2604  if(casc->ChargeXi()<0)
2605  fCandidateCascVariables[ 5] = casc->MassLambda();
2606  else
2607  fCandidateCascVariables[ 5] = casc->MassAntiLambda();
2608 
2609  fCandidateCascVariables[ 6] = casc->DcaXiDaughters();
2610  fCandidateCascVariables[ 7] = casc->DcaV0Daughters();
2611  fCandidateCascVariables[ 8] = casc->DecayLengthXi(posVtx[0],posVtx[1],posVtx[2]);
2612  fCandidateCascVariables[ 9] = casc->CosPointingAngleXi(posVtx[0],posVtx[1],posVtx[2]);
2613  fCandidateCascVariables[10] = casc->DcaV0ToPrimVertex();
2614  fCandidateCascVariables[11] = casc->DcaPosToPrimVertex();
2615  fCandidateCascVariables[12] = casc->DcaNegToPrimVertex();
2616  fCandidateCascVariables[13] = casc->DcaBachToPrimVertex();
2617  fCandidateCascVariables[14] = casc->DecayLengthV0();
2618  fCandidateCascVariables[15] = casc->CosPointingAngle(casc->GetDecayVertexXi());
2619  fCandidateCascVariables[16] = casc->ChargeXi();
2620  fCandidateCascVariables[17] = xipdgcode;
2621  fCandidateCascVariables[18] = ximotherpdgcode;
2622  fCandidateCascVariables[19] = mcxipx;
2623  fCandidateCascVariables[20] = mcxipy;
2624  fCandidateCascVariables[21] = mcxipz;
2625  fCandidateCascVariables[22] = labcasc;
2629 
2630 
2631  fCascVariablesTree->Fill();
2632 }
2635 {
2636  //
2637  // Define electron tree variables
2638  //
2639 
2640  const char* nameoutput = GetOutputSlot(7)->GetContainer()->GetName();
2641  fMCVariablesTree = new TTree(nameoutput,"MC variables tree");
2642  Int_t nVar = 16;
2643  fCandidateMCVariables = new Float_t [nVar];
2644  TString * fCandidateVariableNames = new TString[nVar];
2645 
2646  fCandidateVariableNames[ 0]="Centrality";
2647  fCandidateVariableNames[ 1]="DecayType";
2648  fCandidateVariableNames[ 2]="XicPx";
2649  fCandidateVariableNames[ 3]="XicPy";
2650  fCandidateVariableNames[ 4]="XicPz";
2651  fCandidateVariableNames[ 5]="ElePx";
2652  fCandidateVariableNames[ 6]="ElePy";
2653  fCandidateVariableNames[ 7]="ElePz";
2654  fCandidateVariableNames[ 8]="CascPx";
2655  fCandidateVariableNames[ 9]="CascPy";
2656  fCandidateVariableNames[10]="CascPz";
2657  fCandidateVariableNames[11]="PdgCode";
2658  fCandidateVariableNames[12]="ElePdgCode";
2659  fCandidateVariableNames[13]="CascPdgCode";
2660  fCandidateVariableNames[14]="RunNumber";
2661  fCandidateVariableNames[15]="EvNumber";
2662 
2663  for (Int_t ivar=0; ivar<nVar; ivar++) {
2664  fMCVariablesTree->Branch(fCandidateVariableNames[ivar].Data(),&fCandidateMCVariables[ivar],Form("%s/f",fCandidateVariableNames[ivar].Data()));
2665  }
2666  return;
2667 }
2669 void AliAnalysisTaskSEXic2eleXifromAODtracks::FillMCROOTObjects(AliAODMCParticle *mcpart, AliAODMCParticle *mcepart, AliAODMCParticle *mccascpart, Int_t decaytype)
2670 {
2671  //
2672  // Fill histograms or tree depending on fWriteMCVariableTree
2673  //
2674  if(!mcpart) return;
2675  if(!mcepart) return;
2676  if(!mccascpart) return;
2677 
2678  for(Int_t i=0;i<14;i++){
2679  fCandidateMCVariables[i] = -9999.;
2680  }
2681 
2683  fCandidateMCVariables[ 1] = decaytype;
2684  fCandidateMCVariables[ 2] = mcpart->Px();
2685  fCandidateMCVariables[ 3] = mcpart->Py();
2686  fCandidateMCVariables[ 4] = mcpart->Pz();
2687  fCandidateMCVariables[ 5] = mcepart->Px();
2688  fCandidateMCVariables[ 6] = mcepart->Py();
2689  fCandidateMCVariables[ 7] = mcepart->Pz();
2690  fCandidateMCVariables[ 8] = mccascpart->Px();
2691  fCandidateMCVariables[ 9] = mccascpart->Py();
2692  fCandidateMCVariables[10] = mccascpart->Pz();
2693  fCandidateMCVariables[11] = mcpart->GetPdgCode();
2694  fCandidateMCVariables[12] = mcepart->GetPdgCode();
2695  fCandidateMCVariables[13] = mccascpart->GetPdgCode();
2698 
2699  Double_t epx = mcepart->Px();
2700  Double_t epy = mcepart->Py();
2701  Double_t epz = mcepart->Pz();
2702  Double_t eE = sqrt(epx*epx+epy*epy+epz*epz+0.000511*0.000511);
2703  Double_t cascpx = mccascpart->Px();
2704  Double_t cascpy = mccascpart->Py();
2705  Double_t cascpz = mccascpart->Pz();
2706  Double_t cascE = sqrt(cascpx*cascpx+cascpy*cascpy+cascpz*cascpz+1.32171*1.32171);
2707 
2708  Double_t InvMassEleXi = sqrt(pow(eE+cascE,2)-pow(epx+cascpx,2)-pow(epy+cascpy,2)-pow(epz+cascpz,2));
2709 
2710  Double_t cont[4];
2711  cont[0] = InvMassEleXi;
2712  cont[1] = mcpart->Pt();
2713  cont[2] = 0.0;
2714  cont[3] = fCentrality;
2715  Double_t cont2[3];
2716  cont2[0] = InvMassEleXi;
2717  cont2[1] = mcepart->Pt();
2718  cont2[2] = fCentrality;
2719  Double_t cont_eleptvseta[3];
2720  cont_eleptvseta[0] = mcepart->Pt();
2721  cont_eleptvseta[1] = mcepart->Eta();
2722  cont_eleptvseta[2] = fCentrality;
2723  Double_t cont_eleptvsxipt[3];
2724  cont_eleptvsxipt[0] = mcepart->Pt();
2725  cont_eleptvsxipt[1] = mccascpart->Pt();
2726  cont_eleptvsxipt[2] = fCentrality;
2727  Double_t cont_eleptvsxiptvsxicpt[4];
2728  cont_eleptvsxiptvsxicpt[0] = mcepart->Pt();
2729  cont_eleptvsxiptvsxicpt[1] = mccascpart->Pt();
2730  cont_eleptvsxiptvsxicpt[2] = mcpart->Pt();
2731  cont_eleptvsxiptvsxicpt[3] = fCentrality;
2732 
2733  Double_t contmc[3];
2734  contmc[0] = mcpart->Pt();
2735  contmc[1] = mcpart->Y();
2736  contmc[2] = fCentrality;
2737  Double_t contmcele[3];
2738  contmcele[0] = mcepart->Pt();
2739  contmcele[1] = mcepart->Eta();
2740  contmcele[2] = fCentrality;
2741 
2742 
2743  AliESDtrackCuts *esdcuts = fAnalCuts->GetTrackCuts();
2744  Float_t etamin, etamax;
2745  esdcuts->GetEtaRange(etamin,etamax);
2746 
2747  if(decaytype==0){
2748  fHistoXicMCGen->Fill(contmc);
2749  if(mcpart->GetPdgCode()>0) fHistoXicMCGen1->Fill(contmc);//4132 is particle
2750  if(mcpart->GetPdgCode()<0) fHistoXicMCGen2->Fill(contmc);//-4132 is anti-particle
2751  fHistoXicElectronMCGen->Fill(contmcele);
2752  if(mcepart->GetPdgCode()<0) fHistoXicElectronMCGen1->Fill(contmcele);//-11 is positron
2753  if(mcepart->GetPdgCode()>0) fHistoXicElectronMCGen2->Fill(contmcele);//11 is electron
2754  fHistoEleXiMassMCGen->Fill(cont);
2755  if(fabs(mcepart->Eta())<etamax){
2756  fHistoEleXiMassvsElePtMCGen->Fill(cont2);
2757  if(mcepart->GetPdgCode()<0) fHistoEleXiMassvsElePtMCGen1->Fill(cont2);//-11 is positron
2758  if(mcepart->GetPdgCode()>0) fHistoEleXiMassvsElePtMCGen2->Fill(cont2);//11 is electron
2759  if(InvMassEleXi<2.5){
2760  fHistoElePtMCGen->Fill(mcepart->Pt(),fCentrality);
2761  fHistoElePtvsEtaMCGen->Fill(cont_eleptvseta);
2762  fHistoElePtvsXiPtMCGen->Fill(cont_eleptvsxipt);
2763  }
2764  }
2765  if(fabs(mcpart->Y())<0.7){
2766  if(InvMassEleXi<2.5){
2767  fHistoElePtvsXiPtMCXicGen->Fill(cont_eleptvsxipt);
2768  fHistoElePtvsXiPtvsXicPtMCGen->Fill(cont_eleptvsxiptvsxicpt);
2769  }
2770  }
2771  }
2772 
2774  fMCVariablesTree->Fill();
2775 }
2778 {
2779  //
2780  // Define mc gen electron tree variables
2781  //
2782 
2783  const char* nameoutput = GetOutputSlot(9)->GetContainer()->GetName();
2784  fMCEleVariablesTree = new TTree(nameoutput,"MC Ele variables tree");
2785  Int_t nVar = 8;
2786  fCandidateMCEleVariables = new Float_t [nVar];
2787  TString * fCandidateVariableNames = new TString[nVar];
2788 
2789  fCandidateVariableNames[ 0]="Centrality";
2790  fCandidateVariableNames[ 1]="ElePx";
2791  fCandidateVariableNames[ 2]="ElePy";
2792  fCandidateVariableNames[ 3]="ElePz";
2793  fCandidateVariableNames[ 4]="ElePdgCode";
2794  fCandidateVariableNames[ 5]="EleMotherPdgCode";
2795  fCandidateVariableNames[ 6]="RunNumber";
2796  fCandidateVariableNames[ 7]="EvNumber";
2797 
2798  for (Int_t ivar=0; ivar<nVar; ivar++) {
2799  fMCEleVariablesTree->Branch(fCandidateVariableNames[ivar].Data(),&fCandidateMCEleVariables[ivar],Form("%s/f",fCandidateVariableNames[ivar].Data()));
2800  }
2801  return;
2802 }
2804 void AliAnalysisTaskSEXic2eleXifromAODtracks::FillMCEleROOTObjects(AliAODMCParticle *mcepart, TClonesArray *mcArray)
2805 {
2806  //
2807  // Fill tree depending on fWriteMCVariableTree
2808  //
2809  if(!mcepart) return;
2810 
2811  Int_t pdgarray_ele[100], labelarray_ele[100], ngen_ele;
2812  GetMCDecayHistory(mcepart,mcArray,pdgarray_ele,labelarray_ele,ngen_ele);
2813  Bool_t ele_from_bottom = HaveBottomInHistory(pdgarray_ele);
2814  Bool_t ele_from_charm = HaveCharmInHistory(pdgarray_ele);
2815  Int_t semi_flag = FromSemileptonicDecays(pdgarray_ele);
2816 
2817  Double_t contmc[3];
2818  contmc[0] = mcepart->Pt();
2819  contmc[1] = mcepart->Eta();
2820  contmc[2] = fCentrality;
2821 
2822  if(semi_flag==1 && !ele_from_bottom){
2823  fHistoCharmElectronMCGen->Fill(contmc);
2824  }
2825  if(semi_flag==1 && ele_from_bottom){
2826  fHistoBottomElectronMCGen->Fill(contmc);
2827  }
2828  if(semi_flag==2 ){
2829  fHistoBottomElectronMCGen->Fill(contmc);
2830  }
2831 
2832 
2833  Bool_t hfe_flag = kFALSE;
2834  Int_t labemother = mcepart->GetMother();
2835  Int_t pdgmotherele = -9999;
2836  if(labemother>=0){
2837  AliAODMCParticle *motherele = (AliAODMCParticle*)mcArray->At(labemother);
2838  pdgmotherele = motherele->GetPdgCode();
2839  if(abs(pdgmotherele)>4000&&abs(pdgmotherele)<4400){
2840  hfe_flag = kTRUE;
2841  }
2842  }
2843  if(!hfe_flag) return;
2844 
2845  fHistoElectronMCGen->Fill(contmc);
2846 
2847  for(Int_t i=0;i<8;i++){
2848  fCandidateMCEleVariables[i] = -9999.;
2849  }
2850 
2852  fCandidateMCEleVariables[ 1] = mcepart->Px();
2853  fCandidateMCEleVariables[ 2] = mcepart->Py();
2854  fCandidateMCEleVariables[ 3] = mcepart->Pz();
2855  fCandidateMCEleVariables[ 4] = mcepart->GetPdgCode();
2856  fCandidateMCEleVariables[ 5] = pdgmotherele;
2859 
2860  // This function makes output too heavy (do not use if you have output size limitation)
2861  //if(fWriteMCVariableTree && fWriteEachVariableTree && mcepart->Pt()>0.4 && fabs(mcepart->Eta())<1.0)
2862  //fMCEleVariablesTree->Fill();
2863 }
2866 {
2867  //
2868  // Define Mc cascade tree variables
2869  //
2870 
2871  const char* nameoutput = GetOutputSlot(10)->GetContainer()->GetName();
2872  fMCCascVariablesTree = new TTree(nameoutput,"MC cascade variables tree");
2873  Int_t nVar = 8;
2874  fCandidateMCCascVariables = new Float_t [nVar];
2875  TString * fCandidateVariableNames = new TString[nVar];
2876 
2877  fCandidateVariableNames[ 0]="Centrality";
2878  fCandidateVariableNames[ 1]="CascPx";
2879  fCandidateVariableNames[ 2]="CascPy";
2880  fCandidateVariableNames[ 3]="CascPz";
2881  fCandidateVariableNames[ 4]="CascPdgCode";
2882  fCandidateVariableNames[ 5]="CascMotherPdgCode";
2883  fCandidateVariableNames[ 6]="RunNumber";
2884  fCandidateVariableNames[ 7]="EvNumber";
2885 
2886  for (Int_t ivar=0; ivar<nVar; ivar++) {
2887  fMCCascVariablesTree->Branch(fCandidateVariableNames[ivar].Data(),&fCandidateMCCascVariables[ivar],Form("%s/f",fCandidateVariableNames[ivar].Data()));
2888  }
2889  return;
2890 }
2892 void AliAnalysisTaskSEXic2eleXifromAODtracks::FillMCCascROOTObjects(AliAODMCParticle *mccascpart, TClonesArray *mcArray)
2893 {
2894  //
2895  // Fill histograms or tree depending on fWriteMCVariableTree
2896  //
2897  if(!mccascpart) return;
2898 
2899  for(Int_t i=0;i<8;i++){
2900  fCandidateMCCascVariables[i] = -9999.;
2901  }
2902 
2903  Bool_t hfxi_flag = kFALSE;
2904  Int_t labcascmother = mccascpart->GetMother();
2905  Int_t pdgmothercasc = -9999;
2906  if(labcascmother>=0){
2907  AliAODMCParticle *mothercasc = (AliAODMCParticle*)mcArray->At(labcascmother);
2908  if(mothercasc){
2909  pdgmothercasc = mothercasc->GetPdgCode();
2910  if(abs(pdgmothercasc)>4000&&abs(pdgmothercasc)<4400){
2911  hfxi_flag = kTRUE;
2912  }
2913  }
2914  }
2915  if(!hfxi_flag) return;
2916 
2917  Double_t contmc[3];
2918  contmc[0] = mccascpart->Pt();
2919  contmc[1] = mccascpart->Eta();
2920  contmc[2] = fCentrality;
2921  fHistoXiMCGen->Fill(contmc);
2922 
2924  fCandidateMCCascVariables[ 1] = mccascpart->Px();
2925  fCandidateMCCascVariables[ 2] = mccascpart->Py();
2926  fCandidateMCCascVariables[ 3] = mccascpart->Pz();
2927  fCandidateMCCascVariables[ 4] = mccascpart->GetPdgCode();
2928  fCandidateMCCascVariables[ 5] = pdgmothercasc;
2931 
2932  // This function makes output too heavy (do not use if you have output size limitation)
2933  //if(fWriteMCVariableTree && fWriteEachVariableTree && mccascpart->Pt()>0.4 && fabs(mccascpart->Eta())<1.0)
2934  //fMCCascVariablesTree->Fill();
2935 }
2936 
2939  //
2940  // This is to define general histograms
2941  //
2942 
2943  fCEvents = new TH1F("fCEvents","conter",18,-0.5,17.5);
2944  fCEvents->SetStats(kTRUE);
2945  fCEvents->GetXaxis()->SetBinLabel(1,"X1");
2946  fCEvents->GetXaxis()->SetBinLabel(2,"Analyzed events");
2947  fCEvents->GetXaxis()->SetBinLabel(3,"AliAODVertex exists");
2948  fCEvents->GetXaxis()->SetBinLabel(4,"TriggerOK");
2949  fCEvents->GetXaxis()->SetBinLabel(5,"IsEventSelected");
2950  fCEvents->GetXaxis()->SetBinLabel(6,"CascadesHF exists");
2951  fCEvents->GetXaxis()->SetBinLabel(7,"MCarray exists");
2952  fCEvents->GetXaxis()->SetBinLabel(8,"MCheader exists");
2953  fCEvents->GetXaxis()->SetBinLabel(9,"triggerClass!=CINT1");
2954  fCEvents->GetXaxis()->SetBinLabel(10,"triggerMask!=kAnyINT");
2955  fCEvents->GetXaxis()->SetBinLabel(11,"triggerMask!=kAny");
2956  fCEvents->GetXaxis()->SetBinLabel(12,"vtxTitle.Contains(Z)");
2957  fCEvents->GetXaxis()->SetBinLabel(13,"vtxTitle.Contains(3D)");
2958  fCEvents->GetXaxis()->SetBinLabel(14,"vtxTitle.Doesn'tContain(Z-3D)");
2959  fCEvents->GetXaxis()->SetBinLabel(15,Form("zVtx<=%2.0fcm",fAnalCuts->GetMaxVtxZ()));
2960  fCEvents->GetXaxis()->SetBinLabel(16,"!IsEventSelected");
2961  fCEvents->GetXaxis()->SetBinLabel(17,"triggerMask!=kAnyINT || triggerClass!=CINT1");
2962  fCEvents->GetXaxis()->SetBinLabel(18,Form("zVtxMC<=%2.0fcm",fAnalCuts->GetMaxVtxZ()));
2963  //fCEvents->GetXaxis()->SetTitle("");
2964  fCEvents->GetYaxis()->SetTitle("counts");
2965 
2966  fHTrigger = new TH1F("fHTrigger","counter",18,-0.5,17.5);
2967  fHTrigger->SetStats(kTRUE);
2968  fHTrigger->GetXaxis()->SetBinLabel(1,"X1");
2969  fHTrigger->GetXaxis()->SetBinLabel(2,"kMB");
2970  fHTrigger->GetXaxis()->SetBinLabel(3,"kSemiCentral");
2971  fHTrigger->GetXaxis()->SetBinLabel(4,"kCentral");
2972  fHTrigger->GetXaxis()->SetBinLabel(5,"kINT7");
2973  fHTrigger->GetXaxis()->SetBinLabel(6,"kEMC7");
2974  //fHTrigger->GetXaxis()->SetBinLabel(7,"Space");
2975  fHTrigger->GetXaxis()->SetBinLabel(8,"kMB|kSemiCentral|kCentral");
2976  fHTrigger->GetXaxis()->SetBinLabel(9,"kINT7|kEMC7");
2977  fHTrigger->GetXaxis()->SetBinLabel(11,"kMB&kSemiCentral");
2978  fHTrigger->GetXaxis()->SetBinLabel(12,"kMB&kCentral");
2979  fHTrigger->GetXaxis()->SetBinLabel(13,"kINT7&kEMC7");
2980 
2981  fHCentrality = new TH1F("fHCentrality","conter",100,0.,100.);
2982 
2983 
2984  fOutput->Add(fCEvents);
2985  fOutput->Add(fHTrigger);
2986  fOutput->Add(fHCentrality);
2987 
2988  return;
2989 }
2990 //__________________________________________________________________________
2992 {
2993  //
2994  // Define analyis histograms
2995  //
2996 
2997  //------------------------------------------------
2998  // Basic histogram
2999  //------------------------------------------------
3000  Int_t bins_base[4]= {22 ,100 , 100 ,10};
3001  Double_t xmin_base[4]={1.3,0 , -0.5 ,0.00};
3002  Double_t xmax_base[4]={5.7,20. , 0.5 ,100};
3003 
3004  fHistoEleXiMass = new THnSparseF("fHistoEleXiMass","",4,bins_base,xmin_base,xmax_base);
3006  fHistoEleXiMassRS = new THnSparseF("fHistoEleXiMassRS","",4,bins_base,xmin_base,xmax_base);
3008  fHistoEleXiMassWS = new THnSparseF("fHistoEleXiMassWS","",4,bins_base,xmin_base,xmax_base);
3010  fHistoEleXiMassRSMix = new THnSparseF("fHistoEleXiMassRSMix","",4,bins_base,xmin_base,xmax_base);
3012  fHistoEleXiMassWSMix = new THnSparseF("fHistoEleXiMassWSMix","",4,bins_base,xmin_base,xmax_base);
3014  fHistoEleXiMassRSSide = new THnSparseF("fHistoEleXiMassRSSide","",4,bins_base,xmin_base,xmax_base);
3016  fHistoEleXiMassWSSide = new THnSparseF("fHistoEleXiMassWSSide","",4,bins_base,xmin_base,xmax_base);
3018  fHistoEleXiMassRS1 = new THnSparseF("fHistoEleXiMassRS1","",4,bins_base,xmin_base,xmax_base);
3020  fHistoEleXiMassWS1 = new THnSparseF("fHistoEleXiMassWS1","",4,bins_base,xmin_base,xmax_base);
3022  fHistoEleXiMassRSMix1 = new THnSparseF("fHistoEleXiMassRSMix1","",4,bins_base,xmin_base,xmax_base);
3024  fHistoEleXiMassWSMix1 = new THnSparseF("fHistoEleXiMassWSMix1","",4,bins_base,xmin_base,xmax_base);
3026  fHistoEleXiMassRSSide1 = new THnSparseF("fHistoEleXiMassRSSide1","",4,bins_base,xmin_base,xmax_base);
3028  fHistoEleXiMassWSSide1 = new THnSparseF("fHistoEleXiMassWSSide1","",4,bins_base,xmin_base,xmax_base);
3030  fHistoEleXiMassRS2 = new THnSparseF("fHistoEleXiMassRS2","",4,bins_base,xmin_base,xmax_base);
3032  fHistoEleXiMassWS2 = new THnSparseF("fHistoEleXiMassWS2","",4,bins_base,xmin_base,xmax_base);
3034  fHistoEleXiMassRSMix2 = new THnSparseF("fHistoEleXiMassRSMix2","",4,bins_base,xmin_base,xmax_base);
3036  fHistoEleXiMassWSMix2 = new THnSparseF("fHistoEleXiMassWSMix2","",4,bins_base,xmin_base,xmax_base);
3038  fHistoEleXiMassRSSide2 = new THnSparseF("fHistoEleXiMassRSSide2","",4,bins_base,xmin_base,xmax_base);
3040  fHistoEleXiMassWSSide2 = new THnSparseF("fHistoEleXiMassWSSide2","",4,bins_base,xmin_base,xmax_base);
3042 
3043  fHistoEleXiMassRSAway = new THnSparseF("fHistoEleXiMassRSAway","",4,bins_base,xmin_base,xmax_base);
3045  fHistoEleXiMassWSAway = new THnSparseF("fHistoEleXiMassWSAway","",4,bins_base,xmin_base,xmax_base);
3047  fHistoEleXiMassRSMixAway = new THnSparseF("fHistoEleXiMassRSMixAway","",4,bins_base,xmin_base,xmax_base);
3049  fHistoEleXiMassWSMixAway = new THnSparseF("fHistoEleXiMassWSMixAway","",4,bins_base,xmin_base,xmax_base);
3051  fHistoEleXiMassRSSideAway = new THnSparseF("fHistoEleXiMassRSSideAway","",4,bins_base,xmin_base,xmax_base);
3053  fHistoEleXiMassWSSideAway = new THnSparseF("fHistoEleXiMassWSSideAway","",4,bins_base,xmin_base,xmax_base);
3055  fHistoEleXiMassRS1Away = new THnSparseF("fHistoEleXiMassRS1Away","",4,bins_base,xmin_base,xmax_base);
3057  fHistoEleXiMassWS1Away = new THnSparseF("fHistoEleXiMassWS1Away","",4,bins_base,xmin_base,xmax_base);
3059  fHistoEleXiMassRSMix1Away = new THnSparseF("fHistoEleXiMassRSMix1Away","",4,bins_base,xmin_base,xmax_base);
3061  fHistoEleXiMassWSMix1Away = new THnSparseF("fHistoEleXiMassWSMix1Away","",4,bins_base,xmin_base,xmax_base);
3063  fHistoEleXiMassRSSide1Away = new THnSparseF("fHistoEleXiMassRSSide1Away","",4,bins_base,xmin_base,xmax_base);
3065  fHistoEleXiMassWSSide1Away = new THnSparseF("fHistoEleXiMassWSSide1Away","",4,bins_base,xmin_base,xmax_base);
3067  fHistoEleXiMassRS2Away = new THnSparseF("fHistoEleXiMassRS2Away","",4,bins_base,xmin_base,xmax_base);
3069  fHistoEleXiMassWS2Away = new THnSparseF("fHistoEleXiMassWS2Away","",4,bins_base,xmin_base,xmax_base);
3071  fHistoEleXiMassRSMix2Away = new THnSparseF("fHistoEleXiMassRSMix2Away","",4,bins_base,xmin_base,xmax_base);
3073  fHistoEleXiMassWSMix2Away = new THnSparseF("fHistoEleXiMassWSMix2Away","",4,bins_base,xmin_base,xmax_base);
3075  fHistoEleXiMassRSSide2Away = new THnSparseF("fHistoEleXiMassRSSide2Away","",4,bins_base,xmin_base,xmax_base);
3077  fHistoEleXiMassWSSide2Away = new THnSparseF("fHistoEleXiMassWSSide2Away","",4,bins_base,xmin_base,xmax_base);
3079 
3080  Int_t bins_base_elept[3]= {10 ,100 ,10};
3081  Double_t xmin_base_elept[3]={1.3,0 ,0.00};
3082  Double_t xmax_base_elept[3]={3.3,10. ,100};
3083 
3084  fHistoEleXiMassvsElePtRS = new THnSparseF("fHistoEleXiMassvsElePtRS","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3086  fHistoEleXiMassvsElePtWS = new THnSparseF("fHistoEleXiMassvsElePtWS","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3088  fHistoEleXiMassvsElePtRSMix = new THnSparseF("fHistoEleXiMassvsElePtRSMix","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3090  fHistoEleXiMassvsElePtWSMix = new THnSparseF("fHistoEleXiMassvsElePtWSMix","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3092  fHistoEleXiMassvsElePtRSSide = new THnSparseF("fHistoEleXiMassvsElePtRSSide","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3094  fHistoEleXiMassvsElePtWSSide = new THnSparseF("fHistoEleXiMassvsElePtWSSide","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3096  fHistoEleXiMassvsElePtRS1 = new THnSparseF("fHistoEleXiMassvsElePtRS1","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3098  fHistoEleXiMassvsElePtWS1 = new THnSparseF("fHistoEleXiMassvsElePtWS1","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3100  fHistoEleXiMassvsElePtRSMix1 = new THnSparseF("fHistoEleXiMassvsElePtRSMix1","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3102  fHistoEleXiMassvsElePtWSMix1 = new THnSparseF("fHistoEleXiMassvsElePtWSMix1","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3104  fHistoEleXiMassvsElePtRSSide1 = new THnSparseF("fHistoEleXiMassvsElePtRSSide1","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3106  fHistoEleXiMassvsElePtWSSide1 = new THnSparseF("fHistoEleXiMassvsElePtWSSide1","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3108  fHistoEleXiMassvsElePtRS2 = new THnSparseF("fHistoEleXiMassvsElePtRS2","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3110  fHistoEleXiMassvsElePtWS2 = new THnSparseF("fHistoEleXiMassvsElePtWS2","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3112  fHistoEleXiMassvsElePtRSMix2 = new THnSparseF("fHistoEleXiMassvsElePtRSMix2","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3114  fHistoEleXiMassvsElePtWSMix2 = new THnSparseF("fHistoEleXiMassvsElePtWSMix2","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3116  fHistoEleXiMassvsElePtRSSide2 = new THnSparseF("fHistoEleXiMassvsElePtRSSide2","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3118  fHistoEleXiMassvsElePtWSSide2 = new THnSparseF("fHistoEleXiMassvsElePtWSSide2","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3120 
3121  fHistoElePtRS=new TH2F("fHistoElePtRS","Right-sign e pt",100,0.,10.,10,0.,100.);
3122  fOutputAll->Add(fHistoElePtRS);
3123  fHistoElePtWS=new TH2F("fHistoElePtWS","Wrong-sign e pt",100,0.,10.,10,0.,100.);
3124  fOutputAll->Add(fHistoElePtWS);
3125  fHistoElePtRSMix=new TH2F("fHistoElePtRSMix","Right-sign e pt",100,0.,10.,10,0.,100.);
3127  fHistoElePtWSMix=new TH2F("fHistoElePtWSMix","Wrong-sign e pt",100,0.,10.,10,0.,100.);
3129 
3130  fHistoEleXiMassMCS = new THnSparseF("fHistoEleXiMassMCS","",4,bins_base,xmin_base,xmax_base);
3132  fHistoEleXiMassMCS1 = new THnSparseF("fHistoEleXiMassMCS1","",4,bins_base,xmin_base,xmax_base);
3134  fHistoEleXiMassMCS2 = new THnSparseF("fHistoEleXiMassMCS2","",4,bins_base,xmin_base,xmax_base);
3136  fHistoEleXiMassXibMCS = new THnSparseF("fHistoEleXiMassXibMCS","",4,bins_base,xmin_base,xmax_base);
3138  fHistoEleXiMassXibMCS1 = new THnSparseF("fHistoEleXiMassXibMCS1","",4,bins_base,xmin_base,xmax_base);
3140  fHistoEleXiMassXibMCS2 = new THnSparseF("fHistoEleXiMassXibMCS2","",4,bins_base,xmin_base,xmax_base);
3142  fHistoEleXiMassPromptMCS = new THnSparseF("fHistoEleXiMassPromptMCS","",4,bins_base,xmin_base,xmax_base);
3144  fHistoEleXiMassPromptMCS1 = new THnSparseF("fHistoEleXiMassPromptMCS1","",4,bins_base,xmin_base,xmax_base);
3146  fHistoEleXiMassPromptMCS2 = new THnSparseF("fHistoEleXiMassPromptMCS2","",4,bins_base,xmin_base,xmax_base);
3148  fHistoEleXiMassBFeeddownMCS = new THnSparseF("fHistoEleXiMassBFeeddownMCS","",4,bins_base,xmin_base,xmax_base);
3150  fHistoEleXiMassBFeeddownMCS1 = new THnSparseF("fHistoEleXiMassBFeeddownMCS1","",4,bins_base,xmin_base,xmax_base);
3152  fHistoEleXiMassBFeeddownMCS2 = new THnSparseF("fHistoEleXiMassBFeeddownMCS2","",4,bins_base,xmin_base,xmax_base);
3154  fHistoEleXiMassMCGen = new THnSparseF("fHistoEleXiMassMCGen","",4,bins_base,xmin_base,xmax_base);
3156  fHistoEleXiMassvsElePtMCS = new THnSparseF("fHistoEleXiMassvsElePtMCS","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3158  fHistoEleXiMassvsElePtMCGen = new THnSparseF("fHistoEleXiMassvsElePtMCGen","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3160  fHistoEleXiMassvsElePtMCS1 = new THnSparseF("fHistoEleXiMassvsElePtMCS1","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3162  fHistoEleXiMassvsElePtMCGen1 = new THnSparseF("fHistoEleXiMassvsElePtMCGen1","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3164  fHistoEleXiMassvsElePtMCS2 = new THnSparseF("fHistoEleXiMassvsElePtMCS2","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3166  fHistoEleXiMassvsElePtMCGen2 = new THnSparseF("fHistoEleXiMassvsElePtMCGen2","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3168  fHistoElePtMCS=new TH2F("fHistoElePtMCS","MC S e pt",100,0.,10.,10,0.,100.);
3169  fOutputAll->Add(fHistoElePtMCS);
3170  fHistoElePtMCGen=new TH2F("fHistoElePtMCGen","MC Gen e pt",100,0.,10.,10,0.,100.);
3172 
3173  Int_t bins_eleptvseta[3]= {50,20 ,10};
3174  Double_t xmin_eleptvseta[3]={0.,-1. ,0.0};
3175  Double_t xmax_eleptvseta[3]={5.,1. ,100};
3176 
3177  fHistoElePtvsEtaRS = new THnSparseF("fHistoElePtvsEtaRS","",3,bins_eleptvseta,xmin_eleptvseta,xmax_eleptvseta);
3179  fHistoElePtvsEtaWS = new THnSparseF("fHistoElePtvsEtaWS","",3,bins_eleptvseta,xmin_eleptvseta,xmax_eleptvseta);
3181  fHistoElePtvsEtaRSMix = new THnSparseF("fHistoElePtvsEtaRSMix","",3,bins_eleptvseta,xmin_eleptvseta,xmax_eleptvseta);
3183  fHistoElePtvsEtaWSMix = new THnSparseF("fHistoElePtvsEtaWSMix","",3,bins_eleptvseta,xmin_eleptvseta,xmax_eleptvseta);
3185  fHistoElePtvsEtaMCS = new THnSparseF("fHistoElePtvsEtaMCS","",3,bins_eleptvseta,xmin_eleptvseta,xmax_eleptvseta);
3187  fHistoElePtvsEtaMCGen = new THnSparseF("fHistoElePtvsEtaMCGen","",3,bins_eleptvseta,xmin_eleptvseta,xmax_eleptvseta);
3189 
3190  Int_t bins_eleptvsxipt[3]= {50,20 ,10};
3191  Double_t xmin_eleptvsxipt[3]={0.,0. ,0.0};
3192  Double_t xmax_eleptvsxipt[3]={5.,5. ,100};
3193 
3194  fHistoElePtvsXiPtRS = new THnSparseF("fHistoElePtvsXiPtRS","",3,bins_eleptvsxipt,xmin_eleptvsxipt,xmax_eleptvsxipt);
3196  fHistoElePtvsXiPtWS = new THnSparseF("fHistoElePtvsXiPtWS","",3,bins_eleptvsxipt,xmin_eleptvsxipt,xmax_eleptvsxipt);
3198  fHistoElePtvsXiPtRSMix = new THnSparseF("fHistoElePtvsXiPtRSMix","",3,bins_eleptvsxipt,xmin_eleptvsxipt,xmax_eleptvsxipt);
3200  fHistoElePtvsXiPtWSMix = new THnSparseF("fHistoElePtvsXiPtWSMix","",3,bins_eleptvsxipt,xmin_eleptvsxipt,xmax_eleptvsxipt);
3202  fHistoElePtvsXiPtMCS = new THnSparseF("fHistoElePtvsXiPtMCS","",3,bins_eleptvsxipt,xmin_eleptvsxipt,xmax_eleptvsxipt);
3204  fHistoElePtvsXiPtMCGen = new THnSparseF("fHistoElePtvsXiPtMCGen","",3,bins_eleptvsxipt,xmin_eleptvsxipt,xmax_eleptvsxipt);
3206  fHistoElePtvsXiPtMCXicGen = new THnSparseF("fHistoElePtvsXiPtMCXicGen","",3,bins_eleptvsxipt,xmin_eleptvsxipt,xmax_eleptvsxipt);
3208 
3209  Int_t bins_eleptvsxiptvsxicpt[4]= {50,20,10,10};
3210  Double_t xmin_eleptvsxiptvsxicpt[4]={0.,0.,0.,0.0};
3211  Double_t xmax_eleptvsxiptvsxicpt[4]={5.,5.,10.,100};
3212  fHistoElePtvsXiPtvsXicPtMCS = new THnSparseF("fHistoElePtvsXiPtvsXicPtMCS","",4,bins_eleptvsxiptvsxicpt,xmin_eleptvsxiptvsxicpt,xmax_eleptvsxiptvsxicpt);
3214  fHistoElePtvsXiPtvsXicPtMCGen = new THnSparseF("fHistoElePtvsXiPtvsXicPtMCGen","",4,bins_eleptvsxiptvsxicpt,xmin_eleptvsxiptvsxicpt,xmax_eleptvsxiptvsxicpt);
3216 
3217  Int_t bins_eleptvsd0[3]= {50 ,50 ,10};
3218  Double_t xmin_eleptvsd0[3]={0.,-0.2 ,0.0};
3219  Double_t xmax_eleptvsd0[3]={5.,0.2 ,100};
3220 
3221  fHistoElePtvsd0RS = new THnSparseF("fHistoElePtvsd0RS","",3,bins_eleptvsd0,xmin_eleptvsd0,xmax_eleptvsd0);
3223  fHistoElePtvsd0WS = new THnSparseF("fHistoElePtvsd0WS","",3,bins_eleptvsd0,xmin_eleptvsd0,xmax_eleptvsd0);
3225  fHistoElePtvsd0RSMix = new THnSparseF("fHistoElePtvsd0RSMix","",3,bins_eleptvsd0,xmin_eleptvsd0,xmax_eleptvsd0);
3227  fHistoElePtvsd0WSMix = new THnSparseF("fHistoElePtvsd0WSMix","",3,bins_eleptvsd0,xmin_eleptvsd0,xmax_eleptvsd0);
3229  fHistoElePtvsd0MCS = new THnSparseF("fHistoElePtvsd0MCS","",3,bins_eleptvsd0,xmin_eleptvsd0,xmax_eleptvsd0);
3231  fHistoElePtvsd0PromptMCS = new THnSparseF("fHistoElePtvsd0PromptMCS","",3,bins_eleptvsd0,xmin_eleptvsd0,xmax_eleptvsd0);
3233  fHistoElePtvsd0BFeeddownMCS = new THnSparseF("fHistoElePtvsd0BFeeddownMCS","",3,bins_eleptvsd0,xmin_eleptvsd0,xmax_eleptvsd0);
3235 
3236  //------------------------------------------------
3237  // checking histograms
3238  //------------------------------------------------
3239  fHistoBachPt = new TH1F("fHistoBachPt","Bachelor p_{T}",100,0.0,5.0);
3240  fOutputAll->Add(fHistoBachPt);
3241  fHistoBachPtMCS = new TH1F("fHistoBachPtMCS","Bachelor p_{T}",100,0.0,5.0);
3243  fHistoBachPtMCGen = new TH1F("fHistoBachPtMCGen","Bachelor p_{T}",100,0.0,5.0);
3245  fHistod0Bach = new TH1F("fHistod0Bach","Bachelor d_{0}",100,-0.5,0.5);
3246  fOutputAll->Add(fHistod0Bach);
3247  fHistoXiMassvsPt=new TH2F("fHistoXiMassvsPt","Xi mass",100,1.32-0.05,1.32+0.05,20,0.,10.);
3249  fHistoXiMassvsPtMCS=new TH2F("fHistoXiMassvsPtMCS","Xi mass",100,1.32-0.05,1.32+0.05,20,0.,10.);
3251  fHistoXiMassvsPtMCGen=new TH2F("fHistoXiMassvsPtMCGen","Xi mass",100,1.32-0.05,1.32+0.05,20,0.,10.);
3253  fHistoOmegaMassvsPt=new TH2F("fHistoOmegaMassvsPt","Omega mass",100,1.67-0.05,1.67+0.05,20,0.,10.);
3255 
3256  fHistoElectronTPCPID=new TH2F("fHistoElectronTPCPID","",50,0.,5.,50,-20.,20.);
3258  fHistoElectronTOFPID=new TH2F("fHistoElectronTOFPID","",50,0.,5.,50,-20.,20.);
3260  fHistoElectronTPCSelPID=new TH2F("fHistoElectronTPCSelPID","",50,0.,5.,50,-20.,20.);
3262  fHistoElectronTOFSelPID=new TH2F("fHistoElectronTOFSelPID","",50,0.,5.,50,-20.,20.);
3264  fHistoElectronTPCPIDSelTOF=new TH2F("fHistoElectronTPCPIDSelTOF","",10,0.,5.,500,-10.,10.);
3266  fHistoElectronTOFPIDSelTPC=new TH2F("fHistoElectronTOFPIDSelTPC","",10,0.,5.,500,-10.,10.);
3268  fHistoElectronTPCPIDSelTOFSmallEta=new TH2F("fHistoElectronTPCPIDSelTOFSmallEta","",10,0.,5.,500,-10.,10.);
3270  fHistoElectronTPCPIDSelTOFLargeEta=new TH2F("fHistoElectronTPCPIDSelTOFLargeEta","",10,0.,5.,500,-10.,10.);
3272  fHistoMassConversionsMin=new TH1F("fHistoMassConversionsMin","",500,0,0.5);
3274  fHistoMassConversionsSameSignMin=new TH1F("fHistoMassConversionsSameSignMin","",500,0,0.5);
3276 
3277  for(Int_t i=0;i<8;i++){
3278  fHistoElectronTPCPIDSelTOFEtaDep[i]=new TH2F(Form("fHistoElectronTPCPIDSelTOFEtaDep[%d]",i),"",10,0.,5.,500,-10.,10.);
3280  }
3281 
3282  fHistoElectronQovPtvsPhi=new TH2F("fHistoElectronQovPtvsPhi","",70,0.,7.,50,-2.,2.);
3284  fHistoXiQovPtvsPhi=new TH2F("fHistoXiQovPtvsPhi","",70,0.,7.,50,-2.,2.);
3286 
3287  Int_t bins_xicmcgen[3]= {100 ,20 ,10};
3288  Double_t xmin_xicmcgen[3]={0.,-1.0 ,0.0};
3289  Double_t xmax_xicmcgen[3]={20.,1.0 ,100};
3290  fHistoXicMCGen = new THnSparseF("fHistoXicMCGen","",3,bins_xicmcgen,xmin_xicmcgen,xmax_xicmcgen);
3291  fOutputAll->Add(fHistoXicMCGen);
3292  fHistoXicMCGen1 = new THnSparseF("fHistoXicMCGen1","",3,bins_xicmcgen,xmin_xicmcgen,xmax_xicmcgen);
3294  fHistoXicMCGen2 = new THnSparseF("fHistoXicMCGen2","",3,bins_xicmcgen,xmin_xicmcgen,xmax_xicmcgen);
3296  fHistoXicMCS = new THnSparseF("fHistoXicMCS","",3,bins_xicmcgen,xmin_xicmcgen,xmax_xicmcgen);
3297  fOutputAll->Add(fHistoXicMCS);
3298  fHistoXicMCS1 = new THnSparseF("fHistoXicMCS1","",3,bins_xicmcgen,xmin_xicmcgen,xmax_xicmcgen);
3299  fOutputAll->Add(fHistoXicMCS1);
3300  fHistoXicMCS2 = new THnSparseF("fHistoXicMCS2","",3,bins_xicmcgen,xmin_xicmcgen,xmax_xicmcgen);
3301  fOutputAll->Add(fHistoXicMCS2);
3302 
3303  Int_t bins_elemcgen[3]= {100 ,20 ,10};
3304  Double_t xmin_elemcgen[3]={0.,-1.0 ,0.0};
3305  Double_t xmax_elemcgen[3]={10.,1.0 ,100};
3306  fHistoElectronMCGen = new THnSparseF("fHistoElectronMCGen","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
3308  fHistoBottomElectronMCGen = new THnSparseF("fHistoBottomElectronMCGen","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
3310  fHistoCharmElectronMCGen = new THnSparseF("fHistoCharmElectronMCGen","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
3312  fHistoXicElectronMCGen = new THnSparseF("fHistoXicElectronMCGen","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
3314  fHistoXicElectronMCGen1 = new THnSparseF("fHistoXicElectronMCGen1","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
3316  fHistoXicElectronMCGen2 = new THnSparseF("fHistoXicElectronMCGen2","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
3318  fHistoXicElectronMCS = new THnSparseF("fHistoXicElectronMCS","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
3320  fHistoXicElectronMCS1 = new THnSparseF("fHistoXicElectronMCS1","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
3322  fHistoXicElectronMCS2 = new THnSparseF("fHistoXicElectronMCS2","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
3324 
3325  Int_t bins_ximcgen[3]= {50 ,20 ,10};
3326  Double_t xmin_ximcgen[3]={0.,-1.0 ,0.0};
3327  Double_t xmax_ximcgen[3]={10.,1.0 ,100};
3328  fHistoXiMCGen = new THnSparseF("fHistoXiMCGen","",3,bins_ximcgen,xmin_ximcgen,xmax_ximcgen);
3329  fOutputAll->Add(fHistoXiMCGen);
3330 
3331  fHistoLambdaPtvsDl=new TH2F("fHistoLambdaPtvsDl","Lambda pt vs dl",20,0.,10.,20,0.,40.);
3333  fHistoLambdaPtvsDlSide=new TH2F("fHistoLambdaPtvsDlSide","Lambda pt vs dl",20,0.,10.,20,0.,40.);
3335  fHistoLambdaPtvsDlMCS=new TH2F("fHistoLambdaPtvsDlMCS","Lambda pt vs dl",20,0.,10.,20,0.,40.);
3337  fHistoLambdaPtvsDR=new TH2F("fHistoLambdaPtvsDR","Lambda pt vs dl",20,0.,10.,80,0.,160.);
3339  fHistoLambdaPtvsDRSide=new TH2F("fHistoLambdaPtvsDRSide","Lambda pt vs dl",20,0.,10.,80,0.,160.);
3341  fHistoLambdaPtvsDRMCS=new TH2F("fHistoLambdaPtvsDRMCS","Lambda pt vs dl",20,0.,10.,80,0.,160.);
3343 
3344  fHistoEleXiPtvsRapidityRS=new TH2F("fHistoEleXiPtvsRapidityRS","EleXi pt vs rap",20,0.,20.,40,-2.,2.);
3346  fHistoEleXiPtvsRapidityWS=new TH2F("fHistoEleXiPtvsRapidityWS","EleXi pt vs rap",20,0.,20.,40,-2.,2.);
3348  fHistoEleXiPtvsRapidityMCS=new TH2F("fHistoEleXiPtvsRapidityMCS","EleXi pt vs rap",20,0.,20.,40,-2.,2.);
3350 
3351  fHistoResponseElePt = new TH2D("fHistoResponseElePt","",100,0.,20.,100,0.,10.);
3353  fHistoResponseXiPt = new TH2D("fHistoResponseXiPt","",100,0.,20.,100,0.,20.);
3355  fHistoResponseEleXiPt = new TH2D("fHistoResponseEleXiPt","",100,0.,20.,100,0.,20.);
3357 
3358 
3359  fHistonEvtvsRunNumber=new TH1F("fHistonEvtvsRunNumber","",20000,-0.5,19999.5);
3361  fHistonElevsRunNumber=new TH1F("fHistonElevsRunNumber","",20000,-0.5,19999.5);
3363  fHistonXivsRunNumber=new TH1F("fHistonXivsRunNumber","",20000,-0.5,19999.5);
3365  fHistoMCEventType=new TH1F("fHistoMCEventType","",4,-0.5,3.5);
3367  fHistoMCXic0Decays=new TH1F("fHistoMCXic0Decays","",4,0.5,4.5);
3369  fHistoMCDeltaPhiccbar=new TH1F("fHistoMCDeltaPhiccbar","",100,0.,3.2);
3371  fHistoMCNccbar=new TH1F("fHistoMCNccbar","",100,-0.5,99.5);
3372  fOutputAll->Add(fHistoMCNccbar);
3373 
3374  fHistodPhiSdEtaSElectronProtonR125RS = new TH2D("fHistodPhiSdEtaSElectronProtonR125RS","",50,0.,0.2,50,0.,0.2);
3376  fHistodPhiSdEtaSElectronProtonR125WS = new TH2D("fHistodPhiSdEtaSElectronProtonR125WS","",50,0.,0.2,50,0.,0.2);
3378  fHistodPhiSdEtaSElectronProtonR125RSMix = new TH2D("fHistodPhiSdEtaSElectronProtonR125RSMix","",50,0.,0.2,50,0.,0.2);
3380  fHistodPhiSdEtaSElectronProtonR125WSMix = new TH2D("fHistodPhiSdEtaSElectronProtonR125WSMix","",50,0.,0.2,50,0.,0.2);
3382  fHistodPhiSdEtaSElectronPionR125RS = new TH2D("fHistodPhiSdEtaSElectronPionR125RS","",50,0.,0.2,50,0.,0.2);
3384  fHistodPhiSdEtaSElectronPionR125WS = new TH2D("fHistodPhiSdEtaSElectronPionR125WS","",50,0.,0.2,50,0.,0.2);
3386  fHistodPhiSdEtaSElectronPionR125RSMix = new TH2D("fHistodPhiSdEtaSElectronPionR125RSMix","",50,0.,0.2,50,0.,0.2);
3388  fHistodPhiSdEtaSElectronPionR125WSMix = new TH2D("fHistodPhiSdEtaSElectronPionR125WSMix","",50,0.,0.2,50,0.,0.2);
3390  fHistodPhiSdEtaSElectronBachelorR125RS = new TH2D("fHistodPhiSdEtaSElectronBachelorR125RS","",50,0.,0.2,50,0.,0.2);
3392  fHistodPhiSdEtaSElectronBachelorR125WS = new TH2D("fHistodPhiSdEtaSElectronBachelorR125WS","",50,0.,0.2,50,0.,0.2);
3394  fHistodPhiSdEtaSElectronBachelorR125RSMix = new TH2D("fHistodPhiSdEtaSElectronBachelorR125RSMix","",50,0.,0.2,50,0.,0.2);
3396  fHistodPhiSdEtaSElectronBachelorR125WSMix = new TH2D("fHistodPhiSdEtaSElectronBachelorR125WSMix","",50,0.,0.2,50,0.,0.2);
3398 
3399  for(Int_t ih=0;ih<23;ih++){
3400  Int_t bins_eleptvscutvars[3];
3401  Double_t xmin_eleptvscutvars[3];
3402  Double_t xmax_eleptvscutvars[3];
3403 
3404  bins_eleptvscutvars[0] = 20;//electron pT bin
3405  xmin_eleptvscutvars[0] = 0.;
3406  xmax_eleptvscutvars[0] = 20.;
3407  bins_eleptvscutvars[2] = 10;//centrality bin
3408  xmin_eleptvscutvars[2] = 0.;
3409  xmax_eleptvscutvars[2] = 100.;
3410 
3411  if(ih==0 || ih==1){
3412  //0: TPC Ncluster 1: TPC ncluster PID
3413  bins_eleptvscutvars[1] = 40;
3414  xmin_eleptvscutvars[1] = 0.;
3415  xmax_eleptvscutvars[1] = 160.;
3416  }else if(ih==2 || ih==3){
3417  //2: nSigma(TPC,e) 3: nSigma(TOF,e)
3418  bins_eleptvscutvars[1] = 20;
3419  xmin_eleptvscutvars[1] = -5.;
3420  xmax_eleptvscutvars[1] = 5.;
3421  }else if(ih==4){
3422  //4: eta
3423  bins_eleptvscutvars[1] = 30;
3424  xmin_eleptvscutvars[1] = -1.5;
3425  xmax_eleptvscutvars[1] = 1.5;
3426  }else if(ih==5){
3427  //5: nITS cluster
3428  bins_eleptvscutvars[1] = 7;
3429  xmin_eleptvscutvars[1] = -0.5;
3430  xmax_eleptvscutvars[1] = 6.5;
3431  }else if(ih==6){
3432  //6: Lambda mass
3433  bins_eleptvscutvars[1] = 50;
3434  xmin_eleptvscutvars[1] = 1.1156-0.03;
3435  xmax_eleptvscutvars[1] = 1.1156+0.03;
3436  }else if(ih==7){
3437  //7: Xi mass
3438  bins_eleptvscutvars[1] = 50;
3439  xmin_eleptvscutvars[1] = 1.32-0.03;
3440  xmax_eleptvscutvars[1] = 1.32+0.03;
3441  }else if(ih==8 || ih==9){
3442  //8: Rfid Lambda, 9: Rfid Xi
3443  bins_eleptvscutvars[1] = 20;
3444  xmin_eleptvscutvars[1] = 0.;
3445  xmax_eleptvscutvars[1] = 5.;
3446  }else if(ih==10 || ih==11){
3447  //11: DCA Xi, 10: Dca V0
3448  bins_eleptvscutvars[1] = 20;
3449  xmin_eleptvscutvars[1] = 0.;
3450  xmax_eleptvscutvars[1] = 2.;
3451  }else if(ih==12 || ih==13 || ih==14){
3452  //12: DCA Bachto prim, 13: DCA V0pr to prim 14: DCA V0pi to prim
3453  bins_eleptvscutvars[1] = 20;
3454  xmin_eleptvscutvars[1] = 0.;
3455  xmax_eleptvscutvars[1] = 0.5;
3456  }else if(ih==15 || ih==16){
3457  //16: CosPAXi, 15: CosPAv0
3458  bins_eleptvscutvars[1] = 20;
3459  xmin_eleptvscutvars[1] = 0.95;
3460  xmax_eleptvscutvars[1] = 1.0;
3461  }else if(ih==17 || ih==18 || ih==19){
3462  //17: nSigma(TPC, bach) 18: nSigma(TPC, v0pr), 19: nSigma(TPC,v0pi)
3463  bins_eleptvscutvars[1] = 20;
3464  xmin_eleptvscutvars[1] = -5.;
3465  xmax_eleptvscutvars[1] = 5.;
3466  }else if(ih==20 || ih==21){
3467  //20: V0 eta 21: Xi eta
3468  bins_eleptvscutvars[1] = 30;
3469  xmin_eleptvscutvars[1] = -1.5;
3470  xmax_eleptvscutvars[1] = 1.5;
3471  }else if(ih==22){
3472  //20: Opening angle
3473  bins_eleptvscutvars[1] = 20;
3474  xmin_eleptvscutvars[1] = 0.;
3475  xmax_eleptvscutvars[1] = 3.141592/2;
3476  }
3477 
3478  fHistoElePtvsCutVarsRS[ih] = new THnSparseF(Form("fHistoElePtvsCutVarsRS[%d]",ih),"",3,bins_eleptvscutvars,xmin_eleptvscutvars,xmax_eleptvscutvars);
3480  fHistoElePtvsCutVarsWS[ih] = new THnSparseF(Form("fHistoElePtvsCutVarsWS[%d]",ih),"",3,bins_eleptvscutvars,xmin_eleptvscutvars,xmax_eleptvscutvars);
3482  fHistoElePtvsCutVarsMCS[ih] = new THnSparseF(Form("fHistoElePtvsCutVarsMCS[%d]",ih),"",3,bins_eleptvscutvars,xmin_eleptvscutvars,xmax_eleptvscutvars);
3484  }
3485 
3486  Int_t bins_eletag[3]= {20 ,40 ,10};
3487  Double_t xmin_eletag[3]={0.,0. ,0.0};
3488  Double_t xmax_eletag[3]={10.,20 ,100};
3489  fHistoElectronPi0Total = new THnSparseF("fHistoElectronPi0Total","",3,bins_eletag,xmin_eletag,xmax_eletag);
3491  fHistoElectronPi0Tag = new THnSparseF("fHistoElectronPi0Tag","",3,bins_eletag,xmin_eletag,xmax_eletag);
3493  fHistoElectronEtaTotal = new THnSparseF("fHistoElectronEtaTotal","",3,bins_eletag,xmin_eletag,xmax_eletag);
3495  fHistoElectronEtaTag = new THnSparseF("fHistoElectronEtaTag","",3,bins_eletag,xmin_eletag,xmax_eletag);
3497 
3498  fHistoPi0MCGen = new TH1F("fHistoPi0MCGen","",100,0.,20.);
3499  fOutputAll->Add(fHistoPi0MCGen);
3500  fHistoEtaMCGen = new TH1F("fHistoEtaMCGen","",100,0.,20.);
3501  fOutputAll->Add(fHistoEtaMCGen);
3502 
3503  return;
3504 }
3505 
3506 //________________________________________________________________________
3507 AliAODRecoCascadeHF* AliAnalysisTaskSEXic2eleXifromAODtracks::MakeCascadeHF(AliAODcascade *casc, AliAODTrack *part, AliAODTrack *partpid, AliAODEvent * aod, AliAODVertex *secVert)
3508 {
3509  //
3510  // Create AliAODRecoCascadeHF object from the argument
3511  //
3512 
3513  if(!casc) return 0x0;
3514  if(!part) return 0x0;
3515  if(!aod) return 0x0;
3516 
3517  //------------------------------------------------
3518  // PrimaryVertex
3519  //------------------------------------------------
3520  AliAODVertex *primVertexAOD;
3521  Bool_t unsetvtx = kFALSE;
3523  primVertexAOD = CallPrimaryVertex(casc,part,aod);
3524  if(!primVertexAOD){
3525  primVertexAOD = fVtx1;
3526  }else{
3527  unsetvtx = kTRUE;
3528  }
3529  }else{
3530  primVertexAOD = fVtx1;
3531  }
3532  if(!primVertexAOD) return 0x0;
3533  Double_t posprim[3]; primVertexAOD->GetXYZ(posprim);
3534 
3535  //------------------------------------------------
3536  // DCA between tracks
3537  //------------------------------------------------
3538  AliESDtrack *esdtrack = new AliESDtrack((AliVTrack*)partpid);
3539 
3540  Double_t xyz[3], pxpypz[3], cv[21]; Short_t sign;
3541  xyz[0]=casc->DecayVertexXiX();
3542  xyz[1]=casc->DecayVertexXiY();
3543  xyz[2]=casc->DecayVertexXiZ();
3544  pxpypz[0]=casc->MomXiX();
3545  pxpypz[1]=casc->MomXiY();
3546  pxpypz[2]=casc->MomXiZ();
3547  casc->GetCovarianceXYZPxPyPz(cv);
3548  sign=casc->ChargeXi();
3549  AliExternalTrackParam *trackCasc = new AliExternalTrackParam(xyz,pxpypz,cv,sign);
3550 
3551  Double_t xdummy, ydummy;
3552  Double_t dca = esdtrack->GetDCA(trackCasc,fBzkG,xdummy,ydummy);
3553 
3554 
3555  //------------------------------------------------
3556  // Propagate all tracks to the secondary vertex and calculate momentum there
3557  //------------------------------------------------
3558 
3559  Double_t d0z0bach[2],covd0z0bach[3];
3560  if(sqrt(pow(secVert->GetX(),2)+pow(secVert->GetY(),2))<1.){
3561  part->PropagateToDCA(secVert,fBzkG,kVeryBig,d0z0bach,covd0z0bach);
3562  trackCasc->PropagateToDCA(secVert,fBzkG,kVeryBig);
3563  }else{
3564  part->PropagateToDCA(primVertexAOD,fBzkG,kVeryBig,d0z0bach,covd0z0bach);
3565  trackCasc->PropagateToDCA(primVertexAOD,fBzkG,kVeryBig);
3566  }
3567  Double_t momcasc_new[3]={-9999,-9999,-9999.};
3568  trackCasc->GetPxPyPz(momcasc_new);
3569 
3570  Double_t px[2],py[2],pz[2];
3571  px[0] = part->Px(); py[0] = part->Py(); pz[0] = part->Pz();
3572  px[1] = momcasc_new[0]; py[1] = momcasc_new[1]; pz[1] = momcasc_new[2];
3573 
3574  //------------------------------------------------
3575  // d0
3576  //------------------------------------------------
3577  Double_t d0[3],d0err[3];
3578 
3579  part->PropagateToDCA(primVertexAOD,fBzkG,kVeryBig,d0z0bach,covd0z0bach);
3580  d0[0]= d0z0bach[0];
3581  d0err[0] = TMath::Sqrt(covd0z0bach[0]);
3582 
3583  Double_t d0z0casc[2],covd0z0casc[3];
3584  trackCasc->PropagateToDCA(primVertexAOD,fBzkG,kVeryBig,d0z0casc,covd0z0casc);
3585  d0[1]= d0z0casc[0];
3586  d0err[1] = TMath::Sqrt(covd0z0casc[0]);
3587 
3588  //------------------------------------------------
3589  // Create AliAODRecoCascadeHF
3590  //------------------------------------------------
3591  Short_t charge = part->Charge();
3592  AliAODRecoCascadeHF *theCascade = new AliAODRecoCascadeHF(secVert,charge,px,py,pz,d0,d0err,dca);
3593  if(!theCascade)
3594  {
3595  if(unsetvtx) delete primVertexAOD; primVertexAOD=NULL;
3596  if(esdtrack) delete esdtrack;
3597  if(trackCasc) delete trackCasc;
3598  return 0x0;
3599  }
3600  theCascade->SetOwnPrimaryVtx(primVertexAOD);
3601  UShort_t id[2]={(UShort_t)part->GetID(),(UShort_t)trackCasc->GetID()};
3602  theCascade->SetProngIDs(2,id);
3603 
3604  theCascade->GetSecondaryVtx()->AddDaughter(part);
3605  theCascade->GetSecondaryVtx()->AddDaughter(casc);
3606  if(unsetvtx) delete primVertexAOD; primVertexAOD=NULL;
3607  if(esdtrack) delete esdtrack;
3608  if(trackCasc) delete trackCasc;
3609 
3610  return theCascade;
3611 }
3612 
3613 //________________________________________________________________________
3614 AliAODVertex* AliAnalysisTaskSEXic2eleXifromAODtracks::CallPrimaryVertex(AliAODcascade *casc, AliAODTrack *trk, AliAODEvent* aod)
3615 {
3616  //
3617  // Make an array of tracks which should not be used in primary vertex calculation and
3618  // Call PrimaryVertex function
3619  //
3620 
3621  TObjArray *TrackArray = new TObjArray(3);
3622 
3623  AliESDtrack *cptrk1 = new AliESDtrack((AliVTrack*)trk);
3624  TrackArray->AddAt(cptrk1,0);
3625 
3626  AliESDtrack *cascptrack = new AliESDtrack((AliVTrack*)casc->GetDaughter(0));
3627  TrackArray->AddAt(cascptrack,1);
3628  AliESDtrack *cascntrack = new AliESDtrack((AliVTrack*)casc->GetDaughter(1));
3629  TrackArray->AddAt(cascntrack,2);
3630  AliESDtrack *cascbtrack = new AliESDtrack((AliVTrack*)casc->GetDecayVertexXi()->GetDaughter(0));
3631  TrackArray->AddAt(cascbtrack,3);
3632 
3633  AliAODVertex *newvert = PrimaryVertex(TrackArray,aod);
3634 
3635  for(Int_t i=0;i<4;i++)
3636  {
3637  AliESDtrack *tesd = (AliESDtrack*)TrackArray->UncheckedAt(i);
3638  delete tesd;
3639  }
3640  TrackArray->Clear();
3641  delete TrackArray;
3642 
3643  return newvert;
3644 }
3645 
3646 //________________________________________________________________________
3647 AliAODVertex* AliAnalysisTaskSEXic2eleXifromAODtracks::PrimaryVertex(const TObjArray *trkArray,
3648  AliVEvent *event)
3649 {
3650  //
3651  //Used only for pp
3652  //copied from AliAnalysisVertexingHF (except for the following 3 lines)
3653  //
3654 
3655  Bool_t fRecoPrimVtxSkippingTrks = kTRUE;
3656  Bool_t fRmTrksFromPrimVtx = kFALSE;
3657 
3658  AliESDVertex *vertexESD = 0;
3659  AliAODVertex *vertexAOD = 0;
3660 
3661  //vertexESD = new AliESDVertex(*fV1);
3662 
3663 
3664  if(!fRecoPrimVtxSkippingTrks && !fRmTrksFromPrimVtx) {
3665  // primary vertex from the input event
3666 
3667  vertexESD = new AliESDVertex(*fV1);
3668 
3669  } else {
3670  // primary vertex specific to this candidate
3671 
3672  Int_t nTrks = trkArray->GetEntriesFast();
3673  AliVertexerTracks *vertexer = new AliVertexerTracks(event->GetMagneticField());
3674 
3675  if(fRecoPrimVtxSkippingTrks) {
3676  // recalculating the vertex
3677 
3678  if(strstr(fV1->GetTitle(),"VertexerTracksWithConstraint")) {
3679  Float_t diamondcovxy[3];
3680  event->GetDiamondCovXY(diamondcovxy);
3681  Double_t pos[3]={event->GetDiamondX(),event->GetDiamondY(),0.};
3682  Double_t cov[6]={diamondcovxy[0],diamondcovxy[1],diamondcovxy[2],0.,0.,10.*10.};
3683  AliESDVertex *diamond = new AliESDVertex(pos,cov,1.,1);
3684  vertexer->SetVtxStart(diamond);
3685  delete diamond; diamond=NULL;
3686  if(strstr(fV1->GetTitle(),"VertexerTracksWithConstraintOnlyFitter"))
3687  vertexer->SetOnlyFitter();
3688  }
3689  Int_t skipped[1000];
3690  Int_t nTrksToSkip=0,id;
3691  AliExternalTrackParam *t = 0;
3692  for(Int_t i=0; i<nTrks; i++) {
3693  t = (AliExternalTrackParam*)trkArray->UncheckedAt(i);
3694  id = (Int_t)t->GetID();
3695  if(id<0) continue;
3696  skipped[nTrksToSkip++] = id;
3697  }
3698  // TEMPORARY FIX
3699  // For AOD, skip also tracks without covariance matrix
3700  Double_t covtest[21];
3701  for(Int_t j=0; j<event->GetNumberOfTracks(); j++) {
3702  AliVTrack *vtrack = (AliVTrack*)event->GetTrack(j);
3703  if(!vtrack->GetCovarianceXYZPxPyPz(covtest)) {
3704  id = (Int_t)vtrack->GetID();
3705  if(id<0) continue;
3706  skipped[nTrksToSkip++] = id;
3707  }
3708  }
3709  for(Int_t ijk=nTrksToSkip; ijk<1000; ijk++) skipped[ijk]=-1;
3710  //
3711  vertexer->SetSkipTracks(nTrksToSkip,skipped);
3712  vertexESD = (AliESDVertex*)vertexer->FindPrimaryVertex(event);
3713 
3714  } else if(fRmTrksFromPrimVtx && nTrks>0) {
3715  // removing the prongs tracks
3716 
3717  TObjArray rmArray(nTrks);
3718  UShort_t *rmId = new UShort_t[nTrks];
3719  AliESDtrack *esdTrack = 0;
3720  AliESDtrack *t = 0;
3721  for(Int_t i=0; i<nTrks; i++) {
3722  t = (AliESDtrack*)trkArray->UncheckedAt(i);
3723  esdTrack = new AliESDtrack(*t);
3724  rmArray.AddLast(esdTrack);
3725  if(esdTrack->GetID()>=0) {
3726  rmId[i]=(UShort_t)esdTrack->GetID();
3727  } else {
3728  rmId[i]=9999;
3729  }
3730  }
3731  Float_t diamondxy[2]={static_cast<Float_t>(event->GetDiamondX()),static_cast<Float_t>(event->GetDiamondY())};
3732  vertexESD = vertexer->RemoveTracksFromVertex(fV1,&rmArray,rmId,diamondxy);
3733  delete [] rmId; rmId=NULL;
3734  rmArray.Delete();
3735 
3736  }
3737 
3738  delete vertexer; vertexer=NULL;
3739  if(!vertexESD) return vertexAOD;
3740  if(vertexESD->GetNContributors()<=0) {
3741  //AliDebug(2,"vertexing failed");
3742  delete vertexESD; vertexESD=NULL;
3743  return vertexAOD;
3744  }
3745 
3746 
3747  }
3748 
3749  // convert to AliAODVertex
3750  Double_t pos[3],cov[6],chi2perNDF;
3751  vertexESD->GetXYZ(pos); // position
3752  vertexESD->GetCovMatrix(cov); //covariance matrix
3753  chi2perNDF = vertexESD->GetChi2toNDF();
3754  delete vertexESD; vertexESD=NULL;
3755 
3756  vertexAOD = new AliAODVertex(pos,cov,chi2perNDF);
3757 
3758  return vertexAOD;
3759 }
3760 
3761 //________________________________________________________________________
3762 AliAODVertex* AliAnalysisTaskSEXic2eleXifromAODtracks::ReconstructSecondaryVertex(AliAODcascade *casc, AliAODTrack *part, AliAODEvent * aod)
3763 {
3764  //
3765  // Reconstruct secondary vertex from trkArray (Copied from AliAnalysisVertexingHF)
3766  //
3767 
3768  AliAODVertex *primVertexAOD;
3769  Bool_t unsetvtx = kFALSE;
3771  primVertexAOD = CallPrimaryVertex(casc,part,aod);
3772  if(!primVertexAOD){
3773  primVertexAOD = fVtx1;
3774  }else{
3775  unsetvtx = kTRUE;
3776  }
3777  }else{
3778  primVertexAOD = fVtx1;
3779  }
3780  if(!primVertexAOD) return 0x0;
3781 
3782  AliESDVertex * vertexESD = new AliESDVertex(*fV1);
3783 
3784  Double_t pos[3],cov[6],chi2perNDF;
3785  vertexESD->GetXYZ(pos); // position
3786  vertexESD->GetCovMatrix(cov); //covariance matrix
3787  chi2perNDF = vertexESD->GetChi2toNDF();
3788  delete vertexESD; vertexESD=NULL;
3789 
3790  AliAODVertex *secVert = new AliAODVertex(pos,cov,chi2perNDF);
3791 
3792  return secVert;
3793 }
3794 //________________________________________________________________________
3795 Int_t AliAnalysisTaskSEXic2eleXifromAODtracks::MatchToMC(AliAODRecoCascadeHF *exobj, TClonesArray *mcArray, Int_t *pdgarray_ele, Int_t *pdgarray_casc, Int_t *labelarray_ele, Int_t *labelarray_casc, Int_t &ngen_ele, Int_t &ngen_casc)
3796 {
3797  //
3798  // Match to MC
3799  //
3800  for(Int_t i=0;i<100;i++){
3801  pdgarray_ele[i] = -9999;
3802  labelarray_ele[i] = -9999;
3803  pdgarray_casc[i] = -9999;
3804  labelarray_casc[i] = -9999;
3805  }
3806  ngen_ele = 0;
3807  ngen_casc = 0;
3808 
3809  AliVTrack *trk = dynamic_cast<AliVTrack*>(exobj->GetBachelor());
3810  if(!trk) return -1;
3811  Int_t labEle = trk->GetLabel();
3812  if(labEle<0) return -1;
3813  AliAODMCParticle *mcetrk = (AliAODMCParticle*)mcArray->At(labEle);
3814  if(!mcetrk) return -1;
3815  labelarray_ele[0] = labEle;
3816  pdgarray_ele[0] = mcetrk->GetPdgCode();
3817  ngen_ele ++;
3818 
3819  AliAODMCParticle *mcprimele=0;
3820  mcprimele = mcetrk;
3821  while(mcprimele->GetMother()>=0) {
3822  Int_t labprim_ele=mcprimele->GetMother();
3823  AliAODMCParticle *tmcprimele = (AliAODMCParticle*)mcArray->At(labprim_ele);
3824  if(!tmcprimele) {
3825  break;
3826  }
3827 
3828  mcprimele = tmcprimele;
3829  pdgarray_ele[ngen_ele] = mcprimele->GetPdgCode();
3830  labelarray_ele[ngen_ele] = labprim_ele;
3831  ngen_ele ++;
3832  if(ngen_ele==100) break;
3833  }
3834 
3835  AliAODcascade *theCascade = dynamic_cast<AliAODcascade*>(exobj->GetCascade());
3836  if(!theCascade) return -1;
3837 
3838  Int_t pdgDgcasc[2]={211,3122};
3839  Int_t pdgDgv0[2]={2212,211};
3840  Int_t labcasc = MatchToMCCascade(theCascade,3312,pdgDgcasc,pdgDgv0,mcArray); // the cascade
3841  if(labcasc<0) return -1;
3842 
3843  AliAODMCParticle *mccasc = (AliAODMCParticle*)mcArray->At(labcasc);
3844  if(!mccasc) return -1;
3845  labelarray_casc[0] = labcasc;
3846  pdgarray_casc[0] = mccasc->GetPdgCode();
3847  ngen_casc ++;
3848 
3849  AliAODMCParticle *mcprimcasc=0;
3850  mcprimcasc = mccasc;
3851  while(mcprimcasc->GetMother()>=0) {
3852  Int_t labprim_casc=mcprimcasc->GetMother();
3853  AliAODMCParticle *tmcprimcasc = (AliAODMCParticle*)mcArray->At(labprim_casc);
3854  if(!tmcprimcasc) {
3855  break;
3856  }
3857 
3858  mcprimcasc = tmcprimcasc;
3859  pdgarray_casc[ngen_casc] = mcprimcasc->GetPdgCode();
3860  labelarray_casc[ngen_casc] = labprim_casc;
3861  ngen_casc ++;
3862  if(ngen_casc==100) break;
3863  }
3864 
3865  Bool_t same_flag = kFALSE;
3866  Int_t matchedlabel=-9999;
3867  for(Int_t iemc=0;iemc<ngen_ele;iemc++){
3868  for(Int_t ivmc=0;ivmc<ngen_casc;ivmc++){
3869  if(labelarray_ele[iemc]==labelarray_casc[ivmc]){
3870  same_flag = kTRUE;
3871  matchedlabel = labelarray_ele[iemc];
3872  break;
3873  }
3874  }
3875  if(same_flag) break;
3876  }
3877 
3878  return matchedlabel;
3879 
3880 }
3881 //________________________________________________________________________
3882 Int_t AliAnalysisTaskSEXic2eleXifromAODtracks::MatchToMCCascade(AliAODcascade *theCascade, Int_t pdgabscasc, Int_t *pdgDgcasc, Int_t *pdgDgv0, TClonesArray *mcArray) const // the cascade
3883 {
3884  //
3885  // Matching to MC of cascade
3886  //
3887 
3888  AliAODTrack *cptrack = (AliAODTrack*) theCascade->GetDaughter(0);
3889  if(!cptrack) return -1;
3890  Int_t label_p = TMath::Abs(cptrack->GetLabel());
3891  if(label_p<0) return -1;
3892  AliAODTrack *cntrack = (AliAODTrack*) theCascade->GetDaughter(1);
3893  if(!cntrack) return -1;
3894  Int_t label_n = TMath::Abs(cntrack->GetLabel());
3895  if(label_n<0) return -1;
3896  Int_t labv0 = theCascade->MatchToMC(pdgDgcasc[1],mcArray,2,pdgDgv0);
3897  if(labv0<0) return -1;
3898  AliAODMCParticle *mcpartv0= (AliAODMCParticle*) mcArray->At(labv0);
3899 
3900  AliAODTrack *cbtrack = (AliAODTrack*) theCascade->GetDecayVertexXi()->GetDaughter(0);
3901  if(!cbtrack) return -1;
3902 
3903  Int_t label_b = TMath::Abs(cbtrack->GetLabel());
3904  if(label_b<0) return -1;
3905 
3906  AliAODMCParticle *mcpartb= (AliAODMCParticle*) mcArray->At(label_b);
3907  Int_t pdgb = TMath::Abs(mcpartb->GetPdgCode());
3908  if(pdgb!=pdgDgcasc[0]) return -1;
3909 
3910  AliAODMCParticle *mcmotherv0=mcpartv0;
3911  Bool_t isFromXiv0 = kFALSE;
3912  Int_t labxiv0 = mcmotherv0->GetMother();
3913  if(labxiv0<0) return -1;
3914  mcmotherv0 = (AliAODMCParticle*) mcArray->At(labxiv0);
3915  if(mcmotherv0){
3916  Int_t pdg = TMath::Abs(mcmotherv0 ->GetPdgCode());
3917  if(pdg==pdgabscasc){
3918  isFromXiv0 = kTRUE;
3919  }
3920  }
3921  if(!isFromXiv0) return -1;
3922 
3923  AliAODMCParticle *mcmotherb=mcpartb;
3924  Bool_t isFromXib = kFALSE;
3925  Int_t labxib = mcmotherb->GetMother();
3926  if(labxib<0) return -1;
3927  mcmotherb = (AliAODMCParticle*) mcArray->At(labxib);
3928  if(mcmotherb){
3929  Int_t pdg = TMath::Abs(mcmotherb ->GetPdgCode());
3930  if(pdg==pdgabscasc){
3931  isFromXib = kTRUE;
3932  }
3933  }
3934  if(!isFromXib) return -1;
3935 
3936  if(labxiv0!=labxib) return -1;//Bachelor and V0 should come from the same Xi
3937 
3938  return labxib;
3939 }
3940 //________________________________________________________________________
3941 void AliAnalysisTaskSEXic2eleXifromAODtracks::SelectTrack( const AliVEvent *event, Int_t trkEntries, Int_t &nSeleTrks,Bool_t *seleFlags, TClonesArray *mcArray)
3942 {
3943  //
3944  // Select good tracks using fAnalCuts (AliRDHFCuts object) and return the array of their ids
3945  //
3946 
3947  //const Int_t entries = event->GetNumberOfTracks();
3948  if(trkEntries==0) return;
3949 
3950  nSeleTrks=0;
3951  for(Int_t i=0; i<trkEntries; i++) {
3952  seleFlags[i] = kFALSE;
3953 
3954  AliVTrack *track;
3955  track = (AliVTrack*)event->GetTrack(i);
3956 
3957  //if(track->GetID()<0) continue;
3958  Double_t covtest[21];
3959  if(!track->GetCovarianceXYZPxPyPz(covtest)) continue;
3960 
3961  if(!fAnalCuts) continue;
3962 
3963  AliAODTrack *aodt = (AliAODTrack*)track;
3964 
3966  Int_t filterbit = fAnalCuts->GetProdAODFilterBit();
3967  if(filterbit==7){
3968  if(!aodt->TestFilterBit(BIT(filterbit))) continue;
3969  }else{
3970  if(!aodt->TestFilterMask(BIT(filterbit))) continue;
3971  }
3972  }
3973 
3974  AliAODTrack *aodtpid = 0;
3975  if(fAnalCuts->GetProdAODFilterBit()==7){
3976  aodtpid = fGTI[-aodt->GetID()-1];
3977  }else{
3978  aodtpid = aodt;
3979  }
3980 
3981  Double_t nsigma_tpcele = -9999;
3982  Double_t nsigma_tofele = -9999;
3983  if(fAnalCuts->GetIsUsePID()){
3984  nsigma_tpcele = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTPC(aodtpid,AliPID::kElectron);
3985  nsigma_tofele = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTOF(aodtpid,AliPID::kElectron);
3986  }
3987 
3988  if(fAnalCuts->SingleTrkCutsNoPID(aodt,aodtpid,fVtx1)){
3989  fHistoElectronTPCPID->Fill(aodt->Pt(),nsigma_tpcele);
3990  fHistoElectronTOFPID->Fill(aodt->Pt(),nsigma_tofele);
3991  if(fabs(nsigma_tofele)<3.){
3992  fHistoElectronTPCPIDSelTOF->Fill(aodt->Pt(),nsigma_tpcele);
3993  Double_t eleeta = aodt->Eta();
3994  if(fabs(eleeta)<0.6)
3995  fHistoElectronTPCPIDSelTOFSmallEta->Fill(aodt->Pt(),nsigma_tpcele);
3996  if(fabs(eleeta)>0.6 && fabs(eleeta)<0.8)
3997  fHistoElectronTPCPIDSelTOFLargeEta->Fill(aodt->Pt(),nsigma_tpcele);
3998  if(eleeta>-0.8 && eleeta<-0.6){
3999  fHistoElectronTPCPIDSelTOFEtaDep[0]->Fill(aodt->Pt(),nsigma_tpcele);
4000  }else if(eleeta>-0.6&&eleeta<-0.4){
4001  fHistoElectronTPCPIDSelTOFEtaDep[1]->Fill(aodt->Pt(),nsigma_tpcele);
4002  }else if(eleeta>-0.4&&eleeta<-0.2){
4003  fHistoElectronTPCPIDSelTOFEtaDep[2]->Fill(aodt->Pt(),nsigma_tpcele);
4004  }else if(eleeta>-0.2&&eleeta<0.0){
4005  fHistoElectronTPCPIDSelTOFEtaDep[3]->Fill(aodt->Pt(),nsigma_tpcele);
4006  }else if(eleeta>0.0&&eleeta<0.2){
4007  fHistoElectronTPCPIDSelTOFEtaDep[4]->Fill(aodt->Pt(),nsigma_tpcele);
4008  }else if(eleeta>0.2&&eleeta<0.4){
4009  fHistoElectronTPCPIDSelTOFEtaDep[5]->Fill(aodt->Pt(),nsigma_tpcele);
4010  }else if(eleeta>0.4&&eleeta<0.6){
4011  fHistoElectronTPCPIDSelTOFEtaDep[6]->Fill(aodt->Pt(),nsigma_tpcele);
4012  }else if(eleeta>0.6&&eleeta<0.8){
4013  fHistoElectronTPCPIDSelTOFEtaDep[7]->Fill(aodt->Pt(),nsigma_tpcele);
4014  }
4015  }
4016  if(nsigma_tpcele>-0.5&&nsigma_tpcele<3.){
4017  fHistoElectronTOFPIDSelTPC->Fill(aodt->Pt(),nsigma_tofele);
4018  }
4019  }
4020  if(fAnalCuts->SingleTrkCuts(aodt,aodtpid,fVtx1)){
4021  seleFlags[i]=kTRUE;
4022  nSeleTrks++;
4023  fHistoElectronTPCSelPID->Fill(aodt->Pt(),nsigma_tpcele);
4024  fHistoElectronTOFSelPID->Fill(aodt->Pt(),nsigma_tofele);
4025 
4026  Double_t minmass_ee = 9999.;
4027  Bool_t isconv = fAnalCuts->TagConversions(aodt,fGTIndex,(AliAODEvent*)event,event->GetNumberOfTracks(),minmass_ee);
4028 
4029  if(fUseMCInfo)
4030  {
4031  Int_t labEle = aodt->GetLabel();
4032  if(labEle<0){
4033  seleFlags[i]=kFALSE;
4034  continue;
4035  }
4036  AliAODMCParticle *mcetrk = (AliAODMCParticle*)mcArray->At(labEle);
4037  if(!mcetrk){
4038  seleFlags[i]=kFALSE;
4039  continue;
4040  }
4041  Int_t pdgEle = mcetrk->GetPdgCode();
4042  if(abs(pdgEle)!=11){
4043  seleFlags[i]=kFALSE;
4044  continue;
4045  }
4046 
4047  Int_t pdgarray_ele[100], labelarray_ele[100], ngen_ele;
4048  GetMCDecayHistory(mcetrk,mcArray,pdgarray_ele,labelarray_ele,ngen_ele);
4049 
4050  Bool_t hfe_flag = kFALSE;
4051  Bool_t gamma_flag = kFALSE;
4052  Bool_t pi0_flag = kFALSE;
4053  Bool_t eta_flag = kFALSE;
4054  Double_t pt_pi0 = -9999.;
4055  Double_t pt_eta = -9999.;
4056  if(abs(pdgarray_ele[0])>400&&abs(pdgarray_ele[0])<440){
4057  hfe_flag = kTRUE;
4058  }
4059  if(abs(pdgarray_ele[0])>4000&&abs(pdgarray_ele[0])<4400){
4060  hfe_flag = kTRUE;
4061  }
4062  if(abs(pdgarray_ele[0])>500&&abs(pdgarray_ele[0])<540){
4063  hfe_flag = kTRUE;
4064  }
4065  if(abs(pdgarray_ele[0])>5000&&abs(pdgarray_ele[0])<5400){
4066  hfe_flag = kTRUE;
4067  }
4068  if(abs(pdgarray_ele[0])==22){
4069  gamma_flag = kTRUE;
4070  }
4071  if(!gamma_flag){
4072  fHistoBachPtMCS->Fill(aodt->Pt());
4073  }
4074  if((abs(pdgarray_ele[0])==22) && (abs(pdgarray_ele[1])==111)){
4075  pi0_flag = kTRUE;
4076  AliAODMCParticle *mctrkm = (AliAODMCParticle*)mcArray->At(labelarray_ele[1]);
4077  pt_pi0 = mctrkm->Pt();
4078  }
4079  if(abs(pdgarray_ele[0])==111){
4080  pi0_flag = kTRUE;
4081  AliAODMCParticle *mctrkm = (AliAODMCParticle*)mcArray->At(labelarray_ele[0]);
4082  pt_pi0 = mctrkm->Pt();
4083  }
4084  if((abs(pdgarray_ele[0])==22) && (abs(pdgarray_ele[1])==221)){
4085  eta_flag = kTRUE;
4086  AliAODMCParticle *mctrkm = (AliAODMCParticle*)mcArray->At(labelarray_ele[1]);
4087  pt_eta = mctrkm->Pt();
4088  }
4089  if(abs(pdgarray_ele[0])==221){
4090  eta_flag = kTRUE;
4091  AliAODMCParticle *mctrkm = (AliAODMCParticle*)mcArray->At(labelarray_ele[0]);
4092  pt_eta = mctrkm->Pt();
4093  }
4094 
4095  if(pi0_flag){
4096  Double_t cont_pi0[3];
4097  cont_pi0[0] = aodt->Pt();
4098  cont_pi0[1] = pt_pi0;
4099  cont_pi0[2] = fCentrality;
4100  fHistoElectronPi0Total->Fill(cont_pi0);
4101  if(isconv) fHistoElectronPi0Tag->Fill(cont_pi0);
4102  }
4103 
4104  if(eta_flag){
4105  Double_t cont_eta[3];
4106  cont_eta[0] = aodt->Pt();
4107  cont_eta[1] = pt_eta;
4108  cont_eta[2] = fCentrality;
4109  fHistoElectronEtaTotal->Fill(cont_eta);
4110  if(isconv) fHistoElectronEtaTag->Fill(cont_eta);
4111  }
4112 
4113  if(!hfe_flag){
4114  seleFlags[i]=kFALSE;
4115  continue;
4116  }
4117  }
4118 
4119  if(fMixWithoutConversionFlag && isconv){
4120  //seleFlags[i]=kFALSE;
4121  continue;
4122  }
4123 
4124  FillElectronROOTObjects(aodt,aodtpid,(AliAODEvent*)event,mcArray);
4125 
4126 // Double_t minmass = 9999.;
4127 // Bool_t isconv = fAnalCuts->TagConversions(aodt,fGTIndex,(AliAODEvent*)event,trkEntries,minmass);
4128 // fHistoMassConversionsMin->Fill(minmass);
4129 // if(isconv) seleFlags[i] = kFALSE;
4130 
4131 // if(fMixWithoutConversionFlag){
4132 // if(seleFlags[i]) FillElectronROOTObjects(aodt,mcArray);
4133 // }else{
4134 // FillElectronROOTObjects(aodt,mcArray);
4135 // }
4136 
4137 // Double_t minmasslike = 9999.;
4138 // fAnalCuts->TagConversionsSameSign(aodt,fGTIndex,(AliAODEvent*)event,trkEntries,minmasslike);
4139 // fHistoMassConversionsSameSignMin->Fill(minmasslike);
4140  }
4141  } // end loop on tracks
4142 }
4143 //________________________________________________________________________
4144 void AliAnalysisTaskSEXic2eleXifromAODtracks::SelectCascade( const AliVEvent *event,Int_t nCascs,Int_t &nSeleCasc, Bool_t *seleCascFlags, TClonesArray *mcArray)
4145 {
4146  //
4147  // Select good Casc using fAnalCuts (AliRDHFCuts object) and return the array of their ids
4148  //
4149 
4150  Double_t primVtx[3];
4151  fVtx1->GetXYZ(primVtx);
4152 
4153  nSeleCasc = 0;
4154  for(Int_t icasc=0;icasc<nCascs;icasc++)
4155  {
4156  seleCascFlags[icasc] = kFALSE;
4157  AliAODcascade *casc = ((AliAODEvent*)event)->GetCascade(icasc);
4158 
4159  if(!fAnalCuts) continue;
4160  if(fAnalCuts->SingleCascadeCuts(casc,primVtx)){
4161  seleCascFlags[icasc] = kTRUE;
4162  nSeleCasc++;
4163 
4164  FillCascROOTObjects(casc,mcArray);
4165  }
4166  }
4167 }
4168 //_________________________________________________________________
4169 Int_t AliAnalysisTaskSEXic2eleXifromAODtracks::GetPoolIndex(Double_t zvert, Double_t mult){
4170  //
4171  // check in which of the pools the current event falls
4172  //
4173 
4174  Int_t theBinZ=TMath::BinarySearch(fNzVtxBins,fZvtxBins,zvert);
4175  if(theBinZ<0 || theBinZ>=fNzVtxBins) return -1;
4176  Int_t theBinM=TMath::BinarySearch(fNCentBins,fCentBins,mult);
4177  if(theBinM<0 || theBinM>=fNCentBins) return -1;
4178  return fNCentBins*theBinZ+theBinM;
4179 }
4180 //_________________________________________________________________
4182  //
4183  // delete the contets of the pool
4184  //
4185  if(poolIndex<0 || poolIndex>=fNOfPools) return;
4186  delete fEventBuffer[poolIndex];
4187  fEventBuffer[poolIndex]=new TTree(Form("EventBuffer_%d",poolIndex), "Temporary buffer for event mixing");
4188 
4189  fEventBuffer[poolIndex]->Branch("zVertex", &fVtxZ);
4190  fEventBuffer[poolIndex]->Branch("centrality", &fCentrality);
4191  fEventBuffer[poolIndex]->Branch("eventInfo", "TObjString",&fEventInfo);
4192  fEventBuffer[poolIndex]->Branch("c1array", "TObjArray", &fCascadeTracks1);
4193  fEventBuffer[poolIndex]->Branch("c2array", "TObjArray", &fCascadeTracks2);
4194  fEventBuffer[poolIndex]->Branch("c1varsarray", "TObjArray", &fCascadeCutVarsArray1);
4195  fEventBuffer[poolIndex]->Branch("c2varsarray", "TObjArray", &fCascadeCutVarsArray2);
4196 
4197  return;
4198 }
4199 //_________________________________________________________________
4201 {
4202  //
4203  // perform mixed event analysis
4204  //
4205 
4206  if(poolIndex<0 || poolIndex>fNzVtxBins*fNCentBins) return;
4207  if(fEventBuffer[poolIndex]->GetEntries()<fNumberOfEventsForMixing) return;
4208 
4209  Int_t nEle = fElectronTracks->GetEntries();
4210  Int_t nEvents=fEventBuffer[poolIndex]->GetEntries();
4211 
4212  TObjArray* c1array=0x0;
4213  TObjArray* c2array=0x0;
4214  TObjArray* c1varsarray=0x0;
4215  TObjArray* c2varsarray=0x0;
4216  Float_t zVertex,cent;
4217  TObjString* eventInfo=0x0;
4218  fEventBuffer[poolIndex]->SetBranchAddress("zVertex", &zVertex);
4219  fEventBuffer[poolIndex]->SetBranchAddress("eventInfo",&eventInfo);
4220  fEventBuffer[poolIndex]->SetBranchAddress("centrality", &cent);
4221  fEventBuffer[poolIndex]->SetBranchAddress("c1array", &c1array);
4222  fEventBuffer[poolIndex]->SetBranchAddress("c2array", &c2array);
4223  fEventBuffer[poolIndex]->SetBranchAddress("c1varsarray", &c1varsarray);
4224  fEventBuffer[poolIndex]->SetBranchAddress("c2varsarray", &c2varsarray);
4225  for (Int_t i=0; i<nEle; i++)
4226  {
4227  TLorentzVector* trke=(TLorentzVector*) fElectronTracks->At(i);
4228  if(!trke)continue;
4229  TVector *elevarsarray = (TVector*)fElectronCutVarsArray->At(i);
4230 
4231  for(Int_t iEv=0; iEv<fNumberOfEventsForMixing; iEv++){
4232  fEventBuffer[poolIndex]->GetEvent(iEv + nEvents - fNumberOfEventsForMixing);
4233  //TObjArray* c1array1=(TObjArray*)c1array->Clone();
4234  Int_t nCascs1=c1array->GetEntries();
4235  //Float_t zVertex1=zVertex;
4236  //Float_t mult1=cent;
4237 // Int_t evId1,esdId1,ne1,nv1;
4238 // sscanf((eventInfo->String()).Data(),"Ev%d_esd%d_E%d_C%d",&evId1,&esdId1,&ne1,&nv1);
4239 // if(nv1!=(nCascs1+nCascs2)){
4240 // printf("AliAnalysisTaskSEXic2eleXifromAODtracks::DoMixingWithPools ERROR: read event does not match to the stored one\n");
4241 // delete c1array1;
4242 // delete c2array1;
4243 // continue;
4244 // }
4245  for(Int_t iTr1=0; iTr1<nCascs1; iTr1++){
4246  TLorentzVector* casc1=(TLorentzVector*) c1array->At(iTr1);
4247  if(!casc1) continue;
4248  TVector *cascvarsarray = (TVector*) c1varsarray->At(iTr1);
4249  FillMixROOTObjects(trke,casc1,elevarsarray,cascvarsarray,1);
4250  }//casc loop
4251 
4252  //TObjArray* c2array1=(TObjArray*)c2array->Clone();
4253  Int_t nCascs2=c2array->GetEntries();
4254  for(Int_t iTr2=0; iTr2<nCascs2; iTr2++){
4255  TLorentzVector* casc2=(TLorentzVector*) c2array->At(iTr2);
4256  if(!casc2) continue;
4257  TVector *cascvarsarray = (TVector*) c2varsarray->At(iTr2);
4258  FillMixROOTObjects(trke,casc2,elevarsarray,cascvarsarray,-1);
4259  }//casc loop
4260 
4261  //delete c1array1;
4262  //delete c2array1;
4263  }//event loop
4264  }//track loop
4265 }
4266 //_________________________________________________________________
4268 {
4269  //
4270  // Analyze AliAODmcparticle
4271  //
4272 
4273  Int_t nmcpart = mcArray->GetEntriesFast();
4274 
4275  Int_t mcevttype = 0;
4276  Int_t nccbar = 0;
4277  Bool_t sigmaevent = kFALSE;
4278  if(fMCEventType==1 || fMCEventType==2 || fMCEventType==11 || fMCEventType==12){
4279  //1: c quark event
4280  //2: b quark event
4281  //11: near side c-cbar event
4282  //12: away side c-cbar event
4283  Int_t ncquark = 0;
4284  Int_t ncbarquark = 0;
4285  Double_t phi_c = -9999.;
4286  Double_t phi_cbar = -9999.;
4287  for(Int_t i=0;i<nmcpart;i++)
4288  {
4289  AliAODMCParticle *mcpart = (AliAODMCParticle*) mcArray->At(i);
4290  if(TMath::Abs(mcpart->GetPdgCode())==4){
4291  if(fabs(mcpart->Y())<1.5){
4292  if(mcpart->GetPdgCode()==4){
4293  phi_c = mcpart->Phi();
4294  ncquark++;
4295  }
4296  if(mcpart->GetPdgCode()==-4){
4297  phi_cbar = mcpart->Phi();
4298  ncbarquark++;
4299  }
4300  if(mcevttype==0){
4301  mcevttype = 1;
4302  }else if(mcevttype==1){
4303  mcevttype = 1;
4304  }else if(mcevttype==2){
4305  mcevttype = 3;
4306  }else if(mcevttype==3){
4307  mcevttype = 3;
4308  }
4309  nccbar++;
4310  }
4311  }
4312  if(TMath::Abs(mcpart->GetPdgCode())==5){
4313  if(!mcpart->IsPhysicalPrimary()) continue;
4314  if(fabs(mcpart->Y())<1.5){
4315  if(mcevttype==0){
4316  mcevttype = 2;
4317  }else if(mcevttype==1){
4318  mcevttype = 3;
4319  }else if(mcevttype==2){
4320  mcevttype = 2;
4321  }else if(mcevttype==3){
4322  mcevttype = 3;
4323  }
4324  }
4325  }
4326  }
4327 
4328  if(fMCEventType==1||fMCEventType==11||fMCEventType==12){
4329  if((mcevttype==2)||(mcevttype==0)||(mcevttype==3)) return kFALSE;
4330  }else if(fMCEventType==2){
4331  if((mcevttype==1)||(mcevttype==0)||(mcevttype==3)) return kFALSE;
4332  }
4333 
4334  if(fMCEventType>10){
4335  if(ncquark!=1) return kFALSE;
4336  if(ncbarquark!=1) return kFALSE;
4337  Double_t dphi = fabs(phi_c - phi_cbar);
4338  if(dphi>2*M_PI) dphi -= 2*M_PI;
4339  if(dphi>M_PI) dphi = 2*M_PI-dphi;
4340  if(fMCEventType==11 && dphi>M_PI/3.) return kFALSE;
4341  if(fMCEventType==12 && dphi<2*M_PI/3.) return kFALSE;
4342  fHistoMCDeltaPhiccbar->Fill(dphi);
4343  }
4344 
4345  fHistoMCEventType->Fill(mcevttype);
4346  fHistoMCNccbar->Fill(nccbar);
4347  }
4348 
4349  for(Int_t i=0;i<nmcpart;i++)
4350  {
4351  AliAODMCParticle *mcpart = (AliAODMCParticle*) mcArray->At(i);
4352  if(TMath::Abs(mcpart->GetPdgCode())==4132){
4353  Bool_t e_flag = kFALSE;
4354  Bool_t xi_flag = kFALSE;
4355  AliAODMCParticle *mcepart = 0;
4356  AliAODMCParticle *mccascpart = 0;
4357  for(Int_t idau=mcpart->GetFirstDaughter();idau<mcpart->GetLastDaughter()+1;idau++)
4358  {
4359  if(idau<0) break;
4360  AliAODMCParticle *mcdau = (AliAODMCParticle*) mcArray->At(idau);
4361  if(!mcdau) continue;
4362  if(TMath::Abs(mcdau->GetPdgCode())==11){
4363  e_flag = kTRUE;
4364  mcepart = mcdau;
4365  }
4366  if(TMath::Abs(mcdau->GetPdgCode())==3312){
4367  xi_flag = kTRUE;
4368  mccascpart = mcdau;
4369  }
4370  }
4371 
4372  Int_t decaytype = -9999;
4373  if(e_flag && xi_flag) decaytype = 0;
4374 
4375  if(e_flag&&xi_flag)
4376  fHistoMCXic0Decays->Fill(1);
4377  if(!e_flag&&xi_flag)
4378  fHistoMCXic0Decays->Fill(2);
4379  if(e_flag&&!xi_flag)
4380  fHistoMCXic0Decays->Fill(3);
4381  if(!e_flag&&!xi_flag)
4382  fHistoMCXic0Decays->Fill(4);
4383 
4384  FillMCROOTObjects(mcpart,mcepart,mccascpart,decaytype);
4385  }
4386  if(TMath::Abs(mcpart->GetPdgCode())==11 && mcpart->GetStatus()==1){
4387  AliESDtrackCuts *esdcuts = fAnalCuts->GetTrackCuts();
4388  Float_t etamin, etamax;
4389  esdcuts->GetEtaRange(etamin,etamax);
4390  if(fabs(mcpart->Eta())<etamax){
4391  Bool_t gamma_flag = kFALSE;
4392  Int_t labmother = mcpart->GetMother();
4393  if(labmother>=0){
4394  AliAODMCParticle *mcmother = (AliAODMCParticle*) mcArray->At(labmother);
4395  Int_t pdgmother = mcmother->GetPdgCode();
4396  if(TMath::Abs(pdgmother)==22) gamma_flag = kTRUE;
4397  }
4398  if(!gamma_flag) fHistoBachPtMCGen->Fill(mcpart->Pt());
4399  }
4400  FillMCEleROOTObjects(mcpart, mcArray);
4401  }
4402  if(TMath::Abs(mcpart->GetPdgCode())==3312){
4403  Double_t etamin, etamax, rapmin, rapmax;
4404  fAnalCuts->GetProdCascEtaRange(etamin,etamax);
4405  fAnalCuts->GetProdCascRapRange(rapmin,rapmax);
4406 
4407  if((fabs(mcpart->Y())<rapmax) && (fabs(mcpart->Eta())<etamax)){
4408  fHistoXiMassvsPtMCGen->Fill(1.32171, mcpart->Pt());
4409  }
4410  FillMCCascROOTObjects(mcpart, mcArray);
4411  }
4412 
4413  if(TMath::Abs(mcpart->GetPdgCode())==111){
4414  if(fabs(mcpart->Y())<0.5){
4415  fHistoPi0MCGen->Fill(mcpart->Pt());
4416  }
4417  }
4418  if(TMath::Abs(mcpart->GetPdgCode())==221){
4419  if(fabs(mcpart->Y())<0.5){
4420  fHistoEtaMCGen->Fill(mcpart->Pt());
4421  }
4422  }
4423  }
4424 
4425  if(fMCDoPairAnalysis)
4426  {
4427  for(Int_t i=0;i<nmcpart;i++)
4428  {
4429  AliAODMCParticle *mcparte = (AliAODMCParticle*) mcArray->At(i);
4430  if(!mcparte) continue;
4431  if(TMath::Abs(mcparte->GetPdgCode())!=11) continue;
4432  if(mcparte->GetStatus()!=1) continue;
4433  if(mcparte->Pt()<0.4) continue;//Apply rough cuts
4434  if(fabs(mcparte->Eta())>0.8) continue;//Apply rough cuts
4435  for(Int_t j=0;j<nmcpart;j++)
4436  {
4437  AliAODMCParticle *mcpartv = (AliAODMCParticle*) mcArray->At(j);
4438  if(!mcpartv) continue;
4439  if(TMath::Abs(mcpartv->GetPdgCode())!=3312) continue;
4440  if(mcpartv->Pt()<0.4) continue;//Apply rough cuts
4441  if(fabs(mcpartv->Eta())>0.8) continue;//Apply rough cuts
4442  if(mcpartv->GetNDaughters()!=2) continue;//Apply rough cuts
4443 
4444  FillMCGenPairROOTObjects(mcparte,mcpartv,mcArray);
4445  }
4446  }
4447  return kFALSE;
4448  }
4449 
4450  return kTRUE;
4451 }
4452 
4455 {
4456  //
4457  // Define mc pair tree variables
4458  //
4459 
4460  const char* nameoutput = GetOutputSlot(11)->GetContainer()->GetName();
4461  fMCGenPairVariablesTree = new TTree(nameoutput,"MC pair variables tree");
4462  Int_t nVar = 38;
4463  fCandidateMCGenPairVariables = new Float_t [nVar];
4464  TString * fCandidateVariableNames = new TString[nVar];
4465 
4466  fCandidateVariableNames[ 0] = "InvMassEleXi";
4467  fCandidateVariableNames[ 1] = "EleXiPx";
4468  fCandidateVariableNames[ 2] = "EleXiPy";
4469  fCandidateVariableNames[ 3] = "EleXiPz";
4470  fCandidateVariableNames[ 4] = "ElePdgCode";
4471  fCandidateVariableNames[ 5] = "ElePx";
4472  fCandidateVariableNames[ 6] = "ElePy";
4473  fCandidateVariableNames[ 7] = "ElePz";
4474  fCandidateVariableNames[ 8] = "XiPdgCode";
4475  fCandidateVariableNames[ 9] = "XiPx";
4476  fCandidateVariableNames[10] = "XiPy";
4477  fCandidateVariableNames[11] = "XiPz";
4478  fCandidateVariableNames[12] = "SameFlag";
4479  fCandidateVariableNames[13] = "EleNGeneration";
4480  fCandidateVariableNames[14] = "EleGen1PDG";
4481  fCandidateVariableNames[15] = "EleGen2PDG";
4482  fCandidateVariableNames[16] = "EleGen3PDG";
4483  fCandidateVariableNames[17] = "EleGen4PDG";
4484  fCandidateVariableNames[18] = "EleGen5PDG";
4485  fCandidateVariableNames[19] = "EleGen6PDG";
4486  fCandidateVariableNames[20] = "EleGen7PDG";
4487  fCandidateVariableNames[21] = "EleGen8PDG";
4488  fCandidateVariableNames[22] = "EleGen9PDG";
4489  fCandidateVariableNames[23] = "EleGen10PDG";
4490  fCandidateVariableNames[24] = "ElePrimPDG";
4491  fCandidateVariableNames[25] = "XiNGeneration";
4492  fCandidateVariableNames[26] = "XiGen1PDG";
4493  fCandidateVariableNames[27] = "XiGen2PDG";
4494  fCandidateVariableNames[28] = "XiGen3PDG";
4495  fCandidateVariableNames[29] = "XiGen4PDG";
4496  fCandidateVariableNames[30] = "XiGen5PDG";
4497  fCandidateVariableNames[31] = "XiGen6PDG";
4498  fCandidateVariableNames[32] = "XiGen7PDG";
4499  fCandidateVariableNames[33] = "XiGen8PDG";
4500  fCandidateVariableNames[34] = "XiGen9PDG";
4501  fCandidateVariableNames[35] = "XiGen10PDG";
4502  fCandidateVariableNames[36] = "XiPrimPDG";
4503  fCandidateVariableNames[37] = "MatchedPDG";
4504 
4505  for (Int_t ivar=0; ivar<nVar; ivar++) {
4506  fMCGenPairVariablesTree->Branch(fCandidateVariableNames[ivar].Data(),&fCandidateMCGenPairVariables[ivar],Form("%s/f",fCandidateVariableNames[ivar].Data()));
4507  }
4508  return;
4509 }
4510 
4512 void AliAnalysisTaskSEXic2eleXifromAODtracks::FillMCGenPairROOTObjects(AliAODMCParticle *mcparte, AliAODMCParticle *mcpartv, TClonesArray *mcArray)
4513 {
4514  //
4515  // Fill histograms or mc pair analysis tree
4516  //
4517  for(Int_t i=0;i<38;i++){
4518  fCandidateMCGenPairVariables[i] = -9999.;
4519  }
4520 
4521  TLorentzVector vele, vxi, vexi;
4522  vele.SetXYZM(mcparte->Px(),mcparte->Py(),mcparte->Pz(),0.000510998928);
4523  vxi.SetXYZM(mcpartv->Px(),mcpartv->Py(),mcpartv->Pz(),1.32171);
4524  vexi = vele + vxi;
4525 
4526  Int_t pdgarray_ele[100], labelarray_ele[100], ngen_ele;
4527  Int_t pdgarray_xi[100], labelarray_xi[100], ngen_xi;
4528  GetMCDecayHistory(mcparte,mcArray,pdgarray_ele,labelarray_ele,ngen_ele);
4529  GetMCDecayHistory(mcpartv,mcArray,pdgarray_xi,labelarray_xi,ngen_xi);
4530 
4531  Bool_t same_flag = kFALSE;
4532  Int_t matched_pdg = -999999;
4533  for(Int_t iemc=0;iemc<ngen_ele;iemc++){
4534  for(Int_t ivmc=0;ivmc<ngen_xi;ivmc++){
4535  if(labelarray_ele[iemc]==labelarray_xi[ivmc]){
4536  same_flag = kTRUE;
4537  matched_pdg = pdgarray_ele[iemc];
4538  break;
4539  }
4540  }
4541  if(same_flag) break;
4542  }
4543  Int_t pdgprim_ele = pdgarray_ele[ngen_ele-1];
4544  Int_t pdgprim_xi = pdgarray_xi[ngen_xi-1];
4545 
4546  fCandidateMCGenPairVariables[ 0] = vexi.M();
4547  fCandidateMCGenPairVariables[ 1] = vexi.Px();
4548  fCandidateMCGenPairVariables[ 2] = vexi.Py();
4549  fCandidateMCGenPairVariables[ 3] = vexi.Pz();
4550  fCandidateMCGenPairVariables[ 4] = mcparte->GetPdgCode();
4551  fCandidateMCGenPairVariables[ 5] = vele.Px();
4552  fCandidateMCGenPairVariables[ 6] = vele.Py();
4553  fCandidateMCGenPairVariables[ 7] = vele.Pz();
4554  fCandidateMCGenPairVariables[ 8] = mcpartv->GetPdgCode();
4555  fCandidateMCGenPairVariables[ 9] = vxi.Px();
4556  fCandidateMCGenPairVariables[10] = vxi.Py();
4557  fCandidateMCGenPairVariables[11] = vxi.Pz();
4558  fCandidateMCGenPairVariables[12] = (Float_t)same_flag;
4559  fCandidateMCGenPairVariables[13] = (Float_t)ngen_ele;
4560  fCandidateMCGenPairVariables[14] = (Float_t)pdgarray_ele[0];
4561  fCandidateMCGenPairVariables[15] = (Float_t)pdgarray_ele[1];
4562  fCandidateMCGenPairVariables[16] = (Float_t)pdgarray_ele[2];
4563  fCandidateMCGenPairVariables[17] = (Float_t)pdgarray_ele[3];
4564  fCandidateMCGenPairVariables[18] = (Float_t)pdgarray_ele[4];
4565  fCandidateMCGenPairVariables[19] = (Float_t)pdgarray_ele[5];
4566  fCandidateMCGenPairVariables[20] = (Float_t)pdgarray_ele[6];
4567  fCandidateMCGenPairVariables[21] = (Float_t)pdgarray_ele[7];
4568  fCandidateMCGenPairVariables[22] = (Float_t)pdgarray_ele[8];
4569  fCandidateMCGenPairVariables[23] = (Float_t)pdgarray_ele[9];
4570  fCandidateMCGenPairVariables[24] = (Float_t)pdgarray_ele[ngen_ele-1];
4571  fCandidateMCGenPairVariables[25] = (Float_t)ngen_xi;
4572  fCandidateMCGenPairVariables[26] = (Float_t)pdgarray_xi[0];
4573  fCandidateMCGenPairVariables[27] = (Float_t)pdgarray_xi[1];
4574  fCandidateMCGenPairVariables[28] = (Float_t)pdgarray_xi[2];
4575  fCandidateMCGenPairVariables[29] = (Float_t)pdgarray_xi[3];
4576  fCandidateMCGenPairVariables[30] = (Float_t)pdgarray_xi[4];
4577  fCandidateMCGenPairVariables[31] = (Float_t)pdgarray_xi[5];
4578  fCandidateMCGenPairVariables[32] = (Float_t)pdgarray_xi[6];
4579  fCandidateMCGenPairVariables[33] = (Float_t)pdgarray_xi[7];
4580  fCandidateMCGenPairVariables[34] = (Float_t)pdgarray_xi[8];
4581  fCandidateMCGenPairVariables[35] = (Float_t)pdgarray_xi[9];
4582  fCandidateMCGenPairVariables[36] = (Float_t)pdgarray_xi[ngen_xi-1];
4583  fCandidateMCGenPairVariables[37] = (Float_t) matched_pdg;
4584 
4585  fMCGenPairVariablesTree->Fill();
4586 }
4587 
4590 {
4591  //
4592  // Define mc pair tree variables
4593  //
4594 
4595  const char* nameoutput = GetOutputSlot(12)->GetContainer()->GetName();
4596  fCorrelationVariablesTree = new TTree(nameoutput,"Correlation variables tree");
4597  Int_t nVar = 12;
4598  fCorrelationVariables = new Float_t [nVar];
4599  TString * fCandidateVariableNames = new TString[nVar];
4600 
4601  fCandidateVariableNames[0] = "XiPt";
4602  fCandidateVariableNames[1] = "ElePt";
4603  fCandidateVariableNames[2] = "DeltaPhi";
4604  fCandidateVariableNames[3] = "DeltaEta";
4605  fCandidateVariableNames[4] = "V0ProperDecayLength";
4606  fCandidateVariableNames[5] = "Eled0";
4607  fCandidateVariableNames[6] = "FGMixMC";
4608  fCandidateVariableNames[7] = "SignType";
4609  fCandidateVariableNames[8] = "Convtype";
4610  fCandidateVariableNames[9] = "MCType";
4611  fCandidateVariableNames[10] = "Centrality";
4612  fCandidateVariableNames[11] = "EleXiPt";
4613 
4614 
4615  for (Int_t ivar=0; ivar<nVar; ivar++) {
4616  fCorrelationVariablesTree->Branch(fCandidateVariableNames[ivar].Data(),&fCorrelationVariables[ivar],Form("%s/f",fCandidateVariableNames[ivar].Data()));
4617  }
4618  return;
4619 }
4620 
4622 void AliAnalysisTaskSEXic2eleXifromAODtracks::GetMCDecayHistory(AliAODMCParticle *mcpart, TClonesArray *mcArray, Int_t *pdgarray, Int_t *labelarray, Int_t &ngen)
4623 {
4624 //
4625 // MC decay history
4626 //
4627 
4628  for(Int_t i=0;i<100;i++){
4629  pdgarray[i] = -9999;
4630  labelarray[i] = -9999;
4631  }
4632  ngen = 0;
4633 
4634  AliAODMCParticle *mcprim = mcpart;
4635  while(mcprim->GetMother()>=0) {
4636  Int_t lab_prim=mcprim->GetMother();
4637 
4638  AliAODMCParticle *tmcprim = (AliAODMCParticle*)mcArray->At(lab_prim);
4639  if(!tmcprim) {
4640  break;
4641  }
4642  if((TMath::Abs(tmcprim->GetPdgCode())<10) || (TMath::Abs(tmcprim->GetPdgCode())==21)) break;
4643 
4644  mcprim = tmcprim;
4645 
4646  pdgarray[ngen] = mcprim->GetPdgCode();
4647  labelarray[ngen] = lab_prim;
4648 
4649  ngen ++;
4650  if(ngen == 100) break;
4651  }
4652 }
4653 //________________________________________________________________________
4655  //
4656  // Stores the pointer to the global track
4657  // copied from femtoscopy/k0analysis/plamanalysis
4658  //
4659 
4660  // Check that the id is positive
4661  if(track->GetID()<0){
4662  // printf("Warning: track has negative ID: %d\n",track->GetID());
4663  return;
4664  }
4665 
4666  // Check id is not too big for buffer
4667  if(track->GetID()>=fTrackBuffSize){
4668  printf("Warning: track ID too big for buffer: ID: %d, buffer %d\n"
4669  ,track->GetID(),fTrackBuffSize);
4670  return;
4671  }
4672 
4673  // Warn if we overwrite a track
4674  if(fGTI[track->GetID()]){
4675  // Seems like there are FilterMap 0 tracks
4676  // that have zero TPCNcls, don't store these!
4677  if( (!track->GetFilterMap()) &&
4678  (!track->GetTPCNcls()) )
4679  return;
4680 
4681  // Imagine the other way around,
4682  // the zero map zero clusters track
4683  // is stored and the good one wants
4684  // to be added. We ommit the warning
4685  // and just overwrite the 'bad' track
4686  if( fGTI[track->GetID()]->GetFilterMap() ||
4687  fGTI[track->GetID()]->GetTPCNcls() ){
4688  // If we come here, there's a problem
4689  printf("Warning! global track info already there!");
4690  printf(" TPCNcls track1 %u track2 %u",
4691  (fGTI[track->GetID()])->GetTPCNcls(),track->GetTPCNcls());
4692  printf(" FilterMap track1 %u track2 %u\n",
4693  (fGTI[track->GetID()])->GetFilterMap(),track->GetFilterMap());
4694  }
4695  } // Two tracks same id
4696 
4697  // // There are tracks with filter bit 0,
4698  // // do they have TPCNcls stored?
4699  // if(!track->GetFilterMap()){
4700  // printf("Filter map is zero, TPCNcls: %u\n"
4701  // ,track->GetTPCNcls());
4702  // }
4703 
4704  // Assign the pointer
4705  (fGTI[track->GetID()]) = track;
4706  (fGTIndex[track->GetID()]) = index;
4707 }
4708 //________________________________________________________________________
4710  // Sets all the pointers to zero. To be called at
4711  // the beginning or end of an event
4712  for(UShort_t i=0;i<fTrackBuffSize;i++){
4713  fGTI[i]=0;
4714  fGTIndex[i]=-9999;
4715  }
4716 }
4717 //________________________________________________________________________
4719  //
4720  // Check the mother
4721  //
4722  if(abs(history[1])==411) return 1;
4723  if(abs(history[1])==421) return 1;
4724  if(abs(history[1])==431) return 1;
4725  if(abs(history[1])==4122) return 1;
4726  if(abs(history[1])==4132) return 1;
4727  if(abs(history[1])==4232) return 1;
4728  if(abs(history[1])==4332) return 1;
4729 
4730  if(abs(history[1])==511) return 2;
4731  if(abs(history[1])==521) return 2;
4732  if(abs(history[1])==531) return 2;
4733  if(abs(history[1])==5122) return 2;
4734  if(abs(history[1])==5132) return 2;
4735  if(abs(history[1])==5232) return 2;
4736  if(abs(history[1])==5332) return 2;
4737 
4738  return 0;
4739 }
4740 //________________________________________________________________________
4742  //
4743  // Check if the particle is from charm hadrons
4744  //
4745  for(Int_t ih=0;ih<10;ih++){
4746  if(abs(history[ih])==411) return kTRUE;
4747  if(abs(history[ih])==421) return kTRUE;
4748  if(abs(history[ih])==431) return kTRUE;
4749  if(abs(history[ih])==4122) return kTRUE;
4750  if(abs(history[ih])==4132) return kTRUE;
4751  if(abs(history[ih])==4232) return kTRUE;
4752  if(abs(history[ih])==4332) return kTRUE;
4753  }
4754  return kFALSE;
4755 }
4756 //________________________________________________________________________
4758  //
4759  // Check if the particle is from Bottom hadrons
4760  //
4761  for(Int_t ih=0;ih<10;ih++){
4762  if(abs(history[ih])==511) return kTRUE;
4763  if(abs(history[ih])==521) return kTRUE;
4764  if(abs(history[ih])==531) return kTRUE;
4765  if(abs(history[ih])==5122) return kTRUE;
4766  if(abs(history[ih])==5132) return kTRUE;
4767  if(abs(history[ih])==5232) return kTRUE;
4768  if(abs(history[ih])==5332) return kTRUE;
4769  }
4770  return kFALSE;
4771 }
Int_t charge
THnSparse * fHistoEleXiMassvsElePtWS2
! e-Xi mass spectra (wrong-sign)
Int_t pdg
ClassImp(AliAnalysisTaskTriggerRates) AliAnalysisTaskTriggerRates
TH2F * fHistoLambdaPtvsDl
! Lambda proper life time distribution
THnSparse * fHistoElePtvsXiPtMCGen
! e-Xi spectra efficiency denominator
THnSparse * fHistoEleXiMassBFeeddownMCS1
! e-Xi mass spectra (Efficiency numerator)
Bool_t IsEventRejectedDueToNotRecoVertex() const
Definition: AliRDHFCuts.h:299
Bool_t SingleCascadeCuts(AliAODcascade *casc, Double_t *vert)
THnSparse * fHistoEleXiMassRSMixAway
! e-Xi mass spectra (right-sign)
Bool_t fMCDoPairAnalysis
MC eventtype to analyze 1: ccbar 2: bbbar.
Double_t dEtaSR125(Double_t *postrack1, Double_t *postrack2)
TH1F * fHistoBachPtMCGen
! Bachelor pT histogram (efficiency denominator)
TH2D * fHistoResponseEleXiPt
! Response function e-Xi pT <- XicPt
THnSparse * fHistoElePtvsd0RS
! e pt-d0 spectra (right-sign)
THnSparse * fHistoEleXiMassWSMix2
! e-Xi mass spectra (wrong-sign)
TH2F * fHistoElectronTPCPIDSelTOFEtaDep[8]
! TPC electron PID after TOF 3 sigma cut Eta dep
Float_t * fCorrelationVariables
! Correlation variables to be written to the tree
THnSparse * fHistoEleXiMassWSSideAway
! e-Xi mass spectra (wrong-sign)
THnSparse * fHistoEleXiMassRSMix1
! e-Xi mass spectra (right-sign)
Bool_t fWriteMCVariableTree
flag to decide whether to write the candidate variables on a tree variables
Int_t MatchToMCCascade(AliAODcascade *theCascade, Int_t pdgabscasc, Int_t *pdgDgcasc, Int_t *pdgDgv0, TClonesArray *mcArray) const
Float_t * fCandidateCascVariables
! variables to be written to the tree
THnSparse * fHistoEleXiMassvsElePtRSSide1
! e-Xi mass-ept spectra (right-sign)
THnSparse * fHistoEleXiMassRSAway
! e-Xi mass spectra (right-sign)
TH2F * fHistoLambdaPtvsDR
! Lambda decay length distribution
THnSparse * fHistoEleXiMassRSMix2
! e-Xi mass spectra (right-sign)
THnSparse * fHistoElePtvsXiPtRSMix
! e-Xi spectra (right-sign, mix)
THnSparse * fHistoEleXiMassMCS2
! e-Xi mass spectra (Efficiency numerator)
TH2D * fHistodPhiSdEtaSElectronProtonR125RSMix
! dPhiS vs dEtaS R125 RS Mix
Float_t * fCandidateMCVariables
! variables to be written to the tree
THnSparse * fHistoCharmElectronMCGen
! electron in mcArray (only from charmed baryon)
void SelectTrack(const AliVEvent *event, Int_t trkEntries, Int_t &nSeleTrks, Bool_t *seleFlags, TClonesArray *mcArray)
THnSparse * fHistoElePtvsCutVarsRS[23]
! e pt- cut variables (Right-sign)
THnSparse * fHistoEleXiMassRSSideAway
! e-Xi mass spectra (right-sign)
void FillMCEleROOTObjects(AliAODMCParticle *mcepart, TClonesArray *mcArray)
TList * fOutputAll
! User Output slot 3 //analysis histograms
THnSparse * fHistoElePtvsd0MCS
! e pt-d0 spectra (right-sign)
TH2F * fHistoLambdaPtvsDRMCS
! Lambda decay length distribution (mc)
THnSparse * fHistoEleXiMassvsElePtRS2
! e-Xi mass spectra (right-sign)
THnSparse * fHistoElePtvsd0PromptMCS
! e pt-d0 spectra (right-sign)
TH2D * fHistodPhiSdEtaSElectronBachelorR125WSMix
! dPhiS vs dEtaS R125 WS Mix
THnSparse * fHistoElePtvsXiPtvsXicPtMCS
! e-Xi spectra efficiency numerator
THnSparse * fHistoEleXiMassWSSide
! e-Xi mass spectra (wrong-sign)
TTree * fMCCascVariablesTree
! tree of the candidate variables after track selection on output slot 4
const Float_t * GetCuts() const
Definition: AliRDHFCuts.h:238
void FillROOTObjects(AliAODRecoCascadeHF *elobj, AliAODcascade *casc, AliAODTrack *trk, AliAODTrack *trkpid, AliAODEvent *event, TClonesArray *mcArray)
THnSparse * fHistoEleXiMassWSMixAway
! e-Xi mass spectra (wrong-sign)
THnSparse * fHistoEleXiMassvsElePtMCGen
! e-Xi mass-ept spectra (Efficiency denominator)
THnSparse * fHistoElectronMCGen
! electron in mcArray (only from charmed baryon)
THnSparse * fHistoEleXiMassvsElePtRS
! e-Xi mass spectra (right-sign)
THnSparse * fHistoEleXiMassvsElePtMCS1
! e-Xi mass-ept spectra (Efficiency numerator)
TH2D * fHistodPhiSdEtaSElectronPionR125RSMix
! dPhiS vs dEtaS R125 RS Mix
THnSparse * fHistoEleXiMassRS
! e-Xi mass spectra (right-sign)
THnSparse * fHistoElePtvsEtaWSMix
! e spectra (wrong-sign, mix)
Bool_t TagConversionsSameSign(AliAODTrack *etrk, Int_t *id2index, AliAODEvent *evt, Int_t ntrk, Double_t &minmass)
THnSparse * fHistoEleXiMassvsElePtRSMix2
! e-Xi mass-ept spectra (right-sign)
Int_t MatchToMC(AliAODRecoCascadeHF *elobj, TClonesArray *mcArray, Int_t *pdgarray_ele, Int_t *pdgarray_casc, Int_t *labelarray_ele, Int_t *labelarray_casc, Int_t &ngen_ele, Int_t &ngen_casc)
THnSparse * fHistoElePtvsXiPtWSMix
! e-Xi spectra (wrong-sign, mix)
TTree * fCascVariablesTree
! tree of the candidate variables after track selection on output slot 4
THnSparse * fHistoEleXiMassvsElePtWSMix2
! e-Xi mass-ept spectra (wrong-sign)
virtual void UserCreateOutputObjects()
Implementation of interface methods.
THnSparse * fHistoElectronEtaTotal
! Number of electrons from eta
THnSparse * fHistoElePtvsd0WS
! e pt-d0 spectra (wrong-sign)
Float_t * fCandidateEleVariables
! variables to be written to the tree
Bool_t TagConversions(AliAODTrack *etrk, Int_t *id2index, AliAODEvent *evt, Int_t ntrk, Double_t &minmass)
TTree * fMCEleVariablesTree
! tree of the candidate variables after track selection on output slot 4
Double_t GetMaxVtxZ() const
Definition: AliRDHFCuts.h:241
THnSparse * fHistoElectronPi0Total
! Number of electrons from pi0
THnSparse * fHistoEleXiMassvsElePtWSSide
! e-Xi mass-ept spectra (wrong-sign)
TObjArray * fCascadeCutVarsArray2
array of RDHF cut information
void FillMCROOTObjects(AliAODMCParticle *part, AliAODMCParticle *mcepart, AliAODMCParticle *mcv0part, Int_t decaytype)
THnSparse * fHistoEleXiMassPromptMCS1
! e-Xi mass spectra (Efficiency numerator)
THnSparse * fHistoElePtvsEtaMCGen
! e spectra efficiency denominator
THnSparse * fHistoEleXiMassMCGen
! e-Xi mass spectra (Efficiency denominator)
AliAODPidHF * GetPidHF() const
Definition: AliRDHFCuts.h:231
THnSparse * fHistoElePtvsEtaMCS
! e spectra efficiency numerator
TTree * fMCVariablesTree
! tree of the candidate variables after track selection on output slot 4
THnSparse * fHistoEleXiMassWS
! e-Xi mass spectra (wrong-sign)
THnSparse * fHistoElePtvsXiPtMCS
! e-Xi spectra efficiency numerator
TH2F * fHistoElectronTOFPIDSelTPC
! TOF electron PID after TPC cut
THnSparse * fHistoElePtvsCutVarsWS[23]
! e pt- cut variables (Wrong-sign)
THnSparse * fHistoEleXiMassXibMCS2
! e-Xi mass spectra (Efficiency numerator)
const Double_t etamin
TH2D * fHistodPhiSdEtaSElectronProtonR125WSMix
! dPhiS vs dEtaS R125 WS Mix
THnSparse * fHistoEleXiMassPromptMCS
! e-Xi mass spectra (Efficiency numerator)
TH1F * fHistoBachPtMCS
! Bachelor pT histogram (efficiency numerator)
void MakeAnalysis(AliAODEvent *aod, TClonesArray *mcArray)
AliAODVertex * PrimaryVertex(const TObjArray *trkArray, AliVEvent *event)
THnSparse * fHistoEleXiMassRSSide2
! e-Xi mass spectra (right-sign)
TH2F * fHistoLambdaPtvsDlMCS
! Lambda proper life time distribution (mc)
THnSparse * fHistoEleXiMassvsElePtMCS
! e-Xi mass-ept spectra (Efficiency numerator)
THnSparse * fHistoEleXiMassvsElePtMCS2
! e-Xi mass-ept spectra (Efficiency numerator)
void FillMCCascROOTObjects(AliAODMCParticle *mccpart, TClonesArray *mcArray)
void FillMCGenPairROOTObjects(AliAODMCParticle *mcparte, AliAODMCParticle *mcpartv, TClonesArray *mcArray)
THnSparse * fHistoElePtvsCutVarsMCS[23]
! e pt- cut variables (MCS)
THnSparse * fHistoXiMCGen
! Xi in mcArray (only from charmed baryon)
THnSparse * fHistoBottomElectronMCGen
! electron in mcArray (only from charmed baryon)
THnSparse * fHistoElePtvsXiPtRS
! e-Xi spectra (right-sign)
const UShort_t fTrackBuffSize
Array of integers to keep the index of tpc only track.
THnSparse * fHistoEleXiMassvsElePtRSMix1
! e-Xi mass-ept spectra (right-sign)
THnSparse * fHistoEleXiMassvsElePtWSMix1
! e-Xi mass-ept spectra (wrong-sign)
THnSparse * fHistoEleXiMassvsElePtMCGen1
! e-Xi mass-ept spectra (Efficiency denominator)
TH2F * fHistoElePtMCS
! e spectra (Efficiency numerator)
THnSparse * fHistoEleXiMassWSMix1Away
! e-Xi mass spectra (wrong-sign)
void SetSftPosR125(AliAODTrack *track, Double_t bfield, Double_t priVtx[3], Double_t *XSftR125)
virtual Int_t IsSelected(TObject *obj, Int_t selectionLevel)
TH2F * fHistoElectronTOFSelPID
! TOF electron PID after selection
Float_t * fCandidateMCCascVariables
! variables to be written to the tree
Float_t * fCandidateMCGenPairVariables
! variables to be written to the tree
AliAODTrack * GetBachelor() const
Float_t * fCandidateMCEleVariables
! variables to be written to the tree
THnSparse * fHistoEleXiMassMCS
! e-Xi mass spectra (Efficiency numerator)
TObjArray * fCascadeTracks2
array of xi+compatible tracks
TTree * fEleVariablesTree
flag to decide whether to write the candidate variables on a tree variables
AliESDtrackCuts * GetTrackCuts() const
Definition: AliRDHFCuts.h:246
TObjArray * fElectronTracks
unique event id for mixed event check
TH1F * fCEvents
! Histogram to check selected events
void SetProngIDs(Int_t nIDs, UShort_t *id)
TH2F * fHistoElectronTPCPIDSelTOFSmallEta
! TPC electron PID after TOF 3 sigma cut (|eta|<0.6)
THnSparse * fHistoEleXiMassPromptMCS2
! e-Xi mass spectra (Efficiency numerator)
THnSparse * fHistoElePtvsd0WSMix
! e pt-d0 spectra (wrong-sign, mix)
TH2F * fHistoElectronTPCPIDSelTOF
! TPC electron PID after TOF 3 sigma cut
AliPIDResponse * GetPidResponse() const
Definition: AliAODPidHF.h:160
TObjArray * fCascadeCutVarsArray1
array of RDHF cut information
THnSparse * fHistoEleXiMassvsElePtWSSide2
! e-Xi mass-ept spectra (wrong-sign)
TH2D * fHistoResponseXiPt
! Response function Lambda pT <- True ept
AliNormalizationCounter * fCounter
! Counter for normalization
Int_t fNzVtxBins
maximum number of events to be used in event mixing
THnSparse * fHistoEleXiMassWSAway
! e-Xi mass spectra (wrong-sign)
TObjArray * fCascadeTracks1
array of e-compatible tracks
Bool_t Data(TH1F *h, Double_t *rangefit, Bool_t writefit, Double_t &sgn, Double_t &errsgn, Double_t &bkg, Double_t &errbkg, Double_t &sgnf, Double_t &errsgnf, Double_t &sigmafit, Int_t &status)
THnSparse * fHistoEleXiMassRSSide
! e-Xi mass spectra (right-sign)
Bool_t IsEventRejectedDuePhysicsSelection() const
Definition: AliRDHFCuts.h:320
THnSparse * fHistoElectronEtaTag
! Number of electrons from eta and have partner
void SetOwnPrimaryVtx(const AliAODVertex *vtx)
AliAODcascade * GetCascade() const
THnSparse * fHistoEleXiMassXibMCS
! e-Xi mass spectra (Efficiency numerator)
TH2F * fHistoElePtMCGen
! e spectra (Efficiency denominator)
THnSparse * fHistoEleXiMassvsElePtMCGen2
! e-Xi mass-ept spectra (Efficiency denominator)
THnSparse * fHistoElePtvsd0RSMix
! e pt-d0 spectra (right-sign, mix)
THnSparse * fHistoEleXiMassRS2
! e-Xi mass spectra (right-sign)
void FillCascROOTObjects(AliAODcascade *casc, TClonesArray *mcArray)
Bool_t IsEventSelected(AliVEvent *event)
THnSparse * fHistoEleXiMassWSMix1
! e-Xi mass spectra (wrong-sign)
THnSparse * fHistoElePtvsXiPtWS
! e-Xi spectra (wrong-sign)
void StoreEvent(AliVEvent *, AliRDHFCuts *, Bool_t mc=kFALSE, Int_t multiplicity=-9999, Double_t spherocity=-99.)
AliAODVertex * ReconstructSecondaryVertex(AliAODcascade *casc, AliAODTrack *trk, AliAODEvent *aod)