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