AliPhysics  f2694b8 (f2694b8)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
AliAnalysisTaskSELc2eleLambdafromAODtracks.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 // Lc->e Lambda analysis code
21 //
22 // Input: AOD
23 // Output: TTree and/or THnSparse (mass vs pT vs Centrality)
24 //
25 // Cuts:
26 // TTree: SingleCuts on V0 and electron
27 // THnSparse: In addition to that, IsSelected(obj, kCandidate) applied
28 //
29 //-------------------------------------------------------------------------
30 //
31 // Authors: Y.S Watanabe(a)
32 // (a) CNS, the University of Tokyo
33 // Contatcs: wyosuke@cns.s.u-tokyo.ac.jp
34 //-------------------------------------------------------------------------
35 
36 #include <TSystem.h>
37 #include <TParticle.h>
38 #include <TParticlePDG.h>
39 #include <TH1F.h>
40 #include <TH1F.h>
41 #include <TH2F.h>
42 #include <THnSparse.h>
43 #include <TLorentzVector.h>
44 #include <TTree.h>
45 #include "TROOT.h"
46 #include <TDatabasePDG.h>
47 #include <AliAnalysisDataSlot.h>
48 #include <AliAnalysisDataContainer.h>
49 #include "AliStack.h"
50 #include "AliMCEvent.h"
51 #include "AliAnalysisManager.h"
52 #include "AliAODMCHeader.h"
53 #include "AliAODHandler.h"
54 #include "AliLog.h"
55 #include "AliExternalTrackParam.h"
56 #include "AliAODVertex.h"
57 #include "AliESDVertex.h"
58 #include "AliAODRecoDecay.h"
59 #include "AliAODRecoDecayHF.h"
60 #include "AliAODRecoCascadeHF.h"
61 #include "AliESDtrack.h"
62 #include "AliAODTrack.h"
63 #include "AliAODv0.h"
64 #include "AliAODcascade.h"
65 #include "AliAODMCParticle.h"
66 #include "AliAnalysisTaskSE.h"
68 #include "AliPIDResponse.h"
69 #include "AliPIDCombined.h"
70 #include "AliTOFPIDResponse.h"
71 #include "AliAODPidHF.h"
72 #include "AliInputEventHandler.h"
73 #include "AliESDtrackCuts.h"
74 #include "AliNeutralTrackParam.h"
75 #include "AliKFParticle.h"
76 #include "AliKFVertex.h"
77 #include "AliExternalTrackParam.h"
78 #include "AliESDtrack.h"
79 #include "AliCentrality.h"
80 #include "AliVertexerTracks.h"
81 #include "AliEventPoolManager.h"
83 
84 using std::cout;
85 using std::endl;
86 
90 
91 //__________________________________________________________________________
93  AliAnalysisTaskSE(),
94  fUseMCInfo(kFALSE),
95  fOutput(0),
96  fOutputAll(0),
97  fListCuts(0),
98  fCEvents(0),
99  fHTrigger(0),
100  fHCentrality(0),
101  fAnalCuts(0),
102  fIsEventSelected(kFALSE),
103  fWriteVariableTree(kFALSE),
104  fWriteEachVariableTree(kFALSE),
105  fWriteMCVariableTree(kFALSE),
106  fVariablesTree(0),
107  fEleVariablesTree(0),
108  fV0VariablesTree(0),
109  fMCVariablesTree(0),
110  fMCEleVariablesTree(0),
111  fMCV0VariablesTree(0),
112  fMCGenPairVariablesTree(0),
113  fReconstructPrimVert(kFALSE),
114  fIsMB(kFALSE),
115  fIsSemi(kFALSE),
116  fIsCent(kFALSE),
117  fIsINT7(kFALSE),
118  fIsEMC7(kFALSE),
119  fCandidateVariables(),
120  fCandidateEleVariables(),
121  fCandidateV0Variables(),
122  fCandidateMCVariables(),
123  fCandidateMCEleVariables(),
124  fCandidateMCV0Variables(),
125  fCandidateMCGenPairVariables(),
126  fVtx1(0),
127  fV1(0),
128  fVtxZ(0),
129  fBzkG(0),
130  fCentrality(0),
131  fRunNumber(0),
132  fTriggerCheck(0),
133  fUseCentralityV0M(kFALSE),
134  fEvNumberCounter(0),
135  fMCEventType(-9999),
136  fMCDoPairAnalysis(kFALSE),
137  fHistoEleLambdaMass(0),
138  fHistoEleLambdaMassRS(0),
139  fHistoEleLambdaMassRS1(0),
140  fHistoEleLambdaMassRS2(0),
141  fHistoEleLambdaMassWS(0),
142  fHistoEleLambdaMassWS1(0),
143  fHistoEleLambdaMassWS2(0),
144  fHistoEleLambdaMassRSMix(0),
145  fHistoEleLambdaMassRSMix1(0),
146  fHistoEleLambdaMassRSMix2(0),
147  fHistoEleLambdaMassWSMix(0),
148  fHistoEleLambdaMassWSMix1(0),
149  fHistoEleLambdaMassWSMix2(0),
150  fHistoEleLambdaMassRSSide(0),
151  fHistoEleLambdaMassRSSide1(0),
152  fHistoEleLambdaMassRSSide2(0),
153  fHistoEleLambdaMassWSSide(0),
154  fHistoEleLambdaMassWSSide1(0),
155  fHistoEleLambdaMassWSSide2(0),
156  fHistoEleLambdaMassRSAway(0),
157  fHistoEleLambdaMassRS1Away(0),
158  fHistoEleLambdaMassRS2Away(0),
159  fHistoEleLambdaMassWSAway(0),
160  fHistoEleLambdaMassWS1Away(0),
161  fHistoEleLambdaMassWS2Away(0),
162  fHistoEleLambdaMassRSMixAway(0),
163  fHistoEleLambdaMassRSMix1Away(0),
164  fHistoEleLambdaMassRSMix2Away(0),
165  fHistoEleLambdaMassWSMixAway(0),
166  fHistoEleLambdaMassWSMix1Away(0),
167  fHistoEleLambdaMassWSMix2Away(0),
168  fHistoEleLambdaMassRSSideAway(0),
169  fHistoEleLambdaMassRSSide1Away(0),
170  fHistoEleLambdaMassRSSide2Away(0),
171  fHistoEleLambdaMassWSSideAway(0),
172  fHistoEleLambdaMassWSSide1Away(0),
173  fHistoEleLambdaMassWSSide2Away(0),
174  fHistoEleLambdaMassvsElePtRS(0),
175  fHistoEleLambdaMassvsElePtWS(0),
176  fHistoEleLambdaMassvsElePtRSMix(0),
177  fHistoEleLambdaMassvsElePtWSMix(0),
178  fHistoEleLambdaMassvsElePtRSSide(0),
179  fHistoEleLambdaMassvsElePtWSSide(0),
180  fHistoEleLambdaMassvsElePtRS1(0),
181  fHistoEleLambdaMassvsElePtWS1(0),
182  fHistoEleLambdaMassvsElePtRSMix1(0),
183  fHistoEleLambdaMassvsElePtWSMix1(0),
184  fHistoEleLambdaMassvsElePtRSSide1(0),
185  fHistoEleLambdaMassvsElePtWSSide1(0),
186  fHistoEleLambdaMassvsElePtRS2(0),
187  fHistoEleLambdaMassvsElePtWS2(0),
188  fHistoEleLambdaMassvsElePtRSMix2(0),
189  fHistoEleLambdaMassvsElePtWSMix2(0),
190  fHistoEleLambdaMassvsElePtRSSide2(0),
191  fHistoEleLambdaMassvsElePtWSSide2(0),
192  fHistoElePtRS(0),
193  fHistoElePtWS(0),
194  fHistoElePtRSMix(0),
195  fHistoElePtWSMix(0),
196  fHistoEleLambdaMassMCS(0),
197  fHistoEleLambdaMassLambdabMCS(0),
198  fHistoEleLambdaMassXibMCS(0),
199  fHistoEleLambdaMassMCGen(0),
200  fHistoEleLambdaMassvsElePtMCS(0),
201  fHistoEleLambdaMassvsElePtMCGen(0),
202  fHistoEleLambdaMassvsElePtMCS1(0),
203  fHistoEleLambdaMassvsElePtMCGen1(0),
204  fHistoEleLambdaMassvsElePtMCS2(0),
205  fHistoEleLambdaMassvsElePtMCGen2(0),
206  fHistoElePtMCS(0),
207  fHistoElePtMCGen(0),
208  fHistoElePtvsEtaRS(0),
209  fHistoElePtvsEtaWS(0),
210  fHistoElePtvsEtaRSMix(0),
211  fHistoElePtvsEtaWSMix(0),
212  fHistoElePtvsEtaMCS(0),
213  fHistoElePtvsEtaMCGen(0),
214  fHistoElePtvsLambdaPtRS(0),
215  fHistoElePtvsLambdaPtWS(0),
216  fHistoElePtvsLambdaPtRSMix(0),
217  fHistoElePtvsLambdaPtWSMix(0),
218  fHistoElePtvsLambdaPtMCS(0),
219  fHistoElePtvsLambdaPtvsLcPtMCS(0),
220  fHistoElePtvsLambdaPtMCGen(0),
221  fHistoElePtvsLambdaPtvsLcPtMCGen(0),
222  fHistoElePtvsLambdaPtMCLcGen(0),
223  fHistoElePtvsd0RS(0),
224  fHistoElePtvsd0WS(0),
225  fHistoElePtvsd0RSMix(0),
226  fHistoElePtvsd0WSMix(0),
227  fHistoElePtvsd0MCS(0),
228  fHistoElePtvsd0PromptMCS(0),
229  fHistoElePtvsd0BFeeddownMCS(0),
230  fHistoEleLambdaMassFeeddownXic0MCS(0),
231  fHistoEleLambdaMassFeeddownXic0MCGen(0),
232  fHistoEleLambdaMassvsElePtFeeddownXic0MCS(0),
233  fHistoEleLambdaMassvsElePtFeeddownXic0MCGen(0),
234  fHistoEleLambdaMassvsElePtFeeddownXic0MCS1(0),
235  fHistoEleLambdaMassvsElePtFeeddownXic0MCGen1(0),
236  fHistoEleLambdaMassvsElePtFeeddownXic0MCS2(0),
237  fHistoEleLambdaMassvsElePtFeeddownXic0MCGen2(0),
238  fHistoElePtFeeddownXic0MCS(0),
239  fHistoElePtFeeddownXic0MCGen(0),
240  fHistoElePtvsEtaFeeddownXic0MCS(0),
241  fHistoElePtvsEtaFeeddownXic0MCGen(0),
242  fHistoElePtvsLambdaPtFeeddownXic0MCS(0),
243  fHistoElePtvsLambdaPtFeeddownXic0MCGen(0),
244  fHistoEleLambdaMassFeeddownXicPlusMCS(0),
245  fHistoEleLambdaMassFeeddownXicPlusMCGen(0),
246  fHistoEleLambdaMassvsElePtFeeddownXicPlusMCS(0),
247  fHistoEleLambdaMassvsElePtFeeddownXicPlusMCGen(0),
248  fHistoEleLambdaMassvsElePtFeeddownXicPlusMCS1(0),
249  fHistoEleLambdaMassvsElePtFeeddownXicPlusMCGen1(0),
250  fHistoEleLambdaMassvsElePtFeeddownXicPlusMCS2(0),
251  fHistoEleLambdaMassvsElePtFeeddownXicPlusMCGen2(0),
252  fHistoElePtFeeddownXicPlusMCS(0),
253  fHistoElePtFeeddownXicPlusMCGen(0),
254  fHistoElePtvsEtaFeeddownXicPlusMCS(0),
255  fHistoElePtvsEtaFeeddownXicPlusMCGen(0),
256  fHistoElePtvsLambdaPtFeeddownXicPlusMCS(0),
257  fHistoElePtvsLambdaPtFeeddownXicPlusMCGen(0),
258  fHistoBachPt(0),
259  fHistoBachPtMCS(0),
260  fHistoBachPtMCGen(0),
261  fHistod0Bach(0),
262  fHistoLambdaMassvsPt(0),
263  fHistoLambdaMassvsPtMCS(0),
264  fHistoLambdaMassvsPtMCGen(0),
265  fHistoLambdaPtvsEta(0),
266  fHistoLambdaPtvsEtaMCS(0),
267  fHistoLambdaPtvsEtaMCGen(0),
268  fHistoLambdaArmenteros(0),
269  fHistoLambdaArmenterosMCS(0),
270  fHistoLambdaPtvsDl(0),
271  fHistoLambdaPtvsDlSide(0),
272  fHistoLambdaPtvsDlMCS(0),
273  fHistoLambdaPtvsDlFeeddownXi0MCS(0),
274  fHistoLambdaPtvsDlFeeddownXiMinusMCS(0),
275  fHistoLambdaPtvsDlFeeddownOmegaMCS(0),
276  fHistoK0sMassvsPt(0),
277  fHistoElectronTPCPID(0),
278  fHistoElectronTOFPID(0),
279  fHistoElectronTPCSelPID(0),
280  fHistoElectronTOFSelPID(0),
281  fHistoElectronTPCPIDSelTOF(0),
282  fHistoElectronTPCPIDSelTOFSmallEta(0),
283  fHistoElectronTPCPIDSelTOFLargeEta(0),
284  fHistoMassConversionsMin(0),
285  fHistoMassConversionsSameSignMin(0),
286  fHistoElectronQovPtvsPhi(0),
287  fHistoLambdaQovPtvsPhi(0),
288  fHistoLcMCGen(0),
289  fHistoLcMCGen1(0),
290  fHistoLcMCGen2(0),
291  fHistoLcMCS(0),
292  fHistoLcMCS1(0),
293  fHistoLcMCS2(0),
294  fHistoFeedDownXic0MCGen(0),
295  fHistoFeedDownXic0MCGen1(0),
296  fHistoFeedDownXic0MCGen2(0),
297  fHistoFeedDownXic0MCS(0),
298  fHistoFeedDownXic0MCS1(0),
299  fHistoFeedDownXic0MCS2(0),
300  fHistoFeedDownXicPlusMCGen(0),
301  fHistoFeedDownXicPlusMCGen1(0),
302  fHistoFeedDownXicPlusMCGen2(0),
303  fHistoFeedDownXicPlusMCS(0),
304  fHistoFeedDownXicPlusMCS1(0),
305  fHistoFeedDownXicPlusMCS2(0),
306  fHistoFeedDownSigmaMCGen(0),
307  fHistoFeedDownSigmaMCGen1(0),
308  fHistoFeedDownSigmaMCGen2(0),
309  fHistoFeedDownSigmaMCS(0),
310  fHistoFeedDownSigmaMCS1(0),
311  fHistoFeedDownSigmaMCS2(0),
312  fHistoLcElectronMCGen(0),
313  fHistoLcElectronMCGen1(0),
314  fHistoLcElectronMCGen2(0),
315  fHistoLcElectronMCS(0),
316  fHistoLcElectronMCS1(0),
317  fHistoLcElectronMCS2(0),
318  fHistoElectronFeedDownXic0MCGen(0),
319  fHistoElectronFeedDownXic0MCGen1(0),
320  fHistoElectronFeedDownXic0MCGen2(0),
321  fHistoElectronFeedDownXic0MCS(0),
322  fHistoElectronFeedDownXic0MCS1(0),
323  fHistoElectronFeedDownXic0MCS2(0),
324  fHistoElectronFeedDownXicPlusMCGen(0),
325  fHistoElectronFeedDownXicPlusMCGen1(0),
326  fHistoElectronFeedDownXicPlusMCGen2(0),
327  fHistoElectronFeedDownXicPlusMCS(0),
328  fHistoElectronFeedDownXicPlusMCS1(0),
329  fHistoElectronFeedDownXicPlusMCS2(0),
330  fHistoElectronMCGen(0),
331  fHistoLambdaMCGen(0),
332  fHistoElePtvsV0dlRS(0),
333  fHistoElePtvsV0dlRS1(0),
334  fHistoElePtvsV0dlRS2(0),
335  fHistoElePtvsV0dlRSSide(0),
336  fHistoElePtvsV0dlRSSide1(0),
337  fHistoElePtvsV0dlRSSide2(0),
338  fHistoElePtvsV0dlRSMix(0),
339  fHistoElePtvsV0dlRSMix1(0),
340  fHistoElePtvsV0dlRSMix2(0),
341  fHistoElePtvsV0dlWS(0),
342  fHistoElePtvsV0dlWS1(0),
343  fHistoElePtvsV0dlWS2(0),
344  fHistoElePtvsV0dlWSSide(0),
345  fHistoElePtvsV0dlWSSide1(0),
346  fHistoElePtvsV0dlWSSide2(0),
347  fHistoElePtvsV0dlWSMix(0),
348  fHistoElePtvsV0dlWSMix1(0),
349  fHistoElePtvsV0dlWSMix2(0),
350  fHistoElePtvsV0dlMCS(0),
351  fHistoElePtvsV0dlMCS1(0),
352  fHistoElePtvsV0dlMCS2(0),
353  fHistoElePtvsV0dlFeedDownXic0MCS(0),
354  fHistoElePtvsV0dlFeedDownXic0MCS1(0),
355  fHistoElePtvsV0dlFeedDownXic0MCS2(0),
356  fHistoElePtvsV0dlFeedDownXicPlusMCS(0),
357  fHistoElePtvsV0dlFeedDownXicPlusMCS1(0),
358  fHistoElePtvsV0dlFeedDownXicPlusMCS2(0),
359  fHistoElePtvsV0dcaRS(0),
360  fHistoElePtvsV0dcaRS1(0),
361  fHistoElePtvsV0dcaRS2(0),
362  fHistoElePtvsV0dcaRSSide(0),
363  fHistoElePtvsV0dcaRSSide1(0),
364  fHistoElePtvsV0dcaRSSide2(0),
365  fHistoElePtvsV0dcaRSMix(0),
366  fHistoElePtvsV0dcaRSMix1(0),
367  fHistoElePtvsV0dcaRSMix2(0),
368  fHistoElePtvsV0dcaWS(0),
369  fHistoElePtvsV0dcaWS1(0),
370  fHistoElePtvsV0dcaWS2(0),
371  fHistoElePtvsV0dcaWSSide(0),
372  fHistoElePtvsV0dcaWSSide1(0),
373  fHistoElePtvsV0dcaWSSide2(0),
374  fHistoElePtvsV0dcaWSMix(0),
375  fHistoElePtvsV0dcaWSMix1(0),
376  fHistoElePtvsV0dcaWSMix2(0),
377  fHistoElePtvsV0dcaMCS(0),
378  fHistoElePtvsV0dcaMCS1(0),
379  fHistoElePtvsV0dcaMCS2(0),
380  fHistoElePtvsV0dcaFeedDownXic0MCS(0),
381  fHistoElePtvsV0dcaFeedDownXic0MCS1(0),
382  fHistoElePtvsV0dcaFeedDownXic0MCS2(0),
383  fHistoElePtvsV0dcaFeedDownXicPlusMCS(0),
384  fHistoElePtvsV0dcaFeedDownXicPlusMCS1(0),
385  fHistoElePtvsV0dcaFeedDownXicPlusMCS2(0),
386  fHistoEleLambdaPtvsV0dlRS(0),
387  fHistoEleLambdaPtvsV0dlRS1(0),
388  fHistoEleLambdaPtvsV0dlRS2(0),
389  fHistoEleLambdaPtvsV0dlRSSide(0),
390  fHistoEleLambdaPtvsV0dlRSSide1(0),
391  fHistoEleLambdaPtvsV0dlRSSide2(0),
392  fHistoEleLambdaPtvsV0dlRSMix(0),
393  fHistoEleLambdaPtvsV0dlRSMix1(0),
394  fHistoEleLambdaPtvsV0dlRSMix2(0),
395  fHistoEleLambdaPtvsV0dlWS(0),
396  fHistoEleLambdaPtvsV0dlWS1(0),
397  fHistoEleLambdaPtvsV0dlWS2(0),
398  fHistoEleLambdaPtvsV0dlWSSide(0),
399  fHistoEleLambdaPtvsV0dlWSSide1(0),
400  fHistoEleLambdaPtvsV0dlWSSide2(0),
401  fHistoEleLambdaPtvsV0dlWSMix(0),
402  fHistoEleLambdaPtvsV0dlWSMix1(0),
403  fHistoEleLambdaPtvsV0dlWSMix2(0),
404  fHistoEleLambdaPtvsV0dlMCS(0),
405  fHistoEleLambdaPtvsV0dlMCS1(0),
406  fHistoEleLambdaPtvsV0dlMCS2(0),
407  fHistoEleLambdaPtvsV0dlPromptMCS(0),
408  fHistoEleLambdaPtvsV0dlPromptMCS1(0),
409  fHistoEleLambdaPtvsV0dlPromptMCS2(0),
410  fHistoEleLambdaPtvsV0dlBFeeddownMCS(0),
411  fHistoEleLambdaPtvsV0dlBFeeddownMCS1(0),
412  fHistoEleLambdaPtvsV0dlBFeeddownMCS2(0),
413  fHistoEleLambdaPtvsV0dlFeedDownXic0MCS(0),
414  fHistoEleLambdaPtvsV0dlFeedDownXic0MCS1(0),
415  fHistoEleLambdaPtvsV0dlFeedDownXic0MCS2(0),
416  fHistoEleLambdaPtvsV0dlFeedDownXic0PromptMCS(0),
417  fHistoEleLambdaPtvsV0dlFeedDownXic0PromptMCS1(0),
418  fHistoEleLambdaPtvsV0dlFeedDownXic0PromptMCS2(0),
419  fHistoEleLambdaPtvsV0dlFeedDownXic0BFeeddownMCS(0),
420  fHistoEleLambdaPtvsV0dlFeedDownXic0BFeeddownMCS1(0),
421  fHistoEleLambdaPtvsV0dlFeedDownXic0BFeeddownMCS2(0),
422  fHistoEleLambdaPtvsV0dlFeedDownXicPlusMCS(0),
423  fHistoEleLambdaPtvsV0dlFeedDownXicPlusMCS1(0),
424  fHistoEleLambdaPtvsV0dlFeedDownXicPlusMCS2(0),
425  fHistoEleLambdaPtvsV0dlFeedDownXicPlusPromptMCS(0),
426  fHistoEleLambdaPtvsV0dlFeedDownXicPlusPromptMCS1(0),
427  fHistoEleLambdaPtvsV0dlFeedDownXicPlusPromptMCS2(0),
428  fHistoEleLambdaPtvsV0dlFeedDownXicPlusBFeeddownMCS(0),
429  fHistoEleLambdaPtvsV0dlFeedDownXicPlusBFeeddownMCS1(0),
430  fHistoEleLambdaPtvsV0dlFeedDownXicPlusBFeeddownMCS2(0),
431  fHistoEleLambdaPtvsV0dlFeedDownSigmaMCS(0),
432  fHistoEleLambdaPtvsV0dlFeedDownSigmaMCS1(0),
433  fHistoEleLambdaPtvsV0dlFeedDownSigmaMCS2(0),
434  fHistoEleLambdaPtvsV0dlFeedDownSigmaPromptMCS(0),
435  fHistoEleLambdaPtvsV0dlFeedDownSigmaPromptMCS1(0),
436  fHistoEleLambdaPtvsV0dlFeedDownSigmaPromptMCS2(0),
437  fHistoEleLambdaPtvsV0dlFeedDownSigmaBFeeddownMCS(0),
438  fHistoEleLambdaPtvsV0dlFeedDownSigmaBFeeddownMCS1(0),
439  fHistoEleLambdaPtvsV0dlFeedDownSigmaBFeeddownMCS2(0),
440  fHistoEleLambdaPtvsV0dlLambdabMCS(0),
441  fHistoEleLambdaPtvsV0dlLambdabMCS1(0),
442  fHistoEleLambdaPtvsV0dlLambdabMCS2(0),
443  fHistoEleLambdaPtvsV0dlXibMCS(0),
444  fHistoEleLambdaPtvsV0dlXibMCS1(0),
445  fHistoEleLambdaPtvsV0dlXibMCS2(0),
446  fHistoEleLambdaPtvsV0dlRSAway(0),
447  fHistoEleLambdaPtvsV0dlRS1Away(0),
448  fHistoEleLambdaPtvsV0dlRS2Away(0),
449  fHistoEleLambdaPtvsV0dlRSSideAway(0),
450  fHistoEleLambdaPtvsV0dlRSSide1Away(0),
451  fHistoEleLambdaPtvsV0dlRSSide2Away(0),
452  fHistoEleLambdaPtvsV0dlRSMixAway(0),
453  fHistoEleLambdaPtvsV0dlRSMix1Away(0),
454  fHistoEleLambdaPtvsV0dlRSMix2Away(0),
455  fHistoEleLambdaPtvsV0dlWSAway(0),
456  fHistoEleLambdaPtvsV0dlWS1Away(0),
457  fHistoEleLambdaPtvsV0dlWS2Away(0),
458  fHistoEleLambdaPtvsV0dlWSSideAway(0),
459  fHistoEleLambdaPtvsV0dlWSSide1Away(0),
460  fHistoEleLambdaPtvsV0dlWSSide2Away(0),
461  fHistoEleLambdaPtvsV0dlWSMixAway(0),
462  fHistoEleLambdaPtvsV0dlWSMix1Away(0),
463  fHistoEleLambdaPtvsV0dlWSMix2Away(0),
464  fHistoResponseElePt(0),
465  fHistoResponseElePt1(0),
466  fHistoResponseElePt2(0),
467  fHistoResponseEleLambdaPt(0),
468  fHistoResponseEleLambdaPt1(0),
469  fHistoResponseEleLambdaPt2(0),
470  fHistoResponseEleLambdaPtFeeddownXic0(0),
471  fHistoResponseEleLambdaPtFeeddownXic01(0),
472  fHistoResponseEleLambdaPtFeeddownXic02(0),
473  fHistoResponseEleLambdaPtFeeddownXicPlus(0),
474  fHistoResponseEleLambdaPtFeeddownXicPlus1(0),
475  fHistoResponseEleLambdaPtFeeddownXicPlus2(0),
476  fHistoResponseEleLambdaPtFeeddownSigma(0),
477  fHistoResponseEleLambdaPtFeeddownSigma1(0),
478  fHistoResponseEleLambdaPtFeeddownSigma2(0),
479  fHistoLcPtvseleLambdaPtvsElePtvsLambdaPt(0),
480  fHistoEleLambdaPtvsRapidityRS(0),
481  fHistoEleLambdaPtvsRapidityWS(0),
482  fHistoEleLambdaPtvsRapidityMCS(0),
483  fCounter(0),
484  fHistonEvtvsRunNumber(0),
485  fHistonElevsRunNumber(0),
486  fHistonLambdavsRunNumber(0),
487  fHistoMCEventType(0),
488  fHistoMCDeltaPhiccbar(0),
489  fGTI(0),fGTIndex(0), fTrackBuffSize(19000),
490  fHistodPhiSdEtaSElectronProtonR125RS(0),
491  fHistodPhiSdEtaSElectronProtonR125WS(0),
492  fHistodPhiSdEtaSElectronProtonR125RSMix(0),
493  fHistodPhiSdEtaSElectronProtonR125WSMix(0),
494  fHistodPhiSdEtaSElectronPionR125RS(0),
495  fHistodPhiSdEtaSElectronPionR125WS(0),
496  fHistodPhiSdEtaSElectronPionR125RSMix(0),
497  fHistodPhiSdEtaSElectronPionR125WSMix(0),
498  fDoEventMixing(0),
499  fMixWithoutConversionFlag(kTRUE),
500  fNumberOfEventsForMixing (5),
501  fNzVtxBins (0),
502  fNCentBins (0),
503  fNOfPools(1),
504  fEventBuffer(0x0),
505  fEventInfo(0x0),
506  fElectronTracks(0x0),
507  fV0Tracks1(0x0),
508  fV0Tracks2(0x0),
509  fV0dlArray1(0x0),
510  fV0dlArray2(0x0),
511  fV0dcaArray1(0x0),
512  fV0dcaArray2(0x0),
513  fElectronCutVarsArray(0x0),
514  fV0CutVarsArray1(0x0),
515  fV0CutVarsArray2(0x0)
516 {
517  //
519  //
520  for(Int_t i=0;i<17;i++){
521  fHistoElePtvsCutVarsRS[i] = 0;
522  fHistoElePtvsCutVarsWS[i] = 0;
524  }
525  for(Int_t i=0;i<8;i++){
527  }
528 }
529 
530 //___________________________________________________________________________
533  Bool_t writeVariableTree) :
534  AliAnalysisTaskSE(name),
535  fUseMCInfo(kFALSE),
536  fOutput(0),
537  fOutputAll(0),
538  fListCuts(0),
539  fCEvents(0),
540  fHTrigger(0),
541  fHCentrality(0),
542  fAnalCuts(analCuts),
543  fIsEventSelected(kFALSE),
544  fWriteVariableTree(writeVariableTree),
545  fWriteEachVariableTree(kFALSE),
546  fWriteMCVariableTree(kFALSE),
547  fVariablesTree(0),
548  fEleVariablesTree(0),
549  fV0VariablesTree(0),
550  fMCVariablesTree(0),
551  fMCEleVariablesTree(0),
552  fMCV0VariablesTree(0),
553  fMCGenPairVariablesTree(0),
554  fReconstructPrimVert(kFALSE),
555  fIsMB(kFALSE),
556  fIsSemi(kFALSE),
557  fIsCent(kFALSE),
558  fIsINT7(kFALSE),
559  fIsEMC7(kFALSE),
560  fCandidateVariables(),
561  fCandidateEleVariables(),
562  fCandidateV0Variables(),
563  fCandidateMCVariables(),
564  fCandidateMCEleVariables(),
565  fCandidateMCV0Variables(),
566  fCandidateMCGenPairVariables(),
567  fVtx1(0),
568  fV1(0),
569  fVtxZ(0),
570  fBzkG(0),
571  fCentrality(0),
572  fRunNumber(0),
573  fTriggerCheck(0),
574  fUseCentralityV0M(kFALSE),
575  fEvNumberCounter(0),
576  fMCEventType(-9999),
577  fMCDoPairAnalysis(kFALSE),
578  fHistoEleLambdaMass(0),
579  fHistoEleLambdaMassRS(0),
580  fHistoEleLambdaMassRS1(0),
581  fHistoEleLambdaMassRS2(0),
582  fHistoEleLambdaMassWS(0),
583  fHistoEleLambdaMassWS1(0),
584  fHistoEleLambdaMassWS2(0),
585  fHistoEleLambdaMassRSMix(0),
586  fHistoEleLambdaMassRSMix1(0),
587  fHistoEleLambdaMassRSMix2(0),
588  fHistoEleLambdaMassWSMix(0),
589  fHistoEleLambdaMassWSMix1(0),
590  fHistoEleLambdaMassWSMix2(0),
591  fHistoEleLambdaMassRSSide(0),
592  fHistoEleLambdaMassRSSide1(0),
593  fHistoEleLambdaMassRSSide2(0),
594  fHistoEleLambdaMassWSSide(0),
595  fHistoEleLambdaMassWSSide1(0),
596  fHistoEleLambdaMassWSSide2(0),
597  fHistoEleLambdaMassRSAway(0),
598  fHistoEleLambdaMassRS1Away(0),
599  fHistoEleLambdaMassRS2Away(0),
600  fHistoEleLambdaMassWSAway(0),
601  fHistoEleLambdaMassWS1Away(0),
602  fHistoEleLambdaMassWS2Away(0),
603  fHistoEleLambdaMassRSMixAway(0),
604  fHistoEleLambdaMassRSMix1Away(0),
605  fHistoEleLambdaMassRSMix2Away(0),
606  fHistoEleLambdaMassWSMixAway(0),
607  fHistoEleLambdaMassWSMix1Away(0),
608  fHistoEleLambdaMassWSMix2Away(0),
609  fHistoEleLambdaMassRSSideAway(0),
610  fHistoEleLambdaMassRSSide1Away(0),
611  fHistoEleLambdaMassRSSide2Away(0),
612  fHistoEleLambdaMassWSSideAway(0),
613  fHistoEleLambdaMassWSSide1Away(0),
614  fHistoEleLambdaMassWSSide2Away(0),
615  fHistoEleLambdaMassvsElePtRS(0),
616  fHistoEleLambdaMassvsElePtWS(0),
617  fHistoEleLambdaMassvsElePtRSMix(0),
618  fHistoEleLambdaMassvsElePtWSMix(0),
619  fHistoEleLambdaMassvsElePtRSSide(0),
620  fHistoEleLambdaMassvsElePtWSSide(0),
621  fHistoEleLambdaMassvsElePtRS1(0),
622  fHistoEleLambdaMassvsElePtWS1(0),
623  fHistoEleLambdaMassvsElePtRSMix1(0),
624  fHistoEleLambdaMassvsElePtWSMix1(0),
625  fHistoEleLambdaMassvsElePtRSSide1(0),
626  fHistoEleLambdaMassvsElePtWSSide1(0),
627  fHistoEleLambdaMassvsElePtRS2(0),
628  fHistoEleLambdaMassvsElePtWS2(0),
629  fHistoEleLambdaMassvsElePtRSMix2(0),
630  fHistoEleLambdaMassvsElePtWSMix2(0),
631  fHistoEleLambdaMassvsElePtRSSide2(0),
632  fHistoEleLambdaMassvsElePtWSSide2(0),
633  fHistoElePtRS(0),
634  fHistoElePtWS(0),
635  fHistoElePtRSMix(0),
636  fHistoElePtWSMix(0),
637  fHistoEleLambdaMassMCS(0),
638  fHistoEleLambdaMassLambdabMCS(0),
639  fHistoEleLambdaMassXibMCS(0),
640  fHistoEleLambdaMassMCGen(0),
641  fHistoEleLambdaMassvsElePtMCS(0),
642  fHistoEleLambdaMassvsElePtMCGen(0),
643  fHistoEleLambdaMassvsElePtMCS1(0),
644  fHistoEleLambdaMassvsElePtMCGen1(0),
645  fHistoEleLambdaMassvsElePtMCS2(0),
646  fHistoEleLambdaMassvsElePtMCGen2(0),
647  fHistoElePtMCS(0),
648  fHistoElePtMCGen(0),
649  fHistoElePtvsEtaRS(0),
650  fHistoElePtvsEtaWS(0),
651  fHistoElePtvsEtaRSMix(0),
652  fHistoElePtvsEtaWSMix(0),
653  fHistoElePtvsEtaMCS(0),
654  fHistoElePtvsEtaMCGen(0),
655  fHistoElePtvsLambdaPtRS(0),
656  fHistoElePtvsLambdaPtWS(0),
657  fHistoElePtvsLambdaPtRSMix(0),
658  fHistoElePtvsLambdaPtWSMix(0),
659  fHistoElePtvsLambdaPtMCS(0),
660  fHistoElePtvsLambdaPtvsLcPtMCS(0),
661  fHistoElePtvsLambdaPtMCGen(0),
662  fHistoElePtvsLambdaPtvsLcPtMCGen(0),
663  fHistoElePtvsLambdaPtMCLcGen(0),
664  fHistoElePtvsd0RS(0),
665  fHistoElePtvsd0WS(0),
666  fHistoElePtvsd0RSMix(0),
667  fHistoElePtvsd0WSMix(0),
668  fHistoElePtvsd0MCS(0),
669  fHistoElePtvsd0PromptMCS(0),
670  fHistoElePtvsd0BFeeddownMCS(0),
671  fHistoEleLambdaMassFeeddownXic0MCS(0),
672  fHistoEleLambdaMassFeeddownXic0MCGen(0),
673  fHistoEleLambdaMassvsElePtFeeddownXic0MCS(0),
674  fHistoEleLambdaMassvsElePtFeeddownXic0MCGen(0),
675  fHistoEleLambdaMassvsElePtFeeddownXic0MCS1(0),
676  fHistoEleLambdaMassvsElePtFeeddownXic0MCGen1(0),
677  fHistoEleLambdaMassvsElePtFeeddownXic0MCS2(0),
678  fHistoEleLambdaMassvsElePtFeeddownXic0MCGen2(0),
679  fHistoElePtFeeddownXic0MCS(0),
680  fHistoElePtFeeddownXic0MCGen(0),
681  fHistoElePtvsEtaFeeddownXic0MCS(0),
682  fHistoElePtvsEtaFeeddownXic0MCGen(0),
683  fHistoElePtvsLambdaPtFeeddownXic0MCS(0),
684  fHistoElePtvsLambdaPtFeeddownXic0MCGen(0),
685  fHistoEleLambdaMassFeeddownXicPlusMCS(0),
686  fHistoEleLambdaMassFeeddownXicPlusMCGen(0),
687  fHistoEleLambdaMassvsElePtFeeddownXicPlusMCS(0),
688  fHistoEleLambdaMassvsElePtFeeddownXicPlusMCGen(0),
689  fHistoEleLambdaMassvsElePtFeeddownXicPlusMCS1(0),
690  fHistoEleLambdaMassvsElePtFeeddownXicPlusMCGen1(0),
691  fHistoEleLambdaMassvsElePtFeeddownXicPlusMCS2(0),
692  fHistoEleLambdaMassvsElePtFeeddownXicPlusMCGen2(0),
693  fHistoElePtFeeddownXicPlusMCS(0),
694  fHistoElePtFeeddownXicPlusMCGen(0),
695  fHistoElePtvsEtaFeeddownXicPlusMCS(0),
696  fHistoElePtvsEtaFeeddownXicPlusMCGen(0),
697  fHistoElePtvsLambdaPtFeeddownXicPlusMCS(0),
698  fHistoElePtvsLambdaPtFeeddownXicPlusMCGen(0),
699  fHistoBachPt(0),
700  fHistoBachPtMCS(0),
701  fHistoBachPtMCGen(0),
702  fHistod0Bach(0),
703  fHistoLambdaMassvsPt(0),
704  fHistoLambdaMassvsPtMCS(0),
705  fHistoLambdaMassvsPtMCGen(0),
706  fHistoLambdaPtvsEta(0),
707  fHistoLambdaPtvsEtaMCS(0),
708  fHistoLambdaPtvsEtaMCGen(0),
709  fHistoLambdaArmenteros(0),
710  fHistoLambdaArmenterosMCS(0),
711  fHistoLambdaPtvsDl(0),
712  fHistoLambdaPtvsDlSide(0),
713  fHistoLambdaPtvsDlMCS(0),
714  fHistoLambdaPtvsDlFeeddownXi0MCS(0),
715  fHistoLambdaPtvsDlFeeddownXiMinusMCS(0),
716  fHistoLambdaPtvsDlFeeddownOmegaMCS(0),
717  fHistoK0sMassvsPt(0),
718  fHistoElectronTPCPID(0),
719  fHistoElectronTOFPID(0),
720  fHistoElectronTPCSelPID(0),
721  fHistoElectronTOFSelPID(0),
722  fHistoElectronTPCPIDSelTOF(0),
723  fHistoElectronTPCPIDSelTOFSmallEta(0),
724  fHistoElectronTPCPIDSelTOFLargeEta(0),
725  fHistoMassConversionsMin(0),
726  fHistoMassConversionsSameSignMin(0),
727  fHistoElectronQovPtvsPhi(0),
728  fHistoLambdaQovPtvsPhi(0),
729  fHistoLcMCGen(0),
730  fHistoLcMCGen1(0),
731  fHistoLcMCGen2(0),
732  fHistoLcMCS(0),
733  fHistoLcMCS1(0),
734  fHistoLcMCS2(0),
735  fHistoFeedDownXic0MCGen(0),
736  fHistoFeedDownXic0MCGen1(0),
737  fHistoFeedDownXic0MCGen2(0),
738  fHistoFeedDownXic0MCS(0),
739  fHistoFeedDownXic0MCS1(0),
740  fHistoFeedDownXic0MCS2(0),
741  fHistoFeedDownXicPlusMCGen(0),
742  fHistoFeedDownXicPlusMCGen1(0),
743  fHistoFeedDownXicPlusMCGen2(0),
744  fHistoFeedDownXicPlusMCS(0),
745  fHistoFeedDownXicPlusMCS1(0),
746  fHistoFeedDownXicPlusMCS2(0),
747  fHistoFeedDownSigmaMCGen(0),
748  fHistoFeedDownSigmaMCGen1(0),
749  fHistoFeedDownSigmaMCGen2(0),
750  fHistoFeedDownSigmaMCS(0),
751  fHistoFeedDownSigmaMCS1(0),
752  fHistoFeedDownSigmaMCS2(0),
753  fHistoLcElectronMCGen(0),
754  fHistoLcElectronMCGen1(0),
755  fHistoLcElectronMCGen2(0),
756  fHistoLcElectronMCS(0),
757  fHistoLcElectronMCS1(0),
758  fHistoLcElectronMCS2(0),
759  fHistoElectronFeedDownXic0MCGen(0),
760  fHistoElectronFeedDownXic0MCGen1(0),
761  fHistoElectronFeedDownXic0MCGen2(0),
762  fHistoElectronFeedDownXic0MCS(0),
763  fHistoElectronFeedDownXic0MCS1(0),
764  fHistoElectronFeedDownXic0MCS2(0),
765  fHistoElectronFeedDownXicPlusMCGen(0),
766  fHistoElectronFeedDownXicPlusMCGen1(0),
767  fHistoElectronFeedDownXicPlusMCGen2(0),
768  fHistoElectronFeedDownXicPlusMCS(0),
769  fHistoElectronFeedDownXicPlusMCS1(0),
770  fHistoElectronFeedDownXicPlusMCS2(0),
771  fHistoElectronMCGen(0),
772  fHistoLambdaMCGen(0),
773  fHistoElePtvsV0dlRS(0),
774  fHistoElePtvsV0dlRS1(0),
775  fHistoElePtvsV0dlRS2(0),
776  fHistoElePtvsV0dlRSSide(0),
777  fHistoElePtvsV0dlRSSide1(0),
778  fHistoElePtvsV0dlRSSide2(0),
779  fHistoElePtvsV0dlRSMix(0),
780  fHistoElePtvsV0dlRSMix1(0),
781  fHistoElePtvsV0dlRSMix2(0),
782  fHistoElePtvsV0dlWS(0),
783  fHistoElePtvsV0dlWS1(0),
784  fHistoElePtvsV0dlWS2(0),
785  fHistoElePtvsV0dlWSSide(0),
786  fHistoElePtvsV0dlWSSide1(0),
787  fHistoElePtvsV0dlWSSide2(0),
788  fHistoElePtvsV0dlWSMix(0),
789  fHistoElePtvsV0dlWSMix1(0),
790  fHistoElePtvsV0dlWSMix2(0),
791  fHistoElePtvsV0dlMCS(0),
792  fHistoElePtvsV0dlMCS1(0),
793  fHistoElePtvsV0dlMCS2(0),
794  fHistoElePtvsV0dlFeedDownXic0MCS(0),
795  fHistoElePtvsV0dlFeedDownXic0MCS1(0),
796  fHistoElePtvsV0dlFeedDownXic0MCS2(0),
797  fHistoElePtvsV0dlFeedDownXicPlusMCS(0),
798  fHistoElePtvsV0dlFeedDownXicPlusMCS1(0),
799  fHistoElePtvsV0dlFeedDownXicPlusMCS2(0),
800  fHistoElePtvsV0dcaRS(0),
801  fHistoElePtvsV0dcaRS1(0),
802  fHistoElePtvsV0dcaRS2(0),
803  fHistoElePtvsV0dcaRSSide(0),
804  fHistoElePtvsV0dcaRSSide1(0),
805  fHistoElePtvsV0dcaRSSide2(0),
806  fHistoElePtvsV0dcaRSMix(0),
807  fHistoElePtvsV0dcaRSMix1(0),
808  fHistoElePtvsV0dcaRSMix2(0),
809  fHistoElePtvsV0dcaWS(0),
810  fHistoElePtvsV0dcaWS1(0),
811  fHistoElePtvsV0dcaWS2(0),
812  fHistoElePtvsV0dcaWSSide(0),
813  fHistoElePtvsV0dcaWSSide1(0),
814  fHistoElePtvsV0dcaWSSide2(0),
815  fHistoElePtvsV0dcaWSMix(0),
816  fHistoElePtvsV0dcaWSMix1(0),
817  fHistoElePtvsV0dcaWSMix2(0),
818  fHistoElePtvsV0dcaMCS(0),
819  fHistoElePtvsV0dcaMCS1(0),
820  fHistoElePtvsV0dcaMCS2(0),
821  fHistoElePtvsV0dcaFeedDownXic0MCS(0),
822  fHistoElePtvsV0dcaFeedDownXic0MCS1(0),
823  fHistoElePtvsV0dcaFeedDownXic0MCS2(0),
824  fHistoElePtvsV0dcaFeedDownXicPlusMCS(0),
825  fHistoElePtvsV0dcaFeedDownXicPlusMCS1(0),
826  fHistoElePtvsV0dcaFeedDownXicPlusMCS2(0),
827  fHistoEleLambdaPtvsV0dlRS(0),
828  fHistoEleLambdaPtvsV0dlRS1(0),
829  fHistoEleLambdaPtvsV0dlRS2(0),
830  fHistoEleLambdaPtvsV0dlRSSide(0),
831  fHistoEleLambdaPtvsV0dlRSSide1(0),
832  fHistoEleLambdaPtvsV0dlRSSide2(0),
833  fHistoEleLambdaPtvsV0dlRSMix(0),
834  fHistoEleLambdaPtvsV0dlRSMix1(0),
835  fHistoEleLambdaPtvsV0dlRSMix2(0),
836  fHistoEleLambdaPtvsV0dlWS(0),
837  fHistoEleLambdaPtvsV0dlWS1(0),
838  fHistoEleLambdaPtvsV0dlWS2(0),
839  fHistoEleLambdaPtvsV0dlWSSide(0),
840  fHistoEleLambdaPtvsV0dlWSSide1(0),
841  fHistoEleLambdaPtvsV0dlWSSide2(0),
842  fHistoEleLambdaPtvsV0dlWSMix(0),
843  fHistoEleLambdaPtvsV0dlWSMix1(0),
844  fHistoEleLambdaPtvsV0dlWSMix2(0),
845  fHistoEleLambdaPtvsV0dlMCS(0),
846  fHistoEleLambdaPtvsV0dlMCS1(0),
847  fHistoEleLambdaPtvsV0dlMCS2(0),
848  fHistoEleLambdaPtvsV0dlPromptMCS(0),
849  fHistoEleLambdaPtvsV0dlPromptMCS1(0),
850  fHistoEleLambdaPtvsV0dlPromptMCS2(0),
851  fHistoEleLambdaPtvsV0dlBFeeddownMCS(0),
852  fHistoEleLambdaPtvsV0dlBFeeddownMCS1(0),
853  fHistoEleLambdaPtvsV0dlBFeeddownMCS2(0),
854  fHistoEleLambdaPtvsV0dlFeedDownXic0MCS(0),
855  fHistoEleLambdaPtvsV0dlFeedDownXic0MCS1(0),
856  fHistoEleLambdaPtvsV0dlFeedDownXic0MCS2(0),
857  fHistoEleLambdaPtvsV0dlFeedDownXic0PromptMCS(0),
858  fHistoEleLambdaPtvsV0dlFeedDownXic0PromptMCS1(0),
859  fHistoEleLambdaPtvsV0dlFeedDownXic0PromptMCS2(0),
860  fHistoEleLambdaPtvsV0dlFeedDownXic0BFeeddownMCS(0),
861  fHistoEleLambdaPtvsV0dlFeedDownXic0BFeeddownMCS1(0),
862  fHistoEleLambdaPtvsV0dlFeedDownXic0BFeeddownMCS2(0),
863  fHistoEleLambdaPtvsV0dlFeedDownXicPlusMCS(0),
864  fHistoEleLambdaPtvsV0dlFeedDownXicPlusMCS1(0),
865  fHistoEleLambdaPtvsV0dlFeedDownXicPlusMCS2(0),
866  fHistoEleLambdaPtvsV0dlFeedDownXicPlusPromptMCS(0),
867  fHistoEleLambdaPtvsV0dlFeedDownXicPlusPromptMCS1(0),
868  fHistoEleLambdaPtvsV0dlFeedDownXicPlusPromptMCS2(0),
869  fHistoEleLambdaPtvsV0dlFeedDownXicPlusBFeeddownMCS(0),
870  fHistoEleLambdaPtvsV0dlFeedDownXicPlusBFeeddownMCS1(0),
871  fHistoEleLambdaPtvsV0dlFeedDownXicPlusBFeeddownMCS2(0),
872  fHistoEleLambdaPtvsV0dlFeedDownSigmaMCS(0),
873  fHistoEleLambdaPtvsV0dlFeedDownSigmaMCS1(0),
874  fHistoEleLambdaPtvsV0dlFeedDownSigmaMCS2(0),
875  fHistoEleLambdaPtvsV0dlFeedDownSigmaPromptMCS(0),
876  fHistoEleLambdaPtvsV0dlFeedDownSigmaPromptMCS1(0),
877  fHistoEleLambdaPtvsV0dlFeedDownSigmaPromptMCS2(0),
878  fHistoEleLambdaPtvsV0dlFeedDownSigmaBFeeddownMCS(0),
879  fHistoEleLambdaPtvsV0dlFeedDownSigmaBFeeddownMCS1(0),
880  fHistoEleLambdaPtvsV0dlFeedDownSigmaBFeeddownMCS2(0),
881  fHistoEleLambdaPtvsV0dlLambdabMCS(0),
882  fHistoEleLambdaPtvsV0dlLambdabMCS1(0),
883  fHistoEleLambdaPtvsV0dlLambdabMCS2(0),
884  fHistoEleLambdaPtvsV0dlXibMCS(0),
885  fHistoEleLambdaPtvsV0dlXibMCS1(0),
886  fHistoEleLambdaPtvsV0dlXibMCS2(0),
887  fHistoEleLambdaPtvsV0dlRSAway(0),
888  fHistoEleLambdaPtvsV0dlRS1Away(0),
889  fHistoEleLambdaPtvsV0dlRS2Away(0),
890  fHistoEleLambdaPtvsV0dlRSSideAway(0),
891  fHistoEleLambdaPtvsV0dlRSSide1Away(0),
892  fHistoEleLambdaPtvsV0dlRSSide2Away(0),
893  fHistoEleLambdaPtvsV0dlRSMixAway(0),
894  fHistoEleLambdaPtvsV0dlRSMix1Away(0),
895  fHistoEleLambdaPtvsV0dlRSMix2Away(0),
896  fHistoEleLambdaPtvsV0dlWSAway(0),
897  fHistoEleLambdaPtvsV0dlWS1Away(0),
898  fHistoEleLambdaPtvsV0dlWS2Away(0),
899  fHistoEleLambdaPtvsV0dlWSSideAway(0),
900  fHistoEleLambdaPtvsV0dlWSSide1Away(0),
901  fHistoEleLambdaPtvsV0dlWSSide2Away(0),
902  fHistoEleLambdaPtvsV0dlWSMixAway(0),
903  fHistoEleLambdaPtvsV0dlWSMix1Away(0),
904  fHistoEleLambdaPtvsV0dlWSMix2Away(0),
905  fHistoResponseElePt(0),
906  fHistoResponseElePt1(0),
907  fHistoResponseElePt2(0),
908  fHistoResponseEleLambdaPt(0),
909  fHistoResponseEleLambdaPt1(0),
910  fHistoResponseEleLambdaPt2(0),
911  fHistoResponseEleLambdaPtFeeddownXic0(0),
912  fHistoResponseEleLambdaPtFeeddownXic01(0),
913  fHistoResponseEleLambdaPtFeeddownXic02(0),
914  fHistoResponseEleLambdaPtFeeddownXicPlus(0),
915  fHistoResponseEleLambdaPtFeeddownXicPlus1(0),
916  fHistoResponseEleLambdaPtFeeddownXicPlus2(0),
917  fHistoResponseEleLambdaPtFeeddownSigma(0),
918  fHistoResponseEleLambdaPtFeeddownSigma1(0),
919  fHistoResponseEleLambdaPtFeeddownSigma2(0),
920  fHistoLcPtvseleLambdaPtvsElePtvsLambdaPt(0),
921  fHistoEleLambdaPtvsRapidityRS(0),
922  fHistoEleLambdaPtvsRapidityWS(0),
923  fHistoEleLambdaPtvsRapidityMCS(0),
924  fCounter(0),
925  fHistonEvtvsRunNumber(0),
926  fHistonElevsRunNumber(0),
927  fHistonLambdavsRunNumber(0),
928  fHistoMCEventType(0),
929  fHistoMCDeltaPhiccbar(0),
930  fGTI(0),fGTIndex(0), fTrackBuffSize(19000),
931  fHistodPhiSdEtaSElectronProtonR125RS(0),
932  fHistodPhiSdEtaSElectronProtonR125WS(0),
933  fHistodPhiSdEtaSElectronProtonR125RSMix(0),
934  fHistodPhiSdEtaSElectronProtonR125WSMix(0),
935  fHistodPhiSdEtaSElectronPionR125RS(0),
936  fHistodPhiSdEtaSElectronPionR125WS(0),
937  fHistodPhiSdEtaSElectronPionR125RSMix(0),
938  fHistodPhiSdEtaSElectronPionR125WSMix(0),
939  fDoEventMixing(0),
940  fMixWithoutConversionFlag(kTRUE),
941  fNumberOfEventsForMixing (5),
942  fNzVtxBins (0),
943  fNCentBins (0),
944  fNOfPools(1),
945  fEventBuffer(0x0),
946  fEventInfo(0x0),
947  fElectronTracks(0x0),
948  fV0Tracks1(0x0),
949  fV0Tracks2(0x0),
950  fV0dlArray1(0x0),
951  fV0dlArray2(0x0),
952  fV0dcaArray1(0x0),
953  fV0dcaArray2(0x0),
954  fElectronCutVarsArray(0x0),
955  fV0CutVarsArray1(0x0),
956  fV0CutVarsArray2(0x0)
957 {
958  //
960  //
961  Info("AliAnalysisTaskSELc2eleLambdafromAODtracks","Calling Constructor");
962 
963  for(Int_t i=0;i<17;i++){
964  fHistoElePtvsCutVarsRS[i] = 0;
965  fHistoElePtvsCutVarsWS[i] = 0;
967  }
968  for(Int_t i=0;i<8;i++){
970  }
971 
972  DefineOutput(1,TList::Class()); //conters
973  DefineOutput(2,TList::Class());
974  DefineOutput(3,TList::Class()); //conters
975  DefineOutput(4,TTree::Class()); //My private output
976  DefineOutput(5,TTree::Class()); //My private output
977  DefineOutput(6,TTree::Class()); //My private output
978  DefineOutput(7,TTree::Class()); //My private output
979  DefineOutput(8,AliNormalizationCounter::Class());
980  DefineOutput(9,TTree::Class()); //My private output
981  DefineOutput(10,TTree::Class()); //My private output
982  DefineOutput(11,TTree::Class()); //My private output
983 }
984 
985 //___________________________________________________________________________
987  //
989  //
990  Info("~AliAnalysisTaskSELc2eleLambdafromAODtracks","Calling Destructor");
991 
992  if (fOutput) {
993  delete fOutput;
994  fOutput = 0;
995  }
996 
997  if (fOutputAll) {
998  delete fOutputAll;
999  fOutputAll = 0;
1000  }
1001 
1002  if (fListCuts) {
1003  delete fListCuts;
1004  fListCuts = 0;
1005  }
1006 
1007 
1008  if (fAnalCuts) {
1009  delete fAnalCuts;
1010  fAnalCuts = 0;
1011  }
1012 
1013  if (fVariablesTree) {
1014  delete fVariablesTree;
1015  fVariablesTree = 0;
1016  }
1017  if (fEleVariablesTree) {
1018  delete fEleVariablesTree;
1019  fEleVariablesTree = 0;
1020  }
1021  if (fV0VariablesTree) {
1022  delete fV0VariablesTree;
1023  fV0VariablesTree = 0;
1024  }
1025  if (fMCVariablesTree) {
1026  delete fMCVariablesTree;
1027  fMCVariablesTree = 0;
1028  }
1029  if (fMCEleVariablesTree) {
1030  delete fMCEleVariablesTree;
1031  fMCEleVariablesTree = 0;
1032  }
1033  if (fMCV0VariablesTree) {
1034  delete fMCV0VariablesTree;
1035  fMCV0VariablesTree = 0;
1036  }
1038  delete fMCGenPairVariablesTree;
1040  }
1041  if(fCounter){
1042  delete fCounter;
1043  fCounter = 0;
1044  }
1045 
1046  if(fElectronTracks) fElectronTracks->Delete();
1047  delete fElectronTracks;
1048  if(fV0Tracks1) fV0Tracks1->Delete();
1049  delete fV0Tracks1;
1050  if(fV0Tracks2) fV0Tracks2->Delete();
1051  delete fV0Tracks2;
1052  if(fEventBuffer){
1053  for(Int_t i=0; i<fNOfPools; i++) delete fEventBuffer[i];
1054  delete fEventBuffer;
1055  }
1056  delete fEventInfo;
1058  delete fElectronCutVarsArray;
1059  if(fV0CutVarsArray1) fV0CutVarsArray1->Delete();
1060  delete fV0CutVarsArray1;
1061  if(fV0CutVarsArray2) fV0CutVarsArray2->Delete();
1062  delete fV0CutVarsArray2;
1063 
1064  if (fGTI)
1065  delete[] fGTI;
1066  fGTI=0;
1067  if (fGTIndex)
1068  delete[] fGTIndex;
1069  fGTIndex=0;
1070 }
1071 
1072 //_________________________________________________
1074  //
1076  //
1077  //
1078 
1079  fIsEventSelected=kFALSE;
1080 
1081  if (fDebug > 1) AliInfo("Init");
1082 
1083  fListCuts = new TList();
1084  fListCuts->SetOwner();
1085  fListCuts->SetName("ListCuts");
1087  PostData(2,fListCuts);
1088 
1089  return;
1090 }
1091 
1092 //_________________________________________________
1094 {
1095  //
1097  //
1098 
1099  if (!fInputEvent) {
1100  AliError("NO EVENT FOUND!");
1101  return;
1102  }
1103  AliAODEvent* aodEvent = dynamic_cast<AliAODEvent*>(fInputEvent);
1104  fCEvents->Fill(1);
1105  fEvNumberCounter++;
1106 
1107  //------------------------------------------------
1108  // First check if the event has proper B
1109  //------------------------------------------------
1110 
1111  fBzkG = (Double_t)aodEvent->GetMagneticField();
1112  AliKFParticle::SetField(fBzkG);
1113  if (TMath::Abs(fBzkG)<0.001) {
1114  return;
1115  }
1116  fCEvents->Fill(2);
1117 
1120 
1121  //------------------------------------------------
1122  // MC analysis setting
1123  //------------------------------------------------
1124  TClonesArray *mcArray = 0;
1125  AliAODMCHeader *mcHeader=0;
1126  if (fUseMCInfo) {
1127  // MC array need for maching
1128  mcArray = dynamic_cast<TClonesArray*>(aodEvent->FindListObject(AliAODMCParticle::StdBranchName()));
1129  if (!mcArray) {
1130  AliError("Could not find Monte-Carlo in AOD");
1131  return;
1132  }
1133  fCEvents->Fill(6); // in case of MC events
1134 
1135  // load MC header
1136  mcHeader = (AliAODMCHeader*)aodEvent->GetList()->FindObject(AliAODMCHeader::StdBranchName());
1137  if (!mcHeader) {
1138  AliError("AliAnalysisTaskSELc2eleLambdafromAODtracks::UserExec: MC header branch not found!\n");
1139  return;
1140  }
1141  fCEvents->Fill(7); // in case of MC events
1142 
1143  Double_t zMCVertex = mcHeader->GetVtxZ();
1144  if (TMath::Abs(zMCVertex) > fAnalCuts->GetMaxVtxZ()) {
1145  AliDebug(2,Form("Event rejected: abs(zVtxMC)=%f > fAnalCuts->GetMaxVtxZ()=%f",zMCVertex,fAnalCuts->GetMaxVtxZ()));
1146  return;
1147  } else {
1148  fCEvents->Fill(17); // in case of MC events
1149  }
1150  if ((TMath::Abs(zMCVertex) < fAnalCuts->GetMaxVtxZ()) && (!fAnalCuts->IsEventRejectedDuePhysicsSelection()) && (!fAnalCuts->IsEventRejectedDueToTrigger())) {
1151  Bool_t selevt = MakeMCAnalysis(mcArray);
1152  if(!selevt) return;
1153  }
1154  }
1155 
1156  //------------------------------------------------
1157  // Event selection
1158  //------------------------------------------------
1159  fVtx1 = (AliAODVertex*)aodEvent->GetPrimaryVertex();
1160  if (!fVtx1) return;
1161 
1162  Double_t pos[3],cov[6];
1163  fVtx1->GetXYZ(pos);
1164  fVtx1->GetCovarianceMatrix(cov);
1165  fV1 = new AliESDVertex(pos,cov,100.,100,fVtx1->GetName());
1166  fVtxZ = pos[2];
1167 
1168  Bool_t fIsTriggerNotOK = fAnalCuts->IsEventRejectedDueToTrigger();
1169  if(!fIsTriggerNotOK) fCEvents->Fill(3);
1170  if(!fIsEventSelected) {
1171  delete fV1;
1172  return;
1173  }
1174  fCEvents->Fill(4);
1175 
1176  fIsMB=(((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected()&AliVEvent::kMB)==(AliVEvent::kMB);
1177  fIsSemi=(((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected()&AliVEvent::kSemiCentral)==(AliVEvent::kSemiCentral);
1178  fIsCent=(((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected()&AliVEvent::kCentral)==(AliVEvent::kCentral);
1179  fIsINT7=(((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected()&AliVEvent::kINT7)==(AliVEvent::kINT7);
1180  fIsEMC7=(((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected()&AliVEvent::kEMC7)==(AliVEvent::kEMC7);
1182  if(fIsMB) fHTrigger->Fill(1);
1183  if(fIsSemi) fHTrigger->Fill(2);
1184  if(fIsCent) fHTrigger->Fill(3);
1185  if(fIsINT7) fHTrigger->Fill(4);
1186  if(fIsEMC7) fHTrigger->Fill(5);
1187  if(fIsMB|fIsSemi|fIsCent) fHTrigger->Fill(7);
1188  if(fIsINT7|fIsEMC7) fHTrigger->Fill(8);
1189  if(fIsMB&fIsSemi) fHTrigger->Fill(10);
1190  if(fIsMB&fIsCent) fHTrigger->Fill(11);
1191  if(fIsINT7&fIsEMC7) fHTrigger->Fill(12);
1192 
1193  if(fUseCentralityV0M){
1194  AliCentrality *cent = aodEvent->GetCentrality();
1195  fCentrality = cent->GetCentralityPercentile("V0M");
1196  }else{
1197  fCentrality = 1.;
1198  }
1199  if(fCentrality<0.||fCentrality>100.-0.0000001) {
1200  delete fV1;
1201  return;
1202  }
1203  fHCentrality->Fill(fCentrality);
1204  fRunNumber = aodEvent->GetRunNumber();
1205 
1206  Int_t runnumber_offset = 0;
1207  Int_t runnumber = aodEvent->GetRunNumber();
1208  if(runnumber<=131000&&runnumber>=114000){
1209  runnumber_offset = 114000;//lhc10bcde
1210  }else if(runnumber<=196000&&runnumber>=195000){
1211  runnumber_offset = 195000;//lhc13bc
1212  }else if(runnumber<=170593&&runnumber>=167902){
1213  runnumber_offset = 167902;//lhc11h
1214  }
1215  fHistonEvtvsRunNumber->Fill(runnumber-runnumber_offset,1.);
1216 
1217  //------------------------------------------------
1218  // Check if the event has v0 candidate
1219  //------------------------------------------------
1220  //Int_t nv0 = aodEvent->GetNumberOfV0s();
1221  fCEvents->Fill(5);
1222 
1223 
1224  //------------------------------------------------
1225  // Main analysis done in this function
1226  //------------------------------------------------
1229  MakeAnalysis(aodEvent,mcArray);
1230 
1231 
1232  PostData(1,fOutput);
1233  PostData(3,fOutputAll);
1234  PostData(4,fVariablesTree);
1235  PostData(5,fEleVariablesTree);
1236  PostData(6,fV0VariablesTree);
1237  PostData(7,fMCVariablesTree);
1238  PostData(8,fCounter);
1239  PostData(9,fMCEleVariablesTree);
1240  PostData(10,fMCV0VariablesTree);
1241  PostData(11,fMCGenPairVariablesTree);
1242 
1243  fIsEventSelected=kFALSE;
1244 
1245  delete fV1;
1246  return;
1247 }
1248 
1249 //________________________________________ terminate ___________________________
1251 {
1255 
1256  //AliInfo("Terminate","");
1257  AliAnalysisTaskSE::Terminate();
1258 
1259  fOutput = dynamic_cast<TList*> (GetOutputData(1));
1260  if (!fOutput) {
1261  AliError("fOutput not available");
1262  return;
1263  }
1264 
1265  fOutputAll = dynamic_cast<TList*> (GetOutputData(3));
1266  if (!fOutputAll) {
1267  AliError("fOutputAll not available");
1268  return;
1269  }
1270 
1271  return;
1272 }
1273 
1274 //___________________________________________________________________________
1276 {
1280  //AliInfo(Form("CreateOutputObjects of task %s\n", GetName()));
1281 
1282  //------------------------------------------------
1283  // output object setting
1284  //------------------------------------------------
1285  fOutput = new TList();
1286  fOutput->SetOwner();
1287  fOutput->SetName("chist0");
1288  DefineGeneralHistograms(); // define general histograms
1289  PostData(1,fOutput);
1290 
1291  fOutputAll = new TList();
1292  fOutputAll->SetOwner();
1293  fOutputAll->SetName("anahisto");
1294  DefineAnalysisHistograms(); // define general histograms
1295  PostData(3,fOutputAll);
1296 
1298  PostData(4,fVariablesTree);
1299 
1301  PostData(5,fEleVariablesTree);
1302 
1304  PostData(6,fV0VariablesTree);
1305 
1307  PostData(7,fMCVariablesTree);
1308 
1310  PostData(9,fMCEleVariablesTree);
1311 
1313  PostData(10,fMCV0VariablesTree);
1314 
1316  PostData(11,fMCGenPairVariablesTree);
1317 
1318  //Counter for Normalization
1319  TString normName="NormalizationCounter";
1320  AliAnalysisDataContainer *cont = GetOutputSlot(8)->GetContainer();
1321  if(cont)normName=(TString)cont->GetName();
1322  fCounter = new AliNormalizationCounter(normName.Data());
1323  fCounter->Init();
1324  PostData(8,fCounter);
1325 
1326  if(fDoEventMixing){
1327  fElectronTracks = new TObjArray();
1328  fElectronTracks->SetOwner();
1329  fV0Tracks1 = new TObjArray();
1330  fV0Tracks1->SetOwner();
1331  fV0Tracks2 = new TObjArray();
1332  fV0Tracks2->SetOwner();
1333  fElectronCutVarsArray = new TObjArray();
1334  fElectronCutVarsArray->SetOwner();
1335  fV0CutVarsArray1 = new TObjArray();
1336  fV0CutVarsArray1->SetOwner();
1337  fV0CutVarsArray2 = new TObjArray();
1338  fV0CutVarsArray2->SetOwner();
1339 
1341  fEventBuffer = new TTree*[fNOfPools];
1342  for(Int_t i=0; i<fNOfPools; i++){
1343  fEventBuffer[i]=new TTree(Form("EventBuffer_%d",i), "Temporary buffer for event mixing");
1344  fEventBuffer[i]->Branch("zVertex", &fVtxZ);
1345  fEventBuffer[i]->Branch("centrality", &fCentrality);
1346  fEventBuffer[i]->Branch("eventInfo", "TObjString",&fEventInfo);
1347  fEventBuffer[i]->Branch("v1array", "TObjArray", &fV0Tracks1);
1348  fEventBuffer[i]->Branch("v2array", "TObjArray", &fV0Tracks2);
1349  fEventBuffer[i]->Branch("vdl1array", &fV0dlArray1);
1350  fEventBuffer[i]->Branch("vdl2array", &fV0dlArray2);
1351  fEventBuffer[i]->Branch("vdca1array", &fV0dcaArray1);
1352  fEventBuffer[i]->Branch("vdca2array", &fV0dcaArray2);
1353  fEventBuffer[i]->Branch("v1varsarray", "TObjArray", &fV0CutVarsArray1);
1354  fEventBuffer[i]->Branch("v2varsarray", "TObjArray", &fV0CutVarsArray2);
1355  }
1356  }
1357 
1358  fGTI = new AliAODTrack *[fTrackBuffSize]; // Array of pointers
1359  fGTIndex = new Int_t [fTrackBuffSize]; // Array of index
1360 
1361  return;
1362 }
1363 
1364 //-------------------------------------------------------------------------------
1367  AliAODEvent *aodEvent, TClonesArray *mcArray
1368  )
1369 {
1370  //
1372  //
1373  if(fDoEventMixing){
1374  if(fElectronTracks) fElectronTracks->Delete();
1375  if(fV0Tracks1) fV0Tracks1->Delete();
1376  if(fV0Tracks2) fV0Tracks2->Delete();
1377  if(fElectronCutVarsArray) fElectronCutVarsArray->Delete();
1378  if(fV0CutVarsArray1) fV0CutVarsArray1->Delete();
1379  if(fV0CutVarsArray2) fV0CutVarsArray2->Delete();
1380  fV0dlArray1.clear();
1381  fV0dlArray2.clear();
1382  fV0dcaArray1.clear();
1383  fV0dcaArray2.clear();
1384  }
1385 
1386  ResetGlobalTrackReference();
1387  // ..and set it
1388  for (Int_t iTrack=0;iTrack<aodEvent->GetNumberOfTracks();iTrack++){
1389  // cast needed since the event now returns AliVTrack instead of AliAODTrack
1390  AliAODTrack *track = dynamic_cast<AliAODTrack *>(aodEvent->GetTrack(iTrack));
1391  if (!track) continue;
1392 
1393  // Store the reference of the global tracks
1394  StoreGlobalTrackReference(track,iTrack);
1395  }
1396 
1397  //------------------------------------------------
1398  // Select good track before hand to save time
1399  //------------------------------------------------
1400 
1401  Int_t nV0s= aodEvent->GetNumberOfV0s();
1402  Int_t nTracks= aodEvent->GetNumberOfTracks();
1403 
1404  Bool_t seleTrkFlags[nTracks];
1405  Int_t nSeleTrks=0;
1406  SelectTrack(aodEvent,nTracks,nSeleTrks,seleTrkFlags,mcArray);
1407 
1408  Bool_t seleV0Flags[nV0s];
1409  Int_t nSeleV0=0;
1410  SelectV0(aodEvent,nV0s,nSeleV0,seleV0Flags,mcArray);
1411 
1412  Int_t runnumber_offset = 0;
1413  Int_t runnumber = aodEvent->GetRunNumber();
1414  if(runnumber<=131000&&runnumber>=114000){
1415  runnumber_offset = 114000;//lhc10bcde
1416  }else if(runnumber<=196000&&runnumber>=195000){
1417  runnumber_offset = 195000;//lhc13bc
1418  }else if(runnumber<=170593&&runnumber>=167902){
1419  runnumber_offset = 167902;//lhc11h
1420  }
1421  fHistonElevsRunNumber->Fill(runnumber-runnumber_offset,nSeleTrks);
1422  fHistonLambdavsRunNumber->Fill(runnumber-runnumber_offset,nSeleV0);
1423 
1424  //------------------------------------------------
1425  // V0 loop
1426  //------------------------------------------------
1427  for (Int_t iv0 = 0; iv0<nV0s; iv0++) {
1428  if(!seleV0Flags[iv0]) continue;
1429  AliAODv0 *v0 = aodEvent->GetV0(iv0);
1430  if(!v0) continue;
1431 
1432  AliAODTrack *cptrack = (AliAODTrack*)(v0->GetDaughter(0));
1433  AliAODTrack *cntrack = (AliAODTrack*)(v0->GetDaughter(1));
1434 
1435  //------------------------------------------------
1436  // track loop
1437  //------------------------------------------------
1438  for (Int_t itrk = 0; itrk<nTracks; itrk++) {
1439  if(!seleTrkFlags[itrk]) continue;
1440  AliAODTrack *trk = (AliAODTrack*)aodEvent->GetTrack(itrk);
1441  //if(trk->GetID()<0) continue;
1442 
1443  //if(!fAnalCuts->SelectWithRoughCuts(v0,trk)) continue;
1444 
1445  //TPC only track (BIT 7) does not have PID information
1446  //In addition to that, TPC only tracks does not have good DCA resolution
1447  //(according to femtoscopy code)
1448  AliAODTrack *trkpid = 0;
1449  if(fAnalCuts->GetProdAODFilterBit()==7){
1450  trkpid = fGTI[-trk->GetID()-1];
1451  }else{
1452  trkpid = trk;
1453  }
1454 
1455  Int_t cpid = cptrack->GetID();
1456  Int_t cnid = cntrack->GetID();
1457  Int_t lpid = trkpid->GetID();
1458  if((cpid==lpid)||(cnid==lpid)) continue;
1459 
1460  AliAODVertex *secVert = ReconstructSecondaryVertex(v0,trk,aodEvent);//Fake, prim vertex is just used as secondary vertex. place holder for future
1461  if(!secVert) continue;
1462 
1463  AliAODRecoCascadeHF *elobj = MakeCascadeHF(v0,trk,trkpid,aodEvent,secVert);
1464  if(!elobj) {
1465  continue;
1466  }
1467 
1468  FillROOTObjects(elobj,v0,trk,trkpid,mcArray);
1469 
1470  elobj->GetSecondaryVtx()->RemoveDaughters();
1471  elobj->UnsetOwnPrimaryVtx();
1472  delete elobj;elobj=NULL;
1473  delete secVert;
1474  }
1475  }
1476 
1477  if(fDoEventMixing){
1478  fEventInfo->SetString(Form("Ev%d_esd%d_E%d_V%d",AliAnalysisManager::GetAnalysisManager()->GetNcalls(),((AliAODHeader*)aodEvent->GetHeader())->GetEventNumberESDFile(),fElectronTracks->GetEntries(),fV0Tracks1->GetEntries()+fV0Tracks2->GetEntries()));
1479  Int_t ind=GetPoolIndex(fVtxZ,fCentrality);
1480  if(ind>=0 && ind<fNOfPools){
1481  if(fEventBuffer[ind]->GetEntries() >= fNumberOfEventsForMixing){
1482  DoEventMixingWithPools(ind);
1483  if(fEventBuffer[ind]->GetEntries() >= 20*fNumberOfEventsForMixing){
1484  ResetPool(ind);
1485  }
1486  }
1487  fEventBuffer[ind]->Fill();
1488  }
1489  }
1490 }
1493 {
1497 
1498  const char* nameoutput = GetOutputSlot(4)->GetContainer()->GetName();
1499  fVariablesTree = new TTree(nameoutput,"Candidates variables tree");
1500  Int_t nVar = 92;
1501  fCandidateVariables = new Float_t [nVar];
1502  TString * fCandidateVariableNames = new TString[nVar];
1503 
1504  fCandidateVariableNames[ 0]="Centrality";
1505  fCandidateVariableNames[ 1]="InvMassEleLambda";
1506  fCandidateVariableNames[ 2]="EleLambdaPt";
1507  fCandidateVariableNames[ 3]="EleLambdaPx";
1508  fCandidateVariableNames[ 4]="EleLambdaPy";
1509  fCandidateVariableNames[ 5]="EleLambdaPz";
1510  fCandidateVariableNames[ 6]="ElePx";
1511  fCandidateVariableNames[ 7]="ElePy";
1512  fCandidateVariableNames[ 8]="ElePz";
1513  fCandidateVariableNames[ 9]="V0Px";
1514  fCandidateVariableNames[10]="V0Py";
1515  fCandidateVariableNames[11]="V0Pz";
1516  fCandidateVariableNames[12]="AntiLambdaFlag";
1517  fCandidateVariableNames[13]="MassLambda";
1518  fCandidateVariableNames[14]="MassAntiLambda";
1519  fCandidateVariableNames[15]="Eled0";
1520  fCandidateVariableNames[16]="V0d0";
1521  fCandidateVariableNames[17]="nSigmaTPCele";
1522  fCandidateVariableNames[18]="nSigmaTOFele";
1523  fCandidateVariableNames[19]="nSigmaTPCv0pr";
1524  fCandidateVariableNames[20]="nSigmaTOFv0pr";
1525  fCandidateVariableNames[21]="EleCharge";
1526  fCandidateVariableNames[22]="ProtonPx";
1527  fCandidateVariableNames[23]="ProtonPy";
1528  fCandidateVariableNames[24]="ProtonPz";
1529  fCandidateVariableNames[25]="PiPx";
1530  fCandidateVariableNames[26]="PiPy";
1531  fCandidateVariableNames[27]="PiPz";
1532  fCandidateVariableNames[28]="mcpdglc";
1533  fCandidateVariableNames[29]="mclablc";
1534  fCandidateVariableNames[30]="mcpdgmomele";
1535  fCandidateVariableNames[31]="mcpdgmomv0";
1536  fCandidateVariableNames[32]="Mixing";
1537  fCandidateVariableNames[33]="mcpdgele";
1538  fCandidateVariableNames[34]="nSigmaTPCpr_etrk";
1539  fCandidateVariableNames[35]="nSigmaTOFpr_etrk";
1540  fCandidateVariableNames[36]="nSigmaTPCka_etrk";
1541  fCandidateVariableNames[37]="nSigmaTOFka_etrk";
1542  fCandidateVariableNames[38]="MassK0Short";
1543  fCandidateVariableNames[39]="mcpdggrmomele";
1544  fCandidateVariableNames[40]="mcpdggrmomv0";
1545  fCandidateVariableNames[41]="mcngenele";
1546  fCandidateVariableNames[42]="mcngenv0";
1547  fCandidateVariableNames[43]="mclcpx";
1548  fCandidateVariableNames[44]="mclcpy";
1549  fCandidateVariableNames[45]="mclcpz";
1550  fCandidateVariableNames[46]="mcelepx";
1551  fCandidateVariableNames[47]="mcelepy";
1552  fCandidateVariableNames[48]="mcelepz";
1553  fCandidateVariableNames[49]="mcv0px";
1554  fCandidateVariableNames[50]="mcv0py";
1555  fCandidateVariableNames[51]="mcv0pz";
1556  fCandidateVariableNames[52]="nSigmaTPCpi_etrk";
1557  fCandidateVariableNames[53]="nSigmaTOFpi_etrk";
1558  fCandidateVariableNames[54]="PrimVertx";
1559  fCandidateVariableNames[55]="PrimVerty";
1560  fCandidateVariableNames[56]="PrimVertz";
1561  fCandidateVariableNames[57]="V0Vertx";
1562  fCandidateVariableNames[58]="V0Verty";
1563  fCandidateVariableNames[59]="V0Vertz";
1564 
1565  fCandidateVariableNames[60]="DcaV0PrToPrimVertex";
1566  fCandidateVariableNames[61]="DcaV0PiToPrimVertex";
1567  fCandidateVariableNames[62]="DcaV0daughters";
1568  fCandidateVariableNames[63]="V0CosPointingAngle";
1569  fCandidateVariableNames[64]="V0ProperDecayLength";
1570  fCandidateVariableNames[65]="MassK0Short2";
1571 
1572  fCandidateVariableNames[66]="nSigmaTPCv0pi";
1573  fCandidateVariableNames[67]="nSigmaTOFv0pi";
1574 
1575  fCandidateVariableNames[68]= "EleITSMatch";
1576  fCandidateVariableNames[69]= "V0PosITSMatch";
1577  fCandidateVariableNames[70]= "V0NegITSMatch";
1578  fCandidateVariableNames[71]= "IsV0PeakRegion";
1579  fCandidateVariableNames[72]= "mcpdgv0";
1580 
1581  fCandidateVariableNames[73]= "mcv0pospx";
1582  fCandidateVariableNames[74]= "mcv0pospy";
1583  fCandidateVariableNames[75]= "mcv0pospz";
1584  fCandidateVariableNames[76]= "mcpdgv0pos";
1585  fCandidateVariableNames[77]= "mcv0negpx";
1586  fCandidateVariableNames[78]= "mcv0negpy";
1587  fCandidateVariableNames[79]= "mcv0negpz";
1588  fCandidateVariableNames[80]= "mcpdgv0neg";
1589 
1590  fCandidateVariableNames[81]= "ProtonPxPV";
1591  fCandidateVariableNames[82]= "ProtonPyPV";
1592  fCandidateVariableNames[83]= "ProtonPzPV";
1593  fCandidateVariableNames[84]= "PiPxPV";
1594  fCandidateVariableNames[85]= "PiPyPV";
1595  fCandidateVariableNames[86]= "PiPzPV";
1596 
1597  fCandidateVariableNames[87]= "mcv0vertx";
1598  fCandidateVariableNames[88]= "mcv0verty";
1599  fCandidateVariableNames[89]= "mcv0vertz";
1600 
1601  fCandidateVariableNames[90]="EvNumber";
1602  fCandidateVariableNames[91]="RunNumber";
1603 
1604  for (Int_t ivar=0; ivar<nVar; ivar++) {
1605  fVariablesTree->Branch(fCandidateVariableNames[ivar].Data(),&fCandidateVariables[ivar],Form("%s/f",fCandidateVariableNames[ivar].Data()));
1606  }
1607 
1608  return;
1609 }
1610 
1612 void AliAnalysisTaskSELc2eleLambdafromAODtracks::FillROOTObjects(AliAODRecoCascadeHF *elobj, AliAODv0 *v0, AliAODTrack *trk, AliAODTrack *trkpid, TClonesArray *mcArray)
1613 {
1617  if(!trk) return;
1618  if(!trkpid) return;
1619  if(!v0) return;
1620 
1621  for(Int_t i=0;i<92;i++){
1622  fCandidateVariables[i] = -9999.;
1623  }
1624 
1625  Bool_t anti_lambda_flag = kFALSE;
1626  if(fabs(v0->MassAntiLambda()-1.115683)<fAnalCuts->GetProdV0MassTolLambdaRough()) anti_lambda_flag = kTRUE;
1627 
1628  AliAODTrack *cptrack = (AliAODTrack*)(v0->GetDaughter(0));
1629  AliAODTrack *cntrack = (AliAODTrack*)(v0->GetDaughter(1));
1630  if(cptrack->Charge()<0 && cntrack->Charge()>0){
1631  cptrack = (AliAODTrack*)(v0->GetDaughter(1));
1632  cntrack = (AliAODTrack*)(v0->GetDaughter(0));
1633  }
1634 
1635  Double_t v0px = elobj->PxProng(1);
1636  Double_t v0py = elobj->PyProng(1);
1637  Double_t v0pz = elobj->PzProng(1);
1638  Double_t momv0 = sqrt(v0px*v0px+v0py*v0py+v0pz*v0pz);
1639  Double_t Ev0 = sqrt(momv0*momv0+1.115683*1.115683);
1640  Double_t epx = elobj->PxProng(0);
1641  Double_t epy = elobj->PyProng(0);
1642  Double_t epz = elobj->PzProng(0);
1643  Double_t mome = sqrt(epx*epx+epy*epy+epz*epz);
1644  Double_t Ee = sqrt(mome*mome+0.000510998928*0.000510998928);
1645  Double_t cosoa = (v0px*epx+v0py*epy+v0pz*epz)/sqrt(v0px*v0px+v0py*v0py+v0pz*v0pz)/sqrt(epx*epx+epy*epy+epz*epz);
1646  Double_t Esum = Ee + Ev0;
1647 
1648  Double_t uxe = epx/mome;
1649  Double_t uye = epy/mome;
1650  Double_t uze = epz/mome;
1651  Double_t lf = -2.*(v0px*uxe+v0py*uye+v0pz*uze);
1652  Double_t pxv_flip = v0px + lf * uxe;
1653  Double_t pyv_flip = v0py + lf * uye;
1654  Double_t pzv_flip = v0pz + lf * uze;
1655  Double_t pxsum_flip = epx + pxv_flip;
1656  Double_t pysum_flip = epy + pyv_flip;
1657  Double_t pzsum_flip = epz + pzv_flip;
1658  Double_t melam_flip = sqrt(Esum*Esum-pxsum_flip*pxsum_flip-pysum_flip*pysum_flip-pzsum_flip*pzsum_flip);
1659  Double_t ptelam_flip = sqrt(pxsum_flip*pxsum_flip+pysum_flip*pysum_flip);
1660 
1662  UInt_t pdgdg[2]={11,3122};
1663  fCandidateVariables[ 1] = elobj->InvMass(2,pdgdg);
1664  fCandidateVariables[ 2] = elobj->Pt();
1665  fCandidateVariables[ 3] = elobj->Px();
1666  fCandidateVariables[ 4] = elobj->Py();
1667  fCandidateVariables[ 5] = elobj->Pz();
1668  fCandidateVariables[ 6] = elobj->PxProng(0);
1669  fCandidateVariables[ 7] = elobj->PyProng(0);
1670  fCandidateVariables[ 8] = elobj->PzProng(0);
1671  fCandidateVariables[ 9] = elobj->PxProng(1);
1672  fCandidateVariables[10] = elobj->PyProng(1);
1673  fCandidateVariables[11] = elobj->PzProng(1);
1674  fCandidateVariables[12] = anti_lambda_flag;
1675  fCandidateVariables[13] = v0->MassLambda();
1676  fCandidateVariables[14] = v0->MassAntiLambda();
1677  fCandidateVariables[15] = elobj->Getd0Prong(0);
1678  fCandidateVariables[16] = elobj->Getd0Prong(1);
1679 
1680  Double_t nSigmaTPCele=-9999.;
1681  Double_t nSigmaTOFele=-9999.;
1682  Double_t nSigmaTPCv0pr=-9999.;
1683  Double_t nSigmaTOFv0pr=-9999.;
1684  Double_t nSigmaTPCv0pi=-9999.;
1685  Double_t nSigmaTOFv0pi=-9999.;
1686  if(fAnalCuts->GetIsUsePID())
1687  {
1688  nSigmaTPCele = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTPC(trkpid,AliPID::kElectron);
1689  nSigmaTOFele = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTOF(trkpid,AliPID::kElectron);
1690  fCandidateVariables[17] = nSigmaTPCele;
1691  fCandidateVariables[18] = nSigmaTOFele;
1692  }
1693 
1694  if(fAnalCuts->GetUseLambdaPID())
1695  {
1696  if(anti_lambda_flag){
1697  nSigmaTPCv0pr = fAnalCuts->GetPidProton()->GetPidResponse()->NumberOfSigmasTPC(cntrack,AliPID::kProton);
1698  nSigmaTOFv0pr = fAnalCuts->GetPidProton()->GetPidResponse()->NumberOfSigmasTOF(cntrack,AliPID::kProton);
1699  nSigmaTPCv0pi = fAnalCuts->GetPidProton()->GetPidResponse()->NumberOfSigmasTPC(cptrack,AliPID::kPion);
1700  nSigmaTOFv0pi = fAnalCuts->GetPidProton()->GetPidResponse()->NumberOfSigmasTOF(cptrack,AliPID::kPion);
1701  }else{
1702  nSigmaTPCv0pr = fAnalCuts->GetPidProton()->GetPidResponse()->NumberOfSigmasTPC(cptrack,AliPID::kProton);
1703  nSigmaTOFv0pr = fAnalCuts->GetPidProton()->GetPidResponse()->NumberOfSigmasTOF(cptrack,AliPID::kProton);
1704  nSigmaTPCv0pi = fAnalCuts->GetPidProton()->GetPidResponse()->NumberOfSigmasTPC(cntrack,AliPID::kPion);
1705  nSigmaTOFv0pi = fAnalCuts->GetPidProton()->GetPidResponse()->NumberOfSigmasTOF(cntrack,AliPID::kPion);
1706  }
1707  fCandidateVariables[19] = nSigmaTPCv0pr;
1708  fCandidateVariables[20] = nSigmaTOFv0pr;
1709  fCandidateVariables[66] = nSigmaTPCv0pi;
1710  fCandidateVariables[67] = nSigmaTOFv0pi;
1711  }
1712  fCandidateVariables[21] = trk->Charge();
1713 
1714  if(anti_lambda_flag){
1715  fCandidateVariables[22] = v0->MomNegX(); //cntrack->Px();
1716  fCandidateVariables[23] = v0->MomNegY(); //cntrack->Py();
1717  fCandidateVariables[24] = v0->MomNegZ(); //cntrack->Pz();
1718  fCandidateVariables[25] = v0->MomPosX(); //cptrack->Px();
1719  fCandidateVariables[26] = v0->MomPosY(); //cptrack->Py();
1720  fCandidateVariables[27] = v0->MomPosZ(); //cptrack->Pz();
1721  }else{
1722  fCandidateVariables[22] = v0->MomPosX(); //cptrack->Px();
1723  fCandidateVariables[23] = v0->MomPosY(); //cptrack->Py();
1724  fCandidateVariables[24] = v0->MomPosZ(); //cptrack->Pz();
1725  fCandidateVariables[25] = v0->MomNegX(); //cntrack->Px();
1726  fCandidateVariables[26] = v0->MomNegY(); //cntrack->Py();
1727  fCandidateVariables[27] = v0->MomNegZ(); //cntrack->Pz();
1728  }
1729 
1730  AliAODMCParticle *mclc = 0;
1731  AliAODMCParticle *mcele = 0;
1732  AliAODMCParticle *mcv0 = 0;
1733  Int_t mclablc = 0;
1734  Int_t mcpdgele_array[100];
1735  Int_t mcpdgv0_array[100];
1736  Int_t mclabelele_array[100];
1737  Int_t mclabelv0_array[100];
1738  Int_t mcngen_ele=-9999;
1739  Int_t mcngen_v0=-9999;
1740 
1741  if(fUseMCInfo && mcArray){
1742  mclablc = MatchToMC(elobj,mcArray,mcpdgele_array, mcpdgv0_array,mclabelele_array,mclabelv0_array,mcngen_ele,mcngen_v0);
1743  if(mclabelele_array[0]>=0){
1744  mcele = (AliAODMCParticle*) mcArray->At(mclabelele_array[0]);
1745  if(mcele){
1746  fCandidateVariables[46] = mcele->Px();
1747  fCandidateVariables[47] = mcele->Py();
1748  fCandidateVariables[48] = mcele->Pz();
1749  }
1750  }
1751  if(mclabelv0_array[0]>=0){
1752  mcv0 = (AliAODMCParticle*) mcArray->At(mclabelv0_array[0]);
1753  if(mcv0){
1754  fCandidateVariables[49] = mcv0->Px();
1755  fCandidateVariables[50] = mcv0->Py();
1756  fCandidateVariables[51] = mcv0->Pz();
1757  fCandidateVariables[72] = mcv0->GetPdgCode();
1758  }
1759  }else{
1760  Int_t pdgdgv0[2]={211,211};
1761  Int_t labV0 = v0->MatchToMC(310,mcArray,2,pdgdgv0); // the V0
1762  if(labV0>=0){
1763  mcv0 = (AliAODMCParticle*) mcArray->At(labV0);
1764  if(mcv0){
1765  fCandidateVariables[49] = mcv0->Px();
1766  fCandidateVariables[50] = mcv0->Py();
1767  fCandidateVariables[51] = mcv0->Pz();
1768  fCandidateVariables[72] = mcv0->GetPdgCode();
1769  }
1770  }
1771  }
1772 
1773  Int_t labPos = cptrack->GetLabel();
1774  if(labPos>=0){
1775  AliAODMCParticle *mcv0pos = (AliAODMCParticle*)mcArray->At(labPos);
1776  fCandidateVariables[73] = mcv0pos->Px();
1777  fCandidateVariables[74] = mcv0pos->Py();
1778  fCandidateVariables[75] = mcv0pos->Pz();
1779  fCandidateVariables[76] = mcv0pos->GetPdgCode();
1780  fCandidateVariables[87] = mcv0pos->Xv();
1781  fCandidateVariables[88] = mcv0pos->Yv();
1782  fCandidateVariables[89] = mcv0pos->Zv();
1783  }
1784  Int_t labNeg = cntrack->GetLabel();
1785  if(labNeg>=0){
1786  AliAODMCParticle *mcv0neg = (AliAODMCParticle*)mcArray->At(labNeg);
1787  fCandidateVariables[77] = mcv0neg->Px();
1788  fCandidateVariables[78] = mcv0neg->Py();
1789  fCandidateVariables[79] = mcv0neg->Pz();
1790  fCandidateVariables[80] = mcv0neg->GetPdgCode();
1791  }
1792 
1793  if(mclablc>-1){
1794  mclc = (AliAODMCParticle*) mcArray->At(mclablc);
1795  if(mclc){
1796  fCandidateVariables[28] = mclc->GetPdgCode();
1797  fCandidateVariables[29] = mclc->Label();
1798  fCandidateVariables[43] = mclc->Px();
1799  fCandidateVariables[44] = mclc->Py();
1800  fCandidateVariables[45] = mclc->Pz();
1801  }
1802  }
1803  fCandidateVariables[30] = mcpdgele_array[1];
1804  fCandidateVariables[31] = mcpdgv0_array[1];
1805  fCandidateVariables[33] = mcpdgele_array[0];
1806  fCandidateVariables[39] = mcpdgele_array[2];
1807  fCandidateVariables[40] = mcpdgv0_array[2];
1808  fCandidateVariables[41] = mcngen_ele;
1809  fCandidateVariables[42] = mcngen_v0;
1810  }
1811  fCandidateVariables[32] = 0;
1812 
1813  if(fAnalCuts->GetIsUsePID())
1814  {
1815  Double_t nSigmaTPCpr_etrk = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTPC(trkpid,AliPID::kProton);
1816  Double_t nSigmaTOFpr_etrk = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTOF(trkpid,AliPID::kProton);
1817  Double_t nSigmaTPCka_etrk = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTPC(trkpid,AliPID::kKaon);
1818  Double_t nSigmaTOFka_etrk = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTOF(trkpid,AliPID::kKaon);
1819  Double_t nSigmaTPCpi_etrk = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTPC(trkpid,AliPID::kPion);
1820  Double_t nSigmaTOFpi_etrk = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTOF(trkpid,AliPID::kPion);
1821  fCandidateVariables[34] = nSigmaTPCpr_etrk;
1822  fCandidateVariables[35] = nSigmaTOFpr_etrk;
1823  fCandidateVariables[36] = nSigmaTPCka_etrk;
1824  fCandidateVariables[37] = nSigmaTOFka_etrk;
1825  fCandidateVariables[52] = nSigmaTPCpi_etrk;
1826  fCandidateVariables[53] = nSigmaTOFpi_etrk;
1827  }
1828  fCandidateVariables[38] = v0->MassK0Short();
1829 
1830  fCandidateVariables[54] = fVtx1->GetX();
1831  fCandidateVariables[55] = fVtx1->GetY();
1832  fCandidateVariables[56] = fVtx1->GetZ();
1833  fCandidateVariables[57] = v0->DecayVertexV0X();
1834  fCandidateVariables[58] = v0->DecayVertexV0Y();
1835  fCandidateVariables[59] = v0->DecayVertexV0Z();
1836 
1837  Double_t lDcaPosToPrimVertex = v0->DcaPosToPrimVertex();
1838  Double_t lDcaNegToPrimVertex = v0->DcaNegToPrimVertex();
1839  if(!anti_lambda_flag){
1840  fCandidateVariables[60] = lDcaPosToPrimVertex;
1841  fCandidateVariables[61] = lDcaNegToPrimVertex;
1842  }else{
1843  fCandidateVariables[60] = lDcaNegToPrimVertex;
1844  fCandidateVariables[61] = lDcaPosToPrimVertex;
1845  }
1846  fCandidateVariables[62] = v0->DcaV0Daughters();
1847  Double_t posVtx[3] = {0.,0.,0.};
1848  fVtx1->GetXYZ(posVtx);
1849  fCandidateVariables[63] = v0->CosPointingAngle(posVtx);
1850  Double_t ptotlam = TMath::Sqrt(pow(v0->Px(),2)+pow(v0->Py(),2)+pow(v0->Pz(),2));
1851  fCandidateVariables[64] = v0->DecayLengthV0(posVtx)*1.1157/ptotlam;
1852  fCandidateVariables[65] = v0->MassK0Short();
1853 
1854  if(trk) fCandidateVariables[68] = trk->GetITSClusterMap();
1855  if(cptrack) fCandidateVariables[69] = cptrack->GetITSClusterMap();
1856  if(cntrack) fCandidateVariables[70] = cntrack->GetITSClusterMap();
1857 
1859 
1860  if(!anti_lambda_flag){
1861  fCandidateVariables[81] = cptrack->Px();
1862  fCandidateVariables[82] = cptrack->Py();
1863  fCandidateVariables[83] = cptrack->Pz();
1864  fCandidateVariables[84] = cntrack->Px();
1865  fCandidateVariables[85] = cntrack->Py();
1866  fCandidateVariables[86] = cntrack->Pz();
1867  }else{
1868  fCandidateVariables[81] = cntrack->Px();
1869  fCandidateVariables[82] = cntrack->Py();
1870  fCandidateVariables[83] = cntrack->Pz();
1871  fCandidateVariables[84] = cptrack->Px();
1872  fCandidateVariables[85] = cptrack->Py();
1873  fCandidateVariables[86] = cptrack->Pz();
1874  }
1875 
1878 
1879  if(fWriteVariableTree)
1880  fVariablesTree->Fill();
1881 
1882  Double_t dphis_ele_pr, detas_ele_pr,dphis_ele_pi, detas_ele_pi;
1883  dphis_ele_pr = 9999.;detas_ele_pr = 9999.;dphis_ele_pi = 9999.;detas_ele_pi = 9999.;
1884  //fAnalCuts->GetdPhiSdEtaSR125(trk,cptrack,cntrack,fBzkG,posVtx, dphis_ele_pr,detas_ele_pr,dphis_ele_pi,detas_ele_pi);
1885 
1886  Double_t cont[3];
1887  cont[0] = elobj->InvMass(2,pdgdg);
1888  cont[1] = elobj->Pt();
1889  cont[2] = fCentrality;
1890  fHistoEleLambdaMass->Fill(cont);
1891 
1892  Double_t cont_flip[3];
1893  cont_flip[0] = melam_flip;
1894  cont_flip[1] = ptelam_flip;
1895  cont_flip[2] = fCentrality;
1896 
1897  Double_t cont2[3];
1898  cont2[0] = elobj->InvMass(2,pdgdg);
1899  cont2[1] = trk->Pt();
1900  cont2[2] = fCentrality;
1901  Double_t cont_eleptvseta[3];
1902  cont_eleptvseta[0] = trk->Pt();
1903  cont_eleptvseta[1] = trk->Eta();
1904  cont_eleptvseta[2] = fCentrality;
1905 
1906  Double_t cont_eleptvslambdapt[3];
1907  cont_eleptvslambdapt[0] = trk->Pt();
1908  cont_eleptvslambdapt[1] = v0->Pt();
1909  cont_eleptvslambdapt[2] = fCentrality;
1910 
1911  Double_t cont_eleptvsd0[3];
1912  cont_eleptvsd0[0] = trk->Pt();
1913  cont_eleptvsd0[1] = elobj->Getd0Prong(0)*trk->Charge();
1914  cont_eleptvsd0[2] = fCentrality;
1915 
1916  Double_t cont_eleptvsv0dl[3];
1917  cont_eleptvsv0dl[0] = trk->Pt();
1918  cont_eleptvsv0dl[1] = v0->DecayLengthV0(posVtx)*1.115683/ptotlam;
1919  cont_eleptvsv0dl[2] = fCentrality;
1920 
1921  Double_t cont_elelamptvsv0dl[4];
1922  cont_elelamptvsv0dl[0] = elobj->Pt();
1923  cont_elelamptvsv0dl[1] = v0->DecayLengthV0(posVtx)*1.115683/ptotlam;
1924  cont_elelamptvsv0dl[2] = elobj->Getd0Prong(0)*trk->Charge();
1925  cont_elelamptvsv0dl[3] = fCentrality;
1926 
1927  Double_t cont_elelamptvsv0dl_flip[4];
1928  cont_elelamptvsv0dl_flip[0] = ptelam_flip;
1929  cont_elelamptvsv0dl_flip[1] = v0->DecayLengthV0(posVtx)*1.115683/ptotlam;
1930  cont_elelamptvsv0dl_flip[2] = 0.0;
1931  cont_elelamptvsv0dl_flip[3] = fCentrality;
1932 
1933 
1934  Double_t cont_eleptvsv0dca[3];
1935  cont_eleptvsv0dca[0] = trk->Pt();
1936  cont_eleptvsv0dca[1] = v0->DcaV0ToPrimVertex();
1937  cont_eleptvsv0dca[2] = fCentrality;
1938 
1939  Double_t elobj_mass = elobj->InvMass(2,pdgdg);
1940  Double_t elobj_px = elobj->Px();
1941  Double_t elobj_py = elobj->Py();
1942  Double_t elobj_pz = elobj->Pz();
1943  Double_t elobj_E = sqrt(elobj_mass*elobj_mass+elobj_px*elobj_px+elobj_py*elobj_py+elobj_pz*elobj_pz);
1944  Double_t elobj_rap = 0.5*log((elobj_E+elobj_pz)/(elobj_E-elobj_pz));
1945 
1947  {
1948  if((trk->Charge()>0 && !anti_lambda_flag) || (trk->Charge()<0 && anti_lambda_flag)){
1949  fHistoEleLambdaMassRS->Fill(cont);
1950  if(trk->Charge()>0) fHistoEleLambdaMassRS1->Fill(cont);
1951  else fHistoEleLambdaMassRS2->Fill(cont);
1952 
1953  fHistoEleLambdaMassvsElePtRS->Fill(cont2);
1954  if(trk->Charge()>0) fHistoEleLambdaMassvsElePtRS1->Fill(cont2);
1955  else fHistoEleLambdaMassvsElePtRS2->Fill(cont2);
1956  if(cont[0]<2.3){
1957  fHistoEleLambdaPtvsRapidityRS->Fill(elobj->Pt(),elobj_rap);
1958  fHistoElePtRS->Fill(trk->Pt(),fCentrality);
1959  fHistoElePtvsEtaRS->Fill(cont_eleptvseta);
1960  fHistoElePtvsLambdaPtRS->Fill(cont_eleptvslambdapt);
1961  fHistoElePtvsd0RS->Fill(cont_eleptvsd0);
1962 
1963  fHistoElePtvsV0dlRS->Fill(cont_eleptvsv0dl);
1964  if(trk->Charge()>0) fHistoElePtvsV0dlRS1->Fill(cont_eleptvsv0dl);
1965  else fHistoElePtvsV0dlRS2->Fill(cont_eleptvsv0dl);
1966 
1967  fHistoEleLambdaPtvsV0dlRS->Fill(cont_elelamptvsv0dl);
1968  if(trk->Charge()>0) fHistoEleLambdaPtvsV0dlRS1->Fill(cont_elelamptvsv0dl);
1969  else fHistoEleLambdaPtvsV0dlRS2->Fill(cont_elelamptvsv0dl);
1970 
1971  fHistoElePtvsV0dcaRS->Fill(cont_eleptvsv0dca);
1972  if(trk->Charge()>0) fHistoElePtvsV0dcaRS1->Fill(cont_eleptvsv0dca);
1973  else fHistoElePtvsV0dcaRS2->Fill(cont_eleptvsv0dca);
1974 
1975  for(Int_t ih=0;ih<17;ih++){
1976  Double_t cont_eleptvscutvars[3];
1977  cont_eleptvscutvars[0] = elobj->Pt();
1978  cont_eleptvscutvars[2] = fCentrality;
1979 
1980  if(ih==0){
1981  cont_eleptvscutvars[1] = trk->GetTPCNcls();
1982  }else if(ih==1){
1983  cont_eleptvscutvars[1] = trk->GetTPCsignalN();
1984  }else if(ih==2){
1985  cont_eleptvscutvars[1] = nSigmaTPCele;
1986  }else if(ih==3){
1987  cont_eleptvscutvars[1] = nSigmaTOFele;
1988  }else if(ih==4){
1989  cont_eleptvscutvars[1] = trk->Eta();
1990  }else if(ih==5){
1991  cont_eleptvscutvars[1] = trk->GetITSNcls();
1992  }else if(ih==6){
1993  if(!anti_lambda_flag)
1994  cont_eleptvscutvars[1] = v0->MassLambda();
1995  else
1996  cont_eleptvscutvars[1] = v0->MassAntiLambda();
1997  }else if(ih==7){
1998  Double_t lPosV0[3];
1999  lPosV0[0] = v0->DecayVertexV0X();
2000  lPosV0[1] = v0->DecayVertexV0Y();
2001  lPosV0[2] = v0->DecayVertexV0Z();
2002  cont_eleptvscutvars[1] = TMath::Sqrt(lPosV0[0]*lPosV0[0]+lPosV0[1]*lPosV0[1]);
2003  }else if(ih==8){
2004  cont_eleptvscutvars[1] = v0->DcaV0Daughters();
2005  }else if(ih==9){
2006  if(!anti_lambda_flag)
2007  cont_eleptvscutvars[1] = v0->DcaPosToPrimVertex();
2008  else
2009  cont_eleptvscutvars[1] = v0->DcaNegToPrimVertex();
2010  }else if(ih==10){
2011  if(!anti_lambda_flag)
2012  cont_eleptvscutvars[1] = v0->DcaNegToPrimVertex();
2013  else
2014  cont_eleptvscutvars[1] = v0->DcaPosToPrimVertex();
2015  }else if(ih==11){
2016  cont_eleptvscutvars[1] = v0->CosPointingAngle(posVtx);
2017  }else if(ih==12){
2018  cont_eleptvscutvars[1] = v0->MassK0Short();
2019  }else if(ih==13){
2020  cont_eleptvscutvars[1] = nSigmaTPCv0pr;
2021  }else if(ih==14){
2022  cont_eleptvscutvars[1] = nSigmaTPCv0pi;
2023  }else if(ih==15){
2024  cont_eleptvscutvars[1] = v0->Eta();
2025  }else if(ih==16){
2026  Double_t v0px = elobj->PxProng(1);
2027  Double_t v0py = elobj->PyProng(1);
2028  Double_t v0pz = elobj->PzProng(1);
2029  Double_t epx = elobj->PxProng(0);
2030  Double_t epy = elobj->PyProng(0);
2031  Double_t epz = elobj->PzProng(0);
2032  cont_eleptvscutvars[1] = acos((v0px*epx+v0py*epy+v0pz*epz)/sqrt(v0px*v0px+v0py*v0py+v0pz*v0pz)/sqrt(epx*epx+epy*epy+epz*epz));
2033  }else{
2034  cont_eleptvscutvars[1] = -9999.;
2035  }
2036 
2037  fHistoElePtvsCutVarsRS[ih]->Fill(cont_eleptvscutvars);
2038  }
2039  }
2040  if(fUseMCInfo){
2041  if(mclc){
2042  Int_t pdgcode = mclc->GetPdgCode();
2043  Double_t cont_mclc[3];
2044  cont_mclc[0] = mclc->Pt();
2045  cont_mclc[1] = mclc->Y();
2046  cont_mclc[2] = fCentrality;
2047  Double_t cont_mcele[3];
2048  cont_mcele[0] = mcele->Pt();
2049  cont_mcele[1] = mcele->Eta();
2050  cont_mcele[2] = fCentrality;
2051 
2052  Int_t labmotherlc = mclc->GetMother();
2053  Bool_t isbottomfd = kFALSE;
2054  if(labmotherlc>=0){
2055  AliAODMCParticle *motherlc = (AliAODMCParticle*)mcArray->At(labmotherlc);
2056  Int_t pdgmotherlc = motherlc->GetPdgCode();
2057  if(TMath::Abs(pdgmotherlc)==511||TMath::Abs(pdgmotherlc)==521||TMath::Abs(pdgmotherlc)==5122||TMath::Abs(pdgmotherlc)==5132||TMath::Abs(pdgmotherlc)==5232||TMath::Abs(pdgmotherlc)==5332){
2058  isbottomfd = kTRUE;
2059  }
2060  }
2061  cont2[1] = mcele->Pt();
2062 
2063  if(abs(pdgcode)==4122 && abs(mcpdgele_array[1])==4122 && abs(mcpdgv0_array[1])==4122){
2064  fHistoEleLambdaMassMCS->Fill(cont);
2065  fHistoEleLambdaMassvsElePtMCS->Fill(cont2);
2066  if(trk->Charge()>0) fHistoEleLambdaMassvsElePtMCS1->Fill(cont2);
2067  else fHistoEleLambdaMassvsElePtMCS2->Fill(cont2);
2068  if(cont[0]<2.3){
2069  fHistoEleLambdaPtvsRapidityMCS->Fill(elobj->Pt(),elobj_rap);
2070  fHistoElePtMCS->Fill(trk->Pt(),fCentrality);
2071  fHistoElePtvsEtaMCS->Fill(cont_eleptvseta);
2072  fHistoElePtvsLambdaPtMCS->Fill(cont_eleptvslambdapt);
2073  fHistoElePtvsd0MCS->Fill(cont_eleptvsd0);
2074 
2075  fHistoElePtvsV0dlMCS->Fill(cont_eleptvsv0dl);
2076  if(trk->Charge()>0) fHistoElePtvsV0dlMCS1->Fill(cont_eleptvsv0dl);
2077  else fHistoElePtvsV0dlMCS2->Fill(cont_eleptvsv0dl);
2078 
2079  fHistoElePtvsV0dcaMCS->Fill(cont_eleptvsv0dca);
2080  if(trk->Charge()>0) fHistoElePtvsV0dcaMCS1->Fill(cont_eleptvsv0dca);
2081  else fHistoElePtvsV0dcaMCS2->Fill(cont_eleptvsv0dca);
2082 
2083  fHistoEleLambdaPtvsV0dlMCS->Fill(cont_elelamptvsv0dl);
2084  if(trk->Charge()>0) fHistoEleLambdaPtvsV0dlMCS1->Fill(cont_elelamptvsv0dl);
2085  else fHistoEleLambdaPtvsV0dlMCS2->Fill(cont_elelamptvsv0dl);
2086 
2087  if(isbottomfd){
2088  fHistoEleLambdaPtvsV0dlBFeeddownMCS->Fill(cont_elelamptvsv0dl);
2089  if(trk->Charge()>0) fHistoEleLambdaPtvsV0dlBFeeddownMCS1->Fill(cont_elelamptvsv0dl);
2090  else fHistoEleLambdaPtvsV0dlBFeeddownMCS2->Fill(cont_elelamptvsv0dl);
2091  }else{
2092  fHistoEleLambdaPtvsV0dlPromptMCS->Fill(cont_elelamptvsv0dl);
2093  if(trk->Charge()>0) fHistoEleLambdaPtvsV0dlPromptMCS1->Fill(cont_elelamptvsv0dl);
2094  else fHistoEleLambdaPtvsV0dlPromptMCS2->Fill(cont_elelamptvsv0dl);
2095  }
2096 
2097  fHistoLcMCS->Fill(cont_mclc);
2098  if(trk->Charge()>0) fHistoLcMCS1->Fill(cont_mclc);
2099  else fHistoLcMCS2->Fill(cont_mclc);
2100 
2101  fHistoLcElectronMCS->Fill(cont_mcele);
2102  if(trk->Charge()>0) fHistoLcElectronMCS1->Fill(cont_mcele);
2103  else fHistoLcElectronMCS2->Fill(cont_mcele);
2104 
2105  fHistoResponseElePt->Fill(mcele->Pt(),trk->Pt());
2106  if(trk->Charge()>0) fHistoResponseElePt1->Fill(mcele->Pt(),trk->Pt());
2107  else fHistoResponseElePt2->Fill(mcele->Pt(),trk->Pt());
2108  fHistoResponseEleLambdaPt->Fill(mclc->Pt(),elobj->Pt());
2109  if(trk->Charge()>0) fHistoResponseEleLambdaPt1->Fill(mclc->Pt(),trk->Pt());
2110  else fHistoResponseEleLambdaPt2->Fill(mclc->Pt(),trk->Pt());
2111 
2112  Double_t cont_eleptvslambdaptvslcpt[4];
2113  cont_eleptvslambdaptvslcpt[0] = cont_eleptvslambdapt[0];
2114  cont_eleptvslambdaptvslcpt[1] = cont_eleptvslambdapt[1];
2115  cont_eleptvslambdaptvslcpt[2] = mclc->Pt();
2116  cont_eleptvslambdaptvslcpt[3] = cont_eleptvslambdapt[2];
2117  fHistoElePtvsLambdaPtvsLcPtMCS->Fill(cont_eleptvslambdaptvslcpt);
2118 
2119  Double_t cont_allpt[4];
2120  cont_allpt[0] = mclc->Pt();
2121  cont_allpt[1] = elobj->Pt();
2122  cont_allpt[2] = trk->Pt();
2123  cont_allpt[3] = v0->Pt();
2124  fHistoLcPtvseleLambdaPtvsElePtvsLambdaPt->Fill(cont_allpt);
2125 
2126  if(isbottomfd){
2127  fHistoElePtvsd0BFeeddownMCS->Fill(cont_eleptvsd0);
2128  }else{
2129  fHistoElePtvsd0PromptMCS->Fill(cont_eleptvsd0);
2130  }
2131 
2132  for(Int_t ih=0;ih<17;ih++){
2133  Double_t cont_eleptvscutvars[3];
2134  cont_eleptvscutvars[0] = elobj->Pt();
2135  cont_eleptvscutvars[2] = fCentrality;
2136 
2137  if(ih==0){
2138  cont_eleptvscutvars[1] = trk->GetTPCNcls();
2139  }else if(ih==1){
2140  cont_eleptvscutvars[1] = trk->GetTPCsignalN();
2141  }else if(ih==2){
2142  cont_eleptvscutvars[1] = nSigmaTPCele;
2143  }else if(ih==3){
2144  cont_eleptvscutvars[1] = nSigmaTOFele;
2145  }else if(ih==4){
2146  cont_eleptvscutvars[1] = trk->Eta();
2147  }else if(ih==5){
2148  cont_eleptvscutvars[1] = trk->GetITSNcls();
2149  }else if(ih==6){
2150  if(!anti_lambda_flag)
2151  cont_eleptvscutvars[1] = v0->MassLambda();
2152  else
2153  cont_eleptvscutvars[1] = v0->MassAntiLambda();
2154  }else if(ih==7){
2155  Double_t lPosV0[3];
2156  lPosV0[0] = v0->DecayVertexV0X();
2157  lPosV0[1] = v0->DecayVertexV0Y();
2158  lPosV0[2] = v0->DecayVertexV0Z();
2159  cont_eleptvscutvars[1] = TMath::Sqrt(lPosV0[0]*lPosV0[0]+lPosV0[1]*lPosV0[1]);
2160  }else if(ih==8){
2161  cont_eleptvscutvars[1] = v0->DcaV0Daughters();
2162  }else if(ih==9){
2163  if(!anti_lambda_flag)
2164  cont_eleptvscutvars[1] = v0->DcaPosToPrimVertex();
2165  else
2166  cont_eleptvscutvars[1] = v0->DcaNegToPrimVertex();
2167  }else if(ih==10){
2168  if(!anti_lambda_flag)
2169  cont_eleptvscutvars[1] = v0->DcaNegToPrimVertex();
2170  else
2171  cont_eleptvscutvars[1] = v0->DcaPosToPrimVertex();
2172  }else if(ih==11){
2173  cont_eleptvscutvars[1] = v0->CosPointingAngle(posVtx);
2174  }else if(ih==12){
2175  cont_eleptvscutvars[1] = v0->MassK0Short();
2176  }else if(ih==13){
2177  cont_eleptvscutvars[1] = nSigmaTPCv0pr;
2178  }else if(ih==14){
2179  cont_eleptvscutvars[1] = nSigmaTPCv0pi;
2180  }else if(ih==15){
2181  cont_eleptvscutvars[1] = v0->Eta();
2182  }else if(ih==16){
2183  Double_t v0px = elobj->PxProng(1);
2184  Double_t v0py = elobj->PyProng(1);
2185  Double_t v0pz = elobj->PzProng(1);
2186  Double_t epx = elobj->PxProng(0);
2187  Double_t epy = elobj->PyProng(0);
2188  Double_t epz = elobj->PzProng(0);
2189  cont_eleptvscutvars[1] = acos((v0px*epx+v0py*epy+v0pz*epz)/sqrt(v0px*v0px+v0py*v0py+v0pz*v0pz)/sqrt(epx*epx+epy*epy+epz*epz));
2190  }else{
2191  cont_eleptvscutvars[1] = -9999.;
2192  }
2193 
2194  fHistoElePtvsCutVarsMCS[ih]->Fill(cont_eleptvscutvars);
2195  }
2196  }
2197  }
2198  if(abs(pdgcode)==4132 && abs(mcpdgele_array[1])==4132 && abs(mcpdgv0_array[1])==3312){
2201  if(trk->Charge()>0) fHistoEleLambdaMassvsElePtFeeddownXic0MCS1->Fill(cont2);
2203  if(cont[0]<2.3){
2204  fHistoFeedDownXic0MCS->Fill(cont_mclc);
2205  if(trk->Charge()>0) fHistoFeedDownXic0MCS1->Fill(cont_mclc);
2206  else fHistoFeedDownXic0MCS2->Fill(cont_mclc);
2207 
2208  fHistoElectronFeedDownXic0MCS1->Fill(cont_mcele);
2209  if(trk->Charge()>0) fHistoElectronFeedDownXic0MCS1->Fill(cont_mcele);
2210  else fHistoElectronFeedDownXic0MCS2->Fill(cont_mcele);
2211 
2212  fHistoElePtvsV0dlFeedDownXic0MCS->Fill(cont_eleptvsv0dl);
2213  if(trk->Charge()>0) fHistoElePtvsV0dlFeedDownXic0MCS1->Fill(cont_eleptvsv0dl);
2214  else fHistoElePtvsV0dlFeedDownXic0MCS2->Fill(cont_eleptvsv0dl);
2215 
2216  fHistoEleLambdaPtvsV0dlFeedDownXic0MCS->Fill(cont_elelamptvsv0dl);
2217  if(trk->Charge()>0) fHistoEleLambdaPtvsV0dlFeedDownXic0MCS1->Fill(cont_elelamptvsv0dl);
2218  else fHistoEleLambdaPtvsV0dlFeedDownXic0MCS2->Fill(cont_elelamptvsv0dl);
2219 
2220  if(isbottomfd){
2221  fHistoEleLambdaPtvsV0dlFeedDownXic0BFeeddownMCS->Fill(cont_elelamptvsv0dl);
2222  if(trk->Charge()>0) fHistoEleLambdaPtvsV0dlFeedDownXic0BFeeddownMCS1->Fill(cont_elelamptvsv0dl);
2223  else fHistoEleLambdaPtvsV0dlFeedDownXic0BFeeddownMCS2->Fill(cont_elelamptvsv0dl);
2224  }else{
2225  fHistoEleLambdaPtvsV0dlFeedDownXic0PromptMCS->Fill(cont_elelamptvsv0dl);
2226  if(trk->Charge()>0) fHistoEleLambdaPtvsV0dlFeedDownXic0PromptMCS1->Fill(cont_elelamptvsv0dl);
2227  else fHistoEleLambdaPtvsV0dlFeedDownXic0PromptMCS2->Fill(cont_elelamptvsv0dl);
2228  }
2229 
2230  fHistoElePtvsV0dcaFeedDownXic0MCS->Fill(cont_eleptvsv0dca);
2231  if(trk->Charge()>0) fHistoElePtvsV0dcaFeedDownXic0MCS->Fill(cont_eleptvsv0dca);
2232  else fHistoElePtvsV0dcaFeedDownXic0MCS->Fill(cont_eleptvsv0dca);
2233 
2234  fHistoResponseEleLambdaPtFeeddownXic0->Fill(mclc->Pt(),elobj->Pt());
2235  if(trk->Charge()>0) fHistoResponseEleLambdaPtFeeddownXic01->Fill(mclc->Pt(),trk->Pt());
2236  else fHistoResponseEleLambdaPtFeeddownXic02->Fill(mclc->Pt(),trk->Pt());
2237 
2238  fHistoElePtFeeddownXic0MCS->Fill(trk->Pt(),fCentrality);
2239  fHistoElePtvsEtaFeeddownXic0MCS->Fill(cont_eleptvseta);
2240  fHistoElePtvsLambdaPtFeeddownXic0MCS->Fill(cont_eleptvslambdapt);
2241  }
2242  }
2243  if(abs(pdgcode)==4232 && abs(mcpdgele_array[1])==4232 && abs(mcpdgv0_array[1])==3322){
2246  if(trk->Charge()>0) fHistoEleLambdaMassvsElePtFeeddownXicPlusMCS1->Fill(cont2);
2248  if(cont[0]<2.3){
2249  fHistoFeedDownXicPlusMCS->Fill(cont_mclc);
2250  if(trk->Charge()>0) fHistoFeedDownXicPlusMCS1->Fill(cont_mclc);
2251  else fHistoFeedDownXicPlusMCS2->Fill(cont_mclc);
2252 
2253  fHistoElectronFeedDownXicPlusMCS1->Fill(cont_mcele);
2254  if(trk->Charge()>0) fHistoElectronFeedDownXicPlusMCS1->Fill(cont_mcele);
2255  else fHistoElectronFeedDownXicPlusMCS2->Fill(cont_mcele);
2256 
2257  fHistoElePtvsV0dlFeedDownXicPlusMCS->Fill(cont_eleptvsv0dl);
2258  if(trk->Charge()>0) fHistoElePtvsV0dlFeedDownXicPlusMCS1->Fill(cont_eleptvsv0dl);
2259  else fHistoElePtvsV0dlFeedDownXicPlusMCS2->Fill(cont_eleptvsv0dl);
2260 
2261  fHistoEleLambdaPtvsV0dlFeedDownXicPlusMCS->Fill(cont_elelamptvsv0dl);
2262  if(trk->Charge()>0) fHistoEleLambdaPtvsV0dlFeedDownXicPlusMCS1->Fill(cont_elelamptvsv0dl);
2263  else fHistoEleLambdaPtvsV0dlFeedDownXicPlusMCS2->Fill(cont_elelamptvsv0dl);
2264 
2265  if(isbottomfd){
2266  fHistoEleLambdaPtvsV0dlFeedDownXicPlusBFeeddownMCS->Fill(cont_elelamptvsv0dl);
2267  if(trk->Charge()>0) fHistoEleLambdaPtvsV0dlFeedDownXicPlusBFeeddownMCS1->Fill(cont_elelamptvsv0dl);
2268  else fHistoEleLambdaPtvsV0dlFeedDownXicPlusBFeeddownMCS2->Fill(cont_elelamptvsv0dl);
2269  }else{
2270  fHistoEleLambdaPtvsV0dlFeedDownXicPlusPromptMCS->Fill(cont_elelamptvsv0dl);
2271  if(trk->Charge()>0) fHistoEleLambdaPtvsV0dlFeedDownXicPlusPromptMCS1->Fill(cont_elelamptvsv0dl);
2272  else fHistoEleLambdaPtvsV0dlFeedDownXicPlusPromptMCS2->Fill(cont_elelamptvsv0dl);
2273  }
2274 
2275  fHistoElePtvsV0dcaFeedDownXicPlusMCS->Fill(cont_eleptvsv0dca);
2276  if(trk->Charge()>0) fHistoElePtvsV0dcaFeedDownXicPlusMCS->Fill(cont_eleptvsv0dca);
2277  else fHistoElePtvsV0dcaFeedDownXicPlusMCS->Fill(cont_eleptvsv0dca);
2278 
2279  fHistoResponseEleLambdaPtFeeddownXicPlus->Fill(mclc->Pt(),elobj->Pt());
2280  if(trk->Charge()>0) fHistoResponseEleLambdaPtFeeddownXicPlus1->Fill(mclc->Pt(),trk->Pt());
2281  else fHistoResponseEleLambdaPtFeeddownXicPlus2->Fill(mclc->Pt(),trk->Pt());
2282 
2283  fHistoElePtFeeddownXicPlusMCS->Fill(trk->Pt(),fCentrality);
2284  fHistoElePtvsEtaFeeddownXicPlusMCS->Fill(cont_eleptvseta);
2285  fHistoElePtvsLambdaPtFeeddownXicPlusMCS->Fill(cont_eleptvslambdapt);
2286  }
2287  }
2288  if(abs(pdgcode)==4122 && abs(mcpdgele_array[1])==4122 && ( abs(mcpdgv0_array[1])==3212 || abs(mcpdgv0_array[1])==3214 || abs(mcpdgv0_array[1])==3224) ){
2289  if(cont[0]<2.3){
2290  fHistoFeedDownSigmaMCS->Fill(cont_mclc);
2291  if(trk->Charge()>0) fHistoFeedDownSigmaMCS1->Fill(cont_mclc);
2292  else fHistoFeedDownSigmaMCS2->Fill(cont_mclc);
2293 
2294  fHistoEleLambdaPtvsV0dlFeedDownSigmaMCS->Fill(cont_elelamptvsv0dl);
2295  if(trk->Charge()>0) fHistoEleLambdaPtvsV0dlFeedDownSigmaMCS1->Fill(cont_elelamptvsv0dl);
2296  else fHistoEleLambdaPtvsV0dlFeedDownSigmaMCS2->Fill(cont_elelamptvsv0dl);
2297 
2298  if(isbottomfd){
2299  fHistoEleLambdaPtvsV0dlFeedDownSigmaBFeeddownMCS->Fill(cont_elelamptvsv0dl);
2300  if(trk->Charge()>0) fHistoEleLambdaPtvsV0dlFeedDownSigmaBFeeddownMCS1->Fill(cont_elelamptvsv0dl);
2301  else fHistoEleLambdaPtvsV0dlFeedDownSigmaBFeeddownMCS2->Fill(cont_elelamptvsv0dl);
2302  }else{
2303  fHistoEleLambdaPtvsV0dlFeedDownSigmaPromptMCS->Fill(cont_elelamptvsv0dl);
2304  if(trk->Charge()>0) fHistoEleLambdaPtvsV0dlFeedDownSigmaPromptMCS1->Fill(cont_elelamptvsv0dl);
2305  else fHistoEleLambdaPtvsV0dlFeedDownSigmaPromptMCS2->Fill(cont_elelamptvsv0dl);
2306  }
2307  fHistoResponseEleLambdaPtFeeddownSigma->Fill(mclc->Pt(),elobj->Pt());
2308  if(trk->Charge()>0) fHistoResponseEleLambdaPtFeeddownSigma1->Fill(mclc->Pt(),trk->Pt());
2309  else fHistoResponseEleLambdaPtFeeddownSigma2->Fill(mclc->Pt(),trk->Pt());
2310  }
2311  }
2312  }
2313  }
2314  fHistodPhiSdEtaSElectronProtonR125RS->Fill(dphis_ele_pr,detas_ele_pr);
2315  fHistodPhiSdEtaSElectronPionR125RS->Fill(dphis_ele_pi,detas_ele_pi);
2316  }else if((trk->Charge()<0 && !anti_lambda_flag) || (trk->Charge()>0 && anti_lambda_flag)){
2317  fHistoEleLambdaMassWS->Fill(cont);
2318  if(trk->Charge()>0) fHistoEleLambdaMassWS1->Fill(cont);
2319  else fHistoEleLambdaMassWS2->Fill(cont);
2320 
2321  fHistoEleLambdaMassvsElePtWS->Fill(cont2);
2322  if(trk->Charge()>0) fHistoEleLambdaMassvsElePtWS1->Fill(cont2);
2323  else fHistoEleLambdaMassvsElePtWS2->Fill(cont2);
2324  if(cont[0]<2.3){
2325  fHistoEleLambdaPtvsRapidityWS->Fill(elobj->Pt(),elobj_rap);
2326  fHistoElePtWS->Fill(trk->Pt(),fCentrality);
2327  fHistoElePtvsEtaWS->Fill(cont_eleptvseta);
2328  fHistoElePtvsLambdaPtWS->Fill(cont_eleptvslambdapt);
2329  fHistoElePtvsd0WS->Fill(cont_eleptvsd0);
2330 
2331  fHistoElePtvsV0dlWS->Fill(cont_eleptvsv0dl);
2332  if(trk->Charge()>0) fHistoElePtvsV0dlWS1->Fill(cont_eleptvsv0dl);
2333  else fHistoElePtvsV0dlWS2->Fill(cont_eleptvsv0dl);
2334 
2335  fHistoEleLambdaPtvsV0dlWS->Fill(cont_elelamptvsv0dl);
2336  if(trk->Charge()>0) fHistoEleLambdaPtvsV0dlWS1->Fill(cont_elelamptvsv0dl);
2337  else fHistoEleLambdaPtvsV0dlWS2->Fill(cont_elelamptvsv0dl);
2338 
2339  fHistoElePtvsV0dcaWS->Fill(cont_eleptvsv0dca);
2340  if(trk->Charge()>0) fHistoElePtvsV0dcaWS1->Fill(cont_eleptvsv0dca);
2341  else fHistoElePtvsV0dcaWS2->Fill(cont_eleptvsv0dca);
2342 
2343  for(Int_t ih=0;ih<17;ih++){
2344  Double_t cont_eleptvscutvars[3];
2345  cont_eleptvscutvars[0] = elobj->Pt();
2346  cont_eleptvscutvars[2] = fCentrality;
2347 
2348  if(ih==0){
2349  cont_eleptvscutvars[1] = trk->GetTPCNcls();
2350  }else if(ih==1){
2351  cont_eleptvscutvars[1] = trk->GetTPCsignalN();
2352  }else if(ih==2){
2353  cont_eleptvscutvars[1] = nSigmaTPCele;
2354  }else if(ih==3){
2355  cont_eleptvscutvars[1] = nSigmaTOFele;
2356  }else if(ih==4){
2357  cont_eleptvscutvars[1] = trk->Eta();
2358  }else if(ih==5){
2359  cont_eleptvscutvars[1] = trk->GetITSNcls();
2360  }else if(ih==6){
2361  if(!anti_lambda_flag)
2362  cont_eleptvscutvars[1] = v0->MassLambda();
2363  else
2364  cont_eleptvscutvars[1] = v0->MassAntiLambda();
2365  }else if(ih==7){
2366  Double_t lPosV0[3];
2367  lPosV0[0] = v0->DecayVertexV0X();
2368  lPosV0[1] = v0->DecayVertexV0Y();
2369  lPosV0[2] = v0->DecayVertexV0Z();
2370  cont_eleptvscutvars[1] = TMath::Sqrt(lPosV0[0]*lPosV0[0]+lPosV0[1]*lPosV0[1]);
2371  }else if(ih==8){
2372  cont_eleptvscutvars[1] = v0->DcaV0Daughters();
2373  }else if(ih==9){
2374  if(!anti_lambda_flag)
2375  cont_eleptvscutvars[1] = v0->DcaPosToPrimVertex();
2376  else
2377  cont_eleptvscutvars[1] = v0->DcaNegToPrimVertex();
2378  }else if(ih==10){
2379  if(!anti_lambda_flag)
2380  cont_eleptvscutvars[1] = v0->DcaNegToPrimVertex();
2381  else
2382  cont_eleptvscutvars[1] = v0->DcaPosToPrimVertex();
2383  }else if(ih==11){
2384  cont_eleptvscutvars[1] = v0->CosPointingAngle(posVtx);
2385  }else if(ih==12){
2386  cont_eleptvscutvars[1] = v0->MassK0Short();
2387  }else if(ih==13){
2388  cont_eleptvscutvars[1] = nSigmaTPCv0pr;
2389  }else if(ih==14){
2390  cont_eleptvscutvars[1] = nSigmaTPCv0pi;
2391  }else if(ih==15){
2392  cont_eleptvscutvars[1] = v0->Eta();
2393  }else if(ih==16){
2394  Double_t v0px = elobj->PxProng(1);
2395  Double_t v0py = elobj->PyProng(1);
2396  Double_t v0pz = elobj->PzProng(1);
2397  Double_t epx = elobj->PxProng(0);
2398  Double_t epy = elobj->PyProng(0);
2399  Double_t epz = elobj->PzProng(0);
2400  cont_eleptvscutvars[1] = acos((v0px*epx+v0py*epy+v0pz*epz)/sqrt(v0px*v0px+v0py*v0py+v0pz*v0pz)/sqrt(epx*epx+epy*epy+epz*epz));
2401  }else{
2402  cont_eleptvscutvars[1] = -9999.;
2403  }
2404 
2405  fHistoElePtvsCutVarsWS[ih]->Fill(cont_eleptvscutvars);
2406  }
2407  }
2408  if(fUseMCInfo){
2409  if(mclc){
2410  Int_t pdgcode = mclc->GetPdgCode();
2411  if(abs(pdgcode)==5122 && abs(mcpdgele_array[1])==5122 && abs(mcpdgv0_array[1])==4122 && abs(mcpdgv0_array[2])==5122){
2412  fHistoEleLambdaMassLambdabMCS->Fill(cont);
2413 
2414  fHistoEleLambdaPtvsV0dlLambdabMCS->Fill(cont_elelamptvsv0dl);
2415  if(trk->Charge()>0) fHistoEleLambdaPtvsV0dlLambdabMCS1->Fill(cont_elelamptvsv0dl);
2416  else fHistoEleLambdaPtvsV0dlLambdabMCS2->Fill(cont_elelamptvsv0dl);
2417  }
2418  if(abs(pdgcode)==5132 && abs(mcpdgele_array[1])==5132 && abs(mcpdgv0_array[1])==4132 && abs(mcpdgv0_array[2])==5132){
2419  fHistoEleLambdaMassXibMCS->Fill(cont);
2420  fHistoEleLambdaPtvsV0dlXibMCS->Fill(cont_elelamptvsv0dl);
2421  if(trk->Charge()>0) fHistoEleLambdaPtvsV0dlXibMCS1->Fill(cont_elelamptvsv0dl);
2422  else fHistoEleLambdaPtvsV0dlXibMCS2->Fill(cont_elelamptvsv0dl);
2423  }
2424  if(abs(pdgcode)==5132 && abs(mcpdgele_array[1])==5132 && abs(mcpdgv0_array[1])==4232 && abs(mcpdgv0_array[2])==5132){
2425  fHistoEleLambdaMassXibMCS->Fill(cont);
2426  fHistoEleLambdaPtvsV0dlXibMCS->Fill(cont_elelamptvsv0dl);
2427  if(trk->Charge()>0) fHistoEleLambdaPtvsV0dlXibMCS1->Fill(cont_elelamptvsv0dl);
2428  else fHistoEleLambdaPtvsV0dlXibMCS2->Fill(cont_elelamptvsv0dl);
2429  }
2430  if(abs(pdgcode)==5232 && abs(mcpdgele_array[1])==5232 && abs(mcpdgv0_array[1])==4132 && abs(mcpdgv0_array[2])==5232){
2431  fHistoEleLambdaMassXibMCS->Fill(cont);
2432  fHistoEleLambdaPtvsV0dlXibMCS->Fill(cont_elelamptvsv0dl);
2433  if(trk->Charge()>0) fHistoEleLambdaPtvsV0dlXibMCS1->Fill(cont_elelamptvsv0dl);
2434  else fHistoEleLambdaPtvsV0dlXibMCS2->Fill(cont_elelamptvsv0dl);
2435  }
2436  if(abs(pdgcode)==5232 && abs(mcpdgele_array[1])==5232 && abs(mcpdgv0_array[1])==4232 && abs(mcpdgv0_array[2])==5232){
2437  fHistoEleLambdaMassXibMCS->Fill(cont);
2438  fHistoEleLambdaPtvsV0dlXibMCS->Fill(cont_elelamptvsv0dl);
2439  if(trk->Charge()>0) fHistoEleLambdaPtvsV0dlXibMCS1->Fill(cont_elelamptvsv0dl);
2440  else fHistoEleLambdaPtvsV0dlXibMCS2->Fill(cont_elelamptvsv0dl);
2441  }
2442  }
2443  }
2444  fHistodPhiSdEtaSElectronProtonR125WS->Fill(dphis_ele_pr,detas_ele_pr);
2445  fHistodPhiSdEtaSElectronPionR125WS->Fill(dphis_ele_pi,detas_ele_pi);
2446  }
2447  }
2448 
2449  //if( elobj->InvMass(2,pdgdg) < 10. && cosoa < 0. && fAnalCuts->IsPeakRegion(v0))
2450  if( melam_flip < 10. && cosoa < 0. && fAnalCuts->IsPeakRegion(v0))
2451  {
2452  if((trk->Charge()>0 && !anti_lambda_flag) || (trk->Charge()<0 && anti_lambda_flag)){
2453  fHistoEleLambdaMassRSAway->Fill(cont_flip);
2454  if(trk->Charge()>0) fHistoEleLambdaMassRS1Away->Fill(cont_flip);
2455  else fHistoEleLambdaMassRS2Away->Fill(cont_flip);
2456  if(cont_flip[0]<2.3){
2457  fHistoEleLambdaPtvsV0dlRSAway->Fill(cont_elelamptvsv0dl_flip);
2458  if(trk->Charge()>0) fHistoEleLambdaPtvsV0dlRS1Away->Fill(cont_elelamptvsv0dl_flip);
2459  else fHistoEleLambdaPtvsV0dlRS2Away->Fill(cont_elelamptvsv0dl_flip);
2460  }
2461  }else{
2462  fHistoEleLambdaMassWSAway->Fill(cont_flip);
2463  if(trk->Charge()>0) fHistoEleLambdaMassWS1Away->Fill(cont_flip);
2464  else fHistoEleLambdaMassWS2Away->Fill(cont_flip);
2465  if(cont_flip[0]<2.3){
2466  fHistoEleLambdaPtvsV0dlWSAway->Fill(cont_elelamptvsv0dl_flip);
2467  if(trk->Charge()>0) fHistoEleLambdaPtvsV0dlWS1Away->Fill(cont_elelamptvsv0dl_flip);
2468  else fHistoEleLambdaPtvsV0dlWS2Away->Fill(cont_elelamptvsv0dl_flip);
2469  }
2470  }
2471  }
2472 
2474  {
2475  if((trk->Charge()>0 && !anti_lambda_flag) || (trk->Charge()<0 && anti_lambda_flag)){
2476  fHistoEleLambdaMassRSSide->Fill(cont);
2477  if(trk->Charge()>0) fHistoEleLambdaMassRSSide1->Fill(cont);
2478  else fHistoEleLambdaMassRSSide2->Fill(cont);
2479 
2480  fHistoEleLambdaMassvsElePtRSSide->Fill(cont2);
2481  if(trk->Charge()>0) fHistoEleLambdaMassvsElePtRSSide1->Fill(cont2);
2482  else fHistoEleLambdaMassvsElePtRSSide2->Fill(cont2);
2483 
2484  fHistoElePtvsV0dlRSSide->Fill(cont_eleptvsv0dl);
2485  if(trk->Charge()>0) fHistoElePtvsV0dlRSSide1->Fill(cont_eleptvsv0dl);
2486  else fHistoElePtvsV0dlRSSide2->Fill(cont_eleptvsv0dl);
2487 
2488  fHistoEleLambdaPtvsV0dlRSSide->Fill(cont_elelamptvsv0dl);
2489  if(trk->Charge()>0) fHistoEleLambdaPtvsV0dlRSSide1->Fill(cont_elelamptvsv0dl);
2490  else fHistoEleLambdaPtvsV0dlRSSide2->Fill(cont_elelamptvsv0dl);
2491 
2492  fHistoElePtvsV0dcaRSSide->Fill(cont_eleptvsv0dca);
2493  if(trk->Charge()>0) fHistoElePtvsV0dcaRSSide1->Fill(cont_eleptvsv0dca);
2494  else fHistoElePtvsV0dcaRSSide2->Fill(cont_eleptvsv0dca);
2495 
2496  }else if((trk->Charge()<0 && !anti_lambda_flag) || (trk->Charge()>0 && anti_lambda_flag)){
2497  fHistoEleLambdaMassWSSide->Fill(cont);
2498  if(trk->Charge()>0) fHistoEleLambdaMassWSSide1->Fill(cont);
2499  else fHistoEleLambdaMassWSSide2->Fill(cont);
2500 
2501  fHistoEleLambdaMassvsElePtWSSide->Fill(cont2);
2502  if(trk->Charge()>0) fHistoEleLambdaMassvsElePtWSSide1->Fill(cont2);
2503  else fHistoEleLambdaMassvsElePtWSSide2->Fill(cont2);
2504 
2505  fHistoElePtvsV0dlWSSide->Fill(cont_eleptvsv0dl);
2506  if(trk->Charge()>0) fHistoElePtvsV0dlWSSide1->Fill(cont_eleptvsv0dl);
2507  else fHistoElePtvsV0dlWSSide2->Fill(cont_eleptvsv0dl);
2508 
2509  fHistoEleLambdaPtvsV0dlWSSide->Fill(cont_elelamptvsv0dl);
2510  if(trk->Charge()>0) fHistoEleLambdaPtvsV0dlWSSide1->Fill(cont_elelamptvsv0dl);
2511  else fHistoEleLambdaPtvsV0dlWSSide2->Fill(cont_elelamptvsv0dl);
2512 
2513  fHistoElePtvsV0dcaWSSide->Fill(cont_eleptvsv0dca);
2514  if(trk->Charge()>0) fHistoElePtvsV0dcaWSSide1->Fill(cont_eleptvsv0dca);
2515  else fHistoElePtvsV0dcaWSSide2->Fill(cont_eleptvsv0dca);
2516  }
2517  }
2518 
2519  //if( elobj->InvMass(2,pdgdg) < 10. && cosoa < 0. && fAnalCuts->IsSideBand(v0))
2520  if( melam_flip < 10. && cosoa < 0. && fAnalCuts->IsSideBand(v0))
2521  {
2522  if((trk->Charge()>0 && !anti_lambda_flag) || (trk->Charge()<0 && anti_lambda_flag)){
2523  fHistoEleLambdaMassRSSideAway->Fill(cont_flip);
2524  if(trk->Charge()>0) fHistoEleLambdaMassRSSide1Away->Fill(cont_flip);
2525  else fHistoEleLambdaMassRSSide2Away->Fill(cont_flip);
2526  if(cont_flip[0]<2.3){
2527  fHistoEleLambdaPtvsV0dlRSSideAway->Fill(cont_elelamptvsv0dl_flip);
2528  if(trk->Charge()>0) fHistoEleLambdaPtvsV0dlRSSide1Away->Fill(cont_elelamptvsv0dl_flip);
2529  else fHistoEleLambdaPtvsV0dlRSSide2Away->Fill(cont_elelamptvsv0dl_flip);
2530  }
2531  }else{
2532  fHistoEleLambdaMassWSSideAway->Fill(cont_flip);
2533  if(trk->Charge()>0) fHistoEleLambdaMassWSSide1Away->Fill(cont_flip);
2534  else fHistoEleLambdaMassWSSide2Away->Fill(cont_flip);
2535  if(cont_flip[0]<2.3){
2536  fHistoEleLambdaPtvsV0dlWSSideAway->Fill(cont_elelamptvsv0dl_flip);
2537  if(trk->Charge()>0) fHistoEleLambdaPtvsV0dlWSSide1Away->Fill(cont_elelamptvsv0dl_flip);
2538  else fHistoEleLambdaPtvsV0dlWSSide2Away->Fill(cont_elelamptvsv0dl_flip);
2539  }
2540  }
2541  }
2542 
2543  return;
2544 }
2545 
2547 void AliAnalysisTaskSELc2eleLambdafromAODtracks::FillMixROOTObjects(TLorentzVector *trke, TLorentzVector *v0, Double_t *v0info, TVector *elevars, TVector *v0vars, Int_t chargepr)
2548 {
2552  if(!trke) return;
2553  if(!v0) return;
2554 
2555  for(Int_t i=0;i<92;i++){
2556  fCandidateVariables[i] = -9999.;
2557  }
2558 
2559 
2560  Double_t pxe = trke->Px();
2561  Double_t pye = trke->Py();
2562  Double_t pze = trke->Pz();
2563  Double_t mome = sqrt(pxe*pxe+pye*pye+pze*pze);
2564  Double_t Ee = sqrt(mome*mome+0.000510998928*0.000510998928);
2565 
2566  Double_t pxv = v0->Px();
2567  Double_t pyv = v0->Py();
2568  Double_t pzv = v0->Pz();
2569  Double_t momv = sqrt(pxv*pxv+pyv*pyv+pzv*pzv);
2570  Double_t Ev = sqrt(momv*momv+1.115683*1.115683);
2571 
2572  Double_t cosoa = (pxe*pxv+pye*pyv+pze*pzv)/mome/momv;
2573 
2574  Double_t pxsum = pxe + pxv;
2575  Double_t pysum = pye + pyv;
2576  Double_t pzsum = pze + pzv;
2577  Double_t Esum = Ee + Ev;
2578  Double_t mel = sqrt(Esum*Esum-pxsum*pxsum-pysum*pysum-pzsum*pzsum);
2579 
2580  Double_t uxe = pxe/mome;
2581  Double_t uye = pye/mome;
2582  Double_t uze = pze/mome;
2583  Double_t lf = -2.*(pxv*uxe+pyv*uye+pzv*uze);
2584  Double_t pxv_flip = pxv + lf * uxe;
2585  Double_t pyv_flip = pyv + lf * uye;
2586  Double_t pzv_flip = pzv + lf * uze;
2587  Double_t pxsum_flip = pxe + pxv_flip;
2588  Double_t pysum_flip = pye + pyv_flip;
2589  Double_t pzsum_flip = pze + pzv_flip;
2590  Double_t mel_flip = sqrt(Esum*Esum-pxsum_flip*pxsum_flip-pysum_flip*pysum_flip-pzsum_flip*pzsum_flip);
2591  Double_t ptel_flip = sqrt(pxsum_flip*pxsum_flip+pysum_flip*pysum_flip);
2592 
2594  UInt_t pdgdg[2]={11,3122};
2595  fCandidateVariables[ 1] = mel;
2596  fCandidateVariables[ 2] = sqrt(pxsum*pxsum+pysum*pysum);
2597  fCandidateVariables[ 3] = pxsum;
2598  fCandidateVariables[ 4] = pysum;
2599  fCandidateVariables[ 5] = pzsum;
2600  fCandidateVariables[ 6] = pxe;
2601  fCandidateVariables[ 7] = pye;
2602  fCandidateVariables[ 8] = pze;
2603  fCandidateVariables[ 9] = pxv;
2604  fCandidateVariables[10] = pyv;
2605  fCandidateVariables[11] = pzv;
2606  if(chargepr>0){
2607  fCandidateVariables[12] = 0;
2608  fCandidateVariables[13] = v0->M();
2609  fCandidateVariables[14] = 0.;
2610  }else{
2611  fCandidateVariables[12] = 1;
2612  fCandidateVariables[13] = 0;
2613  fCandidateVariables[14] = v0->M();
2614  }
2615 
2616  fCandidateVariables[21] = trke->T();
2617 
2618  fCandidateVariables[32] = 1;
2619 
2620  fCandidateVariables[54] = fVtx1->GetX();
2621  fCandidateVariables[55] = fVtx1->GetY();
2622  fCandidateVariables[56] = fVtx1->GetZ();
2623  fCandidateVariables[64] = v0info[0];
2624 
2627 
2628 
2629  if(fWriteVariableTree)
2630  fVariablesTree->Fill();
2631 
2632  Double_t cont[3];
2633  cont[0] = mel;
2634  cont[1] = sqrt(pxsum*pxsum+pysum*pysum);
2635  cont[2] = fCentrality;
2636  fHistoEleLambdaMass->Fill(cont);
2637 
2638  Double_t cont_flip[3];
2639  cont_flip[0] = mel_flip;
2640  cont_flip[1] = ptel_flip;
2641  cont_flip[2] = fCentrality;
2642 
2643  Double_t cont2[3];
2644  cont2[0] = mel;
2645  cont2[1] = sqrt(pxe*pxe+pye*pye);
2646  cont2[2] = fCentrality;
2647  Double_t cont_eleptvseta[3];
2648  cont_eleptvseta[0] = trke->Pt();
2649  cont_eleptvseta[1] = trke->Eta();
2650  cont_eleptvseta[2] = fCentrality;
2651 
2652  Double_t cont_eleptvslambdapt[3];
2653  cont_eleptvslambdapt[0] = trke->Pt();
2654  cont_eleptvslambdapt[1] = v0->Pt();
2655  cont_eleptvslambdapt[2] = fCentrality;
2656 
2657  Double_t cont_eleptvsd0[3];
2658  cont_eleptvsd0[0] = trke->Pt();
2659  cont_eleptvsd0[1] = 0.;
2660  cont_eleptvsd0[2] = fCentrality;
2661 
2662  Double_t cont_eleptvsv0dl[3];
2663  cont_eleptvsv0dl[0] = trke->Pt();
2664  cont_eleptvsv0dl[1] = v0info[0];
2665  cont_eleptvsv0dl[2] = fCentrality;
2666 
2667  Double_t cont_eleptvsv0dca[3];
2668  cont_eleptvsv0dca[0] = trke->Pt();
2669  cont_eleptvsv0dca[1] = v0info[1];
2670  cont_eleptvsv0dca[2] = fCentrality;
2671 
2672  Double_t cont_elelamptvsv0dl[4];
2673  cont_elelamptvsv0dl[0] = sqrt(pxsum*pxsum+pysum*pysum);
2674  cont_elelamptvsv0dl[1] = v0info[0];
2675  cont_elelamptvsv0dl[2] = 0.0;
2676  cont_elelamptvsv0dl[3] = fCentrality;
2677 
2678  Double_t cont_elelamptvsv0dl_flip[4];
2679  cont_elelamptvsv0dl_flip[0] = ptel_flip;
2680  cont_elelamptvsv0dl_flip[1] = v0info[0];
2681  cont_elelamptvsv0dl_flip[2] = 0.0;
2682  cont_elelamptvsv0dl_flip[3] = fCentrality;
2683 
2684  Double_t xyzR125_ele[3], xyzR125_pr[3], xyzR125_pi[3];
2685  xyzR125_ele[0] = (*elevars)[0];
2686  xyzR125_ele[1] = (*elevars)[1];
2687  xyzR125_ele[2] = (*elevars)[2];
2688  xyzR125_pr[0] = (*v0vars)[0];
2689  xyzR125_pr[1] = (*v0vars)[1];
2690  xyzR125_pr[2] = (*v0vars)[2];
2691  xyzR125_pi[0] = (*v0vars)[3];
2692  xyzR125_pi[1] = (*v0vars)[4];
2693  xyzR125_pi[2] = (*v0vars)[5];
2694 
2695  Double_t rdhfcutvars[9];
2696  rdhfcutvars[0] = xyzR125_ele[0];
2697  rdhfcutvars[1] = xyzR125_ele[1];
2698  rdhfcutvars[2] = xyzR125_ele[2];
2699  rdhfcutvars[3] = xyzR125_pr[0];
2700  rdhfcutvars[4] = xyzR125_pr[1];
2701  rdhfcutvars[5] = xyzR125_pr[2];
2702  rdhfcutvars[6] = xyzR125_pi[0];
2703  rdhfcutvars[7] = xyzR125_pi[1];
2704  rdhfcutvars[8] = xyzR125_pi[2];
2705 
2706  Double_t dphis_ele_pr = fAnalCuts->dPhiSR125(xyzR125_ele,xyzR125_pr);
2707  Double_t detas_ele_pr = fAnalCuts->dEtaSR125(xyzR125_ele,xyzR125_pr);
2708  Double_t dphis_ele_pi = fAnalCuts->dPhiSR125(xyzR125_ele,xyzR125_pi);
2709  Double_t detas_ele_pi = fAnalCuts->dEtaSR125(xyzR125_ele,xyzR125_pi);
2710 
2711  //if(mel < 10. && cosoa>0. && fAnalCuts->IsPeakRegion(v0))
2712  if(fAnalCuts->IsSelected(trke,v0,rdhfcutvars,AliRDHFCuts::kCandidate) && fAnalCuts->IsPeakRegion(v0))
2713  {
2714 
2715  if(((int)trke->T())*chargepr>0){
2716  fHistoEleLambdaMassRSMix->Fill(cont);
2717  if(trke->T()>0) fHistoEleLambdaMassRSMix1->Fill(cont);
2718  else fHistoEleLambdaMassRSMix2->Fill(cont);
2719 
2720  fHistoEleLambdaMassvsElePtRSMix->Fill(cont2);
2721  if(trke->T()>0) fHistoEleLambdaMassvsElePtRSMix1->Fill(cont2);
2722  else fHistoEleLambdaMassvsElePtRSMix2->Fill(cont2);
2723  if(cont[0]<2.3){
2724  fHistoElePtRSMix->Fill(trke->Pt(),fCentrality);
2725  fHistoElePtvsEtaRSMix->Fill(cont_eleptvseta);
2726  fHistoElePtvsLambdaPtRSMix->Fill(cont_eleptvslambdapt);
2727  fHistoElePtvsd0RSMix->Fill(cont_eleptvsd0);
2728 
2729  fHistoElePtvsV0dlRSMix->Fill(cont_eleptvsv0dl);
2730  if(trke->T()>0) fHistoElePtvsV0dlRSMix1->Fill(cont_eleptvsv0dl);
2731  else fHistoElePtvsV0dlRSMix2->Fill(cont_eleptvsv0dl);
2732 
2733  fHistoEleLambdaPtvsV0dlRSMix->Fill(cont_elelamptvsv0dl);
2734  if(trke->T()>0) fHistoEleLambdaPtvsV0dlRSMix1->Fill(cont_elelamptvsv0dl);
2735  else fHistoEleLambdaPtvsV0dlRSMix2->Fill(cont_elelamptvsv0dl);
2736 
2737  fHistoElePtvsV0dcaRSMix->Fill(cont_eleptvsv0dca);
2738  if(trke->T()>0) fHistoElePtvsV0dcaRSMix1->Fill(cont_eleptvsv0dca);
2739  else fHistoElePtvsV0dcaRSMix2->Fill(cont_eleptvsv0dca);
2740  }
2741  fHistodPhiSdEtaSElectronProtonR125RSMix->Fill(dphis_ele_pr,detas_ele_pr);
2742  fHistodPhiSdEtaSElectronPionR125RSMix->Fill(dphis_ele_pi,detas_ele_pi);
2743  }else{
2744  fHistoEleLambdaMassWSMix->Fill(cont);
2745  if(trke->T()>0) fHistoEleLambdaMassWSMix1->Fill(cont);
2746  else fHistoEleLambdaMassWSMix2->Fill(cont);
2747 
2748  fHistoEleLambdaMassvsElePtWSMix->Fill(cont2);
2749  if(trke->T()>0) fHistoEleLambdaMassvsElePtWSMix1->Fill(cont2);
2750  else fHistoEleLambdaMassvsElePtWSMix2->Fill(cont2);
2751  if(cont[0]<2.3){
2752  fHistoElePtWSMix->Fill(trke->Pt(),fCentrality);
2753  fHistoElePtvsEtaWSMix->Fill(cont_eleptvseta);
2754  fHistoElePtvsLambdaPtWSMix->Fill(cont_eleptvslambdapt);
2755  fHistoElePtvsd0WSMix->Fill(cont_eleptvsd0);
2756 
2757  fHistoElePtvsV0dlWSMix->Fill(cont_eleptvsv0dl);
2758  if(trke->T()>0) fHistoElePtvsV0dlWSMix1->Fill(cont_eleptvsv0dl);
2759  else fHistoElePtvsV0dlWSMix2->Fill(cont_eleptvsv0dl);
2760 
2761  fHistoEleLambdaPtvsV0dlWSMix->Fill(cont_elelamptvsv0dl);
2762  if(trke->T()>0) fHistoEleLambdaPtvsV0dlWSMix1->Fill(cont_elelamptvsv0dl);
2763  else fHistoEleLambdaPtvsV0dlWSMix2->Fill(cont_elelamptvsv0dl);
2764 
2765  fHistoElePtvsV0dcaWSMix->Fill(cont_eleptvsv0dca);
2766  if(trke->T()>0) fHistoElePtvsV0dcaWSMix1->Fill(cont_eleptvsv0dca);
2767  else fHistoElePtvsV0dcaWSMix2->Fill(cont_eleptvsv0dca);
2768  }
2769  fHistodPhiSdEtaSElectronProtonR125WSMix->Fill(dphis_ele_pr,detas_ele_pr);
2770  fHistodPhiSdEtaSElectronPionR125WSMix->Fill(dphis_ele_pi,detas_ele_pi);
2771  }
2772  }
2773 
2774  //if(mel < 10. && cosoa<0. && fAnalCuts->IsPeakRegion(v0))
2775  if(mel_flip < 10. && cosoa<0. && fAnalCuts->IsPeakRegion(v0))
2776  {
2777  if(((int)trke->T())*chargepr>0){
2778  fHistoEleLambdaMassRSMixAway->Fill(cont_flip);
2779  if(trke->T()>0) fHistoEleLambdaMassRSMix1Away->Fill(cont_flip);
2780  else fHistoEleLambdaMassRSMix2Away->Fill(cont_flip);
2781  if(cont_flip[0]<2.3){
2782  fHistoEleLambdaPtvsV0dlRSMixAway->Fill(cont_elelamptvsv0dl_flip);
2783  if(trke->T()>0) fHistoEleLambdaPtvsV0dlRSMix1Away->Fill(cont_elelamptvsv0dl_flip);
2784  else fHistoEleLambdaPtvsV0dlRSMix2Away->Fill(cont_elelamptvsv0dl_flip);
2785  }
2786  }else{
2787  fHistoEleLambdaMassWSMixAway->Fill(cont_flip);
2788  if(trke->T()>0) fHistoEleLambdaMassWSMix1Away->Fill(cont_flip);
2789  else fHistoEleLambdaMassWSMix2Away->Fill(cont_flip);
2790  if(cont_flip[0]<2.3){
2791  fHistoEleLambdaPtvsV0dlWSMixAway->Fill(cont_elelamptvsv0dl_flip);
2792  if(trke->T()>0) fHistoEleLambdaPtvsV0dlWSMix1Away->Fill(cont_elelamptvsv0dl_flip);
2793  else fHistoEleLambdaPtvsV0dlWSMix2Away->Fill(cont_elelamptvsv0dl_flip);
2794  }
2795  }
2796  }
2797 
2798  return;
2799 }
2802 {
2803  //
2805  //
2806 
2807  const char* nameoutput = GetOutputSlot(5)->GetContainer()->GetName();
2808  fEleVariablesTree = new TTree(nameoutput,"electron variables tree");
2809  Int_t nVar = 26;
2810  fCandidateEleVariables = new Float_t [nVar];
2811  TString * fCandidateVariableNames = new TString[nVar];
2812 
2813  fCandidateVariableNames[ 0]="ElePx";
2814  fCandidateVariableNames[ 1]="ElePy";
2815  fCandidateVariableNames[ 2]="ElePz";
2816  fCandidateVariableNames[ 3]="TPCChi2overNDF";
2817  fCandidateVariableNames[ 4]="ITSNcls";
2818  fCandidateVariableNames[ 5]="TPCNcls";
2819  fCandidateVariableNames[ 6]="TPCNclsPID";
2820  fCandidateVariableNames[ 7]="TPCNclsRatio";
2821  fCandidateVariableNames[ 8]="d0R";
2822  fCandidateVariableNames[ 9]="d0Z";
2823  fCandidateVariableNames[10]="ITSClusterMap";
2824  fCandidateVariableNames[11]="nSigmaTPCele";
2825  fCandidateVariableNames[12]="nSigmaTOFele";
2826  fCandidateVariableNames[13]="nSigmaTPCpi";
2827  fCandidateVariableNames[14]="nSigmaTPCka";
2828  fCandidateVariableNames[15]="nSigmaTPCpr";
2829  fCandidateVariableNames[16]="EvNumber";
2830  fCandidateVariableNames[17]="EleCharge";
2831  fCandidateVariableNames[18]="ElePdgCode";
2832  fCandidateVariableNames[19]="EleMotherPdgCode";
2833  fCandidateVariableNames[20]="mcelepx";
2834  fCandidateVariableNames[21]="mcelepy";
2835  fCandidateVariableNames[22]="mcelepz";
2836  fCandidateVariableNames[23]="Centrality";
2837  fCandidateVariableNames[24]="PrimVertZ";
2838  fCandidateVariableNames[25]="RunNumber";
2839 
2840  for (Int_t ivar=0; ivar<nVar; ivar++) {
2841  fEleVariablesTree->Branch(fCandidateVariableNames[ivar].Data(),&fCandidateEleVariables[ivar],Form("%s/f",fCandidateVariableNames[ivar].Data()));
2842  }
2843 
2844  return;
2845 }
2847 void AliAnalysisTaskSELc2eleLambdafromAODtracks::FillElectronROOTObjects(AliAODTrack *trk, TClonesArray *mcArray)
2848 {
2849  //
2851  //
2852 
2853  if(!trk) return;
2854 
2855  fHistoBachPt->Fill(trk->Pt());
2856  fHistoElectronQovPtvsPhi->Fill(trk->Phi(),(Double_t)trk->Charge()/trk->Pt());
2857 
2858  if(fDoEventMixing){
2859  fElectronTracks->AddLast(new TLorentzVector(trk->Px(),trk->Py(),trk->Pz(),trk->Charge()));
2860 
2861  Double_t pv[3];
2862  pv[0] = fVtx1->GetX();
2863  pv[1] = fVtx1->GetY();
2864  pv[2] = fVtx1->GetZ();
2865  Double_t xyzR125[3]={9999.,9999.,9999.};
2866  if(fAnalCuts->GetCuts()[2]>0. || fAnalCuts->GetCuts()[3]>0.) fAnalCuts->SetSftPosR125(trk,fBzkG,pv,xyzR125);
2867  TVector *varvec = new TVector(3);
2868  (*varvec)[0] = xyzR125[0];
2869  (*varvec)[1] = xyzR125[1];
2870  (*varvec)[2] = xyzR125[2];
2871  fElectronCutVarsArray->AddLast(varvec);
2872  }
2873 
2874  Int_t pdgEle = -9999;
2875  Int_t pdgEleMother = -9999;
2876  Float_t mcelepx = -9999;
2877  Float_t mcelepy = -9999;
2878  Float_t mcelepz = -9999;
2879  if(fUseMCInfo)
2880  {
2881  Int_t labEle = trk->GetLabel();
2882  if(labEle<0) return;
2883  AliAODMCParticle *mcetrk = (AliAODMCParticle*)mcArray->At(labEle);
2884  if(!mcetrk) return;
2885  pdgEle = mcetrk->GetPdgCode();
2886  if(abs(pdgEle)!=11) return;
2887 
2888  Bool_t hfe_flag = kFALSE;
2889  Bool_t gamma_flag = kFALSE;
2890  Int_t labemother = mcetrk->GetMother();
2891  if(labemother>=0){
2892  AliAODMCParticle *motherele = (AliAODMCParticle*)mcArray->At(labemother);
2893  pdgEleMother = motherele->GetPdgCode();
2894  if(abs(pdgEleMother)>4000&&abs(pdgEleMother)<4400){
2895  hfe_flag = kTRUE;
2896  }
2897  if(abs(pdgEleMother)==22){
2898  gamma_flag = kTRUE;
2899  }
2900  }
2901  if(!gamma_flag){
2902  fHistoBachPtMCS->Fill(trk->Pt());
2903  }
2904 
2905  if(!hfe_flag) return;
2906  mcelepx = mcetrk->Px();
2907  mcelepy = mcetrk->Py();
2908  mcelepz = mcetrk->Pz();
2909  }
2910  //test propagation
2911 // cout<<"B: "<<fBzkG<<endl;
2912 // cout<<"trk: "<<trk->Charge()<<" "<<trk->Px()<<" "<<trk->Py()<<" "<<trk->Pz()<<endl;
2913 // AliExternalTrackParam etp;
2914 // etp.CopyFromVTrack(trk);
2915 // Double_t xyz_test[3]={-9999.,-9999.,-9999.};
2916 // etp.GetXYZ(xyz_test);
2917 // cout<<"Before: "<<xyz_test[0]<<" "<<xyz_test[1]<<" "<<xyz_test[2]<<endl;
2918 // etp.PropagateTo(80.,(Float_t)fBzkG);
2919 // etp.GetXYZ(xyz_test); // GetXYZ returns global coordinates
2920 // cout<<"After: "<<xyz_test[0]<<" "<<xyz_test[1]<<" "<<xyz_test[2]<<endl;
2921 
2922  if(!fWriteEachVariableTree) return;
2923 
2924  for(Int_t i=0;i<26;i++){
2925  fCandidateEleVariables[i] = -9999.;
2926  }
2927 
2928  fCandidateEleVariables[ 0] = trk->Px();
2929  fCandidateEleVariables[ 1] = trk->Py();
2930  fCandidateEleVariables[ 2] = trk->Pz();
2931  fCandidateEleVariables[ 3] = trk->Chi2perNDF();
2932  fCandidateEleVariables[ 4] = trk->GetITSNcls();
2933  fCandidateEleVariables[ 5] = trk->GetTPCncls();
2934  fCandidateEleVariables[ 6] = trk->GetTPCsignalN();
2935  if(trk->GetTPCNclsF()>0)
2936  fCandidateEleVariables[ 7] = (Float_t)trk->GetTPCncls()/(Float_t)trk->GetTPCNclsF();
2937 
2938  Double_t d0z0[2],covd0z0[3];
2939  trk->PropagateToDCA(fVtx1,fBzkG,kVeryBig,d0z0,covd0z0);
2940 
2941  fCandidateEleVariables[ 8] = d0z0[0];
2942  fCandidateEleVariables[ 9] = d0z0[1];
2943  Int_t itsmap = trk->GetITSClusterMap();
2944  Int_t bit1 = 1;
2945  Int_t bit2 = 2;
2946  Bool_t spdfirst = (itsmap & bit1) == bit1;
2947  Bool_t spdsecond = (itsmap & bit2) == bit2;
2948  fCandidateEleVariables[10] = ((Int_t)spdfirst) + 2 * ((Int_t)spdsecond);
2949 
2950  if(fAnalCuts->GetIsUsePID())
2951  {
2952  Double_t nSigmaTPCele = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTPC(trk,AliPID::kElectron);
2953  Double_t nSigmaTOFele = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTOF(trk,AliPID::kElectron);
2954  Double_t nSigmaTPCpi_etrk = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTPC(trk,AliPID::kPion);
2955  Double_t nSigmaTPCka_etrk = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTPC(trk,AliPID::kKaon);
2956  Double_t nSigmaTPCpr_etrk = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTPC(trk,AliPID::kProton);
2957  fCandidateEleVariables[11] = nSigmaTPCele;
2958  fCandidateEleVariables[12] = nSigmaTOFele;
2959  fCandidateEleVariables[13] = nSigmaTPCpi_etrk;
2960  fCandidateEleVariables[14] = nSigmaTPCka_etrk;
2961  fCandidateEleVariables[15] = nSigmaTPCpr_etrk;
2962  }
2964  fCandidateEleVariables[17] = trk->Charge();
2965  fCandidateEleVariables[18] = pdgEle;
2966  fCandidateEleVariables[19] = pdgEleMother;
2967  fCandidateEleVariables[20] = mcelepx;
2968  fCandidateEleVariables[21] = mcelepy;
2969  fCandidateEleVariables[22] = mcelepz;
2973 
2974  fHistod0Bach->Fill(d0z0[0]);
2975 
2976  fEleVariablesTree->Fill();
2977 }
2980 {
2981  //
2983  //
2984 
2985  const char* nameoutput = GetOutputSlot(6)->GetContainer()->GetName();
2986  fV0VariablesTree = new TTree(nameoutput,"v0 variables tree");
2987  Int_t nVar = 33;
2988  fCandidateV0Variables = new Float_t [nVar];
2989  TString * fCandidateVariableNames = new TString[nVar];
2990 
2991  fCandidateVariableNames[ 0]="V0Px";
2992  fCandidateVariableNames[ 1]="V0Py";
2993  fCandidateVariableNames[ 2]="V0Pz";
2994  fCandidateVariableNames[ 3]="MassLambda";
2995  fCandidateVariableNames[ 4]="MassAntiLambda";
2996  fCandidateVariableNames[ 5]="ProtonPx";
2997  fCandidateVariableNames[ 6]="ProtonPy";
2998  fCandidateVariableNames[ 7]="ProtonPz";
2999  fCandidateVariableNames[ 8]="PionPx";
3000  fCandidateVariableNames[ 9]="PionPy";
3001  fCandidateVariableNames[10]="PionPz";
3002  fCandidateVariableNames[11]="RfidV0";
3003  fCandidateVariableNames[12]="DcaV0PrToPrimVertex";
3004  fCandidateVariableNames[13]="DcaV0PiToPrimVertex";
3005  fCandidateVariableNames[14]="DcaV0daughters";
3006  fCandidateVariableNames[15]="V0CosPointingAngle";
3007  fCandidateVariableNames[16]="V0ProperDecayLength";
3008  fCandidateVariableNames[17]="MassK0Short";
3009  fCandidateVariableNames[18]="nSigmaTPCpr";
3010  fCandidateVariableNames[19]="nSigmaTPCpi";
3011  fCandidateVariableNames[20]="TPCNCrossV0Pr";
3012  fCandidateVariableNames[21]="TPCNCrossV0Pi";
3013  fCandidateVariableNames[22]="TPCNCrossRatioV0Pr";
3014  fCandidateVariableNames[23]="TPCNCrossRatioV0Pi";
3015  fCandidateVariableNames[24]="V0PdgCode";
3016  fCandidateVariableNames[25]="V0MotherPdgCode";
3017  fCandidateVariableNames[26]="mcv0px";
3018  fCandidateVariableNames[27]="mcv0py";
3019  fCandidateVariableNames[28]="mcv0pz";
3020  fCandidateVariableNames[29]="EvNumber";
3021  fCandidateVariableNames[30]="Centrality";
3022  fCandidateVariableNames[31]="PrimVertZ";
3023  fCandidateVariableNames[32]="RunNumber";
3024 
3025  for (Int_t ivar=0; ivar<nVar; ivar++) {
3026  fV0VariablesTree->Branch(fCandidateVariableNames[ivar].Data(),&fCandidateV0Variables[ivar],Form("%s/f",fCandidateVariableNames[ivar].Data()));
3027  }
3028 
3029  return;
3030 }
3031 
3033 void AliAnalysisTaskSELc2eleLambdafromAODtracks::FillV0ROOTObjects(AliAODv0 *v0, TClonesArray *mcArray)
3034 {
3035  //
3037  //
3038  if(!v0) return;
3039  AliAODTrack *cptrack = (AliAODTrack*)(v0->GetDaughter(0));
3040  AliAODTrack *cntrack = (AliAODTrack*)(v0->GetDaughter(1));
3041  if(!cptrack) return;
3042  if(!cntrack) return;
3043  if(cptrack->Charge()<0 && cntrack->Charge()>0){
3044  cptrack = (AliAODTrack*)(v0->GetDaughter(1));
3045  cntrack = (AliAODTrack*)(v0->GetDaughter(0));
3046  }
3047  //test propagation
3048 // cout<<"B: "<<fBzkG<<endl;
3049 // cout<<"trk: "<<cptrack->Charge()<<" "<<v0->MomPosX()<<" "<<v0->MomPosY()<<" "<<v0->MomPosZ()<<endl;
3050 // cout<<"vert: "<<v0->DecayVertexV0X()<<" "<<v0->DecayVertexV0Y()<<" "<<v0->DecayVertexV0Z()<<endl;
3051 // AliExternalTrackParam etp;
3052 // etp.CopyFromVTrack(cptrack);
3053 // Double_t xyz_test[3]={-9999.,-9999.,-9999.};
3054 // etp.PropagateTo(10.,(Float_t)fBzkG);
3055 // etp.GetXYZ(xyz_test); // GetXYZ returns global coordinates
3056 // cout<<"10: "<<xyz_test[0]<<" "<<xyz_test[1]<<" "<<xyz_test[2]<<endl;
3057 // etp.PropagateTo(120.,(Float_t)fBzkG);
3058 // etp.GetXYZ(xyz_test); // GetXYZ returns global coordinates
3059 // cout<<"120: "<<xyz_test[0]<<" "<<xyz_test[1]<<" "<<xyz_test[2]<<endl;
3060 
3061  Double_t mlamPDG = TDatabasePDG::Instance()->GetParticle(3122)->Mass();
3062  Double_t posVtx[3] = {0.,0.,0.};
3063  fVtx1->GetXYZ(posVtx);
3064  Double_t ptotlam = TMath::Sqrt(pow(v0->Px(),2)+pow(v0->Py(),2)+pow(v0->Pz(),2));
3065  Double_t v0propdl = v0->DecayLengthV0(posVtx)*mlamPDG/ptotlam;
3066  Double_t cont_arm[3];
3067  cont_arm[0] = v0->Pt();
3068  cont_arm[1] = v0->PtArmV0();
3069  cont_arm[2] = v0->AlphaV0();
3070 
3071  if(TMath::Abs(v0->MassLambda()-mlamPDG)<fAnalCuts->GetProdV0MassTolLambdaRough()){
3072  fHistoLambdaMassvsPt->Fill(v0->MassLambda(),v0->Pt());
3073  }
3074  if(TMath::Abs(v0->MassAntiLambda()-mlamPDG)<fAnalCuts->GetProdV0MassTolLambdaRough()){
3075  fHistoLambdaMassvsPt->Fill(v0->MassAntiLambda(),v0->Pt());
3076  }
3077  fHistoK0sMassvsPt->Fill(v0->MassK0Short(),v0->Pt());
3078 
3079  if(fAnalCuts->IsPeakRegion(v0)){
3080  fHistoLambdaPtvsDl->Fill(v0->Pt(),v0propdl);
3081  fHistoLambdaPtvsEta->Fill(v0->Pt(),v0->Eta());
3082  fHistoLambdaArmenteros->Fill(cont_arm);
3083  }
3084  if(fAnalCuts->IsSideBand(v0)){
3085  fHistoLambdaPtvsDlSide->Fill(v0->Pt(),v0propdl);
3086  }
3087 
3088  Double_t momv0x = v0->MomV0X();
3089  Double_t momv0y = v0->MomV0Y();
3090  Double_t phi_alice = atan2(momv0y,momv0x);
3091  if(phi_alice<0.) phi_alice += 2 * M_PI;
3092  fHistoLambdaQovPtvsPhi->Fill(phi_alice,1./sqrt(momv0x*momv0x+momv0y*momv0y));
3093 
3094  Int_t v0pdgcode = -9999;
3095  Int_t v0motherpdgcode = -9999;
3096  Float_t mcv0px = -9999;
3097  Float_t mcv0py = -9999;
3098  Float_t mcv0pz = -9999;
3099  if(fUseMCInfo)
3100  {
3101  Int_t pdgdgv0[2]={2212,211};
3102  Int_t labV0 = v0->MatchToMC(3122,mcArray,2,pdgdgv0); // the V0
3103  if(labV0>=0){
3104  if(TMath::Abs(v0->MassLambda()-mlamPDG)<fAnalCuts->GetProdV0MassTolLambdaRough()){
3105  fHistoLambdaMassvsPtMCS->Fill(v0->MassLambda(),v0->Pt());
3106  }
3107  if(TMath::Abs(v0->MassAntiLambda()-mlamPDG)<fAnalCuts->GetProdV0MassTolLambdaRough()){
3108  fHistoLambdaMassvsPtMCS->Fill(v0->MassAntiLambda(),v0->Pt());
3109  }
3110  if(fAnalCuts->IsPeakRegion(v0)){
3111  fHistoLambdaPtvsEtaMCS->Fill(v0->Pt(),v0->Eta());
3112  fHistoLambdaArmenterosMCS->Fill(cont_arm);
3113  }
3114  }
3115  if(labV0<0) return;
3116  AliAODMCParticle *mcv0trk = (AliAODMCParticle*)mcArray->At(labV0);
3117  if(!mcv0trk) return;
3118 
3119  Bool_t hfv0_flag = kFALSE;
3120  v0pdgcode = mcv0trk->GetPdgCode();
3121  Int_t labv0mother = mcv0trk->GetMother();
3122  if(labv0mother>=0){
3123  AliAODMCParticle *motherv0 = (AliAODMCParticle*)mcArray->At(labv0mother);
3124  if(motherv0){
3125  v0motherpdgcode = motherv0->GetPdgCode();
3126  if(abs(v0motherpdgcode)>4000&&abs(v0motherpdgcode)<4400){
3127  hfv0_flag = kTRUE;
3128  }
3129  if(abs(v0motherpdgcode)==3322){
3130  fHistoLambdaPtvsDlFeeddownXi0MCS->Fill(v0->Pt(),v0propdl);
3131  }else if(abs(v0motherpdgcode)==3312){
3132  fHistoLambdaPtvsDlFeeddownXiMinusMCS->Fill(v0->Pt(),v0propdl);
3133  }else if(abs(v0motherpdgcode)==3334){
3134  fHistoLambdaPtvsDlFeeddownOmegaMCS->Fill(v0->Pt(),v0propdl);
3135  }else{
3136  fHistoLambdaPtvsDlMCS->Fill(v0->Pt(),v0propdl);
3137  }
3138  }
3139  }
3140  if(!hfv0_flag) return;
3141  mcv0px = mcv0trk->Px();
3142  mcv0py = mcv0trk->Py();
3143  mcv0pz = mcv0trk->Pz();
3144  }
3145 
3146 
3147  if(fDoEventMixing){
3148  Double_t posVtx[3] = {0.,0.,0.};
3149  fVtx1->GetXYZ(posVtx);
3150  TLorentzVector *lv = new TLorentzVector();
3151  Double_t ptotlam = TMath::Sqrt(pow(v0->Px(),2)+pow(v0->Py(),2)+pow(v0->Pz(),2));
3152  Double_t xyzR125pr[3] = {9999.,9999.,9999.};
3153  Double_t xyzR125pi[3] = {9999.,9999.,9999.};
3154  if(TMath::Abs(v0->MassLambda()-mlamPDG)<fAnalCuts->GetProdV0MassTolLambdaRough()){
3155  lv->SetXYZM(v0->Px(),v0->Py(),v0->Pz(),v0->MassLambda());
3156  fV0Tracks1->AddLast(lv);
3157  fV0dlArray1.push_back(v0->DecayLengthV0(posVtx)*mlamPDG/ptotlam);
3158  fV0dcaArray1.push_back(v0->DcaV0ToPrimVertex());
3159  if(fAnalCuts->GetCuts()[2]>0. || fAnalCuts->GetCuts()[3]>0.) fAnalCuts->SetSftPosR125(cptrack,fBzkG,posVtx,xyzR125pr);
3160  if(fAnalCuts->GetCuts()[2]>0. || fAnalCuts->GetCuts()[3]>0.) fAnalCuts->SetSftPosR125(cntrack,fBzkG,posVtx,xyzR125pi);
3161  TVector *varvec = new TVector(6);
3162  (*varvec)[0] = xyzR125pr[0];
3163  (*varvec)[1] = xyzR125pr[1];
3164  (*varvec)[2] = xyzR125pr[2];
3165  (*varvec)[3] = xyzR125pi[0];
3166  (*varvec)[4] = xyzR125pi[1];
3167  (*varvec)[5] = xyzR125pi[2];
3168  fV0CutVarsArray1->AddLast(varvec);
3169  }else{
3170  lv->SetXYZM(v0->Px(),v0->Py(),v0->Pz(),v0->MassAntiLambda());
3171  fV0Tracks2->AddLast(lv);
3172  fV0dlArray2.push_back(v0->DecayLengthV0(posVtx)*mlamPDG/ptotlam);
3173  fV0dcaArray2.push_back(v0->DcaV0ToPrimVertex());
3174  if(fAnalCuts->GetCuts()[2]>0. || fAnalCuts->GetCuts()[3]>0.) fAnalCuts->SetSftPosR125(cntrack,fBzkG,posVtx,xyzR125pr);
3175  if(fAnalCuts->GetCuts()[2]>0. || fAnalCuts->GetCuts()[3]>0.) fAnalCuts->SetSftPosR125(cptrack,fBzkG,posVtx,xyzR125pi);
3176  TVector *varvec = new TVector(6);
3177  (*varvec)[0] = xyzR125pr[0];
3178  (*varvec)[1] = xyzR125pr[1];
3179  (*varvec)[2] = xyzR125pr[2];
3180  (*varvec)[3] = xyzR125pi[0];
3181  (*varvec)[4] = xyzR125pi[1];
3182  (*varvec)[5] = xyzR125pi[2];
3183  fV0CutVarsArray2->AddLast(varvec);
3184  }
3185  }
3186 
3187  if(!fWriteEachVariableTree) return;
3188 
3189  for(Int_t i=0;i<32;i++){
3190  fCandidateV0Variables[i] = -9999.;
3191  }
3192 
3193 
3194  fCandidateV0Variables[ 0] = v0->Px();
3195  fCandidateV0Variables[ 1] = v0->Py();
3196  fCandidateV0Variables[ 2] = v0->Pz();
3197  fCandidateV0Variables[ 3] = v0->MassLambda();
3198  fCandidateV0Variables[ 4] = v0->MassAntiLambda();
3199 
3200  Bool_t isparticle = kTRUE;
3201  if(fabs(v0->MassAntiLambda()-mlamPDG)<fAnalCuts->GetProdV0MassTolLambdaRough()) isparticle=kFALSE;
3202 
3203  if(isparticle){
3204  fCandidateV0Variables[ 5] = v0->MomPosX(); //cptrack->Px();
3205  fCandidateV0Variables[ 6] = v0->MomPosY(); //cptrack->Py();
3206  fCandidateV0Variables[ 7] = v0->MomPosZ(); //cptrack->Pz();
3207  fCandidateV0Variables[ 8] = v0->MomNegX(); //cntrack->Px();
3208  fCandidateV0Variables[ 9] = v0->MomNegY(); //cntrack->Py();
3209  fCandidateV0Variables[10] = v0->MomNegZ(); //cntrack->Pz();
3210  }else{
3211  fCandidateV0Variables[ 5] = v0->MomNegX(); //cntrack->Px();
3212  fCandidateV0Variables[ 6] = v0->MomNegY(); //cntrack->Py();
3213  fCandidateV0Variables[ 7] = v0->MomNegZ(); //cntrack->Pz();
3214  fCandidateV0Variables[ 8] = v0->MomPosX(); //cptrack->Px();
3215  fCandidateV0Variables[ 9] = v0->MomPosY(); //cptrack->Py();
3216  fCandidateV0Variables[10] = v0->MomPosZ(); //cptrack->Pz();
3217  }
3218 
3219  Double_t lPosV0[3];
3220  lPosV0[0] = v0->DecayVertexV0X();
3221  lPosV0[1] = v0->DecayVertexV0Y();
3222  lPosV0[2] = v0->DecayVertexV0Z();
3223  Double_t decayvertV0 = TMath::Sqrt(lPosV0[0]*lPosV0[0]+lPosV0[1]*lPosV0[1]);
3224  fCandidateV0Variables[11] = decayvertV0;
3225 
3226  Double_t lDcaPosToPrimVertex = v0->DcaPosToPrimVertex();
3227  Double_t lDcaNegToPrimVertex = v0->DcaNegToPrimVertex();
3228  if(isparticle){
3229  fCandidateV0Variables[12] = lDcaPosToPrimVertex;
3230  fCandidateV0Variables[13] = lDcaNegToPrimVertex;
3231  }else{
3232  fCandidateV0Variables[12] = lDcaNegToPrimVertex;
3233  fCandidateV0Variables[13] = lDcaPosToPrimVertex;
3234  }
3235  fCandidateV0Variables[14] = v0->DcaV0Daughters();
3236  fCandidateV0Variables[15] = v0->CosPointingAngle(posVtx);
3237  fCandidateV0Variables[16] = v0->DecayLengthV0(posVtx)*mlamPDG/ptotlam;
3238  fCandidateV0Variables[17] = v0->MassK0Short();
3239 
3240  if(fAnalCuts->GetUseLambdaPID())
3241  {
3242  if(isparticle){
3243  Double_t nSigmaTPCv0pr = fAnalCuts->GetPidProton()->GetPidResponse()->NumberOfSigmasTPC(cptrack,AliPID::kProton);
3244  Double_t nSigmaTPCv0pi = fAnalCuts->GetPidPion()->GetPidResponse()->NumberOfSigmasTPC(cntrack,AliPID::kPion);
3245  fCandidateV0Variables[18] = nSigmaTPCv0pr;
3246  fCandidateV0Variables[19] = nSigmaTPCv0pi;
3247  }else{
3248  Double_t nSigmaTPCv0pr = fAnalCuts->GetPidProton()->GetPidResponse()->NumberOfSigmasTPC(cntrack,AliPID::kProton);
3249  Double_t nSigmaTPCv0pi = fAnalCuts->GetPidPion()->GetPidResponse()->NumberOfSigmasTPC(cptrack,AliPID::kPion);
3250  fCandidateV0Variables[18] = nSigmaTPCv0pr;
3251  fCandidateV0Variables[19] = nSigmaTPCv0pi;
3252  }
3253  }
3254  if(isparticle){
3255  fCandidateV0Variables[20] = cptrack->GetTPCClusterInfo(2,1);
3256  fCandidateV0Variables[21] = cntrack->GetTPCClusterInfo(2,1);
3257  if(cptrack->GetTPCNclsF()>0)
3258  fCandidateV0Variables[22] = (Float_t) cptrack->GetTPCClusterInfo(2,1)/(Float_t)cptrack->GetTPCNclsF();
3259  if(cntrack->GetTPCNclsF()>0)
3260  fCandidateV0Variables[23] =(Float_t) cntrack->GetTPCClusterInfo(2,1)/(Float_t)cntrack->GetTPCNclsF();
3261  }else{
3262  fCandidateV0Variables[20] = cntrack->GetTPCClusterInfo(2,1);
3263  fCandidateV0Variables[21] = cptrack->GetTPCClusterInfo(2,1);
3264  if(cntrack->GetTPCNclsF()>0)
3265  fCandidateV0Variables[22] = (Float_t) cntrack->GetTPCClusterInfo(2,1)/(Float_t)cntrack->GetTPCNclsF();
3266  if(cptrack->GetTPCNclsF()>0)
3267  fCandidateV0Variables[23] = (Float_t) cptrack->GetTPCClusterInfo(2,1)/(Float_t)cptrack->GetTPCNclsF();
3268  }
3269  fCandidateV0Variables[24] = v0pdgcode;
3270  fCandidateV0Variables[25] = v0motherpdgcode;
3271  fCandidateV0Variables[26] = mcv0px;
3272  fCandidateV0Variables[27] = mcv0py;
3273  fCandidateV0Variables[28] = mcv0pz;
3278 
3279 
3280  fV0VariablesTree->Fill();
3281 }
3284 {
3288 
3289  const char* nameoutput = GetOutputSlot(7)->GetContainer()->GetName();
3290  fMCVariablesTree = new TTree(nameoutput,"MC variables tree");
3291  Int_t nVar = 11;
3292  fCandidateMCVariables = new Float_t [nVar];
3293  TString * fCandidateVariableNames = new TString[nVar];
3294 
3295  fCandidateVariableNames[ 0]="Centrality";
3296  fCandidateVariableNames[ 1]="DecayType";
3297  fCandidateVariableNames[ 2]="LcPx";
3298  fCandidateVariableNames[ 3]="LcPy";
3299  fCandidateVariableNames[ 4]="LcPz";
3300  fCandidateVariableNames[ 5]="ElePx";
3301  fCandidateVariableNames[ 6]="ElePy";
3302  fCandidateVariableNames[ 7]="ElePz";
3303  fCandidateVariableNames[ 8]="V0Px";
3304  fCandidateVariableNames[ 9]="V0Py";
3305  fCandidateVariableNames[10]="V0Pz";
3306 
3307  for (Int_t ivar=0; ivar<nVar; ivar++) {
3308  fMCVariablesTree->Branch(fCandidateVariableNames[ivar].Data(),&fCandidateMCVariables[ivar],Form("%s/f",fCandidateVariableNames[ivar].Data()));
3309  }
3310  return;
3311 }
3313 void AliAnalysisTaskSELc2eleLambdafromAODtracks::FillMCROOTObjects(AliAODMCParticle *mcpart, AliAODMCParticle *mcepart, AliAODMCParticle *mcv0part, Int_t decaytype)
3314 {
3315  //
3317  //
3318  if(!mcpart) return;
3319  if(!mcepart) return;
3320  if(!mcv0part) return;
3321 
3322  for(Int_t i=0;i<11;i++){
3323  fCandidateMCVariables[i] = -9999.;
3324  }
3325 
3327  fCandidateMCVariables[ 1] = (Float_t) decaytype;
3328  fCandidateMCVariables[ 2] = mcpart->Px();
3329  fCandidateMCVariables[ 3] = mcpart->Py();
3330  fCandidateMCVariables[ 4] = mcpart->Pz();
3331  fCandidateMCVariables[ 5] = mcepart->Px();
3332  fCandidateMCVariables[ 6] = mcepart->Py();
3333  fCandidateMCVariables[ 7] = mcepart->Pz();
3334  fCandidateMCVariables[ 8] = mcv0part->Px();
3335  fCandidateMCVariables[ 9] = mcv0part->Py();
3336  fCandidateMCVariables[10] = mcv0part->Pz();
3337 
3338  Double_t epx = mcepart->Px();
3339  Double_t epy = mcepart->Py();
3340  Double_t epz = mcepart->Pz();
3341  Double_t eE = sqrt(epx*epx+epy*epy+epz*epz+0.000511*0.000511);
3342  Double_t v0px = mcv0part->Px();
3343  Double_t v0py = mcv0part->Py();
3344  Double_t v0pz = mcv0part->Pz();
3345  Double_t v0E = sqrt(v0px*v0px+v0py*v0py+v0pz*v0pz+1.1157*1.1157);
3346 
3347  Double_t InvMassEleLambda = sqrt(pow(eE+v0E,2)-pow(epx+v0px,2)-pow(epy+v0py,2)-pow(epz+v0pz,2));
3348 
3349  Double_t cont[3];
3350  cont[0] = InvMassEleLambda;
3351  cont[1] = mcpart->Pt();
3352  cont[2] = fCentrality;
3353  Double_t cont2[3];
3354  cont2[0] = InvMassEleLambda;
3355  cont2[1] = mcepart->Pt();
3356  cont2[2] = fCentrality;
3357  Double_t cont_eleptvseta[3];
3358  cont_eleptvseta[0] = mcepart->Pt();
3359  cont_eleptvseta[1] = mcepart->Eta();
3360  cont_eleptvseta[2] = fCentrality;
3361  Double_t cont_eleptvslambdapt[3];
3362  cont_eleptvslambdapt[0] = mcepart->Pt();
3363  cont_eleptvslambdapt[1] = mcv0part->Pt();
3364  cont_eleptvslambdapt[2] = fCentrality;
3365  Double_t cont_eleptvslambdaptvslcpt[4];
3366  cont_eleptvslambdaptvslcpt[0] = mcepart->Pt();
3367  cont_eleptvslambdaptvslcpt[1] = mcv0part->Pt();
3368  cont_eleptvslambdaptvslcpt[2] = mcpart->Pt();
3369  cont_eleptvslambdaptvslcpt[3] = fCentrality;
3370  Double_t contmc[3];
3371  contmc[0] = mcpart->Pt();
3372  contmc[1] = mcpart->Y();
3373  contmc[2] = fCentrality;
3374  Double_t contmcele[3];
3375  contmcele[0] = mcepart->Pt();
3376  contmcele[1] = mcepart->Eta();
3377  contmcele[2] = fCentrality;
3378 
3379  AliESDtrackCuts *esdcuts = fAnalCuts->GetTrackCuts();
3380  Float_t etamin, etamax;
3381  esdcuts->GetEtaRange(etamin,etamax);
3382 
3383  if(decaytype==0){
3384  fHistoLcMCGen->Fill(contmc);
3385  if(mcpart->GetPdgCode()>0) fHistoLcMCGen1->Fill(contmc);
3386  if(mcpart->GetPdgCode()<0) fHistoLcMCGen2->Fill(contmc);
3387  fHistoLcElectronMCGen->Fill(contmcele);
3388  if(mcepart->GetPdgCode()<0) fHistoLcElectronMCGen1->Fill(contmcele);
3389  if(mcepart->GetPdgCode()>0) fHistoLcElectronMCGen2->Fill(contmcele);
3390  fHistoEleLambdaMassMCGen->Fill(cont);
3391  if(fabs(mcepart->Eta())<etamax){
3392  fHistoEleLambdaMassvsElePtMCGen->Fill(cont2);
3393  if(mcepart->GetPdgCode()<0) fHistoEleLambdaMassvsElePtMCGen1->Fill(cont2);
3394  else fHistoEleLambdaMassvsElePtMCGen2->Fill(cont2);
3395  if(InvMassEleLambda<2.3){
3396  fHistoElePtMCGen->Fill(mcepart->Pt(),fCentrality);
3397  fHistoElePtvsEtaMCGen->Fill(cont_eleptvseta);
3398  fHistoElePtvsLambdaPtMCGen->Fill(cont_eleptvslambdapt);
3399  }
3400  }
3401  if(fabs(mcpart->Y())<0.7){
3402  if(InvMassEleLambda<2.3){
3403  fHistoElePtvsLambdaPtMCLcGen->Fill(cont_eleptvslambdapt);
3404  fHistoElePtvsLambdaPtvsLcPtMCGen->Fill(cont_eleptvslambdaptvslcpt);
3405  }
3406  }
3407  }else if(decaytype==1){
3408  fHistoFeedDownXic0MCGen->Fill(contmc);
3409  if(mcpart->GetPdgCode()>0) fHistoFeedDownXic0MCGen1->Fill(contmc);
3410  if(mcpart->GetPdgCode()<0) fHistoFeedDownXic0MCGen2->Fill(contmc);
3412  fHistoElectronFeedDownXic0MCGen->Fill(contmcele);
3413  if(mcepart->GetPdgCode()<0) fHistoElectronFeedDownXic0MCGen1->Fill(contmcele);
3414  if(mcepart->GetPdgCode()>0) fHistoElectronFeedDownXic0MCGen2->Fill(contmcele);
3415  if(fabs(mcepart->Eta())<etamax){
3417  if(mcepart->GetPdgCode()<0) fHistoEleLambdaMassvsElePtFeeddownXic0MCGen1->Fill(cont2);
3419  if(InvMassEleLambda<2.3){
3420  fHistoElePtFeeddownXic0MCGen->Fill(mcepart->Pt(),fCentrality);
3421  fHistoElePtvsEtaFeeddownXic0MCGen->Fill(cont_eleptvseta);
3422  fHistoElePtvsLambdaPtFeeddownXic0MCGen->Fill(cont_eleptvslambdapt);
3423  }
3424  }
3425  }else if(decaytype==2){
3426  fHistoFeedDownXicPlusMCGen->Fill(contmc);
3427  if(mcpart->GetPdgCode()>0) fHistoFeedDownXicPlusMCGen1->Fill(contmc);
3428  if(mcpart->GetPdgCode()<0) fHistoFeedDownXicPlusMCGen2->Fill(contmc);
3430  fHistoElectronFeedDownXicPlusMCGen->Fill(contmcele);
3431  if(mcepart->GetPdgCode()<0) fHistoElectronFeedDownXicPlusMCGen1->Fill(contmcele);
3432  if(mcepart->GetPdgCode()>0) fHistoElectronFeedDownXicPlusMCGen2->Fill(contmcele);
3433  if(fabs(mcepart->Eta())<etamax){
3435  if(mcepart->GetPdgCode()<0) fHistoEleLambdaMassvsElePtFeeddownXicPlusMCGen1->Fill(cont2);
3437  if(InvMassEleLambda<2.3){
3438  fHistoElePtFeeddownXicPlusMCGen->Fill(mcepart->Pt(),fCentrality);
3439  fHistoElePtvsEtaFeeddownXicPlusMCGen->Fill(cont_eleptvseta);
3440  fHistoElePtvsLambdaPtFeeddownXicPlusMCGen->Fill(cont_eleptvslambdapt);
3441  }
3442  }
3443  }else if(decaytype==3){
3444  fHistoFeedDownSigmaMCGen->Fill(contmc);
3445  if(mcpart->GetPdgCode()>0) fHistoFeedDownSigmaMCGen1->Fill(contmc);
3446  if(mcpart->GetPdgCode()<0) fHistoFeedDownSigmaMCGen2->Fill(contmc);
3447  }
3448 
3450  fMCVariablesTree->Fill();
3451 }
3454 {
3455  //
3456  // Define electron tree variables
3457  //
3458 
3459  const char* nameoutput = GetOutputSlot(9)->GetContainer()->GetName();
3460  fMCEleVariablesTree = new TTree(nameoutput,"MC Ele variables tree");
3461  Int_t nVar = 8;
3462  fCandidateMCEleVariables = new Float_t [nVar];
3463  TString * fCandidateVariableNames = new TString[nVar];
3464 
3465  fCandidateVariableNames[ 0]="Centrality";
3466  fCandidateVariableNames[ 1]="ElePx";
3467  fCandidateVariableNames[ 2]="ElePy";
3468  fCandidateVariableNames[ 3]="ElePz";
3469  fCandidateVariableNames[ 4]="ElePdgCode";
3470  fCandidateVariableNames[ 5]="EleMotherPdgCode";
3471  fCandidateVariableNames[ 6]="RunNumber";
3472  fCandidateVariableNames[ 7]="EvNumber";
3473 
3474  for (Int_t ivar=0; ivar<nVar; ivar++) {
3475  fMCEleVariablesTree->Branch(fCandidateVariableNames[ivar].Data(),&fCandidateMCEleVariables[ivar],Form("%s/f",fCandidateVariableNames[ivar].Data()));
3476  }
3477  return;
3478 }
3480 void AliAnalysisTaskSELc2eleLambdafromAODtracks::FillMCEleROOTObjects(AliAODMCParticle *mcepart, TClonesArray *mcArray)
3481 {
3482  //
3483  // Fill tree depending on fWriteMCVariableTree
3484  //
3485  if(!mcepart) return;
3486 
3487  Bool_t hfe_flag = kFALSE;
3488  Int_t labemother = mcepart->GetMother();
3489  Int_t pdgmotherele = -9999;
3490  if(labemother>=0){
3491  AliAODMCParticle *motherele = (AliAODMCParticle*)mcArray->At(labemother);
3492  pdgmotherele = motherele->GetPdgCode();
3493  if(abs(pdgmotherele)>4000&&abs(pdgmotherele)<4400){
3494  hfe_flag = kTRUE;
3495  }
3496  }
3497  if(!hfe_flag) return;
3498 
3499  Double_t contmc[3];
3500  contmc[0] = mcepart->Pt();
3501  contmc[1] = mcepart->Eta();
3502  contmc[2] = fCentrality;
3503  fHistoElectronMCGen->Fill(contmc);
3504 
3505  for(Int_t i=0;i<8;i++){
3506  fCandidateMCEleVariables[i] = -9999.;
3507  }
3508 
3510  fCandidateMCEleVariables[ 1] = mcepart->Px();
3511  fCandidateMCEleVariables[ 2] = mcepart->Py();
3512  fCandidateMCEleVariables[ 3] = mcepart->Pz();
3513  fCandidateMCEleVariables[ 4] = mcepart->GetPdgCode();
3514  fCandidateMCEleVariables[ 5] = pdgmotherele;
3517 
3518 // if(fWriteMCVariableTree && fWriteEachVariableTree && mcepart->Pt()>0.4 && fabs(mcepart->Eta())<1.0 )
3519 // fMCEleVariablesTree->Fill();
3520 
3521 }
3524 {
3525  //
3526  // Define Mc v0 tree variables
3527  //
3528 
3529  const char* nameoutput = GetOutputSlot(10)->GetContainer()->GetName();
3530  fMCV0VariablesTree = new TTree(nameoutput,"MC v0 variables tree");
3531  Int_t nVar = 8;
3532  fCandidateMCV0Variables = new Float_t [nVar];
3533  TString * fCandidateVariableNames = new TString[nVar];
3534 
3535  fCandidateVariableNames[ 0]="Centrality";
3536  fCandidateVariableNames[ 1]="V0Px";
3537  fCandidateVariableNames[ 2]="V0Py";
3538  fCandidateVariableNames[ 3]="V0Pz";
3539  fCandidateVariableNames[ 4]="V0PdgCode";
3540  fCandidateVariableNames[ 5]="V0MotherPdgCode";
3541  fCandidateVariableNames[ 6]="RunNumber";
3542  fCandidateVariableNames[ 7]="EvNumber";
3543 
3544  for (Int_t ivar=0; ivar<nVar; ivar++) {
3545  fMCV0VariablesTree->Branch(fCandidateVariableNames[ivar].Data(),&fCandidateMCV0Variables[ivar],Form("%s/f",fCandidateVariableNames[ivar].Data()));
3546  }
3547  return;
3548 }
3550 void AliAnalysisTaskSELc2eleLambdafromAODtracks::FillMCV0ROOTObjects(AliAODMCParticle *mcv0part, TClonesArray *mcArray)
3551 {
3552  //
3553  // Fill histograms or tree depending on fWriteMCVariableTree
3554  //
3555  if(!mcv0part) return;
3556 
3557  for(Int_t i=0;i<8;i++){
3558  fCandidateMCV0Variables[i] = -9999.;
3559  }
3560 
3561  Bool_t hfv0_flag = kFALSE;
3562  Int_t labv0mother = mcv0part->GetMother();
3563  Int_t pdgmotherv0 = -9999;
3564  if(labv0mother>=0){
3565  AliAODMCParticle *motherv0 = (AliAODMCParticle*)mcArray->At(labv0mother);
3566  if(motherv0){
3567  pdgmotherv0 = motherv0->GetPdgCode();
3568  if(abs(pdgmotherv0)>4000&&abs(pdgmotherv0)<4400){
3569  hfv0_flag = kTRUE;
3570  }
3571  }
3572  }
3573  if(!hfv0_flag) return;
3574 
3575  Double_t contmc[3];
3576  contmc[0] = mcv0part->Pt();
3577  contmc[1] = mcv0part->Eta();
3578  contmc[2] = fCentrality;
3579  fHistoLambdaMCGen->Fill(contmc);
3580 
3582  fCandidateMCV0Variables[ 1] = mcv0part->Px();
3583  fCandidateMCV0Variables[ 2] = mcv0part->Py();
3584  fCandidateMCV0Variables[ 3] = mcv0part->Pz();
3585  fCandidateMCV0Variables[ 4] = mcv0part->GetPdgCode();
3586  fCandidateMCV0Variables[ 5] = pdgmotherv0;
3589 
3590  if(fWriteMCVariableTree && fWriteEachVariableTree && mcv0part->Pt()>0.4 && fabs(mcv0part->Eta())<1.0 )
3591  fMCV0VariablesTree->Fill();
3592 }
3593 
3594 
3597  //
3599  //
3600 
3601  fCEvents = new TH1F("fCEvents","conter",18,-0.5,17.5);
3602  fCEvents->SetStats(kTRUE);
3603  fCEvents->GetXaxis()->SetBinLabel(1,"X1");
3604  fCEvents->GetXaxis()->SetBinLabel(2,"Analyzed events");
3605  fCEvents->GetXaxis()->SetBinLabel(3,"AliAODVertex exists");
3606  fCEvents->GetXaxis()->SetBinLabel(4,"TriggerOK");
3607  fCEvents->GetXaxis()->SetBinLabel(5,"IsEventSelected");
3608  fCEvents->GetXaxis()->SetBinLabel(6,"CascadesHF exists");
3609  fCEvents->GetXaxis()->SetBinLabel(7,"MCarray exists");
3610  fCEvents->GetXaxis()->SetBinLabel(8,"MCheader exists");
3611  fCEvents->GetXaxis()->SetBinLabel(9,"triggerClass!=CINT1");
3612  fCEvents->GetXaxis()->SetBinLabel(10,"triggerMask!=kAnyINT");
3613  fCEvents->GetXaxis()->SetBinLabel(11,"triggerMask!=kAny");
3614  fCEvents->GetXaxis()->SetBinLabel(12,"vtxTitle.Contains(Z)");
3615  fCEvents->GetXaxis()->SetBinLabel(13,"vtxTitle.Contains(3D)");
3616  fCEvents->GetXaxis()->SetBinLabel(14,"vtxTitle.Doesn'tContain(Z-3D)");
3617  fCEvents->GetXaxis()->SetBinLabel(15,Form("zVtx<=%2.0fcm",fAnalCuts->GetMaxVtxZ()));
3618  fCEvents->GetXaxis()->SetBinLabel(16,"!IsEventSelected");
3619  fCEvents->GetXaxis()->SetBinLabel(17,"triggerMask!=kAnyINT || triggerClass!=CINT1");
3620  fCEvents->GetXaxis()->SetBinLabel(18,Form("zVtxMC<=%2.0fcm",fAnalCuts->GetMaxVtxZ()));
3621  //fCEvents->GetXaxis()->SetTitle("");
3622  fCEvents->GetYaxis()->SetTitle("counts");
3623 
3624  fHTrigger = new TH1F("fHTrigger","counter",18,-0.5,17.5);
3625  fHTrigger->SetStats(kTRUE);
3626  fHTrigger->GetXaxis()->SetBinLabel(1,"X1");
3627  fHTrigger->GetXaxis()->SetBinLabel(2,"kMB");
3628  fHTrigger->GetXaxis()->SetBinLabel(3,"kSemiCentral");
3629  fHTrigger->GetXaxis()->SetBinLabel(4,"kCentral");
3630  fHTrigger->GetXaxis()->SetBinLabel(5,"kINT7");
3631  fHTrigger->GetXaxis()->SetBinLabel(6,"kEMC7");
3632  //fHTrigger->GetXaxis()->SetBinLabel(7,"Space");
3633  fHTrigger->GetXaxis()->SetBinLabel(8,"kMB|kSemiCentral|kCentral");
3634  fHTrigger->GetXaxis()->SetBinLabel(9,"kINT7|kEMC7");
3635  fHTrigger->GetXaxis()->SetBinLabel(11,"kMB&kSemiCentral");
3636  fHTrigger->GetXaxis()->SetBinLabel(12,"kMB&kCentral");
3637  fHTrigger->GetXaxis()->SetBinLabel(13,"kINT7&kEMC7");
3638 
3639  fHCentrality = new TH1F("fHCentrality","conter",100,0.,100.);
3640 
3641 
3642  fOutput->Add(fCEvents);
3643  fOutput->Add(fHTrigger);
3644  fOutput->Add(fHCentrality);
3645 
3646  return;
3647 }
3648 //__________________________________________________________________________
3650 {
3651  //
3653  //
3654 
3655  //------------------------------------------------
3656  // Basic histogram
3657  //------------------------------------------------
3658  Int_t bins_base[3]= {23,100 ,10};
3659  Double_t xmin_base[3]={1.1,0 ,0.00};
3660  Double_t xmax_base[3]={5.7,20. ,100};
3661  fHistoEleLambdaMass = new THnSparseF("fHistoEleLambdaMass","",3,bins_base,xmin_base,xmax_base);
3663  fHistoEleLambdaMassRS = new THnSparseF("fHistoEleLambdaMassRS","",3,bins_base,xmin_base,xmax_base);
3665  fHistoEleLambdaMassRS1 = new THnSparseF("fHistoEleLambdaMassRS1","",3,bins_base,xmin_base,xmax_base);
3667  fHistoEleLambdaMassRS2 = new THnSparseF("fHistoEleLambdaMassRS2","",3,bins_base,xmin_base,xmax_base);
3669  fHistoEleLambdaMassWS = new THnSparseF("fHistoEleLambdaMassWS","",3,bins_base,xmin_base,xmax_base);
3671  fHistoEleLambdaMassWS1 = new THnSparseF("fHistoEleLambdaMassWS1","",3,bins_base,xmin_base,xmax_base);
3673  fHistoEleLambdaMassWS2 = new THnSparseF("fHistoEleLambdaMassWS2","",3,bins_base,xmin_base,xmax_base);
3675  fHistoEleLambdaMassRSMix = new THnSparseF("fHistoEleLambdaMassRSMix","",3,bins_base,xmin_base,xmax_base);
3677  fHistoEleLambdaMassRSMix1 = new THnSparseF("fHistoEleLambdaMassRSMix1","",3,bins_base,xmin_base,xmax_base);
3679  fHistoEleLambdaMassRSMix2 = new THnSparseF("fHistoEleLambdaMassRSMix2","",3,bins_base,xmin_base,xmax_base);
3681  fHistoEleLambdaMassWSMix = new THnSparseF("fHistoEleLambdaMassWSMix","",3,bins_base,xmin_base,xmax_base);
3683  fHistoEleLambdaMassWSMix1 = new THnSparseF("fHistoEleLambdaMassWSMix1","",3,bins_base,xmin_base,xmax_base);
3685  fHistoEleLambdaMassWSMix2 = new THnSparseF("fHistoEleLambdaMassWSMix2","",3,bins_base,xmin_base,xmax_base);
3687  fHistoEleLambdaMassRSSide = new THnSparseF("fHistoEleLambdaMassRSSide","",3,bins_base,xmin_base,xmax_base);
3689  fHistoEleLambdaMassRSSide1 = new THnSparseF("fHistoEleLambdaMassRSSide1","",3,bins_base,xmin_base,xmax_base);
3691  fHistoEleLambdaMassRSSide2 = new THnSparseF("fHistoEleLambdaMassRSSide2","",3,bins_base,xmin_base,xmax_base);
3693  fHistoEleLambdaMassWSSide = new THnSparseF("fHistoEleLambdaMassWSSide","",3,bins_base,xmin_base,xmax_base);
3695  fHistoEleLambdaMassWSSide1 = new THnSparseF("fHistoEleLambdaMassWSSide1","",3,bins_base,xmin_base,xmax_base);
3697  fHistoEleLambdaMassWSSide2 = new THnSparseF("fHistoEleLambdaMassWSSide2","",3,bins_base,xmin_base,xmax_base);
3699 
3700  fHistoEleLambdaMassRSAway = new THnSparseF("fHistoEleLambdaMassRSAway","",3,bins_base,xmin_base,xmax_base);
3702  fHistoEleLambdaMassRS1Away = new THnSparseF("fHistoEleLambdaMassRS1Away","",3,bins_base,xmin_base,xmax_base);
3704  fHistoEleLambdaMassRS2Away = new THnSparseF("fHistoEleLambdaMassRS2Away","",3,bins_base,xmin_base,xmax_base);
3706  fHistoEleLambdaMassWSAway = new THnSparseF("fHistoEleLambdaMassWSAway","",3,bins_base,xmin_base,xmax_base);
3708  fHistoEleLambdaMassWS1Away = new THnSparseF("fHistoEleLambdaMassWS1Away","",3,bins_base,xmin_base,xmax_base);
3710  fHistoEleLambdaMassWS2Away = new THnSparseF("fHistoEleLambdaMassWS2Away","",3,bins_base,xmin_base,xmax_base);
3712  fHistoEleLambdaMassRSMixAway = new THnSparseF("fHistoEleLambdaMassRSMixAway","",3,bins_base,xmin_base,xmax_base);
3714  fHistoEleLambdaMassRSMix1Away = new THnSparseF("fHistoEleLambdaMassRSMix1Away","",3,bins_base,xmin_base,xmax_base);
3716  fHistoEleLambdaMassRSMix2Away = new THnSparseF("fHistoEleLambdaMassRSMix2Away","",3,bins_base,xmin_base,xmax_base);
3718  fHistoEleLambdaMassWSMixAway = new THnSparseF("fHistoEleLambdaMassWSMixAway","",3,bins_base,xmin_base,xmax_base);
3720  fHistoEleLambdaMassWSMix1Away = new THnSparseF("fHistoEleLambdaMassWSMix1Away","",3,bins_base,xmin_base,xmax_base);
3722  fHistoEleLambdaMassWSMix2Away = new THnSparseF("fHistoEleLambdaMassWSMix2Away","",3,bins_base,xmin_base,xmax_base);
3724  fHistoEleLambdaMassRSSideAway = new THnSparseF("fHistoEleLambdaMassRSSideAway","",3,bins_base,xmin_base,xmax_base);
3726  fHistoEleLambdaMassRSSide1Away = new THnSparseF("fHistoEleLambdaMassRSSide1Away","",3,bins_base,xmin_base,xmax_base);
3728  fHistoEleLambdaMassRSSide2Away = new THnSparseF("fHistoEleLambdaMassRSSide2Away","",3,bins_base,xmin_base,xmax_base);
3730  fHistoEleLambdaMassWSSideAway = new THnSparseF("fHistoEleLambdaMassWSSideAway","",3,bins_base,xmin_base,xmax_base);
3732  fHistoEleLambdaMassWSSide1Away = new THnSparseF("fHistoEleLambdaMassWSSide1Away","",3,bins_base,xmin_base,xmax_base);
3734  fHistoEleLambdaMassWSSide2Away = new THnSparseF("fHistoEleLambdaMassWSSide2Away","",3,bins_base,xmin_base,xmax_base);
3736 
3737  Int_t bins_base_elept[3]= {10,100 ,10};
3738  Double_t xmin_base_elept[3]={1.1,0 ,0.00};
3739  Double_t xmax_base_elept[3]={3.1,10. ,100};
3740  fHistoEleLambdaMassvsElePtRS = new THnSparseF("fHistoEleLambdaMassvsElePtRS","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3742  fHistoEleLambdaMassvsElePtWS = new THnSparseF("fHistoEleLambdaMassvsElePtWS","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3744  fHistoEleLambdaMassvsElePtRSMix = new THnSparseF("fHistoEleLambdaMassvsElePtRSMix","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3746  fHistoEleLambdaMassvsElePtWSMix = new THnSparseF("fHistoEleLambdaMassvsElePtWSMix","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3748  fHistoEleLambdaMassvsElePtRSSide = new THnSparseF("fHistoEleLambdaMassvsElePtRSSide","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3750  fHistoEleLambdaMassvsElePtWSSide = new THnSparseF("fHistoEleLambdaMassvsElePtWSSide","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3752  fHistoEleLambdaMassvsElePtRS1 = new THnSparseF("fHistoEleLambdaMassvsElePtRS1","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3754  fHistoEleLambdaMassvsElePtWS1 = new THnSparseF("fHistoEleLambdaMassvsElePtWS1","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3756  fHistoEleLambdaMassvsElePtRSMix1 = new THnSparseF("fHistoEleLambdaMassvsElePtRSMix1","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3758  fHistoEleLambdaMassvsElePtWSMix1 = new THnSparseF("fHistoEleLambdaMassvsElePtWSMix1","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3760  fHistoEleLambdaMassvsElePtRSSide1 = new THnSparseF("fHistoEleLambdaMassvsElePtRSSide1","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3762  fHistoEleLambdaMassvsElePtWSSide1 = new THnSparseF("fHistoEleLambdaMassvsElePtWSSide1","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3764  fHistoEleLambdaMassvsElePtRS2 = new THnSparseF("fHistoEleLambdaMassvsElePtRS2","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3766  fHistoEleLambdaMassvsElePtWS2 = new THnSparseF("fHistoEleLambdaMassvsElePtWS2","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3768  fHistoEleLambdaMassvsElePtRSMix2 = new THnSparseF("fHistoEleLambdaMassvsElePtRSMix2","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3770  fHistoEleLambdaMassvsElePtWSMix2 = new THnSparseF("fHistoEleLambdaMassvsElePtWSMix2","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3772  fHistoEleLambdaMassvsElePtRSSide2 = new THnSparseF("fHistoEleLambdaMassvsElePtRSSide2","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3774  fHistoEleLambdaMassvsElePtWSSide2 = new THnSparseF("fHistoEleLambdaMassvsElePtWSSide2","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3776 
3777  fHistoEleLambdaMassMCS = new THnSparseF("fHistoEleLambdaMassMCS","",3,bins_base,xmin_base,xmax_base);
3779  fHistoEleLambdaMassLambdabMCS = new THnSparseF("fHistoEleLambdaMassLambdabMCS","",3,bins_base,xmin_base,xmax_base);
3781  fHistoEleLambdaMassXibMCS = new THnSparseF("fHistoEleLambdaMassXibMCS","",3,bins_base,xmin_base,xmax_base);
3783  fHistoEleLambdaMassMCGen = new THnSparseF("fHistoEleLambdaMassMCGen","",3,bins_base,xmin_base,xmax_base);
3785  fHistoEleLambdaMassvsElePtMCS = new THnSparseF("fHistoEleLambdaMassvsElePtMCS","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3787  fHistoEleLambdaMassvsElePtMCGen = new THnSparseF("fHistoEleLambdaMassvsElePtMCGen","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3789  fHistoEleLambdaMassvsElePtMCS1 = new THnSparseF("fHistoEleLambdaMassvsElePtMCS1","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3791  fHistoEleLambdaMassvsElePtMCGen1 = new THnSparseF("fHistoEleLambdaMassvsElePtMCGen1","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3793  fHistoEleLambdaMassvsElePtMCS2 = new THnSparseF("fHistoEleLambdaMassvsElePtMCS2","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3795  fHistoEleLambdaMassvsElePtMCGen2 = new THnSparseF("fHistoEleLambdaMassvsElePtMCGen2","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3797 
3798  fHistoElePtRS = new TH2F("fHistoElePtRS","",100,0,10,10,0,100);
3799  fOutputAll->Add(fHistoElePtRS);
3800  fHistoElePtWS = new TH2F("fHistoElePtWS","",100,0.,10.,10,0,100);
3801  fOutputAll->Add(fHistoElePtWS);
3802  fHistoElePtRSMix = new TH2F("fHistoElePtRSMix","",100,0.,10.,10,0,100);
3804  fHistoElePtWSMix = new TH2F("fHistoElePtWSMix","",100,0.,10.,10,0,100);
3806  fHistoElePtMCS = new TH2F("fHistoElePtMCS","",100,0,10,10,0,100);
3807  fOutputAll->Add(fHistoElePtMCS);
3808  fHistoElePtMCGen = new TH2F("fHistoElePtMCGen","",100,0,10,10,0,100);
3810 
3811  Int_t bins_eleptvseta[3]= {10,10 ,10};
3812  Double_t xmin_eleptvseta[3]={0.,-1. ,0.0};
3813  Double_t xmax_eleptvseta[3]={5.,1. ,100};
3814 
3815  fHistoElePtvsEtaRS = new THnSparseF("fHistoElePtvsEtaRS","",3,bins_eleptvseta,xmin_eleptvseta,xmax_eleptvseta);
3817  fHistoElePtvsEtaWS = new THnSparseF("fHistoElePtvsEtaWS","",3,bins_eleptvseta,xmin_eleptvseta,xmax_eleptvseta);
3819  fHistoElePtvsEtaRSMix = new THnSparseF("fHistoElePtvsEtaRSMix","",3,bins_eleptvseta,xmin_eleptvseta,xmax_eleptvseta);
3821  fHistoElePtvsEtaWSMix = new THnSparseF("fHistoElePtvsEtaWSMix","",3,bins_eleptvseta,xmin_eleptvseta,xmax_eleptvseta);
3823  fHistoElePtvsEtaMCS = new THnSparseF("fHistoElePtvsEtaMCS","",3,bins_eleptvseta,xmin_eleptvseta,xmax_eleptvseta);
3825  fHistoElePtvsEtaMCGen = new THnSparseF("fHistoElePtvsEtaMCGen","",3,bins_eleptvseta,xmin_eleptvseta,xmax_eleptvseta);
3827 
3828  Int_t bins_eleptvslambdapt[3]= {10,10 ,10};
3829  Double_t xmin_eleptvslambdapt[3]={0.,0. ,0.0};
3830  Double_t xmax_eleptvslambdapt[3]={5.,5. ,100};
3831 
3832  fHistoElePtvsLambdaPtRS = new THnSparseF("fHistoElePtvsLambdaPtRS","",3,bins_eleptvslambdapt,xmin_eleptvslambdapt,xmax_eleptvslambdapt);
3834  fHistoElePtvsLambdaPtWS = new THnSparseF("fHistoElePtvsLambdaPtWS","",3,bins_eleptvslambdapt,xmin_eleptvslambdapt,xmax_eleptvslambdapt);
3836  fHistoElePtvsLambdaPtRSMix = new THnSparseF("fHistoElePtvsLambdaPtRSMix","",3,bins_eleptvslambdapt,xmin_eleptvslambdapt,xmax_eleptvslambdapt);
3838  fHistoElePtvsLambdaPtWSMix = new THnSparseF("fHistoElePtvsLambdaPtWSMix","",3,bins_eleptvslambdapt,xmin_eleptvslambdapt,xmax_eleptvslambdapt);
3840  fHistoElePtvsLambdaPtMCS = new THnSparseF("fHistoElePtvsLambdaPtMCS","",3,bins_eleptvslambdapt,xmin_eleptvslambdapt,xmax_eleptvslambdapt);
3842  fHistoElePtvsLambdaPtMCGen = new THnSparseF("fHistoElePtvsLambdaPtMCGen","",3,bins_eleptvslambdapt,xmin_eleptvslambdapt,xmax_eleptvslambdapt);
3844  fHistoElePtvsLambdaPtMCLcGen = new THnSparseF("fHistoElePtvsLambdaPtMCLcGen","",3,bins_eleptvslambdapt,xmin_eleptvslambdapt,xmax_eleptvslambdapt);
3846 
3847  Int_t bins_eleptvslambdaptvslcpt[4]= {10,10,10,10};
3848  Double_t xmin_eleptvslambdaptvslcpt[4]={0.,0.,0.,0.0};
3849  Double_t xmax_eleptvslambdaptvslcpt[4]={5.,5.,10.,100};
3850  fHistoElePtvsLambdaPtvsLcPtMCS = new THnSparseF("fHistoElePtvsLambdaPtvsLcPtMCS","",4,bins_eleptvslambdaptvslcpt,xmin_eleptvslambdaptvslcpt,xmax_eleptvslambdaptvslcpt);
3852  fHistoElePtvsLambdaPtvsLcPtMCGen = new THnSparseF("fHistoElePtvsLambdaPtvsLcPtMCGen","",4,bins_eleptvslambdaptvslcpt,xmin_eleptvslambdaptvslcpt,xmax_eleptvslambdaptvslcpt);
3854 
3855  Int_t bins_allpt[4]= {10,10,20,20};
3856  Double_t xmin_allpt[4]={0.,0.,0.,0.0};
3857  Double_t xmax_allpt[4]={20.,20.,10.,10};
3858  fHistoLcPtvseleLambdaPtvsElePtvsLambdaPt = new THnSparseF("fHistoLcPtvseleLambdaPtvsElePtvsLambdaPt","",4,bins_allpt,xmin_allpt,xmax_allpt);
3860 
3861  fHistoEleLambdaPtvsRapidityRS=new TH2F("fHistoEleLambdaPtvsRapidityRS","EleLambda pt vs rap",20,0.,20.,40,-2.,2.);
3863  fHistoEleLambdaPtvsRapidityWS=new TH2F("fHistoEleLambdaPtvsRapidityWS","EleLambda pt vs rap",20,0.,20.,40,-2.,2.);
3865  fHistoEleLambdaPtvsRapidityMCS=new TH2F("fHistoEleLambdaPtvsRapidityMCS","EleLambda pt vs rap",20,0.,20.,40,-2.,2.);
3867 
3868  Int_t bins_eleptvsd0[3]= {10 ,10 ,10};
3869  Double_t xmin_eleptvsd0[3]={0.,-0.2 ,0.0};
3870  Double_t xmax_eleptvsd0[3]={5.,0.2 ,100};
3871 
3872  fHistoElePtvsd0RS = new THnSparseF("fHistoElePtvsd0RS","",3,bins_eleptvsd0,xmin_eleptvsd0,xmax_eleptvsd0);
3874  fHistoElePtvsd0WS = new THnSparseF("fHistoElePtvsd0WS","",3,bins_eleptvsd0,xmin_eleptvsd0,xmax_eleptvsd0);
3876  fHistoElePtvsd0RSMix = new THnSparseF("fHistoElePtvsd0RSMix","",3,bins_eleptvsd0,xmin_eleptvsd0,xmax_eleptvsd0);
3878  fHistoElePtvsd0WSMix = new THnSparseF("fHistoElePtvsd0WSMix","",3,bins_eleptvsd0,xmin_eleptvsd0,xmax_eleptvsd0);
3880  fHistoElePtvsd0MCS = new THnSparseF("fHistoElePtvsd0MCS","",3,bins_eleptvsd0,xmin_eleptvsd0,xmax_eleptvsd0);
3882  fHistoElePtvsd0PromptMCS = new THnSparseF("fHistoElePtvsd0PromptMCS","",3,bins_eleptvsd0,xmin_eleptvsd0,xmax_eleptvsd0);
3884  fHistoElePtvsd0BFeeddownMCS = new THnSparseF("fHistoElePtvsd0BFeeddownMCS","",3,bins_eleptvsd0,xmin_eleptvsd0,xmax_eleptvsd0);
3886 
3887 
3888  //Feeddown from Xic0
3889  fHistoEleLambdaMassFeeddownXic0MCS = new THnSparseF("fHistoEleLambdaMassFeeddownXic0MCS","",3,bins_base,xmin_base,xmax_base);
3891  fHistoEleLambdaMassFeeddownXic0MCGen = new THnSparseF("fHistoEleLambdaMassFeeddownXic0MCGen","",3,bins_base,xmin_base,xmax_base);
3893  fHistoEleLambdaMassvsElePtFeeddownXic0MCS = new THnSparseF("fHistoEleLambdaMassvsElePtFeeddownXic0MCS","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3895  fHistoEleLambdaMassvsElePtFeeddownXic0MCGen = new THnSparseF("fHistoEleLambdaMassvsElePtFeeddownXic0MCGen","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3897  fHistoEleLambdaMassvsElePtFeeddownXic0MCS1 = new THnSparseF("fHistoEleLambdaMassvsElePtFeeddownXic0MCS1","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3899  fHistoEleLambdaMassvsElePtFeeddownXic0MCGen1 = new THnSparseF("fHistoEleLambdaMassvsElePtFeeddownXic0MCGen1","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3901  fHistoEleLambdaMassvsElePtFeeddownXic0MCS2 = new THnSparseF("fHistoEleLambdaMassvsElePtFeeddownXic0MCS2","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3903  fHistoEleLambdaMassvsElePtFeeddownXic0MCGen2 = new THnSparseF("fHistoEleLambdaMassvsElePtFeeddownXic0MCGen2","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3905  fHistoElePtFeeddownXic0MCS = new TH2F("fHistoElePtFeeddownXic0MCS","",100,0,10,10,0,100);
3907  fHistoElePtFeeddownXic0MCGen = new TH2F("fHistoElePtFeeddownXic0MCGen","",100,0,10,10,0,100);
3909  fHistoElePtvsEtaFeeddownXic0MCS = new THnSparseF("fHistoElePtvsEtaFeeddownXic0MCS","",3,bins_eleptvseta,xmin_eleptvseta,xmax_eleptvseta);
3911  fHistoElePtvsEtaFeeddownXic0MCGen = new THnSparseF("fHistoElePtvsEtaFeeddownXic0MCGen","",3,bins_eleptvseta,xmin_eleptvseta,xmax_eleptvseta);
3913  fHistoElePtvsLambdaPtFeeddownXic0MCS = new THnSparseF("fHistoElePtvsLambdaPtFeeddownXic0MCS","",3,bins_eleptvslambdapt,xmin_eleptvslambdapt,xmax_eleptvslambdapt);
3915  fHistoElePtvsLambdaPtFeeddownXic0MCGen = new THnSparseF("fHistoElePtvsLambdaPtFeeddownXic0MCGen","",3,bins_eleptvslambdapt,xmin_eleptvslambdapt,xmax_eleptvslambdapt);
3917 
3918  //Feeddown from XicPlus
3919  fHistoEleLambdaMassFeeddownXicPlusMCS = new THnSparseF("fHistoEleLambdaMassFeeddownXicPlusMCS","",3,bins_base,xmin_base,xmax_base);
3921  fHistoEleLambdaMassFeeddownXicPlusMCGen = new THnSparseF("fHistoEleLambdaMassFeeddownXicPlusMCGen","",3,bins_base,xmin_base,xmax_base);
3923  fHistoEleLambdaMassvsElePtFeeddownXicPlusMCS = new THnSparseF("fHistoEleLambdaMassvsElePtFeeddownXicPlusMCS","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3925  fHistoEleLambdaMassvsElePtFeeddownXicPlusMCGen = new THnSparseF("fHistoEleLambdaMassvsElePtFeeddownXicPlusMCGen","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3927  fHistoEleLambdaMassvsElePtFeeddownXicPlusMCS1 = new THnSparseF("fHistoEleLambdaMassvsElePtFeeddownXicPlusMCS1","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3929  fHistoEleLambdaMassvsElePtFeeddownXicPlusMCGen1 = new THnSparseF("fHistoEleLambdaMassvsElePtFeeddownXicPlusMCGen1","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3931  fHistoEleLambdaMassvsElePtFeeddownXicPlusMCS2 = new THnSparseF("fHistoEleLambdaMassvsElePtFeeddownXicPlusMCS2","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3933  fHistoEleLambdaMassvsElePtFeeddownXicPlusMCGen2 = new THnSparseF("fHistoEleLambdaMassvsElePtFeeddownXicPlusMCGen2","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3935  fHistoElePtFeeddownXicPlusMCS = new TH2F("fHistoElePtFeeddownXicPlusMCS","",100,0,10,10,0,100);
3937  fHistoElePtFeeddownXicPlusMCGen = new TH2F("fHistoElePtFeeddownXicPlusMCGen","",100,0,10,10,0,100);
3939  fHistoElePtvsEtaFeeddownXicPlusMCS = new THnSparseF("fHistoElePtvsEtaFeeddownXicPlusMCS","",3,bins_eleptvseta,xmin_eleptvseta,xmax_eleptvseta);
3941  fHistoElePtvsEtaFeeddownXicPlusMCGen = new THnSparseF("fHistoElePtvsEtaFeeddownXicPlusMCGen","",3,bins_eleptvseta,xmin_eleptvseta,xmax_eleptvseta);
3943  fHistoElePtvsLambdaPtFeeddownXicPlusMCS = new THnSparseF("fHistoElePtvsLambdaPtFeeddownXicPlusMCS","",3,bins_eleptvslambdapt,xmin_eleptvslambdapt,xmax_eleptvslambdapt);
3945  fHistoElePtvsLambdaPtFeeddownXicPlusMCGen = new THnSparseF("fHistoElePtvsLambdaPtFeeddownXicPlusMCGen","",3,bins_eleptvslambdapt,xmin_eleptvslambdapt,xmax_eleptvslambdapt);
3947 
3948  //------------------------------------------------
3949  // checking histograms
3950  //------------------------------------------------
3951  fHistoBachPt = new TH1F("fHistoBachPt","Bachelor p_{T}",100,0.0,5.0);
3952  fOutputAll->Add(fHistoBachPt);
3953  fHistoBachPtMCS = new TH1F("fHistoBachPtMCS","Bachelor p_{T}",100,0.0,5.0);
3955  fHistoBachPtMCGen = new TH1F("fHistoBachPtMCGen","Bachelor p_{T}",100,0.0,5.0);
3957  fHistod0Bach = new TH1F("fHistod0Bach","Bachelor d_{0}",100,-0.5,0.5);
3958  fOutputAll->Add(fHistod0Bach);
3959  fHistoLambdaMassvsPt=new TH2F("fHistoLambdaMassvsPt","Lambda mass",100,1.116-0.05,1.116+0.05,20,0.,10.);
3961  fHistoLambdaMassvsPtMCS=new TH2F("fHistoLambdaMassvsPtMCS","Lambda mass",100,1.116-0.05,1.116+0.05,20,0.,10.);
3963  fHistoLambdaMassvsPtMCGen=new TH2F("fHistoLambdaMassvsPtMCGen","Lambda mass",100,1.116-0.05,1.116+0.05,20,0.,10.);
3965  fHistoLambdaPtvsEta=new TH2F("fHistoLambdaPtvsEta","Lambda mass",20,0.,10.,20,-1.,1.);
3967  fHistoLambdaPtvsEtaMCS=new TH2F("fHistoLambdaPtvsEtaMCS","Lambda mass",20,0.,10.,20,-1.,1.);
3969  fHistoLambdaPtvsEtaMCGen=new TH2F("fHistoLambdaPtvsEtaMCGen","Lambda mass",20,0.,10.,20,-1.,1.);
3971  fHistoK0sMassvsPt=new TH2F("fHistoK0sMassvsPt","K0s mass",100,0.497-0.05,0.497+0.05,20,0.,10.);
3973  fHistoLambdaPtvsDl=new TH2F("fHistoLambdaPtvsDl","Lambda pt vs dl",20,0.,10.,20,0.,40.);
3975  fHistoLambdaPtvsDlSide=new TH2F("fHistoLambdaPtvsDlSide","Lambda pt vs dl",20,0.,10.,20,0.,40.);
3977  fHistoLambdaPtvsDlMCS=new TH2F("fHistoLambdaPtvsDlMCS","Lambda pt vs dl",20,0.,10.,20,0.,40.);
3979  fHistoLambdaPtvsDlFeeddownXi0MCS=new TH2F("fHistoLambdaPtvsDlFeeddownXi0MCS","Lambda pt vs dl",20,0.,10.,20,0.,40.);
3981  fHistoLambdaPtvsDlFeeddownXiMinusMCS=new TH2F("fHistoLambdaPtvsDlFeeddownXiMinusMCS","Lambda pt vs dl",20,0.,10.,20,0.,40.);
3983  fHistoLambdaPtvsDlFeeddownOmegaMCS=new TH2F("fHistoLambdaPtvsDlFeeddownOmegaMCS","Lambda pt vs dl",20,0.,10.,20,0.,40.);
3985 
3986  Int_t bins_armenteros[3]= {20 ,100 ,200};
3987  Double_t xmin_armenteros[3]={0.,0. ,-1.};
3988  Double_t xmax_armenteros[3]={20.,1. ,1.};
3989  fHistoLambdaArmenteros = new THnSparseF("fHistoLambdaArmenteros","",3,bins_armenteros,xmin_armenteros,xmax_armenteros);
3991  fHistoLambdaArmenterosMCS = new THnSparseF("fHistoLambdaArmenterosMCS","",3,bins_armenteros,xmin_armenteros,xmax_armenteros);
3993 
3994  fHistoElectronTPCPID=new TH2F("fHistoElectronTPCPID","",50,0.,5.,50,-20.,20.);
3996  fHistoElectronTOFPID=new TH2F("fHistoElectronTOFPID","",50,0.,5.,50,-20.,20.);
3998  fHistoElectronTPCSelPID=new TH2F("fHistoElectronTPCSelPID","",50,0.,5.,50,-20.,20.);
4000  fHistoElectronTOFSelPID=new TH2F("fHistoElectronTOFSelPID","",50,0.,5.,50,-20.,20.);
4002  fHistoElectronTPCPIDSelTOF=new TH2F("fHistoElectronTPCPIDSelTOF","",10,0.,5.,500,-10.,10.);
4004  fHistoElectronTPCPIDSelTOFSmallEta=new TH2F("fHistoElectronTPCPIDSelTOFSmallEta","",10,0.,5.,500,-10.,10.);
4006  fHistoElectronTPCPIDSelTOFLargeEta=new TH2F("fHistoElectronTPCPIDSelTOFLargeEta","",10,0.,5.,500,-10.,10.);
4008  fHistoMassConversionsMin=new TH1F("fHistoMassConversionsMin","",500,0,0.5);
4010  fHistoMassConversionsSameSignMin=new TH1F("fHistoMassConversionsSameSignMin","",500,0,0.5);
4012 
4013  for(Int_t i=0;i<8;i++){
4014  fHistoElectronTPCPIDSelTOFEtaDep[i]=new TH2F(Form("fHistoElectronTPCPIDSelTOFEtaDep[%d]",i),"",10,0.,5.,500,-10.,10.);
4016  }
4017  fHistoElectronQovPtvsPhi=new TH2F("fHistoElectronQovPtvsPhi","",70,0.,7.,50,-2.,2.);
4019  fHistoLambdaQovPtvsPhi=new TH2F("fHistoLambdaQovPtvsPhi","",70,0.,7.,50,-2.,2.);
4021 
4022  Int_t bins_lcmcgen[3]= {100 ,20 ,10};
4023  Double_t xmin_lcmcgen[3]={0.,-1.0 ,0.0};
4024  Double_t xmax_lcmcgen[3]={20.,1.0 ,100};
4025  fHistoLcMCGen = new THnSparseF("fHistoLcMCGen","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
4026  fOutputAll->Add(fHistoLcMCGen);
4027  fHistoLcMCGen1 = new THnSparseF("fHistoLcMCGen1","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
4028  fOutputAll->Add(fHistoLcMCGen1);
4029  fHistoLcMCGen2 = new THnSparseF("fHistoLcMCGen2","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
4030  fOutputAll->Add(fHistoLcMCGen2);
4031  fHistoFeedDownXic0MCGen = new THnSparseF("fHistoFeedDownXic0MCGen","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
4033  fHistoFeedDownXic0MCGen1 = new THnSparseF("fHistoFeedDownXic0MCGen1","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
4035  fHistoFeedDownXic0MCGen2 = new THnSparseF("fHistoFeedDownXic0MCGen2","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
4037  fHistoFeedDownXicPlusMCGen = new THnSparseF("fHistoFeedDownXicPlusMCGen","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
4039  fHistoFeedDownXicPlusMCGen1 = new THnSparseF("fHistoFeedDownXicPlusMCGen1","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
4041  fHistoFeedDownXicPlusMCGen2 = new THnSparseF("fHistoFeedDownXicPlusMCGen2","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
4043  fHistoFeedDownSigmaMCGen = new THnSparseF("fHistoFeedDownSigmaMCGen","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
4045  fHistoFeedDownSigmaMCGen1 = new THnSparseF("fHistoFeedDownSigmaMCGen1","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
4047  fHistoFeedDownSigmaMCGen2 = new THnSparseF("fHistoFeedDownSigmaMCGen2","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
4049 
4050  fHistoLcMCS = new THnSparseF("fHistoLcMCS","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
4051  fOutputAll->Add(fHistoLcMCS);
4052  fHistoLcMCS1 = new THnSparseF("fHistoLcMCS1","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
4053  fOutputAll->Add(fHistoLcMCS1);
4054  fHistoLcMCS2 = new THnSparseF("fHistoLcMCS2","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
4055  fOutputAll->Add(fHistoLcMCS2);
4056  fHistoFeedDownXic0MCS = new THnSparseF("fHistoFeedDownXic0MCS","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
4058  fHistoFeedDownXic0MCS1 = new THnSparseF("fHistoFeedDownXic0MCS1","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
4060  fHistoFeedDownXic0MCS2 = new THnSparseF("fHistoFeedDownXic0MCS2","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
4062  fHistoFeedDownXicPlusMCS = new THnSparseF("fHistoFeedDownXicPlusMCS","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
4064  fHistoFeedDownXicPlusMCS1 = new THnSparseF("fHistoFeedDownXicPlusMCS1","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
4066  fHistoFeedDownXicPlusMCS2 = new THnSparseF("fHistoFeedDownXicPlusMCS2","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
4068  fHistoFeedDownSigmaMCS = new THnSparseF("fHistoFeedDownSigmaMCS","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
4070  fHistoFeedDownSigmaMCS1 = new THnSparseF("fHistoFeedDownSigmaMCS1","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
4072  fHistoFeedDownSigmaMCS2 = new THnSparseF("fHistoFeedDownSigmaMCS2","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
4074 
4075  Int_t bins_elemcgen[3]= {100 ,20 ,10};
4076  Double_t xmin_elemcgen[3]={0.,-1.0 ,0.0};
4077  Double_t xmax_elemcgen[3]={10.,1.0 ,100};
4078  fHistoElectronMCGen = new THnSparseF("fHistoElectronMCGen","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
4080  fHistoLcElectronMCGen = new THnSparseF("fHistoLcElectronMCGen","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
4082  fHistoLcElectronMCGen1 = new THnSparseF("fHistoLcElectronMCGen1","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
4084  fHistoLcElectronMCGen2 = new THnSparseF("fHistoLcElectronMCGen2","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
4086  fHistoElectronFeedDownXic0MCGen = new THnSparseF("fHistoElectronFeedDownXic0MCGen","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
4088  fHistoElectronFeedDownXic0MCGen1 = new THnSparseF("fHistoElectronFeedDownXic0MCGen1","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
4090  fHistoElectronFeedDownXic0MCGen2 = new THnSparseF("fHistoElectronFeedDownXic0MCGen2","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
4092  fHistoElectronFeedDownXicPlusMCGen = new THnSparseF("fHistoElectronFeedDownXicPlusMCGen","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
4094  fHistoElectronFeedDownXicPlusMCGen1 = new THnSparseF("fHistoElectronFeedDownXicPlusMCGen1","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
4096  fHistoElectronFeedDownXicPlusMCGen2 = new THnSparseF("fHistoElectronFeedDownXicPlusMCGen2","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
4098  fHistoLcElectronMCS = new THnSparseF("fHistoLcElectronMCS","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
4100  fHistoLcElectronMCS1 = new THnSparseF("fHistoLcElectronMCS1","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
4102  fHistoLcElectronMCS2 = new THnSparseF("fHistoLcElectronMCS2","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
4104  fHistoElectronFeedDownXic0MCS = new THnSparseF("fHistoElectronFeedDownXic0MCS","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
4106  fHistoElectronFeedDownXic0MCS1 = new THnSparseF("fHistoElectronFeedDownXic0MCS1","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
4108  fHistoElectronFeedDownXic0MCS2 = new THnSparseF("fHistoElectronFeedDownXic0MCS2","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
4110  fHistoElectronFeedDownXicPlusMCS = new THnSparseF("fHistoElectronFeedDownXicPlusMCS","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
4112  fHistoElectronFeedDownXicPlusMCS1 = new THnSparseF("fHistoElectronFeedDownXicPlusMCS1","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
4114  fHistoElectronFeedDownXicPlusMCS2 = new THnSparseF("fHistoElectronFeedDownXicPlusMCS2","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
4116 
4117  Int_t bins_lambdamcgen[3]= {50 ,20 ,10};
4118  Double_t xmin_lambdamcgen[3]={0.,-1.0 ,0.0};
4119  Double_t xmax_lambdamcgen[3]={10.,1.0 ,100};
4120  fHistoLambdaMCGen = new THnSparseF("fHistoLambdaMCGen","",3,bins_lambdamcgen,xmin_lambdamcgen,xmax_lambdamcgen);
4122 
4123  Int_t bins_eleptvsv0dl[3]= {100 ,20 ,10};
4124  Double_t xmin_eleptvsv0dl[3]={0.,0. ,0.0};
4125  Double_t xmax_eleptvsv0dl[3]={10.,40. ,100};
4126  fHistoElePtvsV0dlRS = new THnSparseF("fHistoElePtvsV0dlRS","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
4128  fHistoElePtvsV0dlRS1 = new THnSparseF("fHistoElePtvsV0dlRS1","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
4130  fHistoElePtvsV0dlRS2 = new THnSparseF("fHistoElePtvsV0dlRS2","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
4132  fHistoElePtvsV0dlRSSide = new THnSparseF("fHistoElePtvsV0dlRSSide","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
4134  fHistoElePtvsV0dlRSSide1 = new THnSparseF("fHistoElePtvsV0dlRSSide1","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
4136  fHistoElePtvsV0dlRSSide2 = new THnSparseF("fHistoElePtvsV0dlRSSide2","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
4138  fHistoElePtvsV0dlRSMix = new THnSparseF("fHistoElePtvsV0dlRSMix","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
4140  fHistoElePtvsV0dlRSMix1 = new THnSparseF("fHistoElePtvsV0dlRSMix1","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
4142  fHistoElePtvsV0dlRSMix2 = new THnSparseF("fHistoElePtvsV0dlRSMix2","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
4144  fHistoElePtvsV0dlWS = new THnSparseF("fHistoElePtvsV0dlWS","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
4146  fHistoElePtvsV0dlWS1 = new THnSparseF("fHistoElePtvsV0dlWS1","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
4148  fHistoElePtvsV0dlWS2 = new THnSparseF("fHistoElePtvsV0dlWS2","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
4150  fHistoElePtvsV0dlWSSide = new THnSparseF("fHistoElePtvsV0dlWSSide","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
4152  fHistoElePtvsV0dlWSSide1 = new THnSparseF("fHistoElePtvsV0dlWSSide1","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
4154  fHistoElePtvsV0dlWSSide2 = new THnSparseF("fHistoElePtvsV0dlWSSide2","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
4156  fHistoElePtvsV0dlWSMix = new THnSparseF("fHistoElePtvsV0dlWSMix","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
4158  fHistoElePtvsV0dlWSMix1 = new THnSparseF("fHistoElePtvsV0dlWSMix1","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
4160  fHistoElePtvsV0dlWSMix2 = new THnSparseF("fHistoElePtvsV0dlWSMix2","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
4162  fHistoElePtvsV0dlMCS = new THnSparseF("fHistoElePtvsV0dlMCS","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
4164  fHistoElePtvsV0dlMCS1 = new THnSparseF("fHistoElePtvsV0dlMCS1","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
4166  fHistoElePtvsV0dlMCS2 = new THnSparseF("fHistoElePtvsV0dlMCS2","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
4168  fHistoElePtvsV0dlFeedDownXic0MCS = new THnSparseF("fHistoElePtvsV0dlFeedDownXic0MCS","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
4170  fHistoElePtvsV0dlFeedDownXic0MCS1 = new THnSparseF("fHistoElePtvsV0dlFeedDownXic0MCS1","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
4172  fHistoElePtvsV0dlFeedDownXic0MCS2 = new THnSparseF("fHistoElePtvsV0dlFeedDownXic0MCS2","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
4174  fHistoElePtvsV0dlFeedDownXicPlusMCS = new THnSparseF("fHistoElePtvsV0dlFeedDownXicPlusMCS","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
4176  fHistoElePtvsV0dlFeedDownXicPlusMCS1 = new THnSparseF("fHistoElePtvsV0dlFeedDownXicPlusMCS1","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
4178  fHistoElePtvsV0dlFeedDownXicPlusMCS2 = new THnSparseF("fHistoElePtvsV0dlFeedDownXicPlusMCS2","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
4180 
4181  Int_t bins_eleptvsv0dca[3]= {100 ,20 ,10};
4182  Double_t xmin_eleptvsv0dca[3]={0.,0. ,0.0};
4183  Double_t xmax_eleptvsv0dca[3]={10.,1. ,100};
4184  fHistoElePtvsV0dcaRS = new THnSparseF("fHistoElePtvsV0dcaRS","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
4186  fHistoElePtvsV0dcaRS1 = new THnSparseF("fHistoElePtvsV0dcaRS1","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
4188  fHistoElePtvsV0dcaRS2 = new THnSparseF("fHistoElePtvsV0dcaRS2","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
4190  fHistoElePtvsV0dcaRSSide = new THnSparseF("fHistoElePtvsV0dcaRSSide","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
4192  fHistoElePtvsV0dcaRSSide1 = new THnSparseF("fHistoElePtvsV0dcaRSSide1","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
4194  fHistoElePtvsV0dcaRSSide2 = new THnSparseF("fHistoElePtvsV0dcaRSSide2","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
4196  fHistoElePtvsV0dcaRSMix = new THnSparseF("fHistoElePtvsV0dcaRSMix","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
4198  fHistoElePtvsV0dcaRSMix1 = new THnSparseF("fHistoElePtvsV0dcaRSMix1","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
4200  fHistoElePtvsV0dcaRSMix2 = new THnSparseF("fHistoElePtvsV0dcaRSMix2","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
4202  fHistoElePtvsV0dcaWS = new THnSparseF("fHistoElePtvsV0dcaWS","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
4204  fHistoElePtvsV0dcaWS1 = new THnSparseF("fHistoElePtvsV0dcaWS1","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
4206  fHistoElePtvsV0dcaWS2 = new THnSparseF("fHistoElePtvsV0dcaWS2","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
4208  fHistoElePtvsV0dcaWSSide = new THnSparseF("fHistoElePtvsV0dcaWSSide","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
4210  fHistoElePtvsV0dcaWSSide1 = new THnSparseF("fHistoElePtvsV0dcaWSSide1","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
4212  fHistoElePtvsV0dcaWSSide2 = new THnSparseF("fHistoElePtvsV0dcaWSSide2","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
4214  fHistoElePtvsV0dcaWSMix = new THnSparseF("fHistoElePtvsV0dcaWSMix","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
4216  fHistoElePtvsV0dcaWSMix1 = new THnSparseF("fHistoElePtvsV0dcaWSMix1","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
4218  fHistoElePtvsV0dcaWSMix2 = new THnSparseF("fHistoElePtvsV0dcaWSMix2","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
4220  fHistoElePtvsV0dcaMCS = new THnSparseF("fHistoElePtvsV0dcaMCS","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
4222  fHistoElePtvsV0dcaMCS1 = new THnSparseF("fHistoElePtvsV0dcaMCS1","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
4224  fHistoElePtvsV0dcaMCS2 = new THnSparseF("fHistoElePtvsV0dcaMCS2","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
4226  fHistoElePtvsV0dcaFeedDownXic0MCS = new THnSparseF("fHistoElePtvsV0dcaFeedDownXic0MCS","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
4228  fHistoElePtvsV0dcaFeedDownXic0MCS1 = new THnSparseF("fHistoElePtvsV0dcaFeedDownXic0MCS1","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
4230  fHistoElePtvsV0dcaFeedDownXic0MCS2 = new THnSparseF("fHistoElePtvsV0dcaFeedDownXic0MCS2","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
4232  fHistoElePtvsV0dcaFeedDownXicPlusMCS = new THnSparseF("fHistoElePtvsV0dcaFeedDownXicPlusMCS","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
4234  fHistoElePtvsV0dcaFeedDownXicPlusMCS1 = new THnSparseF("fHistoElePtvsV0dcaFeedDownXicPlusMCS1","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
4236  fHistoElePtvsV0dcaFeedDownXicPlusMCS2 = new THnSparseF("fHistoElePtvsV0dcaFeedDownXicPlusMCS2","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
4238 
4239  Int_t bins_elelamptvsv0dl[4]= {100 ,20 ,100, 10};
4240  Double_t xmin_elelamptvsv0dl[4]={0.,0. ,-0.5, 0.0};
4241  Double_t xmax_elelamptvsv0dl[4]={20.,40.,0.5 ,100};
4242  fHistoEleLambdaPtvsV0dlRS = new THnSparseF("fHistoEleLambdaPtvsV0dlRS","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
4244  fHistoEleLambdaPtvsV0dlRS1 = new THnSparseF("fHistoEleLambdaPtvsV0dlRS1","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
4246  fHistoEleLambdaPtvsV0dlRS2 = new THnSparseF("fHistoEleLambdaPtvsV0dlRS2","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
4248  fHistoEleLambdaPtvsV0dlRSSide = new THnSparseF("fHistoEleLambdaPtvsV0dlRSSide","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
4250  fHistoEleLambdaPtvsV0dlRSSide1 = new THnSparseF("fHistoEleLambdaPtvsV0dlRSSide1","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
4252  fHistoEleLambdaPtvsV0dlRSSide2 = new THnSparseF("fHistoEleLambdaPtvsV0dlRSSide2","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
4254  fHistoEleLambdaPtvsV0dlRSMix = new THnSparseF("fHistoEleLambdaPtvsV0dlRSMix","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
4256  fHistoEleLambdaPtvsV0dlRSMix1 = new THnSparseF("fHistoEleLambdaPtvsV0dlRSMix1","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
4258  fHistoEleLambdaPtvsV0dlRSMix2 = new THnSparseF("fHistoEleLambdaPtvsV0dlRSMix2","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
4260  fHistoEleLambdaPtvsV0dlWS = new THnSparseF("fHistoEleLambdaPtvsV0dlWS","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
4262  fHistoEleLambdaPtvsV0dlWS1 = new THnSparseF("fHistoEleLambdaPtvsV0dlWS1","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
4264  fHistoEleLambdaPtvsV0dlWS2 = new THnSparseF("fHistoEleLambdaPtvsV0dlWS2","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
4266  fHistoEleLambdaPtvsV0dlWSSide = new THnSparseF("fHistoEleLambdaPtvsV0dlWSSide","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
4268  fHistoEleLambdaPtvsV0dlWSSide1 = new THnSparseF("fHistoEleLambdaPtvsV0dlWSSide1","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
4270  fHistoEleLambdaPtvsV0dlWSSide2 = new THnSparseF("fHistoEleLambdaPtvsV0dlWSSide2","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
4272  fHistoEleLambdaPtvsV0dlWSMix = new THnSparseF("fHistoEleLambdaPtvsV0dlWSMix","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
4274  fHistoEleLambdaPtvsV0dlWSMix1 = new THnSparseF("fHistoEleLambdaPtvsV0dlWSMix1","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
4276  fHistoEleLambdaPtvsV0dlWSMix2 = new THnSparseF("fHistoEleLambdaPtvsV0dlWSMix2","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
4278  fHistoEleLambdaPtvsV0dlMCS = new THnSparseF("fHistoEleLambdaPtvsV0dlMCS","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
4280  fHistoEleLambdaPtvsV0dlMCS1 = new THnSparseF("fHistoEleLambdaPtvsV0dlMCS1","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
4282  fHistoEleLambdaPtvsV0dlMCS2 = new THnSparseF("fHistoEleLambdaPtvsV0dlMCS2","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
4284  fHistoEleLambdaPtvsV0dlPromptMCS = new THnSparseF("fHistoEleLambdaPtvsV0dlPromptMCS","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
4286  fHistoEleLambdaPtvsV0dlPromptMCS1 = new THnSparseF("fHistoEleLambdaPtvsV0dlPromptMCS1","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
4288  fHistoEleLambdaPtvsV0dlPromptMCS2 = new THnSparseF("fHistoEleLambdaPtvsV0dlPromptMCS2","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
4290  fHistoEleLambdaPtvsV0dlBFeeddownMCS = new THnSparseF("fHistoEleLambdaPtvsV0dlBFeeddownMCS","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
4292  fHistoEleLambdaPtvsV0dlBFeeddownMCS1 = new THnSparseF("fHistoEleLambdaPtvsV0dlBFeeddownMCS1","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
4294  fHistoEleLambdaPtvsV0dlBFeeddownMCS2 = new THnSparseF("fHistoEleLambdaPtvsV0dlBFeeddownMCS2","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
4296  fHistoEleLambdaPtvsV0dlFeedDownXic0MCS = new THnSparseF("fHistoEleLambdaPtvsV0dlFeedDownXic0MCS","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
4298  fHistoEleLambdaPtvsV0dlFeedDownXic0MCS1 = new THnSparseF("fHistoEleLambdaPtvsV0dlFeedDownXic0MCS1","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
4300  fHistoEleLambdaPtvsV0dlFeedDownXic0MCS2 = new THnSparseF("fHistoEleLambdaPtvsV0dlFeedDownXic0MCS2","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
4302  fHistoEleLambdaPtvsV0dlFeedDownXic0PromptMCS = new THnSparseF("fHistoEleLambdaPtvsV0dlFeedDownXic0PromptMCS","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
4304  fHistoEleLambdaPtvsV0dlFeedDownXic0PromptMCS1 = new THnSparseF("fHistoEleLambdaPtvsV0dlFeedDownXic0PromptMCS1","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
4306  fHistoEleLambdaPtvsV0dlFeedDownXic0PromptMCS2 = new THnSparseF("fHistoEleLambdaPtvsV0dlFeedDownXic0PromptMCS2","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
4308  fHistoEleLambdaPtvsV0dlFeedDownXic0BFeeddownMCS = new THnSparseF("fHistoEleLambdaPtvsV0dlFeedDownXic0BFeeddownMCS","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
4310  fHistoEleLambdaPtvsV0dlFeedDownXic0BFeeddownMCS1 = new THnSparseF("fHistoEleLambdaPtvsV0dlFeedDownXic0BFeeddownMCS1","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
4312  fHistoEleLambdaPtvsV0dlFeedDownXic0BFeeddownMCS2 = new THnSparseF("fHistoEleLambdaPtvsV0dlFeedDownXic0BFeeddownMCS2","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
4314 
4315  fHistoEleLambdaPtvsV0dlFeedDownXicPlusMCS = new THnSparseF("fHistoEleLambdaPtvsV0dlFeedDownXicPlusMCS","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
4317  fHistoEleLambdaPtvsV0dlFeedDownXicPlusMCS1 = new THnSparseF("fHistoEleLambdaPtvsV0dlFeedDownXicPlusMCS1","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
4319  fHistoEleLambdaPtvsV0dlFeedDownXicPlusMCS2 = new THnSparseF("fHistoEleLambdaPtvsV0dlFeedDownXicPlusMCS2","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
4321  fHistoEleLambdaPtvsV0dlFeedDownXicPlusPromptMCS = new THnSparseF("fHistoEleLambdaPtvsV0dlFeedDownXicPlusPromptMCS","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
4323  fHistoEleLambdaPtvsV0dlFeedDownXicPlusPromptMCS1 = new THnSparseF("fHistoEleLambdaPtvsV0dlFeedDownXicPlusPromptMCS1","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
4325  fHistoEleLambdaPtvsV0dlFeedDownXicPlusPromptMCS2 = new THnSparseF("fHistoEleLambdaPtvsV0dlFeedDownXicPlusPromptMCS2","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
4327  fHistoEleLambdaPtvsV0dlFeedDownXicPlusBFeeddownMCS = new THnSparseF("fHistoEleLambdaPtvsV0dlFeedDownXicPlusBFeeddownMCS","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
4329  fHistoEleLambdaPtvsV0dlFeedDownXicPlusBFeeddownMCS1 = new THnSparseF("fHistoEleLambdaPtvsV0dlFeedDownXicPlusBFeeddownMCS1","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
4331  fHistoEleLambdaPtvsV0dlFeedDownXicPlusBFeeddownMCS2 = new THnSparseF("fHistoEleLambdaPtvsV0dlFeedDownXicPlusBFeeddownMCS2","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
4333 
4334  fHistoEleLambdaPtvsV0dlFeedDownSigmaMCS = new THnSparseF("fHistoEleLambdaPtvsV0dlFeedDownSigmaMCS","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
4336  fHistoEleLambdaPtvsV0dlFeedDownSigmaMCS1 = new THnSparseF("fHistoEleLambdaPtvsV0dlFeedDownSigmaMCS1","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
4338  fHistoEleLambdaPtvsV0dlFeedDownSigmaMCS2 = new THnSparseF("fHistoEleLambdaPtvsV0dlFeedDownSigmaMCS2","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
4340  fHistoEleLambdaPtvsV0dlFeedDownSigmaPromptMCS = new THnSparseF("fHistoEleLambdaPtvsV0dlFeedDownSigmaPromptMCS","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
4342  fHistoEleLambdaPtvsV0dlFeedDownSigmaPromptMCS1 = new THnSparseF("fHistoEleLambdaPtvsV0dlFeedDownSigmaPromptMCS1","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
4344  fHistoEleLambdaPtvsV0dlFeedDownSigmaPromptMCS2 = new THnSparseF("fHistoEleLambdaPtvsV0dlFeedDownSigmaPromptMCS2","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
4346  fHistoEleLambdaPtvsV0dlFeedDownSigmaBFeeddownMCS = new THnSparseF("fHistoEleLambdaPtvsV0dlFeedDownSigmaBFeeddownMCS","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
4348  fHistoEleLambdaPtvsV0dlFeedDownSigmaBFeeddownMCS1 = new THnSparseF("fHistoEleLambdaPtvsV0dlFeedDownSigmaBFeeddownMCS1","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
4350  fHistoEleLambdaPtvsV0dlFeedDownSigmaBFeeddownMCS2 = new THnSparseF("fHistoEleLambdaPtvsV0dlFeedDownSigmaBFeeddownMCS2","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
4352  fHistoEleLambdaPtvsV0dlLambdabMCS = new THnSparseF("fHistoEleLambdaPtvsV0dlLambdabMCS","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
4354  fHistoEleLambdaPtvsV0dlLambdabMCS1 = new THnSparseF("fHistoEleLambdaPtvsV0dlLambdabMCS1","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
4356  fHistoEleLambdaPtvsV0dlLambdabMCS2 = new THnSparseF("fHistoEleLambdaPtvsV0dlLambdabMCS2","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
4358  fHistoEleLambdaPtvsV0dlXibMCS = new THnSparseF("fHistoEleLambdaPtvsV0dlXibMCS","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
4360  fHistoEleLambdaPtvsV0dlXibMCS1 = new THnSparseF("fHistoEleLambdaPtvsV0dlXibMCS1","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
4362  fHistoEleLambdaPtvsV0dlXibMCS2 = new THnSparseF("fHistoEleLambdaPtvsV0dlXibMCS2","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
4364 
4365  fHistoEleLambdaPtvsV0dlRSAway = new THnSparseF("fHistoEleLambdaPtvsV0dlRSAway","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
4367  fHistoEleLambdaPtvsV0dlRS1Away = new THnSparseF("fHistoEleLambdaPtvsV0dlRS1Away","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
4369  fHistoEleLambdaPtvsV0dlRS2Away = new THnSparseF("fHistoEleLambdaPtvsV0dlRS2Away","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
4371  fHistoEleLambdaPtvsV0dlRSSideAway = new THnSparseF("fHistoEleLambdaPtvsV0dlRSSideAway","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
4373  fHistoEleLambdaPtvsV0dlRSSide1Away = new THnSparseF("fHistoEleLambdaPtvsV0dlRSSide1Away","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
4375  fHistoEleLambdaPtvsV0dlRSSide2Away = new THnSparseF("fHistoEleLambdaPtvsV0dlRSSide2Away","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
4377  fHistoEleLambdaPtvsV0dlRSMixAway = new THnSparseF("fHistoEleLambdaPtvsV0dlRSMixAway","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
4379  fHistoEleLambdaPtvsV0dlRSMix1Away = new THnSparseF("fHistoEleLambdaPtvsV0dlRSMix1Away","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
4381  fHistoEleLambdaPtvsV0dlRSMix2Away = new THnSparseF("fHistoEleLambdaPtvsV0dlRSMix2Away","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
4383  fHistoEleLambdaPtvsV0dlWSAway = new THnSparseF("fHistoEleLambdaPtvsV0dlWSAway","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
4385  fHistoEleLambdaPtvsV0dlWS1Away = new THnSparseF("fHistoEleLambdaPtvsV0dlWS1Away","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
4387  fHistoEleLambdaPtvsV0dlWS2Away = new THnSparseF("fHistoEleLambdaPtvsV0dlWS2Away","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
4389  fHistoEleLambdaPtvsV0dlWSSideAway = new THnSparseF("fHistoEleLambdaPtvsV0dlWSSideAway","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
4391  fHistoEleLambdaPtvsV0dlWSSide1Away = new THnSparseF("fHistoEleLambdaPtvsV0dlWSSide1Away","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
4393  fHistoEleLambdaPtvsV0dlWSSide2Away = new THnSparseF("fHistoEleLambdaPtvsV0dlWSSide2Away","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
4395  fHistoEleLambdaPtvsV0dlWSMixAway = new THnSparseF("fHistoEleLambdaPtvsV0dlWSMixAway","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
4397  fHistoEleLambdaPtvsV0dlWSMix1Away = new THnSparseF("fHistoEleLambdaPtvsV0dlWSMix1Away","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
4399  fHistoEleLambdaPtvsV0dlWSMix2Away = new THnSparseF("fHistoEleLambdaPtvsV0dlWSMix2Away","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
4401 
4402  fHistoResponseElePt = new TH2D("fHistoResponseElePt","",100,0.,10.,100,0.,10.);
4404  fHistoResponseElePt1 = new TH2D("fHistoResponseElePt1","",100,0.,10.,100,0.,10.);
4406  fHistoResponseElePt2 = new TH2D("fHistoResponseElePt2","",100,0.,10.,100,0.,10.);
4408  fHistoResponseEleLambdaPt = new TH2D("fHistoResponseEleLambdaPt","",100,0.,20.,100,0.,20.);
4410  fHistoResponseEleLambdaPt1 = new TH2D("fHistoResponseEleLambdaPt1","",100,0.,20.,100,0.,20.);
4412  fHistoResponseEleLambdaPt2 = new TH2D("fHistoResponseEleLambdaPt2","",100,0.,20.,100,0.,20.);
4414  fHistoResponseEleLambdaPtFeeddownXic0 = new TH2D("fHistoResponseEleLambdaPtFeeddownXic0","",100,0.,20.,100,0.,20.);
4416  fHistoResponseEleLambdaPtFeeddownXic01 = new TH2D("fHistoResponseEleLambdaPtFeeddownXic01","",100,0.,20.,100,0.,20.);
4418  fHistoResponseEleLambdaPtFeeddownXic02 = new TH2D("fHistoResponseEleLambdaPtFeeddownXic02","",100,0.,20.,100,0.,20.);
4420  fHistoResponseEleLambdaPtFeeddownXicPlus = new TH2D("fHistoResponseEleLambdaPtFeeddownXicPlus","",100,0.,20.,100,0.,20.);
4422  fHistoResponseEleLambdaPtFeeddownXicPlus1 = new TH2D("fHistoResponseEleLambdaPtFeeddownXicPlus1","",100,0.,20.,100,0.,20.);
4424  fHistoResponseEleLambdaPtFeeddownXicPlus2 = new TH2D("fHistoResponseEleLambdaPtFeeddownXicPlus2","",100,0.,20.,100,0.,20.);
4426  fHistoResponseEleLambdaPtFeeddownSigma = new TH2D("fHistoResponseEleLambdaPtFeeddownSigma","",100,0.,20.,100,0.,20.);
4428  fHistoResponseEleLambdaPtFeeddownSigma1 = new TH2D("fHistoResponseEleLambdaPtFeeddownSigma1","",100,0.,20.,100,0.,20.);
4430  fHistoResponseEleLambdaPtFeeddownSigma2 = new TH2D("fHistoResponseEleLambdaPtFeeddownSigma2","",100,0.,20.,100,0.,20.);
4432 
4433  fHistonEvtvsRunNumber=new TH1F("fHistonEvtvsRunNumber","",20000,-0.5,19999.5);
4435  fHistonElevsRunNumber=new TH1F("fHistonElevsRunNumber","",20000,-0.5,19999.5);
4437  fHistonLambdavsRunNumber=new TH1F("fHistonLambdavsRunNumber","",20000,-0.5,19999.5);
4439  fHistoMCEventType=new TH1F("fHistoMCEventType","",4,-0.5,3.5);
4441  fHistoMCDeltaPhiccbar=new TH1F("fHistoMCDeltaPhiccbar","",100,0.,3.2);
4443 
4444  fHistodPhiSdEtaSElectronProtonR125RS = new TH2D("fHistodPhiSdEtaSElectronProtonR125RS","",50,0.,0.2,50,0.,0.2);
4446  fHistodPhiSdEtaSElectronProtonR125WS = new TH2D("fHistodPhiSdEtaSElectronProtonR125WS","",50,0.,0.2,50,0.,0.2);
4448  fHistodPhiSdEtaSElectronProtonR125RSMix = new TH2D("fHistodPhiSdEtaSElectronProtonR125RSMix","",50,0.,0.2,50,0.,0.2);
4450  fHistodPhiSdEtaSElectronProtonR125WSMix = new TH2D("fHistodPhiSdEtaSElectronProtonR125WSMix","",50,0.,0.2,50,0.,0.2);
4452  fHistodPhiSdEtaSElectronPionR125RS = new TH2D("fHistodPhiSdEtaSElectronPionR125RS","",50,0.,0.2,50,0.,0.2);
4454  fHistodPhiSdEtaSElectronPionR125WS = new TH2D("fHistodPhiSdEtaSElectronPionR125WS","",50,0.,0.2,50,0.,0.2);
4456  fHistodPhiSdEtaSElectronPionR125RSMix = new TH2D("fHistodPhiSdEtaSElectronPionR125RSMix","",50,0.,0.2,50,0.,0.2);
4458  fHistodPhiSdEtaSElectronPionR125WSMix = new TH2D("fHistodPhiSdEtaSElectronPionR125WSMix","",50,0.,0.2,50,0.,0.2);
4460 
4461  for(Int_t ih=0;ih<17;ih++){
4462  Int_t bins_eleptvscutvars[3];
4463  Double_t xmin_eleptvscutvars[3];
4464  Double_t xmax_eleptvscutvars[3];
4465 
4466  bins_eleptvscutvars[0] = 20;//electron pT bin
4467  xmin_eleptvscutvars[0] = 0.;
4468  xmax_eleptvscutvars[0] = 20.;
4469  bins_eleptvscutvars[2] = 10;//centrality bin
4470  xmin_eleptvscutvars[2] = 0.;
4471  xmax_eleptvscutvars[2] = 100.;
4472 
4473  if(ih==0 || ih==1){
4474  //0: TPC Ncluster 1: TPC ncluster PID
4475  bins_eleptvscutvars[1] = 40;
4476  xmin_eleptvscutvars[1] = 0.;
4477  xmax_eleptvscutvars[1] = 160.;
4478  }else if(ih==2 || ih==3){
4479  //2: nSigma(TPC,e) 3: nSigma(TOF,e)
4480  bins_eleptvscutvars[1] = 20;
4481  xmin_eleptvscutvars[1] = -5.;
4482  xmax_eleptvscutvars[1] = 5.;
4483  }else if(ih==4){
4484  //4: eta
4485  bins_eleptvscutvars[1] = 30;
4486  xmin_eleptvscutvars[1] = -1.5;
4487  xmax_eleptvscutvars[1] = 1.5;
4488  }else if(ih==5){
4489  //5: nITS cluster
4490  bins_eleptvscutvars[1] = 7;
4491  xmin_eleptvscutvars[1] = -0.5;
4492  xmax_eleptvscutvars[1] = 6.5;
4493  }else if(ih==6){
4494  //6: Lambda mass
4495  bins_eleptvscutvars[1] = 50;
4496  xmin_eleptvscutvars[1] = 1.1156-0.03;
4497  xmax_eleptvscutvars[1] = 1.1156+0.03;
4498  }else if(ih==7){
4499  //7: Rfid Lambda
4500  bins_eleptvscutvars[1] = 20;
4501  xmin_eleptvscutvars[1] = 0.;
4502  xmax_eleptvscutvars[1] = 5.;
4503  }else if(ih==8){
4504  //10: Dca V0
4505  bins_eleptvscutvars[1] = 20;
4506  xmin_eleptvscutvars[1] = 0.;
4507  xmax_eleptvscutvars[1] = 2.;
4508  }else if(ih==9 || ih==10 ){
4509  //9: DCA V0pr to prim 10: DCA V0pi to prim
4510  bins_eleptvscutvars[1] = 20;
4511  xmin_eleptvscutvars[1] = 0.;
4512  xmax_eleptvscutvars[1] = 0.5;
4513  }else if(ih==11){
4514  //11: CosPAv0
4515  bins_eleptvscutvars[1] = 20;
4516  xmin_eleptvscutvars[1] = 0.95;
4517  xmax_eleptvscutvars[1] = 1.0;
4518  }else if(ih==12){
4519  //12:K0s masss
4520  bins_eleptvscutvars[1] = 50;
4521  xmin_eleptvscutvars[1] = 0.497-0.03;
4522  xmax_eleptvscutvars[1] = 0.497+0.03;
4523  }else if(ih==13 || ih==14){
4524  //13: nSigmaTPC(pr), nSigma(pi)
4525  bins_eleptvscutvars[1] = 20;
4526  xmin_eleptvscutvars[1] = -5;
4527  xmax_eleptvscutvars[1] = 5;
4528  }else if(ih==15){
4529  //15: eta
4530  bins_eleptvscutvars[1] = 30;
4531  xmin_eleptvscutvars[1] = -1.5;
4532  xmax_eleptvscutvars[1] = 1.5;
4533  }else if(ih==16){
4534  //16: Opening angle
4535  bins_eleptvscutvars[1] = 20;
4536  xmin_eleptvscutvars[1] = 0.;
4537  xmax_eleptvscutvars[1] = 3.141592/2;
4538  }
4539 
4540  fHistoElePtvsCutVarsRS[ih] = new THnSparseF(Form("fHistoElePtvsCutVarsRS[%d]",ih),"",3,bins_eleptvscutvars,xmin_eleptvscutvars,xmax_eleptvscutvars);
4542  fHistoElePtvsCutVarsWS[ih] = new THnSparseF(Form("fHistoElePtvsCutVarsWS[%d]",ih),"",3,bins_eleptvscutvars,xmin_eleptvscutvars,xmax_eleptvscutvars);
4544  fHistoElePtvsCutVarsMCS[ih] = new THnSparseF(Form("fHistoElePtvsCutVarsMCS[%d]",ih),"",3,bins_eleptvscutvars,xmin_eleptvscutvars,xmax_eleptvscutvars);
4546  }
4547 
4548  return;
4549 }
4550 
4551 //________________________________________________________________________
4552 AliAODRecoCascadeHF* AliAnalysisTaskSELc2eleLambdafromAODtracks::MakeCascadeHF(AliAODv0 *v0, AliAODTrack *part, AliAODTrack *partpid, AliAODEvent * aod, AliAODVertex *secVert)
4553 {
4557 
4558  if(!v0) return 0x0;
4559  if(!part) return 0x0;
4560  if(!aod) return 0x0;
4561 
4562  //------------------------------------------------
4563  // PrimaryVertex
4564  //------------------------------------------------
4565  AliAODVertex *primVertexAOD;
4566  Bool_t unsetvtx = kFALSE;
4568  primVertexAOD = CallPrimaryVertex(v0,part,aod);
4569  if(!primVertexAOD){
4570  primVertexAOD = fVtx1;
4571  }else{
4572  unsetvtx = kTRUE;
4573  }
4574  }else{
4575  primVertexAOD = fVtx1;
4576  }
4577  if(!primVertexAOD) return 0x0;
4578  Double_t posprim[3]; primVertexAOD->GetXYZ(posprim);
4579 
4580  //------------------------------------------------
4581  // DCA between tracks
4582  //------------------------------------------------
4583  AliESDtrack *esdtrack = new AliESDtrack((AliVTrack*)partpid);
4584 
4585  AliNeutralTrackParam *trackV0=NULL;
4586  const AliVTrack *trackVV0 = dynamic_cast<const AliVTrack*>(v0);
4587  if(trackVV0) trackV0 = new AliNeutralTrackParam(trackVV0);
4588 
4589  Double_t xdummy, ydummy;
4590  Double_t dca = esdtrack->GetDCA(trackV0,fBzkG,xdummy,ydummy);
4591 
4592 
4593  //------------------------------------------------
4594  // Propagate all tracks to the secondary vertex and calculate momentum there
4595  //------------------------------------------------
4596 
4597  Double_t d0z0bach[2],covd0z0bach[3];
4598  if(sqrt(pow(secVert->GetX(),2)+pow(secVert->GetY(),2))<1.){
4599  part->PropagateToDCA(secVert,fBzkG,kVeryBig,d0z0bach,covd0z0bach);
4600  trackV0->PropagateToDCA(secVert,fBzkG,kVeryBig);
4601  }else{
4602  part->PropagateToDCA(primVertexAOD,fBzkG,kVeryBig,d0z0bach,covd0z0bach);
4603  trackV0->PropagateToDCA(primVertexAOD,fBzkG,kVeryBig);
4604  }
4605  Double_t momv0_new[3]={-9999,-9999,-9999.};
4606  trackV0->GetPxPyPz(momv0_new);
4607 
4608  Double_t px[2],py[2],pz[2];
4609  px[0] = part->Px(); py[0] = part->Py(); pz[0] = part->Pz();
4610  px[1] = momv0_new[0]; py[1] = momv0_new[1]; pz[1] = momv0_new[2];
4611 
4612  //------------------------------------------------
4613  // d0
4614  //------------------------------------------------
4615  Double_t d0[3],d0err[3];
4616 
4617  part->PropagateToDCA(primVertexAOD,fBzkG,kVeryBig,d0z0bach,covd0z0bach);
4618  d0[0]= d0z0bach[0];
4619  d0err[0] = TMath::Sqrt(covd0z0bach[0]);
4620 
4621  Double_t d0z0v0[2],covd0z0v0[3];
4622  trackV0->PropagateToDCA(primVertexAOD,fBzkG,kVeryBig,d0z0v0,covd0z0v0);
4623  d0[1]= d0z0v0[0];
4624  d0err[1] = TMath::Sqrt(covd0z0v0[0]);
4625 
4626  //------------------------------------------------
4627  // Create AliAODRecoCascadeHF
4628  //------------------------------------------------
4629  Short_t charge = part->Charge();
4630  AliAODRecoCascadeHF *theCascade = new AliAODRecoCascadeHF(secVert,charge,px,py,pz,d0,d0err,dca);
4631  if(!theCascade)
4632  {
4633  if(unsetvtx) delete primVertexAOD; primVertexAOD=NULL;
4634  if(esdtrack) delete esdtrack;
4635  if(trackV0) delete trackV0;
4636  return 0x0;
4637  }
4638  theCascade->SetOwnPrimaryVtx(primVertexAOD);
4639  UShort_t id[2]={(UShort_t)part->GetID(),(UShort_t)trackV0->GetID()};
4640  theCascade->SetProngIDs(2,id);
4641 
4642  theCascade->GetSecondaryVtx()->AddDaughter(part);
4643  theCascade->GetSecondaryVtx()->AddDaughter(v0);
4644 
4645  if(unsetvtx) delete primVertexAOD; primVertexAOD=NULL;
4646  if(esdtrack) delete esdtrack;
4647  if(trackV0) delete trackV0;
4648 
4649  return theCascade;
4650 }
4651 
4652 //________________________________________________________________________
4653 AliAODVertex* AliAnalysisTaskSELc2eleLambdafromAODtracks::CallPrimaryVertex(AliAODv0 *v0, AliAODTrack *trk, AliAODEvent* aod)
4654 {
4655  //
4658  //
4659 
4660  TObjArray *TrackArray = new TObjArray(3);
4661 
4662  AliESDtrack *cptrk1 = new AliESDtrack((AliVTrack*)trk);
4663  TrackArray->AddAt(cptrk1,0);
4664 
4665  AliESDtrack *cascptrack = new AliESDtrack((AliVTrack*)v0->GetDaughter(0));
4666  TrackArray->AddAt(cascptrack,1);
4667  AliESDtrack *cascntrack = new AliESDtrack((AliVTrack*)v0->GetDaughter(1));
4668  TrackArray->AddAt(cascntrack,2);
4669 
4670  AliAODVertex *newvert = PrimaryVertex(TrackArray,aod);
4671 
4672  for(Int_t i=0;i<3;i++)
4673  {
4674  AliESDtrack *tesd = (AliESDtrack*)TrackArray->UncheckedAt(i);
4675  delete tesd;
4676  }
4677  TrackArray->Clear();
4678  delete TrackArray;
4679 
4680  return newvert;
4681 }
4682 
4683 //________________________________________________________________________
4684 AliAODVertex* AliAnalysisTaskSELc2eleLambdafromAODtracks::PrimaryVertex(const TObjArray *trkArray,
4685  AliVEvent *event)
4686 {
4687  //
4690  //
4691 
4692  Bool_t fRecoPrimVtxSkippingTrks = kTRUE;
4693  Bool_t fRmTrksFromPrimVtx = kFALSE;
4694 
4695  AliESDVertex *vertexESD = 0;
4696  AliAODVertex *vertexAOD = 0;
4697 
4698  //vertexESD = new AliESDVertex(*fV1);
4699 
4700 
4701  if(!fRecoPrimVtxSkippingTrks && !fRmTrksFromPrimVtx) {
4702  // primary vertex from the input event
4703 
4704  vertexESD = new AliESDVertex(*fV1);
4705 
4706  } else {
4707  // primary vertex specific to this candidate
4708 
4709  Int_t nTrks = trkArray->GetEntriesFast();
4710  AliVertexerTracks *vertexer = new AliVertexerTracks(event->GetMagneticField());
4711 
4712  if(fRecoPrimVtxSkippingTrks) {
4713  // recalculating the vertex
4714 
4715  if(strstr(fV1->GetTitle(),"VertexerTracksWithConstraint")) {
4716  Float_t diamondcovxy[3];
4717  event->GetDiamondCovXY(diamondcovxy);
4718  Double_t pos[3]={event->GetDiamondX(),event->GetDiamondY(),0.};
4719  Double_t cov[6]={diamondcovxy[0],diamondcovxy[1],diamondcovxy[2],0.,0.,10.*10.};
4720  AliESDVertex *diamond = new AliESDVertex(pos,cov,1.,1);
4721  vertexer->SetVtxStart(diamond);
4722  delete diamond; diamond=NULL;
4723  if(strstr(fV1->GetTitle(),"VertexerTracksWithConstraintOnlyFitter"))
4724  vertexer->SetOnlyFitter();
4725  }
4726  Int_t skipped[1000];
4727  Int_t nTrksToSkip=0,id;
4728  AliExternalTrackParam *t = 0;
4729  for(Int_t i=0; i<nTrks; i++) {
4730  t = (AliExternalTrackParam*)trkArray->UncheckedAt(i);
4731  id = (Int_t)t->GetID();
4732  if(id<0) continue;
4733  skipped[nTrksToSkip++] = id;
4734  }
4735  // TEMPORARY FIX
4736  // For AOD, skip also tracks without covariance matrix
4737  Double_t covtest[21];
4738  for(Int_t j=0; j<event->GetNumberOfTracks(); j++) {
4739  AliVTrack *vtrack = (AliVTrack*)event->GetTrack(j);
4740  if(!vtrack->GetCovarianceXYZPxPyPz(covtest)) {
4741  id = (Int_t)vtrack->GetID();
4742  if(id<0) continue;
4743  skipped[nTrksToSkip++] = id;
4744  }
4745  }
4746  for(Int_t ijk=nTrksToSkip; ijk<1000; ijk++) skipped[ijk]=-1;
4747  //
4748  vertexer->SetSkipTracks(nTrksToSkip,skipped);
4749  vertexESD = (AliESDVertex*)vertexer->FindPrimaryVertex(event);
4750 
4751  } else if(fRmTrksFromPrimVtx && nTrks>0) {
4752  // removing the prongs tracks
4753 
4754  TObjArray rmArray(nTrks);
4755  UShort_t *rmId = new UShort_t[nTrks];
4756  AliESDtrack *esdTrack = 0;
4757  AliESDtrack *t = 0;
4758  for(Int_t i=0; i<nTrks; i++) {
4759  t = (AliESDtrack*)trkArray->UncheckedAt(i);
4760  esdTrack = new AliESDtrack(*t);
4761  rmArray.AddLast(esdTrack);
4762  if(esdTrack->GetID()>=0) {
4763  rmId[i]=(UShort_t)esdTrack->GetID();
4764  } else {
4765  rmId[i]=9999;
4766  }
4767  }
4768  Float_t diamondxy[2]={static_cast<Float_t>(event->GetDiamondX()),static_cast<Float_t>(event->GetDiamondY())};
4769  vertexESD = vertexer->RemoveTracksFromVertex(fV1,&rmArray,rmId,diamondxy);
4770  delete [] rmId; rmId=NULL;
4771  rmArray.Delete();
4772 
4773  }
4774 
4775  delete vertexer; vertexer=NULL;
4776  if(!vertexESD) return vertexAOD;
4777  if(vertexESD->GetNContributors()<=0) {
4778  //AliDebug(2,"vertexing failed");
4779  delete vertexESD; vertexESD=NULL;
4780  return vertexAOD;
4781  }
4782 
4783 
4784  }
4785 
4786  // convert to AliAODVertex
4787  Double_t pos[3],cov[6],chi2perNDF;
4788  vertexESD->GetXYZ(pos); // position
4789  vertexESD->GetCovMatrix(cov); //covariance matrix
4790  chi2perNDF = vertexESD->GetChi2toNDF();
4791  delete vertexESD; vertexESD=NULL;
4792 
4793  vertexAOD = new AliAODVertex(pos,cov,chi2perNDF);
4794 
4795  return vertexAOD;
4796 }
4797 
4798 //________________________________________________________________________
4799 AliAODVertex* AliAnalysisTaskSELc2eleLambdafromAODtracks::ReconstructSecondaryVertex(AliAODv0 *v0, AliAODTrack *part, AliAODEvent * aod)
4800 {
4801  //
4802  // Reconstruct secondary vertex from trkArray (Copied from AliAnalysisVertexingHF)
4803  // Currently only returns Primary vertex (can we reconstruct secondary vertex from e - v0??)
4804  //
4805 
4806  AliAODVertex *primVertexAOD;
4807  Bool_t unsetvtx = kFALSE;
4809  primVertexAOD = CallPrimaryVertex(v0,part,aod);
4810  if(!primVertexAOD){
4811  primVertexAOD = fVtx1;
4812  }else{
4813  unsetvtx = kTRUE;
4814  }
4815  }else{
4816  primVertexAOD = fVtx1;
4817  }
4818  if(!primVertexAOD) return 0x0;
4819 
4820  AliESDVertex * vertexESD = new AliESDVertex(*fV1);
4821 
4822  Double_t pos[3],cov[6],chi2perNDF;
4823  vertexESD->GetXYZ(pos); // position
4824  vertexESD->GetCovMatrix(cov); //covariance matrix
4825  chi2perNDF = vertexESD->GetChi2toNDF();
4826  delete vertexESD; vertexESD=NULL;
4827 
4828  AliAODVertex *secVert = new AliAODVertex(pos,cov,chi2perNDF);
4829 
4830  return secVert;
4831 }
4832 //________________________________________________________________________
4833 Int_t AliAnalysisTaskSELc2eleLambdafromAODtracks::MatchToMC(AliAODRecoCascadeHF *elobj, TClonesArray *mcArray, Int_t *pdgarray_ele, Int_t *pdgarray_v0, Int_t *labelarray_ele, Int_t *labelarray_v0, Int_t &ngen_ele, Int_t &ngen_v0)
4834 {
4835  //
4836  // Match to MC
4837  //
4838  for(Int_t i=0;i<100;i++){
4839  pdgarray_ele[i] = -9999;
4840  labelarray_ele[i] = -9999;
4841  pdgarray_v0[i] = -9999;
4842  labelarray_v0[i] = -9999;
4843  }
4844  ngen_ele = 0;
4845  ngen_v0 = 0;
4846 
4847  AliVTrack *trk = dynamic_cast<AliVTrack*>(elobj->GetBachelor());
4848  if(!trk) return -1;
4849  Int_t labEle = trk->GetLabel();
4850  if(labEle<0) return -1;
4851  AliAODMCParticle *mcetrk = (AliAODMCParticle*)mcArray->At(labEle);
4852  if(!mcetrk) return -1;
4853  labelarray_ele[0] = labEle;
4854  pdgarray_ele[0] = mcetrk->GetPdgCode();
4855  ngen_ele ++;
4856 
4857  AliAODMCParticle *mcprimele=0;
4858  mcprimele = mcetrk;
4859  while(mcprimele->GetMother()>=0) {
4860  Int_t labprim_ele=mcprimele->GetMother();
4861  AliAODMCParticle *tmcprimele = (AliAODMCParticle*)mcArray->At(labprim_ele);
4862  if(!tmcprimele) {
4863  break;
4864  }
4865 
4866  mcprimele = tmcprimele;
4867  pdgarray_ele[ngen_ele] = mcprimele->GetPdgCode();
4868  labelarray_ele[ngen_ele] = labprim_ele;
4869  ngen_ele ++;
4870  if(ngen_ele==100) break;
4871  }
4872 
4873  AliAODv0 *theV0 = dynamic_cast<AliAODv0*>(elobj->Getv0());
4874  if(!theV0) return -1;
4875  Int_t pdgdgv0[2]={2212,211};
4876  Int_t labV0 = theV0->MatchToMC(3122,mcArray,2,pdgdgv0); // the V0
4877  if(labV0<0) return -1;
4878  AliAODMCParticle *mcv0 = (AliAODMCParticle*)mcArray->At(labV0);
4879  if(!mcv0) return -1;
4880  labelarray_v0[0] = labV0;
4881  pdgarray_v0[0] = mcv0->GetPdgCode();
4882  ngen_v0 ++;
4883 
4884  AliAODMCParticle *mcprimv0=0;
4885  mcprimv0 = mcv0;
4886  while(mcprimv0->GetMother()>=0) {
4887  Int_t labprim_v0=mcprimv0->GetMother();
4888  AliAODMCParticle *tmcprimv0 = (AliAODMCParticle*)mcArray->At(labprim_v0);
4889  if(!tmcprimv0) {
4890  break;
4891  }
4892 
4893  mcprimv0 = tmcprimv0;
4894  pdgarray_v0[ngen_v0] = mcprimv0->GetPdgCode();
4895  labelarray_v0[ngen_v0] = labprim_v0;
4896  ngen_v0 ++;
4897  if(ngen_v0==100) break;
4898  }
4899 
4900  Bool_t same_flag = kFALSE;
4901  Int_t matchedlabel=-9999;
4902  for(Int_t iemc=0;iemc<ngen_ele;iemc++){
4903  for(Int_t ivmc=0;ivmc<ngen_v0;ivmc++){
4904  if(labelarray_ele[iemc]==labelarray_v0[ivmc]){
4905  same_flag = kTRUE;
4906  matchedlabel = labelarray_ele[iemc];
4907  break;
4908  }
4909  }
4910  if(same_flag) break;
4911  }
4912 
4913  return matchedlabel;
4914 
4915 }
4916 //________________________________________________________________________
4917 void AliAnalysisTaskSELc2eleLambdafromAODtracks::SelectTrack( const AliVEvent *event, Int_t trkEntries, Int_t &nSeleTrks,Bool_t *seleFlags, TClonesArray *mcArray)
4918 {
4919  //
4920  // Select good tracks using fAnalCuts (AliRDHFCuts object) and return the array of their ids
4921  //
4922 
4923  if(trkEntries==0) return;
4924 
4925  nSeleTrks=0;
4926  for(Int_t i=0; i<trkEntries; i++) {
4927  seleFlags[i] = kFALSE;
4928 
4929  AliVTrack *track;
4930  track = (AliVTrack*)event->GetTrack(i);
4931 
4932  //if(track->GetID()<0) continue;
4933  Double_t covtest[21];
4934  if(!track->GetCovarianceXYZPxPyPz(covtest)) continue;
4935  if(!fAnalCuts) continue;
4936 
4937 
4938  AliAODTrack *aodt = (AliAODTrack*)track;
4939 
4941  Int_t filterbit = fAnalCuts->GetProdAODFilterBit();
4942  if(filterbit==7){
4943  if(!aodt->TestFilterBit(BIT(filterbit))) continue;
4944  }else{
4945  if(!aodt->TestFilterMask(BIT(filterbit))) continue;
4946  }
4947  }
4948 
4949  AliAODTrack *aodtpid = 0;
4950  if(fAnalCuts->GetProdAODFilterBit()==7){
4951  aodtpid = fGTI[-aodt->GetID()-1];
4952  }else{
4953  aodtpid = aodt;
4954  }
4955 
4956  Double_t nsigma_tpcele = -9999;
4957  Double_t nsigma_tofele = -9999;
4958  if(fAnalCuts->GetIsUsePID()){
4959  nsigma_tpcele = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTPC(aodtpid,AliPID::kElectron);
4960  nsigma_tofele = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTOF(aodtpid,AliPID::kElectron);
4961  }
4962 
4963  if(fAnalCuts->SingleTrkCutsNoPID(aodt,aodtpid,fVtx1)){
4964  fHistoElectronTPCPID->Fill(aodt->Pt(),nsigma_tpcele);
4965  fHistoElectronTOFPID->Fill(aodt->Pt(),nsigma_tofele);
4966  if(fabs(nsigma_tofele)<3.){
4967  fHistoElectronTPCPIDSelTOF->Fill(aodt->Pt(),nsigma_tpcele);
4968  Double_t eleeta = aodt->Eta();
4969  if(fabs(eleeta)<0.6)
4970  fHistoElectronTPCPIDSelTOFSmallEta->Fill(aodt->Pt(),nsigma_tpcele);
4971  if(fabs(eleeta)>0.6 && fabs(eleeta)<0.8)
4972  fHistoElectronTPCPIDSelTOFLargeEta->Fill(aodt->Pt(),nsigma_tpcele);
4973  if(eleeta>-0.8 && eleeta<-0.6){
4974  fHistoElectronTPCPIDSelTOFEtaDep[0]->Fill(aodt->Pt(),nsigma_tpcele);
4975  }else if(eleeta>-0.6&&eleeta<-0.4){
4976  fHistoElectronTPCPIDSelTOFEtaDep[1]->Fill(aodt->Pt(),nsigma_tpcele);
4977  }else if(eleeta>-0.4&&eleeta<-0.2){
4978  fHistoElectronTPCPIDSelTOFEtaDep[2]->Fill(aodt->Pt(),nsigma_tpcele);
4979  }else if(eleeta>-0.2&&eleeta<0.0){
4980  fHistoElectronTPCPIDSelTOFEtaDep[3]->Fill(aodt->Pt(),nsigma_tpcele);
4981  }else if(eleeta>0.0&&eleeta<0.2){
4982  fHistoElectronTPCPIDSelTOFEtaDep[4]->Fill(aodt->Pt(),nsigma_tpcele);
4983  }else if(eleeta>0.2&&eleeta<0.4){
4984  fHistoElectronTPCPIDSelTOFEtaDep[5]->Fill(aodt->Pt(),nsigma_tpcele);
4985  }else if(eleeta>0.4&&eleeta<0.6){
4986  fHistoElectronTPCPIDSelTOFEtaDep[6]->Fill(aodt->Pt(),nsigma_tpcele);
4987  }else if(eleeta>0.6&&eleeta<0.8){
4988  fHistoElectronTPCPIDSelTOFEtaDep[7]->Fill(aodt->Pt(),nsigma_tpcele);
4989  }
4990  }
4991  }
4992 
4993  if(fAnalCuts->